CN113506100A - Alliance link data processing method and device, computer equipment and storage medium - Google Patents

Alliance link data processing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN113506100A
CN113506100A CN202110713074.XA CN202110713074A CN113506100A CN 113506100 A CN113506100 A CN 113506100A CN 202110713074 A CN202110713074 A CN 202110713074A CN 113506100 A CN113506100 A CN 113506100A
Authority
CN
China
Prior art keywords
node
target
current node
consensus
information
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
CN202110713074.XA
Other languages
Chinese (zh)
Other versions
CN113506100B (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.)
Netease Hangzhou Network Co Ltd
Original Assignee
Netease Hangzhou Network 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 Netease Hangzhou Network Co Ltd filed Critical Netease Hangzhou Network Co Ltd
Priority to CN202110713074.XA priority Critical patent/CN113506100B/en
Publication of CN113506100A publication Critical patent/CN113506100A/en
Application granted granted Critical
Publication of CN113506100B publication Critical patent/CN113506100B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/085Payment architectures involving remote charge determination or related payment systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

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

Abstract

The embodiment of the application discloses a alliance link data processing method and device, computer equipment and a storage medium. Receiving a consensus processing request aiming at all nodes in a alliance chain network through a current node, wherein the consensus processing request is used for indicating consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters; if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request; based on the transaction result data, achieving consensus on contract transaction information through the current node and other nodes except the current node in the alliance chain network; and storing the transaction result data to a target account book corresponding to a target node cluster to which the current node belongs through the current node. The storage cost of each node in the alliance-link network is effectively reduced.

Description

