Event consensus methods, devices, electronic equipment, and storage media for asynchronous nodes
By combining hash graphs and clustering in an asynchronous consensus method, along with the Gossip protocol and dynamic multidimensional reputation assessment, the problem of low consensus efficiency in low-throughput and narrow-bandwidth environments in self-organizing networks is solved, achieving efficient event propagation and consensus.
Patent Information
- Application Number
- CN202510210564.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-25
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2045-02-25
AI Technical Summary
In ad hoc networks, existing consensus algorithms struggle to achieve efficient event propagation in low-throughput, narrow-bandwidth, and weak-connection environments. Furthermore, they lack real-time dynamic scheduling and fast adaptive message selection strategies, resulting in redundant transmission and low consensus efficiency.
An asynchronous consensus method combining hash graphs and clustering is adopted. Information is propagated through the Gossip protocol, and the event propagation path is dynamically adjusted based on node performance data and reputation value. The event propagation path is optimized using the Markov chain Monte Carlo method, and a dynamic multi-dimensional reputation evaluation mechanism is introduced to improve consensus efficiency.
It improves the consensus efficiency between nodes in ad hoc networks, reduces redundant communication, optimizes event propagation paths, adapts to dynamic changes in node reputation, and ensures network stability and reliability.
Smart Images

Figure CN120151345B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to an event consensus method, apparatus, electronic device and storage medium for asynchronous nodes. Background Technology
[0002] Ad hoc networking technology, due to its high dynamism, self-organizing capabilities, and flexibility, has broad application prospects in modern communications. However, in ad hoc networks, node hardware platforms vary widely, with significant differences in computing power and link bandwidth. Weak connections and high packet loss are common, making it difficult to apply traditional, demanding consensus algorithms. Furthermore, frequent node disconnections, disconnections, or movements lead to continuous changes in the topology. Especially without dynamic evaluation and adjustment, this can easily result in redundant event propagation and invalid operations, further slowing down consensus speed.
[0003] Especially for more complex communication scenarios such as low throughput and narrow bandwidth, uneven node reputation, and dynamic changes in online status, the following limitations still exist:
[0004] 1. Lack of real-time dynamic scheduling
[0005] Clustering or asynchronous propagation alone makes it difficult to accurately schedule the propagation process based on the latest state and historical performance of nodes. This can lead to a large number of redundant event transmissions in weak connection and high latency scenarios, resulting in low consensus efficiency between nodes.
[0006] 2. Lack of a fast and adaptive message selection strategy
[0007] When the number of nodes is large and state iterations are frequent, topology optimization based on clustering alone is insufficient to find the optimal event propagation path at the network level. Without directional transmission and load balancing mechanisms, individual clusters or a few high-performance nodes may become overloaded, leading to event redundancy and slowing down consensus efficiency. Summary of the Invention
[0008] In view of this, the purpose of this application is to propose an event consensus method, apparatus, electronic device and storage medium for asynchronous nodes to overcome all or part of the shortcomings of the prior art.
[0009] To achieve the above objectives, this application provides an event consensus method for asynchronous nodes, applied to a communication system. The communication system includes multiple nodes with communication relationships. The method includes: designating each node among at least one starting node that receives an event as an event node, and designating the multiple nodes as target nodes corresponding to each event node; performing at least one round of consensus operations based on the event to ensure that each node among the multiple nodes receives the event; each round of consensus operations is performed as follows: for each event node, in response to determining that there is a target node among the target nodes corresponding to the event node that has not received the event, acquiring performance data of the target node in the current round; based on the performance data, determining the next event node to receive the event, and sending the event from the event node to the next event node; updating the performance data based on the event; for each event node... The event node is defined as follows: The target node after removing the next event node is used as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation. For the next event node, multiple nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to these multiple nodes is used as the performance data of the target node corresponding to the next event node in the next round of consensus operation. Each event node in the current round and the next event node determined by each event node are collectively considered as all event nodes in the next round of consensus operation. In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, at least one round of consensus operation is exited.
[0010] Optionally, determining the next event node to receive the event based on the performance data includes: for each of the target nodes, determining a target reputation value corresponding to the node based on the performance data; determining a target probability distribution value corresponding to the node based on the target reputation value; determining an event transition probability matrix corresponding to the target node based on all target probability distribution values; generating a random number belonging to a predetermined range; and determining the next event node based on the event transition probability matrix and the random number.
[0011] Optionally, determining the target probability distribution value corresponding to the node based on the target reputation value includes: determining the target probability distribution value using the following formula: Where, π target,i Let R'(i) be the target probability distribution value of the i-th node, and R′(i) be the target reputation value of the i-th node. i δ is the adaptive smoothing amount for the i-th node. jR'(n) is the adaptive smoothing value for the j-th node, and R'(n) is the sum of the target reputation values of the n target nodes.
[0012] Optionally, determining the event transition probability matrix corresponding to the target node based on all target probability distribution values includes: constructing an initial event transition probability matrix that satisfies a predetermined probability storage order based on the target node; and modifying the initial event transition probability matrix using a predetermined summation matrix and all target probability distribution values to obtain the event transition probability matrix.
[0013] Optionally, determining the target reputation value corresponding to the node based on the performance data includes: determining the node's basic reputation value, current reputation value, and historical reputation value based on the performance data; performing a weighted summation of the basic reputation value, the current reputation value, and the historical reputation value to obtain an overall reputation value; and performing a smoothing process on the overall reputation value to obtain the target reputation value.
[0014] Optionally, the smoothing of the overall reputation value to obtain the target reputation value includes: smoothing the overall reputation value using the following formula: R′(i)=(1-r)·ln(1+R(i))+r·R(i), where R′(i) is the target reputation value of the i-th node, R(i) is the overall reputation value of the i-th node, and r is a predetermined adjustment parameter.
[0015] Optionally, determining the next event node based on the event transition probability matrix and the random number includes: searching in the event transition probability matrix for multiple probability parameters corresponding to the event node as the node initiating the event transition; sorting the multiple probability parameters according to a predetermined probability storage order to obtain a first sequence; for each probability parameter, adding the probability parameter to all probability parameters located before it in the first sequence to obtain a probability comparison value; sorting all probability comparison values and the random number in ascending order to obtain a second sequence, and determining the sorting sequence number corresponding to the random number in the second sequence as a target sequence number; searching in the first sequence for the target probability parameter corresponding to the target sequence number; and determining the node receiving the event transition corresponding to the target probability parameter as the next event node.
[0016] Based on the same inventive concept, this application also provides an event consensus device for asynchronous nodes, applied to a communication system. The communication system includes multiple nodes with communication relationships. The device includes: a receiving module configured to treat each node among at least one starting node that receives an event as an event node, and the multiple nodes as target nodes corresponding to each event node; a consensus operation module configured to perform at least one round of consensus operation based on the event, so that each node among the multiple nodes receives the event; the consensus operation module is further configured to perform the following in each round of consensus operation: for each event node, in response to determining that there is a node among the target nodes corresponding to the event node that has not received the event, obtain the performance data of the target node in the current round; based on the performance data, determine the next event node to receive the event, and send the event from the event node to the next event node; based on the... The performance data is updated according to the event described above. For each event node, the target node after removing the next event node is used as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation. For each next event node, the plurality of nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are used as the performance data of the target node corresponding to the next event node in the next round of consensus operation. Each event node in the current round and the next event node determined by each event node are used together as all event nodes in the next round of consensus operation. In response to determining that there is no node among the target nodes corresponding to the event node that has not received the event, at least one round of consensus operation is exited.
[0017] Based on the same inventive concept, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable by the processor, wherein the processor implements the method described above when executing the computer program.
[0018] Based on the same inventive concept, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing a computer to perform the method described above.
[0019] As can be seen from the above, the asynchronous node event consensus method, apparatus, electronic device, and storage medium provided in this application include: the method comprising: taking each of at least one starting node among a plurality of nodes that receives an event as an event node; taking the plurality of nodes as target nodes corresponding to each event node; performing at least one round of consensus operation based on the event to ensure that each of the plurality of nodes receives the event; each round of consensus operation is performed as follows: for each event node, in response to determining that there is a target node among the target nodes corresponding to the event node that has not received the event, obtaining the performance data of the target node in the current round; based on the performance data, determining the next event node to receive the event, and sending the event from the event node to the next event node; updating the performance data based on the event; for the event node, The target node after removing the next event node is used as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation. For the next event node, the plurality of nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are used as the performance data of the target node corresponding to the next event node in the next round of consensus operation. Each event node in the current round and the next event node determined by each event node are used together as all event nodes in the next round of consensus operation. In response to determining that there is no node among the target nodes corresponding to the event node that has not received the event, at least one round of consensus operation is exited. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in this application or related technologies, the drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0021] Figure 1 This is a flowchart illustrating the event consensus method for asynchronous nodes in an embodiment of this application.
[0022] Figure 2 This is a schematic diagram of the consensus architecture between nodes in an embodiment of this application;
[0023] Figure 3 A schematic diagram illustrating the selection of a propagation strategy for a probability-based consensus event in an embodiment of this application;
[0024] Figure 4This is a flowchart illustrating the dynamic multidimensional credit assessment process in an embodiment of this application.
[0025] Figure 5 This is a schematic diagram of the event consensus device for asynchronous nodes in an embodiment of this application;
[0026] Figure 6 This is a schematic diagram of the hardware structure of an electronic device according to an embodiment of this application. Detailed Implementation
[0027] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with specific embodiments and the accompanying drawings.
[0028] It should be noted that, unless otherwise defined, the technical or scientific terms used in the embodiments of this application should have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms "first," "second," and similar terms used in the embodiments of this application do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are only used to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0029] As described in the background section, with the rapid development of the Internet, network scale is constantly expanding, and network topology is becoming increasingly complex. In certain special scenarios (such as emergency communication and disaster relief), due to damaged infrastructure or limited conditions, it is difficult for networks to rely on traditional centralized facilities. Often, it is necessary to quickly build and deploy decentralized, centerless, self-organizing networks. Self-organizing network technology, due to its high dynamism, self-organizing capability, and flexibility, has broad application prospects in modern communication. For example, in smart homes, self-organizing network technology can achieve interconnection and interoperability among various devices within the home, improving convenience and comfort. In the field of industrial automation, self-organizing networks can achieve real-time communication and data transmission between devices, improving production efficiency and intelligence levels. These devices can be considered nodes. Furthermore, self-organizing networks are also widely used in emergency communication, wireless sensor networks, autonomous driving, and network monitoring.
[0030] However, self-organizing networks face challenges such as link heterogeneity, narrow bandwidth, node instability, and dynamic online / offline cycles, which frequently limit the quality of communication between nodes, leading to high latency, high packet loss rates, and low throughput, significantly increasing the difficulty of achieving network consensus. In these applications, the connection links between nodes vary, often facing challenges of low throughput, narrow bandwidth, and weak connections. For example, in remote areas or complex terrain, communication signals are easily interfered with, resulting in unstable network connections. In monitoring networks, the network bandwidth of different network nodes changes dynamically. In some distributed systems, such as large-scale cross-regional data monitoring networks, equipment may be deployed in different cities, and the bandwidth resources between these devices will fluctuate dynamically due to environmental conditions and load changes. In this context, ensuring real-time synchronization of monitoring data and rapid updates to monitoring strategies are core issues for the stable operation of the communication system. In such an environment, consensus mechanisms are particularly important because they ensure that all nodes in the network can still reach a consistent data state and achieve global convergence in the face of communication interruptions, data loss, and node failures. This is crucial for maintaining network stability and reliability.
[0031] While consensus mechanisms play a crucial role in ad hoc networks, existing consensus algorithms still face numerous challenges in low-throughput, narrow-bandwidth, and weakly connected environments. First, many consensus algorithms are not designed with network bandwidth limitations in mind, resulting in significant bandwidth consumption during data transmission. For example, traditional Byzantine Fault Tolerance (BFT) algorithms maintain high message complexity under both normal and leader failure conditions, leading to increased communication latency and slower consensus efficiency in bandwidth-constrained environments. Second, the complexity and computational overhead of consensus algorithms pose a challenge for resource-constrained ad hoc network nodes. For instance, some blockchain-based consensus algorithms require complex cryptographic calculations and verification processes, which not only increase the computational burden on nodes but may also reduce consensus speed. Furthermore, the dynamic topology of ad hoc networks also presents challenges to consensus algorithms, as frequent and unpredictable node joining and leaving can lead to information loss and inconsistencies between nodes during the consensus process. Therefore, designing lightweight, low-bandwidth consensus algorithms that can adapt to dynamic topology changes is an important research direction in the current development of ad hoc network technology.
[0032] To better adapt to dynamic topologies and reduce synchronization overhead, some existing technologies are beginning to explore the use of Directed Acyclic Graphs (DAGs) in hash graphs to record the events and state evolution of nodes in the network. Unlike traditional blockchains, hash graphs form a topology through direct references between events, allowing nodes to exchange event information asynchronously in a "gossip" manner. This reduces the reliance on strict synchronization in weakly connected, narrow-bandwidth network environments. Meanwhile, in ad hoc networks, a common network organization method is node clustering. This involves aggregating nodes that are close in distance (or have good communication quality) into clusters based on factors such as geographical location or signal strength. The cluster head node is responsible for intra-cluster management and inter-cluster communication. Clustering reduces the number of direct communications across the entire network, shortens some data transmission paths, and improves network scalability and management efficiency. Combining hash graphs and clustering has also become a common approach in some solutions to address frequent changes in network topology and weak connectivity.
[0033] However, relying solely on the combination of hash graphs and clustering still has some shortcomings in practical systems: Firstly, it doesn't fully consider the dynamic differences in performance between nodes, potentially leading to redundant propagation in situations with weak connections or extremely limited bandwidth. Secondly, it cannot effectively determine the optimal path for event propagation at the network-wide level, and it lacks a real-time feedback and adjustment mechanism for varying node performance and unstable states. This approach performs reasonably well in topologically stable environments, but in low-throughput, narrow-bandwidth environments of ad hoc networks, random and blind propagation can easily cause redundant communication, resulting in wasted bandwidth, increased propagation latency, and even load imbalance. Therefore, how to further reduce communication volume, improve consensus efficiency, and adapt to dynamic changes in node reputation based on asynchronous hash graph propagation remains an important problem to be solved.
[0034] In summary, using hash graphs to achieve asynchronous consensus and clustering nodes to reduce communication burden can solve some of the problems caused by frequent changes in network topology to a certain extent. However, for more complex real-world scenarios such as low throughput and narrow bandwidth, uneven node reputation, and dynamic changes in online status, the following obvious limitations still exist:
[0035] 1. Lack of real-time dynamic scheduling
[0036] Clustering or asynchronous propagation alone makes it difficult to accurately schedule the propagation process based on the latest state and historical performance of nodes. This can lead to a large number of redundant event transmissions in weak connection and high latency scenarios, resulting in low consensus efficiency between nodes.
[0037] 2. Lack of a fast and adaptive message selection strategy
[0038] When the number of nodes is large and state iterations are frequent, topology optimization based on clustering alone is insufficient to find the optimal event propagation path at the network level. Without directional transmission and load balancing mechanisms, individual clusters or a few high-performance nodes may become overloaded, or even form new bottlenecks, leading to event redundancy and slowing down consensus efficiency.
[0039] In view of this, embodiments of this application propose an event consensus method for asynchronous nodes, referring to... Figure 1 The method, applied to a communication system comprising multiple nodes with communication relationships, includes the following steps:
[0040] Step 101: Take each of the at least one starting node that receives the event from the multiple nodes as an event node, and take the multiple nodes as the target node corresponding to each event node.
[0041] In this step, the hash graph employs a unique "gossip protocol" and virtual voting mechanism to ensure the rapid propagation of transaction information and consensus on transaction order, providing a decentralized, secure, and efficient solution for distributed systems. In the hash graph, nodes propagate information through the gossip protocol. Each node propagates events it knows about to other nodes and records the timestamp and order of propagation. This propagation method ensures that information can spread quickly and widely throughout the network. Subsequently, nodes conduct virtual voting based on the received information and timestamps to confirm the validity of transactions and reach consensus. The multiple nodes in this application constitute the hash graph, which is a node in a self-organizing network. Furthermore, the nodes in this application are asynchronous nodes, meaning nodes that can run independently in an asynchronous execution environment without waiting for synchronization signals or events from other nodes.
[0042] This application uses a hash graph as the basic structure for recording and tracking events, and employs an asynchronous Gossip protocol to propagate events between nodes, thereby avoiding the excessive reliance of traditional consensus algorithms on synchronization and stable topologies. Figure 2 As shown, the hash graph model serves as the base layer, representing the historical record of events through a directed acyclic graph (DAG), where each event includes a timestamp and associated information. The clustering mechanism, as the network's organizational layer, provides a dynamic method for node management and communication. Hash graph consensus propagation uses the Gossip protocol, randomly selecting neighboring nodes to propagate events.
[0043] A node can receive events. Each node among at least one starting node that receives the event is designated as an event node. If a node has not previously received the event, it is designated as an event node upon receiving the event again. All nodes in the communication system are considered as target nodes for each event node. Naming the nodes distinguishes them from each other.
[0044] Step 102: Based on the event, perform at least one round of consensus operation to ensure that each of the plurality of nodes receives the event.
[0045] In this step, when an event node receives an event, it performs at least one round of consensus operations to ensure that each of the multiple nodes receives the event. Consensus operations refer to the process in a distributed system where multiple nodes reach an agreement on a specific event using a particular algorithm and protocol. By performing at least one round of consensus operations, data consistency among the nodes is achieved.
[0046] It should be noted that the communication system is capable of performing consensus operations on multiple events simultaneously.
[0047] Step 103, each round of consensus operation is performed as follows: for each event node, in response to determining that there is a node among the target nodes corresponding to the event node that has not received the event, the performance data of the target node in the current round is obtained.
[0048] In this step, for each event node, if there are nodes among the target nodes that have not received the event, it indicates that the consensus operation for that event in the current round has not yet been completed. The performance data of the target nodes in the current round is then obtained. This performance data is related to the node's ability to process events. For example, performance data includes the node's remaining computing power, network bandwidth, node security, latency response, packet integrity, node response speed, and response time. The performance data includes sub-performance data for each node.
[0049] Step 104: Based on the performance data, determine the next event node to receive the event, and send the event from the event node to the next event node.
[0050] In this step, if the dynamic differences in performance between nodes are not considered, topology optimization based solely on clustering is insufficient to find the optimal event propagation path at the network level, leading to a large amount of redundant event transmission and consequently low consensus efficiency between nodes. To address this issue, this application determines the next event node to receive the event based on performance data reflecting a node's event processing capabilities, and then sends the event from the current event node to the next event node. By using the performance data of the current round, events can be preferentially sent to the next event node with relatively strong event processing capabilities, achieving precise event scheduling while reducing the possibility of generating a large number of redundant events, thereby improving the consensus efficiency between nodes.
[0051] It should be noted that the event node and the next event node can be the same node or different nodes.
[0052] Step 105: Update the performance data based on the event.
[0053] In this step, since an event node may process an event after receiving it, this can change the node's current event processing capability. Therefore, it is necessary to find the sub-performance data corresponding to the event node and the next event node in the performance data. Based on the event, the sub-performance data corresponding to the event node and the next event node are updated. By updating the performance data, the real-time nature and accuracy of the performance data are ensured.
[0054] Step 106: For the event node, the target node after removing the next event node is taken as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is taken as the performance data of the target node corresponding to the event node in the next round of consensus operation.
[0055] In this step, since the current round of consensus operations is not the final round and a next round is still needed, the data for the next round is determined based on the data from the current round. Since the event node has already sent the event to the target node, the next round of consensus operations does not need to send the event to the next event node; the target node after removing the next event node is used as the target node corresponding to that event node in the next round of consensus operations. At this time, the performance data corresponding to the target node has also changed. The updated performance data is filtered using the target node after removing the next event node, removing the sub-performance data corresponding to the next event node from all performance data. The filtered performance data is used as the performance data of the target node corresponding to that event node in the next round of consensus operations. By determining the data of that event node in the next round of consensus operations using the data from the current round of consensus operations, the goal of dynamically updating the data for the next round of consensus operations is achieved, ensuring the accuracy of the data participating in the next round of consensus operations, and thus enabling accurate event scheduling based on the latest node status.
[0056] Step 107: For the next event node, the plurality of nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are used as the performance data of the target nodes corresponding to the next event node in the next round of consensus operation.
[0057] In this step, since the next event node has already received the event, it can continue to share the event with other nodes in the next round of consensus operations. Therefore, it is necessary to determine the data used by the next event node in the next round of consensus operations. Since the next event node is receiving the event for the first time, its target nodes are all nodes in the communication system. This also shows that events between nodes in this application are bidirectional; that is, if node A sends an event to node B, node B may also send the event back to node A. Multiple nodes are used as target nodes for the next event node in the next round of consensus operations, and the performance data corresponding to multiple nodes is used as the performance data of the target nodes for the next event node in the next round of consensus operations. By determining the data of the next event node in the next round of consensus operations using the data from the current round of consensus operations, the goal of dynamically determining the data for the next round of consensus operations is achieved, ensuring the accuracy of the data participating in the next round of consensus operations, and thus enabling accurate scheduling of events based on the latest state of the nodes.
[0058] Step 108: Each event node in the current round and the next event node determined by each event node are collectively used as all event nodes in the next round of consensus operation.
[0059] In this step, since each event node and the next event node determined by each event node have received the event in the current round, the event node in the current round and the next event node can both serve as event nodes in the next round of consensus operation and continue to execute the consensus operation.
[0060] It should be noted that in the next round of consensus operations, there is a possibility that both event node A and the next event node B may send the event to node C. In this case, node C needs to determine which event to process based on the trust mechanism. The events in this application are executed asynchronously; unless otherwise specified, a node will not execute the event immediately upon receiving it.
[0061] Step 109: In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, exit at least one round of consensus operation.
[0062] In this step, if no node among the target nodes corresponding to the event node has not received the event, it indicates that all nodes in the communication system have received the event, and no further consensus operation is needed, thus exiting at least one round of consensus operation. In this application, when nodes reach event consensus, they tend to reach consensus with nodes that have strong event processing capabilities. Nodes with strong event processing capabilities have relatively high performance, exhibiting good performance in both event processing and event consensus, thus improving the efficiency of completing the consensus operation and consequently improving the consensus efficiency between nodes.
[0063] The above scheme designates each of the at least one starting node among multiple nodes that receive an event as an event node, and the multiple nodes as the target node corresponding to each event node. Based on the event, at least one round of consensus operations is performed to ensure that each of the multiple nodes receives the event. By performing at least one round of consensus operations, data consistency among nodes is achieved. Each round of consensus operations is performed as follows: For each event node, in response to determining that there is a target node among the target nodes corresponding to the event node that has not received the event, the performance data of the target node in the current round is obtained. Based on the performance data, the next event node to receive the event is determined, and the event is sent from the event node to the next event node. By using the performance data of the current round, events can be preferentially sent to the next event node with relatively strong event processing capabilities, achieving the purpose of precise event scheduling. At the same time, it reduces the possibility of generating a large number of redundant events, thereby improving the consensus efficiency among nodes. Based on the event, the performance data is updated. By updating the performance data, the real-time and accuracy of the performance data are ensured. For the aforementioned event node, the target node after removing the next event node is used as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation. This achieves the purpose of dynamically updating the data for the next round of consensus operation, ensuring the accuracy of the data participating in the next round of consensus operation. For the next event node, multiple nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to these multiple nodes is used as the performance data of the target node corresponding to the next event node in the next round of consensus operation. This achieves the purpose of dynamically determining the data for the next round of consensus operation, ensuring the accuracy of the data participating in the next round of consensus operation. Each event node in the current round and the next event node determined by each event node are collectively used as all event nodes in the next round of consensus operation. In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, at least one round of consensus operation is exited, improving the efficiency of completing the consensus operation and thus improving the consensus efficiency between nodes.
[0064] In some embodiments, determining the next event node to receive the event based on the performance data includes: for each of the target nodes, determining a target reputation value corresponding to the node based on the performance data; determining a target probability distribution value corresponding to the node based on the target reputation value; determining an event transition probability matrix corresponding to the target node based on all target probability distribution values; generating a random number belonging to a predetermined range; and determining the next event node based on the event transition probability matrix and the random number.
[0065] In this embodiment, given the performance data of the current round, it is necessary to integrate the performance data so that the integrated value can guide the determination of the next event node. Therefore, based on the performance data, the target reputation value corresponding to the node is determined. To enhance reliability and efficiency in weakly connected environments, this application further introduces a dynamic evaluation mechanism for node reputation. By monitoring indicators such as computing power, stability, response time, and error rate, real-time feedback on the overall performance of nodes in the network is formed. Without smooth mapping and reputation probability guidance, pure random Gossip can easily lead to bandwidth waste and redundant propagation, potentially sending events repeatedly to offline or low-performance nodes. However, by using target reputation value guidance, most events will be more quickly consensused to nodes with relatively high target reputation values, while also ensuring that nodes with medium to high target reputation values bear a reasonable load, reducing invalid communication. Based on the Markov chain Monte Carlo adaptive propagation method, when a node selects an event propagation target, it uses node reputation as a reference and determines the message forwarding object according to a certain probability distribution, enabling high-reputation nodes to receive and process more events without creating a single point of bottleneck. Even if some nodes fail or go offline, the remaining nodes can gradually maintain network consistency by continuously exchanging and updating the hash map. Because the reputation mechanism can dynamically adjust based on factors such as node online time, processing latency, and error rate, a node's reputation score will naturally decrease if it becomes overloaded or its connection status deteriorates, thus reducing the reliance of subsequent messages on it.
[0066] Based on the target reputation value, the target probability distribution value corresponding to each node is determined. The target reputation value of each node is an important indicator for measuring node performance and reliability. Therefore, a target probability distribution value can be designed based on the target reputation value to describe the proportion of consensus events that each node should ideally receive. Based on all target probability distribution values, the event transition probability matrix corresponding to the target node is determined. The event transition probability matrix includes the probability of consensus events from one node to another. For example, the event transition probability matrix is shown below:
[0067]
[0068] It should be noted that the event transition probability matrix has a predetermined probability storage order. If the communication system has six nodes, N1, N2, N3, N4, N5, and N6, then the first row of the event transition matrix stores the nodes that initiate the event transition as N1, the second row stores the nodes that initiate the event transition as N2, and so on, until the sixth row stores the nodes that initiate the event transition as N6. The first position of the first row stores the probability that N1 will transition the event to N1, the second position stores the probability that N1 will transition the event to N2, and so on, until the sixth position stores the probability that N1 will transition the event to N6.
[0069] This application employs a dynamic multidimensional reputation assessment mechanism to design a target probability distribution, enabling high-reputation nodes to undertake more consensus tasks and optimizing event propagation paths. This reduces redundant communication and ineffective propagation, effectively lowering bandwidth consumption and improving network resource utilization efficiency. The consensus directional propagation strategy is based on the Markov Chain Monte Carlo (MCMC) method. By dynamically calculating the ideal event probability distribution through changes in node reputation values, a Markov chain state transition matrix is constructed, giving event propagation a clear direction. High-reputation nodes are prioritized for propagation, and single-point overload is avoided while ensuring efficiency, thus significantly accelerating consensus achievement and improving propagation success rate in weakly connected environments.
[0070] Generate random numbers within a predetermined range, where the predetermined range is greater than 0 and less than 1. Based on the event transition probability matrix and the random numbers, determine the next event node using the Monte Carlo method. Figure 3 As shown, through event propagation and dynamic adjustment, the actual distribution of events received by nodes gradually approaches the target distribution as the communication system operates, thereby achieving load balancing and maximizing the utilization of consensus resources.
[0071] In some embodiments, determining the target probability distribution value corresponding to the node based on the target reputation value includes: determining the target probability distribution value using the following formula: Where, π target,i Let R'(i) be the target probability distribution value of the i-th node, and R′(i) be the target reputation value of the i-th node. i δ is the adaptive smoothing amount for the i-th node. j R'(n) is the adaptive smoothing value for the j-th node, and R'(n) is the sum of the target reputation values of the n target nodes.
[0072] In this embodiment, relying solely on the number of events held by each node to naturally form the actual distribution of consensus propagation often leads to an imbalance in the load on the communication system.
[0073] π actual =(x1,x2,…,xi ,…,x n ) T ,
[0074] Where, x i This indicates the proportion of events received by a node out of the total number of events.
[0075] The target reputation value of each node is an important indicator for measuring node performance and reliability. Therefore, a target probability distribution set π can be designed based on the target reputation value. target This describes the proportion of consensus events that each node should ideally receive.
[0076] π target =(π) target,1 ,π target,2 ,…,π target,i ,…,π target,n ).
[0077] To avoid the potential imbalance in target probability distribution or increased sparsity of the transition matrix caused by sudden events such as node offline, a Laplace smoothing method is introduced. By adding a small smoothing amount to the target probability of each node, the allocation ratio is prevented from being too small or zero, ensuring the traversability and irreducibility of the Markov chain. Furthermore, an adaptive smoothing amount is adopted, which dynamically selects a suitable small smoothing amount based on the reputation value of each node and the average reputation value of the system as a whole.
[0078] The adaptive smoothing amount is calculated as follows:
[0079]
[0080] in, The target reputation value represents the average reputation value of all nodes, and ∈ is a predefined adjustment parameter used to control the strength of smoothing. When a node's reputation value is less than or close to the average reputation, the smoothing parameter δ... i A relatively large smoothing parameter δ can prevent the target probability of nodes with excessively low reputation from approaching 0; however, when the reputation value of a node is much higher than the average reputation, the smoothing parameter δ becomes less important. i The target probability is relatively small, maintaining a high-reputation node. The target probability distribution value reflects the transition probability of events between nodes. The target probability distribution value is calculated using a formula, quantifying it to accurately determine its value.
[0081] By smoothing the target reputation value to determine the target probability distribution, and introducing the Laplace smoothing method and adaptive smoothing adjustment mechanism, it is ensured that low-reputation or weakly connected nodes are not completely excluded during propagation, thus maintaining the ergodicity of the Markov chain and the connectivity of the network. Even when nodes frequently go online or offline, or when network connectivity fluctuates, the system consistency can be continuously maintained, enhancing the network's fault tolerance and robustness.
[0082] In some embodiments, determining the event transition probability matrix corresponding to the target node based on all target probability distribution values includes: constructing an initial event transition probability matrix that satisfies a predetermined probability storage order based on the target node; and modifying the initial event transition probability matrix using a predetermined summation matrix and all target probability distribution values to obtain the event transition probability matrix.
[0083] In this embodiment, an initial event transition matrix is constructed based on the target node, satisfying a predetermined probability storage order. This predetermined probability storage order is set based on historical experience, storing the probability parameters corresponding to nodes that initiate event transitions in the same row of the initial event transition probability matrix, with all probability parameters in that row summing to 1. The parameter order in a predetermined summation matrix is determined according to the predetermined probability storage order. The initial event transition probability matrix is then corrected using the predetermined summation matrix and all target probability distribution values to obtain the event transition probability matrix. The probability parameters in the initial event transition matrix have a one-to-one correspondence with target probability distribution values, and also have a one-to-one correspondence with parameters in the predetermined summation matrix. The probability parameters are corrected using the target probability distribution values and parameters in the predetermined summation matrix that have this correspondence. This correspondence means that the node initiating the event transition and the node receiving the event transition are the same. By correcting the initial event transition probability matrix, the accuracy of the probability parameters in the obtained event transition probability matrix is ensured.
[0084] Specifically, if the sequence x0,x1,x2,…,x… k+1 It is based on the conditional probability distribution p(x) k+1 |x k The conditional probability distribution is generated and satisfies the formula (i.e., x). k+1 The distribution depends only on the current state x k (Instead of historical states), then x0, x1, x2, ..., x k+1 This forms a Markov chain.
[0085] p(x k+1 =x|x k ,x k-1 ,…)=p(x k+1 =x|x k ),
[0086] Here, x0 is the given initial condition, and according to the conditional probability distribution, the state x k+1 The probabilistic characteristics are determined by the previous state x k Given. As k approaches infinity, x kRegardless of the initial value. That is, as k increases, the random vectors in the Markov chain will converge to a steady-state distribution, at which point the Markov chain is considered to have reached convergence. Given a smooth probability distribution π... target It is very difficult to directly find the corresponding Markov chain state transition matrix P, where the Markov chain state transition matrix is the event transition probability matrix in this application.
[0087] A matrix P that satisfies the ergodic theorem not only satisfies Pπ target =π target Furthermore, by transforming matrix P, any initial distribution π0 can be made to converge to the target stationary distribution.
[0088] Since the event distribution typically begins with a random distribution, it is necessary to be able to adjust the distribution of any state so that it reaches a target stationary distribution after a finite number of transitions. This requires calculating the transition matrix P that satisfies the ergodic theorem, which can be used to apply the detailed smoothing conditions of the Markov chain.
[0089] If the state transition matrix P and the probability distribution π of a noncyclic Markov chain satisfy the formula for all i, j, then the probability distribution π is called the stationary distribution of the state transition matrix P.
[0090] p ij π target,j =p ji π target,i ,
[0091] The formula satisfies the convergence property of Markov chains. Therefore, it suffices to find a matrix P such that the probability distribution π satisfies the detailed smoothing distribution. This provides a new approach to finding the corresponding Markov chain state transition matrix P from the stationary distribution π. However, finding a suitable matrix P solely through the detailed smoothing condition remains difficult. If a target stationary distribution π exists, it is difficult to satisfy the detailed smoothing condition using a randomly chosen Markov chain state transition matrix Q (as shown in the formula). In other words, q ij π target,j ≠q ji π target i
[0092] The transition matrix 0 proposed in this method, based on Markov chain design, is defined as follows:
[0093]
[0094] In this case, simply add a predetermined summation matrix U to both sides of the inequality, as shown in the formula:
[0095]
[0096] Since both sides of the equation involve only numerical operations, we only need to set u ij ,u ji As shown in the formula below:
[0097]
[0098] This will make the following equation true.
[0099] u ij p ij π target,j =u ji p ji π target,i ,
[0100] Let matrix P satisfy the following condition:
[0101]
[0102] Calculations show that if matrix P satisfies the formula, then matrix P satisfies the detailed smoothing conditions of a Markov chain, and there exists a unique stationary distribution π. target .
[0103]
[0104] In some embodiments, determining the target reputation value corresponding to the node based on the performance data includes: determining the node's basic reputation value, current reputation value, and historical reputation value based on the performance data; performing a weighted summation of the basic reputation value, the current reputation value, and the historical reputation value to obtain an overall reputation value; and performing a smoothing process on the overall reputation value to obtain the target reputation value.
[0105] In this embodiment, as Figure 4 As shown, a multidimensional dynamic reputation model is proposed. This model comprehensively considers three dimensions: basic reputation value (initial hardware capability), historical reputation value (long-term performance), and current reputation value (real-time state). The overall reputation value of a node is dynamically calculated through weighted summation. The overall reputation value is then smoothed to obtain the target reputation value. Specifically, basic reputation assesses the initial characteristics of a node, such as computing power, bandwidth, and response time; historical reputation, based on feedback records from long-term interactions, employs a time decay mechanism to prevent outdated information from affecting the results; and current reputation monitors the latest state changes of the node in real time, ensuring the timeliness and accuracy of the reputation evaluation. This multidimensional dynamic reputation model improves the fault tolerance and consensus efficiency of consensus-participating nodes in weakly connected environments, effectively avoiding consensus failures caused by sudden changes in node state.
[0106] In self-organizing networks, due to the high dynamism of network nodes and frequent topology changes, traditional consensus mechanisms relying on fixed topology structures are insufficient in dealing with the uncertainty of node behavior in self-organizing network environments. This application proposes a multi-dimensional dynamic reputation model, which divides the reputation value of a node into three parts: basic reputation, historical reputation, and current reputation. The model dynamically adjusts the reputation value by monitoring the node's network participation behavior and resource contribution in real time. Combined with feedback mechanisms and incentive strategies, it enhances the node's participation in the consensus process and the system's stability. Basic reputation reflects the node's comprehensive capabilities in the initial stage of the system, including key parameters such as remaining computing power (Sc), network bandwidth (Nb), node security (Ns), and response latency (Rt). These factors directly affect the node's ability to complete data synchronization and event verification during the consensus process. For example, a node's remaining computing power is an important indicator of its task processing efficiency, while network bandwidth affects data transmission throughput. To ensure the rationality of the basic reputation, the model comprehensively evaluates the node's various capabilities during system initialization and assigns initial weights. Historical reputation is based on the node's accumulated performance over long-term interactions and is mainly calculated through the node's historical feedback records. After each data interaction, a node's collaborating nodes evaluate its behavior and generate feedback. This feedback includes key indicators such as network latency, packet integrity, node response speed, and the presence of malicious behavior, and is recorded in the node's local hash graph. To prevent malicious nodes from disrupting the system with false feedback, the model introduces a feedback credibility weighting strategy. The weight of the feedback is dynamically adjusted based on the feedback node's own reputation value, thereby reducing the impact of low-reputation nodes on the overall system evaluation.
[0107] Furthermore, to address the potential for feedback information to become outdated, the model incorporates a time decay mechanism, gradually reducing the weight of historical feedback that has exceeded a certain time threshold. Current reputation reflects a node's recent behavior and state changes, aiming to reflect its current performance and participation activity in real time. In actual system operation, parameters such as a node's remaining computing power, network bandwidth, and response time have dynamic characteristics; therefore, the model employs a dynamic weight adjustment mechanism to ensure that current reputation accurately reflects the node's latest state. By combining rapid feedback in the short term with dynamic weight adjustment, the model can promptly identify changes in node state and respond accordingly.
[0108] (1) The calculation process of basic reputation value:
[0109]
[0110]
[0111] Where Sc represents remaining computing power, Nb represents network bandwidth, Ns represents node security, and Rt represents response latency.
[0112] The formula for calculating the basic credit score is:
[0113]
[0114] Where Base(n) represents the initial reputation value of node n, S j Let W be the initial value for node n on the j-th performance data point. 1j The first predetermined coefficient for the j-th performance data can be adjusted according to the actual situation of the system to adapt to the importance of each indicator score under different network environments.
[0115] (2) The calculation process of historical reputation score:
[0116] The formula for calculating historical reputation score is:
[0117]
[0118] Hist(n) represents the sum of all reputation values received by node n, Num(n) is the number of feedbacks received by node n, FB(n,i) is the feedback value of the i-th performance data of node n, FN(n,i) is the node that provides the i-th feedback to node n, and C(FN(n,i)) represents the weight of the feedback node, i.e. the credibility corresponding to the feedback score.
[0119] The reliability of feedback is ensured by comparing the differences between new and old feedback, and a threshold θ is set to identify potential biases. If the absolute value of the difference between the score of the new feedback and the average score of the previous feedback is less than or equal to θ, the feedback is considered reasonable, and the weight of the node is increased accordingly; otherwise, the weight is decreased. This feedback penalty mechanism is as follows:
[0120]
[0121] The requirement that Δ1 < Δ2 means that the penalty for malicious feedback is greater than the reward for positive feedback, which helps maintain the stability of the node's reputation value.
[0122] Considering that early feedback may not accurately reflect a node's current behavior and performance over time, the model gradually reduces the weight of historical feedback by introducing a time decay factor σ. This ensures that the reputation score calculation focuses more on recent performance. The optimized historical reputation score calculation is as follows:
[0123]
[0124] Where Δt is the interval between the i-th feedback of node n and the current time.
[0125] (3) The calculation process of the current reputation value:
[0126] The formula for calculating the current credit score is:
[0127]
[0128] Where Curr(n) represents the current reputation value of node n, and S(t) j W represents the current value of the performance data in the j-th dimension of node n. 2j This is the second predetermined coefficient for the j-th performance data.
[0129] (4) Calculation process of overall reputation score:
[0130] The consensus is derived by weighting and summing the base reputation value, historical reputation value, and current reputation value. The weight of each component is dynamically adjusted based on the system's operating status and needs. For example, when the system is under high load, the weight of the current reputation value can be appropriately increased to prioritize nodes with good recent performance in participating in consensus. This multi-stage reputation evaluation strategy can both incentivize nodes to actively participate and effectively reduce the impact of malicious nodes, thereby improving the overall stability and security of the system.
[0131] The overall reputation score is calculated as follows:
[0132] R(n)=α*Base(n)+β*Hist(n)+γ*Curr(n)
[0133] Where α, β, and γ represent the weights of the basic reputation value, historical reputation value, and current reputation value in the overall reputation, respectively, and satisfy α+β+γ=1.
[0134] After smoothing the overall reputation score, the target reputation score is obtained.
[0135] In some embodiments, smoothing the overall reputation value to obtain the target reputation value includes: smoothing the overall reputation value using the following formula: R′(i)=(1-r)·ln(1+R(i))+r·R(i), where R′(i) is the target reputation value of the i-th node, R(i) is the overall reputation value of the i-th node, and r is a predetermined adjustment parameter.
[0136] In this embodiment, considering the inconsistent dimensions of reputation in different dimensions under this multidimensional reputation calculation method, the reputation score of a node may fluctuate significantly, necessitating a smooth mapping of the overall reputation score. Directly using linear mapping would lead to overly extreme allocation, potentially overloading some high-reputation nodes while leaving low-reputation nodes with almost no load. To address this issue, we employ a smoothing adjustment model that combines logarithmic smoothing and linear growth mechanisms. While preserving the differences in node reputation, it moderately compresses the reputation value to obtain the smoothed target reputation value. The adjustment parameter r∈[0,1] controls the weights of smoothing and linear mapping. When r=0, the model uses logarithmic smoothing entirely, favoring a more balanced distribution; when r=1, the model uses linear mapping entirely, favoring a more prominent emphasis on reputation differences between nodes. By selecting an appropriate node parameter r, the balance between smoothness and discriminative power can be flexibly adjusted, ensuring the accuracy of node performance and reliability measurements.
[0137] Compared to traditional static reputation mechanisms, this dynamic reputation model demonstrates significant advantages in adaptability and effectiveness. In dynamic network environments, the model accurately reflects the comprehensive reliability of nodes through a hierarchical weighted evaluation of basic reputation, historical reputation, and current reputation, thereby reducing the negative impact of malicious node behavior or performance fluctuations on the system. Furthermore, by incorporating incentive and penalty mechanisms, the model effectively improves node resource contributions and overall system performance, providing an efficient and robust consensus mechanism for self-organizing networks.
[0138] In some embodiments, determining the next event node based on the event transition probability matrix and the random number includes: searching in the event transition probability matrix for multiple probability parameters corresponding to the event node as the node initiating the event transition; sorting the multiple probability parameters according to a predetermined probability storage order to obtain a first sequence; for each probability parameter, adding the probability parameter to all probability parameters located before it in the first sequence to obtain a probability comparison value; sorting all probability comparison values and the random number in ascending order to obtain a second sequence; determining the sorting sequence number corresponding to the random number in the second sequence as a target sequence number; searching in the first sequence for the target probability parameter corresponding to the target sequence number; and determining the node receiving the event transition corresponding to the target probability parameter as the next event node.
[0139] In this embodiment, by searching for multiple probability parameters corresponding to an event node as the initiator of an event transition in the event transition probability matrix, the probability of an event node transitioning to other nodes can be obtained. These multiple probability parameters are sorted according to a predetermined probability storage order to obtain a first sequence. The probability parameters in the first sequence are accumulated, and for each probability parameter, it is added to all probability parameters preceding it in the first sequence to obtain a probability comparison value. All probability comparison values are sorted with a random number in ascending order to obtain a second sequence. The sorting index of the random number in the second sequence is determined as the target index. The target probability parameter corresponding to the target index is searched in the first sequence. The node receiving the event transition corresponding to the target probability parameter is determined as the next event node. Monte Carlo propagation is used to accurately determine the next event node.
[0140] For example, in the probability transition matrix is With event node N1 and a comparison value of 0.35, the first sequence is (0.05, 0.18, 0.26, 0.12, 0.22, 0.17), with probability comparison values of: c1 = 0.05, c2 = 0.05 + 0.18 = 0.23, c3 = 0.23 + 0.26 = 0.49, c4 = 0.49 + 0.12 = 0.61, c5 = 0.61 + 0.22 = 0.83, c6 = 1.0. The second sequence is (0.05, 0.23, 0.35, 0.4, 0.61, 0.83, 1.0), with a target sequence number of 3. The target probability parameter corresponding to the target sequence number is found to be 0.26 in the first sequence. The node N3 corresponding to the target probability parameter is then selected as the next event node.
[0141] The event transition probability matrix P represents the probability distribution of each node sending an event to other nodes. Based on the Monte Carlo method, a geometric probability model is constructed by mathematically modeling the probability distribution of sent events. According to the formula (where p... Si It is the probability of sending an event from node S to node i, which comes from matrix P. We can know a t It is a random sample value, according to a t The range of values can be used to determine the target node for sending events.
[0142]
[0143] ...
[0144]
[0145] Compared to the traditional Gossip random propagation strategy, the probability-based consensus event selection propagation strategy uses reputation value to construct a target probability distribution, guiding the selection of event propagation paths. This transforms event propagation from random and blind to reputation-based precise propagation, effectively reducing communication redundancy and propagation delay, and ensuring that the strategy can achieve efficient consensus in low-throughput and narrow-bandwidth environments.
[0146] In another embodiment provided in this application, based on the aforementioned challenges, this application proposes a dynamic evaluation mechanism for node reputation and a directional propagation strategy based on the Monte Carlo method, building upon the existing asynchronous consensus concept of hash graphs. This addresses the problems of low efficiency, bottlenecks, and high error rates in traditional consensus algorithms under environments with weak connections, narrow bandwidth, and frequent node online / offline cycles. A hash graph model is used to record the event order and dependencies between nodes. Compared to traditional methods that require strict synchronization, hash graphs can perform asynchronous Gossip-style propagation between nodes, greatly reducing the dependence on synchronous clocks and stable connections, and adapting to frequent topology changes. A dynamic reputation evaluation model is introduced, comprehensively considering indicators such as computing power, stability, response time, and error rate, and updating node reputation scores in real time. When a node selects an event propagation target, a Markov chain is constructed based on the node reputation distribution, and probability sampling is performed. The higher the reputation score, the greater the probability of the node being selected; however, a certain probability is reserved for other nodes to prevent over-concentration on a few nodes, thereby maintaining optimal consensus efficiency and network fault tolerance in environments with weak connections and high latency.
[0147] The following example scenario demonstrates how the hash graph asynchronous consensus architecture, dynamic multidimensional reputation evaluation method, and probability-based event selection propagation strategy proposed in this application can be used in self-organizing networks to accelerate consensus speed and improve throughput. The example details the data construction and calculation process, including: calculation of the node's base reputation value, historical reputation value, and current reputation value; smooth mapping of the target reputation; Laplace smoothing of the target probability distribution; and the construction of the event transition probability matrix and the final Monte Carlo process for event propagation.
[0148] 1. Scene and Node Settings
[0149] In a cross-border data monitoring system, monitoring devices are distributed across different cities, forming a distributed monitoring network via ad hoc networking technology. However, the available bandwidth of each device node fluctuates dynamically due to changes in the environment and load. To simulate this complex environment, the ad hoc network is configured with six nodes {N1, N2, N3, N4, N5, N6}. These nodes may be located in different locations and have varying computing power, bandwidth, and online duration. To demonstrate the advantages of this application in handling situations with "significant differences in node reputation" and "some nodes may be offline or have extremely weak connections," a node with an extremely low reputation (e.g., N6 may be offline for extended periods) and significant differences between the other nodes are intentionally included.
[0150] Referring to the evaluation criteria given in this application (with a maximum score of 10 and a minimum score of 1):
[0151] 1. Remaining computing power S c The larger the value, the stronger the computing power.
[0152] 2. Network bandwidth N b A higher value indicates better bandwidth.
[0153] 3. Node security N s The higher the value, the safer it is.
[0154] 4. Response delay R t A higher value indicates a smaller delay.
[0155] These four metrics are assigned certain weights {W1, W2, W3, W4} in the basic reputation score. In this example, let W1 = 0.25, W2 = 0.25, W3 = 0.3, W4 = 0.2. Table 1 shows the basic reputation scores for the six nodes:
[0156] Table 1 Scoring Table for Basic Credit (Note: This is a table of scores for basic creditworthiness.)
[0157]
[0158]
[0159] The calculation is performed using a node-based dynamic multidimensional reputation assessment method:
[0160] According to the basic reputation formula:
[0161]
[0162] Among them, S j The initial values of node n on the j-th performance data point (see Sc, Nb, Ns, Rt in the table above), W 1jThis is the first predetermined coefficient for the j-th performance data. Taking N1 as an example, Base(N1) = (S c ×W1)+(N b ×W2)+(Ns×W3)+(R t ×W4)=8×0.25+7×0.25+6×0.3+8×0.2=2+1.75+1.8+1.6=7.15
[0163] Similarly, the basic reputation of the remaining nodes can be calculated, and the results are shown in Table 2:
[0164] Table 2: Calculation of Basic Reputation Value for Each Node
[0165] node Base(n) calculation result <![CDATA[N1]]> 2+1.75+1.8+1.6 7.15 <![CDATA[N2]]> 1.5+2.25+2.1+1.4 7.25 <![CDATA[N3]]> 2.25+2.25+2.7+1.8 9.0 <![CDATA[N4]]> 1.0+1.25+1.8+1.0 5.05 <![CDATA[N5]]> 1.75+2.0+1.5+1.2 6.45 <![CDATA[N6]]> 0.5+0.5+0.6+0.4 2.0
[0166] Hist(n):
[0167] Assume the system has recorded feedback on each node's performance over a period of time (e.g., recent propagation rounds), and that reliability weighting and time decay have been applied. This section only illustrates a simplified calculation process (ignoring detailed breakdowns of strip comparison and time decay) to represent positive feedback from some nodes, moderate feedback from most nodes, and N6 having almost no positive feedback or a large amount of negative feedback. Let the weighted historical reputation value aggregated for each node be:
[0168] Hist(N1) = 5.2
[0169] Hist(N2) = 5.5
[0170] Hist(N3) = 8.1
[0171] Hist(N4) = 4.0
[0172] Hist(N5) = 5.0
[0173] Hist(N6) = 1.0
[0174] Current reputation Curr(n):
[0175] To reflect the node's operational status over a recent period (such as the current round or the previous two rounds), Sc, Nb, Ns, and Rt can be dynamically measured again. For example, as shown in Table 3:
[0176] Table 3: Current Credit Rating Table
[0177]
[0178]
[0179] The current reputation is calculated in the same way as the base reputation, except that it is replaced with recent measurements; the weights remain {0.25,,0.25,,0.3,,0.2}. For example, the current reputation of N1:
[0180] Curr(N1)=8.5×0.25+6.5×0.25+6.0×0.3+8.0×0.2
[0181] = 2.125 + 1.625 + 1.8 + 1.6
[0182] =7.15
[0183] Similarly, the calculations are shown in Table 4 below:
[0184] Table 4. Current Reputation Value Calculation Table for Each Node
[0185] node Curr(n) calculation result <![CDATA[N1]]> 2.125+1.625+1.8+1.6 7.15 <![CDATA[N2]]> 1.375+2.125+2.1+1.3 6.9 <![CDATA[N3]]> 2.2+2.25+2.7+1.8 8.95 <![CDATA[N4]]> 1.125+1.25+1.65+0.9 4.925 <![CDATA[N5]]> 1.75+2.0+1.65+1.2 6.6 <![CDATA[N6]]> 0.375+0.5+0.6+0.4 1.875
[0186] Target reputation R′(n):
[0187] According to the weighted formula of overall reputation R(n):
[0188] R(n)=α·Base(n)+β·Hist(n)+γ·Curr(n),
[0189] The requirement is that α + β + γ = 1. In this example, let α = 0.3, β = 0.4, and γ = 0.3.
[0190] Taking N1 as an example: R(N1)=0.3·Base(N1)+0.4·Hist(N1)+0.3·Curr(N1)=0.3×7.15+0.4×5.2+0.3×7.15=2.145+2.08+2.145=6.37.
[0191] As shown in Table 5:
[0192] Table 5. Calculation of Overall Reputation Value for Each Node
[0193]
[0194]
[0195] As can be seen from the table above, N3 has the highest reputation, while N6 has the lowest. The remaining nodes N1, N2, and N5 are in the upper-middle range, while N4 is slightly lower.
[0196] To avoid excessive load due to large differences between high-reputation and low-reputation nodes, a combination of logarithmic smoothing and linear mapping is proposed for the overall reputation value R(n):
[0197] R'(n)=(1-r)·ln(1+R(n))+r·R(n)
[0198] Where r∈[0,1] controls the smoothing strength. If r=0, logarithmic smoothing is used completely; if r=1, linear smoothing is used completely. In this example, r=0.5 is used, which preserves the differences to a certain extent while avoiding excessive polarization.
[0199] Taking N3 as an example: R′(N3)=0.5×ln(1+8.625)+0.5×8.625=0.5×ln(9.625)+0.5×8.625=1.1335+4.3125=5.446.
[0200] As shown in Table 6, the smoothed reputation R′(n) of the 6 nodes is calculated similarly:
[0201] Table 6 Calculation of Target Reputation Value for Each Node
[0202]
[0203] As can be seen, after smoothing, the value of N3 decreased to approximately 5.446, while N6 was correspondingly adjusted from 1.5625 to 1.25125, resulting in a relatively smaller difference between nodes. (Without smoothing, the reputation difference between N3 and N6 is 8.625 - 1.5625 = 7.0625; while with smoothing, the difference becomes 5.446 - 1.25125 = 4.19475, showing that the degree of polarization is significantly suppressed.)
[0204] Employs a probability-based consensus event selection and propagation strategy.
[0205] Adaptive Laplace smoothing for calculating target distribution
[0206] To achieve load balancing in subsequent Gossip propagation, the target probability distribution π needs to be obtained based on the reputation value (here, the smoothed T′(n)). target And add an adaptive Laplacian smoothing factor δ to it. i This is to avoid nodes with low reputation having a "0% probability" of failure.
[0207] First, calculate the adaptive smoothing amount:
[0208]
[0209] in
[0210] Calculate the smoothing factor δ for each node by taking ∈ = 0.05 (which can be adjusted according to network size and actual needs). i :
[0211] For example, N6
[0212] As shown in Table 7, the calculations for the remaining nodes are similar:
[0213] Table 7 Target Reputation Value for Each Node
[0214] node R′(n) <![CDATA[δ i ]]> <![CDATA[N1]]> 4.1845 ≈0.043 <![CDATA[N2]]> 4.2255 ≈0.0428 <![CDATA[N3]]> 5.446 ≈0.0319 <![CDATA[N4]]> 3.15625 ≈0.0547 <![CDATA[N5]]> 3.923 ≈0.0471 <![CDATA[N6]]> 1.25125 ≈0.14215
[0215] Then calculate the target probability distribution value π. target,i
[0216]
[0217] As shown in Table 8:
[0218] Table 8 Target probability distribution values for each node
[0219]
[0220] As can be seen, although N6 has a very low reputation, it still obtains a target probability of about 6.18% (not 0). This means that even if N6 is offline, the load can be gradually transferred to other nodes. Once N6 is back online, this probability distribution can also allow it to participate in event processing to a certain extent.
[0221] Markov chain transition matrix construction
[0222] According to the patent, it is necessary to obtain the target distribution π. target Starting from this point, we construct a transition matrix P that satisfies the detailed stationarity conditions. In a practical system, we might first randomly generate an "initial" transition matrix Q, and then correct it to P = U·Q by introducing a matrix U, satisfying the following:
[0223]
[0224] Here, π is... target Using itself as a row reference, a random jump matrix is constructed row by row. For example, in each node row, a small probability (e.g., 0.05) is reserved for "itself", and other nodes are jumped by π. target The remaining weight distribution is 0.95. For example, for row N1:
[0225] p 1,1 =0.05
[0226]
[0227] Normalization can make the sum of the entire row equal to 1, and also ensures that π is equal to 1. target This is a relatively probable trend. After further symmetry processing, a detailed and stable P can be obtained. This process can be completed in the implementation using an iterative algorithm.
[0228]
[0229] Monte Carlo method for selective propagation
[0230] During the Gossip process, if a node S is preparing to propagate an event to the next hop, then according to row S of the transition matrix P, the following steps are performed:
[0231] 1. Generate a uniformly distributed random number a t ∈(0,1).
[0232] 2. Order Find the one that satisfies c k-1 t ≤c k Once we know k, we can determine that the next hop is node k.
[0233] For example: If the current node is N1, and its corresponding row is (0.05, 0.18, 0.26, 0.12, 0.22, 0.17), sum them up:
[0234] c1 = 0.05,
[0235] c² = 0.05 + 0.18 = 0.23
[0236] c3 = 0.23 + 0.26 = 0.49
[0237] c4 = 0.49 + 0.12 = 0.61,
[0238] c5 = 0.61 + 0.22 = 0.83
[0239] c6 = 1.0
[0240] If a t =0.35, then c2 = 0.23 < 0.35 ≤ c3 = 0.49, so the next jump is N3.
[0241] After repeating Gossip multiple times, the system randomly distributes events to each node. If a node is offline, it will not receive the event. However, if it reconnects after a period of time, the above strategy will still give it a certain probability of receiving the event, thus gradually converging to a network consensus state synchronized with the hash graph.
[0242] N6 has a very low reputation, and although its target probability is only about 0.0618, it is not zero. When N6 occasionally comes online or the network recovers briefly, it still has a chance to receive events. The hash map will synchronize its state to maintain the integrity of the overall network. If it remains offline for too long, its reputation will be even lower, and it will be allocated less load, ensuring that other nodes do not waste too many resources on invalid transmissions. Furthermore, tests showed a reduction in the number of rounds required for the entire network to reach consensus. What was originally 15 rounds of propagation to get 90% of nodes to reach consensus on an event was reduced to only 9-10 rounds after the improvement. Because the load is dynamically balanced, network bottlenecks are reduced; and high-reputation nodes can quickly process and relay events, allowing more consensus events to be processed in the same amount of time, thus increasing overall throughput. In tests, throughput (the number of consensus events that can be completed per unit of time) was increased by 20%-30% compared to the purely random Gossip scheme.
[0243] It should be noted that the method in this embodiment can be executed by a single device, such as a computer or server. The method can also be applied in a distributed scenario, where multiple devices cooperate to complete the task. In such a distributed scenario, one of these devices may execute only one or more steps of the method in this embodiment, and the multiple devices will interact with each other to complete the method described.
[0244] It should be noted that the above description describes some embodiments of this application. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in a different order than that shown in the above embodiments and still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require a specific or sequential order to achieve the desired result. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0245] Based on the same inventive concept, and corresponding to any of the above embodiments, this application also provides an event consensus device for asynchronous nodes.
[0246] refer to Figure 5 The asynchronous node event consensus device is applied to a communication system, which includes multiple nodes with communication relationships. The device includes:
[0247] The receiving module 10 is configured to treat each of at least one starting node that receives an event among a plurality of nodes as an event node, and the plurality of nodes as the target node corresponding to each event node.
[0248] Consensus operation module 20 is configured to perform at least one round of consensus operation based on the event, so that each of the plurality of nodes receives the event;
[0249] The consensus operation module 20 is further configured to perform the following in each round of consensus operation: For each event node, in response to determining that there is a node among the target nodes corresponding to the event node that has not received the event, obtain the performance data of the target node in the current round; based on the performance data, determine the next event node to receive the event, and send the event from the event node to the next event node; update the performance data based on the event; for the event node, take the target node after removing the next event node as the target node corresponding to the event node in the next round of consensus operation, and use the target node after removing the next event node to update the performance data. The data is filtered, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation; for the next event node, the plurality of nodes are used as the target node corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are used as the performance data of the target node corresponding to the next event node in the next round of consensus operation; each event node in the current round and the next event node determined by each event node are used together as all event nodes in the next round of consensus operation; in response to determining that there is no node among the target nodes corresponding to the event node that has not received the event, at least one round of consensus operation is exited.
[0250] Using the aforementioned apparatus, each of the at least one starting node among multiple nodes that receives an event is designated as an event node, and the multiple nodes are designated as target nodes corresponding to each event node. Based on the event, at least one round of consensus operations is performed to ensure that each of the multiple nodes receives the event. By performing at least one round of consensus operations, data consistency among nodes is achieved. Each round of consensus operations is performed as follows: For each event node, in response to determining that there is a target node among the target nodes corresponding to the event node that has not received the event, the performance data of the target node in the current round is obtained. Based on the performance data, the next event node to receive the event is determined, and the event is sent from the event node to the next event node. By using the performance data of the current round, events can be preferentially sent to the next event node with relatively strong event processing capabilities, achieving the purpose of precise event scheduling. At the same time, the possibility of generating a large number of redundant events is reduced, thereby improving the consensus efficiency among nodes. Based on the event, the performance data is updated. By updating the performance data, the real-time nature and accuracy of the performance data are ensured. For the aforementioned event node, the target node after removing the next event node is used as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is used as the performance data of the target node corresponding to the event node in the next round of consensus operation. This achieves the purpose of dynamically updating the data for the next round of consensus operation, ensuring the accuracy of the data participating in the next round of consensus operation. For the next event node, multiple nodes are used as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to these multiple nodes is used as the performance data of the target node corresponding to the next event node in the next round of consensus operation. This achieves the purpose of dynamically determining the data for the next round of consensus operation, ensuring the accuracy of the data participating in the next round of consensus operation. Each event node in the current round and the next event node determined by each event node are collectively used as all event nodes in the next round of consensus operation. In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, at least one round of consensus operation is exited, improving the efficiency of completing the consensus operation and thus improving the consensus efficiency between nodes.
[0251] In some embodiments, the consensus operation module 20 is further configured to, for each of the target nodes, determine a target reputation value corresponding to the node based on the performance data; determine a target probability distribution value corresponding to the node based on the target reputation value; determine an event transition probability matrix corresponding to the target node based on all target probability distribution values; generate a random number belonging to a predetermined range; and determine the next event node based on the event transition probability matrix and the random number.
[0252] In some embodiments, the consensus operation module 20 is further configured to determine the target probability distribution value using the following formula: Where, π target,i Let R'(i) be the target probability distribution value of the i-th node, and R′(i) be the target reputation value of the i-th node. i δ is the adaptive smoothing amount for the i-th node. j R'(n) is the adaptive smoothing value for the j-th node, and R'(n) is the sum of the target reputation values of the n target nodes.
[0253] In some embodiments, the consensus operation module 20 is further configured to construct an initial event transition probability matrix that satisfies a predetermined probability storage order based on the target node; and to modify the initial event transition probability matrix using a predetermined summation matrix and all target probability distribution values to obtain the event transition probability matrix.
[0254] In some embodiments, the consensus operation module 20 is further configured to determine the basic reputation value, current reputation value, and historical reputation value of the node based on the performance data; to perform a weighted summation of the basic reputation value, the current reputation value, and the historical reputation value to obtain an overall reputation value; and to perform a smoothing process on the overall reputation value to obtain the target reputation value.
[0255] In some embodiments, the consensus operation module 20 is further configured to smooth the overall reputation value using the following formula: R′(i)=(1-r)·ln(1+R(i))+r·R(i), where R′(i) is the target reputation value of the i-th node, R(i) is the overall reputation value of the i-th node, and r is a predetermined adjustment parameter.
[0256] In some embodiments, the consensus operation module 20 is further configured to: search in the event transition probability matrix for multiple probability parameters corresponding to the event node as the node initiating the event transition; sort the multiple probability parameters according to a predetermined probability storage order to obtain a first sequence; for each probability parameter, add the probability parameter to all probability parameters located before it in the first sequence to obtain a probability comparison value; sort all probability comparison values and the random number in ascending order to obtain a second sequence; determine the sorting sequence number corresponding to the random number in the second sequence as a target sequence number; search in the first sequence for the target probability parameter corresponding to the target sequence number; and determine the node receiving the event transition corresponding to the target probability parameter as the next event node.
[0257] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, in implementing this application, the functions of each module can be implemented in one or more software and / or hardware.
[0258] The apparatus of the above embodiments is used to implement the event consensus method of the corresponding asynchronous node in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0259] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the event consensus method of asynchronous nodes as described in any of the above embodiments.
[0260] Figure 6 This embodiment illustrates a more specific hardware structure of an electronic device, which may include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, memory 1020, input / output interface 1030, and communication interface 1040 are interconnected internally via the bus 1050.
[0261] The processor 1010 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this specification.
[0262] The memory 1020 can be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory), static storage device, dynamic storage device, etc. The memory 1020 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program code is stored in the memory 1020 and is called and executed by the processor 1010.
[0263] The input / output interface 1030 is used to connect input / output modules to realize information input and output. Input / output modules can be configured as components within the device (not shown in the figure) or externally connected to the device to provide corresponding functions. Input devices may include keyboards, mice, touchscreens, microphones, various sensors, etc., while output devices may include displays, speakers, vibrators, indicator lights, etc.
[0264] The communication interface 1040 is used to connect a communication module (not shown in the figure) to enable communication between this device and other devices. The communication module can communicate via wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.).
[0265] Bus 1050 includes a pathway for transmitting information between various components of the device, such as processor 1010, memory 1020, input / output interface 1030, and communication interface 1040.
[0266] It should be noted that although the above-described device only shows the processor 1010, memory 1020, input / output interface 1030, communication interface 1040, and bus 1050, in specific implementations, the device may also include other components necessary for normal operation. Furthermore, those skilled in the art will understand that the above-described device may only include the components necessary for implementing the embodiments of this specification, and not necessarily all the components shown in the figures.
[0267] The electronic devices described above are used to implement the event consensus method of the corresponding asynchronous node in any of the foregoing embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0268] Based on the same inventive concept, corresponding to the methods of any of the above embodiments, this application also provides a non-transitory computer-readable storage medium that stores computer instructions for causing the computer to execute the event consensus method of asynchronous nodes as described in any of the above embodiments.
[0269] The computer-readable medium of this embodiment includes permanent and non-permanent, removable and non-removable media, and information storage can be implemented by any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transfer medium that can be used to store information accessible by a computing device.
[0270] The computer instructions stored in the storage medium of the above embodiments are used to cause the computer to execute the event consensus method of the asynchronous node as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0271] Based on the same concept, corresponding to the methods of any of the above embodiments, this application also provides a computer program product, including computer program instructions, which, when run on a computer, cause the computer to execute the event consensus method of asynchronous nodes as described in any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which will not be repeated here.
[0272] It should be noted that the embodiments of this application can also be further described in the following ways:
[0273] It is understood that before using the technical solutions of the various embodiments in this disclosure, users will be informed of the type, scope of use, and usage scenarios of the personal information involved in an appropriate manner, and user authorization will be obtained.
[0274] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations of this disclosed technical solution.
[0275] As an optional but not limited implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0276] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0277] Those skilled in the art should understand that the discussion of any of the above embodiments is merely exemplary and is not intended to imply that the scope of this application is limited to these examples; under the concept of this application, the technical features of the above embodiments or different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of this application as described above, which are not provided in detail for the sake of brevity.
[0278] Additionally, to simplify the description and discussion, and to avoid obscuring the embodiments of this application, the well-known power / ground connections to integrated circuit (IC) chips and other components may or may not be shown in the provided drawings. Furthermore, the apparatus may be shown in block diagram form to avoid obscuring the embodiments of this application, and this also takes into account the fact that the details of the implementation of these block diagram apparatuses are highly dependent on the platform on which the embodiments of this application will be implemented (i.e., these details should be fully understood by those skilled in the art). While specific details (e.g., circuits) have been set forth to describe exemplary embodiments of this application, it will be apparent to those skilled in the art that the embodiments of this application can be implemented without these specific details or with variations thereof. Therefore, these descriptions should be considered illustrative rather than restrictive.
[0279] Although this application has been described in conjunction with specific embodiments thereof, many substitutions, modifications, and variations of these embodiments will be apparent to those skilled in the art from the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may be used with the embodiments discussed.
[0280] The embodiments of this application are intended to cover all such substitutions, modifications, and variations that fall within the broad scope of this application. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the embodiments of this application should be included within the protection scope of this application.
Claims
1. An event consensus method for asynchronous nodes, characterized in that, Applied to a communication system, the communication system comprising multiple nodes having a communication relationship, the method includes: Each of the at least one starting node that receives the event among the multiple nodes is taken as the event node, and the multiple nodes are taken as the target node corresponding to each event node; Based on the event, at least one round of consensus operations is performed to ensure that each of the plurality of nodes receives the event; Each round of consensus operations is executed as follows: For each event node, in response to determining that there is a node among the target nodes corresponding to the event node that has not received the event, the performance data of the target node in the current round is obtained; Based on the performance data, determine the next event node to receive the event, and send the event from the event node to the next event node; Based on the event, the performance data is updated; For the event node, the target node after removing the next event node is taken as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is taken as the performance data of the target node corresponding to the event node in the next round of consensus operation. For the next event node, the plurality of nodes are taken as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are taken as the performance data of the target nodes corresponding to the next event node in the next round of consensus operation; Each event node in the current round and the next event node determined by each event node are collectively used as all event nodes in the next round of consensus operation; In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, exit at least one round of consensus operation.
2. The method according to claim 1, characterized in that, Determining the next event node to receive the event based on the performance data includes: For each of the target nodes, a target reputation value is determined based on the performance data. Based on the target reputation value, determine the target probability distribution value corresponding to the node; Based on all target probability distribution values, determine the event transition probability matrix corresponding to the target node; Generate a random number within a predetermined range, and determine the next event node based on the event transition probability matrix and the random number.
3. The method according to claim 2, characterized in that, The step of determining the target probability distribution value corresponding to the node based on the target reputation value includes: The target probability distribution value is determined using the following formula: Where, π target,i Let R'(i) be the target probability distribution value of the i-th node, and R′(i) be the target reputation value of the i-th node. i δ is the adaptive smoothing amount for the i-th node. j R'(n) is the adaptive smoothing value for the j-th node, and R'(n) is the sum of the target reputation values of the n target nodes.
4. The method according to claim 2, characterized in that, The step of determining the event transition probability matrix corresponding to the target node based on the total target probability distribution values includes: Based on the target node, an initial event transition probability matrix is constructed that satisfies a predetermined probability storage order; The initial event transition probability matrix is corrected using a predetermined summation matrix and all target probability distribution values to obtain the event transition probability matrix.
5. The method according to claim 2, characterized in that, The process of determining the target reputation value corresponding to the node based on the performance data includes: Based on the performance data, the node's basic reputation value, current reputation value, and historical reputation value are determined. The overall reputation value is obtained by weighted summing of the base reputation value, the current reputation value, and the historical reputation value. The overall reputation value is smoothed to obtain the target reputation value.
6. The method according to claim 5, characterized in that, The process of smoothing the overall reputation value to obtain the target reputation value includes: The overall reputation value is smoothed using the following formula: R′(i)=(1-r)·ln(1+R(i))+r·R(i), Where R′(i) is the target reputation value of the i-th node, R(i) is the overall reputation value of the i-th node, and r is a predetermined adjustment parameter.
7. The method according to claim 2, characterized in that, The step of determining the next event node based on the event transition probability matrix and the random number includes: Search the event transition probability matrix for multiple probability parameters corresponding to the event node that initiates the event transition; The plurality of probability parameters are sorted according to a predetermined probability storage order to obtain a first sequence; For each probability parameter, the probability parameter is added to all probability parameters that precede it in the first sequence to obtain a probability comparison value; All probability comparison values are sorted with the random number in ascending order to obtain a second sequence, and the sorting number corresponding to the random number in the second sequence is determined as the target sequence number. Search for the target probability parameter corresponding to the target index in the first sequence; The node corresponding to the target probability parameter that receives the event transfer is determined as the next event node.
8. An event consensus device for asynchronous nodes, characterized in that, Applied to a communication system, the communication system comprising multiple nodes having a communication relationship, the device includes: The receiving module is configured to treat each of at least one starting node that receives an event from a plurality of nodes as an event node, and the plurality of nodes as the target node corresponding to each event node. A consensus operation module is configured to perform at least one round of consensus operation based on the event, so that each of the plurality of nodes receives the event; The consensus operation module is also configured to perform the following in each round of consensus operations: For each event node, in response to determining that there is a node among the target nodes corresponding to the event node that has not received the event, the performance data of the target node in the current round is obtained; Based on the performance data, determine the next event node to receive the event, and send the event from the event node to the next event node; Based on the event, the performance data is updated; For the event node, the target node after removing the next event node is taken as the target node corresponding to the event node in the next round of consensus operation. The updated performance data is filtered using the target node after removing the next event node, and the filtered performance data is taken as the performance data of the target node corresponding to the event node in the next round of consensus operation. For the next event node, the plurality of nodes are taken as the target nodes corresponding to the next event node in the next round of consensus operation, and the performance data corresponding to the plurality of nodes are taken as the performance data of the target nodes corresponding to the next event node in the next round of consensus operation; Each event node in the current round and the next event node determined by each event node are collectively used as all event nodes in the next round of consensus operation; In response to determining that there are no nodes among the target nodes corresponding to the event node that have not received the event, exit at least one round of consensus operation.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.
10. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method described in any one of claims 1 to 7.
Citation Information
Patent Citations
Asynchronous Byzantine consensus method and system based on DAG
CN113923217A
Consensus method based on dynamic selection of consensus nodes and storage medium
CN118764156A