CN-122001892-A - Data processing method, device and equipment based on alliance chain and readable storage medium
Abstract
The application discloses a data processing method, a device, equipment and a readable storage medium based on a coalition chain, wherein the method comprises the steps of obtaining a target consensus type corresponding to a target coalition party to which a first consensus node belongs; and carrying out consensus voting processing on at least one consensus node contained in the target alliance party according to a consensus voting rule indicated by the target consensus type, wherein the consensus voting processing is used for voting a voting representative node of the target alliance party from the at least one consensus node contained in the target alliance party, and the voting representative node of the target alliance party is used for carrying out voting consensus processing on a proposal block in a alliance chain on behalf of the target alliance party. By adopting the application, the decentralization and fairness of the alliance chain can be improved.
Inventors
- SHAO ZHUGUANG
- LIU KEMENG
- LIU JINGBO
- WANG CHUNXIANG
Assignees
- 腾讯科技(深圳)有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241107
Claims (15)
- 1. A data processing method based on a federation chain, wherein the federation chain includes a plurality of consensus nodes, the federation chain is formed by N federation parties, each federation party includes at least one consensus node of the plurality of consensus nodes, each federation party corresponds to a consensus voting rule, N is an integer greater than 1, the method is performed by a first consensus node in the federation chain, the method comprises: determining a target alliance party to which the first consensus node belongs; Determining at least one consensus node contained by the target alliance party and a corresponding consensus voting rule; And selecting a voting representative node of the target alliance party from at least one consensus node contained in the target alliance party based on a consensus voting rule corresponding to the target alliance party, wherein the voting representative node is used for carrying out voting consensus processing on a proposal block in the alliance chain on behalf of the target alliance party.
- 2. The method of claim 1, wherein the federation chain contains a set of preconfigured consensus types, the set of preconfigured consensus types including a plurality of consensus types, each of the consensus types being for indicating a consensus voting rule, each of the federation parties corresponding to one of the plurality of consensus types; the corresponding consensus type of each alliance party is any one consensus type selected from a preset consensus type set by the alliance party according to own business requirements, and the corresponding consensus type is dynamically adjusted when the business requirements change by the alliance party.
- 3. The method of claim 1, wherein the consensus voting rule corresponding to the target coalition party is an internal voting rule; The selecting, based on the consensus voting rule corresponding to the target alliance party, a voting representative node of the target alliance party from at least one consensus node included in the target alliance party includes: According to the internal voting rule, selecting an alternative voting representative node from at least one consensus node contained in the target alliance party; and determining the voting representative node of the target alliance party from the alternative voting representative nodes respectively elected by all the consensus nodes in the target alliance party.
- 4. A method according to claim 3, wherein said electing an alternative voting representative node from at least one consensus node contained by said target coalition party according to said internal election voting rule comprises: Acquiring a proposal block to be commonly recognized in the alliance chain and a proposal node of the proposal block; according to the internal voting rule, if the proposal node is a consensus node contained by the target alliance party, the proposal node is elected to be an alternative voting representative node; if the proposed node is not the consensus node contained in the target alliance party, selecting an alternative voting representative node according to the block height of the proposed block.
- 5. The method of claim 4, wherein the electing an alternative vote representative node based on a block height of the proposed block comprises: aggregating node identifiers corresponding to the consensus nodes in the target alliance party respectively to obtain a node identifier set corresponding to the target alliance party; If the node identification set corresponding to the target alliance party contains node identifications with the same height as the block, determining the node identifications with the same height as the block as a first target node identification, and determining a consensus node indicated by the first target node identification as an alternative voting representative node selected by the first consensus node; If the node identification set corresponding to the target alliance party does not contain the node identification with the same block height, carrying out residual processing on the total number of the first nodes by the block height, determining the node identification with the same residual result in the node identification set corresponding to the target alliance party as a second target node identification, and determining the consensus node indicated by the second target node identification in at least one consensus node contained in the target alliance party as an alternative voting representative node of the target alliance party.
- 6. A method according to claim 3, wherein the determining the voting representative node of the target party from among the candidate voting representative nodes respectively elected from the respective consensus nodes in the target party comprises: the alternative voting representative nodes selected by all the consensus nodes in at least one consensus node contained in the target alliance party are aggregated to obtain an alternative set; Counting the occurrence frequency of each alternative voting representative node in the alternative set; and determining the alternative voting representative node with the largest occurrence frequency as the voting representative node of the target alliance party.
- 7. The method of claim 1, wherein the consensus voting rule corresponding to the target coalition party is a time-first voting rule; The selecting, based on the consensus voting rule corresponding to the target alliance party, a voting representative node of the target alliance party from at least one consensus node included in the target alliance party includes: acquiring a proposal block to be consensus in the alliance chain; executing the transaction in the proposal block, and generating voting information aiming at the proposal block according to the executing result of the transaction; determining consensus nodes except the consensus node in the target alliance party in the alliance chain as first residual consensus nodes, and determining the consensus nodes except the first consensus node in the target alliance party as second residual consensus nodes; According to the time-priority voting rule, the receiving time of the first residual consensus node receiving the voting information of the first consensus node aiming at the proposal block and the receiving time of the second residual consensus node receiving the voting information of the second residual consensus node aiming at the proposal block are obtained, and the consensus node indicated by the earliest receiving time is determined as the voting representative node of the target alliance party.
- 8. The method of claim 1, wherein each party is associated with a consensus type, and wherein the consensus voting rule associated with each party is determined by the corresponding consensus type; The voting representative node of the target alliance party performs voting consensus processing on the proposal blocks in the alliance chain on behalf of the target alliance party, and the voting representative node comprises: Acquiring a proposal block to be consensus in the alliance chain and voting information of a voting representative node of the target alliance party aiming at the proposal block; Acquiring a target consensus type corresponding to the target alliance party, and performing information processing on voting information of the first consensus node for the proposal block according to an information processing mode indicated by the target consensus type to obtain representative voting information of the first consensus node for the proposal block; And carrying out block consensus processing on the proposal blocks according to the voting representative nodes of all alliance parties in the alliance chain and the representative voting information of the proposal blocks.
- 9. The method of claim 8, wherein the target consensus type is an internal election type, and the information processing manner indicated by the target consensus type is an internal unified manner indicated by the internal election type; The information processing method according to the information processing mode indicated by the target consensus type, performs information processing on the voting information of the first consensus node for the proposal block to obtain the representative voting information of the first consensus node for the proposal block, and includes: According to the internal unified mode, acquiring voting information of each consensus node in the target alliance party aiming at the proposal block respectively, wherein the voting information of each consensus node in the target alliance party aiming at the proposal block carries respective signature information; Counting a first number of voting information representing a voting passing result and a second number of voting information representing a voting failing result in voting information of each consensus node in the target alliance party aiming at the proposal block; if the first number is larger than the second number, generating representative voting information of the first consensus node for the proposal block based on voting information representing voting passing results and signature information of each consensus node in the target alliance party; If the first number is smaller than the second number, generating representative voting information of the first consensus node for the proposal block based on voting information representing a voting failing result and signature information of each consensus node in the target alliance party.
- 10. The method of claim 8, wherein the method further comprises: According to the consensus type of other alliance parties, carrying out validity verification on the representative voting information of the proposal block by the voting representative nodes of the other alliance parties to obtain a validity verification result, wherein the other alliance parties refer to alliance parties except the target alliance party in the N alliance parties; And if the validity verification result is a verification passing result, executing a step of performing block consensus processing on the proposal block according to the representative voting information of each party in the alliance chain aiming at the proposal block.
- 11. The method of claim 10, wherein the consensus type to which the other federated party belongs is a full participation type; And according to the consensus type of the other alliance party, performing validity verification on the representative voting information of the proposal block by the voting representative node of the other alliance party to obtain a validity verification result, wherein the validity verification result comprises the following steps: Detecting the receiving attribute of the voting information of each consensus node in the other alliance party aiming at the proposal block according to the total participation type; If the receiving attribute of the voting information of each consensus node aiming at the proposal block in the other alliance party is the received attribute, determining that the validity verification result of the voting representative node of the other alliance party aiming at the representative voting information of the proposal block is a verification passing result; If the receiving attribute of the voting information of any consensus node in the other alliance party is the unreceived attribute, determining that the validity verification result of the voting representative node of the other alliance party aiming at the representative voting information of the proposal block is a verification failing result.
- 12. A data processing apparatus based on a federated chain, the apparatus being applied to a first consensus node in the federated chain, the federated chain comprising a plurality of consensus nodes, the federated chain being comprised of N federated parties, each of the federated parties comprising at least one consensus node of the plurality of consensus nodes, each of the federated parties corresponding to a consensus voting rule, N being an integer greater than 1, the apparatus comprising: the coalition determining module is used for determining a target coalition party to which the first consensus node belongs; the rule determining module is used for determining at least one consensus node and a corresponding consensus voting rule contained in the target alliance party; The selection module is used for selecting a voting representative node of the target alliance party from at least one consensus node contained in the target alliance party based on a consensus voting rule corresponding to the target alliance party, and is used for carrying out voting consensus processing on proposal blocks in the alliance chain on behalf of the target alliance party.
- 13. A computer device comprises a processor, a memory, and a network interface; The processor is connected to the memory and the network interface, wherein the network interface is configured to provide a network communication function, the memory is configured to store a computer program, and the processor is configured to invoke the computer program to cause the computer device to perform the method of any of claims 1-11.
- 14. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program adapted to be loaded by a processor and to perform the method of any of claims 1-11.
- 15. A computer program product, characterized in that the computer program product comprises a computer program stored in a computer readable storage medium, the computer program being adapted to be read and executed by a processor to cause a computer device having the processor to perform the method of any of claims 1-11.
Description
Data processing method, device and equipment based on alliance chain and readable storage medium Technical Field The present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, device and readable storage medium based on a coalition chain. Background With the development of blockchain technology, more and more business systems are beginning to use blockchains. The alliance chain refers to a blockchain which is commonly participated by a plurality of organizations/organizations and is cooperatively maintained together, namely, different organizations form benefit-related alliances, and a healthy operation of the blockchain is commonly maintained, and the blockchain is called as an alliance chain. In the alliance chain, each organization runs and manages one or more consensus nodes, and after a certain organization authorizes a certain consensus node, the organization can join or leave the alliance chain. Based on the foregoing, it can be seen that the consensus nodes running in the federated chain are all the consensus nodes run by all organizations within the federation, and for the blocks in the federated chain to be consensus, all the consensus nodes run in the federated chain are required to be consensus. Typically, the federation chain employs a bayer fault tolerance (Byzantine Fault Tolerance, BFT) consensus mechanism, i.e., as long as more than a certain proportion (e.g., 2/3) of the consensus nodes in the federation chain agree on a result, the result that most of the consensus nodes agree on is determined to be the final consensus result. That is, the federation chain itself depends on all the consensus nodes in the federation chain to perform consensus judgment, so that an organization with more consensus nodes has higher speaking right to form the centralization of the federation chain, thereby reducing the fairness of the federation chain. Disclosure of Invention The embodiment of the application provides a data processing method, device and equipment based on a alliance chain and a readable storage medium, which can improve the decentralization and fairness of the alliance chain. In one aspect, an embodiment of the present application provides a data processing method based on a federation chain, where the federation chain includes a plurality of consensus nodes, the federation chain is formed by N federation parties, each federation party includes at least one consensus node of the plurality of consensus nodes, each federation party corresponds to a consensus voting rule, and N is an integer greater than 1, where the method is performed by a first consensus node in the federation chain, and the method includes: determining a target alliance party to which the first consensus node belongs; determining at least one consensus node contained in the target alliance party and a corresponding consensus voting rule; And selecting a voting representative node of the target alliance party from at least one consensus node contained in the target alliance party based on a consensus voting rule corresponding to the target alliance party, wherein the voting representative node is used for carrying out voting consensus processing on proposal blocks in an alliance chain on behalf of the target alliance party. In one aspect, an embodiment of the present application provides a data processing apparatus based on a federation chain, where the apparatus is applied to a first consensus node in the federation chain, the federation chain includes a plurality of consensus nodes, the federation chain is formed by N federation parties, each federation party includes at least one consensus node in the plurality of consensus nodes, each federation party corresponds to a consensus voting rule, and N is an integer greater than 1, and the apparatus includes: The coalition determining module is used for determining a target coalition party to which the first consensus node belongs; the rule determining module is used for determining at least one consensus node and a corresponding consensus voting rule contained in the target alliance party; the selection module is used for selecting a voting representative node of the target alliance party from at least one consensus node contained in the target alliance party based on a consensus voting rule corresponding to the target alliance party, and is used for carrying out voting consensus processing on a proposal block in a alliance chain on behalf of the target alliance party. In one embodiment, the federation chain includes a preconfigured set of consensus types including a plurality of consensus types, each consensus type indicating a consensus voting rule, each federation party corresponding to one of the plurality of consensus types; the corresponding consensus type of each alliance party is any one consensus type selected from a preconfigured consensus type set by the alliance party according to own business requi