Method and apparatus for updating routing table

By maintaining a set of candidate nodes with communication quality higher than a preset standard in a distributed network and updating the routing table in a timely manner, the problem of unstable communication quality of routing nodes in existing technologies is solved, and efficient and stable communication is achieved.

CN116566878BActive Publication Date: 2026-05-29ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
Filing Date
2023-04-28
Publication Date
2026-05-29

AI Technical Summary

Technical Problem

Existing technologies cannot guarantee the quality of communication between routing nodes in a timely manner when generating and updating routing tables in distributed networks, resulting in low communication efficiency and instability.

Method used

By continuously monitoring network communication quality, a candidate node set is maintained, which includes nodes with communication quality higher than a preset standard. When necessary, the routing table is updated according to a preset strategy, and replacement routing nodes are directly selected from the candidate node set.

Benefits of technology

It achieves efficient communication and stable communication quality between routing nodes, avoiding resource waste and communication quality fluctuations caused by frequently checking all nodes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116566878B_ABST
    Figure CN116566878B_ABST
Patent Text Reader

Abstract

The one or more embodiments of the specification provide a routing table updating method and device. The method is applied to a target node in a distributed network, and includes: continuously performing a set generation step, including: determining a candidate node set from each node in the distributed network based on network communication quality between the target node and each node, wherein the network communication quality of the candidate node set with the target node is higher than a preset standard; and performing a routing table updating step when any current routing node in a routing table corresponding to the target node meets a routing node updating condition, including: selecting a candidate node for replacing the any current routing node from the candidate node set according to a preset routing node updating strategy, to update the routing table corresponding to the target node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to one or more embodiments in the field of communication technology, and in particular to a routing table update method and apparatus. Background Technology

[0002] In distributed networks such as peer-to-peer (P2P) networks, each node relies on a routing table to communicate with other nodes in the network. The quality of communication between the nodes contained in the routing table directly determines the overall communication quality of the distributed network.

[0003] Therefore, in distributed networks, how to generate high-quality routing tables to ensure network communication quality has long been a major concern in the field of network communication. Summary of the Invention

[0004] In view of the above, one or more embodiments of this specification provide a routing table update method and apparatus.

[0005] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:

[0006] According to a first aspect of one or more embodiments of this specification, a routing table update method is proposed, applied to a target node in a distributed network, comprising:

[0007] The set generation step is continuously executed, including: determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from the nodes based on the network communication quality between the target node and each node in the distributed network;

[0008] If any current routing node in the routing table corresponding to the target node satisfies the routing node update condition, a routing table update step is performed, including: selecting a candidate node from the candidate node set to replace any current routing node according to a preset routing node update strategy, so as to update the routing table corresponding to the target node.

[0009] According to a second aspect of one or more embodiments of this specification, a routing table update apparatus is provided, applied to a target node in a distributed network, comprising a set generation unit and a node update unit; wherein, the set generation unit is configured to continuously execute a set generation step; the node update unit is configured to execute a routing table update step when any current routing node in the routing table corresponding to the target node satisfies a routing node update condition; wherein...

[0010] The set generation step includes: determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from the nodes based on the network communication quality between the target node and each node in the distributed network;

[0011] The node update step includes: selecting a candidate node from the candidate node set to replace any current routing node according to a preset routing node update strategy, so as to update the routing table corresponding to the target node.

[0012] According to a third aspect of one or more embodiments of this specification, an electronic device is provided, comprising:

[0013] processor;

[0014] Memory used to store processor-executable instructions;

[0015] The processor implements the method as described in the first aspect by running the executable instructions.

[0016] According to a fourth aspect of one or more embodiments of this specification, a computer-readable storage medium is provided that stores computer instructions thereon, which, when executed by a processor, implement the steps of the method as described in the first aspect. Attached Figure Description

[0017] Figure 1 This is a flowchart of a routing table update method provided in an exemplary embodiment.

[0018] Figure 2 This is a flowchart of a routing table generation method provided in an exemplary embodiment.

[0019] Figure 3 This is a schematic diagram of the structure of a device provided in an exemplary embodiment.

[0020] Figure 4 This is a block diagram of a routing table update apparatus provided in an exemplary embodiment. Detailed Implementation

[0021] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numerals in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0022] It should be noted that the steps of the corresponding methods are not necessarily performed in the order shown and described in this specification in other embodiments. In some other embodiments, the methods may include more or fewer steps than described in this specification. Furthermore, a single step described in this specification may be broken down into multiple steps in other embodiments; and multiple steps described in this specification may be combined into a single step in other embodiments.

