CN116760632A - Data processing method, device, equipment and readable storage medium - Google Patents

Data processing method, device, equipment and readable storage medium Download PDF

Info

Publication number
CN116760632A
CN116760632A CN202311006036.6A CN202311006036A CN116760632A CN 116760632 A CN116760632 A CN 116760632A CN 202311006036 A CN202311006036 A CN 202311006036A CN 116760632 A CN116760632 A CN 116760632A
Authority
CN
China
Prior art keywords
sub
chain
block
consensus
verification
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202311006036.6A
Other languages
Chinese (zh)
Other versions
CN116760632B (en
Inventor
朱耿良
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202311006036.6A priority Critical patent/CN116760632B/en
Publication of CN116760632A publication Critical patent/CN116760632A/en
Application granted granted Critical
Publication of CN116760632B publication Critical patent/CN116760632B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/12Applying verification of the received information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/40Network security protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/46Secure multiparty computation, e.g. millionaire problem

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data processing method, a device, equipment and a readable storage medium based on a hierarchical chain network, which comprises the following steps: writing the first sub-chain block and the block execution result into the first sub-chain; transmitting the first sub-chain block and the block execution result to a scheduling node so that the scheduling node transmits the first sub-chain block and the block execution result to a first verification node cluster; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result generated by the first verification node cluster is that the consensus passes; when the block containing the first block information is stored in the main chain corresponding to the consensus network, the first sub-chain block is determined to belong to the block of which the main chain is verified. By adopting the application, the technical and resource burden of sub-link consensus in the hierarchical link network can be reduced, and the difficulty of verifying the correctness of the sub-link data by the consensus network can be reduced.

Description

Data processing method, device, equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device and readable storage medium based on a hierarchical chain network.
Background
In some hierarchical blockchain corresponding network architectures, one or more traffic networks and a core consensus network may be generally included. Each service network may independently operate a local consensus network, where the local consensus network is configured to process service data sent by service nodes in the corresponding service network, for example, block-packing the service data, and writing the packed block into a sub-chain maintained by the local consensus network. The core consensus network is used for running a core main chain and is a main chain service corresponding to the whole blockchain network, and when the sub-chain corresponding to the service network is created, related information is recorded in the core main chain.
In practice, the inventor finds that in the existing local consensus mode of the hierarchical blockchain, when a new service network is accessed, the new local consensus network needs to be built by itself, and the architecture has a larger resource burden and technical burden for the service parties in the hierarchical blockchain. In addition, it is also difficult for the core consensus network to verify the correctness of the data returned from the local consensus network, and it is necessary to try to trust the data forwarding relay, or trust all verifiers in the local consensus network, and the core consensus network has a greater concern about local consensus data errors or dislikes.
Disclosure of Invention
The embodiment of the application provides a data processing method, device and equipment based on a hierarchical chain network and a readable storage medium, which can reduce the technical and resource burden of sub-chain consensus in the hierarchical chain network and reduce the difficulty of verifying the correctness of the sub-chain data by the consensus network.
In one aspect, the embodiment of the application provides a data processing method based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a scheduling node, a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
when service data sent by a service node in a first service network is obtained, the service data is packed into a first sub-chain block, the first sub-chain block is executed, and a block execution result is obtained;
writing the first sub-chain block and the block execution result into a first sub-chain corresponding to a first service network;
transmitting the first sub-chain block and the block execution result to a scheduling node so that the scheduling node transmits the first sub-chain block and the block execution result to a first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the first sub-chain block and the block execution result; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes;
When the block containing the first block information is stored in the main chain corresponding to the consensus network, the first sub-chain block in the first sub-chain is determined to belong to the block with the verified main chain.
In one aspect, the embodiment of the application provides a data processing method based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
receiving a block execution result corresponding to the first sub-chain block; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
determining a first verification node cluster associated with a first sub-chain corresponding to a first service network in a consensus network;
the first sub-chain block and the block execution result corresponding to the first sub-chain block are sent to a first verification node cluster, so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into the block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
In one aspect, the embodiment of the application provides a data processing method based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
receiving a verification result sent by a first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
if the verification result is that the consensus passes, adding first block information corresponding to the first sub-chain block to a block information set to be packaged;
generating combined consensus data according to the block information set to be packaged;
packaging the combined consensus data to a main chain block, and initiating a consensus request for the main chain block to a consensus node cluster so that the consensus node cluster performs block consensus on the main chain block according to the consensus request to obtain a consensus result;
If the consensus result is that the consensus passes, the main chain block is written into the main chain corresponding to the consensus network.
In one aspect, the embodiment of the application provides a data processing device based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a scheduling node, a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
the acquisition module is used for packaging the service data into a first sub-chain block when acquiring the service data sent by the service node in the first service network, and executing the first sub-chain block to obtain a block execution result;
the first writing module is used for writing the first sub-chain block and the block execution result into a first sub-chain corresponding to the first service network;
the first sending module is used for sending the first sub-chain block and the block execution result to the scheduling node so that the scheduling node sends the first sub-chain block and the block execution result to the first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the first sub-chain block and the block execution result; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes;
And the first determining module is used for determining that the first sub-chain block in the first sub-chain belongs to the block with the verified main chain when the block containing the first block information is stored in the main chain corresponding to the consensus network.
Wherein, above-mentioned data processing apparatus still includes:
the block receiving module is used for receiving a main chain block corresponding to the consensus network and synchronizing the main chain block in the main chain corresponding to the consensus network; the main chain block is a block which is commonly recognized by the commonly recognized node cluster;
the first block determining module is used for determining that a block containing the first block information is stored in a main chain corresponding to the consensus network if the first block information is found in the main chain block;
and the second block determining module is used for determining that the block containing the first block information is not stored in the main chain corresponding to the consensus network if the first block information is not found in the main chain block.
Wherein, above-mentioned data processing apparatus still includes:
the data acquisition module is used for determining that the first block information is not found in the main chain block if the combined consensus data is not acquired in the main chain block; the merging consensus data comprises block information of sub-chain blocks respectively corresponding to one or more service networks contained in the hierarchical chain network.
Wherein, above-mentioned data processing apparatus still includes:
the searching module is used for searching the block information of the combined consensus data if the combined consensus data is acquired from the main chain block;
the information determining module is used for determining that the first block information is not found in the main chain block if the first block information is not found in the combined consensus data;
the information determining module is further configured to determine that the first block information is found in the main block if the first block information is found in the merged common data.
The first block information comprises a first block hash corresponding to a first sub-chain block; the merging consensus data comprises a merck tree and a sub-chain bitmap; the merck tree is generated by the consensus node cluster according to block hashes respectively corresponding to one or more sub-chain blocks through which the verification result passes; the sub-link bitmap comprises a sub-link identifier corresponding to each sub-link contained in the hierarchical link network and a marking state corresponding to each sub-link identifier; a sub-chain identification for uniquely identifying a sub-chain;
a lookup module comprising:
the first determining unit is used for determining that the first block information is not found in the merging consensus data if the marked state corresponding to the target sub-chain mark is the unmarked state according to the sub-chain bitmap; the target sub-chain identifier is a sub-chain identifier corresponding to the first sub-chain;
The hash acquisition unit is used for acquiring K Merker tree node hashes associated with the target sub-chain identification from the Merker tree if the marked state corresponding to the target sub-chain identification is determined to be the marked state through the sub-chain bitmap, wherein K is a positive integer;
the hash verification unit is used for verifying the merck node of the first block hash according to the K merck node hashes and the merck root hashes corresponding to the merck trees to obtain a verification result;
the second determining unit is used for determining that the first block information is found in the combined consensus data if the verification result is a verification passing result;
and the second determining unit is further used for determining that the first block information is not found in the combined consensus data if the verification result is a verification failure result.
The hash verification unit is specifically configured to sequentially obtain the i-th merck tree node hash according to tree node positions corresponding to the K merck tree node hashes in the merck tree; i is a positive integer less than or equal to K; performing hash operation on the ith merck tree node hash and the (i-1) th verification hash to obtain the ith verification hash, and comparing the kth verification hash with the merck tree root hash until the kth verification hash is obtained; when i is 1, the i-1 th verification hash is a first block hash; if the Kth verification hash is different from the Merker tree root hash, determining that the verification result is a verification failure result; if the Kth verification hash is the same as the Merker tree root hash, determining that the verification result is a verification passing result.
In one aspect, the embodiment of the application provides a data processing device based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
the first receiving module is used for receiving the first sub-chain block and a block execution result corresponding to the first sub-chain block; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
a second determining module, configured to determine, in a consensus network, a first verification node cluster associated with a first sub-chain corresponding to a first service network;
the second sending module is used for sending the first sub-chain block and the block execution result corresponding to the first sub-chain block to the first verification node cluster so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into the block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
Wherein the consensus network further comprises a verification node cluster; the first verification node cluster belongs to the verification node cluster;
a second determination module comprising:
a table acquisition unit for acquiring a sub-chain verification mapping table; the sub-chain verification mapping table comprises one or more sub-chain identifiers and verification nodes associated with each sub-chain identifier; each verification node belongs to a verification node cluster; the number of sub-chain identifications associated with one verification node is one or more;
and the cluster determining unit is used for determining the verification node associated with the first sub-chain identifier corresponding to the first sub-chain in the sub-chain verification mapping table as a first verification node cluster.
The verification node cluster comprises a first verification node; the first verification node associates H sub-link identifiers in a sub-link verification mapping table, wherein H is a positive integer;
the above data processing apparatus further includes:
the node scheduling module is used for acquiring the computational power resource occupation information in the consensus operation period, which is sent by the first verification node;
the node scheduling module is further used for acquiring a target sub-chain identifier from the H sub-chain identifiers if the calculation power resource occupation information exceeds a first calculation power threshold;
the node scheduling module is also used for selecting a second verification node from the verification node cluster; the computational power resource occupation information of the second verification node in the consensus operation period is lower than a second computational power threshold value; the first computational force threshold is greater than the second computational force threshold;
And the node scheduling module is also used for updating the first verification node associated with the target sub-chain identification into the second verification node in the sub-chain verification mapping table.
Wherein the hierarchical chain network further comprises a second service network; the second service network is independent of the consensus network;
the above data processing apparatus further includes:
the node allocation module is used for receiving a verification node cluster allocation request aiming at the second service network; verifying that the node cluster allocation request comprises a second sub-link identifier corresponding to a second sub-link corresponding to the second service network;
the node allocation module is also used for determining the node allocation quantity according to the verification node cluster allocation request;
the node distribution module is further used for selecting verification nodes corresponding to the node distribution number from the verification node clusters to serve as second verification node clusters;
the node allocation module is further configured to record, in the sub-link verification mapping table, an association relationship between the second sub-link identifier and the second verification node cluster.
In one aspect, the embodiment of the application provides a data processing device based on a hierarchical link network, wherein the hierarchical link network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
The second receiving module is used for receiving the verification result sent by the first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
the adding module is used for adding the first block information corresponding to the first sub-chain block to the block information set to be packaged if the verification result is that the consensus passes;
the generation module is used for generating combined consensus data according to the block information set to be packaged;
the consensus module is used for packaging the combined consensus data to a main chain block, and initiating a consensus request for the main chain block to the consensus node cluster so that the consensus node cluster performs block consensus on the main chain block according to the consensus request to obtain a consensus result;
and the second writing module is used for writing the main chain block into the main chain corresponding to the consensus network if the consensus result is that the consensus passes.
The block information set to be packaged comprises M block hashes, wherein M is a positive integer; the M block hashes include a first block hash; the first block hash belongs to first block information; the sub-chain identifiers corresponding to the M block hashes are different; the sub-chain identifier is used for uniquely identifying a sub-chain corresponding to a service network; each service network belongs to a hierarchical chain network;
A generation module, comprising:
the bitmap generation unit is used for generating a sub-chain bitmap according to the sub-chain identifiers respectively corresponding to the M pieces of block information;
the tree generating unit is used for generating merck trees corresponding to the M block information according to the position sequence of the sub-chain identifiers corresponding to the M block information in the sub-chain bitmap; the merck tree includes a merck tree root;
and the data generation unit is used for generating the combined consensus data according to the sub-chain bitmap and the merck tree root.
The hierarchical chain network comprises N service networks, wherein N is a positive integer greater than or equal to M; the service networks corresponding to the M block hashes belong to N service networks;
a bitmap generation unit comprising:
a diagram acquisition subunit, configured to acquire an initial sub-chain bitmap; the initial sub-link bitmap comprises sub-link identifiers corresponding to the N service networks respectively and marking states corresponding to the sub-link identifiers; the marking state corresponding to each sub-chain mark in the initial sub-chain bitmap is an unmarked state;
and the map updating subunit is used for updating the marking states corresponding to the sub-chain identifiers corresponding to the M pieces of block information respectively in the initial sub-chain bitmap into marking states to obtain the sub-chain bitmap.
Wherein, above-mentioned data processing apparatus still includes:
The sub-chain data query module is used for receiving a data query request aiming at the first sub-chain; the first sub-chain is a sub-chain corresponding to the first sub-chain block; the data query request comprises a first sub-chain identifier corresponding to the first sub-chain;
the sub-chain data query module is also used for determining a query verification node according to the first sub-chain identification and forwarding a data query request to the query verification node; the query verification node belongs to a first verification node cluster; the verification nodes in the first verification node cluster are all stored with a first sub-chain;
and the sub-chain data query module is also used for receiving a data query result returned by the query verification node according to the data query request.
In one aspect, an embodiment of the present application provides a computer device, including: a processor, a memory, a network interface;
the processor is connected to the memory and the network interface, where the network interface is used to provide a data communication network element, the memory is used to store a computer program, and the processor is used to call the computer program to execute the method in the embodiment of the present application.
In one aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored therein, the computer program being adapted to be loaded by a processor and to perform a method according to embodiments of the present application.
In one aspect, embodiments of the present application provide a computer program product or computer program comprising computer instructions stored in a computer-readable storage medium, the computer instructions being read from the computer-readable storage medium by a processor of a computer device, the computer instructions being executed by the processor, causing the computer device to perform a method according to an embodiment of the present application.
In the embodiment of the application, the unified consensus verification of the sub-chain blocks corresponding to the first service network is completed by the first verification node cluster in the consensus network, the first service network is not required to self-establish the consensus network, the technical and resource burden of sub-chain consensus in the hierarchical chain network can be reduced, in addition, the block information corresponding to the sub-chain blocks needs to be recorded in the main chain, the correctness of the sub-chain blocks can be verified directly through the block information in the main chain, and the difficulty of verifying the correctness of the sub-chain data by the consensus network can be reduced.
Drawings
In order to more clearly illustrate the embodiments of the application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, it being obvious that the drawings in the following description are only some embodiments of the application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a hierarchical architecture of a blockchain network provided by an embodiment of the present application;
FIG. 2 is a schematic diagram of a hierarchical chain network according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of a data processing method based on a hierarchical chain network according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a data structure of a main chain block according to an embodiment of the present application;
FIG. 5 is a schematic diagram of a merck node verification provided by an embodiment of the present application;
FIG. 6 is a schematic flow chart of another data processing method based on a hierarchical chain network according to an embodiment of the present application;
FIG. 7 is a flowchart of another data processing method based on a hierarchical chain network according to an embodiment of the present application;
FIG. 8 is a schematic diagram of a data processing apparatus based on a hierarchical chain network according to an embodiment of the present application;
FIG. 9 is a schematic diagram of another data processing apparatus based on a hierarchical chain network according to an embodiment of the present application;
FIG. 10 is a schematic diagram of a data processing apparatus based on a hierarchical chain network according to an embodiment of the present application;
FIG. 11 is a schematic diagram of a computer device according to an embodiment of the present application;
FIG. 12 is a block diagram of a data processing system based on a hierarchical chain network in accordance with an embodiment of the present application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
Referring to fig. 1, fig. 1 is a schematic diagram of a hierarchical structure of a blockchain network according to an embodiment of the present application. The hierarchical structure shown in fig. 1 is applied to a blockchain electronic bill system, and a blockchain network corresponding to the blockchain electronic bill system comprises a business network deployed in a public network and a consensus network (also called witness network) deployed in a private cloud. As shown in fig. 1, the service network herein may be the service network 100a shown in fig. 1, and the consensus network herein may be the consensus network 200a shown in fig. 1.
In the service network 100a shown in fig. 1, a plurality of service nodes are deployed, where the plurality of service nodes may specifically include the service node 110a, the service node 110b, the service node 110c, the service node 110d, the service node 110e, the service node 110f, the service nodes 110g, …, and the service node 110n shown in fig. 1. It should be noted, however, that the number of service nodes deployed in the service network 100a will not be limited. As shown in fig. 1, for each service node operating in the service network 100a, the above-mentioned consensus network may be accessed through a network communication, and the number of consensus networks that each service object accesses through the corresponding service node will not be limited here.
It should be appreciated that in the consensus network 200a shown in fig. 1, a plurality of consensus nodes are deployed, where the plurality of consensus nodes may specifically include the consensus node 11a, the consensus node 11b, the consensus node 11c, and the consensus node 11d shown in fig. 1. It should be noted that the number of consensus nodes deployed in the consensus network 200a is not limited here. Further, as shown in FIG. 1, for a plurality of consensus nodes operating in the consensus network 200a, the commonly maintained blockchain is specifically blockchain 11e shown in FIG. 1.
For ease of understanding, the service nodes and the consensus nodes in the blockchain electronic bill system may be collectively referred to as blockchain nodes (simply referred to as nodes), and the consensus network 200a participating in the blockchain electronic bill system may be referred to as a core consensus network (or a global consensus network), and each node in the core consensus network may be collectively referred to as a core node or a core consensus node. It can be understood that in the blockchain electronic bill system, the service network and the core consensus network can interact through a route boundary, and as the core consensus network is in a relatively safe private cloud, the mutual access of the core consensus network and the core consensus network can ensure the safety by a consensus mechanism without adding additional identity management and network control. The service node is in the public network and may be accessed by other uncertain network terminals, so that the behavior of the service node and other possible nodes in the access core consensus network needs to be strictly controlled.
It should be understood that the blockchain (such as blockchain 11 e) according to the embodiments of the present application is a novel application mode of computer technologies such as distributed data storage, peer-to-peer transmission, a consensus mechanism, and an encryption algorithm, and is mainly used for sorting data in time sequence, encrypting the data into an account book, so that the account book cannot be tampered and forged, and meanwhile, performing verification, storage, and update of the data. A blockchain is essentially a de-centralized database in which each node stores one and the same blockchain.
For example, the blockchain stored on each node (e.g., the core nodes such as the consensus node 11a, the consensus node 11b, the consensus node 11c, and the consensus node 11 d) in the consensus network 200a is the blockchain 11e, where the blockchain 11e may also be referred to as the main chain (also referred to as the core main chain, the core chain, and the core consensus main chain) in the blockchain electronic ticket system, and the consensus network 200a may also be referred to as the core consensus network (also referred to as the global consensus network), and a consensus mechanism in the core consensus network may be used to take a certain consensus node selected from the consensus nodes as the core consensus node.
In the above-mentioned blockchain electronic bill system, the core node may be responsible for the consensus in the core consensus network where the corresponding blockchain is located, that is, the core node may be the consensus node in the core consensus network where the corresponding blockchain is located. For the core consensus network, a specific process of writing service data in the core consensus network into a corresponding blockchain ledger (e.g. a distributed database) may be that a user client sends service data to a certain service node, and then the service data is transferred between service nodes in the service network in the blockchain network in a baton manner until a consensus node (e.g. a consensus node 11b in a consensus network 200 a) in the core consensus network receives the service data, at this time, the consensus node (e.g. a consensus node 11b in a consensus network 200 a) packages the service data into blocks again, so that a following consensus can be performed between other consensus nodes, and thus after the consensus passes, the block through which the consensus passes can be written into the distributed database of the core consensus network (e.g. a consensus network 200 a) where the consensus is located.
It will be appreciated, among other things, that in the above-described blockchain electronic ticket system, an intelligent contract may be deployed on the blockchain of the core consensus network, which in the blockchain electronic ticket system may be understood as a code executed by blockchain nodes (i.e., consensus nodes) through which any logic may be executed and the result obtained. For example, a user may invoke an intelligent contract already deployed on a blockchain (e.g., blockchain 11 e) of a corresponding core consensus network (e.g., consensus network 200a described above) by initiating a transaction request via a user client.
Specifically, a service node in the service network may send the service request to a consensus node (e.g., consensus node 11a shown in fig. 1) in the corresponding core consensus network, so as to authenticate the user sending the service request through a chain entry of the corresponding core consensus network, and allow the service request sent by the user to be sent to other consensus nodes (e.g., consensus node 11b shown in fig. 1) in the corresponding core consensus network when the authentication is successful, so as to invoke intelligent contracts running in the consensus nodes (e.g., consensus nodes 11a and 11b shown in fig. 1) to execute the service requested by the user.
It should be appreciated that one or more intelligent contracts may be deployed on a blockchain (e.g., blockchain 11 e) of the core consensus network (e.g., consensus network 200 a) that may be distinguished by contract invocation addresses, contract identification numbers (Identity document, IDs), or contract names, and that the user client-initiated service requests may also carry the contract invocation addresses or contract identification numbers or contract names of the intelligent contracts to specify the intelligent contracts that need to be run.
It should be appreciated that in the blockchain electronic ticket system described above, a peer-to-peer network may be formed between any two blockchain nodes in a consensus network (e.g., consensus network 200 a), the protocol employed by the peer-to-peer network being an application layer protocol running on top of the transmission control protocol (TCP, transmission Control Protocol) protocol. In a distributed system, any device, such as a server, terminal, etc., may be added as blockchain nodes, where each blockchain node may include a hardware layer, a middle layer, an operating system layer, and an application layer.
Further, based on the above hierarchical structure of the blockchain network, the embodiment of the present application further provides a hierarchical chain network, where the hierarchical chain network includes one or more service networks including ledger service nodes and a consensus network (such as the core consensus network described in fig. 1 above). Wherein the consensus network is independent of the one or more service networks, the consensus network comprising a consensus node cluster and a verification node cluster. The account book service node is used for maintaining sub-chains (also called local consensus sub-chains), the verification node cluster is used for completing the decentralization verification of different sub-chains, and the consensus node cluster is used for maintaining a main chain. The ledger-paper service node may be located in the service network shown in fig. 1, and the sub-chains may also be called local sub-chains, local consensus sub-chains, local chains, etc. The cluster of consensus nodes and the cluster of verification nodes in the consensus network may be located in the consensus network shown in fig. 1 described above, and the backbone may also be referred to as a global consensus chain, a core consensus chain, a core backbone, etc. It may be understood that one or more ledger service nodes for processing regional services may be corresponding to the consensus network, that is, the number of ledger service nodes corresponding to the consensus network may be one or more, that is, the number of sub-chains under the main chain may be one or more, each ledger service node may be used to process service data submitted by service nodes under one region (or service environment), different ledger service nodes may be used to process service data submitted by service nodes under a corresponding region, and the consensus network may be used to process global service data and a merged consensus request for sub-chain blocks submitted by a verification node cluster. It should be appreciated that in a hierarchical chain maintained by the hierarchical chain network, only traffic data associated with that sub-chain is typically stored on one sub-chain, i.e., traffic data associated with traffic nodes in different areas (or under different traffic environments) is stored on different sub-chains. For example, in the electronic bill system, a consensus network (also called a global consensus network or a core consensus network) may be used to perform global bill service processing, and a sub-chain may be deployed under the consensus network for a plurality of areas (such as a plurality of provincial areas under a global area), each account service node may be used to perform data interaction with a service node in a corresponding area, and perform service processing in the area, such as each account service node may be used to process credit check service, bill red impact service, and so on in each area. The ledger service node for performing service processing in the provincial area may also be referred to as a provincial local ledger service node, a network formed by service nodes in a service environment where the provincial local ledger service node is located may be referred to as a provincial local service network, and a sub-chain maintained by the provincial local ledger service node may be referred to as a provincial local sub-chain.
For ease of understanding, please refer to fig. 2, fig. 2 is a schematic structural diagram of a hierarchical chain network according to an embodiment of the present application. As shown in fig. 2, the hierarchical chain network may include a service network 201, a service network 202, and a consensus network 203 (also referred to as a global consensus network or a core consensus network). The corresponding area or service environment between the service network 201 and the service network 202 may be different, which all belong to the service network shown in fig. 1, and it should be understood that other service networks may be also included in the hierarchical chain network. The ledger service node 21 is deployed in the service network 201, and a main chain SPV ledger and a lightweight sub-chain engine may be integrally installed in the ledger service node 21, where the main chain SPV ledger is used to complete synchronization of the main chain ledger and related interaction with the main chain (also called a core main chain), and the lightweight sub-chain engine may be regarded as a single blockchain generation service, may be used to maintain local sub-chains (also called sub-chains), and process service data submitted by service nodes in a corresponding area. It may be understood that in the hierarchical chain network, one or more service networks may be included, where each service network is configured with an account service node, where the account service node is used to process service data of a corresponding area, and only the service network 201 corresponding to the service environment a and the account service node 21 included therein are described as an example, and other service networks corresponding to other service environments and account service nodes, such as the service network 202 corresponding to the service environment B and the account service node 22 included therein, may refer to related descriptions of the service network 201 and the account service node 21, which are not described herein.
As shown in fig. 2, the consensus node cluster 23 in the consensus network 203 may be used to maintain a backbone (also called a core backbone) in a hierarchical chain and perform global service processing, such as global electronic bill service processing, where the consensus node cluster 23 (also called a global consensus node cluster) may include a plurality of consensus nodes (also called global consensus nodes, core consensus nodes), for example, a consensus node 23a, a consensus node 23b, a consensus node 23c, and a consensus node 23d shown in fig. 2. The authentication node cluster 24 in the consensus network 203 may be used to facilitate the consensus authentication of the sub-chain, and the authentication node cluster 24 may include a plurality of authentication nodes, such as the authentication node 24a, the authentication node 24b, the authentication node 24c, and the authentication node 24d shown in fig. 2. When the number of authentication nodes included in the authentication node cluster 24 is sufficiently large, common authentication may be performed for the sub-chains corresponding to the plurality of service networks, and at this time, a scheduling node 25 (may also be referred to as an authenticator scheduler) may be disposed in the common network 203, and the scheduling node 25 may be used to schedule a large number of authentication nodes. The verifying node in the verifying node cluster 24 may detect different sub-ledgers, that is, different verifying nodes may be responsible for the common-knowledge verification of different sub-chains, and when the computing power resource of the verifying node is enough, may also be responsible for the common-knowledge verification of multiple sub-chains, for example, the verifying node 24a shown in fig. 2 may detect the a sub-ledgers and the B sub-ledgers, and the verifying node 24C may detect the a sub-ledgers and the C sub-ledgers, that is, the verifying node 24a needs to be responsible for the common-knowledge verification of the a sub-chains and the B sub-chains, and the verifying node 24C needs to be responsible for the common-knowledge verification of the a sub-chains and the C sub-chains. The a sub-chain may be a sub-chain corresponding to the service network 201, the B sub-chain may be a sub-chain corresponding to the service network 202, and the C sub-chain may be a sub-chain corresponding to other service networks. It will be appreciated that the authentication nodes responsible for the common authentication of the same sub-chain may form a cluster of authentication nodes corresponding to the sub-chain, e.g. authentication node 24a, authentication node 24b and authentication node 24c shown in fig. 2 may all belong to a cluster of authentication nodes corresponding to the sub-chain a.
It will be appreciated that the sub-links maintained by the ledger wall service nodes comprised by the service network may be registered on the backbone maintained by the consensus network, thereby enabling a hierarchical link network to be obtained which is comprised of the service network and the consensus network where the registration was successful. It will be appreciated that when registering a sub-chain on the backbone, the business object may send registration business data and configuration business data for the sub-chain to the core consensus node to activate the ledger service node, and may create an creation block in the sub-chain on the ledger service node to start the sub-chain, thereby completing creation of the sub-chain. The account book service node can synchronously write in a target consensus block with registration service data from a main chain, wherein the registration service data is service data for applying for a booklet chain to a core consensus node, the target consensus block also comprises configuration service data corresponding to the registration service data, the configuration service data carries a chain identifier of a sub-chain (such as a chain identifier L1 of the sub-chain) and configuration information of an creation block on the sub-chain, then the configuration information is obtained from the target consensus block, and after the configuration information is successfully verified, the creation block is created in the account book service node and the sub-chain is started based on the creation block. When a sub-chain is started for the first time, a corresponding verification node cluster is also required to be allocated for the sub-chain, and after receiving a verification node cluster allocation request carrying the chain identification of the sub-chain, a scheduling node in the consensus network selects part of verification nodes in the verification node cluster as the verification node cluster corresponding to the sub-chain.
It will be appreciated that ledger wall service node 21 may interact with consensus network 203, thereby constructing a secure and efficient traffic flow system on the premise that the ledger wall service node and consensus network cooperate with each other. It can be understood that the electronic bill system based on the structure of the hierarchical chain network can be beneficial to hierarchical business management, can ensure that each region operates business at the level of the region relatively independently, and does not need to collect the traffic of the whole business alliance to the global consensus chain. On the premise of data isolation, service privacy isolation and legal compliance, the global consensus network can be ensured not to bear a large amount of subdivision services, and the method is focused on critical tasks and global management.
It can be understood that the service data submitted to the ledger wall service node is not forwarded to the consensus node cluster in the consensus network, but only needs to be locally packed in the ledger wall service node to be in the sub-chain block, and then is written into the sub-chain in the ledger wall service node after being executed by the ledger wall service node. However, at this time, the sub-chain block corresponding to the sub-chain block is not recognized by the main chain, that is, the sub-chain block is not reliable enough, the sub-chain block also needs to be subjected to common-identification verification in a corresponding verification node cluster in the common-identification network, after the common identification of the sub-chain block by the verification node cluster is passed, the verification node cluster may submit a merging common-identification request carrying the block information of the sub-chain block and the sub-chain common-identification result to the common-identification node cluster, and perform merging common-identification with the main chain to form a common-identification block, that is, when the common-identification result of the sub-chain cluster is determined to be the common-identification passing result, the block information corresponding to the sub-chain block is packed into the block generated by the common-identification node cluster. For example, the ledger service node 21 may execute a lottery service based on an electronic ticket, after the ledger service node 21 receives lottery service data submitted by service nodes in a corresponding area, the ledger service node 21 does not forward each lottery service data to a common node cluster in a common network, but autonomously processes the lottery service data, and then writes a corresponding lottery result into a sub-chain, but the lottery result is not approved by the main chain at this time, the ledger service node 21 also needs to send a sub-chain block containing the lottery service data and a block execution result (i.e., the lottery result) to the scheduling node 25, the scheduling node 25 sends the sub-chain block and the block execution result to a verification node cluster corresponding to the ledger service node 21, and when the sub-chain common result is a common passing result, the sub-chain block information corresponding to the sub-chain block is submitted to the common node cluster, and the sub-chain block information is combined with the block in the main chain. When a block containing block information of the sub-chain block is stored in the main chain, the lottery result may be considered to be recognized by the main chain, i.e., trusted.
It will be appreciated that in this hierarchical link network, the traffic network 201 may interact with the consensus network 202 via provincial backbone SPV nodes. In the multi-level blockchain network, multiple provincial backbone SPV nodes (26 a, 26b shown in fig. 2) may be included, each provincial backbone SPV node's role, data, and authority being identical, e.g., 2 provincial backbone SPV nodes may be included to represent service dual activity. For example, the provincial backbone SPV node may synchronize ledger data of the backbone maintained in the consensus network 202 to ledger service nodes 21 in the business network 201, so that ledger service nodes 21 may perform business processing based on the ledger data of the backbone and confirm whether or not the sub-chain blocks in the sub-chains are verified by the backbone. In addition, the provincial main chain SPV node 26a and the core network portal 204 to which the ledger wall service node 21 is connected may be referred to as a hierarchical chain path between the service network 201 and the consensus network 203, and at this time, data interaction between the service network 201 and the consensus network 203 may be considered to be performed through the hierarchical chain path.
It will be appreciated that the provincial backbone SPV node (26 a, 26b as shown in fig. 2) may also receive core service data submitted by respective service objects via the user clients, e.g. a service object may submit archive configuration service data indicating that the tile data on the sub-chain is archived when the sub-chain is required, and further the provincial backbone SPV node may forward the received core service data to the consensus network portal 204, so that the consensus network portal 204 may forward the received core service data to core consensus nodes for processing the service data, e.g. core consensus node 23a, core consensus node 23b, core consensus node 23c in fig. 2, etc. In addition, the provincial main chain SPV node may further receive the sub-chain blocks and the block execution results sent by the ledger wall service node, and forward the sub-chain blocks and the block execution results sent by the ledger wall service node to the consensus network entry 204, so that the consensus network entry 204 may forward the received sub-chain blocks and the block execution results to the scheduling node 25, and then the scheduling node 25 sends the sub-chain blocks and the block execution results to the corresponding verification node cluster to perform block chain consensus, so as to obtain the sub-chain consensus results, and when the sub-chain consensus results are the consensus, send the block information corresponding to the sub-chain blocks to the core consensus node, so that the core consensus node may uplink the block information corresponding to the sub-chain blocks to the main chain.
It will be appreciated that the service nodes in the hierarchical chain network may be SPV nodes, such as the service SPV nodes 27a, 27b, 27c included in the service network 201 in fig. 2. Service nodes in service network 201 may interact with ledger service node 21 for regional service processing. For example, ledger wall service node 21 may receive service data (also referred to as local service data) for a sub-link sent by a service SPV node (27 a shown in fig. 2), so that ledger wall service node 21 verifies the validity of the received service data, and performs packaging execution on the service data that passes the verification, so as to implement uplink of the service data to the sub-link.
It will be appreciated that, in general, a boom filter (bloom filter) is set in connection with a neighboring node of the SPV node (light node), for example, the neighboring node of the provincial backbone SPV node is a core consensus node in the consensus network, and the neighboring node of the service SPV node is an account book service node. When the neighboring node sees that a service data meets BoomFilter condition (filter condition) of the SPV node, it sends a block to the SPV node with a merkleblock message (in a message form); wherein, the merkleblock message comprises a BlockHead and a Merkle path (merck path) connected to the Merkle Root of the service data; the SPV node may use the merkle path to associate traffic data with a block containing traffic data and use the BlockHead to verify that the block containing traffic data is on the blockchain and has been acknowledged. These two verifications can prove that the traffic data is present on the blockchain, and the SPV node can synchronize from the neighboring nodes to the corresponding traffic data.
Based on the above description, the embodiments of the present application provide a data processing scheme based on a hierarchical chain network, which can deploy account service nodes in a first service network in an infrastructure of the hierarchical chain network (a consensus network and a first service network), further, when the account service nodes acquire service data sent by the service nodes in the first service network, the account service nodes package the service data into first sub-chain blocks, execute the first sub-chain blocks to obtain block execution results, write the first sub-chain blocks and the block execution results into first sub-chains corresponding to the first service network, then send the first sub-chain blocks and the block execution results to a scheduling node in the consensus network, the scheduling node sends the first sub-chain blocks and the block execution results to a first verification node cluster in the consensus network, the first verification node cluster can perform block chain consensus on the first sub-chain blocks and the block execution results, then send the sub-chain consensus results and the first sub-chain blocks corresponding to the first sub-chain blocks together to determine that the first sub-chain blocks belong to the first sub-chain blocks in the consensus network when the first sub-chain blocks are stored in the first sub-chain clusters, and the first sub-chain blocks corresponding to the first sub-chain blocks are determined to have the same recognition result. By adopting the scheme, the technical and resource burden of sub-link consensus in the hierarchical link network can be reduced, and the difficulty in verifying the correctness of the sub-link data by the consensus network can be reduced.
It may be understood that the nodes (such as the ledger service node, the scheduling node, the verification node, and the core consensus node) according to the embodiments of the present application may be servers, or may be terminal devices, or may be other devices that perform data processing, which is not limited herein. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms, and the like, which is not limited herein. The terminal equipment comprises, but is not limited to, a mobile phone, a computer, an intelligent voice interaction device, an intelligent household appliance, a vehicle-mounted terminal, an aircraft, an intelligent sound box, an intelligent household appliance and the like.
It should be noted that, when the node in the embodiment of the present application obtains the data (such as the object identifier, the personnel information of the enterprise, the client information of the enterprise, etc.) of the service object (such as a person, an enterprise or an organization), a prompt interface or a popup window may be displayed, where the prompt interface or the popup window is used to prompt that the service object is collecting the data such as the object identifier, the personnel information of the enterprise, the client information of the enterprise, etc. only after the service object sends a confirmation operation to the prompt interface or the popup window, the relevant step of data obtaining is started, otherwise, the process is ended.
In addition, it will be appreciated that in the embodiments of the present application, business data (e.g., the above-mentioned abstract business data for conducting lottery drawing, etc.) of business objects of users, enterprises, institutions, etc. may be involved, and when the above embodiments of the present application are applied to specific products or technologies, permission or consent of the business objects of users, enterprises, institutions, etc. needs to be obtained, and collection, use and processing of relevant data need to comply with relevant laws and regulations and standards of relevant areas.
It can be understood that the above scenario is merely an example, and does not constitute a limitation on the application scenario of the technical solution provided by the embodiment of the present application, and the technical solution of the present application may also be applied to other scenarios. For example, as one of ordinary skill in the art can know, with the evolution of the system architecture and the appearance of new service scenarios, the technical solution provided by the embodiment of the present application is also applicable to similar technical problems.
Based on the above description, the embodiment of the application provides a data processing method based on a hierarchical chain network. Referring to fig. 3, fig. 3 is a flowchart of a data processing method based on a hierarchical chain network according to an embodiment of the present application. The hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a scheduling node, a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the first service network and the consensus network perform data interaction through a first hierarchical chain channel; the method is performed by a computer device; wherein the computer device may be an ledger service node in the first business network; the hierarchical chain based data processing method may at least include the following steps S101 to S104:
Step S101, when service data sent by a service node in a first service network is obtained, the service data is packed into a first sub-chain block, the first sub-chain block is executed, and a block execution result is obtained.
Specifically, the service data refers to data for delivering service information; the block is a data packet carrying service data on a block chain network, is a data structure marked with a time stamp and a hash value of the previous block, and is verified and determined by a consensus mechanism of the network; the first sub-chain block refers to a data packet generated by the computer device and used for carrying service data in the first service network.
Specifically, the first sub-chain block may include one or more service data, each service data may carry an identification number or a name of the intelligent contract, and the computer device executes a feasible process of the first sub-chain block may be: and traversing and reading each service data contained in the first sub-chain block, and operating the corresponding intelligent contract according to the identification number or the name of the intelligent contract contained in each service data so as to obtain an execution result corresponding to the service data, wherein when the traversing is finished, the execution of the first sub-chain block is completed, and the computer equipment determines the execution result corresponding to all the service data contained in the first sub-chain block as a block execution result.
Specifically, a lightweight sub-chain engine may be integrally installed in the computer device, and the lightweight sub-chain engine may be regarded as a stand-alone blockchain generation service or blockchain generation component, which may implement functions of processing logic execution on intelligent contracts and blockchains, managing data storage and retrieval on blockchains, and processing communication and data transmission in a blockchain network, etc., and it will be appreciated that the specific engine composition and function depend on the blockchain technology and design used, and the application is not limited herein. The computer device may receive, through the lightweight sub-chain engine, service data sent by each service node in the first service network, and then construct a new sub-chain block (i.e., the first sub-chain block) according to the service data, and perform execution.
Step S102, writing the first sub-chain block and the block execution result into a first sub-chain corresponding to the first service network.
Specifically, the first sub-chain refers to a block chain corresponding to the first service network, and it can be understood that the first sub-chain is only used for storing service data sent by a service node in the first service network.
Specifically, when the lightweight sub-chain engine is integrally installed in the computer device, the first sub-chain block and the block execution result can be written into the first sub-chain through the lightweight sub-chain engine.
Step S103, the first sub-chain block and the block execution result are sent to a scheduling node, so that the scheduling node sends the first sub-chain block and the block execution result to a first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the execution result of the first sub-chain block and the block; and the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
Specifically, in the hierarchical link network, the consensus network and the first service network are two independent networks, wherein the consensus network can be deployed in a private cloud, the first service network can be deployed in a public network, and the consensus network and the first service network can perform data interaction through a first hierarchical link channel. The first hierarchical link channel may include a core network entry corresponding to a cross-link relay and a consensus network, where the cross-link relay refers to a device capable of implementing data forwarding, such as the main-chain SPV node 26a shown in fig. 2, and the first hierarchical link channel shown in fig. 2 refers to a data forwarding channel formed by the main-chain SPV node 26a and the core network entry.
Specifically, the consensus network may include a verification node cluster, where the verification node cluster may include a large number of verification nodes, and the verification node cluster is configured to assist all the service networks in the hierarchical chain network to perform consensus verification on the sub-chains respectively corresponding to the service networks. It is understood that different sub-chains may correspond to different verification nodes, and that the verification nodes corresponding to the same sub-chain form a verification node cluster corresponding to the sub-chain. That is, the first authentication node cluster may belong to the authentication node cluster, and if the hierarchical chain network further includes a second service network, the authentication node cluster may further include a second authentication node cluster corresponding to a second sub-chain corresponding to the second service network. Furthermore, it should be noted that if the computational power resource is sufficient, one verification node may be responsible for the common-knowledge verification of multiple sub-chains, for example, the verification node a may be responsible for the common-knowledge verification of the first sub-chain and the second sub-chain, and the verification node a may belong to both the first verification node cluster and the second verification node cluster. It can be understood that the clustered mode of the verification nodes can ensure centralized and safe management of computing power, and meanwhile, a large verifier cluster can perform consensus calculation for the sub-chains, so that the consensus power of the sub-chains in the service network is saved, and the deployment architecture requiring multi-node consensus is simplified.
Specifically, the scheduling node is configured to schedule the verification node cluster in the consensus network, for example, send the received first sub-chain block and the block execution result corresponding to the first sub-chain block to the first verification node cluster corresponding to the first sub-chain. After the first verification node cluster receives the first sub-chain block and the block execution result, the first sub-chain block and the block execution result are subjected to consensus verification to obtain a verification result, and then the first verification node cluster sends the verification result of the consensus verification and first block information corresponding to the first sub-chain block to the consensus node cluster. The first block information corresponding to the first sub-chain block may be related information for identifying the first sub-chain block, for example, the block header information included in the first sub-chain block, or the block hash corresponding to the first sub-chain block, which may be selected according to the actual situation, which is not limited in this disclosure.
Specifically, one possible implementation process of the first verification node cluster for performing consensus verification on the first sub-chain block and the block execution result may be: the first verifying node cluster may verify the first sub-chain block and the block execution result and perform BFT (Byzantine Fault Tolerance, by & busy) consensus voting to obtain a consensus voting result. Among these, BFT consensus is a mechanism that attempts to agree on an infinitely growing sequence of proposals (blocks or traffic data sets) for N authentication nodes (where there are at most f byesting nodes).
Specifically, after the first verification node cluster obtains the verification results of the first sub-chain block and the block execution result, the first verification node cluster needs to send the sub-chain consensus result and the first block information corresponding to the first sub-chain block to the consensus node cluster, and the first block information and the main chain are combined to form a consensus block together, that is, when the verification result is that the consensus passes, the consensus node cluster packages the first block information corresponding to the first sub-chain block into the block generated by the consensus node cluster. The step of packaging the first block information corresponding to the first sub-chain block into the block generated by the common node cluster may be that merging common data is generated according to the first block information, and then the merging common data is added into the new block. Besides checking the main chain service data and block header information in the generated new block, the consensus node cluster checks the combined consensus data, and can only throw approval tickets, and when the approval ticket number reaches the target number, the new block consensus can only be determined to pass, and the new block can only be written into the main chain. It will be appreciated that the new block will include the merged common data, and the merged common data includes the first block information, i.e. the new block will include the first block information.
Step S104, when the block containing the first block information is stored in the main chain corresponding to the consensus network, determining that the first sub-chain block in the first sub-chain belongs to the block verified by the main chain.
Specifically, the process of the computer device writing the first sub-chain block into the first validation node cluster in the first sub-chain and consensus network for block chain consensus of the first sub-chain block may be performed asynchronously. However, in the present application, when the first sub-chain block is written into the first sub-chain, but the first block information corresponding to the first sub-chain block is not yet written into the main chain, the first sub-chain block may be considered to have not been verified by the main chain, that is, the block execution result corresponding to the first sub-chain block is not acknowledged by the main chain at this time, and may be considered to be unreliable. When the block containing the first block information is stored in the main chain corresponding to the consensus network, the first sub-chain block can be considered to be verified by the main chain, and at this time, the block execution result corresponding to the first sub-chain block can be considered to be reliable.
Alternatively, a backbone corresponding to the consensus network may be stored in the computer device (it may be understood that each consensus node in the consensus network stores a backbone), and each time a new block in the backbone passes the consensus, not only will the consensus node add the new block to the locally stored backbone, but the computer device will synchronize the new block through the first hierarchical link channel and then write the new block to the locally stored backbone.
Optionally, a main chain SPV ledger module may be integrally installed in the computer device, where the main chain SPV ledger module is mainly equivalent to the SPV function and is used to complete synchronization with the main chain ledger and related interaction with the main chain. In addition, the main chain SPV account book module and the lightweight sub-chain engine can form a local consensus account book organization service together, and when any node in the first service network is integrally provided with the local consensus account book organization service, the node can be considered as the computer equipment in the embodiment of the application.
Alternatively, after receiving the backbone blocks corresponding to the consensus network, the computer device may synchronize the backbone blocks in the backbone corresponding to the consensus network (herein referred to as the backbone stored in the computer device), i.e., write the received backbone blocks into the backbone stored by itself. The main chain block is a block commonly recognized by the common node cluster. Then, each time the computer device receives a new main chain block, the computer device needs to verify whether the block information of the sub-chain block related to the first sub-chain is stored in the newly written main chain block. Taking first block information corresponding to a first sub-chain block as an example, the computer equipment can perform data searching on the main chain block to obtain a block searching result; if the block searching result indicates that the first block information is searched in the main chain blocks, determining that the blocks containing the first block information are stored in the main chain corresponding to the consensus network; if the block searching result indicates that the first block information is not searched in the main chain blocks, determining that the blocks containing the first block information are not stored in the main chain corresponding to the consensus network. The data searching refers to determining whether the main chain block contains the first block information. It can be understood that when the computer device determines that the block containing the first block information is stored in the main chain corresponding to the consensus network, it can be determined that the first sub-chain block and the corresponding block execution result are verified by the main chain, and are both trusted, so that additional verification is not required, and the verification cost and verification time for the first sub-chain block and the corresponding block execution result are saved.
Specifically, one possible implementation process for performing data searching on the main chain block to obtain the block searching result may be: traversing the business data contained in the main chain block; if the combined consensus data is not obtained in the main chain block, determining that the block searching result aiming at the main chain block indicates that the first block information is not searched in the main chain block; if the combined consensus data is obtained from the main chain block, carrying out data searching on the combined consensus data; if the first block information is not found in the combined consensus data, determining that the block finding result indicates that the first block information is not found in the main chain block; if the first block information is found in the combined consensus data, determining that the block finding result indicates that the first block information is found in the main chain block. The merging consensus data is data generated based on merging and blocking technology, and the merging consensus data can comprise block information of sub-chain blocks respectively corresponding to one or more service networks contained in the hierarchical chain network. It can be understood that if the merging consensus data is not found in the main chain, it can be considered that when the main chain block is generated, the consensus node cluster does not write the block information of any sub-chain block into the main chain block, and at this time, it can be directly determined that the main chain block does not contain the first block information; however, if the merged common data is found in the main chain, it cannot be directly determined that the main chain block contains the first block information, and because the merged common data is possibly generated by the common node cluster according to the block information of the sub-chain block corresponding to the received other service network, the merged common data needs to be subjected to data search, that is, whether the merged common data contains the first block information is verified. It can be understood that, whether the service data included in the main chain block is the service data of the combined consensus data is determined first, whether the main chain block includes the block information can be determined quickly, because only the combined consensus data includes the block information, after the combined consensus data is determined to be included in the main chain block, detailed search is performed on the combined consensus data, and detailed search is not performed on each service data, so that the search speed of the first block information can be increased.
Specifically, the merging and chunking technique is a technique of multiplexing the workload spent on protecting one blockchain while protecting the other blockchain, where PoW (workload proof) of two blockchains uses the same blockhead hash function (and difficulty check), and for easy understanding of the merging and chunking technique, it is assumed that there is one main chain B and one secondary chain S. hB and hS are the block headers of the two new blocks of B and S, respectively, and H is any cryptographic hash function. When generating a block, the node that merges the block must explicitly point to H (hS) when building a template of hB, and then when the block is exported, try to find a nonce value, so that the workload of hB proves that the difficulty requirement of the blockchain network corresponding to the backbone B can be met (i.e., SHA256D (hB) < targetb, meaning that the hash value of the new block of the backbone B is smaller than the target value of the backbone B), and there is no difference from generating only the block of the backbone B. However, if the node finds a new chunk header for backbone B whose workload meets the secondary chain's difficulty requirement (i.e., SHA256D (hB) < targetS, meaning that the hash value of the new chunk for backbone B is less than the target value for the secondary chain), then this hB, hS, and some additional chunk header association information becomes a valid workload proof for the secondary chain. The new chunk generated by the complete merge may contain this proof of workload and other data specific to this chain (i.e., transactions confirmed by the hS). This block is sent to the network of secondary blockchains and added to the secondary blockchains. With the merging and chunking technique, two different workload proofs can be created with one effort. However, in the application, the merging of the blocks is not based on calculation force, but is performed on the basis of BFT consensus, but the modification of the fields in the block header is similar.
It can be understood that the merging consensus data is different from the data structure corresponding to the main-chain service data included in the main-chain block, so that the searching speed is much faster than the searching of the first block information in each piece of service data included in the main-chain block one by one. For ease of understanding, please refer to fig. 4, fig. 4 is a schematic diagram of a data structure of a main chain block according to an embodiment of the present application. As shown in fig. 4, the root 41 of the merck tree of the service data included in the main chain block 40 is a root node hash value of the merck tree of the service data generated based on the merged common data 42, the service data 43a, …, the service data 43b, and the service data 43 n. The service data 43a, …, the service data 43b, and the service data 43n are all core service data received by the consensus network, i.e. normal service data for the main chain. The Merkle Tree (Merkle Tree) is also called a hash Tree, and is a Tree data structure used for quickly inducing and checking the integrity of large-scale data, the leaf nodes of the Merkle Tree are hashes of data blocks, so that merging common data 42, service data 43a and …, service data 43b and hashes corresponding to service data 43n are leaf nodes corresponding to the Merkle Tree (Merkle Tree) of service data (it should be understood that fig. 4 does not directly depict leaf nodes corresponding to the Merkle Tree), the hashes of non-leaf nodes are obtained by hash calculation according to all leaf node values below the hash nodes, as shown in fig. 4, the Merkle Tree node hashes 44 are hashes corresponding to the common data 42 and hashes corresponding to the service data 43a, the Merkle Tree node hashes 45 are hashes corresponding to the service data 43b and hashes corresponding to the service data 43n, and the service data Merkle Tree root hashes 41 are hashes obtained by hash Tree node hash calculation of the hash node 45.
The merge consensus data 42 is a special service data that may contain a cobase field and may therefore also be referred to as cobase. It will be appreciated that the final output of cobase will include in its script an op_return opcode followed by the merck root (also known as the secondary attestation merck root) and the sub-chain bitmap (bitmap, also known as the secondary attestation sub-chain bitmap). The merck tree root is a root node hash value of the merck tree (also called as an auxiliary proof merck tree) generated by the common node cluster according to block hashes respectively corresponding to one or more sub-chain blocks through which the verification result passes. The sub-link bitmap comprises a sub-link identifier corresponding to each sub-link and a marking state corresponding to each sub-link, wherein the sub-link identifier is contained in the hierarchical link network, and if the sub-link state corresponding to the sub-link is in the marking state, the generation of the merck tree is characterized in that the sub-link block corresponding to the sub-link is involved; if the state of the sub-chain corresponding to the sub-chain is in an unlabeled state, the generation of the representation merck tree is irrelevant to the sub-chain block corresponding to the sub-chain. As shown in FIG. 4, the script of the merged common data 42 includes a Merker tree root 46, where the Merker tree root 46 may be generated based on block hashes corresponding to the sub-chain block 47a, the sub-chain block 47b, the sub-chain block 47c and the sub-chain block 47d, respectively, where the sub-chain block 47a may be the sub-chain block W on the 1 st sub-chain, the sub-chain block 47b may be the sub-chain block X on the 4 th sub-chain, the sub-chain block 47c may be the sub-chain block Y on the 5 th sub-chain, and the sub-chain block 47d may be the sub-chain block Z on the 7 th sub-chain. In addition, the merging consensus data 42 further includes a sub-link bitmap (abbreviated as a sub-link bitmap), as shown in fig. 4, the sub-link bitmap indicates numbers 1-8 …, which respectively represent sub-links with sub-link identifiers 1, 2, and 3 …, the sub-links determine unique sub-link identifiers when registration is started, and when the hierarchical link network includes multiple sub-links and sub-link blocks of the multiple sub-links all need to be merged and consensus, the sub-link bitmap is used to indicate block information of sub-link blocks of which sub-links are included in the merging consensus data 42. As shown in fig. 4, the sub-chain identifiers 1, 4, 5, and 7 are marked in the sub-chain bitmap, which indicates that the merging consensus data 42 includes block information corresponding to the sub-chain blocks on the 1 st sub-chain, the 4 th sub-chain, and the 7 th sub-chain.
Specifically, as can be seen from the above, the first block information includes a first block hash of the first sub-chain block; the merged consensus data includes a merck tree and a sub-chain bitmap. The merck tree may be an auxiliary proof merck tree, and is used for verifying that the merging common identification data includes block hashes of which sub-chain blocks, where the common identification node cluster is generated according to block hashes corresponding to one or more sub-chain blocks that the verification result is that the common identification passes. It should be noted that, if not otherwise stated, the merck tree mentioned in all embodiments of the present application may be an auxiliary proof merck tree. The sub-link bitmap comprises a sub-link identifier corresponding to each sub-link contained in the hierarchical link network and a marking state corresponding to each sub-link identifier; one sub-chain identification is used to uniquely identify one sub-chain. One possible implementation of the data lookup for the synthetic consensus data can be summarized as follows: if the marking state corresponding to the target sub-chain mark is determined to be the unmarked state through the sub-chain bitmap, determining that the first block information is not found in the combined consensus data; the target sub-chain identifier is a sub-chain identifier corresponding to the first sub-chain identifier; if the marking state corresponding to the target sub-chain mark is the marked state through the sub-chain bitmap, K Merker tree node hashes associated with the target sub-chain mark are obtained from the Merker tree, wherein K is a positive integer; performing Merker node verification on the first block hash according to the K Merker tree node hashes and the Merker tree root hashes corresponding to the Merker tree to obtain a verification result; if the verification result is a verification passing result, determining that the first block information is found in the combined consensus data; if the verification result is a verification failure result, determining that the first block information is not found in the combined consensus data.
Specifically, the foregoing performing merck node verification on the first block hash according to the K merck node hashes and the merck tree root corresponding to the merck tree, to obtain a feasible implementation process of the verification result may be: sequentially obtaining the i-th merck tree node hash according to tree node positions corresponding to the K merck tree node hashes in the merck tree; i is a positive integer less than or equal to K; performing hash operation on the ith merck tree node hash and the (i-1) th verification hash to obtain the ith verification hash, and comparing the kth verification hash with the merck tree root hash until the kth verification hash is obtained; when i is 1, the i-1 th verification hash is a first block hash; if the Kth verification hash is different from the Merker tree root hash, determining that the verification result is a verification failure result; if the Kth verification hash is the same as the Merker tree root hash, determining that the verification result is a verification passing result.
For the convenience of understanding the foregoing merck node verification process, please refer to fig. 5, and fig. 5 is a schematic diagram of merck node verification according to an embodiment of the present application. As shown in fig. 5, assuming that H0 is the first chunk hash to be verified, the child chain corresponding to H0 is the 5 th child chain, the ledger service node may query the position of the child chain identifier 5 corresponding to the 5 th child chain in the child chain bitmap in the marked state, determine that the child chain identifier 5 is in the third order, which means that the leaf node 52 in the third order in the merck tree 51 is the leaf node corresponding to the 5 th child chain, at this time, the tree node in the merck tree 51 that can form the merck tree root node 55 together with the leaf node 52 may be determined as the target node, that is, the leaf node 53 and the merck tree node 54, and it may be understood that the hash corresponding to the merck tree root node 55 may be calculated according to the positions of the leaf node 52, the leaf node 53 and the merck tree node 54, which are obtained by the merck service node at this time, is the H3 corresponding to the hash node H5 corresponding to the hash node. Then, the ledger-paper service node may perform hash operation on the first block hash H0 to be verified and the hash H3 to obtain a verification hash HK1, then perform hash operation on the hash H5 and the hash HK1 to obtain a hash HK2 to be verified, and then, the ledger-paper service node may compare the hash HK2 to be verified with the merck root hash H7 corresponding to the merck root node 55, and if HK 2=h7, it indicates that the merck verification passes; if hk2+.h7, then it is stated that the mercker verification is not passed.
By the method provided by the embodiment of the application, the unified consensus verification of the sub-chain blocks corresponding to the service network is completed by the first verification node cluster in the consensus network, the service network is not required to self-establish the local consensus network, the technical and resource burden of sub-chain consensus in the hierarchical chain network can be reduced, in addition, the block information corresponding to the sub-chain blocks needs to be recorded in the main chain, the correctness of the sub-chain blocks can be verified directly through the block information in the main chain, and the difficulty of verifying the correctness of the sub-chain data by the consensus network can be reduced.
Based on the above description, the embodiment of the application provides a data processing method based on a hierarchical chain network. Referring to fig. 6, fig. 6 is a flowchart of another data processing method based on a hierarchical chain network according to an embodiment of the present application. The hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; wherein the computer device may be a scheduling node in a consensus network; the data processing method based on the hierarchical chain network at least comprises the following steps of S201 to S203:
Step S201, receiving a first sub-chain block and a block execution result corresponding to the first sub-chain block; the first sub-chain block is generated by packing account book service nodes in a first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block.
Specifically, the first sub-chain block and the block execution result corresponding to the first sub-chain block are sent to the computer device by the ledger wall service node in the first service network through the first hierarchical chain channel, and the sending process and the packing and execution process of the first sub-chain block can refer to the specific description of step S101 to step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Step S202, determining a first verification node cluster associated with a first sub-chain corresponding to the first service network in a consensus network.
Specifically, in practical application, the hierarchical chain network may include one or more service networks, where each service network needs to correspond to one verification node cluster (may be referred to as a local verification node cluster), so a large number of verification nodes for helping the sub-chain to perform blockchain consensus may be deployed in a centralized manner in the consensus network, and all the verification nodes form one verification node cluster. During the registration of the first sub-chain, the computer device may select a part of the verification nodes from the verification node clusters to help the first sub-chain perform the blockchain consensus, and the selected part of the verification nodes are the first verification node clusters corresponding to the first sub-chain, that is, the first verification node clusters belong to the verification node clusters.
Specifically, one possible implementation procedure of determining, in the consensus network, the first verification node cluster associated with the first sub-chain corresponding to the first service network may be: acquiring a sub-chain verification mapping table; and determining the verification node associated with the first sub-chain identifier corresponding to the first sub-chain in the sub-chain verification mapping table as a first verification node cluster. The sub-chain verification mapping table comprises one or more sub-chain identifiers and verification nodes associated with each sub-chain identifier; each verification node belongs to a verification node cluster contained in the consensus network; the number of sub-chain identifications associated with one authentication node is one or more. For ease of understanding, please refer to the following table 1, table 1 is an example of a sub-chain verification mapping table provided in an embodiment of the present application. As shown in table 1:
TABLE 1
As shown in table 1, one or more sub-chain identifications may be associated with the same authentication node, so it may be appreciated that the same authentication node may belong to different service network associated authentication node clusters.
Optionally, the authentication node cluster comprises a first authentication node; the first verification node associates H sub-link identifiers in a sub-link verification mapping table, wherein H is a positive integer; the computer equipment can acquire the computing power resource occupation information in the consensus operation period, which is sent by the first verification node; if the calculation power resource occupation information exceeds a first calculation power threshold value, acquiring a target sub-chain identifier from the H sub-chain identifiers; selecting a second verification node from the verification node cluster; the computational power resource occupation information of the second verification node in the consensus operation period is lower than a second computational power threshold value; the first computational force threshold is greater than the second computational force threshold; and updating the first verification node associated with the target sub-chain identification into a second verification node in the sub-chain verification mapping table. The common operation period may be a preset period of time, such as one day, two hours, etc., and may be determined according to practical situations, which is not limited herein. The computing power resource occupation information is quantization index information of the computing power resource occupied by the first verification node when the first verification node performs blockchain consensus of the sub-chain. The quantization index information may include one or more index information among a plurality of index information such as central processing unit power information, graphics processing unit power information, memory usage information, network bandwidth usage information, disk read-write capability information, etc. The first power threshold may include an upper limit value corresponding to a plurality of index information, and when a certain index information exceeds the corresponding upper limit value, it may be considered that the power resource is too occupied, the first verification node will be in a busy state, and a part of tasks to be processed associated with blockchain sharing may need to wait. For example, when the computing power resource occupation information includes the index information of the memory usage information, the first computing power threshold should include an upper limit value corresponding to the memory usage information, for example, 66%, and if the memory usage information exceeds 66%, it indicates that the memory of the first verification node is used too much. Therefore, the block chain consensus task of the partial sub-chains can be scheduled to be completed by the idle second verification node from the block chain consensus tasks of the H sub-chains which need to be completed by the first verification node, so that the problem of overlong block chain consensus time of the sub-chains caused by insufficient calculation force of the verification node is avoided.
Optionally, the hierarchical chain network further comprises a second service network; the second service network is independent of the consensus network; the computer device may receive a validation node cluster allocation request for the second service network; verifying that the node cluster allocation request comprises a second sub-link identifier corresponding to a second sub-link corresponding to the second service network; determining node allocation quantity according to the verification node cluster allocation request; selecting verification nodes corresponding to node allocation quantity from the verification node clusters to serve as second verification node clusters; and recording the association relation between the second sub-chain identification and the second verification node cluster in the sub-chain verification mapping table.
Step S203, sending the first sub-chain block and a block execution result corresponding to the first sub-chain block to the first verification node cluster, so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
Specifically, after the first verification node cluster completes the block chain consensus on the first sub-chain block and the block execution result, the obtained sub-chain consensus result may be sent to the consensus node cluster, and the consensus node cluster may combine the first block information with the core service data in the main chain according to the sub-chain consensus result to form a block, which may be specifically described in step S301 to step S305 in the embodiment corresponding to fig. 7 below. The consensus verification may be a BFT consensus vote, or other consensus votes, and the application is not limited herein.
By adopting the method provided by the embodiment of the application, the block chain consensus corresponding to one or more sub-chains contained in the hierarchical chain network is completed by the verification node clustering mode, the verification node clustering mode can ensure that the calculation power is intensively and safely managed, and meanwhile, one large verifier cluster can perform consensus calculation for a plurality of sub-chains, thereby saving the consensus calculation power of the sub-chains in the service network and simplifying the deployment architecture requiring multi-node consensus.
Based on the above description, the embodiment of the application provides a data processing method based on a hierarchical chain network. Referring to fig. 7, fig. 7 is a flowchart of another data processing method based on a hierarchical chain network according to an embodiment of the present application. The hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device, wherein the computer device may be a consensus node in a consensus network; the hierarchical chain based data processing method may at least include the following steps S301 to S305:
step S301, receiving a verification result sent by a first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in a first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block.
Specifically, the generation of the first sub-chain block and the block execution result may refer to the description of step S101 to step S103 in the embodiment corresponding to fig. 3, which is not repeated here.
Step S302, if the verification result is that the consensus is passed, adding the first block information corresponding to the first sub-chain block to the to-be-packaged block information set.
Specifically, when the hierarchical chain network includes a plurality of service networks, the to-be-packaged block information set may include block information corresponding to sub-chain blocks corresponding to the plurality of service networks.
Step S303, generating merging consensus data according to the block information set to be packaged.
Specifically, the block information set to be packaged includes M block hashes, where M is a positive integer; the M block hashes include a first block hash; the first block hash belongs to first block information; the sub-chain identifiers corresponding to the M block hashes are different; the sub-chain identifier is used for uniquely identifying a sub-chain corresponding to a service network; each service network belongs to a hierarchical chain network; one possible implementation procedure for generating the merged common data according to the set of block information to be packed may be: generating a sub-chain bitmap according to the sub-chain identifiers respectively corresponding to the M pieces of block information; generating the merck tree corresponding to the M pieces of block information according to the position sequence of the sub-chain identifiers corresponding to the M pieces of block information in the sub-chain bitmap; the merck tree includes a merck tree root; and generating the combined consensus data according to the sub-link bitmap and the Merker tree root. The structure and the generation process of the merged common data may refer to the structure and the generation process of the merged common data 42 in the embodiment corresponding to fig. 4, which are not described herein.
Specifically, the hierarchical chain network comprises N service networks, wherein N is a positive integer greater than or equal to M; the service networks corresponding to the M block hashes belong to N service networks; one possible implementation procedure for generating the sub-chain bitmap according to the sub-chain identifiers respectively corresponding to the M pieces of block information may be: acquiring an initial sub-link bitmap; the initial sub-link bitmap comprises sub-link identifiers corresponding to the N service networks respectively and marking states corresponding to the sub-link identifiers; the marking state corresponding to each sub-chain mark in the initial sub-chain bitmap is an unmarked state; and updating the marking states corresponding to the sub-chain identifiers corresponding to the M pieces of block information in the initial sub-chain bitmap into marking states to obtain the sub-chain bitmap. It can be understood that by pre-configuring the initial sub-link bitmap, the number of service networks included in the hierarchical link network and the determination of corresponding sub-link identifiers can be reduced when the sub-link bitmap is newly built each time, so that the generation speed of the sub-link bitmap is increased.
And S304, packaging the combined consensus data to a main chain block, and initiating a consensus request aiming at the main chain block to a consensus node cluster so that the consensus node cluster performs block consensus on the main chain block according to the consensus request to obtain a consensus result.
Specifically, when the consensus node cluster performs blockchain consensus on the main chain block, the combined consensus data is checked except for checking the main chain service data and the block header information in the main chain block, and approval tickets for agreeing to the consensus can be thrown through the checking.
Step S305, if the consensus result is that the consensus passes, writing the main chain block into the main chain corresponding to the consensus network.
Optionally, when the computer device is a consensus node, a data query request for the first sub-chain may be received; the first sub-chain is a sub-chain corresponding to the first sub-chain block; the data query request comprises a first sub-chain identifier corresponding to the first sub-chain; determining a query verification node according to the first sub-chain identification, and forwarding a data query request to the query verification node; the query verification node belongs to a first verification node cluster; the verification nodes in the first verification node cluster are all stored with a first sub-chain; and receiving a data query result returned by the query verification node according to the data query request. It can be appreciated that the consensus node in the consensus network does not need to include ledger data related to the first sub-chain, and if ledger data related to the first sub-chain needs to be queried, the consensus node can be synchronized from the query verification node related to the first sub-chain, so that storage pressure of the consensus node can be reduced.
By adopting the method provided by the embodiment of the application, the block chain consensus data confirmation and inspection capability of the sub-chains is improved to the consensus network by introducing the merging and blocking technology, and the strong binding relationship between the main chain and each sub-chain block is realized (because the block information corresponding to the sub-chain block can be written into the main chain), so that the following steps are realized: centralizing the calculation capability of the number of verifiers in the consensus network, ensuring that the consensus of each sub-chain is sufficiently decentralised, and a large number of consensus and calculation processes are not required to be completed in the service network; the correctness of the full network multi-chain is enhanced through block binding, the account book correctness of all the sub-chains can be verified from the main chain, and the time for the main chain to verify the correctness of the sub-chain blocks is saved.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a data processing apparatus based on a hierarchical chain network according to an embodiment of the present application. Wherein the data processing apparatus 1 based on the hierarchical chain network may be a computer program (including program code) running on a computer device (e.g. the above-mentioned ledger wall service node), for example the data processing apparatus 1 based on the hierarchical chain network is an application software; it will be appreciated that the data processing apparatus 1 based on a hierarchical chain network may be used to perform the corresponding steps in the data processing method based on a hierarchical chain network provided by the embodiment of the present application. As shown in fig. 8, the hierarchical chain network-based data processing apparatus 1 may include: the device comprises an acquisition module 11, a first writing module 12, a first sending module 13 and a first determining module 14.
The acquiring module 11 is configured to, when acquiring service data sent by a service node in the first service network, package the service data into a first sub-chain block, execute the first sub-chain block, and obtain a block execution result;
the first writing module 12 is configured to write the first sub-chain block and the block execution result into a first sub-chain corresponding to the first service network;
the first sending module 13 is configured to send the first sub-chain block and the block execution result to the scheduling node, so that the scheduling node sends the first sub-chain block and the block execution result to the first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the first sub-chain block and the block execution result; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes;
the first determining module 14 is configured to determine that a first sub-chain block in the first sub-chain belongs to a block whose main chain has been verified when a block including the first block information is stored in the main chain corresponding to the consensus network.
The specific implementation manner of the obtaining module 11, the first writing module 12, the first sending module 13, and the first determining module 14 may refer to the specific description of step S101 to step S104 in the embodiment corresponding to fig. 3, and will not be repeated here.
Wherein, the above-mentioned data processing apparatus 1, further include: a block receiving module 15, a first block determining module 16 and a second block determining module 17.
The block receiving module 15 is configured to receive a main chain block corresponding to the consensus network, and synchronize the main chain block in the main chain corresponding to the consensus network; the main chain block is a block which is commonly recognized by the commonly recognized node cluster;
the first block determining module 16 is configured to determine that, if the first block information is found in the main chain blocks, a block including the first block information is stored in the main chain corresponding to the consensus network;
the second block determining module 17 is configured to determine that, if the first block information is not found in the main chain blocks, no block including the first block information is stored in the main chain corresponding to the consensus network.
The specific implementation manner of the block receiving module 15, the first block determining module 16, and the second block determining module 17 may refer to the optional descriptions of step S101 to step S104 in the embodiment corresponding to fig. 3, and are not repeated here.
Wherein, above-mentioned data processing apparatus still includes: a data acquisition module 18.
A data acquisition module 18, configured to determine that the first block information is not found in the main chain block if the combined consensus data is not acquired in the main chain block; the merging consensus data comprises block information of sub-chain blocks respectively corresponding to one or more service networks contained in the hierarchical chain network.
The specific implementation of the data obtaining module 18 may refer to the optional description of step S104 in the embodiment corresponding to fig. 3, which is not repeated here.
Wherein, above-mentioned data processing apparatus still includes: a look-up module 19 and a determination module 110.
The searching module 19 is configured to perform block information searching on the combined consensus data if the combined consensus data is obtained from the main chain block;
an information determining module 110, configured to determine that the first block information is not found in the main chain block if the first block information is not found in the combined consensus data;
the information determining module 110 is further configured to determine that the first block information is found in the main chain block if the first block information is found in the merged common data.
The specific implementation manner of the search module 19 and the determination module 110 may refer to the optional description of step S104 in the embodiment corresponding to fig. 3, which is not described herein.
The first block information comprises a first block hash corresponding to a first sub-chain block; the merging consensus data comprises a merck tree and a sub-chain bitmap; the merck tree is generated by the consensus node cluster according to the consensus result as a block hash corresponding to one or more sub-chain blocks of the consensus passing result; the sub-link bitmap comprises a sub-link identifier corresponding to each sub-link contained in the hierarchical link network and a marking state corresponding to each sub-link identifier; a sub-chain identification for uniquely identifying a sub-chain;
The search module 19 includes: a first determination unit 191, a hash acquisition unit 192, a hash verification unit 193, and a second determination unit 194.
A first determining unit 191, configured to determine that the first block information is not found in the merging consensus data if it is determined that the marked state corresponding to the target sub-chain identifier is an unmarked state by using the sub-chain bitmap; the target sub-chain identifier is a sub-chain identifier corresponding to the first sub-chain;
a hash obtaining unit 192, configured to obtain K merck tree node hashes associated with the target sub-chain identifier from the merck tree if it is determined that the marking state corresponding to the target sub-chain identifier is a marked state by the sub-chain bitmap, where K is a positive integer;
a hash verification unit 193, configured to verify the first block hash by using the merck node hashes and the merck root hashes corresponding to the merck tree to obtain a verification result;
a second determining unit 194, configured to determine that the first block information is found in the combined consensus data if the verification result is a verification passing result;
the second determining unit 194 is further configured to determine that the first block information is not found in the merged common data if the verification result is a verification failure result.
The specific implementation manner of the first determining unit 191, the hash obtaining unit 192, the hash verifying unit 193, and the second determining unit 194 may refer to the optional description of step S104 in the embodiment corresponding to fig. 3, which is not repeated here.
The hash verification unit 193 is specifically configured to sequentially obtain the i-th merck tree node hash according to tree node positions corresponding to the K merck tree node hashes in the merck tree; i is a positive integer less than or equal to K; performing hash operation on the ith merck tree node hash and the (i-1) th verification hash to obtain the ith verification hash, and comparing the kth verification hash with the merck tree root hash until the kth verification hash is obtained; when i is 1, the i-1 th verification hash is a first block hash; if the Kth verification hash is different from the Merker tree root hash, determining that the verification result is a verification failure result; if the Kth verification hash is the same as the Merker tree root hash, determining that the verification result is a verification passing result.
Further, referring to fig. 9, fig. 9 is a schematic structural diagram of another data processing apparatus based on a hierarchical chain network according to an embodiment of the present application. Wherein the data processing device 2 based on the hierarchical network may be a computer program (comprising program code) running on a computer apparatus, for example the data processing device 2 based on the hierarchical network is an application software; it will be appreciated that the data processing apparatus 1 based on a hierarchical chain network may be used to perform the corresponding steps in the data processing method based on a hierarchical chain network provided by the embodiment of the present application. As shown in fig. 9, the hierarchical chain network based data processing apparatus 2 may include: a first receiving module 21, a second determining module 22 and a second transmitting module 23.
The first receiving module 21 is configured to receive the first sub-chain block and a block execution result corresponding to the first sub-chain block; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
a second determining module 22, configured to determine, in the consensus network, a first authentication node cluster associated with a first sub-chain corresponding to the first service network;
the second sending module 23 is configured to send the first sub-chain block and the block execution result corresponding to the first sub-chain block to the first verification node cluster, so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into the block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
The specific implementation manner of the first receiving module 21, the second determining module 22, and the second transmitting module 23 may refer to the specific description of step S201 to step S203 in the embodiment corresponding to fig. 6, which is not repeated here.
Wherein the consensus network further comprises a verification node cluster; the first verification node cluster belongs to the verification node cluster;
the second determination module 22 includes: table acquisition unit 221 and cluster determination unit 222.
A table obtaining unit 221, configured to obtain a sub-chain verification mapping table; the sub-chain verification mapping table comprises one or more sub-chain identifiers and verification nodes associated with each sub-chain identifier; each verification node belongs to a verification node cluster; the number of sub-chain identifications associated with one verification node is one or more;
the cluster determining unit 222 is configured to determine, as the first verification node cluster, a verification node associated with a first sub-link identifier corresponding to the first sub-link in the sub-link verification mapping table.
The specific implementation manner of the table obtaining unit 221 and the cluster determining unit 222 may refer to the specific description of step S202 in the embodiment corresponding to fig. 6, which is not repeated here.
The verification node cluster comprises a first verification node; the first verification node associates H sub-link identifiers in a sub-link verification mapping table, wherein H is a positive integer;
the data processing apparatus 2 further includes: node scheduling module 24.
The node scheduling module 24 is configured to obtain computing power resource occupation information in a common operation period sent by the first verification node;
The node scheduling module 24 is further configured to obtain a target sub-chain identifier from the H sub-chain identifiers if the computing power resource occupation information exceeds the first computing power threshold;
the node scheduling module 24 is further configured to select a second verification node from the verification node cluster; the computational power resource occupation information of the second verification node in the consensus operation period is lower than a second computational power threshold value; the first computational force threshold is greater than the second computational force threshold;
the node scheduling module 24 is further configured to update, in the sub-link verification mapping table, the first verification node associated with the target sub-link identifier to the second verification node.
The specific implementation manner of the node scheduling module 24 may refer to the optional description of step S202 in the embodiment corresponding to fig. 6, which is not repeated here.
Wherein, the layering chain network corresponding to the layering chain also comprises a second service network; the second service network is independent of the consensus network;
the data processing apparatus 2 further includes: the node allocation module 25.
A node allocation module 25, configured to receive a verification node cluster allocation request for the second service network through the second hierarchical link channel; verifying that the node cluster allocation request comprises a second sub-link identifier corresponding to a second sub-link corresponding to the second service network;
The node allocation module 25 is further configured to determine a node allocation number according to the verification node cluster allocation request;
the node allocation module 25 is further configured to select, from the verification node clusters, verification nodes corresponding to the node allocation number as a second verification node cluster;
the node allocation module 25 is further configured to record, in the sub-link verification mapping table, an association relationship between the second sub-link identifier and the second verification node cluster.
The specific implementation manner of the node allocation module 25 may refer to the optional description of step S202 in the embodiment corresponding to fig. 6, which is not described herein.
Referring to fig. 10, fig. 10 is a schematic structural diagram of another data processing apparatus based on a hierarchical chain network according to an embodiment of the present application. Wherein the data processing means 3 based on the hierarchical network may be a computer program (comprising program code) running on a computer device, e.g. the data processing means 3 based on the hierarchical network is an application software; it will be appreciated that the data processing apparatus 3 based on a hierarchical chain network may be used to perform the corresponding steps in the data processing method based on a hierarchical chain network provided by the embodiment of the present application. As shown in fig. 10, the hierarchical chain network-based data processing apparatus 3 may include: a second receiving module 31, an adding module 32, a generating module 33, a consensus module 34 and a second writing module 35.
A second receiving module 31, configured to receive a verification result sent by the first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the account service node executes the first sub-chain block;
the adding module 32 is configured to add the first block information corresponding to the first sub-chain block to the to-be-packaged block information set if the verification result is that the consensus passes;
a generating module 33, configured to generate combined consensus data according to the set of block information to be packaged;
the consensus module 34 is configured to package the combined consensus data to a main chain block, and initiate a consensus request for the main chain block to the consensus node cluster, so that the consensus node cluster performs blockchain consensus on the main chain block according to the consensus request to obtain a consensus result;
the second writing module 35 is configured to write the main chain block into the main chain corresponding to the consensus network if the consensus result is that the consensus passes.
The specific implementation manner of the second receiving module 31, the adding module 32, the generating module 33, the consensus module 34, and the second writing module 35 may refer to the specific description of step S301 to step S305 in the embodiment corresponding to fig. 7, and the detailed description is omitted here.
The block information set to be packaged comprises M block hashes, wherein M is a positive integer; the M block hashes include a first block hash; the first block hash belongs to first block information; the sub-chain identifiers corresponding to the M block hashes are different; the sub-chain identifier is used for uniquely identifying a sub-chain corresponding to a service network; each service network belongs to a hierarchical chain network;
the generating module 33 includes: bitmap generation unit 331, tree generation unit 332, and data generation unit 333.
The bitmap generation unit 331 is configured to generate a sub-link bitmap according to the sub-link identifiers corresponding to the M pieces of block information respectively;
the tree generating unit 332 is configured to generate a merck tree corresponding to the M pieces of block information according to the position order of the sub-chain identifiers corresponding to the M pieces of block information in the sub-chain bitmap; the merck tree includes a merck tree root;
the data generating unit 333 is configured to generate the merged consensus data according to the sub-link bitmap and the merck tree root.
The specific implementation manner of the bitmap generation unit 331, the tree generation unit 332, and the data generation unit 333 may refer to the specific description of step S303 in the embodiment corresponding to fig. 7, which is not described herein.
The hierarchical chain network comprises N service networks, wherein N is a positive integer greater than or equal to M; the service networks corresponding to the M block hashes belong to N service networks;
the bitmap generation unit 331 includes: a graph acquisition subunit 3311 and a graph update subunit 3312.
A graph acquisition subunit 3311, configured to acquire an initial sub-chain bitmap; the initial sub-link bitmap comprises sub-link identifiers corresponding to the N service networks respectively and marking states corresponding to the sub-link identifiers; the marking state corresponding to each sub-chain mark in the initial sub-chain bitmap is an unmarked state;
and the map updating subunit 3312 is configured to update the marking states corresponding to the sub-chain identifiers corresponding to the M pieces of block information in the initial sub-chain bitmap to marking states, so as to obtain the sub-chain bitmap.
The specific implementation manner of the graph obtaining subunit 3311 and the graph updating subunit 3312 may refer to the specific description of step S303 in the embodiment corresponding to fig. 7, which is not described herein.
Wherein, the above-mentioned data processing device 3, still include: the sub-chain data query module 36.
A sub-chain data query module 36 for receiving a data query request for a first sub-chain; the first sub-chain is a sub-chain corresponding to the first sub-chain block; the data query request comprises a first sub-chain identifier corresponding to the first sub-chain;
The sub-link data query module 36 is further configured to determine a query verification node according to the first sub-link identifier, and forward a data query request to the query verification node; the query verification node belongs to a first verification node cluster; the verification nodes in the first verification node cluster are all stored with a first sub-chain;
the sub-chain data query module 36 is further configured to receive a data query result returned by the query verification node according to the data query request.
The specific implementation of the sub-link data query module 36 may refer to the optional description of step S305 in the embodiment corresponding to fig. 7, which is not repeated here.
Referring to fig. 11, fig. 11 is a schematic structural diagram of a computer device according to an embodiment of the application. As shown in fig. 11, the data processing apparatus in any of the above embodiments may be applied to a computer device 1000, and the computer device 1000 may include: processor 1001, network interface 1004, and memory 1005, and in addition, the above-described computer device 1000 may further include: a user interface 1003, and at least one communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display (Display), a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface, among others. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk memory. The memory 1005 may also optionally be at least one storage device located remotely from the processor 1001. As shown in fig. 11, an operating system, a network communication module, a user interface module, and a device control application may be included in the memory 1005, which is one type of computer-readable storage medium.
In the computer device 1000 shown in fig. 11, the network interface 1004 may provide a network communication network element; while user interface 1003 is primarily used as an interface for providing input to a user; the processor 1001 may be configured to invoke the device control application stored in the memory 1005 to implement the description of the data processing method in any of the embodiments corresponding to fig. 3, 6 and 7, which is not described herein. In addition, the description of the beneficial effects of the same method is omitted.
Furthermore, it should be noted here that: the embodiment of the present application further provides a computer readable storage medium, in which the computer program executed by the aforementioned data processing apparatus 1 is stored, and the computer program includes program instructions, when executed by the aforementioned processor, can execute the description of the data processing method in any of the foregoing embodiments corresponding to fig. 3, 6, and 7, and therefore, a detailed description will not be given here. In addition, the description of the beneficial effects of the same method is omitted. For technical details not disclosed in the embodiments of the computer-readable storage medium according to the present application, please refer to the description of the method embodiments of the present application.
The computer readable storage medium may be the data processing apparatus provided in any one of the foregoing embodiments or an internal storage unit of the computer device, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash card (flash card) or the like, which are provided on the computer device. Further, the computer-readable storage medium may also include both internal storage units and external storage devices of the computer device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.
Furthermore, it should be noted here that: embodiments of the present application also provide a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium and executes the computer instructions to cause the computer device to perform the method provided by any of the corresponding embodiments of fig. 3, 6, 7, previously described.
Referring to FIG. 12, FIG. 12 is a block diagram of a data processing system based on a hierarchical chain network according to an embodiment of the present application. As shown in fig. 12, the data processing system 2000 may include an ledger service device 2001, a scheduling device 2002, and a consensus device 2003. The data processing apparatus 1 in the embodiment corresponding to fig. 8 may be applied to the ledger service device 2001, where the ledger service device 2001 may be a computer device described in the embodiment corresponding to fig. 3, and may be used to execute the description of the data processing method in the embodiment corresponding to fig. 3, and the structure of the data processing apparatus may refer to the computer device in the embodiment corresponding to fig. 11, which is not described herein. The data processing apparatus 2 in the embodiment corresponding to fig. 9 may be applied to the scheduling device 2002, where the scheduling device 2002 may be a computer device described in the embodiment corresponding to fig. 6, and may be used to execute the description of the data processing method in the embodiment corresponding to fig. 6, and the structure of the data processing apparatus may be referred to the computer device in the embodiment corresponding to fig. 11, which is not described herein again. The data processing apparatus 3 in the embodiment corresponding to fig. 10 may be applied to the consensus device 2003, where the consensus device 2003 may be a computer device described in the embodiment corresponding to fig. 7, and may be used to execute the description of the data processing method in the embodiment corresponding to fig. 7, and the structure of the data processing apparatus may be referred to the computer device in the embodiment corresponding to fig. 11, which is not described herein again. In addition, the description of the beneficial effects of the same method is not repeated.
In the data processing system 2000 shown in fig. 12, the ledger service device 2001 may be located in a service network in a hierarchical chain network, the scheduling device 2002 and the consensus device 2003 may be located in a consensus network in the hierarchical chain network, communication may be performed between the ledger service device 2001 and the scheduling device 2002 through a hierarchical chain channel (may refer to the hierarchical chain channel in the embodiment corresponding to fig. 2 described above), and the scheduling device 2002 and the consensus device 2003 are located in the consensus network, and may directly communicate through a network connection.
The terms first, second and the like in the description and in the claims and drawings of embodiments of the application are used for distinguishing between different objects and not for describing a particular sequential order. Furthermore, the term "include" and any variations thereof is intended to cover a non-exclusive inclusion. For example, a process, method, apparatus, article, or device that comprises a list of steps or elements is not limited to the list of steps or modules but may, in the alternative, include other steps or modules not listed or inherent to such process, method, apparatus, article, or device.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps described in connection with the embodiments disclosed herein may be embodied as electronic hardware, as a computer software, or in a combination of the two, and that the elements and steps of the examples have been generally described in terms of network elements in the foregoing description to clearly illustrate the interchangeability of hardware and software. Whether these network elements are implemented in hardware or software depends on the specific application and design constraints of the solution. The skilled person may use different methods for implementing the described network elements for each specific application, but such implementation should not be considered to be beyond the scope of the present application.
The foregoing disclosure is illustrative of the present application and is not to be construed as limiting the scope of the application, which is defined by the appended claims.

Claims (20)

1. A data processing method based on a hierarchical chain network, wherein the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a scheduling node, a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
when service data sent by a service node in the first service network is obtained, packaging the service data into a first sub-chain block, and executing the first sub-chain block to obtain a block execution result;
writing the block execution result of the first sub-chain block into a first sub-chain corresponding to the first service network;
transmitting the first sub-chain block and the block execution result to the scheduling node, so that the scheduling node transmits the first sub-chain block and the block execution result to the first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the execution result of the first sub-chain block and the block; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes;
When a block containing the first block information is stored in a backbone of the consensus network, it is determined that the first sub-chain block in the first sub-chain belongs to a block for which the backbone has been verified.
2. The method as recited in claim 1, further comprising:
receiving a main chain block corresponding to the consensus network, and synchronizing the main chain block in a main chain corresponding to the consensus network; the main chain block is a block which is commonly recognized by the commonly recognized node cluster;
if the first block information is found in the main chain blocks, determining that the block containing the first block information is stored in the main chain corresponding to the consensus network;
if the first block information is not found in the main chain blocks, determining that the block containing the first block information is not stored in the main chain corresponding to the consensus network.
3. The method as recited in claim 2, further comprising:
if the combined consensus data is not acquired in the main chain block, determining that the first block information is not found in the main chain block; the merging consensus data comprises block information of sub-chain blocks respectively corresponding to one or more service networks contained in the hierarchical chain network.
4. A method according to claim 2 or 3, further comprising:
if the combined consensus data is obtained from the main chain block, searching block information of the combined consensus data;
if the first block information is not found in the combined consensus data, determining that the first block information is not found in the main chain block;
and if the first block information is found in the combined consensus data, determining to find the first block information in the main chain block.
5. The method of claim 4, wherein the first chunk information comprises a first chunk hash corresponding to the first subchain chunk; the merging consensus data comprises a merck tree and a sub-chain bitmap; the merck tree is generated by the consensus node cluster according to block hashes respectively corresponding to one or more sub-chain blocks which pass the verification result as a consensus; the sub-link bitmap comprises a sub-link identifier corresponding to each sub-link contained in the hierarchical link network and a marking state corresponding to each sub-link identifier; a sub-chain identification for uniquely identifying a sub-chain;
the block information searching for the combined consensus data comprises the following steps:
If the marking state corresponding to the target sub-chain mark is determined to be an unmarked state through the sub-chain bitmap, determining that the first block information is not found in the combined consensus data; the target sub-chain identifier is a sub-chain identifier corresponding to the first sub-chain;
if the marking state corresponding to the target sub-chain mark is determined to be marked state through the sub-chain bitmap, K Merker tree node hashes associated with the target sub-chain mark are obtained from the Merker tree, wherein K is a positive integer;
performing merck node verification on the first block hash according to the K merck tree node hashes and the merck tree root hashes corresponding to the merck tree to obtain a verification result;
if the verification result is a verification passing result, determining that the first block information is found in the combined consensus data;
and if the verification result is a verification failure result, determining that the first block information is not found in the combined consensus data.
6. The method according to claim 5, wherein performing the merck node verification on the first chunk hash according to the K merck node hashes and the merck tree root corresponding to the merck tree, to obtain a verification result includes:
Sequentially obtaining the ith merck tree node hash according to the tree node positions corresponding to the K merck tree node hashes in the merck tree; i is a positive integer less than or equal to K;
performing hash operation on the ith merck tree node hash and the (i-1) th verification hash to obtain the ith verification hash, and comparing the kth verification hash with the merck tree root hash until the kth verification hash is obtained; when i is 1, the i-1 th verification hash is the first block hash;
if the Kth verification hash is different from the Merker tree root hash, determining that the verification result is a verification failure result;
and if the Kth verification hash is the same as the merck tree root hash, determining that the verification result is a verification passing result.
7. A data processing method based on a hierarchical chain network, which is characterized in that the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
receiving a block execution result corresponding to a first sub-chain block; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block;
Determining the first verification node cluster associated with a first sub-chain corresponding to the first service network in the consensus network;
transmitting the first sub-chain block and a block execution result corresponding to the first sub-chain block to the first verification node cluster, so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into the block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
8. The method of claim 7, wherein the consensus network further comprises a cluster of authentication nodes; the first verification node cluster belongs to the verification node cluster;
the determining, in the consensus network, the first authentication node cluster associated with a first sub-chain corresponding to the first service network, including:
acquiring a sub-chain verification mapping table; the sub-chain verification mapping table comprises one or more sub-chain identifiers and verification nodes associated with each sub-chain identifier; each verification node belongs to the verification node cluster; the number of sub-chain identifications associated with one verification node is one or more;
And determining the verification node associated with the first sub-chain identifier corresponding to the first sub-chain in the sub-chain verification mapping table as a first verification node cluster.
9. The method according to claim 7 or 8, wherein the authentication node cluster comprises a first authentication node; the first verification node associates H sub-link identifiers in a sub-link verification mapping table, wherein H is a positive integer; the method further comprises the steps of:
acquiring computing power resource occupation information in a consensus operation period, which is sent by the first verification node;
if the computational power resource occupation information exceeds a first computational power threshold, acquiring a target sub-chain identifier from the H sub-chain identifiers;
selecting a second authentication node from the authentication node cluster; the computational power resource occupation information of the second verification node in the common operation period is lower than a second computational power threshold value; the first computational force threshold is greater than the second computational force threshold;
and updating the first verification node associated with the target sub-chain identification into the second verification node in the sub-chain verification mapping table.
10. The method of claim 7, wherein the hierarchical chain network further comprises a second traffic network; the second service network is independent of the consensus network;
The method further comprises the steps of:
receiving a verification node cluster allocation request aiming at the second service network; the verification node cluster allocation request comprises a second sub-link identifier corresponding to a second sub-link corresponding to the second service network;
determining node allocation quantity according to the verification node cluster allocation request;
selecting verification nodes corresponding to the node distribution number from the verification node clusters to serve as second verification node clusters;
and recording the association relation between the second sub-chain identification and the second verification node cluster in a sub-chain verification mapping table.
11. A data processing method based on a hierarchical chain network, which is characterized in that the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the method is performed by a computer device; the method comprises the following steps:
receiving a verification result sent by the first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block;
If the verification result is that the consensus passes, adding first block information corresponding to the first sub-chain block to a block information set to be packaged;
generating merging consensus data according to the block information set to be packaged;
packaging the combined consensus data to a main chain block, and initiating a consensus request aiming at the main chain block to the consensus node cluster so that the consensus node cluster performs block consensus on the main chain block according to the consensus request to obtain a consensus result;
and if the consensus result is that the consensus passes, writing the main chain block into a main chain corresponding to the consensus network.
12. The method of claim 11, wherein the set of block information to be packaged comprises M block hashes, M being a positive integer; the M block hashes include a first block hash; the first chunk hash belongs to the first chunk information; the sub-chain identifiers respectively corresponding to the M block hashes are different; the sub-chain identifier is used for uniquely identifying a sub-chain corresponding to a service network; each service network belongs to the hierarchical chain network;
the generating the merging consensus data according to the block information set to be packaged comprises the following steps:
Generating a sub-chain bitmap according to the sub-chain identifiers respectively corresponding to the M pieces of block information;
generating a merck tree corresponding to the M block information according to the position sequence of the sub-chain identifiers corresponding to the M block information in the sub-chain bitmap; the merck tree comprises a merck tree root;
and generating merging consensus data according to the subchain map and the merck tree root.
13. The method of claim 12, wherein the hierarchical chain network comprises N service networks, N being a positive integer greater than or equal to M; the service networks corresponding to the M block hashes belong to the N service networks;
generating a sub-link bitmap according to the sub-link identifiers respectively corresponding to the M pieces of block information includes:
acquiring an initial sub-link bitmap; the initial sub-link bitmap comprises sub-link identifiers respectively corresponding to the N service networks and marking states corresponding to the sub-link identifiers; the marking state corresponding to each sub-chain mark in the initial sub-chain bitmap is an unmarked state;
and updating the marking states corresponding to the sub-chain identifiers corresponding to the M pieces of block information in the initial sub-chain bitmap to marked states to obtain a sub-chain bitmap.
14. The method according to any one of claims 11-13, further comprising:
receiving a data query request for a first sub-chain; the first sub-chain is a sub-chain corresponding to the first sub-chain block; the data query request comprises a first sub-chain identifier corresponding to the first sub-chain;
determining a query verification node according to the first sub-chain identifier, and forwarding the data query request to the query verification node; the query verification node belongs to the first verification node cluster; the verification nodes in the first verification node cluster all store the first sub-chain;
and receiving a data query result returned by the query verification node according to the data query request.
15. A data processing apparatus based on a hierarchical chain network, wherein the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a scheduling node, a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
the acquisition module is used for packing the service data into a first sub-chain block when acquiring the service data sent by the service node in the first service network, and executing the first sub-chain block to obtain a block execution result;
The first writing module is used for writing the first sub-chain block and the block execution result into a first sub-chain corresponding to the first service network;
the first sending module is used for sending the first sub-chain block and the block execution result to the scheduling node so that the scheduling node sends the first sub-chain block and the block execution result to the first verification node cluster; the first verification node cluster is used for carrying out consensus verification on the execution result of the first sub-chain block and the block; the first block information corresponding to the first sub-chain block is used for being packed into a block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes;
and the first determining module is used for determining that the first sub-chain block in the first sub-chain belongs to a block verified by the main chain when the block containing the first block information is stored in the main chain corresponding to the consensus network.
16. A data processing apparatus based on a hierarchical chain network, wherein the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
The first receiving module is used for receiving a first sub-chain block and a block execution result corresponding to the first sub-chain block; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block;
a second determining module, configured to determine, in the consensus network, the first authentication node cluster associated with a first sub-chain corresponding to the first service network;
the second sending module is used for sending the first sub-chain block and the block execution result corresponding to the first sub-chain block to the first verification node cluster so that the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; and the first block information corresponding to the first sub-chain block is used for being packed into the block generated by the consensus node cluster when the verification result of the consensus verification is that the consensus passes.
17. A data processing apparatus based on a hierarchical chain network, wherein the hierarchical chain network comprises a consensus network and a first service network; the consensus network comprises a first verification node cluster and a consensus node cluster; the first service network is independent of the consensus network; the apparatus is operated by a computer device; the device comprises:
The second receiving module is used for receiving the verification result sent by the first verification node cluster; the verification result is obtained after the first verification node cluster performs consensus verification on the first sub-chain block and the block execution result; the first sub-chain block is generated by packing account book service nodes in the first service network according to service data sent by service nodes in the first service network; the block execution result is obtained after the ledger wall service node executes the first sub-chain block;
the adding module is used for adding the first block information corresponding to the first sub-chain block to the block information set to be packaged if the verification result is that the consensus passes;
the generation module is used for generating combined consensus data according to the block information set to be packaged;
the consensus module is used for packaging the combined consensus data to a main chain block, and initiating a consensus request for the main chain block to the consensus node cluster so that the consensus node cluster performs block consensus on the main chain block according to the consensus request to obtain a consensus result;
and the second writing module is used for writing the main chain block into the main chain corresponding to the consensus network if the consensus result is that the consensus passes.
18. A computer device, comprising: a processor, a memory, and a network interface;
the processor is connected to the memory, the network interface for providing data communication functions, the memory for storing program code, the processor for invoking the program code to perform the method of any of claims 1-14.
19. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-14.
20. A computer program product comprising computer programs/instructions which, when executed by a processor, are adapted to carry out the method of any one of claims 1-14.
CN202311006036.6A 2023-08-10 2023-08-10 Data processing method, device, equipment and readable storage medium Active CN116760632B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311006036.6A CN116760632B (en) 2023-08-10 2023-08-10 Data processing method, device, equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311006036.6A CN116760632B (en) 2023-08-10 2023-08-10 Data processing method, device, equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN116760632A true CN116760632A (en) 2023-09-15
CN116760632B CN116760632B (en) 2023-11-03

Family

ID=87953524

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311006036.6A Active CN116760632B (en) 2023-08-10 2023-08-10 Data processing method, device, equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN116760632B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050402A (en) * 2014-06-12 2014-09-17 深圳市汇顶科技股份有限公司 Mobile terminal security certification method and system and mobile terminal
CN105760723A (en) * 2014-12-15 2016-07-13 联芯科技有限公司 Mobile terminal and unlocking method thereof
CN106897591A (en) * 2015-12-18 2017-06-27 小米科技有限责任公司 unlocking method and device
CN109508982A (en) * 2018-11-21 2019-03-22 北京蓝石环球区块链科技有限公司 REPB common recognition based on the more subchains of block chain main chain adduction row
CN109558064A (en) * 2017-09-25 2019-04-02 航天信息股份有限公司 A kind of synchronous method, device, medium and the electronic equipment of electronic invoice data chain
CN111339086A (en) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN111612614A (en) * 2019-02-26 2020-09-01 傲为信息技术(江苏)有限公司 Public link-based sub-chain service system
CN113421097A (en) * 2021-08-23 2021-09-21 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and storage medium
CN113609215A (en) * 2021-07-07 2021-11-05 深圳云科能源科技有限公司 Data processing method, device, equipment and computer readable storage medium
WO2023045620A1 (en) * 2021-09-24 2023-03-30 腾讯科技(深圳)有限公司 Transaction data processing method and apparatus, computer device and storage medium
CN115988133A (en) * 2017-06-02 2023-04-18 华为技术有限公司 Unlocking method and device
CN116055052A (en) * 2021-10-28 2023-05-02 腾讯科技(深圳)有限公司 Block chain-based data processing method, device, equipment and readable storage medium
CN116150260A (en) * 2021-11-23 2023-05-23 腾讯科技(深圳)有限公司 Data processing method, device, medium and electronic equipment of block chain system

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050402A (en) * 2014-06-12 2014-09-17 深圳市汇顶科技股份有限公司 Mobile terminal security certification method and system and mobile terminal
CN105760723A (en) * 2014-12-15 2016-07-13 联芯科技有限公司 Mobile terminal and unlocking method thereof
CN106897591A (en) * 2015-12-18 2017-06-27 小米科技有限责任公司 unlocking method and device
CN115988133A (en) * 2017-06-02 2023-04-18 华为技术有限公司 Unlocking method and device
CN109558064A (en) * 2017-09-25 2019-04-02 航天信息股份有限公司 A kind of synchronous method, device, medium and the electronic equipment of electronic invoice data chain
CN109508982A (en) * 2018-11-21 2019-03-22 北京蓝石环球区块链科技有限公司 REPB common recognition based on the more subchains of block chain main chain adduction row
CN111612614A (en) * 2019-02-26 2020-09-01 傲为信息技术(江苏)有限公司 Public link-based sub-chain service system
CN111339086A (en) * 2020-02-18 2020-06-26 腾讯科技(深圳)有限公司 Block processing method, and data query method and device based on block chain
CN113609215A (en) * 2021-07-07 2021-11-05 深圳云科能源科技有限公司 Data processing method, device, equipment and computer readable storage medium
CN113421097A (en) * 2021-08-23 2021-09-21 腾讯科技(深圳)有限公司 Data processing method and device, computer equipment and storage medium
WO2023024742A1 (en) * 2021-08-23 2023-03-02 腾讯科技(深圳)有限公司 Data processing method and apparatus, and computer device and storage medium
WO2023045620A1 (en) * 2021-09-24 2023-03-30 腾讯科技(深圳)有限公司 Transaction data processing method and apparatus, computer device and storage medium
CN116055052A (en) * 2021-10-28 2023-05-02 腾讯科技(深圳)有限公司 Block chain-based data processing method, device, equipment and readable storage medium
CN116150260A (en) * 2021-11-23 2023-05-23 腾讯科技(深圳)有限公司 Data processing method, device, medium and electronic equipment of block chain system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
付颖赫;: "区块链技术在电子发票领域的应用研究――基于财务共享视角", 财会通讯, no. 21 *

Also Published As

Publication number Publication date
CN116760632B (en) 2023-11-03

Similar Documents

Publication Publication Date Title
CN102859935B (en) Virtual machine remote is utilized to safeguard the system and method for the multiple clients in electric network
CN112003703A (en) Method and device for sending authenticable message in cross-link mode
CN113570466B (en) Transaction data processing method and device and readable storage medium
CN112632629B (en) Voting management method, device, medium and electronic equipment based on block chain
CN111931220B (en) Consensus processing method, device, medium and electronic equipment for block chain network
CN109493052B (en) Cross-chain contract system based on main chain and parallel multiple sub-chains
CN113256297B (en) Data processing method, device and equipment based on block chain and readable storage medium
CN114363352B (en) Cross-chain interaction method of Internet of things system based on block chain
CN116827957B (en) Information processing method, device, equipment and medium based on multi-block chain
CN111241188A (en) Consensus method in block chain network, node and storage medium
CN112948866A (en) Data processing method, device and equipment and readable storage medium
CN113111125A (en) Business evidence storage method based on block chain
CN116760632B (en) Data processing method, device, equipment and readable storage medium
CN117010889A (en) Data processing method, device, equipment, medium and product
US11343107B2 (en) System for method for secured logging of events
CN116070191A (en) Information processing method and device, storage medium, and program product
CN116975158B (en) Request processing method, apparatus, computer device and storage medium
CN116708463B (en) Information processing method, device, equipment and medium based on multi-block chain
CN117057806B (en) Data processing method and device based on block chain and related equipment
CN115001707B (en) Device authentication method based on block chain and related device
CN117453654A (en) Version processing method and device based on block chain and related equipment
CN117333178A (en) Data processing method and device based on block chain and related equipment
CN117992534A (en) Multi-block-chain-based data cross-chain method, related equipment, medium and product
CN117372016A (en) Block chain-based data processing method, device, equipment and readable storage medium
CN118041839A (en) Multi-block chain data processing method, device, equipment, medium and product

Legal Events

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

Ref country code: HK

Ref legal event code: DE

Ref document number: 40092308

Country of ref document: HK