Method and device for determining block chain network consensus node
By acquiring blockchain network state information and dynamically adjusting node strategies and task scheduling, the performance limitations of blockchain consensus mechanisms in dynamic network environments are resolved, achieving an efficient and flexible consensus process.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA STAR NETWORK SYST RES INST CO LTD
- Filing Date
- 2024-11-20
- Publication Date
- 2026-05-22
AI Technical Summary
Blockchain consensus mechanisms are inadequate in dynamic network environments, resulting in insufficient consensus performance and adaptability.
By acquiring network state information of the blockchain network, dynamically adjusting node strategy information, determining consensus nodes that are suitable for the current network state, and using reinforcement learning to optimize node roles and task scheduling.
It improves consensus efficiency, balances network load, ensures efficient operation of the consensus process in dynamic environments, and enhances consensus performance and adaptability.
Smart Images

Figure CN122073580A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the fields of blockchain technology and blockchain networks, and in particular to a method, apparatus, electronic device, storage medium, and computer program product for determining consensus nodes in a blockchain network. Background Technology
[0002] Blockchain is a decentralized distributed ledger that is block-based, immutable, secure, and reliable. It combines distributed storage, peer-to-peer transmission, consensus mechanisms, and cryptography to record transactions and information through a continuously growing chain of data blocks, ensuring data security and transparency. Among related technologies, blockchain consensus mechanisms typically employ static algorithms, which, while effective in terms of security and consistency, perform poorly in dynamic network environments. Therefore, there is currently a lack of effective means to improve the consensus performance and adaptability of blockchain networks. Summary of the Invention
[0003] This disclosure provides a method, apparatus, electronic device, storage medium, and computer program product for determining consensus nodes in a blockchain network, which can solve the problem that the blockchain consensus mechanism, which uses a static algorithm, is inadequate in dynamic network environments.
[0004] According to a first aspect of the present disclosure, a method for determining consensus nodes in a blockchain network is provided, the method comprising:
[0005] Obtain the first network state information of the blockchain network in real time;
[0006] Based on the first network state information of the blockchain network in the first moment, determine the node policy information corresponding to the first network state information;
[0007] Based on the node policy information, the first node is determined; the first node is used to execute the consensus task.
[0008] According to a second aspect of the present disclosure, an apparatus for determining consensus nodes in a blockchain network is provided, the apparatus comprising:
[0009] The monitoring module is used to obtain the first network status information of the blockchain network in real time;
[0010] The adjustment module is used to determine the node strategy information corresponding to the first network state information based on the first network state information of the blockchain network in the first time.
[0011] The task scheduling module is used to determine the first node based on node policy information; the first node is used to execute consensus tasks.
[0012] According to a third aspect of the present disclosure, an electronic device is provided, comprising:
[0013] At least one processor; and
[0014] A memory that is communicatively connected to at least one processor; wherein,
[0015] The memory stores instructions that can be executed by at least one processor, which enables the at least one processor to perform the method for determining consensus nodes of the blockchain network described in the first aspect above.
[0016] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, having stored thereon computer instructions for causing a computer to execute the method for determining consensus nodes in a blockchain network as described in the first aspect.
[0017] According to a fifth aspect of the present disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0018] According to the technical solution disclosed herein, the node strategy information can be dynamically adjusted to better suit the first network state information through the first network state information of the blockchain network in real time. Based on the node strategy information, the first node to participate in the consensus task is determined, so that nodes that are better suited to the first network state information can participate in the consensus. In this way, while ensuring the security of the consensus, the consensus efficiency can also be improved, the network load can be balanced, and the consensus process can be ensured to operate efficiently in a dynamic environment. It can better adapt to complex and ever-changing network environments, thereby solving the problem that the blockchain consensus mechanism in related technologies uses static algorithms and therefore performs poorly in dynamic network environments. It can significantly improve the consensus performance and adaptability of the blockchain network.
[0019] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0020] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0021] Figure 1 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0022] Figure 2 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0023] Figure 3 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0024] Figure 4 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0025] Figure 5 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0026] Figure 6 This is a flowchart illustrating a device for determining consensus nodes in a blockchain network according to an exemplary embodiment.
[0027] Figure 7 This is an example diagram illustrating a blockchain network system architecture according to an exemplary embodiment.
[0028] Figure 8 This is a block diagram of an electronic device according to an embodiment of the present disclosure. Detailed Implementation
[0029] The embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure. In the description of this disclosure, unless otherwise stated, " / " means "or," for example, A / B can mean A or B; "and / or" in this document is merely a description of the relationship between related objects, indicating that three relationships can exist, for example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone.
[0030] The terminology used in this disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the present disclosure. The singular forms “a” and “the” as used in this disclosure and the appended claims are also intended to include the plural forms, unless the context clearly indicates otherwise.
[0031] It should be understood that although the terms first, second, third, etc., may be used to describe various information in embodiments of this disclosure, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of embodiments of this disclosure, and similarly, second information may also be referred to as first information. Depending on the context, the words “if” and “suppose” as used herein may be interpreted as “when”, “when”, or “in response to a determination”.
[0032] Embodiments of this disclosure are described in detail below, with examples of embodiments illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.
[0033] It should be noted that the acquisition, transmission, storage, use, and processing of data in this disclosed technical solution comply with the relevant provisions of national laws and regulations and do not violate public order and good morals.
[0034] It is worth noting that in the embodiments disclosed herein, certain software, components, models, and other existing solutions in the industry may be mentioned. These should be considered as exemplary, and their purpose is only to illustrate the feasibility of implementing the technical solutions disclosed herein. However, this does not mean that the applicant has used or necessarily used such solutions.
[0035] It should be noted that, in some embodiments, the blockchain network in this disclosure can be a low-orbit blockchain network. For example, consensus nodes in a low-orbit blockchain network can implement consensus authentication. For instance, they can perform consensus verification on access authentication requests from land-based users, using information exchange to enable all consensus nodes in the low-orbit blockchain network to reach a consensus on the legitimacy of the user's identity.
[0036] In some embodiments, the terms “at least one,” “one or more,” “multiple,” etc., can be used interchangeably.
[0037] It should be noted that the execution subject of the blockchain network consensus node determination method in this embodiment can be a blockchain network consensus node determination device. The determination device can be implemented by software and / or hardware. The determination device can be configured in an electronic device, which may include, but is not limited to, a terminal, a server, etc.
[0038] Figure 1 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment. In some embodiments, a consensus node can be understood as a node participating in consensus tasks. For example, the tasks a node participates in include at least consensus tasks; that is, the node can also participate in other tasks, such as accounting tasks, or the node can participate only in consensus tasks, but is not limited to these. Figure 1 As shown, the determination method may include, but is not limited to, the following steps.
[0039] In step 101, the first network state information of the blockchain network at the first moment is obtained.
[0040] In some embodiments, the network state information of the blockchain network can be monitored to obtain the first network state information of the blockchain network at a specific time. For example, the first time can be the current moment. For instance, the first network state information of the blockchain network at the current moment can be obtained, which facilitates the subsequent dynamic optimization of the consensus process based on the first network state information at the current moment combined with historical network state information.
[0041] In some embodiments, the first network state information of the blockchain network at the first moment may include, but is not limited to, the node state information of all nodes in the blockchain network at the first moment. In some embodiments, the node state information may include, but is not limited to, one or more of the following: CPU (Central Processing Unit) efficiency (or CPU utilization) information, memory efficiency (or memory utilization) information, storage efficiency (or storage space usage) information, and network efficiency (or network latency) information.
[0042] In step 102, based on the first network state information of the blockchain network at the first moment, the node policy information corresponding to the first network state information is determined.
[0043] In some embodiments, the node policy information may include, but is not limited to, at least one of node role adjustment information and consensus task load redistribution information. For example, the node policy information may include node role adjustment information. For example, the node policy information may include consensus task load redistribution information. For example, the node policy information may include, but is not limited to, node role adjustment information and consensus task load redistribution information.
[0044] In one possible implementation, within a blockchain network, different network state information can correspond to different node policy information. Upon obtaining the initial network state information of the blockchain network, the corresponding node policy information can be determined based on this initial network state information. For example, in the initial state of the blockchain network, the node policy information corresponding to the initial network state information can be obtained. This initial network state information might include: which nodes can be used solely for performing accounting tasks, and which nodes can be used for both consensus and accounting tasks. For instance, assuming the blockchain network includes 10 nodes, in the initial state of the blockchain network, 5 of these 10 nodes can be used for both consensus and accounting tasks, while the remaining 5 nodes can be used solely for accounting tasks.
[0045] It should be noted that, in some embodiments, node policy information more suitable for the current network state can be dynamically adjusted. Based on this node policy information for the current network state, the first node to participate in the consensus task is determined, thus obtaining nodes more suited to the current network state information to participate in consensus. For example, in the operational state of the blockchain network, upon obtaining the first network state information of the blockchain network at the first moment, node policy information corresponding to the first network state information can be determined based on this first network state information combined with the historical network state information of the blockchain network. This facilitates the identification of nodes more suited to the first network state information to participate in consensus.
[0046] In step 103, a first node is determined based on node policy information; this first node can be used to perform consensus tasks. In some embodiments, the consensus task may include at least one of performing a consensus process, generating blocks, and recording data.
[0047] For example, in the initial state of a blockchain network, node policy information corresponding to the initial state of the blockchain network can be obtained, and the first node to perform the consensus task can be determined based on this node policy information. For instance, the node policy information corresponding to the initial state of the network can include: which nodes can be used solely for performing accounting tasks, and which nodes can be used for both consensus and accounting tasks. For example, assuming the blockchain network includes 10 nodes, in the initial state of the blockchain network, the corresponding node policy information can include: nodes 1 to 5 of the 10 nodes are used for both consensus and accounting tasks, and nodes 6 to 10 of the 10 nodes are used solely for accounting tasks. Based on this node policy information, nodes 1 to 5 can be determined as the nodes that can be used to perform the consensus task.
[0048] For example, in the operational state of a blockchain network, upon obtaining the first network state information at the earliest moment, node policy information corresponding to the first network state information can be determined based on this first network state information and the historical network state information of the blockchain network. Based on this node policy information, the first node to perform the consensus task can be determined. For instance, continuing with the example of a blockchain network containing 10 nodes, in the initial state of the blockchain network, nodes 1 to 5 are used for both consensus and accounting tasks, while nodes 6 to 10 are used only for accounting tasks. In the operational state of the blockchain network, the roles of the nodes can be dynamically adjusted based on the first network state information at the earliest moment and the historical network state information of the blockchain network, thereby determining the node most suited to the first network state information to participate in the consensus.
[0049] In the above embodiments, the node strategy information that is more adapted to the first network state information can be dynamically adjusted through the first network state information of the blockchain network in real time. Based on the node strategy information, the first node to participate in the consensus task is determined, so that nodes that are more adapted to the first network state information can participate in the consensus. In this way, while ensuring the security of the consensus, the consensus efficiency can also be improved, the network load can be balanced, and the consensus process can be ensured to operate efficiently in a dynamic environment. It can better adapt to complex and ever-changing network environments, thereby solving the problem that the blockchain consensus mechanism uses static algorithms in related technologies, resulting in insufficient performance in dynamic network environments. It can significantly improve the consensus performance and adaptability of the blockchain network.
[0050] Figure 2 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment. Figure 2 As shown, the determination method may include, but is not limited to, the following steps.
[0051] In step 201, the first network state information of the blockchain network at the first moment is obtained.
[0052] In the embodiments of this disclosure, step 201 can be implemented in any of the ways described in the various embodiments of this disclosure. This disclosure does not limit this and will not elaborate further.
[0053] In step 202, based on the first network state information of the blockchain network at the first time and the second network state information of the blockchain network at the second time, the node strategy information corresponding to the first network state information is determined.
[0054] In some embodiments, the second time mentioned above can be a historical time of the first time. For example, if the first time is the current time t, then the second time can be the time t-1 before the current time t. In some embodiments, the second network state information of the blockchain network at the second time may include, but is not limited to, the node state information of all nodes in the blockchain network at the second time. In some embodiments, the node state information may include, but is not limited to, one or more of the following: CPU efficiency (or CPU utilization) information, memory efficiency (or memory utilization) information, storage efficiency (or storage space usage) information, and network efficiency (or network latency) information.
[0055] In some embodiments, upon obtaining the first network state information of the blockchain network at a first time, multiple candidate node policy information associated with the first network state information can be evaluated based on the first network state information at the first time and the second network state information of the blockchain network at a second time to obtain node policy information corresponding to the first network state information. In one possible implementation, upon obtaining the first network state information of the blockchain network at a first time, multiple candidate node policy information associated with the first network state information can be evaluated using reinforcement learning methods based on the first network state information at the first time and the second network state information of the blockchain network at the second time. The candidate node policy information with the largest evaluation function value is selected from these multiple candidate node policy information as the node policy information corresponding to the first network state information. In some embodiments, the evaluation function can be used to evaluate the effect of the system adopting the candidate node policy information, guiding the system to adjust towards efficiency and adaptability. In some embodiments, the evaluation function can represent the evaluation value obtained by executing the candidate node policy information under the first network state information. For example, this value (i.e., the evaluation function value) can represent the expected future reward that can be obtained by adopting the candidate node policy information under the first network state information.
[0056] In some embodiments, the multiple candidate node policy information associated with the first network state information can be pre-set. For example, multiple candidate node policy information corresponding to different network states can be pre-set. In this way, when consensus node updates are required, multiple candidate node policy information associated with the first network state information can be obtained from the pre-set candidate node policy information.
[0057] In some embodiments, the multiple candidate node policy information associated with the first network state information may be candidate node policy information extended by the system management layer based on the network state of the blockchain network. For example, the multiple candidate node policy information associated with the first network state information may be candidate node policy information extended by the system management layer based on the first network state information.
[0058] In some embodiments, the aforementioned candidate node strategy information may include, but is not limited to, at least one of node role adjustment information and consensus task load redistribution information. For example, node roles in a blockchain network may include roles that coexist in accounting and consensus (i.e., can be used to perform both accounting and consensus tasks), accounting-only roles (i.e., only used to perform accounting tasks), and consensus-only roles (i.e., only used to perform consensus tasks). Node role adjustment information may include a change in a node's role from accounting-only to consensus-only, or from a coexistence of accounting and consensus roles to accounting-only, or from accounting-only to a coexistence of accounting and consensus roles to consensus-only, etc. For example, consensus task load redistribution information may refer to the consensus task load information that a node participating in a consensus task can bear; for instance, this consensus task load redistribution information may include the node's consensus task load information.
[0059] In step 203, a first node is determined based on the node policy information; the first node can be used to perform consensus tasks.
[0060] In some embodiments, when node policy information corresponding to the first network state information is obtained, the first node for performing consensus tasks can be determined based on the node policy information. For example, based on the node policy information, nodes with unstable performance in the consensus process can be removed from the consensus role, and nodes with stable and high performance in the blockchain network can participate in the consensus process.
[0061] In some embodiments, node policy information may include node role adjustment information. Based on the node policy information, a first node for performing consensus tasks can be determined from the blockchain network. This node may include a node whose role changes from a purely accounting role to a purely consensus role, and / or a node whose role changes from a coexisting accounting and consensus role to a purely consensus role. For example, the node role adjustment information may include changing the role of node A (accounting-only) to a coexisting accounting and consensus role, meaning node A participates in the subsequent consensus process; changing the role of node B (accounting-and-consensus coexisting role) to a purely accounting role, meaning node B does not participate in the subsequent consensus process; and changing the role of node C (accounting-and-consensus coexisting role) to a purely consensus role, meaning node C can participate in the subsequent consensus process but does not participate in the subsequent accounting tasks.
[0062] In the above embodiments, when some nodes in the blockchain network execute the consensus process, the first network state information of the blockchain network at the first moment can be obtained. The node strategy information that is more adapted to the first network state information can be dynamically adjusted through the first network state information. The consensus nodes are updated based on the node strategy information so that nodes that are more adapted to the first network state information can participate in the consensus. In this way, while ensuring the security of the consensus, the consensus efficiency can also be improved, the network load can be balanced, and the consensus process can be ensured to operate efficiently in a dynamic environment. It can better adapt to complex and ever-changing network environments, thereby solving the problem that the blockchain consensus mechanism in related technologies uses static algorithms and therefore performs poorly in dynamic network environments. It can significantly improve the consensus performance and adaptability of the blockchain network.
[0063] Figure 3 This is a flowchart illustrating a method for determining consensus nodes in a blockchain network according to an exemplary embodiment. Figure 3 As shown, the determination method may include, but is not limited to, the following steps.
[0064] In step 301, the first network state information of the blockchain network at the first moment is obtained.
[0065] In the embodiments of this disclosure, step 301 can be implemented in any of the ways described in the various embodiments of this disclosure. This disclosure does not limit this and will not elaborate further.
[0066] In step 302, based on the first network state information of the blockchain network at the first time and the second network state information at the second time, the policy information of multiple candidate nodes associated with the first network state information is evaluated and processed to obtain the node policy information corresponding to the first network state information.
[0067] In some embodiments, based on the first network state information of the blockchain network at a first time and the second network state information at a second time, the evaluation function value of each candidate node policy information can be determined by reinforcement learning. The maximum evaluation function value can be found from the multiple evaluation function values of the multiple candidate node policy information, and the candidate node policy information corresponding to the maximum evaluation function value can be determined as the node policy information corresponding to the first network state information.
[0068] In some embodiments, reinforcement learning methods can be used to optimize node policy information. By continuously updating the evaluation function value, it is brought to an optimum, thereby selecting the best node policy information under different network states to obtain the maximum reward and improve the system's learning and adaptability. In some embodiments, such as Figure 4 As shown, an optional implementation of step 302 above may include the following steps.
[0069] In step 401, the policy information of multiple candidate nodes associated with the first network state information is evaluated sequentially. Based on the first network state information of the blockchain network at the first time and the second network state information at the second time, the evaluation function value of the current candidate node policy information to be evaluated is determined.
[0070] In one possible implementation, the immediate reward information obtained when the candidate node policy information to be evaluated is executed under the first network state information can be obtained; the evaluation function value of the node policy information corresponding to the second network state information can be obtained; and the evaluation function value of the candidate node policy information to be evaluated can be determined based on the immediate reward information and the evaluation function value of the node policy information corresponding to the second network state information.
[0071] For example, reinforcement learning can be used to optimize node policy information. By continuously updating the evaluation function value to make it optimal, node policy information can be selected under the first network state information to obtain the maximum reward, thereby improving the system's learning and adaptability. For example, the evaluation function can be Q(S t ,a t This indicates that the evaluation function can be represented in state S. t Selection of candidate node strategy information a t The obtained evaluation value (or assessment value) is then continuously updated using the evaluation function to approach the optimal value. The candidate node policy information associated with this optimal value is the policy information for the node in state S. t The corresponding node policy information (also called optimal node policy information). For example, the formula for calculating (or updating) the evaluation function Q value can be expressed as follows:
[0072] Q(S t ,a t )←Q(S t ,a t )+α[r t +γmax a′ Q(S t-1 ,a ′ )-Q(S t ,a t )](1)
[0073] Among them, Q(S) t ,a t ) indicates that in state S t (e.g., first network state information) execute candidate node policy information a t The Q-value (also known as the evaluation function) represents the current state S. t The following adopts candidate node strategy information a tThe expected future reward that can be obtained. For example, this evaluation function can assess the effectiveness of different candidate node strategy information, covering factors such as consensus efficiency, resource balance, network latency, communication overhead, and system fault tolerance, and performs quantitative analysis based on the Pareto principle (80 / 20 rule). For instance, taking node resource utilization as an example, resource utilization can include indicators such as CPU utilization, memory consumption, and storage space usage. Based on historically collected data, CPU utilization is sorted from low to high, with the lowest 20% assigned a score of 5 and the highest 20% assigned a score of 1. The scoring method for memory consumption is similar. Network latency refers to the communication time between the monitoring device and the accounting node, and is also quantitatively evaluated based on the Pareto principle to ensure efficient system operation. Evaluation function Q(S) t ,a t Information a is used to evaluate the system's strategy for adopting a particular candidate node. t The effect of this guides the system towards greater efficiency and adaptability. In some embodiments, the evaluation function comprises at least one of the following factors: consensus efficiency, resource balance, network latency and communication overhead, and fault tolerance. For example, the evaluation function may comprise the following factors: consensus efficiency (for example, the faster the consensus is achieved, the higher the evaluation), resource balance (for example, the more balanced the utilization of node resources in the system, the higher the evaluation), network latency and communication overhead (for example, the lower the latency and communication overhead, the higher the evaluation), and system fault tolerance (for example, the higher the evaluation, the better the system can maintain normal operation when nodes fail or resources are limited). By comprehensively considering these factors, an evaluation function Q(S) can be constructed. t ,a t This guides the system to adjust towards greater efficiency and adaptability.
[0074] In formula (1) above, α is the learning rate, which can range from 0 to 1, controlling the degree to which newly acquired information affects the Q-value update. A higher α indicates a greater focus on new information, while a lower α indicates a greater focus on existing Q-values. t Indicates that in state S t Execute candidate node policy information a t The immediate reward received is the reward obtained afterward. This can be seen as direct feedback from the reinforcement learning system to the current behavior. γ is the discount factor, which can range from 0 to 1 and is used to balance the importance of future expected rewards and immediate rewards; a higher γ indicates a greater emphasis on future expected rewards, while a lower γ indicates a greater emphasis on immediate rewards. a′ Q(S t-1 ,a ′ ) indicates that in state S t-1 Below, policy information for all possible candidate nodes a ′The maximum Q value that can be obtained. It represents the maximum Q value in state S. t-1 The expected reward for selecting the optimal node strategy information.
[0075] It should be noted that, in some embodiments, the above state S t-1 This can be, for example, the second network state information, which is the set of states of each node in the blockchain network at a second time, that is, representing the current state information of all nodes in the blockchain network at the second time t-1. The aforementioned state S t For example, it can be the first network state information, which is the set of states of each node in the blockchain network at the first time, that is, it represents the current state information of all nodes in the blockchain network at the first time t.
[0076] In the embodiments of this disclosure, when evaluating multiple candidate node policy information associated with the first network state information sequentially, the evaluation function value of the candidate node policy information to be evaluated can be calculated using the above formula (1) based on the first network state information of the blockchain network at the first time and the second network state information at the second time. For example, the candidate node policy information a to be evaluated can be obtained. t First network state information S t The instant reward information r obtained when it is executed. t Determine the maximum value of the evaluation function for the node policy information corresponding to the second network state information. a′ Q(S t-1 ,a ′ ), will instantly reward information r t The maximum value of the evaluation function for the node policy information corresponding to the second network state information. a′ Q(S t-1 ,a ′ Substituting into formula (1) above, we can obtain state S. t The current candidate node strategy information to be evaluated and processed is a t The evaluation function value. Among them, the evaluation function value max of the node policy information corresponding to the second network state information. a′ Q(S t-1 ,a ′ The optimal node strategy information can be determined based on the second network state information of the blockchain network at the second time and historical network state information (such as the network state information of the blockchain network at the third time, which is a historical time of the second time).
[0077] In step 402, when the evaluation function value of the candidate node strategy information does not meet the preset conditions, the evaluation function value of the next candidate node strategy information to be evaluated is determined based on the first network state information of the blockchain network at the first time and the second network state information at the second time.
[0078] For example, when the evaluation function value of the candidate node strategy information to be evaluated is obtained, it can be determined whether the evaluation function value meets the preset conditions. For example, if the evaluation function value is less than the target value, it can be considered that the evaluation function value does not meet the preset conditions. Then, the evaluation function value of the next candidate node strategy information to be evaluated can be calculated. That is, based on the first network state information of the blockchain network at the first time and the second network state information at the second time, the evaluation function value of the next candidate node strategy information to be evaluated is determined. For example, the above formula (1) can be used to calculate the evaluation function value of the next candidate node strategy information to be evaluated.
[0079] In step 403, when the evaluation function value of the candidate node policy information meets the preset conditions, the candidate node policy information corresponding to the evaluation function value that meets the preset conditions is determined as the node policy information corresponding to the first network state information.
[0080] For example, when the evaluation function value of the candidate node policy information to be evaluated is obtained, it can be determined whether the evaluation function value meets the preset conditions. For example, if the evaluation function value is greater than or equal to the target value, it can be considered that the evaluation function value meets the preset conditions. Then, the candidate node policy information corresponding to the evaluation function value that meets the preset conditions can be determined as the node policy information corresponding to the first network state information.
[0081] For example, such as Figure 5 As shown, the multiple candidate node policy information associated with the first network state information includes candidate node policy information a1. t a2 t a3 t For example, regarding the candidate node policy information a1 t a2 t a3 t When performing evaluation and processing sequentially, the current state S can be selected. t Candidate node policy information a1 under (i.e., first network state information) t Execute candidate node strategy information a1 t And obtain candidate node policy information a1 t In state S t The immediate reward information that can be obtained below r t Using the second network state information S t-1The maximum value of the evaluation function for the corresponding optimal candidate node policy information. a′ Q(S t-1 ,a ′ ) and the instant reward information r t The Q value is updated using the above formula (1), that is, the candidate node strategy information a1 is calculated. t The evaluation function value. Determine the candidate node policy information a1. t Whether the evaluation function value meets the termination condition, such as judging the candidate node strategy information a1. t If the evaluation function value is greater than or equal to the target threshold, then the candidate node policy information a1 is considered. t If the evaluation function value is greater than or equal to the target threshold, the termination condition is considered met, and the candidate node policy information a1 can be transferred. t This serves as the node policy information corresponding to the first network state information. If the candidate node policy information a1 t If the evaluation function value is less than the target threshold, the termination condition is considered not met, and the current state S can be selected. t The next candidate node policy information to be evaluated under (i.e., the first network state information) a2 t And similarly calculate the candidate node strategy information a1 t The evaluation function value is used to calculate the policy information a2 of the candidate node. t The evaluation function value, if the candidate node policy information a2 t If the evaluation function value is greater than or equal to the target threshold, the termination condition is considered met, and the candidate node policy information a2 can be transferred. t This serves as the node policy information corresponding to the first network state information. If the candidate node policy information a2... t If the evaluation function value is less than the target threshold, the termination condition is considered not met, and the current state S can be selected. t The next candidate node policy information to be evaluated under (i.e., the first network state information) is a3. t The evaluation function value. Candidate node policy information a3 t The evaluation function value is calculated in a similar way to the candidate node policy information a1. t The calculation method for the evaluation function value will not be elaborated here. If the candidate node policy information a3 t If the evaluation function value is greater than or equal to the target threshold, the termination condition is considered met, and the candidate node policy information a3 can be transferred. t This serves as the node policy information corresponding to the first network state information. If the candidate node policy information is a3... t If the evaluation function value is less than the target threshold, then the candidate node policy information a1 can be... t a2 t a3 tThe candidate node policy information with the largest evaluation function value is determined as the node policy information corresponding to the first network state information.
[0082] In step 303, a first node is determined based on the node policy information; the first node can be used to perform consensus tasks.
[0083] In the embodiments of this disclosure, step 303 can be implemented in any of the ways described in the various embodiments of this disclosure. This disclosure does not limit this and will not elaborate further.
[0084] In some embodiments, node policy information may include consensus task load redistribution information. Consensus tasks can be assigned to corresponding consensus nodes based on this information. For example, when determining the first node based on node policy information, consensus tasks can also be assigned to the corresponding first node participating in consensus based on the consensus task load redistribution information within the node policy information. In some embodiments, during the execution of the assigned consensus task by the first node, the node status information of the first node can be obtained, and the consensus task allocation can be adjusted according to this information. That is, during the execution of the assigned consensus task by the first node participating in consensus, the consensus task allocation can be adjusted in conjunction with the node status information of the first node to address potential node performance fluctuations or resource conflicts, thereby improving the flexibility of task scheduling and the overall stability of the system.
[0085] Figure 6 This is a flowchart illustrating a device for determining consensus nodes in a blockchain network according to an exemplary embodiment. Figure 6 As shown, the device for determining the consensus node of the blockchain network may include, but is not limited to, a monitoring module 601, an adjustment module 602, and a task scheduling module 603.
[0086] Among them, the monitoring module 601 is used to obtain the first network status information of the blockchain network at the first moment.
[0087] The adjustment module 602 is used to determine the node strategy information corresponding to the first network state information based on the first network state information of the blockchain network at the first moment.
[0088] The task scheduling module 603 is used to determine the first node based on the node policy information; the first node is used to execute the consensus task.
[0089] In some embodiments, the adjustment module 602 is used to: determine node policy information corresponding to the first network state information based on the first network state information of the blockchain network at a first time and the second network state information of the blockchain network at a second time; the second time is the historical time of the first time.
[0090] In some embodiments, the adjustment module 602 is used to: evaluate and process multiple candidate node policy information associated with the first network state information based on the first network state information of the blockchain network at a first time and the second network state information at a second time, so as to obtain node policy information corresponding to the first network state information.
[0091] In some embodiments, the adjustment module 602 is configured to: sequentially evaluate multiple candidate node policy information; determine the evaluation function value of the current candidate node policy information to be evaluated based on the first network state information of the blockchain network at a first time and the second network state information at a second time; when the evaluation function value of the candidate node policy information does not meet a preset condition, determine the evaluation function value of the next candidate node policy information to be evaluated based on the first network state information of the blockchain network at a first time and the second network state information at a second time; when the evaluation function value of the candidate node policy information meets the preset condition, determine the candidate node policy information corresponding to the evaluation function value that meets the preset condition as the node policy information corresponding to the first network state information. In some embodiments, the evaluation function consists of at least one of the following factors: consensus efficiency, resource balance, network latency and communication overhead, and fault tolerance.
[0092] In some embodiments, the adjustment module 602 is configured to: obtain the immediate reward information obtained when the candidate node policy information to be evaluated is executed under the first network state information; obtain the evaluation function value of the node policy information corresponding to the second network state information; and determine the evaluation function value of the candidate node policy information to be evaluated based on the immediate reward information and the evaluation function value of the node policy information corresponding to the second network state information.
[0093] In some embodiments, node policy information includes at least one of node role adjustment information and consensus task load redistribution information.
[0094] In some embodiments, the node policy information includes consensus task load redistribution information. The task scheduling module 603 is further configured to: allocate consensus tasks to the corresponding first node participating in the consensus based on the consensus task load redistribution information. In some embodiments, the task scheduling module 603 is further configured to: obtain the node status information of the first node during the execution of the allocated consensus task by the first node; and adjust the consensus task allocation according to the node status information.
[0095] Regarding the apparatus in the above embodiments, the specific manner in which each module performs its operation has been described in detail in the embodiments related to the method, and will not be elaborated upon here.
[0096] It is worth noting that the embodiments disclosed herein relate to an Adaptive Layered Consensus Mechanism (ALCM) based on a blockchain network. Through an innovative two-layer consensus structure and a real-time monitoring reinforcement learning (RL) dynamic adjustment mechanism, this disclosure can significantly improve the consensus performance and adaptability of the blockchain network. The two-layer consensus structure includes a base layer and an optimization layer: the base layer uses traditional consensus algorithms to ensure security and consistency; the optimization layer utilizes reinforcement learning to achieve self-optimization of node role allocation and task scheduling, and monitors network status and resource usage in real time. For example, the technical solution of this disclosure can be applied to trusted platform management nodes, such as trusted platform management nodes for the control plane and business plane of a satellite network that integrates resilient blockchains. Figure 7 As shown, the blockchain network system architecture is based on a two-layer consensus structure, which can be divided into a base layer and an optimization layer. The base layer is responsible for the security and consistency of the system, and uses a consensus mechanism such as PBFT (Practical Byzantine Fault Tolerant) to ensure stable operation; the optimization layer achieves intelligent node selection and task scheduling optimization through real-time monitoring and reinforcement learning modules.
[0097] like Figure 7 As shown, the system's functional modules can include a monitoring module, an adjustment module, and a task scheduling module. The monitoring module monitors the blockchain network's operational status, collecting key parameters such as node resource utilization, network latency, and node load to identify system bottlenecks and potential node failures. The adjustment module utilizes reinforcement learning to analyze network state information and employs the Dynamic Consensus Optimal Reinforcement Algorithm (DCORA) to select the optimal node, ensuring the efficiency and fault tolerance of the consensus process. The task scheduling module dynamically adjusts the node selection results based on reinforcement learning, assigning consensus tasks to the optimal node to execute the consensus process, generate blocks, and record data.
[0098] The Dynamic Consensus Optimal Reinforcement Algorithm is a consensus optimization algorithm based on reinforcement learning. It achieves optimal consensus decisions for the system under different states by defining a state space, designing an evaluation function, and implementing a real-time optimization strategy. This algorithm utilizes reinforcement learning to continuously update the evaluation function to balance key factors such as consensus efficiency, resource utilization, network latency, and fault tolerance, thereby providing a dynamic adjustment strategy to improve the overall efficiency and adaptability of the system. The state space is defined as follows: the state space is the set of states of all nodes in the system at a certain time, abstracted as a state in the state space, used to describe the current state of the system. In the RL (Reinforcement Learning) model, these collected parameters are abstracted as a state S in the state space. t This refers to the current state of all nodes in the system at a given time t. The real-time optimization strategy can be implemented as follows: reinforcement learning can be used to optimize node policy information. By continuously updating the evaluation function value, it is brought to the optimum, thereby selecting the best node policy information under different network states to obtain the maximum reward and improve the system's learning and adaptability. The system maintains an evaluation function, which is continuously updated to approach its optimal value. Optional implementations of the evaluation function and how to obtain the optimal policy can be found above. Figure 4 and Figure 5 The relevant descriptions of the evaluation function in the embodiments will not be repeated here.
[0099] In some embodiments, the Dynamic Hierarchical Adaptive Consensus Mechanism (ALCM) based on a blockchain network provided herein can optimize the consensus process and achieve dynamic adjustment through the following steps, ensuring that the system operates efficiently and securely in different environments. The business process may include the following steps 1 to 5:
[0100] Step 1: Node layering
[0101] For example, the blockchain ledger nodes in the system can be divided into a basic layer and an optimization layer through a layered module. The basic layer is responsible for maintaining the system's basic ledger functions and ensuring data integrity and security; the optimization layer focuses on improving system performance, handling consensus mechanism optimization, and scheduling node resources. The layered module provides a foundation for subsequent node startup and consensus initiation.
[0102] Step 2: Node Startup and Base Layer Consensus Startup
[0103] For example, the ledger node management module can be used to start all ledger nodes in the base layer and optimization layer to ensure the overall system operates normally. The ledger node management module also needs to initiate base layer consensus, using a base layer consensus mechanism (such as PBFT) to start the consensus process and ensure the security and consistency of the blockchain. The ledger node management module is a prerequisite for the monitoring and adjustment modules.
[0104] Step 3: Monitor network status in real time
[0105] For example, the monitoring module continuously monitors the status of all nodes in the base and optimization layers, specifically monitoring metrics including node CPU efficiency, memory efficiency, storage efficiency, and network efficiency. These metrics cover node computing power, storage space utilization, memory consumption, and network bandwidth usage. This data ensures a comprehensive understanding of the system status, enabling timely detection and resolution of potential problems. The monitoring module not only records these metrics but also generates real-time statistical reports and early warning information to facilitate timely remedial measures when node performance degrades. Furthermore, the system analyzes the monitoring data using machine learning methods to predict potential faults or performance bottlenecks, allowing for proactive adjustments.
[0106] For example, real-time data monitoring can provide foundational data support for subsequent dynamic adjustments, ensuring that the system can respond and adjust quickly based on its current operating status at any time to achieve optimal performance. This monitoring data helps identify bottlenecks, optimize resource allocation, and provide a reliable data foundation for optimization modules. Furthermore, the results of real-time monitoring can also provide data support for long-term system planning, such as predicting expansion needs and making decisions about hardware upgrades.
[0107] It should be noted that the monitoring module can transmit node status information to the adjustment module, and its monitoring data provides a basis for the adjustment module's optimization strategies. Simultaneously, the monitoring module also collaborates with the task scheduling module to ensure that the node status information is up-to-date during scheduling, enabling better task allocation decisions. The monitoring module's reports are also shared with the system management layer, allowing management to make more informed decisions regarding system maintenance and expansion.
[0108] Step 4: Generate consensus node optimization strategy
[0109] For example, the adjustment module employs a dynamic consensus optimization algorithm (an algorithm for dynamically adjusting node roles and optimizing the consensus process) to select the optimal action at each time step t, generating optimal node strategy information, changing node roles, and optimizing consensus efficiency. The algorithm dynamically evaluates nodes based on real-time performance data and historical records, combined with network status, to find the most suitable node to assume the consensus role. Optimal node strategy information includes node role adjustment information, task load redistribution information, etc., to maximize the efficiency and stability of the entire blockchain network. Simultaneously, the adjustment module also performs predictive analysis based on the real-time status of nodes, proactively identifying potential performance problems and developing preventative measures to ensure smooth network operation.
[0110] In this embodiment, an optimal consensus strategy is generated through dynamic optimization to adapt to the current network state, improve consensus efficiency, and ensure the system's resilience to cope with various dynamic changes. The optimization process aims to maximize the use of existing resources, reduce latency in the consensus process, and improve the collaborative capabilities of nodes through scientific data analysis and intelligent decision-making. Furthermore, dynamic optimization can also improve the system's scalability and stability, ensuring that the system maintains high-efficiency consensus capabilities even as the network expands or nodes join / leave.
[0111] It should be noted that the adjustment module can transmit optimal node policy information to the task scheduling module, ensuring that the optimal node undertakes the consensus task. Furthermore, the adjustment module works closely with the monitoring module, using monitoring data to continuously adjust and improve optimization strategies to adapt to network changes. The adjustment module also interfaces with the system's policy management module to ensure the consistency of overall system policies and the effectiveness of optimization strategies, thereby achieving more comprehensive network management.
[0112] Step 5: Task Scheduling and Consensus Execution
[0113] For example, the task scheduling module can perform the following task scheduling operations and consensus execution operations.
[0114] (1) Task Scheduling Operation: The task scheduling module can allocate consensus tasks to the optimal nodes based on the node role adjustment information in the optimal node strategy information (such as the node selection results of the optimization layer), ensuring efficient resource utilization. The task scheduling module will also combine the node status data provided by the monitoring module to adjust the task allocation to cope with possible node performance fluctuations or resource conflicts, thereby improving the flexibility of task scheduling and the overall stability of the system. In addition, the task scheduling module can periodically review and optimize the task allocation to ensure the effectiveness of the scheduling strategy and the continuous efficient operation of the system.
[0115] (2) Consensus Execution Operation: After scheduling is completed, the selected nodes begin the specific consensus process, generating blocks and recording data. Consensus execution includes multiple stages such as transaction verification, block proposal, voting, block generation, and ledger update.
[0116] in,
[0117] Transaction verification: Verifies the validity of transactions, ensuring all transactions comply with the blockchain's rules and consensus protocol. This step needs to be fast and accurate to ensure the security and legitimacy of transactions.
[0118] Block proposal: Nodes propose new block candidates, containing verified transactions. Block proposal is a crucial step in the consensus process; nodes select appropriate transactions to package based on transaction priority and network state.
[0119] Voting: Nodes in the network vote on proposed blocks to determine whether they meet consensus criteria. The voting process must ensure fairness and consistency within the network to prevent interference from malicious nodes.
[0120] Block generation: Once sufficient votes are received, a block is officially generated and added to the blockchain. After generation, the new block is broadcast to the entire network to ensure that all nodes are synchronized with the latest ledger state.
[0121] Ledger Update: This involves synchronizing the transaction records from newly generated blocks to the ledgers of all nodes to maintain data consistency. During execution, all relevant nodes work synchronously to ensure the reliability of the consensus process and data consistency. Ledger updates are fundamental to system security and consistency; all nodes must remain consistent to ensure the trustworthiness of the entire blockchain.
[0122] In other words, tasks can be rationally allocated to achieve efficient resource utilization and ultimately reach blockchain consensus. Through effective task scheduling and consensus execution, the system can reduce communication latency between nodes and improve data processing speed, thereby achieving efficient resource utilization and rapid consensus reaching throughout the blockchain network. Furthermore, task scheduling and consensus execution ensure the system's flexibility, enabling rapid responses to node additions or removals and maintaining efficient system operation.
[0123] It is worth noting that the task scheduling module ensures the efficient operation of the system and completes ledger recording. The task scheduling module needs to work closely with the monitoring and adjustment modules to ensure that all decisions during consensus task allocation and execution are based on the latest node states and optimal strategies, thereby achieving optimal system performance and reliability. Furthermore, the task scheduling module can communicate with the system's management layer to provide system status reports, thus assisting management in long-term system planning and strategy adjustments.
[0124] In summary, the blockchain network system disclosed herein optimizes network performance and flexibility by adopting a two-layer consensus structure. This two-layer consensus mechanism divides the consensus structure into a base layer and an optimization layer. The base layer uses traditional consensus algorithms (such as PBFT and PoS) to ensure system security and consistency; the optimization layer dynamically adjusts node roles and task scheduling through reinforcement learning, optimizing the consensus process based on real-time network conditions and resource utilization. This two-layer design retains the security of traditional consensus while introducing dynamic flexibility, enabling the system to better adapt to complex and changing network environments. Furthermore, by introducing reinforcement learning algorithms into the optimization layer, the optimal node role allocation and task scheduling strategy can be learned through a dynamic consensus optimal reinforcement algorithm. The reinforcement learning algorithm abstracts parameters such as network state, node performance, and consensus tasks into a state space, action space, and action value function. It can continuously optimize strategies based on feedback information, select the most suitable nodes to participate in consensus, balance network load, and ensure the efficient operation of the consensus process in a dynamic environment.
[0125] According to embodiments of this disclosure, this disclosure also provides an electronic device and a readable storage medium.
[0126] like Figure 8 The diagram shown is a block diagram of an electronic device according to an embodiment of the present disclosure. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present application described and / or claimed herein.
[0127] like Figure 8As shown, the electronic device includes one or more processors 801, a memory 802, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components are interconnected via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the electronic device, including instructions stored in or on memory to display graphical information of a GUI on an external input / output device (such as a display device coupled to the interface). In other embodiments, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple electronic devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 8 Take the 801 processor as an example.
[0128] The memory 802 is the non-transitory computer-readable storage medium provided in this application. The memory stores instructions executable by at least one processor to cause the at least one processor to execute the method for determining consensus nodes in a blockchain network provided in this application. The non-transitory computer-readable storage medium of this application stores computer instructions for causing a computer to execute the method for determining consensus nodes in a blockchain network provided in this application.
[0129] The memory 802, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the method for determining consensus nodes in a blockchain network in the embodiments of this application (e.g., attached). Figure 5 The monitoring module 501, adjustment module 502, and task scheduling module 503 are shown. The processor 801 executes various server functions and data processing by running non-transient software programs, instructions, and modules stored in the memory 802, thereby implementing the method for determining blockchain network consensus nodes in the above method embodiments.
[0130] The memory 802 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, the memory 802 may include high-speed random access memory and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory 802 may optionally include memory remotely located relative to the processor 801, and these remote memories can be connected to the electronic device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0131] The electronic device may also include an input device 803 and an output device 804. The processor 801, memory 802, input device 803, and output device 804 can be connected via a bus or other means. Figure 8 Taking the example of a connection between China and Israel via a bus.
[0132] Input device 803 can receive input numerical or character information, and generate key signal inputs related to user settings and function control of the electronic device, such as touch screens, keypads, mice, trackpads, touchpads, joysticks, one or more mouse buttons, trackballs, joysticks, etc. Output device 804 may include display devices, auxiliary lighting devices (e.g., LEDs), and haptic feedback devices (e.g., vibration motors). The display device may include, but is not limited to, liquid crystal displays (LCDs), light-emitting diode (LED) displays, and plasma displays. In some embodiments, the display device may be a touch screen.
[0133] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application-specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations may include: implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transferring data and instructions to the storage system, the at least one input device, and the at least one output device.
[0134] These computational programs (also referred to as programs, software, software applications, or code) include machine instructions for a programmable processor and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms “machine-readable medium” and “computer-readable medium” refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) used to provide machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term “machine-readable signal” refers to any signal used to provide machine instructions and / or data to a programmable processor.
[0135] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0136] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0137] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem, addressing the shortcomings of traditional physical hosts and VPS (Virtual Private Server, or simply "VPS") services, such as high management difficulty and weak business scalability. Servers can also be servers for distributed systems or servers incorporating blockchain technology.
[0138] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.
[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for determining consensus nodes in a blockchain network, characterized in that, The method includes: Obtain the first network state information of the blockchain network at the first moment; Based on the first network state information of the blockchain network at the first moment, determine the node strategy information corresponding to the first network state information; Based on the node policy information, a first node is determined; the first node is used to execute consensus tasks.
2. The method as described in claim 1, characterized in that, The step of determining the node policy information corresponding to the first network state information based on the first network state information of the blockchain network at a first time includes: Based on the first network state information of the blockchain network at a first time and the second network state information of the blockchain network at a second time, node policy information corresponding to the first network state information is determined; the second time is the historical time of the first time.
3. The method as described in claim 2, characterized in that, The step of determining node policy information corresponding to the first network state information based on the first network state information of the blockchain network at a first time and the second network state information of the blockchain network at a second time includes: Based on the first network state information of the blockchain network at a first time and the second network state information at a second time, the policy information of multiple candidate nodes associated with the first network state information is evaluated and processed to obtain the node policy information corresponding to the first network state information.
4. The method as described in claim 3, characterized in that, The process of evaluating and processing multiple candidate node policy information associated with the first network state information based on the first network state information at a first time and the second network state information at a second time, to obtain node policy information corresponding to the first network state information, includes: The policy information of the multiple candidate nodes is evaluated and processed sequentially. Based on the first network state information of the blockchain network at the first time and the second network state information at the second time, the evaluation function value of the current candidate node policy information to be evaluated and processed is determined. When the evaluation function value of the candidate node strategy information does not meet the preset conditions, the evaluation function value of the next candidate node strategy information to be evaluated is determined based on the first network state information of the blockchain network at the first time and the second network state information at the second time. When the evaluation function value of the candidate node policy information satisfies the preset condition, the candidate node policy information corresponding to the evaluation function value that satisfies the preset condition is determined as the node policy information corresponding to the first network state information.
5. The method as described in claim 4, characterized in that, The step of determining the evaluation function value of the candidate node strategy information to be evaluated based on the first network state information of the blockchain network at a first time and the second network state information at a second time includes: The instant reward information obtained when the current candidate node policy information to be evaluated is executed under the first network state information; Obtain the evaluation function value of the node policy information corresponding to the second network state information; The evaluation function value of the candidate node policy information to be evaluated is determined based on the real-time reward information and the evaluation function value of the node policy information corresponding to the second network state information.
6. The method as described in claim 4, characterized in that, The evaluation function consists of at least one of the following factors: consensus efficiency, resource balance, network latency and communication overhead, and fault tolerance.
7. The method according to any one of claims 1-6, characterized in that, The node policy information includes at least one of node role adjustment information and consensus task load redistribution information.
8. The method as described in claim 7, characterized in that, The node policy information includes consensus task load redistribution information; the method further includes: Based on the consensus task load redistribution information, a consensus task is assigned to the first node participating in the consensus.
9. The method as described in claim 8, characterized in that, The method further includes: During the execution of the assigned consensus task by the first node, the node status information of the first node is obtained; The consensus task allocation is adjusted based on the node status information.
10. A device for determining consensus nodes in a blockchain network, characterized in that, The device includes: The monitoring module is used to obtain the first network status information of the blockchain network at the first moment; The adjustment module is used to determine node strategy information corresponding to the first network state information based on the first network state information of the blockchain network at the first moment. The task scheduling module is used to determine the first node based on the node policy information; the first node is used to execute the consensus task.
11. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method for determining a consensus node of a blockchain network as described in any one of claims 1-9.
12. A computer-readable storage medium storing computer instructions thereon, characterized in that, The computer instructions are used to cause the computer to execute the method for determining a consensus node in a blockchain network as described in any one of claims 1-9.
13. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-9.