[0023] In a distributed network, a routing table records information about forwarding nodes that can be used for message forwarding; these nodes are called routing nodes. During message forwarding, each node in the distributed network relies on the routing table for message forwarding. Therefore, the quality of the routing table, or rather, the communication quality between the routing nodes in the routing table, determines the communication quality of message sending between nodes in the distributed network.

[0024] Therefore, in the field of communications, a certain number of nodes with relatively high communication quality are usually selected from all the nodes in a distributed network to serve as routing nodes, thereby forming the routing table of the distributed network.

[0025] In related technologies, each node in a distributed network selects nodes with relatively high communication quality from all other nodes to serve as its routing nodes, thereby generating its own routing table. In actual execution, each time a routing table is generated or updated, it is necessary to check and filter the network communication quality between itself and other nodes in the distributed network.

[0026] It should be understood that the communication quality between the same nodes fluctuates, requiring timely updates to the routing table to ensure the communication quality between the nodes in the routing table. However, because the related technologies need to detect and compare a large number of nodes, they consume a considerable amount of time and processing resources to detect the communication quality between a node itself and other nodes, making it impossible to update the routing table in a timely manner. Consequently, it is impossible to guarantee that the communication between the routing nodes in the routing table is efficient and stable.

[0027] In addition, the relevant technology only filters routing nodes from all nodes in the network and performs routing table generation or update operations under specific circumstances, such as at specific intervals or when the communication quality of some routing nodes in the current routing table is detected to be poor. As a result, the communication quality between routing nodes cannot be guaranteed in this process, further proving that the relevant technology cannot guarantee that the communication between routing nodes in the routing table is efficient and stable.

[0028] In view of this, this specification proposes a routing table update method that can update the routing table in a timely manner to ensure that the communication quality between the routing nodes contained in the generated routing table is efficient and stable.

[0029] In this method, the target node in the distributed network can continuously determine a set of candidate nodes whose network communication quality with the target node is higher than a preset standard, based on the acquired network communication quality between itself and other nodes in the distributed network. Based on this, it can further determine whether the routing nodes in the routing table need to be updated according to preset routing node update conditions. If the update condition is met, a candidate node is selected from the candidate node set to replace the current routing node that meets the routing node update condition, according to a preset routing node update strategy, thereby updating the routing table corresponding to the target node.

[0030] It should be understood that, in updating the routing table of the target node, this specification does not directly update the routing table based on the obtained network communication quality. Instead, it continuously maintains a set of candidate nodes with relatively good communication quality, filtered based on the obtained network communication quality. This allows for the direct selection of candidate nodes from this set when the routing table needs updating, thus enabling timely updates. Since the candidate node set contains nodes with communication quality exceeding a preset standard, the routing table updated based on this candidate node cluster ensures high communication quality between the new routing nodes and the target node. Therefore, the routing table update method described in this specification guarantees both efficient communication between routing nodes and stable communication quality.

[0031] Figure 1 This is a flowchart illustrating a routing table update method as an exemplary embodiment of this specification. The method is applied to a target node in a distributed network and includes:

[0032] The set generation step 102 is continuously executed, including: based on the network communication quality between the target node and each node in the distributed network, determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from each node;

[0033] In this specification, the step of obtaining network communication quality can be referred to as the quality acquisition step. The target node in this specification can continuously execute the quality acquisition step to continuously update the candidate node set, thereby ensuring that the candidate nodes maintained in the candidate node set are always nodes whose network communication quality is higher than the preset standard.

[0034] In this specification, the network communication quality between a target node and other nodes can be obtained by sending communication quality probe signals. For example, a target node can send communication quality probe signals to each node in a distributed network that is distinct from itself to obtain the network communication quality between the target node and each node individually.

[0035] In this specification, since not all nodes in the distributed network are communicable, a connection attempt can be made first with nodes in the network to determine if communication is possible. If so, a communication quality probe signal is then sent. For example, the target node can first obtain node information of the distributed network and, based on the obtained node information, send connection requests to all nodes in the distributed network to obtain response messages from at least a portion of the nodes in response to the received connection requests. If a response message is received, it proves that the corresponding node can communicate with the target node. Therefore, a communication quality probe signal can be further sent to the identified at least a portion of the nodes to obtain the network communication quality between these at least a portion of the nodes and the target node. It should be understood that this method can avoid sending communication quality probe signals to nodes that cannot communicate, thereby reducing power consumption.

[0036] In this specification, in addition to prioritizing the sending of connection requests to determine whether nodes can communicate, thereby reducing the number of communication quality probe signals that need to be sent, communication quality probe signals can also be sent in batches to a subset of nodes in the distributed network that are distinct from the target node, thus avoiding the need to send communication quality probe signals to a large number of nodes.

