CN113506100B - Alliance chain data processing method, device, computer equipment and storage medium - Google Patents

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

Info

Publication number
CN113506100B
CN113506100B CN202110713074.XA CN202110713074A CN113506100B CN 113506100 B CN113506100 B CN 113506100B CN 202110713074 A CN202110713074 A CN 202110713074A CN 113506100 B CN113506100 B CN 113506100B
Authority
CN
China
Prior art keywords
node
target
current node
information
consensus
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.)
Active
Application number
CN202110713074.XA
Other languages
Chinese (zh)
Other versions
CN113506100A (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

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 chain data processing method, a device, computer equipment and a storage medium. Receiving, by a current node, a consensus processing request for all nodes in a coalition chain network, the consensus processing request being used to instruct to perform consensus processing on the contracted transaction information, the coalition chain network including at least one node cluster, the current node belonging 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 transaction result data, consensus is achieved for 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 the target node cluster to which the current node belongs through the current node. The storage cost of each node in the alliance chain network is effectively reduced.

Description

Alliance chain data processing method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of blockchain technologies, and in particular, to a method and an apparatus for processing coalition chain data, a computer device, and a storage medium.
Background
In a federation 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. The PBFT (Practical Byzantine Fault Tolerance, practical bayer fault tolerance algorithm) is a common consensus algorithm, and in the process of executing the PBFT consensus algorithm, when all nodes in the federation chain receive contract transaction information sent by a client, acquire data generated by executing the contract transaction information, and agree based on the contract transaction information, all nodes in the federation chain need to store the data generated by executing the contract transaction information, so that the storage cost of each node in the federation chain network is greatly increased, and the storage resource of each node is wasted.
Disclosure of Invention
The embodiment of the application provides a method, a device, computer equipment and a storage medium for processing alliance chain data, which effectively reduce the storage cost of each node in an alliance chain network.
The embodiment of the application provides a alliance 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 to perform consensus processing on the constraint 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, consensus is achieved for the 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 the target node cluster to which the current node belongs through the current node.
Correspondingly, the embodiment of the application also provides a coalition chain data processing device, which comprises:
the receiving unit is used for 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 to perform consensus processing on the constraint transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters;
the acquisition unit is used for acquiring transaction result data corresponding to 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, wherein the transaction result data comprises related data generated when the contract transaction information is executed;
The consensus unit is used for realizing consensus on the contract transaction information through the current node and other nodes except the current node in the alliance chain network 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 acquiring 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 account book;
determining node attribute information of a storage settlement node 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;
if the node identification in the determined 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 a target node cluster to which the current node belongs.
Optionally, the acquiring unit is further configured to:
performing remainder calculation on the number of node attribute information in the target attribute information set and the block height to obtain a remainder;
determining node attribute information with the sequence number equal to the remainder in the preset sequence in the target attribute information set;
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 acquiring unit is further configured to:
acquiring attribute information sets of all nodes in the alliance chain network from a storage space of the current node, wherein the attribute information sets comprise node attribute information of all nodes in the alliance chain network, and the node attribute information comprises node identifiers and cluster identifiers of node clusters to which the nodes belong;
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 acquiring unit is further configured to:
if the current node is a storage settlement node in the target node cluster, acquiring historical account book data related to the contract transaction information in a target account book corresponding to the target node cluster through the current node;
executing the contract transaction information based on the historical account book data and transaction logic contained in the contract transaction information through 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 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 acquiring unit is further configured to:
determining an account data access proxy layer corresponding to the target node cluster;
and sending a data acquisition request aiming at the contract transaction information to the account data access proxy layer, triggering the account data access proxy layer, and acquiring the historical account data related to the contract transaction information from a target account corresponding to the target node cluster.
Optionally, the consensus unit 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 a consensus confirmation process by 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 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;
transmitting the 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 the 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 verification identifications of the other nodes;
and carrying out identity verification based on the identity verification mark in the second identity preparation information, and if the number of the second identity preparation information passing through the identity verification exceeds a first preset value, confirming that the node in the alliance chain network completes the identity preparation process.
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;
transmitting the first consensus acknowledgement 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 of 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, an identity verification identifier of the other nodes and a consensus completion identifier;
and carrying out identity verification based on the identity verification mark in the second identity verification information, and if the number of the second identity verification information passing through the identity verification exceeds two preset values, confirming that the identity verification process is completed with the nodes in the alliance chain network so as to achieve the consensus for the contract transaction information.
Optionally, the acquiring 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;
And broadcasting the storage success information to nodes except the current node in the target node cluster through the current node.
Optionally, the acquiring unit is further configured to:
if the current node is not the storage settlement node in the target node cluster, receiving the transaction result data sent by the storage settlement node;
if the storage success information sent by the storage settlement nodes in the target node cluster is not received within the preset time length after the agreement of the contract transaction information is achieved according to the transaction result data, the storage settlement nodes in the target node cluster are obtained, and the first serial numbers are arranged in the corresponding target attribute information set according to the preset sequence;
acquiring a second serial number of the current node in the target attribute information set, which is arranged according to the preset sequence;
and if the second serial number is the serial number adjacent to the first serial 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 data access proxy 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 data access proxy layer, triggering the account data access proxy layer to store the transaction result data into a target account corresponding to the target node cluster.
Also, an embodiment of the present application further provides a computer device, including:
a memory for storing a computer program;
a processor for executing the steps of any of the federated chain data processing methods.
Furthermore, the embodiment of the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program realizes the steps of any one of the alliance chain data processing methods when being executed by a processor.
The embodiment of the application provides a method, a device, computer equipment and a storage medium for processing alliance chain data, when 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 is acquired, and after consensus is achieved for the contract transaction information, the storage settlement node in each node cluster is only used for storing the transaction result data into a target account book corresponding to each node cluster, so that all nodes in the alliance chain network are prevented from storing the transaction result data, and the storage cost of each node in the alliance chain network is effectively reduced.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below, it being obvious that the drawings in the following description are only some embodiments of the present invention, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a system diagram of a federated chain data processing apparatus provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart of a method for processing federated chain data according to an embodiment of the present application;
FIG. 3 is another flow chart of a federated chain data processing method provided in an embodiment of the present application;
FIG. 4 is a schematic diagram of a federated chain data processing apparatus provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a computer device according to 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 will be apparent that the described embodiments are only some, but not all, embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to fall within the scope of the invention.
The embodiment of the application provides a alliance chain data processing method, an alliance chain data processing device, computer equipment and a storage medium. Specifically, the coalition chain data processing method of the embodiment of the application may be executed by a computer device, where the computer device may be a terminal or a server. 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 (Personal Computer, PC), a personal digital assistant (Personal Digital Assistant, PDA) and the like, and the terminal can also comprise a client, wherein the client can be a game application client, a browser client carrying a game program, an instant messaging client or 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 cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution network services, basic cloud computing services such as big data and an artificial intelligence platform.
Referring to fig. 1, fig. 1 is a schematic system diagram of a coalition chain data processing apparatus according to an embodiment of the present application. The system is applied to a alliance chain network. The system may include three node clusters, namely node cluster a, node cluster B and node cluster C, wherein node cluster a includes node 11, node cluster B includes node 21, node 22 and node 23, and node cluster C includes node 31 and node 32. The nodes in each node cluster and the nodes in different node clusters may communicate with each other through different networks, e.g. the network may be a wireless network or a wired network, 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, etc. Each node cluster is correspondingly provided with an account book data access proxy layer and a target account book, the target account book can store transaction result data generated after related nodes in the alliance chain execute contract transaction information, the account book data access proxy 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 proxy layer. For example, the node cluster a obtains or stores transaction result data from the target ledger a through the ledger data access proxy layer a, the node cluster B obtains or stores transaction result data from the target ledger B through the ledger data access proxy layer B, and the node cluster C obtains or stores transaction result data from the target ledger C through the ledger data access proxy layer C. After receiving a consensus processing request for all nodes in a coalition chain network, a current node in each node cluster of the system is used for indicating to perform consensus processing on the constraint transaction information, wherein the coalition 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 transaction result data, consensus is achieved for 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 the target node cluster to which the current node belongs through the current node.
Furthermore, embodiments of the present application relate to blockchain technology, which is a decentralized, distributed database technology involving nodes. The blockchain does not have a central mechanism, and the consistency of the information of each node is ensured by a consensus mechanism of the blockchain. Blockchains can be generally divided into three general categories, public chains, private chains, and federated chains. Where a federated chain refers to a blockchain that is commonly participated in management by a pre-selected plurality of organizations or organizations, each of which may manage one or more nodes. One or more nodes managed by each organization or organization form a cluster of nodes. For example, an enterprise a, an enterprise B, and an enterprise C participate in managing nodes in a federation chain network together, the enterprise a manages a node cluster a as shown in fig. 1, the enterprise B manages a node cluster B, the enterprise C manages a node cluster C, accounting transactions can be performed between nodes managed by each enterprise, the enterprise a records accounting transaction conditions between nodes managed by each enterprise using a target account book a, the enterprise B records accounting transaction conditions between nodes managed by each enterprise using a target account book B, and the enterprise C records accounting transaction conditions between nodes managed by each enterprise using a target account book C.
The following will describe in detail. The following description of the embodiments is not intended to limit the preferred embodiments.
The present embodiment will be described from the perspective of a coalition chain data processing apparatus, which may be integrated in a terminal device, which may include a smart phone, a notebook computer, a tablet computer, a personal computer, and the like.
The embodiment of the application provides a method for processing federated chain data, which can be executed by a processor of a terminal, as shown in fig. 2, and the specific flow of the federated chain data processing method mainly includes steps 201 to 204, and the detailed description is as follows:
step 201, receiving, by a current node, a consensus processing request for all nodes in a coalition chain network, where the consensus processing request is used to indicate performing consensus processing on constraint transaction information, and the coalition chain network includes at least one node cluster, where the current node belongs to one of the node clusters.
In an embodiment of the present application, when one or more users want to deploy a new smart contract in the federated chain network, a consensus processing request may be sent by a client to one or more nodes in the federated chain network, where the consensus processing request may include contract transaction information that wants to deploy the smart contract and is used to instruct the consensus processing of the contract transaction information. The consensus processing request may further include information such as a time when the user sent the contract transaction information, a client identifier, a specific operation of processing data, and/or a client signature. The contract transaction information may be specific content of the corresponding smart contract, i.e., the contract transaction information may include transaction logic for each transaction by the smart contract.
For example, after any node cluster receives the consensus processing request through the current node, the current node obtains contract transaction information from the consensus processing request, and according to the instruction of the consensus processing request, the current node and other nodes except the current node in the alliance chain network agree on the contract transaction information, so that storage settlement nodes in each node cluster are triggered to send persistence requests for the contract transaction information, and transaction result data generated by executing the contract transaction information can be stored in a target account book corresponding to each node cluster 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 node in the target node cluster. The target node cluster may be any one of the node clusters included in the federated chain network.
Step 202, 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 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 to obtain transaction result data corresponding to contract transaction information in a consensus processing request" 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 confirm whether the current node is a storage settlement node in the target node cluster or not may have two methods, where the first method is to calculate a node identifier of the storage settlement node of the target node cluster according to a preset node confirmation logic, determine whether the node identifier of the current node is equal to the calculated node identifier, if yes, the current node is the storage settlement node in the target node cluster, and execute the contract transaction information by the storage settlement node, so as to generate transaction result data. The second method is that all nodes in the node cluster acquire historical account book data related to contract transaction information, execute the contract transaction information based on transaction logic contained in the historical account book data and the contract transaction information, generate transaction result data, firstly execute the node which completes generating the transaction result data as a storage settlement node in the target node cluster, send calculation completion information to other nodes in the same node cluster, inform the other nodes in the same node cluster to stop executing the contract transaction information, and then broadcast all generated transaction result data to the other nodes in the same node cluster by the node which completes executing first.
When the first method is employed, a specific confirmation process may be realized 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 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 a list form, 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, the cluster identifier is information for uniquely distinguishing different clusters, for example, the node identifier can be information such as a node name and a node number, and the cluster identifier can be information such as a cluster name.
In this embodiment of the present application, the preset sequence may be a sequence from small to large of the network access sequence numbers of each node.
In this embodiment of the present application, in the step S2021, the "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 chain network from a storage space of a current node, wherein the attribute information sets comprise node attribute information of all nodes in the alliance chain network, and the node attribute information comprises node identifiers and cluster identifiers of node clusters to which the nodes belong; acquiring a node identifier of a current node, and determining a target cluster identifier of a target node cluster 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 a target attribute information set.
In this embodiment of the present application, attribute information sets of all nodes may be deployed in advance in storage spaces of all nodes in a federation chain network, where 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 a federation chain, and after one node 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 that relevant operations are performed.
For example, referring to the federation chain system schematic diagram shown in fig. 1, fig. 1 includes 6 nodes, and the preset node information list may include six pieces of node attribute information corresponding to the 6 nodes, which are respectively 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 the node number corresponding to the node, the agent is the cluster identifier of the node cluster to which the node belongs, the name is the node name corresponding to the node, and the index is the network access sequence number of the node, namely the sequence number of the node to which the corresponding node joins the node cluster.
In addition, the current node obtains its own node number bb2333c1 as its own node identifier, obtains node attribute information including its own node number in a preset node information list, that is, { node id: "bb2333c1", agent: "ingredient 2", name: "node2_1", index:2}, obtains cluster identifier of the target node cluster as ingredient 2 in the node attribute information including its own node number, and then obtains node attribute information including cluster identifier ingredient 2 in a preset node information list, specifically { node id: "bb2323c1", agent: "ingredient 2", name: "node2_2", index:3} and { node id: "cb2333c1", agent: "ingredient 2", name: "node2_3", index:4}, thereby obtaining candidate node attribute information of all clusters of the target node in the cluster node information list.
In addition, when the preset sequence is the sequence number of the node joining the node cluster, all the candidate node attribute information can be arranged according to the node network access sequence number, so as to form a final cluster node information list, and in particular, the cluster node information list can 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 the block chain corresponding to the target node cluster to which the current node belongs based on the target account book.
In this embodiment of the present application, the related data in the target ledger corresponding to each node cluster may be stored in the form of a blockchain, so that the number of blocks included in the blockchain corresponding to each node cluster may be obtained, that is, the block height.
In this embodiment of the present application, since each block of the target ledger uses the system storage address to identify the position of each block in the system, the storage address of each block in the system is sequentially incremented, and the storage space occupied by each block is the same, so that the storage address value of the first block and the storage address value of the last block in the target ledger can be obtained, the storage address value of the first block in the same target ledger is subtracted from the storage address value of the last block in the target ledger to determine the address increment value of the current last block in the target ledger relative to the first block, that is, the total occupied address value of the block chain corresponding to the target ledger is obtained, and the number of blocks included in the block chain corresponding to the target ledger can be obtained according to the total occupied address value and the address occupied address value of each block, thereby obtaining the block height.
Step S2023: and determining the node attribute information of the storage settlement node in the target node cluster based on the number of the node attribute information in the target attribute information set, the preset sequence and the block height.
In the embodiment of the present application, in the above step S2023, the implementation manner of determining the node attribute information of the storage settlement node in the target node cluster based on the number of node attribute information in the target attribute information set, the preset sequence and the block height may specifically be: performing remainder calculation on the number of 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 in a preset sequence; and taking the determined node attribute information as the node attribute information of the storage settlement node in the belonging target node cluster.
For example, if the number of node attribute information in the target attribute information set is 3, the block height of the corresponding target account in the target node cluster is 10, the remainder 1 is obtained by dividing 10 by 3, and the first node attribute information in the target attribute information set is determined to be the node attribute information of the required storage settlement node.
In the embodiment of the application, the remainder is calculated on the number of the node attribute information and the block height, the node attribute information corresponding to the obtained remainder is used as the node attribute information of the storage settlement node, the calculated node attribute information of the storage settlement node can be analogized with the increase of the block height, so that 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: if the node identification in the determined 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.
In this embodiment of the present application, after confirming that the current node is a storage settlement node in the target node cluster, in step 202, if the current node is a storage settlement node in the target node cluster to which the current node belongs, the obtaining transaction result data corresponding to the contract transaction information in the common identification processing request may specifically be: if the current node is a storage settlement node in the target node cluster, acquiring historical account book data related to contract transaction information in a target account book corresponding to the target node cluster through the current node; executing contract transaction information based on historical account book data and transaction logic contained in the contract transaction information through the current node, recording the execution process of the contract transaction information, and generating transaction process record data; according to transaction process record data, changing account information of historical account book data through a 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 virtual currency of a predetermined amount given to the user B by the user a, 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 may change with the execution of the contract transaction information, that is, updated account information is formed, so that 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 record data of executing the contract transaction information, that is, the virtual currency of a predetermined amount given to the user B by the user a, the virtual currency of a predetermined amount is reduced by the user a, and the virtual currency of a predetermined amount is increased by the user B.
In the embodiment of the application, only the storage settlement nodes in each node cluster are required to acquire historical account book data, contract transaction information is executed according to the historical account book data to form transaction result data, and all nodes in the blockchain network are not required to execute the contract transaction information to form the transaction result data, so that the operation pressure of each node is reduced.
In this embodiment of the present application, an account data access proxy layer may be preset in a federation chain network, and is configured to provide an access entry for data in a target account, and in a target account corresponding to a target node cluster, the process of obtaining historical account data related to contract transaction information may be performed by using the account data access proxy layer set in the federation chain network instead, where a specific process may be: determining an account book data access proxy layer corresponding to the target node cluster; and sending a data acquisition request for contract transaction information to an account data access proxy layer, triggering the account data access proxy layer, and acquiring historical account data related to the contract transaction information in a target account corresponding to the target node cluster. The account book data access agent layer may obtain, from 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 one embodiment of the present application, a ledger data access proxy layer may be set in the federation chain network, where each node cluster stores and settles data in the target ledger using one ledger data access proxy layer. And a plurality of account book data access proxy layers can be arranged in the alliance chain network, each node cluster corresponds to one account book data access proxy layer, and each node cluster stores account book data access proxy layers corresponding to the node clusters to which the settlement node belongs so as to realize the access to the data in the target account book.
And 203, based on the transaction result data, consensus is achieved for contract transaction information through the current node and other nodes except the current node in the alliance chain network.
In the embodiment of the present application, the "consensus with the node in the federation chain network for the contract transaction information based on the transaction result data" in the above step 203 may be implemented as follows steps S2031 to S2032:
step S2031: based on the transaction result data, the consensus preparation process is completed through the current node and other nodes except the current node in the alliance chain network.
In this embodiment of the present application, the "completing the consensus preparation process by the current node and the other nodes in the federation chain network except the current node" in the step S2031 based on the transaction result data may specifically be: 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; transmitting 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 verification identifiers of the other nodes; and carrying out identity verification based on the identity verification mark in the second consensus preparation information, and if the number of the second consensus preparation information passing through the identity verification exceeds a first preset value, confirming that the consensus preparation process is completed with the node in the alliance chain network. The first preset value may be two-thirds of the number of all nodes in the federation chain network.
Step S2032: based on the transaction result data and the consensus preparation process, the consensus confirmation process is completed through the current node and other nodes except the current node in the alliance chain network so as to achieve consensus for contract transaction information.
In this embodiment of the present application, in the step S2032, the "based on the transaction result data and the consensus preparation process, the consensus confirmation process is completed by the current node and other nodes in the federation chain network except for the current node, so as to achieve consensus for the contract transaction information" may specifically be: after nodes in the alliance chain network complete 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 other nodes based on the consensus processing request, identity verification identifiers of other nodes and consensus completion identifiers; and carrying out identity verification based on the identity verification mark in the second identity verification information, and if the number of the second identity verification information passing through the identity verification exceeds two preset values, confirming that the identity verification process is completed with the nodes in the alliance chain network so as to achieve the consensus for the contract transaction information. Wherein the second preset value may be two-thirds of the number of all nodes in the federated chain network.
And 204, 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.
In this embodiment of the present application, in the step 204, "store the transaction result data to the target ledger corresponding to the target node cluster to which the current node belongs" may also be implemented by using a ledger data access agent layer preset in the federation chain network, and the specific process may be: determining an account book data access proxy layer corresponding to the target node cluster; and sending a data storage request for the transaction result data to the account data access proxy layer, triggering the account data access proxy layer to store the transaction result data into a target account 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 the target node cluster, if the current node stores transaction result data in a target account book corresponding to the target node cluster, storage success information is generated; and the current node broadcasts the storage success information to nodes other than the current node in the target node cluster.
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 agrees with other nodes in the alliance chain network for contract transaction information according to the received transaction result data, if the current node does not receive the successful storage information sent by the storage settlement nodes in the target node cluster within the preset time length after the current node agrees with the contract transaction information according to the transaction result data, the storage settlement nodes in the target node cluster are obtained, and the first serial numbers are arranged in the corresponding target attribute information set according to the preset sequence; acquiring a second serial number of the current node in the target attribute information set, which is arranged according to a preset sequence; and if the second serial number is the adjacent serial number after the first serial 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 agreed transaction result data to the target account book due to faults and the like, other nodes of the target node cluster are in a state of long-term waiting, and the storage efficiency of the transaction result data is improved.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
The embodiment of the application provides a alliance chain data processing method, when 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 is acquired, and after consensus is achieved for the contract transaction information, the transaction result data is stored in a target account book corresponding to each node cluster only by using the storage settlement node in each node cluster, so that all nodes in the alliance chain network are prevented from storing the transaction result data, and the storage cost of each node in the alliance chain network is effectively reduced.
Referring to fig. 3, fig. 3 is another flow chart of a coalition chain data processing method according to an embodiment of the present application. The specific flow of the method can be as follows:
step 301, receiving, by a current node, a consensus processing request for all nodes in a federation chain network.
For example, the consensus processing request is used to instruct to perform a consensus process on the contracted transaction information, and the coalition chain network includes at least one node cluster, where the current node belongs to one of the node clusters.
Step 302, confirming 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 the target node cluster is obtained, a block height of a block chain corresponding to the target node cluster is determined based on a target account book, node attribute information of storage settlement nodes in the target node cluster is determined based on the number of node attribute information in the target attribute information set, a preset sequence and the block height, and if the node identification in the determined node attribute information is the same as the node identification of the current node, the current node is determined to be the storage settlement node in the target node cluster.
Step 303, if the current node is a storage settlement node in the target node cluster, obtaining transaction result data corresponding to the contract transaction information in the consensus processing request.
For example, in a target ledger corresponding to the target node cluster, historical ledger data related to contract transaction information is acquired; executing contract transaction information based on transaction logic contained in the historical account book 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, and generating updated account information; and forming transaction result data according to the transaction process record data and the updated account information.
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.
Step 305, consensus is made with other nodes except the current node in the alliance chain network for contract transaction information based on the transaction result data through the current node.
For example, the consensus preparation process is completed with the nodes in the coalition chain network based on the transaction result data, and after the consensus preparation process is completed, the consensus confirmation process is completed with the nodes in the coalition chain network based again on the transaction result data and the consensus preparation process, thereby achieving consensus for the contract transaction information.
And 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, determining an account data access proxy layer corresponding to the target node cluster; and sending a data storage request for the transaction result data to the account data access proxy layer, triggering the account data access proxy layer to store the transaction result data into a target account corresponding to the target node cluster.
Step 307, if the current node is not the storage settlement node in the target node cluster, receiving the storage completion information sent by the storage settlement node in the target node cluster.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
The embodiment of the application provides a alliance chain data processing method, when 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 is acquired, and after consensus is achieved for the contract transaction information, the transaction result data is stored in a target account book corresponding to each node cluster only by using the storage settlement node in each node cluster, so that all nodes in the alliance chain network are prevented from storing the transaction result data, and the storage cost of each node in the alliance chain network is effectively reduced.
In order to facilitate better implementation of the coalition chain data processing method of the embodiment of the application, the embodiment of the application also provides a coalition chain data processing device. Referring to fig. 4, fig. 4 is a schematic structural diagram of a coalition chain data processing apparatus according to an embodiment of the present application. The coalition chain data processing apparatus may include a receiving unit 401, an acquiring unit 402, a consensus unit 403, and a storage unit 404.
The receiving unit 401 is configured to receive, by using a current node, a consensus processing request for all nodes in a federation chain network, where the consensus processing request is used to instruct performing consensus processing on the constraint transaction information, and the federation chain network includes at least one node cluster, where the current node belongs to one of the node clusters;
an obtaining unit 402, configured to obtain transaction result data corresponding to 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, 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 chain network except the current node based on the transaction result data;
and the storage unit 404 is configured to store, by the current node, the transaction result data in 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 the 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 of node attribute information in the target attribute information set, a preset sequence and a block height;
if the node identification in the determined 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.
Optionally, the obtaining unit 402 is further configured to:
performing remainder calculation on the number of 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 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 chain network from a storage space of a current node, wherein the attribute information sets comprise node attribute information of all nodes in the alliance chain network, and the node attribute information comprises node identifiers and cluster identifiers of node clusters to which the nodes belong;
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 account book data related to contract transaction information in a target account book corresponding to the target node cluster through the current node;
executing contract transaction information based on historical account book data and transaction logic contained in the contract transaction information through the current node, recording the execution process of the contract transaction information, and generating transaction process record data;
according to transaction process record data, changing account information of historical account book data through a 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 proxy layer corresponding to the target node cluster;
and sending a data acquisition request for contract transaction information to an account data access proxy layer, triggering the account data access proxy layer, and acquiring historical account data related to the contract transaction information in a target account corresponding to the 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;
based on the transaction result data and the consensus preparation process, the consensus confirmation process is completed through the current node and other nodes except the current node in the alliance chain network so as to achieve consensus for contract transaction information.
Optionally, the consensus unit 403 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;
transmitting 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 verification identifiers of the other nodes;
and carrying out identity verification based on the identity verification mark in the second consensus preparation information, and if the number of the second consensus preparation information passing through the identity verification exceeds a first preset value, confirming that the consensus preparation process is completed with the node in the alliance chain network.
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;
transmitting 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 of 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 identifiers of the other nodes and consensus completion identifiers;
and carrying out identity verification based on the identity verification mark in the second identity verification information, and if the number of the second identity verification information passing through the identity verification exceeds two preset values, confirming that the identity verification process is completed with the nodes in the alliance chain network so as to achieve the consensus for the contract transaction information.
Optionally, the obtaining unit 402 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;
and broadcasting storage success information to 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 storage success information sent by the storage settlement nodes in the target node cluster is not received within the preset time length after the agreement of the contract transaction information is achieved according to the transaction result data, the storage settlement nodes in the target node cluster are obtained, and the first serial numbers are arranged in the corresponding target attribute information set according to the preset sequence;
acquiring a second serial number of the current node in the target attribute information set, which is arranged according to a preset sequence;
and if the second serial number is the adjacent serial number after the first serial 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 data access proxy layer corresponding to a target node cluster to which the current node belongs;
and sending a data storage request for the transaction result data to the account data access proxy layer, triggering the account data access proxy layer to store the transaction result data into a target account corresponding to the target node cluster.
All the above technical solutions may be combined to form an optional embodiment of the present application, which is not described here in detail.
According to the alliance chain data processing device provided by the embodiment of the application, all nodes in the alliance chain network receive the consensus processing request through the receiving unit 401, then, 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 is acquired by utilizing the acquiring unit 402, after consensus is achieved for the contract transaction information by utilizing the consensus unit 403, the storage settlement node in each node cluster stores the transaction result data into a target account book corresponding to each node cluster by utilizing the storage unit 404, 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.
Correspondingly, the embodiment of the application also provides computer equipment, which can be a terminal, and the terminal can be terminal equipment such as a smart phone, a tablet personal computer, a notebook computer, a touch screen, a game machine, a personal computer, a personal digital assistant and the like. Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application, as shown in fig. 5. The computer device 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. It will be appreciated by those skilled in the art that the computer device structure shown in the figures is not limiting of the computer device and may include more or fewer components than shown, or may combine certain components, 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, and 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 performing overall monitoring of the computer device 500.
In the embodiment of the present application, the processor 501 in the computer device 500 loads the instructions corresponding to the processes of one or more application programs into the memory 502 according to the following steps, and the processor 501 executes the application programs stored in the memory 502, so as to implement various functions:
after receiving the consensus processing request for all nodes in the alliance chain network, the current node in each node cluster of the system is used for indicating to perform the consensus processing on the constraint transaction information, and the alliance chain network comprises at least one node cluster, wherein 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 transaction result data, consensus is achieved for 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 the target node cluster to which the current node belongs through the current node.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Optionally, as shown in fig. 5, the computer device 500 further includes: a touch display screen 503, a radio frequency circuit 504, an audio circuit 505, an input unit 506, and a power supply 507. The processor 501 is electrically connected to the touch display 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 structure shown in FIG. 5 is not limiting of the computer device and may include more or fewer components than shown, or may be combined with certain components, or a different arrangement of components.
The touch display screen 503 may be used to display a graphical user interface and receive operation instructions generated by a user acting on the graphical user interface. The touch display screen 503 may include a display panel and a touch panel. Wherein the display panel may be used to display information entered by a user or provided to a user as well as various graphical user interfaces of a computer device, which may be composed of graphics, text, icons, video, and any combination thereof. Alternatively, the display panel may be configured in the form of a liquid crystal display (Liquid Crystal Display, LCD), an Organic Light-Emitting Diode (OLED), or the like. The touch panel may be used to collect touch operations on or near the user (such as operations on or near the touch panel by the user using any suitable object or accessory such as a finger, stylus, etc.), 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 azimuth 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 detection device and converts it into touch point coordinates, which are then sent to the processor 501, and can receive commands from the processor 501 and execute them. The touch panel may overlay the display panel, and upon detection of a touch operation thereon or thereabout, the touch panel is passed to the processor 501 to determine the type of touch event, and the processor 501 then provides a corresponding visual output on the display panel based on the type of 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 the input and output functions. In some embodiments, however, the touch panel and the touch panel may be implemented as two separate components to perform the input and output functions. I.e. the touch sensitive display 503 may also implement an input function as part of the input unit 506.
In this embodiment of the present application, after the current node in each node cluster of the system receives the consensus processing request for the node in the federation chain network, the processor 501 confirms whether the current node is a storage settlement node in the target node cluster to which the current node belongs, if so, the current node obtains the transaction contract information in the consensus processing request, and then obtains the transaction result data generated by executing the transaction contract information. If not, the current node waits for receiving the transaction result data sent by the node which is used for storing the settlement node. Therefore, all nodes in the alliance chain network can acquire the transaction result data and achieve consensus for transaction contract information. Then, if the current node is a storage settlement node, the current node stores the transaction result data into a corresponding target account book through the processor 501, and if the current node is not a storage settlement node, the current node judges whether storage completion information sent by the storage settlement node is received through the processor 501.
The radio frequency circuitry 504 may be used to transceive radio frequency signals to establish wireless communications with a network device or other computer device via wireless communications.
The audio circuitry 505 may be used to provide an audio interface between a user and a computer device through speakers, microphones, and so on. The audio circuit 505 may transmit the received electrical signal after audio data conversion to a speaker, and convert the electrical signal into a sound signal for output by the speaker; on the other hand, the microphone converts the collected sound signals into electrical signals, which are received by the audio circuit 505 and converted into audio data, which are processed by the audio data output processor 501 for transmission to, for example, another computer device via the radio frequency circuit 504, or which are output to the memory 502 for further processing. The audio circuit 505 may also include an ear bud jack to provide communication of the peripheral ear bud 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 to 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. Alternatively, 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, and power consumption management through the power management system. The power supply 507 may also include one or more of any components, such as a direct current or alternating current power supply, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, 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 herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
As can be seen from the foregoing, the computer device provided in this embodiment may determine whether the node itself is a storage settlement node of the target node cluster to which the node cluster belongs after the request for consensus processing is obtained, if so, obtain transaction result data corresponding to contract transaction information in the request for consensus processing, broadcast the transaction result data to other nodes in the target node cluster to which the node cluster belongs, and store the transaction result data in the target account book corresponding to each node cluster after consensus is achieved for the contract transaction information, thereby avoiding all nodes in the federation link network from storing the transaction result data, and effectively reducing storage cost of each node in the federation link network.
Those of ordinary skill in the art will appreciate that all or a portion of the steps of the various methods of the above embodiments may be performed by instructions, or by instructions controlling associated hardware, which may be stored in a computer-readable storage medium and loaded and executed by a processor.
To this end, embodiments of the present application provide a computer readable storage medium having stored therein a plurality of computer programs that can be loaded by a processor to perform steps in any of the federated chain data processing methods provided by embodiments of the present application. For example, the computer program may perform the steps of:
after receiving the consensus processing request for all nodes in the alliance chain network, the current node in each node cluster of the system is used for indicating to perform the consensus processing on the constraint transaction information, and the alliance chain network comprises at least one node cluster, wherein 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 transaction result data, consensus is achieved for 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 the target node cluster to which the current node belongs through the current node.
The specific implementation of each operation above may be referred to the previous embodiments, and will not be described herein.
Wherein the storage medium may include: read Only Memory (ROM), random access Memory (Random Access Memory, RAM), magnetic or optical disk, and the like.
Because the computer program stored in the storage medium may perform the steps in any of the alliance chain data processing methods provided in the embodiments of the present application, the beneficial effects that any of the alliance chain data processing methods provided in the embodiments of the present application may be achieved, which are detailed in the previous embodiments and are not described herein.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
The foregoing describes in detail a method, apparatus, computer device and storage medium for processing federated chain data provided in the embodiments of the present application, and specific examples are applied to illustrate the principles and embodiments of the present invention, where the foregoing description of the embodiments is only for helping to understand the technical solution and core ideas of the present invention; those of ordinary skill in the art will appreciate that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the invention.

Claims (14)

1. A method of federation chain data processing, 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 to perform consensus processing on the constraint 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, acquiring historical account book data related to the contract transaction information in a target account book corresponding to the target node cluster through the current node;
executing the contract transaction information based on the historical account book data and transaction logic contained in the contract transaction information through 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 account information of the historical account book data through the current node, and generating updated account information;
forming transaction result data according to the transaction process record data and the updated account information, wherein the transaction result data comprises related data generated when the contract transaction information is executed;
Based on the transaction result data, consensus is achieved for the 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 the target node cluster to which the current node belongs through the current node.
2. The method according to claim 1, wherein if the current node is a storage settlement node in the target node cluster, obtaining, by the current node, historical ledger data related to the contract transaction information in a target ledger corresponding to the target node cluster, includes:
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 account 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;
If the node identification in the determined 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 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 order, and the block height includes:
performing remainder calculation on the number of node attribute information in the target attribute information set and the block height to obtain a remainder;
determining node attribute information with the sequence number equal to the remainder in the preset sequence in the target attribute information set;
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 includes:
Acquiring attribute information sets of all nodes in the alliance chain network from a storage space of the current node, wherein the attribute information sets comprise node attribute information of all nodes in the alliance chain network, and the node attribute information comprises node identifiers and cluster identifiers of node clusters to which the nodes belong;
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 the obtaining, in the target ledger corresponding to the target node cluster, historical ledger data related to the contract transaction information includes:
determining an account data access proxy layer corresponding to the target node cluster;
and sending a data acquisition request aiming at the contract transaction information to the account data access proxy layer, triggering the account data access proxy layer, and acquiring the historical account data related to the contract transaction information from a target account corresponding to the target node cluster.
6. The method of claim 1, wherein the agreement on the contract transaction information based on the transaction outcome data is made by the current node with other nodes in the federation chain network than the current node, comprising:
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 a consensus confirmation process by 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.
7. The method of claim 6, wherein the completing a consensus preparation process with other nodes in the federated chain network than the current node based on the transaction outcome 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;
Transmitting the 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 the 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 verification identifications of the other nodes;
and carrying out identity verification based on the identity verification mark in the second identity preparation information, and if the number of the second identity preparation information passing through the identity verification exceeds a first preset value, confirming that the node in the alliance chain network completes the identity preparation process.
8. The method of claim 6, wherein the completing a consensus validation process with other nodes in the federation chain network than the current node based on the transaction outcome 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;
Transmitting the 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 of 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, an identity verification identifier of the other nodes and a consensus completion identifier;
and carrying out identity verification based on the identity verification mark in the second identity verification information, and if the number of the second identity verification information passing through the identity verification exceeds two preset values, confirming that the identity verification process is completed with the nodes in the alliance chain network so as to achieve the consensus for the contract transaction information.
9. The method according to claim 2, wherein the method further comprises:
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.
10. The method according to claim 9, wherein the method further comprises:
if the current node is not the storage settlement node in the target node cluster, receiving the transaction result data sent by the storage settlement node;
if the storage success information sent by the storage settlement nodes in the target node cluster is not received within the preset time length after the agreement of the contract transaction information is achieved according to the transaction result data, the storage settlement nodes in the target node cluster are obtained, and the first serial numbers are arranged in the corresponding target attribute information set according to the preset sequence;
acquiring a second serial number of the current node in the target attribute information set, which is arranged according to the preset sequence;
and if the second serial number is the serial number adjacent to the first serial number, storing the transaction result data into a target account book corresponding to the target node cluster through the current node.
11. The method according to claim 1, wherein 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, includes:
Determining an account data access proxy 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 data access proxy layer, triggering the account data access proxy layer to store the transaction result data into a target account corresponding to the target node cluster.
12. A coalition chain data processing apparatus, comprising:
the receiving unit is used for 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 to perform consensus processing on the constraint transaction information, the alliance chain network comprises at least one node cluster, and the current node belongs to one of the node clusters;
the acquisition unit is used for acquiring historical account book data related to the contract transaction information in a target account book corresponding to the target node cluster through the current node if the current node is a storage settlement node in the target node cluster; executing the contract transaction information based on the historical account book data and transaction logic contained in the contract transaction information through 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 account information of the historical account book data through the current node, and generating updated account information; forming transaction result data according to the transaction process record data and the updated account information, wherein the transaction result data comprises related data generated when the contract transaction information is executed;
The consensus unit is used for realizing consensus on the contract transaction information through the current node and other nodes except the current node in the alliance chain network 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.
13. A computer device, comprising:
a memory for storing a computer program;
a processor for implementing the steps in the federated chain data processing method of any one of claims 1 to 11 when executing the computer program.
14. A computer readable storage medium, characterized in that the computer readable storage medium has stored thereon a computer program which, when executed by a processor, implements the steps of the coalition chain data processing method according to any one of claims 1 to 11.
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 CN113506100A (en) 2021-10-15
CN113506100B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114047980B (en) * 2021-11-29 2024-01-19 珠海格力电器股份有限公司 Management system for configuration data of programmable controller
CN114205233B (en) * 2021-11-30 2022-07-12 北京大学 Intelligent contract self-adaptive configuration and execution system 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

Also Published As

Publication number Publication date
CN113506100A (en) 2021-10-15

Similar Documents

Publication Publication Date Title
CN113506100B (en) Alliance chain data processing method, device, computer equipment and storage medium
CN101083537B (en) Method, apparatus and system for realizing device management
WO2021227457A1 (en) Blockchain-based electronic data evidence preservation method and system, and storage medium and terminal
CN107241416A (en) The management method and terminal device in shared cabin
CN107172196A (en) A kind of business interaction methods, devices and systems
JP2023536711A (en) COMPUTING POWER SHARING METHOD AND RELATED DEVICE
CN109150981B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN201985891U (en) System for preventing harassment of strangers in social network
CN113506108A (en) Account management method, device, terminal and storage medium
CN109600254A (en) The generation method and related system of full link log
CN112612496A (en) Intelligent contract operation management method, device, equipment and computer storage medium
CN109104472B (en) Block chain network networking method, device, equipment and computer readable storage medium
CN113746640B (en) Digital certificate using method, device, computer equipment and storage medium
CN111222885B (en) Data processing request endorsement method and device, computer equipment and storage medium
CN113342776B (en) Transaction information migration method, device, equipment and medium based on intelligent contract
CN112380411B (en) Sensitive word processing method, device, electronic equipment, system and storage medium
CN111798223A (en) Data collection method and device, storage medium and electronic equipment
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
CN111476562A (en) Virtual resource transfer method, device, electronic equipment and storage medium
CN116307343A (en) User asset management method, device, computer equipment and storage medium
CN116308786A (en) Processing method, system, electronic equipment and readable storage medium for blockchain transaction
CN110069355A (en) Customer relationship shows, customer relationship method of converting, device, equipment and medium
CN116233130A (en) Block chain-based registration method, device, electronic equipment and readable storage medium

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