CN115629900A - View processing method and device in alliance chain and electronic equipment - Google Patents

View processing method and device in alliance chain and electronic equipment Download PDF

Info

Publication number
CN115629900A
CN115629900A CN202211235108.XA CN202211235108A CN115629900A CN 115629900 A CN115629900 A CN 115629900A CN 202211235108 A CN202211235108 A CN 202211235108A CN 115629900 A CN115629900 A CN 115629900A
Authority
CN
China
Prior art keywords
consensus
node
response
participating
replica
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.)
Pending
Application number
CN202211235108.XA
Other languages
Chinese (zh)
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.)
Beijing Octa Innovations Information Technology Co Ltd
Original Assignee
Beijing Octa Innovations Information Technology 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 Beijing Octa Innovations Information Technology Co Ltd filed Critical Beijing Octa Innovations Information Technology Co Ltd
Priority to CN202211235108.XA priority Critical patent/CN115629900A/en
Publication of CN115629900A publication Critical patent/CN115629900A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0793Remedial or corrective actions
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/542Event management; Broadcasting; Multicasting; Notifications
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The method comprises the steps that a view processing method, a view processing device and electronic equipment in a alliance chain are disclosed, wherein when a response consensus request is overtime in response to a master copy node participating in consensus processing in the alliance chain, each slave copy node participating in the consensus processing in the alliance chain generates a map cutting request and broadcasts in the alliance chain; the duplicate nodes which do not participate in the consensus processing in the alliance chain receive each view switching request broadcasted from the duplicate node which participates in the consensus processing to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting certificate; and verifying the legality of the graph cutting opening certificate by the master copy node participating in the consensus processing in the alliance chain, responding to the legality of the graph cutting opening certificate, sending the graph cutting opening certificate to the new master copy node, and enabling the new master copy node to replace the master copy node overtime in response to the consensus request so as to perform view switching, so that the new master copy node and the copy node participating in the consensus processing are positioned in the same view.

Description