[0037] Since each loop only sends probe signals to a subset of nodes, a single loop can only acquire the network communication quality of that subset of nodes. However, because the number of routing nodes in a single node's routing table is not on the same order of magnitude as the number of nodes in the distributed network, acquiring the network communication quality of only a subset of nodes is usually sufficient for constructing the routing table. Furthermore, this specification does not determine the candidate node set solely based on the network communication quality acquired in a single loop; it can also determine the candidate node set from the corresponding nodes based on the network communication quality acquired in multiple loops. This specification does not impose any restrictions on this approach.

[0038] For example, this specification may limit the number of nodes in each cycle's corresponding batch, and in each cycle, determine the nodes in the distributed network that match this number, then send communication quality probe signals to the determined nodes to obtain the network communication quality of these nodes. Of course, this example is merely illustrative; how to specifically determine the nodes included in each cycle's corresponding batch can be determined by those skilled in the art based on actual circumstances, and this specification does not impose any limitations on this.

[0039] In this specification, when using a batch-based cyclic transmission method for communication quality probe signals, the target node can send communication quality probe signals to nodes that are not entirely the same in two adjacent cycles. In other words, in two adjacent cycles, the nodes receiving the communication quality probe signals from the target node are not entirely the same. For example, the target node can send communication quality probe signals to two completely different batches of nodes in two adjacent cycles; or, in two adjacent cycles, the target node can send communication quality probe signals to the nodes included in the replaced batch in the later cycle, replacing a small number of nodes in the batch corresponding to the previous cycle. Of course, this example is only illustrative, and the specific method of batch-based cyclic transmission of quality probe signals can be determined by those skilled in the art according to actual needs, and this specification does not impose any restrictions on it.

[0040] In this specification, to ensure the accuracy of the network communication quality obtained between the target node and any other node in the distributed network that is different from the target node, multiple communication quality probe signals can be sent to that node to obtain multiple network communication quality data for that node. Based on this, the multiple network communication quality data can be integrated and calculated using a preset algorithm to obtain the long-term network communication quality between the target node and that other node. It should be understood that, since this long-term network communication quality is obtained by integrating multiple network communication quality data, it can guarantee that it can characterize the relatively stable communication quality between the target node and that other node over a certain period of time.

[0041] In this specification, the aforementioned long-term network communication quality can be calculated in various ways. For example, calculation weights can be assigned to each transmitted communication quality probe signal, and based on the calculation weights of each communication quality probe signal, a weighted calculation can be performed on the multiple network communication quality values ​​obtained, thereby obtaining the long-term network communication quality between the target node and any of the nodes. Of course, this example is merely illustrative, and how to specifically calculate the long-term network communication quality can be determined by those skilled in the art according to actual needs; this specification does not impose any limitations on this.

[0042] In this specification, to ensure the accuracy of the network communication quality between the target node and any node in the distributed network that is different from the target node, the target node can also continuously send communication quality detection signals to any node in the distributed network that is different from the target node to obtain the network communication quality between the target node and any node at different times. Based on this, the historical network communication quality between the target node and any node can be updated based on the continuously obtained network communication quality to obtain the updated network communication quality.

[0043] It should be understood that this method can continuously update the network communication quality between the target node and any other node during the continuous detection process. This is equivalent to continuously correcting the historical network communication quality based on the latest obtained network communication quality, which can improve the accuracy of the obtained network communication quality.

[0044] When continuously sending communication quality probe signals, a smoothing accumulation algorithm can be used to update the network communication quality. In other words, the target node can perform a smoothing accumulation calculation on the historical network communication quality between the target node and any other node based on the continuously acquired network communication quality, to obtain the updated network communication quality. This specification does not restrict whether, after the updated network communication quality has smoothed out, sending network quality probe signals continues to update the network communication quality, or it stops sending network quality probe signals after the updated network communication quality has smoothed out.

[0045] By continuously sending communication quality probe signals, the candidate node set can be continuously updated. For example, after obtaining the updated network communication quality of each node, high-quality nodes with network communication quality higher than a preset standard are identified from among the nodes, and the candidate node set determined based on historical network communication quality is updated accordingly. In this way, it can be ensured that the candidate nodes included in the candidate node set are nodes with relatively high communication quality among all nodes in the distributed network at any given time, thereby guaranteeing the communication quality of the routing nodes selected based on the candidate node set.

[0046] When continuously sending communication quality probe signals, the historical network communication quality between the target node and any node can be updated based on the network communication quality obtained from any one of the probe signals, resulting in the updated network communication quality. Alternatively, multiple network communication quality values ​​can be obtained from multiple probe signals, and then the historical network communication quality between the target node and any node can be updated based on these multiple values. Of course, this example is merely illustrative; the specific method for updating network communication quality during continuous probes can be determined by those skilled in the art based on actual needs, and this specification does not impose any limitations on this.

