Block output method and device of alliance chain system and alliance chain system
By monitoring the block generation time and consensus voting of consensus nodes in the alliance chain system, the downtime nodes are determined and the remaining nodes are controlled to take turns to block out, solving the problem of too long block generation time caused by consensus node downtime and improving system performance.
Patent Information
- Application Number
- CN202411413066.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2025-02-07
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
In the consortium chain system, when the consensus node goes down, the block time is too long, resulting in a degradation of system performance.
By monitoring the block time and consensus voting status of the consensus node, determine whether there is a downtime node. If there is a downtime node, control the remaining consensus nodes to take turns to exit blocks, prohibit the block output permission of the downtime node but allow them to conduct consensus voting.
It avoids too long block generation time due to consensus node downtime, and improves the block generation performance of the consortium chain system.
Smart Images

Figure CN119396611A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to blockchain technology, and in particular to a block generation method, device and alliance chain system of an alliance chain system. Background Art
[0002] The consortium chain system specifies multiple pre-selected nodes as account keepers for members of a specific group and limited third parties. The generation of each block is jointly determined by all pre-selected nodes. In the consortium chain system, for load balancing and Byzantine fault tolerance, multiple consensus nodes are usually used in turn as the leader node to be responsible for block generation. When a consensus node goes down, two adjacent blocks in each cycle at the time when the down node generates a block are judged as failed in the case of timeout, which greatly damages the system performance. Summary of the invention
[0003] The embodiments of the present disclosure provide a block generation method, device and alliance chain system for an alliance chain system to solve the above-mentioned problems.
[0004] According to a first aspect of an embodiment of the present disclosure, a block generation method of a consortium chain system is provided, comprising:
[0005] Monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node, wherein each consensus node in the consensus node group generates blocks in turn;
[0006] Based on the block time and consensus vote of each consensus node, determine whether there is a downtime consensus node among the consensus nodes;
[0007] In response to determining that there is a downed consensus node and the downed consensus node includes a target consensus node, controlling the remaining consensus nodes in the consensus node group except the target consensus node to take turns to generate blocks; wherein the consensus nodes include the target consensus node.
[0008] In one embodiment of the present disclosure, determining whether there is a consensus node downtime among the consensus nodes based on the block generation time and consensus vote of each consensus node includes:
[0009] In response to monitoring that the target consensus node's block generation time is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times, it is determined that there is a downed consensus node and the downed consensus node includes the target consensus node.
[0010] In one embodiment of the present disclosure, in response to determining that the target consensus node among the consensus nodes is down, the process of controlling the remaining consensus nodes in the consensus node group except the target consensus node to take turns to generate blocks also includes:
[0011] The target consensus node is prohibited from having the authority to produce blocks and is allowed to conduct consensus voting.
[0012] In one embodiment of the present disclosure, the process of prohibiting the target consensus node from having the authority to produce blocks and allowing the target consensus node to perform consensus voting also includes:
[0013] In response to receiving the consensus vote of the target consensus node, the block generation authority of the target consensus node is restored so that the consensus nodes generate blocks in turn.
[0014] In one embodiment of the present disclosure, the step of restoring the block generation authority of the target consensus node so that each consensus node generates blocks in turn includes:
[0015] Obtaining the block generation order of each consensus node before the remaining consensus nodes take turns to generate blocks;
[0016] After the remaining consensus nodes complete a round of block generation, the block generation authority of the target consensus node is restored so that the consensus nodes generate blocks in turn according to the block generation order.
[0017] A second aspect of the embodiments of the present disclosure provides a block generation device of a consortium chain system, including:
[0018] A monitoring module, used to monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node, wherein each consensus node in the consensus node group generates blocks in turn;
[0019] A node downtime determination module, used to determine whether there is a downtime consensus node among the consensus nodes based on the block generation time and consensus vote of each consensus node;
[0020] A block generation control module is used to control the remaining consensus nodes in the consensus node group except the target consensus node to generate blocks in turn in response to determining that there is a downed consensus node and the downed consensus node includes a target consensus node; wherein the consensus nodes include the target consensus node.
[0021] In one embodiment of the present disclosure, the node downtime determination module is used to determine that there is a downed consensus node and that the downed consensus node includes the target consensus node in response to monitoring that the target consensus node's block production time is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times.
[0022] In one embodiment of the present disclosure, the block generation control module is used to prohibit the block generation authority of the target consensus node and allow the target consensus node to perform consensus voting after determining that the target consensus node is down.
[0023] In one embodiment of the present disclosure, the block generation control module is further used to restore the block generation authority of the target consensus node in response to receiving the consensus vote of the target consensus node, so that the consensus nodes can generate blocks in turn.
[0024] In one embodiment of the present disclosure, the block generation control module is used to obtain the block generation order of each consensus node before the remaining consensus nodes take turns to generate blocks; the block generation control module is also used to restore the block generation authority of the target consensus node after the remaining consensus nodes complete a round of block generation, so that each consensus node takes turns to generate blocks according to the block generation order.
[0025] A third aspect of the embodiments of the present disclosure provides a consortium chain system, including:
[0026] The consensus node group is used for the device described in the second aspect to produce blocks.
[0027] According to a fourth aspect of the embodiments of the present disclosure, an electronic device is provided, including:
[0028] A memory for storing a computer program product;
[0029] The processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, the method described in the first aspect above is implemented.
[0030] According to a fifth aspect of the embodiments of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the method described in the first aspect is implemented.
[0031] The block generation method, device and alliance chain system of the alliance chain system of the disclosed embodiments, since the block generation time and voting behavior of the consensus nodes in the consensus node group of the alliance chain system can reflect whether the consensus node is down, therefore when it is determined that there is a downed consensus node according to the block generation time and consensus vote of each consensus node in the consensus node group, the remaining consensus nodes in the consensus node group except the downed consensus node are controlled to generate blocks in turn, which can avoid the block generation time of the consensus node group being too long due to the downtime of the consensus node, thereby greatly improving the block generation performance of the alliance chain system.
[0032] The technical solution of the present disclosure is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The accompanying drawings, which constitute a part of the specification, illustrate embodiments of the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0034] The present disclosure may be more clearly understood from the following detailed description with reference to the accompanying drawings, in which:
[0035] Figure 1 This is a flowchart of a block generation method of a consortium chain system according to an embodiment of the present disclosure;
[0036] Figure 2 This is a block generation schematic diagram before and after the consensus node crashes in an example disclosed in this disclosure;
[0037] Figure 3 This is a structural block diagram of a block generation device of a consortium chain system in one embodiment of the present disclosure;
[0038] Figure 4 The structure block diagram of an electronic device in one embodiment of the present disclosure is shown in FIG. DETAILED DESCRIPTION
[0039] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that the relative arrangement of components and steps, numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless otherwise specifically stated.
[0040] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0041] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0042] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0043] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0044] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0045] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0046] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0047] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0048] The embodiments of the present disclosure can be applied to electronic devices such as terminal devices, computer systems, servers, etc., which can operate with many other general or special computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, servers, etc. include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, small computer systems, large computer systems, and distributed cloud computing technology environments including any of the above systems, etc.
[0049] Electronic devices such as terminal devices, computer systems, servers, etc. can be described in the general context of computer system executable instructions (such as program modules) executed by computer systems. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked through a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media including storage devices.
[0050] Figure 1 The following is a flowchart of a block generation method of a consortium chain system according to an embodiment of the present disclosure. Figure 1 As shown, the block generation method of the alliance chain system includes the following steps:
[0051] S1: Monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node. Among them, each consensus node in the consensus node group generates blocks in turn.
[0052] A consensus node group is set in the alliance chain system. The consensus node group includes multiple consensus nodes. Usually, the number of consensus nodes in the consensus node group is greater than or equal to 5. If the number of consensus nodes is too small (for example, less than 5) and a consensus node is down, it is difficult for the remaining consensus nodes to ensure the fairness of the consensus vote. Among them, the consensus method used by the consensus node group can be one of the Byzantine Fault Tolerance (PBFT) consensus method, the HotStuff consensus method (a distributed consensus method based on Byzantine Fault Tolerance) / Dumbo BFT consensus method (i.e., the Dumbo Byzantine Fault Tolerance consensus method).
[0053] In order to balance the load and achieve Byzantine fault tolerance, each consensus node in the consensus node group takes turns as the leader node to generate blocks, that is, each consensus node takes turns as the leader node to generate new blocks, and all consensus nodes in the consensus node group conduct consensus voting, for example, voting whether to accept new blocks based on the weight of each consensus node. Among them, if there are enough votes (greater than 2 / 3 of the number of consensus nodes) in each consensus vote, the vote is considered passed. For example, when the number of consensus nodes in the consensus node group is 6, if 4 votes (such as 5 votes or 6 votes) are received in each consensus vote, it means that the vote is passed.
[0054] In the process of each consensus node in the consensus node group taking turns to produce blocks, the alliance chain system monitors the block production time of each consensus node in the consensus node group as a leader node, and monitors the consensus voting situation of each consecutive consensus node. Among them, the consensus voting situation includes whether the interface receives the consensus vote of each consensus node, and the voting results of each simultaneous node representing the acceptance or rejection of the block.
[0055] S2: Based on the block time and consensus vote of each consensus node, determine whether there is a downtime consensus node among the consensus nodes.
[0056] Since the block generation time of each consensus node under normal working conditions (non-downtime state) is usually less than a preset time threshold, and each consensus node will perform consensus voting on new blocks under normal working conditions, the alliance chain system can determine whether there is a consensus node downtime among the consensus nodes based on the block generation time and consensus voting situation of each consensus node.
[0057] S3: In response to determining that there is a downtime consensus node in the consensus node group, and the downtime consensus node includes the target consensus node, the remaining consensus nodes in the consensus node group except the target consensus node are controlled to generate blocks in turn, wherein each consensus node includes the target consensus node.
[0058] If the alliance chain system determines that there are downed consensus nodes in the consensus node group based on the block generation time and consensus voting status of each consensus node, and the downed consensus nodes include the target consensus node, then the remaining consensus nodes in the consensus node group except the target consensus node can be controlled to generate blocks in turn, so as to avoid the target consensus node downtime causing the block generation time to be too long, thereby affecting the block generation performance of the alliance chain system.
[0059] Figure 2 This is a block diagram of an example of the consensus node before and after the crash. Figure 2 As shown, the consensus node group of the alliance chain system includes 5 consensus nodes, namely node n1, node n2, node n3, node n4 and node n5.
[0060] When all consensus nodes in the consensus node group are working normally, each consensus node takes turns to produce blocks, that is, in each block production round, blocks are produced in the order of node n1->node n2->node n3->node n4->node n5.
[0061] When node n1 of the consensus node group is down, the block generation time of nodes n5 and n1 is too long or even unable to generate consensus. For example, the consensus method of the alliance chain requires that the current leader node generates a block and then sends it to the next consensus node for consensus voting. When node n1 is down, it cannot receive the block sent by node n5 and cannot send a new block to node n2, resulting in a lot of time spent on block generation by nodes n5 and n1, which leads to a sharp deterioration in the block generation performance of the alliance chain system.
[0062] When node n1 is detected to be down, the remaining nodes except node n1 (i.e. node n2, node n3, node n4 and node n5) are controlled to produce blocks in turn in the order of node n2->node n3->node n4->node n5, thereby ensuring the block production performance of the alliance chain system.
[0063] In this embodiment, since the block generation time and voting behavior of the consensus nodes in the consensus node group of the alliance chain system can reflect whether the consensus node is down, when it is determined that there is a downed consensus node based on the block generation time and consensus vote of each consensus node in the consensus node group, the remaining consensus nodes in the consensus node group except the downed consensus node are controlled to generate blocks in turn, which can avoid the block generation time of the consensus node group being too long due to the downtime of the consensus node, thereby greatly improving the block generation performance of the alliance chain system.
[0064] In one embodiment of the present disclosure, step S2 may include: in response to monitoring that the target consensus node's block generation time is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times, determining that the target consensus node is down.
[0065] When a consensus node is down, its block time is usually much longer than the original block time, or even it may not be able to produce a block. When the consensus node network is unstable, it is usually not possible for the block time to be much longer than the original block time for multiple consecutive times. When a consensus node is down, consensus voting is usually not possible, resulting in the alliance chain system being unable to receive consensus votes from the downed consensus node. Therefore, a time threshold can be set to measure whether a consensus node is down.
[0066] When the alliance chain system detects that there is a consensus node (defined as the target consensus node) in the consensus node group whose block generation time is greater than the preset time threshold for multiple consecutive times and has not received multiple consecutive consensus votes from the target consensus node, it can accurately determine that the target consensus node is down.
[0067] In this embodiment, when it is monitored that the target consensus node's block generation time is greater than the preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times, it can be accurately determined that the target consensus node is down, so that after determining that the target node is down, consensus nodes other than the target consensus node will take turns to generate blocks, thereby ensuring the block generation performance of the alliance chain system.
[0068] In one embodiment of the present disclosure, during the execution of step S3, the following steps may also be performed: prohibiting the target consensus node's block generation authority and allowing the target consensus node to perform consensus voting.
[0069] After the consortium chain system determines that the target consensus node is down, it prohibits the block generation permission of the target consensus node to avoid reducing the block generation performance of the consortium chain system due to the target consensus node's long block generation time. By allowing the target consensus node to conduct consensus voting, the consortium chain system can quickly know that the network status of the target consensus node has returned to normal when it receives the consensus vote of the target consensus node. After that, the consortium chain system can restore the block generation permission of the target consensus node whose network status has returned to normal.
[0070] In an embodiment, after determining that the target consensus node is down, on the one hand, the block generation performance of the alliance chain system can be prevented from being reduced due to the target consensus node's long block generation time by prohibiting the target consensus node's block generation permission. On the other hand, the target consensus node can be allowed to perform consensus voting, so that when the alliance chain system receives the consensus vote of the target consensus node, it can quickly know that the network status of the target consensus node has returned to normal, which helps to quickly enable the target consensus node that has restored the normal network status to generate blocks.
[0071] In one embodiment of the present disclosure, in the process of prohibiting the target consensus node's block generation authority and allowing the target consensus node to perform consensus voting, the following steps may also be performed: in response to receiving the consensus vote of the target consensus node, restoring the target consensus node's block generation authority so that each consensus node takes turns to generate blocks.
[0072] After the consortium chain system prohibits the target consensus node's block-generating authority and allows the target consensus node to conduct consensus voting, if it receives the consensus vote of the target consensus node, it can be known that the network of the target consensus node has returned to normal. After that, the target consensus node's block-generating authority can be restored so that the target consensus node and other consensus nodes can take turns to generate blocks.
[0073] In this embodiment, after the target consensus node's block-generating authority is prohibited and the target consensus node is allowed to perform consensus voting, if the consensus vote of the target consensus node is received, it indicates that the network status of the target consensus node has returned to normal. By restoring the target consensus node's block-generating authority, the target consensus node and other consensus nodes can take turns to generate blocks. Since the number of consensus nodes that can generate blocks is increased, the block-generating pressure of a single consensus node can be reduced.
[0074] In one embodiment of the present disclosure, the step of restoring the block generation authority of the target consensus node so that each consensus node generates blocks in turn may specifically include: obtaining the block generation order of each consensus node before the remaining consensus nodes generate blocks in turn; after the remaining consensus nodes complete a round of block generation, restoring the block generation authority of the target consensus node so that each consensus node generates blocks in turn according to the block generation order.
[0075] Please refer to Figure 2 , if the target consensus node is node n1, and the block generation order before node n1 crashes is n1->node n2->node n3->node n4->node n5, then after the network of node n1 is restored to normal, after completing a round of block generation of node n2->node n3->node n4->node n5, the block generation authority of node n1 is restored. After that, blocks are generated in turn in the order of n1->node n2->node n3->node n4->node n5.
[0076] In this embodiment, after the consensus node network that was originally down returns to normal, the block generation authority of the consensus node that was originally down is restored after the consensus node that can currently generate blocks completes a round of block generation, so that the consensus nodes that can generate blocks can generate blocks in turn according to the original block generation order. On the one hand, since the number of consensus nodes that can generate blocks is increased, the block generation pressure of a single consensus node can be reduced. On the other hand, since there is no need to modify the original block generation order of the consensus node group, the data processing volume caused by modifying the block generation order can be reduced.
[0077] Figure 3 FIG. 1 is a structural block diagram of a block generation device of a consortium chain system in one embodiment of the present disclosure. Figure 3 As shown, the block generation device of the alliance chain system includes:
[0078] The monitoring module 100 is used to monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node, wherein each consensus node in the consensus node group generates blocks in turn;
[0079] A node downtime determination module 200 is used to determine whether there is a downtime consensus node among the consensus nodes based on the block generation time and consensus vote of each consensus node;
[0080] The block generation control module 300 is used to control the remaining consensus nodes in the consensus node group except the target consensus node to generate blocks in turn in response to determining that there is a downed consensus node and the downed consensus node includes the target consensus node; wherein each consensus node includes the target consensus node.
[0081] In one embodiment of the present disclosure, the node downtime determination module 200 is used to determine that there is a downtime consensus node and the downtime consensus node includes the target consensus node in response to monitoring that the target consensus node's block generation time is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times.
[0082] In one embodiment of the present disclosure, the block generation control module 300 is used to prohibit the block generation permission of the target consensus node and allow the target consensus node to perform consensus voting after determining that the target consensus node is down.
[0083] In one embodiment of the present disclosure, the block generation control module 300 is further configured to restore the block generation authority of the target consensus node in response to receiving a consensus vote from the target consensus node, so that each consensus node generates blocks in turn.
[0084] In one embodiment of the present disclosure, the block generation control module 300 is used to obtain the block generation order of each consensus node before the remaining consensus nodes take turns to generate blocks; the block generation control module 300 is also used to restore the block generation authority of the target consensus node after the remaining consensus nodes complete a round of block generation, so that each consensus node takes turns to generate blocks according to the block generation order.
[0085] It should be noted that the specific implementation of the block production device of the alliance chain system of the embodiment of the present disclosure is similar to the specific implementation of the block production method of the alliance chain system of the embodiment of the present disclosure. Please refer to the description of the block production method of the alliance chain system for details. In order to reduce redundancy, it will not be repeated here.
[0086] The disclosed embodiment also provides a consortium chain system, including a consensus node group, which is used to generate blocks through the block generation device of the consortium chain system described in any of the above embodiments.
[0087] In addition, an embodiment of the present disclosure further provides an electronic device, including:
[0088] Memory for storing computer programs;
[0089] The processor is used to execute the computer program stored in the memory, and when the computer program is executed, the block generation method of the alliance chain system described in any of the above embodiments of the present disclosure is implemented.
[0090] Below, reference Figure 4 To describe the electronic device according to the embodiment of the present disclosure. Figure 4 As shown, the electronic device includes one or more processors and memory.
[0091] The processor may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0092] The memory may store one or more computer program products, and the memory may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program products may be stored on the computer-readable storage medium, and the processor may run the computer program product to implement the block generation method and / or other desired functions of the alliance chain system of each embodiment of the present disclosure described above.
[0093] In one example, the electronic device may further include: an input device and an output device, and these components are interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0094] In addition, the input device may also include, for example, a keyboard, a mouse, and the like.
[0095] The output device can output various information to the outside, including determined distance information, direction information, etc. The output device can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto, and the like.
[0096] Of course, to simplify, Figure 4 Only some of the components related to the present disclosure in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, according to specific application situations, the electronic device may further include any other appropriate components.
[0097] In addition to the above-mentioned methods and devices, an embodiment of the present disclosure may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the block generation method of the alliance chain system according to various embodiments of the present disclosure described in the above part of this specification.
[0098] The computer program product may be written in any combination of one or more programming languages to write program code for performing the operations of the disclosed embodiments, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0099] In addition, an embodiment of the present disclosure may also be a computer-readable storage medium on which computer program instructions are stored. When the computer program instructions are executed by a processor, the processor executes the steps of the block generation method of the alliance chain system according to various embodiments of the present disclosure described in the above part of this specification.
[0100] The computer readable storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0101] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0102] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0103] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0104] The method and apparatus of the present disclosure may be implemented in many ways. For example, the method and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above order of steps for the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above, unless otherwise specifically stated. In addition, in some embodiments, the present disclosure may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present disclosure. Therefore, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
[0105] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0106] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0107] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A block generation method of a consortium chain system, characterized in that: include: Monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node, wherein each consensus node in the consensus node group generates blocks in turn; Based on the block time and consensus vote of each consensus node, determine whether there is a downtime consensus node among the consensus nodes; In response to determining that there is a downed consensus node and the downed consensus node includes a target consensus node, controlling the remaining consensus nodes in the consensus node group except the target consensus node to take turns to generate blocks; wherein the consensus nodes include the target consensus node.
2. The method according to claim 1, characterized in that The determining whether there is a downtime consensus node among the consensus nodes based on the block generation time and consensus vote of each consensus node includes: In response to monitoring that the target consensus node's block generation time is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times, it is determined that there is a downed consensus node and the downed consensus node includes the target consensus node.
3. The method according to claim 1 or 2, characterized in that: In the process of controlling the remaining consensus nodes in the consensus node group except the target consensus node to take turns to generate blocks in response to determining that the target consensus node among the consensus nodes is down, the process also includes: The target consensus node is prohibited from having the authority to produce blocks and is allowed to conduct consensus voting.
4. The method according to claim 3, characterized in that The process of prohibiting the target consensus node from having the authority to produce blocks and allowing the target consensus node to perform consensus voting also includes: In response to receiving the consensus vote of the target consensus node, the block generation authority of the target consensus node is restored so that the consensus nodes generate blocks in turn.
5. The method according to claim 4, characterized in that The restoring the block generation authority of the target consensus node so that each consensus node generates blocks in turn includes: Obtaining the block generation order of each consensus node before the remaining consensus nodes take turns to generate blocks; After the remaining consensus nodes complete a round of block generation, the block generation authority of the target consensus node is restored so that the consensus nodes generate blocks in turn according to the block generation order.
6. A block generation device of a consortium chain system, characterized in that: include: A monitoring module, used to monitor the block generation time of each consensus node in the consensus node group of the alliance chain system, and monitor the consensus vote of each consensus node, wherein each consensus node in the consensus node group generates blocks in turn; A node downtime determination module, used to determine whether there is a downtime consensus node among the consensus nodes based on the block generation time and consensus vote of each consensus node; A block generation control module is used to control the remaining consensus nodes in the consensus node group except the target consensus node to generate blocks in turn in response to determining that there is a downed consensus node and the downed consensus node includes a target consensus node; wherein the consensus nodes include the target consensus node.
7. The device according to claim 6, characterized in that The node downtime determination module is used to determine that there is a downtime consensus node and the downtime consensus node includes the target consensus node in response to monitoring that the block generation time of the target consensus node is greater than a preset time threshold for multiple consecutive times and no consensus votes from the target consensus node are received for multiple consecutive times.
8. The device according to claim 6 or 7, characterized in that The block control module is used to prohibit the block authority of the target consensus node and allow the target consensus node to perform consensus voting after determining that the target consensus node is down.
9. The device according to claim 8, characterized in that The block generation control module is also used to restore the block generation authority of the target consensus node in response to receiving the consensus vote of the target consensus node, so that the consensus nodes can generate blocks in turn.
10. The device according to claim 9, characterized in that The block generation control module is used to obtain the block generation order of each consensus node before the remaining consensus nodes take turns to generate blocks; the block generation control module is also used to restore the block generation authority of the target consensus node after the remaining consensus nodes complete a round of block generation, so that each consensus node takes turns to generate blocks according to the block generation order.
11. A consortium chain system, characterized in that: include: A consensus node group, used to generate blocks through the device described in any one of claims 6-10.
12. An electronic device, characterized in that: include: a memory for storing a computer program product; A processor is used to execute the computer program product stored in the memory, and when the computer program product is executed, it implements the method described in any one of claims 1 to 5.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method described in any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Alliance chain performance maintaining method and system and storage medium
CN111107103A
Blockchain consensus node state monitoring method and device
CN111786818A
Consensus method and device of block chain, computer readable medium and electronic equipment
CN117411893A