View processing method and device in alliance chain and electronic equipment
Technical Field
The present application relates to the field of federation chain technologies, and in particular, to a method and an apparatus for processing views in a federation chain, and an electronic device.
Background
The alliance link technology does not have an authoritative central node to uniformly manage data in the system. The data in the federation chain is stored in a copy in a disk of each federation chain node, which needs a mechanism for ensuring that the data of each node is consistent by making each node in the federation chain coordinate their actions to agree on a block through a consensus process.
However, in the consensus process, one node may be used as a master copy node, all other nodes may be used as slave copy nodes, and the master copy node and the slave copy nodes are managed as views in the block chain.
Disclosure of Invention
Based on the above problem, embodiments of the present application provide a view processing method and apparatus in a federation chain, and an electronic device.
The embodiment of the application discloses the following technical scheme:
1. a method for processing views in a federation chain, comprising:
responding to response consensus request timeout of a master replica node participating in consensus processing in the alliance chain, generating a graph cutting request by each slave replica node participating in the consensus processing in the alliance chain, and broadcasting the graph cutting request in the alliance chain;
the duplicate nodes which do not participate in the consensus processing in the alliance chain receive the view switching request broadcasted by each duplicate node which participates in the consensus processing to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting certificate;
and the master copy node participating in the consensus process in the alliance chain verifies the legality of the graph cut open certificate, responds to the fact that the graph cut open certificate is legal, sends the graph cut open certificate to a new master copy node, and enables the new master copy node to replace the master copy node overtime in response to the consensus request so as to perform view switching, so that the new master copy node and the copy node participating in the consensus process are located in the same view.
2. The method of claim 1, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: and judging that the response consensus request timeout occurs in the main replica node participating in the consensus processing in the alliance chain according to the response consensus request timeout challenge certificate generated from the replica node participating in the consensus processing in the alliance chain and the response consensus request stability certificate generated from the replica node not participating in the consensus processing in the alliance chain.
3. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: polling the inquiry messages of the response consensus request overtime of the master replica node, which are sent by the slave replica nodes participating in the consensus processing in the view, wherein each slave replica node sending the inquiry messages has a first sequence identification code, and all the inquiry messages are spliced into the response consensus request overtime inquiry certificate according to the first sequence identification codes of the corresponding slave replica nodes.
4. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: polling stability messages of the main replica node responding to the consensus request, which are sent by the replica nodes not participating in the consensus processing in the view, wherein each slave replica node sending the stability messages has a second sequence identification code, and all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification codes of the corresponding slave replica nodes.
5. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: and acquiring a consensus state recorded in a consensus state machine in the alliance chain, and determining a plurality of slave replica nodes with the same consensus state as the replica nodes participating in the consensus processing based on the consensus state.
6. The method of claim 5, wherein the first sequence identification code is generated as follows: determining a consensus timestamp for each of a number of slave replica nodes having the same consensus status; and generating a first random number based on the consensus timestamp, and distributing the first random number to the slave replica node as the sequence identification code.
7. The method of claim 3, further comprising: generating a challenge message digest for each challenge message, and combining the challenge message digest with the sequence identification of the slave copy node which sends the challenge message into a key-value pair; all the challenge messages are spliced into the response consensus request overtime challenge proof according to the sequence of the first sequence identification codes of the corresponding slave copy nodes, and the method comprises the following steps: based on the key value, all the inquiry messages are spliced into a response consensus request timeout inquiry certificate according to the sequence identification code sequence of the slave replica node which sends the inquiry messages.
8. The method of claim 7, further comprising: establishing a challenge message broadcast queue based on the sequence identification of the slave copy node broadcasting the challenge message, and projecting the key value pair onto the challenge message broadcast queue to dynamically maintain the challenge message broadcast queue according to the key value.
9. The method of claim 4, further comprising: generating a confirmation message digest for each confirmation message, and combining the digest with the sequence identification of the slave copy node broadcasting the confirmation message into a key-value pair; all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification code sequence of the corresponding slave replica node, and the method comprises the following steps: based on the key value, all the stability messages are spliced into a stability certificate according to the sequence of the second sequence identification codes of the slave copy nodes sending the stability messages.
10. The method of claim 9, further comprising: and establishing a stability message broadcasting queue based on the sequence identification of the slave copy node which sends the confirmation message, and projecting the key value pair onto the stability message broadcasting queue so as to dynamically maintain the stability message broadcasting queue according to the key value.
11. The method according to claim 7, wherein the challenge message carries an identity code of the primary replica node, so that when all the challenge messages are sequentially spliced into one response consensus request timeout challenge certificate according to the sequence identification code of the secondary replica node that sends the challenge message, the identity codes included in the challenge messages are separated, so that the response consensus request timeout challenge certificate includes one identity code.
12. The method according to claim 2, wherein the determining that the response consensus request timeout occurs for the primary replica node in the federation chain participating in the consensus process according to the response consensus request timeout challenge certificate generated from the replica node participating in the consensus process in the federation chain and the response consensus request stability certificate generated from the replica node not participating in the consensus process in the federation chain comprises: loading the challenge proof and the stability proof into two containers with dynamically adjustable volume sizes, respectively; determining whether the master replica node has actually timed out in response to a consensus request based on a volume ratio of the two containers.
13. The method of claim 12, wherein determining whether the master replica node has actually timed out in response to a consensus request based on a volumetric ratio of the two containers comprises: in response to the volumes of the two containers satisfying:
Figure BDA0003883342830000031
in a set rangeIn the enclosure, S 1 Representing the size of the volume in which the challenge proof is loaded, S 2 And k represents the volume size of the stability certification, and k represents the volume size of the alliance chain, the primary replica node is judged to be actually responding to the consensus request and time out.
14. The method of claim 1, wherein causing the new master replica node to replace the master replica node that has timed out in response to a consensus request comprises: and judging whether all the replica nodes participating in the consensus processing generate a graph cutting confirmation message, and if so, replacing the primary replica node with the new primary replica node which responds to the consensus request overtime.
15. An apparatus for processing views in a federation chain, comprising:
a first program unit, configured to respond to a timeout of a response consensus request occurring at a master replica node participating in the consensus process in the federation chain, generate a graph cutting request for each slave replica node participating in the consensus process in the federation chain, and broadcast the graph cutting request in the federation chain;
a second program unit, configured to receive, by a duplicate node not participating in the consensus process in the federation chain, the view switching request broadcast from the duplicate node to participate in the consensus process to generate a graph cut message, where the graph cut messages generated by a plurality of other duplicate nodes not participating in the consensus process are assembled to form a graph cut opening certificate;
and a third program unit, configured to verify the validity of the graph cut open certificate by a master copy node participating in consensus processing in the federation chain, send the graph cut open certificate to a new master copy node in response to the graph cut open certificate being valid, and enable the new master copy node to replace the master copy node that has responded to a consensus request overtime, so as to perform view switching, so that the new master copy node and the copy node participating in consensus processing are located in the same view.
16. The apparatus of claim 15, wherein the first program unit is further configured to: and judging that the response consensus request timeout occurs on the primary replica node participating in the consensus processing in the alliance chain according to a response consensus request timeout challenge certificate generated from the replica node participating in the consensus processing in the alliance chain and a response consensus request stability certificate generated from the replica node not participating in the consensus processing in the alliance chain.
17. The apparatus according to claim 16, characterized in that the first program unit is further adapted to: polling the inquiry messages of the response consensus request overtime of the master replica node, which are sent by the slave replica nodes participating in the consensus processing in the view, wherein each slave replica node sending the inquiry messages has a first sequence identification code, and all the inquiry messages are spliced into the response consensus request overtime inquiry certificate according to the first sequence identification codes of the corresponding slave replica nodes.
18. The apparatus according to claim 16, characterized in that the first program unit is further adapted to: polling stability messages of response consensus requests of the main replica nodes, sent by the replica nodes which do not participate in the consensus processing in the view, wherein each slave replica node sending the stability messages has a second sequence identification code, and all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification codes of the corresponding slave replica nodes.
19. The apparatus of claim 16, wherein the first program unit is further configured to: and acquiring a consensus state recorded in a consensus state machine in the alliance chain, and determining a plurality of slave replica nodes with the same consensus state as the replica nodes participating in the consensus processing based on the consensus state.
20. The apparatus of claim 19, wherein the first sequence identification code is generated as follows: such that the first program unit determines a consensus timestamp for each of a number of slave replica nodes having the same consensus status; and generating a first random number based on the consensus timestamp, and distributing the first random number to the slave replica node as the sequence identification code.
21. The apparatus of claim 17, further comprising: a first digest generation unit, configured to generate a challenge message digest for each challenge message, and combine the challenge message digest with a sequence identifier of a slave node that sends the challenge message into a key-value pair; the first program element is further for: based on the key value, all the inquiry messages are spliced into a response consensus request timeout inquiry certificate according to the sequence identification code sequence of the slave replica node which sends the inquiry messages.
22. The apparatus of claim 21, further comprising: and the first queue establishing unit is used for establishing a challenge message broadcast queue based on the sequence identification of the slave copy node broadcasting the challenge message, and projecting the key value pair onto the challenge message broadcast queue so as to dynamically maintain the challenge message broadcast queue according to the key value.
23. The apparatus of claim 18, further comprising: a second digest generation unit, configured to generate a digest of each acknowledgment message, and combine the digest with the sequence identifier of the slave node that broadcasts the acknowledgment message to form a key-value pair; the first program element is further for: based on the key value, all the stability messages are spliced into a stability certificate according to the sequence of the second sequence identification codes of the slave copy nodes sending the stability messages.
24. The apparatus of claim 23, further comprising: and the second queue establishing unit is used for establishing a stability message broadcasting queue based on the sequence identification of the slave copy node which sends the confirmation message, and projecting the key value pair onto the stability message broadcasting queue so as to dynamically maintain the stability message broadcasting queue according to the key value.
25. The apparatus according to claim 21, wherein the challenge message carries an identity code of the primary replica node, so that when all challenge messages of the first digest generation unit are spliced into a response consensus request timeout challenge certificate according to a sequence of sequence identifiers of secondary replica nodes that send the challenge messages, the identity codes included in the challenge messages are separated, so that the response consensus request timeout challenge certificate includes one of the identity codes.
26. The apparatus according to claim 16, characterized in that the first program unit is further adapted to: loading the challenge proof and the stability proof into two dynamically sized containers, respectively; determining whether the master replica node has actually timed out in response to a consensus request based on a volume ratio of the two containers.
27. The apparatus of claim 26, wherein the first program unit is further configured to: in response to the volumes of the two containers satisfying:
Figure BDA0003883342830000061
within a set range, S 1 Representing the size of the volume in which the challenge proof is loaded, S 2 And k represents the volume size of the stability certification, and k represents the volume size of the alliance chain, the primary replica node is judged to be actually responding to the consensus request and time out.
28. The apparatus according to claim 15, characterized in that the third program element is further adapted to: and judging whether all the replica nodes participating in the consensus processing generate a graph cutting confirmation message, and if so, replacing the primary replica node with the new primary replica node which responds to the consensus request overtime.
29. An electronic device, comprising a memory and a processor, wherein the memory stores an executable program, and the processor executes the executable program to perform the following steps:
responding to response consensus request timeout of a master replica node participating in consensus processing in the alliance chain, generating a graph cutting request by each slave replica node participating in the consensus processing in the alliance chain, and broadcasting the graph cutting request in the alliance chain;
the duplicate nodes which do not participate in the consensus processing in the alliance chain receive the view switching request broadcasted by each duplicate node which participates in the consensus processing to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting certificate;
and the master copy node participating in the consensus processing in the alliance chain verifies the legality of the graph cut open certificate, responds to the graph cut open certificate being legal, sends the graph cut open certificate to a new master copy node, and enables the new master copy node to replace the master copy node overtime in response to the consensus request so as to perform view switching, so that the new master copy node and the copy node participating in the consensus processing are located in the same view.
In the technical solution of the embodiment of the present application, in response to a timeout of a response consensus request occurring at a master replica node participating in the consensus process in the federation chain, each slave replica node participating in the consensus process in the federation chain generates a graph cutting request and broadcasts in the federation chain; the duplicate nodes which do not participate in the consensus processing in the alliance chain receive the view switching request broadcasted by each duplicate node which participates in the consensus processing to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting certificate; the master copy node participating in consensus processing in the alliance chain verifies the legality of the graph cut open proof, responds to the fact that the graph cut open proof is legal, sends the graph cut open proof to a new master copy node, and enables the new master copy node to replace the master copy node overtime in response to the consensus request so as to conduct view switching, so that the new master copy node and the copy node participating in consensus processing are located in the same view, and the situation that the view is wrong when the master copy node overtime in consensus is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a flowchart illustrating a method for processing views in a federation chain according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of a view processing apparatus in a federation chain according to an embodiment of the present application;
FIG. 3 is a schematic structural diagram of a view processing apparatus in a federation chain according to an embodiment of the present application;
FIG. 4 is a schematic structural diagram of an electronic device in an embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of an electronic device in an embodiment of the present application.
Detailed Description
It is not necessary for any particular embodiment of the invention to achieve all of the above advantages at the same time.
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
In the technical solution of the embodiment of the present application, in response to a response consensus request timeout occurring at a master replica node participating in consensus processing in the federation chain, each slave replica node participating in consensus processing in the federation chain generates a graph cutting request and broadcasts the graph cutting request in the federation chain; the duplicate nodes which do not participate in the consensus processing in the alliance chain receive the view switching request broadcasted by each duplicate node which participates in the consensus processing to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting certificate; the master copy node participating in the consensus process in the alliance chain verifies the legality of the graph cut open certificate, responds to the fact that the graph cut open certificate is legal, sends the graph cut open certificate to a new master copy node, and enables the new master copy node to replace the master copy node which responds to the consensus request overtime so as to conduct view switching, so that the new master copy node and the copy node participating in the consensus process are located in the same view, and the situation that the view is wrong when the master copy node is overtime in the consensus process is avoided.
Fig. 1 is a schematic flowchart of a view processing method in a federation chain according to an embodiment of the present application; as shown in fig. 1, it includes:
s101, responding to overtime response consensus request of a master replica node participating in consensus processing in the alliance chain, generating a graph cutting request by each slave replica node participating in the consensus processing in the alliance chain, and broadcasting in the alliance chain;
s102, receiving the view switching request broadcasted by each copy node participating in the consensus processing by the copy nodes not participating in the consensus processing in the alliance chain to generate a graph cutting message, and splicing the graph cutting messages generated by a plurality of other copy nodes not participating in the consensus processing to form a graph cutting starting proof;
s103, the master copy node participating in the consensus process in the alliance chain verifies the legality of the graph cut open certificate, responds to the graph cut open certificate being legal, sends the graph cut open certificate to a new master copy node, and enables the new master copy node to replace the master copy node which is overtime in response to the consensus request so as to perform view switching, so that the new master copy node and the copy node participating in the consensus process are located in the same view.
Optionally, the responding to a timeout of the response consensus request occurring at the primary replica node participating in the consensus process in the federation chain includes: and judging that the response consensus request timeout occurs on the master replica node participating in the consensus processing in the alliance chain according to a response consensus request timeout challenge certificate generated by the slave replica node participating in the consensus processing in the alliance chain and a response consensus request stability certificate generated by the replica node not participating in the consensus processing in the alliance chain, thereby accurately determining that the response consensus request timeout occurs on the master replica node participating in the consensus processing in the alliance chain.
Optionally, the responding to a timeout of a response consensus request occurring at a primary replica node participating in consensus processing in the federation chain includes: polling the inquiry messages of the response consensus request overtime of the master replica node, which are sent by the slave replica nodes participating in the consensus processing in the view, wherein each slave replica node sending the inquiry messages has a first sequence identification code, and all the inquiry messages are spliced into the inquiry certificate of the response consensus request overtime according to the first sequence identification codes of the corresponding slave replica nodes, so that the time sequence among the inquiry messages is ensured, and meanwhile, the inquiry messages are spliced to form the inquiry certificate.
Optionally, the responding to a timeout of the response consensus request occurring at the primary replica node participating in the consensus process in the federation chain includes: polling stability messages of the main replica node responding to the consensus request, which are sent by the replica nodes not participating in the consensus processing in the view, wherein each slave replica node sending the stability messages has a second sequence identification code, and all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification codes of the corresponding slave replica nodes. And polling a stability message of the primary replica node responding to the consensus request sent by the replica node which does not participate in the consensus processing in the view, so that the conflict of data processing in the algorithm execution process is ensured.
Optionally, the responding to a timeout of the response consensus request occurring at the primary replica node participating in the consensus process in the federation chain includes: the consensus state recorded in the consensus state machine in the alliance chain is obtained, a plurality of slave replica nodes with the same consensus state are determined to be the replica nodes participating in the consensus processing based on the consensus state, and the replica nodes participating in the consensus processing are determined based on the consensus state, so that the master replica nodes responding to the consensus request overtime can be accurately determined.
Optionally, the first sequence identification code is generated as follows: determining a consensus timestamp for each of a number of slave replica nodes having the same consensus status; and generating a first random number based on the consensus timestamp, distributing the first random number to the slave copy node to serve as the sequence identification code, and generating the first random number based on the consensus timestamp, so that the sequence identification code represents the time sequence of the slave copy node participating in consensus processing, and meanwhile, the privacy of the sequence identification code is increased, and the safety of the algorithm is guaranteed.
Optionally, the method further comprises: generating a challenge message digest for each challenge message, and combining the challenge message digest with the sequence identification of the slave copy node which sends the challenge message into a key-value pair; all the inquiry messages are spliced into one response consensus request overtime inquiry certificate according to the sequence of the first sequence identification codes of the corresponding slave copy nodes, and the method comprises the following steps: based on the key value, all the inquiry messages are spliced into a response consensus request timeout inquiry certificate according to the sequence identification code sequence of the slave replica node which sends the inquiry messages.
In the embodiment, the safety of the challenge message is ensured based on the digest of the challenge message, the space requirement of data storage is further reduced based on the key value pair, the transmission efficiency is ensured, and meanwhile, the plurality of challenge messages are spliced into one challenge certificate according to the sequence of the sequence identification codes of the slave copy nodes broadcasting the challenge messages, so that the orderliness of the challenge messages is ensured, meanwhile, the plurality of challenge messages form one challenge certificate integrally, the safety of the challenge messages is ensured, and the challenge messages cannot be tampered.
Optionally, the method further comprises: establishing a challenge message broadcast queue based on the sequence identification of the slave copy node broadcasting the challenge message, and projecting the key value pair onto the challenge message broadcast queue to dynamically maintain the challenge message broadcast queue according to the key value.
Optionally, the method further comprises: generating a confirmation message digest for each confirmation message, and combining the digest with the sequence identification of the slave copy node broadcasting the confirmation message into a key-value pair; all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification code sequence of the corresponding slave replica node, and the method comprises the following steps: based on the key value, all the stability messages are spliced into a stability certificate according to the sequence of the second sequence identification codes of the slave copy nodes sending the stability messages.
In the embodiment, the safety of the confirmation messages is ensured based on the confirmation message abstract, the space requirement of data storage is further reduced based on the key value pair, the transmission efficiency is ensured, meanwhile, the confirmation messages are spliced into the confirmation certificate according to the sequence identification code sequence of the broadcast copy nodes of the confirmation messages, so that the orderliness of the confirmation messages is ensured, meanwhile, the confirmation certificates are integrally formed by the confirmation messages, and the safety of the confirmation messages is ensured and cannot be falsified.
Optionally, the method further comprises: and establishing a stability message broadcasting queue based on the sequence identification of the slave copy node which sends the confirmation message, and projecting the key value pair onto the stability message broadcasting queue so as to dynamically maintain the stability message broadcasting queue according to the key value.
In this embodiment, the challenge message is maintained in a key-value pair manner by establishing a message broadcast queue and projecting the key-value pair to the challenge message broadcast queue.
In this embodiment, the key value pair may be projected onto the challenge message broadcast queue by specifically establishing a mapping relationship between the key value pair and each queue node in the challenge message broadcast queue.
Optionally, the challenge message carries the identity code of the master replica node, so that when all the challenge messages are spliced into one response consensus request timeout challenge certificate according to the sequence of the sequence identifiers of the slave replica nodes sending the challenge messages, the identity codes included in the challenge messages are separated, so that the response consensus request timeout challenge certificate includes one identity code.
Optionally, the determining, according to a challenge certificate of response consensus request timeout generated by a slave replica node participating in consensus processing in the federation chain and a stability certificate of response consensus request generated by a replica node not participating in consensus processing in the federation chain, that a response consensus request timeout occurs in a master replica node participating in consensus processing in the federation chain includes: loading the challenge proof and the stability proof into two containers with dynamically adjustable volume sizes, respectively; determining whether the master replica node has actually timed out in response to a consensus request based on a volume ratio of the two containers.
In this embodiment, based on the volume comparison of the containers, it may be quickly determined whether the master replica node actually responds to the consensus request overtime, so as to improve the efficiency of executing the algorithm.
Optionally, the determining whether the primary replica node actually times out in response to the consensus request based on the volume ratio of the two containers includes: in response to the volumes of the two containers satisfying:
Figure BDA0003883342830000101
within a set range, S 1 Representing the size of the volume in which the challenge proof is loaded, S 2 And k represents the volume size of the stability certification, and k represents the volume size of the alliance chain, the primary replica node is judged to be actually responding to the consensus request and time out.
Optionally, causing the new master-replica node to replace the master-replica node that has a response consensus request timeout includes: and judging whether all the replica nodes participating in the consensus processing generate a graph cutting confirmation message, and if so, enabling the new master replica node to replace the master replica node which responds to the consensus request overtime.
FIG. 2 is a schematic structural diagram of a view processing apparatus in a federation chain according to an embodiment of the present application; as shown in fig. 2, it includes:
a first program unit 201, configured to respond to a timeout of a response consensus request occurring at a master replica node participating in a consensus process in the federation chain, where each slave replica node participating in the consensus process in the federation chain generates a graph cutting request and broadcasts within the federation chain;
a second program unit 202, configured to receive, by a replica node not participating in the consensus process in the federation chain, the view switching request broadcast from the replica node to participate in the consensus process to generate a cut-map message, where cut-map messages generated by a plurality of other replica nodes not participating in the consensus process are assembled to form a cut-map opening certificate;
a third program unit 203, where the master copy node participating in the consensus process in the federation chain verifies the validity of the graph cut open certificate, and sends the graph cut open certificate to a new master copy node in response to the graph cut open certificate being valid, so that the new master copy node replaces the master copy node that has responded to the consensus request overtime, so as to perform view switching, and thus the new master copy node and the copy node participating in the consensus process are located in the same view.
Optionally, the first program element 201 is further configured to: and judging that the response consensus request timeout occurs in the main replica node participating in the consensus processing in the alliance chain according to the response consensus request timeout challenge certificate generated from the replica node participating in the consensus processing in the alliance chain and the response consensus request stability certificate generated from the replica node not participating in the consensus processing in the alliance chain.
Optionally, the first program element 201 is further configured to: polling the inquiry messages of the response consensus request overtime of the master replica node, which are sent by the slave replica nodes participating in the consensus processing in the view, wherein each slave replica node sending the inquiry messages has a first sequence identification code, and all the inquiry messages are spliced into the response consensus request overtime inquiry certificate according to the first sequence identification codes of the corresponding slave replica nodes.
Optionally, the first program element 201 is further configured to: polling stability messages of the main replica node responding to the consensus request, which are sent by the replica nodes not participating in the consensus processing in the view, wherein each slave replica node sending the stability messages has a second sequence identification code, and all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification codes of the corresponding slave replica nodes.
Optionally, the first program element 201 is further configured to: and acquiring a consensus state recorded in a consensus state machine in the alliance chain, and determining a plurality of slave replica nodes with the same consensus state as the replica nodes participating in the consensus processing based on the consensus state.
Optionally, the first sequence identification code is generated as follows: such that the first program unit 201 determines for each of several slave replica nodes having the same consensus status its consensus timestamp; and generating a first random number based on the consensus timestamp, and distributing the first random number to the slave replica node as the sequence identification code.
FIG. 3 is a schematic structural diagram of a view processing apparatus in a federation chain according to an embodiment of the present application; as shown in fig. 3, compared to fig. 2 above, there are added:
optionally, the apparatus further comprises: a first digest generation unit 204, configured to generate a challenge message digest for each challenge message, and combine the challenge message digest with the sequence identifier of the slave node that sent the challenge message into a key-value pair; the first program element 201 is further adapted to: based on the key value, all the inquiry messages are spliced into a response consensus request timeout inquiry certificate according to the sequence identification code sequence of the slave replica node which sends the inquiry messages.
Optionally, the apparatus further comprises: the first queue establishing unit 205 is configured to establish a challenge message broadcast queue based on the sequence identifier of the slave node broadcasting the challenge message, and project the key value pair onto the challenge message broadcast queue, so as to dynamically maintain the challenge message broadcast queue according to the key value pair.
Optionally, the apparatus further comprises: a second digest generation unit 206, configured to generate a digest of each acknowledgment message, and combine the digest with the sequence identifier of the slave node broadcasting the acknowledgment message into a key-value pair; the first program element 201 is further adapted to: based on the key value, all the stability messages are spliced into a stability certificate according to the sequence of the second sequence identification codes of the slave copy nodes sending the stability messages.
Optionally, the apparatus further comprises: a second queue establishing unit 207, configured to establish a stability message broadcast queue based on the sequence identifier of the slave node that sends the acknowledgment message, and project the key value pair onto the stability message broadcast queue, so as to dynamically maintain the stability message broadcast queue according to the key value pair.
Optionally, the challenge message carries the identity code of the primary replica node, so that when all challenge messages of the first digest generation unit 204 are spliced into a response consensus request timeout challenge certificate according to the sequence of the sequence identifiers of the secondary replica nodes that send the challenge messages, the identity codes included in the challenge messages are separated, so that the response consensus request timeout challenge certificate includes one identity code.
Optionally, the first program element 201 is further configured to: loading the challenge proof and the stability proof into two dynamically sized containers, respectively; and judging whether the primary replica node actually times out for responding to the consensus request or not based on the volume ratio of the two containers.
Optionally, the first program element 201 is further configured to: in response to the volumes of the two containers satisfying: s _ 1/(e ^ k [ (Mod) (S) 2^ k)) is in a set range, S _1 represents the volume size for loading the challenge certificate, S _2 represents the volume size for loading the stability certificate, and k represents the volume size of the federation chain, and then the master replica node is judged to be actually responding to the consensus request timeout.
Optionally, the third program element 203 is further configured to: and judging whether all the replica nodes participating in the consensus processing generate a graph cutting confirmation message, and if so, replacing the primary replica node with the new primary replica node which responds to the consensus request overtime.
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application; as shown in fig. 4, it includes a memory 301 and a processor 302, the memory stores an executable program, and the processor executes the executable program and executes the following steps:
determining a master replica node participating in consensus processing and determining a plurality of slave replica nodes with consensus states, wherein the master replica node and the plurality of slave replica nodes are positioned in the same view;
collecting the question messages broadcasted by the slave copy nodes in the view, wherein the response consensus requests of the master copy nodes are overtime, counting the number of the slave copy nodes broadcasting the question messages, and splicing all the question messages into a question certificate according to the sequence identification code sequence of the slave copy nodes broadcasting the question messages;
collecting confirmation messages which are generated by responding to the challenge messages and broadcast by the slave copy nodes in the view, counting the number of the slave copy nodes broadcasting the confirmation messages, and splicing all the confirmation messages into a confirmation certificate according to the sequence identification codes of the slave copy nodes broadcasting the confirmation messages;
and judging whether the primary copy node actually responds to the consensus request overtime or not according to the challenge certificate and the confirmation certificate.
FIG. 5 is a schematic diagram of a hardware structure of an electronic device in an embodiment of the present application; as shown in fig. 5, the hardware structure of the electronic device may include: the electronic device 400 includes a computing unit 401 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 402 or a computer program loaded from a storage unit 406 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the device 400 can also be stored. The computing unit 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
A number of components in the electronic device 400 are connected to the I/O interface 405, including: an input unit 406, an output unit 407, a storage unit 408, and a communication unit 409. The input unit 406 may be any type of device capable of inputting information to the electronic device 400, and the input unit 406 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device. Output unit 407 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. The storage unit 404 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 409 allows the electronic device 400 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth (TM) devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
Computing unit 401 may be a variety of general and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 401 executes the respective methods and processes described above. For example, in some embodiments, the above steps may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 40. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 400 via the ROM 402 and/or the communication unit 409. In some embodiments, the computing unit 401 may be configured to perform the above steps in any other suitable manner (e.g., by means of firmware).
The electronic device of the embodiments of the present application exists in various forms, including but not limited to:
(1) Mobile communication devices, which are characterized by mobile communication capabilities and are primarily targeted at providing voice and data communications. Such terminals include smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, among others.
(2) The ultra-mobile personal computer equipment belongs to the category of personal computers, has the functions of calculation and processing, and generally has the mobile internet access characteristic. Such terminals include PDA, MID, and UMPC devices, such as ipads.
(3) Portable entertainment devices such devices may display and play multimedia content. Such devices include audio and video players (e.g., ipods), handheld game consoles, electronic books, and smart toys and portable car navigation devices.
(4) The server is similar to a general computer architecture, but has higher requirements on processing capability, stability, reliability, safety, expandability, manageability and the like because of the need of providing highly reliable services.
(5) And other electronic devices with data interaction functions.
It should be noted that, in this specification, each embodiment is described in a progressive manner, and the same and similar parts between the embodiments are referred to each other, and each embodiment focuses on differences from other embodiments. In particular, for the apparatus and system embodiments, since they are substantially similar to the method embodiments, they are described in a relatively simple manner, and reference may be made to some of the descriptions of the method embodiments for related points. The above-described embodiments of the apparatus and system are merely illustrative, and the modules described as separate components may or may not be physically separate, and the components suggested as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only one specific embodiment of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A method for processing views in a federation chain, comprising:
responding to response consensus request timeout of a master replica node participating in consensus processing in the alliance chain, generating a graph cutting request by each slave replica node participating in the consensus processing in the alliance chain, and broadcasting in the alliance chain;
the duplicate nodes which do not participate in the consensus processing in the alliance chain receive the view switching request broadcasted by each duplicate node which participates in the consensus processing so as to generate a graph cutting message, and the graph cutting messages generated by a plurality of other duplicate nodes which do not participate in the consensus processing are assembled to form a graph cutting starting proof;
and the master copy node participating in the consensus processing in the alliance chain verifies the legality of the graph cut open certificate, responds to the graph cut open certificate being legal, sends the graph cut open certificate to a new master copy node, and enables the new master copy node to replace the master copy node overtime in response to the consensus request so as to perform view switching, so that the new master copy node and the copy node participating in the consensus processing are located in the same view.
2. The method of claim 1, wherein said responding to a response consensus request timeout occurring for a master replica node participating in a consensus process in said federation chain is preceded by: and judging that the response consensus request timeout occurs in the main replica node participating in the consensus processing in the alliance chain according to the response consensus request timeout challenge certificate generated from the replica node participating in the consensus processing in the alliance chain and the response consensus request stability certificate generated from the replica node not participating in the consensus processing in the alliance chain.
3. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node participating in a consensus process in said federation chain is preceded by: polling inquiry messages of response consensus request timeout of the master replica node, which are sent by the slave replica nodes participating in the consensus processing in the view, wherein each slave replica node sending the inquiry messages has a first sequence identification code, and all the inquiry messages are spliced into the response consensus request timeout inquiry certificate according to the first sequence identification codes of the corresponding slave replica nodes.
4. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: polling stability messages of response consensus requests of the main replica nodes, sent by the replica nodes which do not participate in the consensus processing in the view, wherein each slave replica node sending the stability messages has a second sequence identification code, and all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification codes of the corresponding slave replica nodes.
5. The method of claim 2, wherein said responding to a response consensus request timeout occurring for a master replica node in the federation chain participating in a consensus process previously comprises: and acquiring a consensus state recorded in a consensus state machine in the alliance chain, and determining a plurality of slave replica nodes with the same consensus state as the replica nodes participating in the consensus processing based on the consensus state.
6. The method of claim 5, wherein the first sequence identification code is generated as follows: determining a consensus timestamp of each slave replica node in a plurality of slave replica nodes with the same consensus state; and generating a first random number based on the consensus timestamp, and distributing the first random number to the slave replica node as the sequence identification code.
7. The method of claim 3, further comprising: generating a challenge message digest for each challenge message, and combining the challenge message digest with the sequence identification of the slave copy node which sends the challenge message into a key-value pair; all the challenge messages are spliced into the response consensus request overtime challenge proof according to the sequence of the first sequence identification codes of the corresponding slave copy nodes, and the method comprises the following steps: based on the key value, all the inquiry messages are spliced into a response consensus request timeout inquiry certificate according to the sequence identification code sequence of the slave copy node sending the inquiry messages.
8. The method of claim 4, further comprising: generating a confirmation message digest for each confirmation message, and combining the digest with the sequence identification of the slave copy node broadcasting the confirmation message into a key-value pair; all the stability messages are spliced into a response consensus request stability certificate according to the second sequence identification code sequence of the corresponding slave replica node, and the method comprises the following steps: based on the key value, all the stability messages are spliced into a stability certificate according to the sequence of the second sequence identification codes of the slave copy nodes sending the stability messages.
9. The method according to claim 7, wherein the challenge message carries the identity code of the primary replica node, so that when all challenge messages are spliced into a response consensus request timeout challenge certificate according to the sequence of the sequence identifiers of the secondary replica nodes sending the challenge messages, the identity codes included in the challenge messages are separated, so that the response consensus request timeout challenge certificate includes one of the identity codes.
10. The method according to claim 2, wherein the determining that the response consensus request timeout occurs for the primary replica node in the federation chain participating in the consensus process according to the response consensus request timeout challenge certificate generated from the replica node participating in the consensus process in the federation chain and the response consensus request stability certificate generated from the replica node not participating in the consensus process in the federation chain comprises: loading the challenge proof and the stability proof into two containers with dynamically adjustable volume sizes, respectively; determining whether the master replica node has actually timed out in response to a consensus request based on a volume ratio of the two containers.
CN202211235108.XA 2022-10-10 2022-10-10 View processing method and device in alliance chain and electronic equipment Pending CN115629900A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211235108.XA CN115629900A (en) 2022-10-10 2022-10-10 View processing method and device in alliance chain and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211235108.XA CN115629900A (en) 2022-10-10 2022-10-10 View processing method and device in alliance chain and electronic equipment