[0047] If any current routing node in the routing table corresponding to the target node satisfies the routing node update condition, the routing table update step 104 is executed, including: selecting a candidate node from the candidate node set to replace any current routing node according to a preset routing node update strategy, so as to update the routing table corresponding to the target node.

[0048] In addition to updating the maintained routing table, this specification may also include the operation of generating a routing table, which may be referred to as the routing table generation step. For example, when a new node joins the distributed network, a routing table needs to be generated for that new node; similarly, when the routing table maintained by a node is lost, a new routing table needs to be generated for that node.

[0049] In this specification, different routing node filtering strategies can be preset to select routing nodes that constitute the routing table from the candidate node set.

[0050] In one embodiment, all candidate nodes in the candidate node set can be divided into multiple communication quality levels. Based on routing selection criteria set for each communication quality level, a subset of nodes are selected from the candidate nodes of the corresponding communication quality level to form a routing table corresponding to the target node. For example, according to a preset level standard, all nodes in the candidate node set can be divided into three communication quality levels: "low," "medium," and "high." If the preset screening strategy specifies selecting three nodes from each of the three levels as routing nodes, then three nodes can be selected from multiple nodes in each of the "low," "medium," and "high" communication quality levels, resulting in a total of nine nodes forming the routing table corresponding to the target node. Of course, this example is merely illustrative. The specific method of dividing the levels and selecting routing nodes from each level can be determined by those skilled in the art based on actual circumstances, and this specification does not impose any limitations on this.

[0051] In another embodiment, the preset routing node filtering strategy can be an optimal filtering strategy. In other words, multiple nodes with the best network communication quality from the candidate node set can be identified as routing nodes to construct a routing table corresponding to the target node. For example, the routing node filtering strategy can include a preset number of nodes to be identified as routing nodes from the candidate node set with the preset number of nodes having the best network communication quality.

[0052] Of course, the above examples are merely illustrative. The specific method for setting the routing node filtering strategy to determine the routing nodes used to build the routing table from the candidate node set can be determined by those skilled in the art according to actual needs, and this specification does not impose any restrictions on it.

[0053] In this manual, different routing node update conditions can be set to perform routing table update operations at different times.

[0054] In one embodiment, a routing table update step can be performed if the network communication quality of any currently routing node recorded in the routing table is poor. For example, a communication quality standard specifically for selecting routing nodes can be set for the routing table. Based on this, a routing table update step can be performed when the network communication quality between any routing node in the routing table and the target node is lower than the communication quality standard. In other words, the routing node update condition can be: the network communication quality between any currently routing node and the target node is lower than the communication quality standard set for the routing table.

[0055] In another embodiment, the routing table can also be updated when there are candidate nodes with better communication quality than the current routing node. For example, a preset difference can be set to measure whether there are candidate nodes with significantly better network communication quality than the current routing node. When there are candidate nodes in the candidate node cluster with better network communication quality than any current routing node, and the difference in network communication quality between the two is greater than the preset difference, the routing table update step is performed. Alternatively, the network communication quality of candidate nodes and the current routing node can be sorted to select a preset number of nodes with the best network communication quality as candidate nodes. In other words, the routing node update condition can be: the current routing node recorded in the routing table does not reach a preset ranking in the network communication quality ranking.

[0056] Of course, the above examples are merely illustrative. The specific settings for the routing node update conditions can be determined by those skilled in the art based on the actual situation, and this specification does not impose any restrictions on this.

[0057] In this specification, the routing table of a single node is often insufficient for determining forwarding paths. Therefore, this specification can also generate a global routing table corresponding to the distributed network. For example, after generating its own routing table, the target node can share this routing table with other nodes in the distributed network. These other nodes can then construct a global routing table for the distributed network based on the routing tables corresponding to each node in the network. Similarly, other nodes in the distributed network can also generate their own routing tables and share them throughout the network. Based on this, the target node can receive multiple routing tables corresponding to each node in the distributed network and construct a global routing table for the distributed network based on its own routing table and the received routing tables. After generating the global routing table, each node in the distributed network can forward messages based on it.

[0058] It is worth noting that the technical solutions in this specification can be applied to any type of distributed network, such as a P2P (Peer-to-Peer) network, a blockchain network, etc. The specific type of distributed network to which the technical solutions in this specification are applied can be determined by those skilled in the art based on actual needs, and this specification does not impose any restrictions on this.