Alliance link data processing method and device, computer equipment and storage medium
Technical Field
The present application relates to the field of block chain technologies, and in particular, to a method and an apparatus for processing alliance chain data, a computer device, and a storage medium.
Background
In a alliance chain network formed by a plurality of private chain networks, each private chain network corresponds to a node cluster, and each node cluster comprises at least one node. In the process of executing the PBFT consensus algorithm, when all nodes in a federation chain receive contract transaction information sent by a client, obtain data generated by executing the contract transaction information, and reach consensus based on the contract transaction information, all nodes in the federation chain need to store the data generated by executing the contract transaction information, which greatly increases the storage cost of each node in the network of the federation chain, thereby causing waste of storage resources of each node.
Disclosure of Invention
Embodiments of the present application provide a method and an apparatus for processing federation link data, a computer device, and a storage medium, which effectively reduce storage cost of each node in a federation link network.
The embodiment of the application provides a federation chain data processing method, which comprises the following steps:
receiving a consensus processing request aiming at all nodes in a alliance chain network through a current node, wherein the consensus processing request is used for indicating consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters;
if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when the contract transaction information is executed;
agreeing on the contract transaction information with other nodes in the alliance-link network except the current node through the current node based on the transaction result data;
and storing the transaction result data to a target account book corresponding to the target node cluster to which the current node belongs through the current node.
Correspondingly, an embodiment of the present application further provides a federation chain data processing apparatus, including:
a receiving unit, configured to receive, through a current node, a consensus processing request for all nodes in a federation chain network, where the consensus processing request is used to indicate that consensus processing is performed on contract transaction information, the federation chain network includes at least one node cluster, and the current node belongs to one of the node clusters;
an obtaining unit, configured to obtain, if the current node is a storage settlement node in a target node cluster to which the current node belongs, transaction result data corresponding to contract transaction information in the consensus processing request, where the transaction result data includes related data generated when the contract transaction information is executed;
a consensus unit, configured to agree on the contract transaction information through the current node and other nodes in the alliance-link network except the current node based on the transaction result data;
and the storage unit is used for storing the transaction result data into a target account book corresponding to the target node cluster to which the current node belongs through the current node.
Optionally, the obtaining unit is further configured to:
acquiring a target attribute information set of each node in a target node cluster to which the current node belongs, wherein the target attribute information set comprises at least one piece of node attribute information arranged according to a preset sequence, and one node corresponds to one piece of node attribute information;
determining the block height of a block chain corresponding to a target node cluster to which the current node belongs based on the target book;
determining node attribute information of storage settlement nodes in a target node cluster to which the current node belongs based on the number of node attribute information in the target attribute information set, the preset sequence and the block height;
and if the determined node identification in the node attribute information is the same as the node identification of the current node, determining the current node as a storage settlement node in a target node cluster to which the current node belongs.
Optionally, the obtaining unit is further configured to:
performing remainder calculation on the number of the node attribute information in the target attribute information set and the block height to obtain a remainder;
in the target attribute information set, determining node attribute information with sequence numbers equal to the remainder in the preset sequence;
and taking the determined node attribute information as the node attribute information of the storage settlement node in the target node cluster to which the current node belongs.
Optionally, the obtaining unit is further configured to:
acquiring attribute information sets of all nodes in the alliance chain network from the storage space of the current node, wherein the attribute information sets comprise node attribute information of each node in the alliance chain network, and the node attribute information comprises a node identifier and a cluster identifier of a node cluster to which the node belongs;
acquiring a node identifier of the current node, and determining a target cluster identifier of a target node cluster to which the current node belongs in the attribute information set according to the node identifier of the current node;
and acquiring node attribute information containing the target cluster identifier from the attribute information set to form the target attribute information set.
Optionally, the obtaining unit is further configured to:
if the current node is a storage settlement node in the target node cluster, acquiring historical book data related to the contract transaction information in a target book corresponding to the target node cluster through the current node;
executing the contract transaction information through the current node based on transaction logic contained in the historical ledger data and the contract transaction information, recording the execution process of the contract transaction information, and generating transaction process record data;
according to the transaction process record data, changing account information of the historical account book data through the current node, and generating updated account information;
and forming the transaction result data according to the transaction process record data and the updated account information.
Optionally, the obtaining unit is further configured to:
determining an account book data access agent layer corresponding to the target node cluster;
sending a data acquisition request aiming at the contract transaction information to the ledger data access agent layer, triggering the ledger data access agent layer, and acquiring the historical ledger data related to the contract transaction information in a target ledger corresponding to the target node cluster.
Optionally, the consensus unit is further configured to:
completing a consensus preparation process with other nodes in the alliance-link network except the current node through the current node based on the transaction result data;
and completing a consensus confirmation process with other nodes except the current node in the alliance chain network through the current node based on the transaction result data and the consensus preparation process so as to achieve consensus for the contract transaction information.
Optionally, the consensus unit is further configured to:
generating first consensus preparation information based on the transaction result data, wherein the first consensus preparation information comprises the transaction result data and an identity verification identifier of the current node;
sending the first consensus preparation information to other nodes except the current node in the alliance-link network through the current node;
receiving second consensus preparation information sent by the other node, wherein the second consensus preparation information comprises transaction result data obtained by the other node based on the consensus processing request and an identity authentication identifier of the other node;
and performing identity authentication based on the identity authentication identifier in the second consensus preparation information, and if the number of the second consensus preparation information passing the identity authentication exceeds a first preset value, confirming that the consensus preparation process is completed with the nodes in the alliance chain network.
Optionally, the consensus unit is further configured to:
generating first consensus confirmation information, wherein the first consensus confirmation information comprises the transaction result data, the identity verification identifier of the current node and a consensus completion identifier;
sending the first common identification confirmation information to other nodes except the current node in the alliance-link network through the current node;
receiving second consensus confirmation information sent by other nodes of the alliance chain network except the current node, wherein the second consensus confirmation information comprises transaction result data obtained by the other nodes based on the consensus processing request, identity verification marks of the other nodes and consensus completion marks;
and performing identity verification based on the identity verification identification in the second consensus confirmation information, and if the number of the second consensus confirmation information passing the identity verification exceeds two preset values, confirming that the consensus confirmation process is completed with the nodes in the alliance chain network so as to achieve consensus for the contract transaction information.
Optionally, the obtaining unit is further configured to:
if the transaction result data is stored in the target account book corresponding to the target node cluster, generating successful storage information;
broadcasting the storage success information to nodes except the current node in the target node cluster through the current node.
Optionally, the obtaining unit is further configured to:
if the current node is not a storage settlement node in the target node cluster, receiving the transaction result data sent by the storage settlement node;
if the successful storage information sent by the storage settlement node in the target node cluster is not received within the preset duration after agreement is achieved on the contract transaction information according to the transaction result data, acquiring a first serial number of the storage settlement node in the target node cluster and arranging the first serial number in the corresponding target attribute information set according to a preset sequence;
acquiring a second sequence number of the current node in the target attribute information set according to the preset sequence;
and if the second sequence number is a sequence number adjacent to the first sequence number, storing the transaction result data into a target account book corresponding to the target node cluster through the current node.
Optionally, the storage unit is further configured to:
determining an account book data access agent layer corresponding to the target node cluster to which the current node belongs;
and sending a data storage request aiming at the transaction result data to the account book data access agent layer, and triggering the account book data access agent layer to store the transaction result data into a target account book corresponding to the target node cluster.
Similarly, an embodiment of the present application further provides a computer device, including:
a memory for storing a computer program;
a processor for performing the steps of any of the federation chain data processing methods.
In addition, an embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the steps of any one of the federation chain data processing methods.
The embodiment of the application provides a method and a device for processing alliance chain data, computer equipment and a storage medium, wherein after all nodes in an alliance chain network acquire a consensus processing request, one node is confirmed in each node cluster to serve as a storage settlement node, transaction result data corresponding to contract transaction information in the consensus processing request are acquired, after consensus is achieved on the contract transaction information, the transaction result data are stored into a target account book corresponding to each node cluster only by using the storage settlement node in each node cluster, and all nodes in the alliance chain network are prevented from storing the transaction result data, so that the storage cost of each node in the alliance chain network is effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a system diagram of a federated data processing apparatus provided by an embodiment of the present application;
FIG. 2 is a schematic flowchart of a federation chain data processing method provided in an embodiment of the present application;
FIG. 3 is another schematic flow chart of a federation chain data processing method provided by an embodiment of the present application;
FIG. 4 is a schematic structural diagram of a federation chain data processing apparatus provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the described embodiments are merely exemplary of the invention, and not restrictive of the full scope of the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the application provides a alliance link data processing method and device, computer equipment and a storage medium. Specifically, the federation link data processing method according to the embodiment of the present application may be executed by a computer device, where the computer device may be a terminal or a server or other devices. The terminal may be a terminal device such as a smart phone, a tablet Computer, a notebook Computer, a touch screen, a game machine, a Personal Computer (PC), a Personal Digital Assistant (PDA), and the like, and may further include a client, which may be a game application client, a browser client carrying a game program, or an instant messaging client, and the like. 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 basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content distribution network service, big data and an artificial intelligence platform.
Referring to fig. 1, fig. 1 is a system diagram of a federation link data processing apparatus according to an embodiment of the present application. The system is applied to a alliance-link network. The system can comprise three node clusters, namely a node cluster A, a node cluster B and a node cluster C, wherein the node cluster A comprises a node 11, the node cluster B comprises a node 21, a node 22 and a node 23, and the node cluster C comprises a node 31 and a node 32. The nodes in each node cluster and the nodes in different node clusters may communicate with each other through different networks, for example, the network may be a wireless network or a wired network, and the wireless network may be a Wireless Local Area Network (WLAN), a Local Area Network (LAN), a cellular network, a 2G network, a 3G network, a 4G network, a 5G network, and the like. Each node cluster is correspondingly provided with an account book data access agent layer and a target account book, the target account book can store transaction result data generated after contract transaction information is executed by a corresponding node in a federation chain, the account book data access agent layer is a data access gateway of the target account book corresponding to the node cluster, and each node in the node cluster can acquire or store the transaction result data from the target account book through the corresponding account book data access agent layer. For example, the node cluster a acquires or stores transaction result data from the target ledger a through the ledger data access agent layer a, the node cluster B acquires or stores transaction result data from the target ledger B through the ledger data access agent layer B, and the node cluster C acquires or stores transaction result data from the target ledger C through the ledger data access agent layer C. After a current node in each node cluster of the system receives a consensus processing request aiming at all nodes in a alliance chain network, the consensus processing request is used for indicating to perform consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters; if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when the contract transaction information is executed; based on the transaction result data, achieving consensus on contract transaction information through the current node and other nodes except the current node in the alliance chain network; and storing the transaction result data to a target account book corresponding to a target node cluster to which the current node belongs through the current node.
In addition, embodiments of the present application relate to blockchain technology, which is a decentralized, distributed database technology that is participated in by nodes. The block chain does not have a central mechanism, and the consistency of the information of each node is ensured by a consensus mechanism of the block chain. Blockchains can be generally classified into three major categories, public chains, private chains, and federation chains. A federation chain refers to a block chain that is managed by a preselected number of enterprises or organizations, each of which may manage one or more nodes. One or more nodes managed by each organization or organization form a node cluster. For example, enterprise a, enterprise B, and enterprise C participate in managing nodes in the alliance chain network together, enterprise a manages a node cluster a shown in fig. 1, enterprise B manages a node cluster B, and enterprise C manages a node cluster C, account transactions among the nodes managed by each enterprise can be performed, enterprise a records the account transaction situation among the nodes managed by each enterprise by using a target account book a, enterprise B records the account transaction situation among the nodes managed by each enterprise by using a target account book B, and enterprise C records the account transaction situation among the nodes managed by each enterprise by using a target account book C.
The following are detailed below. It should be noted that the following description of the embodiments is not intended to limit the preferred order of the embodiments.
The present embodiment will be described from the perspective of a alliance-chain data processing apparatus, which may be specifically integrated in a terminal device, where the terminal device may include a smart phone, a notebook computer, a tablet computer, a personal computer, and the like.
The federation chain data processing method provided in the embodiment of the present application may be executed by a processor of a terminal, as shown in fig. 2, a specific flow of the federation chain data processing method mainly includes steps 201 to 204, which are described in detail as follows:
step 201, receiving a consensus processing request for all nodes in the alliance chain network through a current node, where the consensus processing request is used to indicate to perform consensus processing on agreement transaction information, the alliance chain network includes at least one node cluster, and the current node belongs to one of the node clusters.
In the embodiment of the application, when one or more users want to deploy a new intelligent contract in the alliance-chain network, a consensus processing request can be sent to one or more nodes in the alliance-chain network through the client, wherein the consensus processing request can comprise contract transaction information of the intelligent contract to be deployed and is used for indicating consensus processing on the contract transaction information. The contract transaction request may further include information such as a time when the user sent the contract transaction information, a client identifier, a specific operation for processing data, and/or a client signature. The contract transaction information may be specific content of the corresponding intelligent contract, i.e., the contract transaction information may include the transaction logic of the intelligent contract for each transaction.
For example, after any node cluster receives the consensus processing request through the current node, the contract transaction information is obtained from the consensus processing request through the current node, and according to the instruction of the consensus processing request, the current node agrees with other nodes except the current node in the alliance chain network on the contract transaction information, so that the storage settlement nodes in the node clusters are triggered to send the persistence requests for the contract transaction information, and the transaction result data generated by executing the contract transaction information can be stored in the target ledger corresponding to the node clusters in the alliance chain network.
In this embodiment of the present application, the current node is a node in the target node cluster that receives the consensus processing request, and may be any one node in the target node cluster. The target node cluster may be any one of the node clusters included in the federated coalition network.
Step 202, if the current node is a storage settlement node in the target node cluster to which the current node belongs, obtaining transaction result data corresponding to the contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when executing the contract transaction information.
In this embodiment of the present application, before "if the current node is a storage settlement node in a target node cluster to which the current node belongs and transaction result data corresponding to contract transaction information in the consensus processing request is obtained" in step 202, the target node cluster further needs to determine whether the current node is a storage settlement node in the target node cluster, and there may be two methods for determining whether the current node is a storage settlement node in the target node cluster, where the first method is to calculate a node identifier of the storage settlement node in the target node cluster according to a preset node determination logic, determine whether the node identifier of the current node is equal to the calculated node identifier, and if so, the current node is the storage settlement node in the target node cluster, and execute the contract transaction information by the storage settlement node to generate transaction result data. The second method is that all nodes in a node cluster acquire historical account book data related to contract transaction information, contract transaction information is executed based on transaction logic contained in the historical account book data and the contract transaction information, transaction result data is generated, the node which finishes generating the transaction result data firstly is used as a storage settlement node in a target node cluster, the storage settlement node sends calculation finishing information to other nodes in the same node cluster, other nodes in the same node cluster are informed to stop executing the contract transaction information, and then the node which finishes executing firstly broadcasts all generated transaction result data to other nodes in the same node cluster.
When the first method is adopted, the specific confirmation process can be implemented by the following steps S2021 to S2024:
step S2021: the method comprises the steps of obtaining a target attribute information set of each node in a target node cluster to which a current node belongs, wherein the target attribute information set comprises at least one piece of node attribute information which is arranged according to a preset sequence, and one node corresponds to one piece of node attribute information.
In this embodiment of the present application, the target attribute information set of each node in the target node cluster may be in the form of a list, that is, the node attribute information of each node in the target node cluster may form a cluster node information list according to a preset sequence. The node attribute information may include a node identifier of each node, a cluster identifier of a node cluster to which the node belongs, and a network access sequence number of each node joining the node cluster. The node identifier is information for uniquely distinguishing each node, and the cluster identifier is information for uniquely distinguishing different clusters, for example, the node identifier may be information such as a node name and a node number, and the cluster identifier may be information such as a cluster name.
In this embodiment of the present application, the preset sequence may be a sequence from a small network access serial number to a large network access serial number of each node.
In this embodiment of the application, the step S2021 of "obtaining the target attribute information set of each node in the target node cluster to which the current node belongs" may specifically be: acquiring attribute information sets of all nodes in the alliance link network from a storage space of a current node, wherein the attribute information sets comprise node attribute information of each node in the alliance link network, and the node attribute information comprises a node identifier and a cluster identifier of a node cluster to which the node belongs; acquiring a node identifier of a current node, and determining a target cluster identifier of a target node cluster in an attribute information set according to the node identifier of the current node; and acquiring node attribute information containing the target cluster identifier from the attribute information set to form a target attribute information set.
In this embodiment of the present application, the attribute information sets of all nodes may be deployed in the storage spaces of all nodes in the federation chain network in advance, where the attribute information sets of all nodes may be arranged in a list form, that is, a preset node information list, where the preset node information list may include node attribute information of each node in the federation chain, and after one of the nodes acquires the preset node information list, relevant information of all nodes in the federation chain may be seen in the preset node information list, so as to perform relevant operations.
For example, referring to the schematic diagram of the federation chain system shown in fig. 1, where fig. 1 includes 6 nodes, the preset node information list may include six pieces of node attribute information corresponding to the 6 nodes, which are respectively shown as follows:
{nodeId:“ab2323c1”,agent:“enterprise1”,name:“node1_1”,index:1},
{nodeId:“bb2333c1”,agent:“enterprise2”,name:“node2_1”,index:2},
{nodeId:“bb2323c1”,agent:“enterprise2”,name:“node2_2”,index:3},
{nodeId:“cb2333c1”,agent:“enterprise2”,name:“node2_3”,index:4},
{nodeId:“db2333c1”,agent:“enterprise3”,name:“node3_1”,index:5},
{nodeId:“eb2333c1”,agent:“enterprise3”,name:“node3_2”,index:6}
the nodeId is a node number corresponding to the node, the agent is a cluster identifier of a node cluster to which the node belongs, the name is a node name corresponding to the node, and the index is a network access serial number of the node, namely a serial number of the corresponding node added into the node cluster.
In addition, the current node obtains its node number bb2333c1, as its node identifier, obtains node attribute information including its node number in a preset node information list, that is, { node id: "bb 2333c 1", agent: "enterprise file 2", name: "node 2_ 1", index:2}, obtains the cluster identifier of the target node cluster in the node attribute information including its node number as enterprise file 2, and then obtains node attribute information including cluster identifier enterprise file 2, specifically, { node id: "bb 2323c 1", agent: "enterprise file 2", name: "node 5 _ 2", index:3} and { node id: "cb 2333c 35", 46agent: "enterprise file 2", node id: "82925:" node 38725: "3874", from the preset node information list, thereby obtaining all the node attribute information of the target node list.
In addition, when the preset sequence is a serial number of a node added to a node cluster, all candidate node attribute information may be arranged according to the network access serial number of the node, so as to form a final cluster node information list, specifically, the cluster node information list may be
{nodeId:“bb2333c1”,agent:“enterprise2”,name:“node2_1”,index:2},
{nodeId:“bb2323c1”,agent:“enterprise2”,name:“node2_2”,index:3},
{nodeId:“cb2333c1”,agent:“enterprise2”,name:“node2_3”,index:4}。
Step S2022: and determining the block height of a block chain corresponding to the target node cluster to which the current node belongs based on the target book.
In this embodiment of the application, the relevant data in the target account book corresponding to each node cluster may be stored in the form of a block chain, so that the number of blocks included in the block chain corresponding to each node cluster, that is, the block height, may be obtained.
In the embodiment of the present application, since each block of the target account book uses the system memory address to identify the position of each block in the system, the memory addresses of each block in the system are sequentially increased, and the memory space occupied by each block is the same, therefore, the storage address value of the first block and the storage address value of the last block in the target account book can be obtained, the storage address value of the last block in the target account book is subtracted by the storage address value of the first block in the same target account book to determine the address increment value of the current last block in the target account book relative to the first block, namely, the total occupied address value of the block chain corresponding to the target account book is obtained, according to the total occupied address value and the address value occupied by each block, the number of blocks included in the block chain corresponding to the target account book can be obtained, and therefore the block height is obtained.
Step S2023: and determining the node attribute information of the storage settlement node in the target node cluster based on the number, the preset sequence and the block height of the node attribute information in the target attribute information set.
In this embodiment of the application, in the step S2023, an implementation manner of "determining the node attribute information of the storage settlement node in the target node cluster to which the node attribute information belongs based on the number, the preset order, and the block height of the node attribute information in the target attribute information set" may specifically be: performing remainder calculation on the number of the node attribute information in the target attribute information set and the block height to obtain a remainder; in the target attribute information set, determining node attribute information with the sequence number equal to the remainder arranged in a preset sequence; and taking the determined node attribute information as the node attribute information of the storage settlement node in the target node cluster.
For example, if the number of pieces of node attribute information in the target attribute information set is 3, the block height of the target account book corresponding to the target node cluster is 10, and the remainder 1 is obtained by dividing 3 by 10, it is determined that the first piece of node attribute information in the target attribute information set is the node attribute information of the required storage settlement node.
In the embodiment of the application, the number of the node attribute information and the block height are subjected to remainder calculation, and the node attribute information corresponding to the obtained remainder is used as the node attribute information of the storage settlement node, so that the node attribute information of the storage settlement node obtained by calculation can be analogized in sequence along with the increase of the block height, the distribution of the node attribute information of the storage settlement node in the target attribute information set is more uniform, and the storage settlement node is determined fairly.
Step S2024: and if the node identification in the determined node attribute information is the same as the node identification of the current node, determining the current node as a storage settlement node in a target node cluster to which the current node belongs.
In this embodiment of the application, after it is determined that the current node is a storage settlement node in the target node cluster, in the step 202, "if the current node is a storage settlement node in the target node cluster to which the current node belongs, the transaction result data corresponding to the contract transaction information in the consensus processing request is obtained" may specifically be: if the current node is a storage settlement node in the target node cluster, acquiring historical book data related to contract transaction information in a target book corresponding to the target node cluster through the current node; executing contract transaction information based on transaction logic contained in the historical account book data and the contract transaction information by the current node, recording the execution process of the contract transaction information, and generating transaction process record data; according to the transaction process record data, changing the account information of the historical account book data through the current node, and generating updated account information; and forming transaction result data according to the transaction process record data and the updated account information.
For example, if the contract transaction information is the virtual currency of the amount predetermined by the user a to the user B, after executing the contract transaction information, the value of the virtual currency originally owned by the user a and the user B before executing the contract transaction information changes along with the execution of the contract transaction information, that is, updated account information is formed, so after executing the contract transaction information, the transaction result data may be the value of the virtual currency owned by each of the user a and the user B, or may be process recording data for executing the contract transaction information, that is, the user a gives the user B the predetermined amount of virtual currency, the user a decreases the predetermined amount of virtual currency, and the user B increases the predetermined amount of virtual currency.
In the embodiment of the application, only the storage settlement nodes in each node cluster need to acquire the historical book data and execute the contract transaction information according to the historical book data to form the transaction result data, and all nodes in the block chain network do not need to execute the contract transaction information to form the transaction result data, so that the operating pressure of each node is reduced.
In this embodiment of the application, an account book data access agent layer may be preset in the federation chain network, and configured to provide an access entry for data in a target account book, and in the target account book corresponding to the target node cluster, acquiring historical account book data related to contract transaction information may be handled through the account book data access agent layer set in the federation chain network, where the specific process may be: determining an account book data access agent layer corresponding to a target node cluster; sending a data acquisition request aiming at contract transaction information to an account book data access agent layer, triggering the account book data access agent layer, and acquiring historical account book data related to the contract transaction information in a target account book corresponding to a target node cluster. The account book data access agent layer may obtain, in the target account book, data including a contract identifier of a contract to which the contract transaction information belongs, that is, historical account book data related to the contract transaction information.
In an embodiment of the application, an account book data access agent layer may be set in the alliance chain network, and the data in the target account book is accessed by the storage and settlement nodes in each node cluster by using one account book data access agent layer. The data access proxy layers of the account book can be set in the alliance chain network, each node cluster corresponds to one account book data access proxy layer, and the storage settlement nodes in each node cluster utilize the account book data access proxy layers corresponding to the node cluster to which the node cluster belongs, so that the data in the target account book can be accessed.
And 203, based on the transaction result data, achieving consensus on the contract transaction information through the current node and other nodes except the current node in the alliance chain network.
In this embodiment of the application, the above-mentioned "agreeing on contract transaction information with a node in the federation chain network based on the transaction result data" in step 203 may be implemented by the following steps S2031 to S2032:
step S2031: and completing the consensus preparation process with other nodes except the current node in the alliance chain network through the current node based on the transaction result data.
In this embodiment of the application, the step S2031 of "completing the consensus preparation process with the current node and the other nodes in the alliance-link network except the current node based on the transaction result data" may specifically be: generating first common identification preparation information based on the transaction result data, wherein the first common identification preparation information comprises the transaction result data and an identity authentication identifier of the current node; sending first consensus preparation information to other nodes except the current node in the alliance-link network through the current node; receiving second consensus preparation information sent by other nodes, wherein the second consensus preparation information comprises transaction result data obtained by the other nodes based on the consensus processing request and identity authentication marks of the other nodes; and performing identity authentication based on the identity authentication identifier in the second consensus preparation information, and if the number of the second consensus preparation information passing the identity authentication exceeds a first preset value, confirming that the node in the alliance chain network completes the consensus preparation process. The first preset value may be two thirds of the number of all nodes in the alliance-link network.
Step S2032: and based on the transaction result data and the consensus preparation process, completing the consensus confirmation process through the current node and other nodes except the current node in the alliance chain network so as to achieve consensus for the contract transaction information.
In this embodiment of the application, in the step S2032, "based on the transaction result data and the consensus preparation process, the current node and other nodes in the alliance-link network except the current node complete the consensus confirmation process to achieve consensus on the contract transaction information" may specifically be: after the node in the alliance chain network completes the consensus confirmation process, the current node generates first consensus confirmation information, wherein the first consensus confirmation information comprises transaction result data, an identity verification identifier of the current node and a consensus completion identifier; sending first consensus confirmation information to other nodes in the alliance chain network through the current node; receiving second consensus confirmation information sent by other nodes in the alliance chain network, wherein the second consensus confirmation information comprises transaction result data obtained by the other nodes based on the consensus processing request, identity authentication identifications of the other nodes and consensus completion identifications; and performing identity authentication based on the identity authentication identifier in the second consensus confirmation information, and if the number of the second consensus confirmation information passing the identity authentication exceeds two preset values, confirming that the nodes in the alliance chain network complete the consensus confirmation process so as to achieve consensus on the contract transaction information. The second preset value may be two thirds of the number of all nodes in the alliance-link network.
And 204, storing the transaction result data to a target account book corresponding to a target node cluster to which the current node belongs through the current node.
In this embodiment of the application, the step 204 of storing the transaction result data in the target account book corresponding to the target node cluster to which the current node belongs through the current node may also be implemented by accessing the agent layer through the account book data preset in the alliance-link network, and the specific process may be: determining an account book data access agent layer corresponding to a target node cluster; and sending a data storage request aiming at the transaction result data to the account book data access agent layer, and triggering the account book data access agent layer to store the transaction result data into a target account book corresponding to the target node cluster.
In the embodiment of the application, under the condition that the current node is a storage settlement node of a target node cluster, if the current node completes the storage of transaction result data in a target account book corresponding to the target node cluster, successful storage information is generated; and the current node broadcasts the storage success information to nodes in the target node cluster except the current node.
In the embodiment of the application, if the current node is not a storage settlement node in the target node cluster, the current node does not acquire historical ledger data related to contract transaction information, and does not execute the contract transaction information according to the historical ledger data to generate transaction result data, but waits for receiving the transaction result data sent by the storage settlement node in the target node cluster. Then the current node achieves consensus with other nodes in the alliance chain network aiming at contract transaction information according to the received transaction result data, if the current node does not receive successful storage information sent by a storage settlement node in the target node cluster within a preset time length after achieving consensus on the contract transaction information according to the transaction result data, the storage settlement node in the target node cluster is obtained, and a first sequence number is arranged in a corresponding target attribute information set according to a preset sequence; acquiring a second sequence number of the current node in the target attribute information set according to a preset sequence; and if the second sequence number is the adjacent sequence number after the first sequence number, storing the transaction result data into a target account book corresponding to the target node cluster through the current node. Therefore, when the storage settlement node of the target node cluster cannot store the commonly-identified transaction result data into the target account book due to the reasons of faults and the like, other nodes of the target node cluster are in a long-term waiting state, and the storage efficiency of the transaction result data is improved.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The embodiment of the application provides a federation chain data processing method, when all nodes in a federation chain network acquire a consensus processing request, one node is confirmed in each node cluster as a storage settlement node, transaction result data corresponding to contract transaction information in the consensus processing request is acquired, and after consensus is achieved for the contract transaction information, the transaction result data are stored in a target account book corresponding to each node cluster by using the storage settlement node in each node cluster, so that all nodes in the federation chain network are prevented from storing the transaction result data, and the storage cost of each node in the federation chain network is effectively reduced.
Referring to fig. 3, fig. 3 is another schematic flow chart of a federation chain data processing method according to an embodiment of the present application. The specific process of the method can be as follows:
step 301, receiving a consensus processing request for all nodes in the alliance-link network through the current node.
For example, the consensus processing request is used for indicating to perform consensus processing on the contract transaction information, the alliance-link network comprises at least one node cluster, and the current node belongs to one of the node clusters.
Step 302, determining whether the current node is a storage settlement node in the target node cluster.
For example, a target attribute information set of each node in a target node cluster is obtained, based on a target book, a block height of a block chain corresponding to the target node cluster is determined, based on the number, preset sequence and block heights of node attribute information in the target attribute information set, node attribute information of a storage settlement node in the target node cluster is determined, and if a node identifier in the determined node attribute information is the same as that of a current node, the current node is determined to be the storage settlement node in the target node cluster.
And 303, if the current node is a storage settlement node in the target node cluster, acquiring transaction result data corresponding to contract transaction information in the consensus processing request.
For example, historical ledger data related to contract transaction information is acquired from a target ledger corresponding to a target node cluster; executing contract transaction information based on transaction logic contained in the historical book data and the contract transaction information, recording the execution process of the contract transaction information, and generating transaction process record data; changing account information of the historical account book data according to the transaction process record data to generate updated account information; and forming transaction result data according to the transaction process record data and the updated account information.
And step 304, if the current node is not the storage settlement node in the target node cluster, waiting for receiving the transaction result data sent by the storage settlement node in the target node cluster.
And 305, agreeing with other nodes except the current node in the alliance-link network on contract transaction information through the current node based on the transaction result data.
For example, the consensus preparation process is completed with the node in the alliance-link network based on the transaction result data, and after the consensus preparation process is completed, the consensus confirmation process is completed with the node in the alliance-link network again based on the transaction result data and the consensus preparation process, so that consensus is achieved for the contract transaction information.
And step 306, if the current node is a storage settlement node in the target node cluster, storing the transaction result data into a target account book corresponding to the target node cluster.
For example, an account book data access agent layer corresponding to the target node cluster is determined; and sending a data storage request aiming at the transaction result data to the account book data access agent layer, and triggering the account book data access agent layer to store the transaction result data into a target account book corresponding to the target node cluster.
And 307, if the current node is not the storage settlement node in the target node cluster, receiving storage completion information sent by the storage settlement node in the target node cluster.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
The embodiment of the application provides a federation chain data processing method, when all nodes in a federation chain network acquire a consensus processing request, one node is confirmed in each node cluster as a storage settlement node, transaction result data corresponding to contract transaction information in the consensus processing request is acquired, and after consensus is achieved for the contract transaction information, the transaction result data are stored in a target account book corresponding to each node cluster by using the storage settlement node in each node cluster, so that all nodes in the federation chain network are prevented from storing the transaction result data, and the storage cost of each node in the federation chain network is effectively reduced.
In order to better implement the federation chain data processing method in the embodiment of the present application, an embodiment of the present application further provides a federation chain data processing apparatus. Referring to fig. 4, fig. 4 is a schematic structural diagram of a federation chain data processing apparatus according to an embodiment of the present application. The alliance-link data processing apparatus may include a receiving unit 401, an obtaining unit 402, a recognizing unit 403, and a storing unit 404.
The receiving unit 401 is configured to receive, through a current node, a consensus processing request for all nodes in an alliance-link network, where the consensus processing request is used to instruct consensus processing on agreement transaction information, the alliance-link network includes at least one node cluster, and the current node belongs to one of the node clusters;
an obtaining unit 402, configured to obtain, if a current node is a storage settlement node in a target node cluster to which the current node belongs, transaction result data corresponding to contract transaction information in the consensus processing request, where the transaction result data includes related data generated when executing the contract transaction information;
a consensus unit 403, configured to agree on contract transaction information through the current node and other nodes in the alliance-link network except the current node based on the transaction result data;
the storage unit 404 is configured to store, by the current node, the transaction result data into a target ledger corresponding to a target node cluster to which the current node belongs.
Optionally, the obtaining unit 402 is further configured to:
acquiring a target attribute information set of each node in a target node cluster to which a current node belongs, wherein the target attribute information set comprises at least one piece of node attribute information arranged according to a preset sequence, and one node corresponds to one piece of node attribute information;
determining the block height of a block chain corresponding to a target node cluster to which the current node belongs based on a target account book;
determining node attribute information of a storage settlement node in a target node cluster to which a current node belongs based on the number, preset sequence and block height of node attribute information in a target attribute information set;
and if the node identification in the determined node attribute information is the same as the node identification of the current node, determining the current node as a storage settlement node in a target node cluster to which the current node belongs.
Optionally, the obtaining unit 402 is further configured to:
performing remainder calculation on the number of the node attribute information in the target attribute information set and the block height to obtain a remainder;
in the target attribute information set, determining node attribute information with the sequence number equal to the remainder arranged in a preset sequence;
and taking the determined node attribute information as the node attribute information of the storage settlement node in the target node cluster to which the current node belongs.
Optionally, the obtaining unit 402 is further configured to:
acquiring attribute information sets of all nodes in the alliance link network from a storage space of a current node, wherein the attribute information sets comprise node attribute information of each node in the alliance link network, and the node attribute information comprises a node identifier and a cluster identifier of a node cluster to which the node belongs;
acquiring a node identifier of a current node, and determining a target cluster identifier of a target node cluster to which the current node belongs in an attribute information set according to the node identifier of the current node;
and acquiring node attribute information containing the target cluster identifier from the attribute information set to form a target attribute information set.
Optionally, the obtaining unit 402 is further configured to:
if the current node is a storage settlement node in the target node cluster, acquiring historical book data related to contract transaction information in a target book corresponding to the target node cluster through the current node;
executing contract transaction information based on transaction logic contained in the historical account book data and the contract transaction information by the current node, recording the execution process of the contract transaction information, and generating transaction process record data;
according to the transaction process record data, changing the account information of the historical account book data through the current node, and generating updated account information;
and forming transaction result data according to the transaction process record data and the updated account information.
Optionally, the obtaining unit 402 is further configured to:
determining an account book data access agent layer corresponding to a target node cluster;
sending a data acquisition request aiming at contract transaction information to an account book data access agent layer, triggering the account book data access agent layer, and acquiring historical account book data related to the contract transaction information in a target account book corresponding to a target node cluster.
Optionally, the consensus unit 403 is further configured to:
based on the transaction result data, completing a consensus preparation process through the current node and other nodes except the current node in the alliance chain network;
and based on the transaction result data and the consensus preparation process, completing the consensus confirmation process through the current node and other nodes except the current node in the alliance chain network so as to achieve consensus for the contract transaction information.
Optionally, the consensus unit 403 is further configured to:
generating first common identification preparation information based on the transaction result data, wherein the first common identification preparation information comprises the transaction result data and an identity authentication identifier of the current node;
sending first consensus preparation information to other nodes except the current node in the alliance chain network through the current node;
receiving second consensus preparation information sent by other nodes, wherein the second consensus preparation information comprises transaction result data obtained by the other nodes based on the consensus processing request and identity authentication marks of the other nodes;
and performing identity authentication based on the identity authentication identifier in the second consensus preparation information, and if the number of the second consensus preparation information passing the identity authentication exceeds a first preset value, confirming that the node in the alliance chain network completes the consensus preparation process.
Optionally, the consensus unit 403 is further configured to:
generating first consensus confirmation information, wherein the first consensus confirmation information comprises transaction result data, an identity verification identifier of a current node and a consensus completion identifier;
sending first consensus confirmation information to other nodes except the current node in the alliance chain network through the current node;
receiving second consensus confirmation information sent by other nodes except the current node in the alliance chain network, wherein the second consensus confirmation information comprises transaction result data obtained by the other nodes based on the consensus processing request, identity verification marks of the other nodes and consensus completion marks;
and performing identity authentication based on the identity authentication identifier in the second consensus confirmation information, and if the number of the second consensus confirmation information passing the identity authentication exceeds two preset values, confirming that the nodes in the alliance chain network complete the consensus confirmation process so as to achieve consensus on the contract transaction information.
Optionally, the obtaining unit 402 is further configured to:
if the transaction result data are completely stored in the target account book corresponding to the target node cluster, successful storage information is generated;
and broadcasting the successful storage information to the nodes except the current node in the target node cluster through the current node.
Optionally, the obtaining unit 402 is further configured to:
if the current node is not a storage settlement node in the target node cluster, receiving transaction result data sent by the storage settlement node;
if the successful storage information sent by the storage settlement node in the target node cluster is not received within the preset duration after agreement is achieved on the contract transaction information according to the transaction result data, acquiring the storage settlement node in the target node cluster, and arranging a first sequence number in a corresponding target attribute information set according to a preset sequence;
acquiring a second sequence number of the current node in the target attribute information set according to a preset sequence;
and if the second sequence number is the adjacent sequence number after the first sequence number, storing the transaction result data into a target account book corresponding to the target node cluster through the current node.
Optionally, the storage unit 404 is further configured to:
determining an account book data access agent layer corresponding to a target node cluster to which a current node belongs;
and sending a data storage request aiming at the transaction result data to the account book data access agent layer, and triggering the account book data access agent layer to store the transaction result data into a target account book corresponding to the target node cluster.
All the above technical solutions can be combined arbitrarily to form the optional embodiments of the present application, and are not described herein again.
In the alliance chain data processing apparatus provided in the embodiment of the present application, all nodes in an alliance chain network receive a consensus processing request through the receiving unit 401, then, a node is confirmed in each node cluster as a storage settlement node, the obtaining unit 402 is used to obtain transaction result data corresponding to contract transaction information in the consensus processing request, and after agreement is achieved on the contract transaction information through the consensus unit 403, the storage settlement node in each node cluster stores the transaction result data into a target ledger corresponding to each node cluster through the storage unit 404, so that all nodes in the alliance chain network are prevented from storing the transaction result data, and thus, the storage cost of each node in the alliance chain network is effectively reduced.
Correspondingly, the embodiment of the application also provides a computer device, which can be a terminal, and the terminal can be a terminal device such as a smart phone, a tablet computer, a notebook computer, a touch screen, a game machine, a personal computer, a personal digital assistant and the like. As shown in fig. 5, fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application. The computer apparatus 500 includes a processor 501 having one or more processing cores, a memory 502 having one or more computer-readable storage media, and a computer program stored on the memory 502 and executable on the processor. The processor 501 is electrically connected to the memory 502. Those skilled in the art will appreciate that the computer device configurations illustrated in the figures are not meant to be limiting of computer devices and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The processor 501 is a control center of the computer device 500, connects various parts of the entire computer device 500 using various interfaces and lines, performs various functions of the computer device 500 and processes data by running or loading software programs and/or modules stored in the memory 502, and calling data stored in the memory 502, thereby monitoring the computer device 500 as a whole.
In this embodiment of the application, the processor 501 in the computer device 500 loads instructions corresponding to processes of one or more applications into the memory 502, and the processor 501 runs the applications stored in the memory 502, so as to implement various functions as follows:
after a current node in each node cluster of the system receives a consensus processing request aiming at all nodes in an alliance chain network, the consensus processing request is used for indicating to perform consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters; if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when the contract transaction information is executed; based on the transaction result data, achieving consensus on contract transaction information through the current node and other nodes except the current node in the alliance chain network; and storing the transaction result data to a target account book corresponding to a target node cluster to which the current node belongs through the current node.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Optionally, as shown in fig. 5, the computer device 500 further includes: touch-sensitive display screen 503, radio frequency circuit 504, audio circuit 505, input unit 506 and power 507. The processor 501 is electrically connected to the touch display screen 503, the radio frequency circuit 504, the audio circuit 505, the input unit 506, and the power supply 507, respectively. Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 5 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
The touch display screen 503 can be used for displaying a graphical user interface and receiving an operation instruction generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. The display panel may be used, among other things, to display information entered by or provided to a user and various graphical user interfaces of the computer device, which may be made up of graphics, text, icons, video, and any combination thereof. Alternatively, the Display panel may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations of a user on or near the touch panel (for example, operations of the user on or near the touch panel using any suitable object or accessory such as a finger, a stylus pen, and the like), and generate corresponding operation instructions, and the operation instructions execute corresponding programs. Alternatively, the touch panel may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 501, and can receive and execute commands sent by the processor 501. The touch panel may overlay the display panel, and when the touch panel detects a touch operation thereon or nearby, the touch panel transmits the touch operation to the processor 501 to determine the type of the touch event, and then the processor 501 provides a corresponding visual output on the display panel according to the type of the touch event. In the embodiment of the present application, the touch panel and the display panel may be integrated into the touch display screen 503 to implement input and output functions. However, in some embodiments, the touch panel and the touch panel can be implemented as two separate components to perform the input and output functions. That is, the touch display 503 can also be used as a part of the input unit 506 to implement an input function.
In this embodiment of the present application, after a current node in each node cluster of the system receives a consensus processing request for a node in the federation chain network, the processor 501 determines whether the current node is a storage settlement node in a target node cluster to which the current node belongs, and if so, the current node obtains, through the processor 501, transaction contract information in the consensus processing request, and then obtains transaction result data generated by executing the transaction contract information. If not, the current node waits to receive the transaction result data sent by the node serving as the storage settlement node. Therefore, all nodes in the alliance-link network can acquire the transaction result data and reach the consensus on the transaction contract information. Then, if the current node is a storage settlement node, the current node stores the transaction result data into the corresponding target ledger through the processor 501, and if the current node is not a storage settlement node, the current node judges whether the storage completion information sent by the storage settlement node is received through the processor 501.
The rf circuit 504 may be used for transceiving rf signals to establish wireless communication with a network device or other computer device via wireless communication, and for transceiving signals with the network device or other computer device.
Audio circuitry 505 may be used to provide an audio interface between a user and a computer device through speakers, microphones. The audio circuit 505 may transmit the electrical signal converted from the received audio data to a speaker, and convert the electrical signal into a sound signal for output; on the other hand, the microphone converts the collected sound signal into an electrical signal, which is received by the audio circuit 505 and converted into audio data, which is then processed by the audio data output processor 501, and then transmitted to, for example, another computer device via the rf circuit 504, or output to the memory 502 for further processing. The audio circuitry 505 may also include an earbud jack to provide communication of a peripheral headset with the computer device.
The input unit 506 may be used to receive input numbers, character information, or user characteristic information (e.g., fingerprint, iris, facial information, etc.), and generate keyboard, mouse, joystick, optical, or trackball signal inputs related to user settings and function control.
The power supply 507 is used to power the various components of the computer device 500. Optionally, the power supply 507 may be logically connected to the processor 501 through a power management system, so as to implement functions of managing charging, discharging, power consumption management, and the like through the power management system. The power supply 507 may also include any component including one or more dc or ac power sources, recharging systems, power failure detection circuitry, power converters or inverters, power status indicators, and the like.
Although not shown in fig. 5, the computer device 500 may further include a camera, a sensor, a wireless fidelity module, a bluetooth module, etc., which are not described in detail herein.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
As can be seen from the above, the computer device provided in this embodiment may, after obtaining the consensus processing request, determine whether the computer device is a storage settlement node of the target node cluster to which the computer device belongs, and if so, obtain transaction result data corresponding to the contract transaction information in the consensus processing request, broadcast the transaction result data to other nodes in the target node cluster to which the computer device belongs, and after reaching consensus for the contract transaction information, store the transaction result data in a target ledger corresponding to each node cluster, thereby preventing all nodes in the federation chain network from storing the transaction result data, and thus effectively reducing storage cost of each node in the federation chain network.
It will be understood by those skilled in the art that all or part of the steps of the methods of the above embodiments may be performed by instructions or by associated hardware controlled by the instructions, which may be stored in a computer readable storage medium and loaded and executed by a processor.
To this end, the present application provides a computer-readable storage medium, in which a plurality of computer programs are stored, where the computer programs can be loaded by a processor to execute the steps in any of the federation link data processing methods provided by the present application. For example, the computer program may perform the steps of:
after a current node in each node cluster of the system receives a consensus processing request aiming at all nodes in an alliance chain network, the consensus processing request is used for indicating to perform consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters; if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when the contract transaction information is executed; based on the transaction result data, achieving consensus on contract transaction information through the current node and other nodes except the current node in the alliance chain network; and storing the transaction result data to a target account book corresponding to a target node cluster to which the current node belongs through the current node.
The above operations can be implemented in the foregoing embodiments, and are not described in detail herein.
Wherein the storage medium may include: read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disks, and the like.
Since the computer program stored in the storage medium can execute the steps in any of the federation chain data processing methods provided in the embodiments of the present application, beneficial effects that can be achieved by any of the federation chain data processing methods provided in the embodiments of the present application can be achieved, for details, see the foregoing embodiments, and are not described herein again.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
The federation link data processing method, apparatus, computer device and storage medium provided in the embodiments of the present application are introduced in detail above, and a specific example is applied in the present application to explain the principle and implementation manner of the present invention, and the description of the above embodiments is only used to help understanding the technical scheme and core idea of the present invention; those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (15)

1. A federation chain data processing method, comprising:
receiving a consensus processing request aiming at all nodes in a alliance chain network through a current node, wherein the consensus processing request is used for indicating consensus processing on agreement transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters;
if the current node is a storage settlement node in a target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request, wherein the transaction result data comprises related data generated when the contract transaction information is executed;
agreeing on the contract transaction information with other nodes in the alliance-link network except the current node through the current node based on the transaction result data;
and storing the transaction result data to a target account book corresponding to the target node cluster to which the current node belongs through the current node.
2. The method according to claim 1, wherein before the obtaining transaction result data corresponding to the contract transaction information in the consensus processing request if the current node is a storage settlement node in a target node cluster to which the current node belongs, the method comprises:
acquiring a target attribute information set of each node in the target node cluster to which the current node belongs, wherein the target attribute information set comprises at least one piece of node attribute information arranged according to a preset sequence, and one node corresponds to one piece of node attribute information;
determining the block height of a block chain corresponding to the target node cluster to which the current node belongs based on the target book;
determining node attribute information of a storage settlement node in the target node cluster to which the current node belongs based on the number of node attribute information in the target attribute information set, the preset sequence and the block height;
and if the determined node identification in the node attribute information is the same as the node identification of the current node, determining that the current node is a storage settlement node in the target node cluster to which the current node belongs.
3. The method according to claim 2, wherein the determining node attribute information of storage settlement nodes in the target node cluster to which the current node belongs based on the number of pieces of node attribute information in the target attribute information set, the preset order and the block height comprises:
performing remainder calculation on the number of the node attribute information in the target attribute information set and the block height to obtain a remainder;
in the target attribute information set, determining node attribute information with sequence numbers equal to the remainder in the preset sequence;
and taking the determined node attribute information as the node attribute information of the storage settlement node in the target node cluster to which the current node belongs.
4. The method according to claim 2, wherein the obtaining the target attribute information set of each node in the target node cluster to which the current node belongs comprises:
acquiring attribute information sets of all nodes in the alliance chain network from the storage space of the current node, wherein the attribute information sets comprise node attribute information of each node in the alliance chain network, and the node attribute information comprises a node identifier and a cluster identifier of a node cluster to which the node belongs;
acquiring a node identifier of the current node, and determining a target cluster identifier of the target node cluster to which the current node belongs in the attribute information set according to the node identifier of the current node;
and acquiring node attribute information containing the target cluster identifier from the attribute information set to form the target attribute information set.
5. The method according to claim 1, wherein if the current node is a storage settlement node in the target node cluster to which the current node belongs, acquiring transaction result data corresponding to contract transaction information in the consensus processing request includes:
if the current node is a storage settlement node in the target node cluster, acquiring historical book data related to the contract transaction information in a target book corresponding to the target node cluster through the current node;
executing the contract transaction information through the current node based on transaction logic contained in the historical ledger data and the contract transaction information, recording the execution process of the contract transaction information, and generating transaction process record data;
according to the transaction process record data, changing account information of the historical account book data through the current node, and generating updated account information;
and forming the transaction result data according to the transaction process record data and the updated account information.
6. The method of claim 5, wherein the obtaining historical ledger data related to the contract transaction information in a target ledger corresponding to the target node cluster comprises:
determining an account book data access agent layer corresponding to the target node cluster;
sending a data acquisition request aiming at the contract transaction information to the ledger data access agent layer, triggering the ledger data access agent layer, and acquiring the historical ledger data related to the contract transaction information in a target ledger corresponding to the target node cluster.
7. The method of claim 1, wherein the agreeing on the contract transaction information by the current node with other nodes in the federation chain network other than the current node based on the transaction result data comprises:
completing a consensus preparation process with other nodes in the alliance-link network except the current node through the current node based on the transaction result data;
and completing a consensus confirmation process with other nodes except the current node in the alliance chain network through the current node based on the transaction result data and the consensus preparation process so as to achieve consensus for the contract transaction information.
8. The method of claim 7, wherein completing, by the current node and other nodes in the federation chain network other than the current node, a consensus preparation process based on the transaction result data comprises:
generating first consensus preparation information based on the transaction result data, wherein the first consensus preparation information comprises the transaction result data and an identity verification identifier of the current node;
sending the first consensus preparation information to other nodes except the current node in the alliance-link network through the current node;
receiving second consensus preparation information sent by the other node, wherein the second consensus preparation information comprises transaction result data obtained by the other node based on the consensus processing request and an identity authentication identifier of the other node;
and performing identity authentication based on the identity authentication identifier in the second consensus preparation information, and if the number of the second consensus preparation information passing the identity authentication exceeds a first preset value, confirming that the consensus preparation process is completed with the nodes in the alliance chain network.
9. The method of claim 7, wherein the completing, by the current node and other nodes in the federation chain network other than the current node, a consensus confirmation process based on the transaction result data and the consensus preparation process to agree on the contract transaction information comprises:
generating first consensus confirmation information, wherein the first consensus confirmation information comprises the transaction result data, the identity verification identifier of the current node and a consensus completion identifier;
sending the first common identification confirmation information to other nodes except the current node in the alliance-link network through the current node;
receiving second consensus confirmation information sent by other nodes of the alliance chain network except the current node, wherein the second consensus confirmation information comprises transaction result data obtained by the other nodes based on the consensus processing request, identity verification marks of the other nodes and consensus completion marks;
and performing identity verification based on the identity verification identification in the second consensus confirmation information, and if the number of the second consensus confirmation information passing the identity verification exceeds two preset values, confirming that the consensus confirmation process is completed with the nodes in the alliance chain network so as to achieve consensus for the contract transaction information.
10. The method of claim 2, further comprising:
if the transaction result data is stored in the target account book corresponding to the target node cluster, generating successful storage information;
broadcasting the storage success information to nodes except the current node in the target node cluster through the current node.
11. The method of claim 10, further comprising:
if the current node is not a storage settlement node in the target node cluster, receiving the transaction result data sent by the storage settlement node;
if the successful storage information sent by the storage settlement node in the target node cluster is not received within the preset duration after agreement is achieved on the contract transaction information according to the transaction result data, acquiring a first serial number of the storage settlement node in the target node cluster and arranging the first serial number in the corresponding target attribute information set according to a preset sequence;
acquiring a second sequence number of the current node in the target attribute information set according to the preset sequence;
and if the second sequence number is a sequence number adjacent to the first sequence number, storing the transaction result data into a target account book corresponding to the target node cluster through the current node.
12. The method of claim 1, wherein the storing, by the current node, the transaction result data into a target ledger corresponding to the target node cluster to which the current node belongs comprises:
determining an account book data access agent layer corresponding to the target node cluster to which the current node belongs;
and sending a data storage request aiming at the transaction result data to the account book data access agent layer, and triggering the account book data access agent layer to store the transaction result data into a target account book corresponding to the target node cluster.
13. A federation chain data processing apparatus, comprising:
a receiving unit, configured to receive, through a current node, a consensus processing request for all nodes in a federation chain network, where the consensus processing request is used to indicate that consensus processing is performed on contract transaction information, the federation chain network includes at least one node cluster, and the current node belongs to one of the node clusters;
an obtaining unit, configured to obtain, if the current node is a storage settlement node in a target node cluster to which the current node belongs, transaction result data corresponding to contract transaction information in the consensus processing request, where the transaction result data includes related data generated when the contract transaction information is executed;
a consensus unit, configured to agree on the contract transaction information through the current node and other nodes in the alliance-link network except the current node based on the transaction result data;
and the storage unit is used for storing the transaction result data into a target account book corresponding to the target node cluster to which the current node belongs through the current node.
14. A computer device, comprising:
a memory for storing a computer program;
a processor for implementing the steps in the federation chain data processing method of any one of claims 1 to 12 when executing the computer program.
15. A computer-readable storage medium, having stored thereon a computer program which, when executed by a processor, implements the steps in the federation chain data processing method of any one of claims 1 to 12.
CN202110713074.XA 2021-06-25 2021-06-25 Alliance chain data processing method, device, computer equipment and storage medium Active CN113506100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110713074.XA CN113506100B (en) 2021-06-25 2021-06-25 Alliance chain data processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110713074.XA CN113506100B (en) 2021-06-25 2021-06-25 Alliance chain data processing method, device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN113506100A true CN113506100A (en) 2021-10-15
CN113506100B CN113506100B (en) 2023-08-08

Family

ID=78010652

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110713074.XA Active CN113506100B (en) 2021-06-25 2021-06-25 Alliance chain data processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113506100B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114047980A (en) * 2021-11-29 2022-02-15 珠海格力电器股份有限公司 Management system for configuration data of programmable controller
CN114205233A (en) * 2021-11-30 2022-03-18 北京大学 Intelligent contract self-adaptive configuration and execution framework oriented to data management and control

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878000A (en) * 2017-03-06 2017-06-20 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of alliance's chain common recognition method and system
CN108615151A (en) * 2018-04-24 2018-10-02 深圳市元征科技股份有限公司 Data processing method, block chain server and node device
CN110322352A (en) * 2019-07-09 2019-10-11 深圳市炳德区块链技术有限公司 A kind of account book foundation and querying method, electronic equipment based on block chain
CN111191292A (en) * 2019-12-16 2020-05-22 平安壹钱包电子商务有限公司 Accounting method, accounting device, accounting system and computer-readable storage medium
CN111461870A (en) * 2020-04-02 2020-07-28 江苏德绅智股权投资有限公司 Supply chain financial credit increasing method based on block chain
WO2020186727A1 (en) * 2019-03-18 2020-09-24 苏宁云计算有限公司 Sensitive data transaction method and system based on blockchain
CN112600841A (en) * 2018-04-19 2021-04-02 创新先进技术有限公司 Credit record sharing method and device based on block chain and electronic equipment

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106878000A (en) * 2017-03-06 2017-06-20 中钞信用卡产业发展有限公司北京智能卡技术研究院 A kind of alliance's chain common recognition method and system
CN112600841A (en) * 2018-04-19 2021-04-02 创新先进技术有限公司 Credit record sharing method and device based on block chain and electronic equipment
CN108615151A (en) * 2018-04-24 2018-10-02 深圳市元征科技股份有限公司 Data processing method, block chain server and node device
WO2020186727A1 (en) * 2019-03-18 2020-09-24 苏宁云计算有限公司 Sensitive data transaction method and system based on blockchain
CN110322352A (en) * 2019-07-09 2019-10-11 深圳市炳德区块链技术有限公司 A kind of account book foundation and querying method, electronic equipment based on block chain
CN111191292A (en) * 2019-12-16 2020-05-22 平安壹钱包电子商务有限公司 Accounting method, accounting device, accounting system and computer-readable storage medium
CN111461870A (en) * 2020-04-02 2020-07-28 江苏德绅智股权投资有限公司 Supply chain financial credit increasing method based on block chain

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114047980A (en) * 2021-11-29 2022-02-15 珠海格力电器股份有限公司 Management system for configuration data of programmable controller
CN114047980B (en) * 2021-11-29 2024-01-19 珠海格力电器股份有限公司 Management system for configuration data of programmable controller
CN114205233A (en) * 2021-11-30 2022-03-18 北京大学 Intelligent contract self-adaptive configuration and execution framework oriented to data management and control
CN114205233B (en) * 2021-11-30 2022-07-12 北京大学 Intelligent contract self-adaptive configuration and execution system oriented to data management and control

Also Published As

Publication number Publication date
CN113506100B (en) 2023-08-08

Similar Documents

Publication Publication Date Title
CN110365491B (en) Service processing method, device, equipment, storage medium and data sharing system
CN113506100B (en) Alliance chain data processing method, device, computer equipment and storage medium
CN110601858B (en) Certificate management method and device
CN107241416A (en) The management method and terminal device in shared cabin
CN106656985B (en) Backup account login method, device and system
CN110620820A (en) Ubiquitous power Internet of things intelligent management system
CN109150981B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN112612496A (en) Intelligent contract operation management method, device, equipment and computer storage medium
CN113746640B (en) Digital certificate using method, device, computer equipment and storage medium
CN113342776B (en) Transaction information migration method, device, equipment and medium based on intelligent contract
CN109104472B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN111359210A (en) Data processing method and device, electronic equipment and storage medium
CN114092101B (en) Transaction verification method and device, storage medium and electronic equipment
CN112380411B (en) Sensitive word processing method, device, electronic equipment, system and storage medium
CN112948804B (en) Program control method, device and computer readable storage medium
CN110661789B (en) Address resetting method, device, equipment and computer readable storage medium
CN113890753A (en) Digital identity management method, device, system, computer equipment and storage medium
CN110677494B (en) Access response method and device
CN113506108A (en) Account management method, device, terminal and storage medium
CN113746909A (en) Network connection method, device, electronic equipment and computer readable storage medium
CN114422535B (en) Method, apparatus, computer device and storage medium for distributing contracts in blockchain
CN113360883B (en) Intelligent contract processing method and device, computer equipment and storage medium
CN113806801B (en) Transaction information uplink method, device, computer equipment and storage medium
CN112783860B (en) Method, device, storage medium and computer equipment for constructing mirror image database
CN109685578A (en) Integration managing method, server and the storage medium of card and subsystem

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