Method and apparatus for updating routing table, storage medium and electronic device
Patent Information
- Application Number
- CN202211349587.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2042-10-31
AI Technical Summary
[0005]本申请实施例提供了一种路由表的更新方法和装置、存储介质及电子装置,以至少解决相关技术中,路由表的更新检测复杂且容易阻塞网络等问题
[0017] In this embodiment, a routing table is configured for a target device in a wireless ad hoc network. The routing table includes routing table entries, each entry indicating the address combination and effective field for data transmission by the target device. The effective field includes an effective result and an effective time. The update mechanism of the routing table is determined based on the target status of the effective field. This technical solution solves the problems of complex routing table update detection and network congestion. In this embodiment, by configuring a corresponding routing table for the wireless ad hoc network and setting corresponding effective fields in the routing table entries, the effective status of different routing table entries is determined. Finally, the appropriate update mechanism for the corresponding routing table is determined based on the effective status. This improves the efficiency of routing table updates, reduces the number of routing table maintenance operations, lowers data traffic consumption, and ensures smooth network operation during data transmission in the wireless ad hoc network.
Smart Images

Figure CN115734306B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of smart home technology, and more specifically, to a method and apparatus for updating a routing table, a storage medium, and an electronic device. Background Technology
[0002] For routing technology in wireless ad hoc networks, the network structure is very unstable, and any node in the network may enter, leave, move, or even shut down at any time; therefore, it is necessary to maintain the routing information within the network during use.
[0003] In related technologies, one approach is to establish and maintain routing information in the network as soon as it is established. Although this can clearly guide the data's destination during transmission, maintaining a set of routing information in such an unstable network is very costly (almost all nodes that may participate in data transmission need to participate in routing maintenance, and frequent device status reporting / detection is also required). Furthermore, balancing real-time performance and overhead is difficult. Another approach is to perform a route detection mechanism for the destination node only during data transmission. While this avoids the need to maintain a network-wide routing information in real time, and nodes not participating in the current data transmission do not need to participate in route detection, each data transmission requires waiting for the route detection result before actual transmission, which obviously leads to extremely high latency for each transmission. In addition, if route detection is required for every transmission, the overhead of route detection itself is considerable, and it may also cause traffic spikes and network congestion.
[0004] There is still no effective solution to the problems of complex routing table update detection and network congestion in related technologies. Summary of the Invention
[0005] This application provides a method, apparatus, storage medium, and electronic device for updating a routing table, to at least solve the problems in the related art, such as the complexity of routing table update detection and its tendency to block the network.
[0006] According to one embodiment of this application, a routing table update method is provided, comprising: configuring a routing table for a target device in a wireless ad hoc network, wherein the routing table includes: routing table entries, and the routing table entries are used to indicate the address combination and effective field for data transmission by the target device, the effective field including: effective result and effective time; and determining the update mechanism of the routing table according to the target status of the effective field.
[0007] In an exemplary embodiment, determining the update mechanism of the routing table based on the target status of the effective field corresponding to the routing table entry includes: updating the routing table based on the routing information corresponding to the data packets forwarded by the target device when the effective field is in a valid state; or updating the routing table based on the routing information reported by other devices, wherein the target device and other devices are in the same wireless ad hoc network.
[0008] In an exemplary embodiment, determining the update mechanism of the routing table based on the target state of the effective field corresponding to the routing table entry further includes: when the effective field is in a valid state, updating the effective time corresponding to the effective field with a valid target state based on the query result of the routing table; when the effective field is in an invalid state and the target device needs to transmit data to the next-hop address corresponding to the routing table entry, updating the effective result corresponding to the effective field with an invalid target state based on the query result of the routing table.
[0009] In an exemplary embodiment, updating the effective result corresponding to the effective field of the target state being in an invalid state according to the query result of the routing table includes: sending a first routing query request to the next-hop address; wherein the first routing query request carries a time-to-live value for indicating the number of times the first routing query request is allowed to be forwarded; adjusting the effective result corresponding to the effective field of the invalid state from invalid characters to valid characters based on the first response information corresponding to the first routing query request; and adjusting the effective time corresponding to the effective field of the invalid state to the maximum timeout duration.
[0010] In an exemplary embodiment, after sending a first routing query request to the next-hop address, the method further includes: obtaining a waiting response time after the first routing query request is sent; if the waiting response time is greater than a preset waiting time, determining that the first routing query request has not obtained the first response information corresponding to the first routing query request; and if the waiting response time is less than or equal to the preset waiting time, determining that the first routing query request has obtained the first response information corresponding to the first routing query request.
[0011] In an exemplary embodiment, after determining that the first routing query request has not obtained the first response information corresponding to the first routing query request, the method further includes: broadcasting a second routing query request in the network where the target device is located; determining a new routing table entry based on the second response information corresponding to the second routing query request; adding the new routing table entry to the routing table; setting the effective result included in the effective field of the new routing table entry to a valid character; and adjusting the effective time included in the effective field of the new routing table entry to the maximum timing duration.
[0012] In an exemplary embodiment, determining a new routing table entry based on the second response information corresponding to the second routing query request includes: when there are multiple second response information, determining the number of route reachable hops carried in the response message corresponding to each of the multiple second response information to obtain multiple route reachable hops; determining the second response information with the smallest hop count among the multiple route reachable hops as the target response information for determining the new routing table entry, and using the target next-hop address corresponding to the target response information and the node address corresponding to the target device to determine the target address combination corresponding to the new routing table entry.
[0013] In an exemplary embodiment, after determining the update mechanism of the routing table based on the target state of the effective field, the method further includes: in the case of obtaining abnormal routing information in the wireless ad hoc network, deleting the target routing table entry in the routing table corresponding to the abnormal routing information, wherein the abnormal routing information is used to indicate routing information that has been incorrectly used after network changes have occurred in the wireless ad hoc network.
[0014] According to another embodiment of the present application, a routing table update apparatus is also provided, comprising: a configuration module, configured to configure a routing table for a target device in a wireless ad hoc network, wherein the routing table includes: a routing table entry, and the routing table entry is used to indicate the address combination for data transmission by the target device and an effective field, the effective field including: an effective result and an effective time; and a determination module, configured to determine the update mechanism of the routing table based on the target status of the effective field.
[0015] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, and the computer program is configured to execute the above-described routing table update method when running.
[0016] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the above-described routing table update method through the computer program.
[0017] In this embodiment, a routing table is configured for a target device in a wireless ad hoc network. The routing table includes routing table entries, each entry indicating the address combination and effective field for data transmission by the target device. The effective field includes an effective result and an effective time. The update mechanism of the routing table is determined based on the target status of the effective field. This technical solution solves the problems of complex routing table update detection and network congestion. In this embodiment, by configuring a corresponding routing table for the wireless ad hoc network and setting corresponding effective fields in the routing table entries, the effective status of different routing table entries is determined. Finally, the appropriate update mechanism for the corresponding routing table is determined based on the effective status. This improves the efficiency of routing table updates, reduces the number of routing table maintenance operations, lowers data traffic consumption, and ensures smooth network operation during data transmission in the wireless ad hoc network. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a schematic diagram of the hardware environment for a routing table update method according to an embodiment of this application;
[0021] Figure 2 This is a flowchart of a routing table update method according to an embodiment of this application;
[0022] Figure 3 This is a schematic diagram of the routing table structure according to an optional embodiment of this application;
[0023] Figure 4 This is a schematic diagram illustrating the application of a routing table according to an optional embodiment of this application;
[0024] Figure 5 This is a schematic diagram illustrating the updating of a routing table using routing information according to an optional embodiment of this application;
[0025] Figure 6 This is a structural block diagram (a) of a routing table updating device according to an embodiment of this application;
[0026] Figure 7 This is a structural block diagram (II) of a routing table updating device according to an embodiment of this application. Detailed Implementation
[0027] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0028] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0029] According to one aspect of the embodiments of this application, a method for updating a routing table is provided. This routing table updating method is widely applicable to whole-house intelligent digital control application scenarios such as smart homes, smart home ecosystems, and intelligence house ecosystems. Optionally, in this embodiment, the above-mentioned routing table updating method can be applied to, for example... Figure 1 The hardware environment shown consists of terminal device 102 and server 104. For example... Figure 1 As shown, server 104 is connected to terminal device 102 via a network and can be used to provide services (such as application services) to the terminal or clients installed on the terminal. A database can be set up on the server or independently of the server to provide data storage services for server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data processing services for server 104.
[0030] The aforementioned network may include, but is not limited to, at least one of the following: wired network, wireless network. The aforementioned wired network may include, but is not limited to, at least one of the following: wide area network, metropolitan area network, local area network. The aforementioned wireless network may include, but is not limited to, at least one of the following: Wi-Fi (Wireless Fidelity), Bluetooth. The terminal device 102 may not be limited to PC, mobile phone, tablet computer, smart air conditioner, smart range hood, smart refrigerator, smart oven, smart stove, smart washing machine, smart water heater, smart washing equipment, smart dishwasher, smart projector, smart TV, smart clothes rack, smart curtains, smart audio-visual equipment, smart socket, smart speaker, smart speaker box, smart fresh air equipment, smart kitchen and bathroom equipment, smart bathroom equipment, smart robot vacuum cleaner, smart window cleaning robot, smart mopping robot, smart air purifier, smart steam oven, smart microwave oven, smart water heater, smart air purifier, smart water dispenser, smart door lock, etc.
[0031] This embodiment provides a method for updating a routing table, applied to the aforementioned terminal device. Figure 2 This is a flowchart of a routing table update method according to an embodiment of this application, which includes the following steps:
[0032] Step S202: Configure a routing table for the target device in the wireless ad hoc network. The routing table includes a routing table entry, and the routing table entry is used to indicate the address combination and effective field for the target device to perform data transmission. The effective field includes an effective result and an effective time.
[0033] Optionally, the above address combination includes: the node address corresponding to the current target device and the next-hop address.
[0034] It should be noted that the aforementioned target device can be one or more devices, and this embodiment of the invention does not limit this. When storing the routing table, to improve the efficiency of updating the routing table, it can be stored as a cache, i.e., the routing table is given a cache attribute. In this case, the routing table in the wireless ad hoc network protocol has an expiration time. That is, an effective field for recording the effective time and effective result is added to the routing table entries in the routing table. For example, when a new routing table entry enters the routing table, its entry time needs to be recorded. In the aforementioned routing table, the effective time is recorded as a countdown. That is, after a new routing table entry enters the routing table, if the effective result is set to a valid character, the corresponding effective time is set to the default maximum countdown duration. Each time the status of the entry is updated, the maximum countdown duration needs to be updated accordingly. If there is no change for a period of time, the routing table entry becomes invalid, and subsequent route selection can no longer rely on this routing table entry. Optionally, the effective time of the routing table entry can be set to 5 minutes, or other durations; this embodiment of the invention does not limit this.
[0035] Step S204: Determine the update mechanism of the routing table based on the target status of the effective field.
[0036] Through the above steps, a routing table is configured for the target device in the wireless ad hoc network. The routing table includes routing table entries, each entry indicating the address combination and effective field for data transmission by the target device. The effective field includes an effective result and an effective time. The update mechanism of the routing table is determined based on the target status of the effective field. This technical solution solves the problems of complex routing table update detection and network congestion. In this embodiment, by configuring a corresponding routing table for the wireless ad hoc network and setting corresponding effective fields in the routing table entries, the effective status of different routing table entries is determined. Finally, the appropriate update mechanism for the corresponding routing table is determined based on the effective status. This improves the efficiency of routing table updates, reduces the number of routing table maintenance operations, lowers data traffic consumption, and ensures smooth network operation during data transmission in the wireless ad hoc network.
[0037] As an optional implementation, the refresh mechanism in step S204 above includes: updating the routing table according to the routing information corresponding to the data packets forwarded by the target device when the effective field is in a valid state; or updating the routing table according to the routing information reported by other devices, wherein the target device and other devices are in the same wireless ad hoc network.
[0038] Optionally, the above-mentioned valid state is: the effective result included in the routing table entry is a valid character, and the effective time is not 0.
[0039] Understandably, when the effective status of a routing table entry is valid, it means that the entry can be quickly applied to data transmission. However, since the effective time field is constantly changing, when the effective time is 0, the effective status of the entry will quickly change from valid to invalid, making it unusable for data transmission. Therefore, to ensure that the routing table entries remain valid, the routing table can be updated using the routing information obtained by the target device when forwarding data packets.
[0040] Specifically, the source address information carried in the forwarded data packet is obtained. If a next-hop address corresponding to this source address exists in the current routing table, the target address combination corresponding to this next-hop address is determined, and the effective time corresponding to the effective field of this target address combination is readjusted to the maximum timeout duration. If no next-hop address corresponding to this source address exists in the current routing table, the address corresponding to this source address is used as a new next-hop address and combined with the node address corresponding to the target device to form a new address combination. The effective result included in the effective field of this new address combination is set to valid characters, and the effective time included in the effective field of this new address combination is adjusted to the maximum timeout duration. A new routing table entry is determined and added to the routing table to complete the routing table update.
[0041] Optionally, after obtaining routing information actively reported by other devices, if a routing table entry corresponding to the next-hop address exists based on the next-hop address reported by other devices, the effective time of the valid routing table entry matching the address is refreshed (i.e., the effective time is readjusted to the maximum timeout). If no routing table entry corresponding to the next-hop address exists, the next-hop address is combined with the node address corresponding to the target device to form a new address combination. The effective result in the effective field corresponding to this new address combination is set to a valid character, and the effective time in the effective field corresponding to this new address combination is adjusted to the maximum timeout. A new routing table entry is then determined and added to the routing table to complete the routing table update.
[0042] It should be noted that since devices within the same wireless ad hoc network are interconnected, when the network is not congested or is idle, routing information between different devices can be synchronized through active reporting. This synchronization of routing information is achieved before data transmission, ensuring the effective use of the routing table in the future.
[0043] In an exemplary embodiment, determining the update mechanism of the routing table based on the target state of the effective field corresponding to the routing table entry further includes: when the effective field is in a valid state, updating the effective time corresponding to the effective field with a valid target state based on the query result of the routing table; when the effective field is in an invalid state and the target device needs to transmit data to the next-hop address corresponding to the routing table entry, updating the effective result corresponding to the effective field with an invalid target state based on the query result of the routing table.
[0044] Optionally, the routing table can also be updated by initiating a route lookup. However, it's important to note that if the effective field corresponding to a routing entry in the routing table is valid, the lookup result only updates the effective time of the effective field. This ensures the effective field remains valid, allowing for quick application to data transmission when the routing entry is used. Furthermore, when the effective field corresponding to a routing entry is invalid, the route lookup requires a precondition: the lookup will only be triggered when the target device needs to transmit data to the next-hop address corresponding to the invalid routing entry, thus avoiding unnecessary route looksup.
[0045] In an exemplary embodiment, updating the effective result corresponding to the effective field of the target state being in an invalid state according to the query result of the routing table includes: sending a first routing query request to the next-hop address; wherein the first routing query request carries a time-to-live value for indicating the number of times the first routing query request is allowed to be forwarded; adjusting the effective result corresponding to the effective field of the invalid state from invalid characters to valid characters based on the first response information corresponding to the first routing query request; and adjusting the effective time corresponding to the effective field of the invalid state to the maximum timeout duration.
[0046] In simple terms, a lookup of a routing table entry is triggered only when the target device needs to transmit data to the next-hop address corresponding to the failed entry. To prevent indefinite forwarding of routing query requests, a Time-to-Live (TTL) value is added to the request. This TTL value is related to the maximum hop count of the current ad hoc network. Each time a TTL-enabled routing query request is forwarded by another device, the TTL value is decremented. When the TTL value reaches 0, forwarding of the request stops, effectively preventing routing loops. It's understandable that even if a routing table entry fails, the entry shouldn't be discarded and a new broadcast routing query performed when access to the device is needed. Instead, a unicast routing query should be performed based on the existing entry. If successful, the routing table entry is refreshed; otherwise, a broadcast routing query is performed. Finally, after obtaining the response information corresponding to the route query request, the response information is used to update the invalid route table entry. The effective result corresponding to the effective field of the invalid route table entry is changed from invalid characters to valid characters, and the effective time corresponding to the effective field is adjusted to the maximum timeout duration. In this way, the invalid route table entry can be restored to a valid route table entry in the route table.
[0047] In an exemplary embodiment, after sending a first routing query request to the next-hop address, the method further includes: obtaining a waiting response time after the first routing query request is sent; if the waiting response time is greater than a preset waiting time, determining that the first routing query request has not obtained the first response information corresponding to the first routing query request; and if the waiting response time is less than or equal to the preset waiting time, determining that the first routing query request has obtained the first response information corresponding to the first routing query request.
[0048] It is understandable that, since the first route query request is essentially a unicast request to query the next-hop address included in the route table entry in the failed state, there is a certain waiting time when sending the first route query request for the route table entry in the failed state. This is to avoid the first route query request not being able to end for a long time and to ensure the timeliness of the route query.
[0049] In an exemplary embodiment, after determining that the first routing query request has not obtained the first response information corresponding to the first routing query request, the method further includes: broadcasting a second routing query request in the network where the target device is located; determining a new routing table entry based on the second response information corresponding to the second routing query request; adding the new routing table entry to the routing table; setting the effective result included in the effective field of the new routing table entry to a valid character; and adjusting the effective time included in the effective field of the new routing table entry to the maximum timing duration.
[0050] For example, the target device should first initiate a unicast route query request (equivalent to the first route query request mentioned above) to the destination device corresponding to the next-hop address of the route table entry in the expired state of the routing table. After receiving the request, if the destination device has routing information in its own routing table, it will forward the query request; otherwise, it will discard the request. After sending the unicast route query request, the target device will wait for a period of time. If it receives a response, it will refresh its local routing information (here, the timeout of the expired entry should be directly restored), and complete the unicast route query. If it does not receive a response, the unicast route query fails and is converted to a broadcast route query. That is, when the first route query request fails, the second route query request is rebroadcast in the network where the target device is located, and the new route table entry used to update the routing table is determined according to the second response information corresponding to the second route query request.
[0051] In an exemplary embodiment, determining a new routing table entry based on the second response information corresponding to the second routing query request includes: when there are multiple second response information, determining the number of route reachable hops carried in the response message corresponding to each of the multiple second response information to obtain multiple route reachable hops; determining the second response information with the smallest hop count among the multiple route reachable hops as the target response information for determining the new routing table entry, and using the target next-hop address corresponding to the target response information and the node address corresponding to the target device to determine the target address combination corresponding to the new routing table entry.
[0052] Understandably, since the second route query request corresponds to a broadcast method, it's possible to receive second response messages from multiple other destination devices simultaneously. To improve the data transmission efficiency indicated by the routing table entry, the number of hops the route can reach should be carried in the route query response message, and an appropriate next-hop address should be selected and recorded in the target device's routing table (e.g., the minimum number of hops, the highest next-hop signal strength, etc.). In fact, the first second response message received should have high priority, at least indicating that the current data exchange time is the shortest.
[0053] In an exemplary embodiment, after determining the update mechanism of the routing table based on the target state of the effective field, the method further includes: in the case of obtaining abnormal routing information in the wireless ad hoc network, deleting the target routing table entry in the routing table corresponding to the abnormal routing information, wherein the abnormal routing information is used to indicate routing information that has been incorrectly used after network changes have occurred in the wireless ad hoc network.
[0054] To prevent the misuse of routing information due to network changes before the cache expires, the cached routing table also provides an immediate expiration mechanism. This allows other parts of the protocol to directly delete the target routing table entry corresponding to the erroneous routing information from the routing table once other parts detect incorrect routing information (e.g., a reliable transport layer detects that the destination address is unreachable), further improving the routing table's response speed to network changes.
[0055] To better understand the process of updating the routing table described above, the implementation flow of updating the routing table will be further explained below with reference to optional embodiments, but this is not intended to limit the technical solution of the embodiments of this application.
[0056] This embodiment provides a method for updating a routing table. Figure 3 This is a schematic diagram of the routing table structure according to an optional embodiment of this application, such as... Figure 3 As shown, the routing table contains multiple routing entries. Each entry consists of fields such as node address, whether it is active, effective time, and next-hop address. A refresh mechanism can also be added to these fields: optionally, the refresh mechanism can include: a refresh mechanism for route queries, a refresh mechanism for traversed data, and a refresh mechanism for device reports. It should be noted that the routing table is a core function of the network layer. In a loosely distributed multi-hop network, the main purpose of the routing table is to find the correct next-hop device based on an address, and ultimately send the data packet to the destination address through multi-hop relay. The overall design of the routing table described above is based on a local routing table with high-speed caching capabilities and a series of transmission control messages to implement the routing function of the wireless ad hoc network protocol stack.
[0057] As an optional implementation, the process for updating the routing table corresponding to the target device is as follows:
[0058] Optional, Figure 4This is an application diagram of a routing table according to an optional embodiment of this application. Assume that the routing table determined for the target device contains three routing entries. The node address and next-hop address of the first routing entry are reachable. The effective result corresponding to the effective field of the first routing entry is a valid character. The effective time corresponding to the effective field of the first routing entry is 180 seconds, indicating that the effective field of the first routing entry will become invalid after 180 seconds. The first routing entry will become an invalid entry after 180 seconds and needs to be updated before it can be used again. Optionally, the maximum allowed value for the effective time is 300 seconds. It should be noted that the maximum allowed value for the effective time can be flexibly set according to the actual usage of the routing table, and this application does not impose excessive limitations on this.
[0059] Secondly, the node address and next-hop address of the second routing table entry are reachable, the effective result corresponding to the effective field of the second routing table entry is an invalid character, and the effective time corresponding to the effective field of the second routing table entry is 0 seconds, indicating that the second routing table entry has become an invalid entry in the routing table, and the second routing table entry cannot indicate the data transmission between the target device and other devices corresponding to the next-hop address in the second routing table entry;
[0060] Secondly, if the node address and next-hop address of the third routing table entry are reachable, the effective result corresponding to the effective field of the third routing table entry is a valid character, the effective time corresponding to the effective field of the third routing table entry is 180 seconds, and there is a route query result for the next-hop address corresponding to the third routing table entry in the routing table, then the effective time corresponding to the effective field of the third routing table entry is adjusted from 180 seconds to the maximum allowed value of 300 seconds.
[0061] During the update, when the target device obtains routing information through its forwarded data packets, or receives routing information from other devices in the same wireless ad hoc network, a new routing table entry is generated based on the aforementioned routing information. For example, the fourth routing table entry can be determined based on the routing information corresponding to the data packets, and the fifth routing table entry can be determined based on the routing information sent by other devices. Furthermore, due to the newly added entries to the routing table, the effective results corresponding to the effective fields in the fourth and fifth routing table entries are both valid characters, and the effective time corresponding to the effective fields is the maximum allowed value of 300 seconds. Figure 5 This is a schematic diagram illustrating the updating of the routing table using routing information according to an optional embodiment of this application.
[0062] Optionally, since the effective field of the first routing table entry is in a valid state, the update mechanism for the first routing table entry in the routing table is to initiate a route query for the next-hop address corresponding to the first routing table entry. Based on the query result, the effective time carried in the effective field of the first routing table entry is adjusted from 180 seconds to 300 seconds. Then, by updating the effective time in the first routing table entry, the first routing table entry remains valid in the routing table, which is convenient for the target device to use during data transmission.
[0063] Optionally, since the effective field of the second routing table is invalid, the second routing table entry will be in a silent state when it is not used by the target. That is, the update mechanism for the second routing table entry will only be initiated when the target device needs to transmit data to the next-hop address corresponding to the second routing table entry. Specifically, a unicast route query (equivalent to the first route query request in this embodiment) is sent to the next-hop address in the address combination corresponding to the effective field of the invalid state. After the target device sends the unicast route query request, it waits for a period of time. If a response is received, the local routing information in the routing table is refreshed to complete the unicast route query.
[0064] Optionally, the refresh process involves: changing the effective result corresponding to the second routing table entry from invalid characters to valid characters, adjusting the effective time corresponding to the second routing table entry to the maximum timeout duration, and then changing the effective field corresponding to the second routing table entry from an invalid state to a valid state. Furthermore, if a unicast route query request sent to the second routing table entry does not receive a response after a certain waiting period, the unicast route query fails and is converted to a broadcast route query. It should be noted that the aforementioned waiting period is the timeout period allowed for direct restoration of expired entries.
[0065] Optionally, after converting to a broadcast route query (equivalent to the second route query request in this embodiment of the invention), a new route table entry will be determined based on the response information corresponding to the broadcast route query, and the new route table entry will be added to the route table to complete the route table update.
[0066] Furthermore, when multiple results exist for a broadcast routing query, the routing information that receives the first response is selected as the information for generating a new routing table entry. This is because the response has a high priority, as it indicates that the current data exchange time is the shortest, meaning the route has the shortest number of hops during transmission, thereby improving data transmission efficiency and saving data transmission time.
[0067] It should be noted that the above routing table has a high-speed cache attribute, which means that the routing table in the wireless ad hoc network protocol has an expiration time. After a routing table entry is entered into the routing table, the time of its entry into the routing table also needs to be recorded. Every time the status of the entry is updated, the time needs to be updated. If there is no change for a period of time, the entry becomes invalid, and subsequent route selection can no longer rely on the entry. It is recommended that the effective time be 5 minutes.
[0068] It is important to note that, in order to avoid unnecessary route lookups (especially broadcast route lookups, which are costly and should be minimized), the routing table should support multiple refresh mechanisms. Whenever a device can obtain routing information from another device, it should be added to the routing table or the lifetime of an existing entry should be refreshed to prevent it from becoming invalid. Routing information in the routing table can be refreshed at the following times: a) route lookup results; b) source address information carried in passing data packets; c) devices actively reporting their own information, etc.
[0069] In summary, when updating the routing table after it has been determined, the specific update mechanism is determined by considering the status of the effective fields in the routing table entries (i.e., whether the entries are valid or invalid).
[0070] Optionally, when the routing table entry is valid, the effective field is in a valid state, specifically corresponding to the address reachability in the address combination, and the effective result is a valid character; the effective time has not changed from a 5-minute countdown to 0;
[0071] When a routing table entry is invalid, the effective field will be in an invalid state, specifically corresponding to the address reachability in the address combination, and the effective result will be an invalid character; the effective time will change from a 5-minute countdown to 0.
[0072] It should be noted that the above 5 minutes is the preset maximum duration of the countdown, and this effective time value can be flexibly adjusted according to actual usage.
[0073] When a routing table entry is valid, regardless of whether it is used to indicate data transmission, the update method is as follows: a) Update via route lookup to reset the countdown corresponding to the effective time to 5 minutes; b) Add a new routing table entry corresponding to the source address information carried in the data packets passing through the target device; c) The device actively reports its own information, that is, the target device receives routing information actively uploaded by other devices, searches for the routing table entry corresponding to the routing information in the current routing table, and updates the effective time (resetting the countdown to 5 minutes). If there is no corresponding routing table entry, a new routing table entry is added to the routing table based on the routing information.
[0074] When a routing table entry is invalid, it indicates that the target device needs to transmit data to the routing address corresponding to that entry. If the invalid entry needs to be used, a route query is performed. Upon receiving the corresponding query result, the validity period of the invalid routing table entry is reset to 5 minutes, and the validity result of the invalid routing table entry is refreshed from the invalid field to the valid field.
[0075] It's important to note that routing technologies based on local routing table caching already exist, such as AODV (AdHoc On-Demand Distance Vector). However, these technologies do not employ caching in the local routing table. This means that once routing information for a node is stored in the local routing table, that information remains valid indefinitely. Consequently, if the path to that node changes, or if the node itself leaves, moves, or is even shut down, the technology cannot detect this. Therefore, such technologies typically require additional routing fault detection techniques (e.g., Hello messages in AODV). The aforementioned solution, however, uses caching. After a predetermined time, the local routing information for a node expires. Once expired, any subsequent data request to that node requires a re-update of the routing table and a refresh of the routing information. This avoids the overhead of frequent, network-wide routing information maintenance involving almost all devices, and also prevents the problem of local routing information failing to detect route changes and continuously using incorrect routing information.
[0076] Furthermore, even after local routing information becomes invalid, it is not deleted but marked as invalid. When data needs to be sent to a destination marked as invalid, this technology does not perform a normal network-wide broadcast route lookup during route refresh. Instead, it first performs a unicast route lookup based on the original invalid routing information. Generally, in most cases, the original invalid routing information should still be usable, so a single unicast route lookup is sufficient to refresh the local routing information. Only when the routing information is truly erroneous (due to intermediate or destination nodes exiting, moving, or shutting down, etc.) will a network-wide broadcast route lookup be performed. This further reduces the overhead of route refresh caused by routing failures due to caching. The mechanism of immediate invalidation of the cached routing table can further accelerate network change detection and response speed.
[0077] In summary, based on the above embodiments, a high-speed caching technology is introduced into the routing table of an on-demand routing protocol for wireless ad hoc networks. This can balance the overhead of routing information maintenance with the real-time response to network routing changes. At the same time, an immediate invalidation mechanism for the cached routing table is provided to further accelerate the response speed to network changes, reduce resource waste, and improve user satisfaction.
[0078] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0079] Figure 6 This is a structural block diagram (a) of a routing table updating device according to an embodiment of this application; as shown... Figure 6 As shown, it includes:
[0080] Configuration module 42 is used to configure a routing table for target devices in a wireless ad hoc network. The routing table includes routing table entries, and the routing table entries are used to indicate the address combination and effective field for data transmission by the target devices. The effective field includes effective result and effective time.
[0081] Optionally, the above address combination includes: the node address corresponding to the current target device and the next-hop address.
[0082] It should be noted that the aforementioned target device can be one or more devices, and this embodiment of the invention does not limit this. When storing the routing table, to improve the efficiency of updating the routing table, it can be stored as a cache, i.e., the routing table is given a cache attribute. In this case, the routing table in the wireless ad hoc network protocol has an expiration time. That is, an effective field for recording the effective time and effective result is added to the routing table entries in the routing table. For example, when a new routing table entry enters the routing table, its entry time needs to be recorded. In the aforementioned routing table, the effective time is recorded as a countdown. That is, after a new routing table entry enters the routing table, if the effective result is set to a valid character, the corresponding effective time is set to the default maximum countdown duration. Each time the status of the entry is updated, the maximum countdown duration needs to be updated accordingly. If there is no change for a period of time, the routing table entry becomes invalid, and subsequent route selection can no longer rely on this routing table entry. Optionally, the effective time of the routing table entry can be set to 5 minutes, or other durations; this embodiment of the invention does not limit this.
[0083] The determination module 44 is used to determine the update mechanism of the routing table based on the target status of the effective field. Through the above device, a routing table is configured for target devices in a wireless ad hoc network. The routing table includes routing table entries, each indicating the address combination and effective field for data transmission by the target device. The effective field includes an effective result and an effective time. The update mechanism of the routing table is determined based on the target status of the effective field. This technical solution solves the problems of complex routing table update detection and network congestion. In this embodiment, by configuring a corresponding routing table for the wireless ad hoc network and setting corresponding effective fields in the routing table entries, the effective status of different routing table entries is determined. Finally, the appropriate update mechanism for the corresponding routing table is determined based on the effective status. This improves the efficiency of routing table updates, thereby reducing the number of routing table maintenance operations, reducing data traffic consumption, and ensuring smooth network operation during data transmission in the wireless ad hoc network.
[0084] In an exemplary embodiment, the determining module 44 is further configured to update the routing table based on the routing information corresponding to the data packets forwarded by the target device when the effective field is in an effective state; or to update the routing table based on the routing information reported by other devices, wherein the target device and other devices are in the same wireless ad hoc network.
[0085] Optionally, the above-mentioned valid state is: the effective result included in the routing table entry is a valid character, and the effective time is not 0.
[0086] Understandably, when the effective status of a routing table entry is valid, it means that the entry can be quickly applied to data transmission. However, since the effective time field is constantly changing, when the effective time is 0, the effective status of the entry will quickly change from valid to invalid, making it unusable for data transmission. Therefore, to ensure that the routing table entries remain valid, the routing table can be updated using the routing information obtained by the target device when forwarding data packets.
[0087] Specifically, the source address information carried in the forwarded data packet is obtained. If a next-hop address corresponding to this source address exists in the current routing table, the target address combination corresponding to this next-hop address is determined, and the effective time corresponding to the effective field of this target address combination is readjusted to the maximum timeout duration. If no next-hop address corresponding to this source address exists in the current routing table, the address corresponding to this source address is used as a new next-hop address and combined with the node address corresponding to the target device to form a new address combination. The effective result included in the effective field of this new address combination is set to valid characters, and the effective time included in the effective field of this new address combination is adjusted to the maximum timeout duration. A new routing table entry is determined and added to the routing table to complete the routing table update.
[0088] Optionally, after obtaining routing information actively reported by other devices, if a routing table entry corresponding to the next-hop address exists based on the next-hop address reported by other devices, the effective time of the valid routing table entry matching the address is refreshed (i.e., the effective time is readjusted to the maximum timeout). If no routing table entry corresponding to the next-hop address exists, the next-hop address is combined with the node address corresponding to the target device to form a new address combination. The effective result in the effective field corresponding to this new address combination is set to a valid character, and the effective time in the effective field corresponding to this new address combination is adjusted to the maximum timeout. A new routing table entry is then determined and added to the routing table to complete the routing table update.
[0089] In an exemplary embodiment, the determining module 44 is further configured to, when the effective field is in a valid state, update the effective time corresponding to the effective field in the target state that is in a valid state according to the query result of the routing table; and when the effective field is in an invalid state and the target device needs to transmit data to the next-hop address corresponding to the routing table entry, update the effective result corresponding to the effective field in the target state that is in an invalid state according to the query result of the routing table.
[0090] Optionally, the routing table can also be updated by initiating a route lookup. However, it's important to note that if the effective field corresponding to a routing entry in the routing table is valid, the lookup result only updates the effective time of the effective field included in the routing entry. This ensures the effective field remains valid, allowing for quick application to data transmission when the routing entry is used. Furthermore, when the effective field corresponding to a routing entry in the routing table is invalid, the route lookup requires a precondition: the lookup will only be triggered when the target device needs to transmit data to the next-hop address corresponding to the invalid routing entry, thus avoiding unnecessary route looksup. In an exemplary embodiment, the determining module 44 further includes: a first request unit, configured to send a first routing query request to the next-hop address; wherein the first routing query request carries a time-to-live value corresponding to the number of times the first routing query request is allowed to be forwarded; and based on the first response information corresponding to the first routing query request, the effective result corresponding to the effective field of the failure state is adjusted from an invalid character to a valid character, and the effective time corresponding to the effective field of the failure state is adjusted to the maximum timeout duration.
[0091] In simple terms, a lookup of a routing table entry is triggered only when the target device needs to transmit data to the next-hop address corresponding to the failed entry. To prevent indefinite forwarding of routing query requests, a Time-to-Live (TTL) value is added to the request. This TTL value is related to the maximum hop count of the current ad hoc network. Each time a TTL-enabled routing query request is forwarded by another device, the TTL value is decremented. When the TTL value reaches 0, forwarding of the request stops, effectively preventing routing loops. It's understandable that even if a routing table entry fails, the entry shouldn't be discarded and a new broadcast routing query performed when access to the device is needed. Instead, a unicast routing query should be performed based on the existing entry. If successful, the routing table entry is refreshed; otherwise, a broadcast routing query is performed. Finally, after obtaining the response information corresponding to the route query request, the response information is used to update the invalid route table entry. The effective result corresponding to the effective field of the invalid route table entry is changed from invalid characters to valid characters, and the effective time corresponding to the effective field is adjusted to the maximum timeout duration. In this way, the invalid route table entry can be restored to a valid route table entry in the route table.
[0092] In an exemplary embodiment, the determining module 44 further includes: a waiting unit, configured to obtain the waiting response time after the first routing query request is sent; if the waiting response time is greater than a preset waiting time, determine that the first routing query request has not obtained the first response information corresponding to the first routing query request; and if the waiting response time is less than or equal to the preset waiting time, determine that the first routing query request has obtained the first response information corresponding to the first routing query request.
[0093] It is understandable that, since the first route query request is essentially a unicast request to query the next-hop address included in the route table entry in the failed state, there is a certain waiting time when sending the first route query request for the route table entry in the failed state. This is to avoid the first route query request not being able to end for a long time and to ensure the timeliness of the route query.
[0094] In an exemplary embodiment, the determining module 44 further includes: a second request unit, configured to broadcast a second routing query request in the network where the target device is located; determine a new routing table entry based on the second response information corresponding to the second routing query request; add the new routing table entry to the routing table; set the effective result included in the effective field of the new routing table entry to a valid character; and adjust the effective time included in the effective field of the new routing table entry to the maximum timing duration.
[0095] For example, the target device should first initiate a unicast route query request (equivalent to the first route query request mentioned above) to the destination device corresponding to the next-hop address included in the expired route table entry. After receiving the request, if the destination device has routing information in its own routing table, it forwards the query request; otherwise, it discards the request. After sending the unicast route query request, the target device waits for a period of time. If it receives a response, it refreshes its local routing information (here, the timeout of the expired entry should be directly restored), thus completing the unicast route query. If it does not receive a response, the unicast route query fails and is converted to a broadcast route query. That is, when the first route query request fails, a second route query request is broadcast again in the network where the target device is located, and the new route table entry used to update the routing table is determined based on the second response information corresponding to the second route query request.
[0096] In an exemplary embodiment, the second request unit is further configured to, when there are multiple second response messages, determine the number of route reachable hops carried in the response message corresponding to each of the multiple second response messages, thereby obtaining multiple route reachable hops; determine the second response message with the smallest hop count among the multiple route reachable hops as the target response message for determining the newly added routing table entry, and use the target next-hop address corresponding to the target response message and the node address corresponding to the target device to determine the target address combination corresponding to the newly added routing table entry.
[0097] Understandably, since the second route query request corresponds to a broadcast method, it's possible to receive second response messages from multiple other destination devices simultaneously. To improve the data transmission efficiency indicated by the routing table entry, the number of hops the route can reach should be carried in the route query response message, and an appropriate next-hop address should be selected and recorded in the target device's routing table (e.g., the minimum number of hops, the highest next-hop signal strength, etc.). In fact, the first second response message received should have high priority, at least indicating that the current data exchange time is the shortest.
[0098] In one exemplary embodiment, Figure 7 This is a structural block diagram (II) of a routing table updating device according to an embodiment of this application; as shown Figure 7 As shown, the above-mentioned device also includes: a deletion module 50.
[0099] In one exemplary embodiment, the above apparatus further includes: a deletion module, configured to delete a target routing table entry in the routing table corresponding to the abnormal routing information when abnormal routing information is obtained in the wireless ad hoc network, wherein the abnormal routing information is used to indicate routing information that has been incorrectly used after network changes have occurred in the wireless ad hoc network.
[0100] To prevent the misuse of routing information due to network changes before the cache expires, the cached routing table also provides an immediate expiration mechanism. This allows other parts of the protocol to directly delete the target routing table entry corresponding to the erroneous routing information from the routing table once other parts detect incorrect routing information (e.g., a reliable transport layer detects that the destination address is unreachable), further improving the routing table's response speed to network changes.
[0101] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.
[0102] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:
[0103] S1, Configure a routing table for the target device in the wireless ad hoc network, wherein the routing table includes: routing table entries, and the routing table entries are used to indicate the address combination and effective field for the target device to perform data transmission, wherein the effective field includes: effective result and effective time;
[0104] S2, determine the update mechanism of the routing table based on the target status of the effective field.
[0105] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.
[0106] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.
[0107] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:
[0108] S1, Configure a routing table for the target device in the wireless ad hoc network, wherein the routing table includes: routing table entries, and the routing table entries are used to indicate the address combination and effective field for the target device to perform data transmission, wherein the effective field includes: effective result and effective time;
[0109] S2, determine the update mechanism of the routing table based on the target status of the effective field.
[0110] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.
[0111] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.
[0112] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.
[0113] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. A method for updating a routing table, characterized in that, include: Configure a routing table for target devices in a wireless ad hoc network, wherein the routing table includes: routing table entries, and the routing table entries are used to indicate the address combination and effective field for data transmission by the target devices, wherein the effective field includes: effective result and effective time; The update mechanism of the routing table is determined based on the target status of the effective field; The address combination includes: the node address corresponding to the current target device and the next-hop address; the effective time is recorded by countdown recording; the target state includes at least one of the following: an effective field for a valid state, an effective field for a failed state, an effective time updated based on the valid state, and an effective time updated based on the failed state. The routing table is stored using a high-speed cache method; If the effective field is in a valid state, the routing table is updated in one of the following ways: The routing table is updated based on the routing information corresponding to the data packets forwarded by the target device. The routing table update is performed through the following process: obtaining the source address information carried in the forwarded data packets; if a next-hop address corresponding to the source address information exists in the current routing table, the effective time of the routing table entry corresponding to the next-hop address is reset to the maximum timeout duration; if the next-hop address does not exist, the address corresponding to the source address information is used as a new next-hop address and combined with the node address corresponding to the target device to form a new address combination, and the effective result included in the effective field corresponding to the new address combination is set to a valid character, and the effective time included in the effective field corresponding to the new address combination is adjusted to the maximum timeout duration, a new routing table entry is determined, and the new routing table entry is added to the routing table to complete the routing table update. The routing table is updated based on routing information reported by other devices; If the effective field is in an invalid state, and the target device needs to transmit data to the next-hop address corresponding to the routing table entry, perform the following operations: A first routing query request is sent to the next-hop address, wherein the first routing query request carries a time-to-live (TTL) value, which is related to the maximum hop count corresponding to the current ad hoc network; it is determined whether a first response information corresponding to the first routing query request is obtained; if the first response information is obtained, the effective result corresponding to the effective field of the invalidation state is adjusted to a valid character, and the effective time is reset to the maximum timeout duration; if the first response information is not obtained, a second routing query request is broadcast in the network where the target device is located, and a new routing table entry is determined according to the second response information corresponding to the second routing query request, the new routing table entry is added to the routing table, and the effective result in the effective field of the new routing table entry is set to a valid character, and the effective time is adjusted to the maximum timeout duration.
2. The method for updating a routing table according to claim 1, characterized in that, The target device is in the same wireless ad hoc network as other devices.
3. The method for updating a routing table according to claim 1, characterized in that, After sending a first routing query request to the next-hop address, the method further includes: Obtain the waiting time after the first route query request is sent; If the waiting time for the response is greater than the preset waiting time, it is determined that the first route query request has not obtained the first response information corresponding to the first route query request; If the waiting time is less than or equal to a preset waiting time, it is determined that the first routing query request has obtained the first response information corresponding to the first routing query request.
4. The method for updating a routing table according to claim 1, characterized in that, The newly added routing table entry is determined based on the second response information corresponding to the second routing query request, including: When there are multiple second response messages, determine the number of route reachable hops carried in the response message corresponding to each of the multiple second response messages to obtain multiple route reachable hops; The second response information with the smallest hop count among the multiple routes is determined as the target response information for determining the newly added routing table entry, and the target next-hop address corresponding to the target response information and the node address corresponding to the target device are used to determine the target address combination corresponding to the newly added routing table entry.
5. The method for updating a routing table according to claim 1, characterized in that, After determining the update mechanism of the routing table based on the target status of the effective field, the method further includes: If abnormal routing information is obtained in the wireless ad hoc network, the target routing table entry corresponding to the abnormal routing information in the routing table is deleted. The abnormal routing information is used to indicate routing information that has been incorrectly used after network changes have occurred in the wireless ad hoc network.
6. A routing table updating device, characterized in that, include: A configuration module is used to configure a routing table for target devices in a wireless ad hoc network. The routing table includes routing table entries, and the routing table entries are used to indicate the address combination and effective field for data transmission by the target devices. The effective field includes effective result and effective time. The determination module is used to determine the update mechanism of the routing table based on the target status of the effective field; The address combination includes: the node address corresponding to the current target device and the next-hop address; the effective time is recorded by countdown recording; the target state includes at least one of the following: an effective field for a valid state, an effective field for a failed state, an effective time updated based on the valid state, and an effective time updated based on the failed state; the routing table is stored in a high-speed cache. The determining module is further configured to update the routing table in one of the following ways when the effective field is in a valid state: The routing table is updated based on the routing information corresponding to the data packets forwarded by the target device. The routing table update is performed through the following process: obtaining the source address information carried in the forwarded data packets; if a next-hop address corresponding to the source address information exists in the current routing table, the effective time of the routing table entry corresponding to the next-hop address is reset to the maximum timeout duration; if the next-hop address does not exist, the address corresponding to the source address information is used as a new next-hop address and combined with the node address corresponding to the target device to form a new address combination, and the effective result included in the effective field corresponding to the new address combination is set to a valid character, and the effective time included in the effective field corresponding to the new address combination is adjusted to the maximum timeout duration, a new routing table entry is determined, and the new routing table entry is added to the routing table to complete the routing table update. The routing table is updated based on routing information reported by other devices; If the effective field is in an invalid state and the target device needs to transmit data to the next-hop address corresponding to the routing table entry, perform the following operations: send a first routing query request to the next-hop address, wherein the first routing query request carries a time-to-live (TTL) value, which is related to the maximum number of hops corresponding to the current ad hoc network; determine whether a first response information corresponding to the first routing query request is obtained; if the first response information is obtained, adjust the effective result corresponding to the effective field of the invalid state to a valid character and reset the effective time to the maximum timeout duration; if the first response information is not obtained, broadcast a second routing query request in the network where the target device is located, and determine a new routing table entry based on the second response information corresponding to the second routing query request, add the new routing table entry to the routing table, set the effective result in the effective field of the new routing table entry to a valid character, and adjust the effective time to the maximum timeout duration.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 5.
8. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 5 through the computer program.