[0059] In the case of a distributed network that is a blockchain network, the blockchain network can be deployed based on the traditional architecture of blockchain technology, in which all nodes in the blockchain network are formed by deploying blockchain code on corresponding physical devices. In most cases, each node corresponds to a physical device. Alternatively, the blockchain network can be deployed based on the BaaS (Blockchain as a Service) architecture in blockchain technology, in which all nodes in the blockchain network are formed by deploying blockchain code on virtual machines implemented in the cloud through cloud services. Blockchain nodes do not need to correspond to corresponding physical devices one by one.

[0060] As can be seen from the above technical solution, the routing table update method of this specification includes a continuous execution set generation step, so that the node always maintains a set of candidate nodes with network communication quality better than the preset standard; on this basis, when any routing node recorded in the routing table meets the routing node update condition, the routing table update step is executed to select a candidate node from the candidate node set to replace any routing node.

[0061] It should be understood that because this specification continuously maintains a set of candidate nodes with relatively high network communication quality, when a target node needs to update the routing nodes in its routing table, it can directly select a node from the candidate node set to replace the routing nodes in the routing table in real time. This ensures the communication quality between the routing nodes in the routing table, that is, it ensures that the communication between the routing nodes in the routing table is efficient and stable. This avoids the situation in related technologies where the routing table is directly generated based on the network communication quality of all nodes in the network, which leads to the routing nodes in the routing table being unable to guarantee consistently good communication quality.

[0062] The following section uses the example of generating the routing table for node 1 in the blockchain network to introduce the technical solution in this manual.

[0063] Figure 2 This is a flowchart illustrating a routing table generation method as an exemplary embodiment of this specification. The method is applied to node 1 in a blockchain network, such as... Figure 2 As shown, the method may include the following steps:

[0064] Step 201: Obtain global node information of the blockchain network.

[0065] In this embodiment, the blockchain network can maintain node information for all its constituent nodes, which can be referred to as global node information. Based on this, any node, such as node 1, can obtain this global node information when it needs to generate a routing table.

[0066] Step 202: Send connection requests to all nodes in the blockchain network based on the obtained global node information.

[0067] In this embodiment, since not all nodes in the blockchain network can be connected, after obtaining the global node information, a connection request can be sent to all nodes in the blockchain network based on the global node information to filter out the connectable nodes in the blockchain network that can be connected to node 1, which will serve as the connectable layer of node 1.

[0068] Step 203: Based on the connection response returned in response to the issued connection request, select connectable layers from the global nodes.

[0069] In this embodiment, if any node returns a connection response to the connection request sent by node 1, it proves that node 1 can connect to that node and that node can be added to the connectable layer.

[0070] For example, suppose a blockchain network contains 1,000 nodes, and 800 of them are identified as connectable nodes based on the way connection requests are sent. These 800 nodes can then be used as the connectable layer for node 1.

[0071] Step 204: Continuously send communication quality detection signals to the connectable nodes contained in the connectable layer.

[0072] In this embodiment, after determining the connectable layer of node 1, the network latency between node 1 and each connectable node can be calculated based on the response messages returned by each connectable node by sending communication quality detection signals to the connectable nodes in the connectable layer, and used as a parameter to characterize the network communication quality.

[0073] Step 205: Calculate the network latency between node 1 and each connectable node based on the response messages returned by each connectable node in response to the received communication quality probe signal.

[0074] Following the above example, this embodiment can use a smoothing cumulative algorithm to calculate the network latency between node 1 and any connectable node. For example, the smoothing cumulative algorithm for network latency can be as follows:

[0075] SRTT=SRTT'*α+SRTT”*(1–α)

[0076] In this algorithm, SRTT' is the historical delay obtained by smoothing and accumulating previously sent communication quality probe signals, while SRTT" is the delay obtained by smoothing and accumulating the most recently sent communication quality probe signal. α is the weight value of the historical delay, and SRTT is the current delay obtained after smoothing and accumulating. Of course, this example is only illustrative, and how to obtain network communication quality can be determined by those skilled in the art according to actual needs. This embodiment does not impose any limitations on this.

[0077] Step 206: Select candidate node layers with network latency lower than the preset latency from the connectable layers.

[0078] Continuing with the example above, assuming the preset latency for filtering candidate nodes is 100ms, and among the network latencies of 800 connectable nodes, there are 50 connectable nodes with network latencies below 100ms, then these 50 connectable nodes can be included as candidate nodes in the candidate node layer.

[0079] It is worth noting that Node 1 continuously sends communication quality detection signals to each connectable node to continuously update the nodes in the candidate node layer, thereby ensuring that the candidate nodes in the candidate node layer are always nodes with better communication quality with Node 1.