Publications (1)

Publication Number Publication Date
CN115629900A true CN115629900A (en) 2023-01-20

Family

ID=84903870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211235108.XA Pending CN115629900A (en) 2022-10-10 2022-10-10 View processing method and device in alliance chain and electronic equipment

Country Status (1)

Country Link
CN (1) CN115629900A (en)

Similar Documents

Publication Publication Date Title
CN107862216B (en) Privacy protection method, device and storage medium for anonymous cross-link transaction
CN111539726B (en) Block chain consensus system and method
CN108769230B (en) Transaction data storage method, device, server and storage medium
CN112600678B (en) Data processing method, device, equipment and storage medium
CN111275555B (en) Block chain transaction processing method, transaction node and block chain system
CN113794694B (en) Binary consensus method and device based on reliable broadcast
CN110177124A (en) Identity identifying method and relevant device based on block chain
US20170171496A1 (en) Method and Electronic Device for Screen Projection
WO2017181601A1 (en) Live broadcast streaming processing method, apparatus, electronic device and system
CN112118239A (en) Block chain consensus method and device, electronic equipment and storage medium
CN114070733A (en) Consensus method, device and system based on block chain network
CN110990790B (en) Data processing method and equipment
CN112423285A (en) Networking method of terminal equipment, electronic equipment and storage medium
CN112134883A (en) Method and device for quickly authenticating trust relationship between nodes based on trusted computing and related products
CN113347174B (en) Consensus method and device in block chain and electronic equipment
CN112202765A (en) Block chain common identification block method and device based on trusted computing and related products
CN109348451A (en) The storage method and device of vehicle auxiliary transmission record
CN115629900A (en) View processing method and device in alliance chain and electronic equipment
CN115270161A (en) Encryption method and device based on encryption plug-in and related product
CN115629896A (en) Method and device for dealing with common identification timeout in alliance chain
CN112131602B (en) Method, device and related product for quickly expanding trust relationship between nodes based on trusted computing
US20170169239A1 (en) Method for file synchronization, the receiver equipment and systems
CN115269056A (en) Encryption module plug-in method and device based on class loader and related product
CN114554251A (en) Multimedia data request method and device, storage medium and electronic device
CN113783946A (en) Re-voting binary consensus method and device based on threshold signature

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