[0080] In addition, it should be emphasized that the selection of candidate nodes based on preset latency is merely illustrative. The specific conditions for selecting candidate nodes can be set by those skilled in the art according to actual needs, and this embodiment does not impose any limitations on this. For example, a preset number can also be set to determine the preset number of connectable nodes with the lowest network latency as the candidate node layer.

[0081] Step 207: Select multiple routing nodes from the candidate node layer based on the preset node filtering strategy to construct the routing table of node 1.

[0082] Continuing with the example above, Node 1 can divide the candidate node layer into three latency levels: the first level has a latency range of 0–33 ms, the second level has a latency range of 34–66 ms, and the third level has a latency range of 67–100 ms. Assuming the preset node selection strategy is to randomly select three candidate nodes from each latency level to serve as routing nodes in the routing table, then based on this strategy, nine routing nodes can be selected from the candidate node layer to form the routing table.

[0083] It is important to emphasize that although this embodiment only describes the operation of selecting routing nodes from the candidate node layer to construct the routing table, the routing table can also be updated based on the candidate node layer after it is generated. For example, if a forwarding failure occurs when forwarding based on any routing node in the routing table, a new routing node can be selected from the candidate nodes to ensure that the communication quality of the routing nodes in the routing table is always good.

[0084] It should also be emphasized that although this embodiment performs each operation step by step, it does not mean that the above multiple steps are performed sequentially. Among them, the generation or update operation of the candidate node layer is continuously executed. In other words, steps 204 to 206 are continuously executed, while the update operation of the routing table is performed based on preset routing node update conditions.

[0085] As can be seen from the above technical solution, since this specification prioritizes the selection of nodes with relatively high communication quality as candidate nodes when generating the routing table of any node, any node in this specification only needs to select some nodes from the candidate nodes as routing nodes when generating the routing table. Moreover, when the communication quality of the routing nodes in the routing table is poor, candidate nodes to replace the nodes with poor communication quality can be obtained from the candidate node layer at any time, thus ensuring the stability of the communication quality of the maintained routing table.

[0086] Figure 3 This is a schematic structural diagram of a device provided in an exemplary embodiment. Please refer to... Figure 3 At the hardware level, the device includes a processor 302, an internal bus 304, a network interface 306, memory 308, and non-volatile memory 310, and may also include other hardware required for business operations. One or more embodiments of this specification can be implemented in software, such as the processor 302 reading the corresponding computer program from the non-volatile memory 310 into memory 308 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of hardware and software, etc. That is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0087] Please refer to Figure 4 The routing table update device can be applied to, for example, Figure 3 The device shown implements the technical solution of this specification. The routing table update device is applied to a target node in a distributed network and includes a set generation unit 401 and a node update unit 402. The set generation unit 401 continuously executes a set generation step; the node update unit 402 executes a routing table update step when any current routing node in the routing table corresponding to the target node satisfies the routing node update condition.

[0088] The set generation step includes: determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from the nodes based on the network communication quality between the target node and each node in the distributed network;

[0089] The node filtering step includes: selecting multiple routing nodes from the candidate node set according to a preset routing node filtering strategy, so as to construct a routing table corresponding to the target node.

[0090] Optionally, it also includes: a quality acquisition unit 403 for continuously performing the quality acquisition steps;

[0091] The quality acquisition step includes: sending communication quality detection signals to each node in the distributed network that is different from the target node, in order to obtain the network communication quality between the target node and each of the nodes respectively.

[0092] Optionally, the quality acquisition unit 403 is also used for:

[0093] Obtain node information of the distributed network, and send connection requests to all nodes in the distributed network based on the obtained node information, so as to obtain response messages returned by at least a portion of the nodes in response to the received connection requests.

[0094] A communication quality detection signal is sent to at least a portion of the nodes to obtain the network communication quality between the at least a portion of the nodes and the target node.

[0095] Optionally, the quality acquisition unit 403 is also used for:

[0096] In a batch and cyclical manner, communication quality detection signals are sent to a subset of nodes in the distributed network that are distinct from the target node, in order to obtain the network communication quality between the target node and the subset of nodes.

[0097] Optionally, in two adjacent cycles, the nodes that receive the communication quality probe signal may not be exactly the same.

[0098] Optionally, the quality acquisition unit 403 is also used for:

[0099] Multiple communication quality detection signals are sent to any node in the distributed network that is different from the target node, in order to obtain multiple network communication qualities between the target node and any node.

[0100] The multiple network communication qualities are integrated and calculated based on a preset algorithm to obtain the long-term network communication quality between the target node and any of the nodes.

[0101] Optionally, the quality acquisition unit 403 is also used for:

[0102] Assign computational weights to each of the transmitted communication quality probe signals;

[0103] Based on the calculated weights of each communication quality detection signal, the multiple network communication qualities are weighted and calculated to obtain the long-term network communication quality between the target node and any of the nodes.

[0104] Optionally, the quality acquisition unit 403 is also used for:

[0105] Continuously send communication quality detection signals to any node in the distributed network that is different from the target node, in order to obtain the network communication quality between the target node and any node at different times;

[0106] Based on the continuously acquired network communication quality, the historical network communication quality between the target node and any of the nodes is updated to obtain the updated network communication quality.

[0107] Optionally, the set generation unit 401 is further used for:

[0108] Based on the updated network communication quality of each node, high-quality nodes with network communication quality higher than a preset standard with the target node are identified, so as to update the candidate node set determined based on historical network communication quality.

[0109] Optionally, the quality acquisition unit 403 is also used for:

[0110] Based on the continuously acquired network communication quality, the historical network communication quality between the target node and any of the nodes is smoothly accumulated to obtain the updated network communication quality.

[0111] Optionally, the quality acquisition unit 403 is also used for:

[0112] If the network communication quality is obtained based on any communication quality detection signal, the historical network communication quality between the target node and any node is updated based on the network communication quality to obtain the updated network communication quality.

[0113] Optionally, node update unit 402 is also used for:

[0114] The candidate node set is divided into multiple communication quality levels;

[0115] According to the routing selection criteria set for each communication quality level, a subset of nodes are selected from the candidate nodes of the corresponding communication quality level to form a routing table corresponding to the target node.

[0116] Optionally, node update unit 402 is also used for:

[0117] The routing table corresponding to the target node is shared with other nodes in the distributed network, so that the other nodes can construct a global routing table for the distributed network based on the routing tables corresponding to each node in the distributed network; and / or,

[0118] Receive multiple routing tables corresponding to each node in the distributed network, and construct a global routing table for the distributed network based on the routing table corresponding to the target node and the received routing tables.

[0119] Optionally, the routing node update conditions include at least one of the following:

[0120] The network communication quality between any current routing node and the target node is lower than the communication quality standard set for the routing table.

[0121] The candidate node set contains candidate nodes whose network communication quality is better than any of the current routing nodes, and the difference in network communication quality between the two is greater than a preset difference.

[0122] Optionally, the distributed network is a blockchain network.

[0123] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which can take the form of a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email sending and receiving device, game console, tablet computer, wearable device, or any combination of these devices.

[0124] In a typical configuration, a computer includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0125] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0126] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, 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, disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0127] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0128] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0129] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to limit the scope of one or more embodiments of this specification. The singular forms “a,” “described,” and “the” used in one or more embodiments of this specification and in the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used herein refers to and includes any or all possible combinations of one or more associated listed items.

[0130] It should be understood that although the terms first, second, third, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first information may also be referred to as second information without departing from the scope of one or more embodiments of this specification, and similarly, second information may also be referred to as first information. Depending on the context, the word "if" as used herein may be interpreted as "when," "in response to a determination," or "when," or "in the event of a determination."

[0131] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit the scope of one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of one or more embodiments of this specification should be included within the protection scope of one or more embodiments of this specification.

Claims

1. A routing table update method, applied to a target node in a distributed network, comprising: The set generation step is continuously executed, including: based on the network communication quality between the target node and each node in the distributed network, determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from the nodes, and maintaining the set of candidate nodes; The routing table generation steps include: dividing all candidate nodes in the candidate node set into multiple communication quality levels; selecting some nodes from the candidate nodes of the corresponding communication quality level according to the routing selection criteria set for each communication quality level, so as to form a routing table corresponding to the target node; If any current routing node in the routing table corresponding to the target node satisfies the routing node update condition, the routing table update step is executed, including: selecting a candidate node from the candidate node set to replace any current routing node according to a preset routing node update strategy, so as to update the routing table corresponding to the target node. The node update strategy is used to obtain candidate nodes from the candidate node set to replace nodes with poor communication quality, so as to maintain the communication quality stability of the routing table.

2. The method according to claim 1, further comprising: Continuously perform the quality acquisition steps; The quality acquisition step includes: sending communication quality detection signals to each node in the distributed network that is different from the target node, in order to obtain the network communication quality between the target node and each of the nodes respectively.

3. The method according to claim 2, The quality acquisition step further includes: Obtain node information of the distributed network, and send connection requests to all nodes in the distributed network based on the obtained node information, so as to obtain response messages returned by at least a portion of the nodes in response to the received connection requests. Sending communication quality detection signals to each node in the distributed network that is distinct from the target node to obtain the network communication quality between the target node and each node respectively includes: sending communication quality detection signals to at least a portion of the nodes to obtain the network communication quality between the at least a portion of the nodes and the target node.

4. The method according to claim 2, wherein sending communication quality detection signals to each node in the distributed network that is distinct from the target node comprises: In a batch and cyclical manner, communication quality detection signals are sent to a subset of nodes in the distributed network that are distinct from the target node, in order to obtain the network communication quality between the target node and the subset of nodes.

5. The method according to claim 4, wherein in two adjacent cycles, some nodes receiving the communication quality detection signal are not completely identical.

6. The method according to claim 2, wherein a communication quality detection signal is sent to any node in the distributed network that is distinct from the target node to obtain the network communication quality between the target node and the any node, comprising: Multiple communication quality detection signals are sent to any node in the distributed network that is different from the target node, in order to obtain multiple network communication qualities between the target node and any node. The multiple network communication qualities are integrated and calculated based on a preset algorithm to obtain the long-term network communication quality between the target node and any of the nodes.

7. The method according to claim 6, wherein the step of integrating and calculating the quality of the plurality of network communications based on a preset algorithm includes: Assign computational weights to each of the transmitted communication quality probe signals; Based on the calculated weights of each communication quality detection signal, the multiple network communication qualities are weighted and calculated to obtain the long-term network communication quality between the target node and any of the nodes.

8. The method according to claim 2, wherein a communication quality detection signal is sent to any node in the distributed network that is distinct from the target node to obtain the network communication quality between the target node and the any node, comprising: Continuously send communication quality detection signals to any node in the distributed network that is different from the target node, in order to obtain the network communication quality between the target node and any node at different times; Based on the continuously acquired network communication quality, the historical network communication quality between the target node and any of the nodes is updated to obtain the updated network communication quality.

9. The method according to claim 8, wherein determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from the nodes based on the acquired network communication quality includes: Based on the updated network communication quality of each node, high-quality nodes with network communication quality higher than a preset standard with the target node are identified, so as to update the candidate node set determined based on historical network communication quality.

10. The method according to claim 8, wherein updating the historical network communication quality between the target node and any of the nodes based on continuously acquired network communication quality comprises: Based on the continuously acquired network communication quality, the historical network communication quality between the target node and any of the nodes is smoothly accumulated to obtain the updated network communication quality.

11. The method according to claim 8, wherein updating the historical network communication quality between the target node and any of the nodes based on continuously acquired network communication quality comprises: If the network communication quality is obtained based on any communication quality detection signal, the historical network communication quality between the target node and any node is updated based on the network communication quality to obtain the updated network communication quality.

12. The method according to claim 1, further comprising: The routing table corresponding to the target node is shared with other nodes in the distributed network, so that the other nodes can construct a global routing table for the distributed network based on the routing tables corresponding to each node in the distributed network; and / or, Receive multiple routing tables corresponding to each node in the distributed network, and construct a global routing table for the distributed network based on the routing table corresponding to the target node and the received routing tables.

13. The method of claim 1, wherein the routing node update conditions include at least one of the following: The network communication quality between any current routing node and the target node is lower than the communication quality standard set for the routing table. The candidate node set contains candidate nodes whose network communication quality is better than any of the current routing nodes, and the difference in network communication quality between the two is greater than a preset difference.

14. The method according to claim 1, wherein the distributed network is a blockchain network.

15. A routing table update device, applied to a target node in a distributed network, comprising a set generation unit and a node update unit; wherein, The set generation unit is used to continuously execute the set generation step; the node update unit is used to execute the routing table generation step, and to execute the routing table update step when any current routing node in the routing table corresponding to the target node meets the routing node update condition. The set generation step includes: determining a set of candidate nodes whose network communication quality with the target node is higher than a preset standard from among the nodes based on the network communication quality between the target node and each node in the distributed network, and maintaining the set of candidate nodes; The routing table generation step includes: dividing all candidate nodes in the candidate node set into multiple communication quality levels; selecting some nodes from the candidate nodes of the corresponding communication quality level according to the routing selection criteria set for each communication quality level, so as to form a routing table corresponding to the target node; The routing table update step includes: selecting a candidate node from the candidate node set to replace any current routing node according to a preset routing node update strategy, so as to update the routing table corresponding to the target node; The node update strategy is used to obtain candidate nodes from the candidate node set to replace nodes with poor communication quality, so as to maintain the communication quality stability of the routing table.

16. An electronic device comprising: processor; Memory used to store processor-executable instructions; The processor implements the method as described in any one of claims 1-14 by executing the executable instructions.

17. A computer-readable storage medium having stored thereon computer instructions that, when executed by a processor, implement the steps of the method as claimed in any one of claims 1-14.