WO2024092913A1 - 路由表的更新方法和装置、存储介质及电子装置 - Google Patents
路由表的更新方法和装置、存储介质及电子装置 Download PDFInfo
- Publication number
- WO2024092913A1 WO2024092913A1 PCT/CN2022/134468 CN2022134468W WO2024092913A1 WO 2024092913 A1 WO2024092913 A1 WO 2024092913A1 CN 2022134468 W CN2022134468 W CN 2022134468W WO 2024092913 A1 WO2024092913 A1 WO 2024092913A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- routing table
- routing
- effective
- query request
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W40/00—Communication routing or communication path finding
- H04W40/24—Connectivity information management, e.g. connectivity discovery or connectivity update
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W84/00—Network topologies
- H04W84/18—Self-organising networks, e.g. ad-hoc networks or sensor networks
Definitions
- the present disclosure relates to the field of smart home technology, and in particular to a method and device for updating a routing table, a storage medium, and an electronic device.
- the embodiments of the present disclosure provide a method and device for updating a routing table, a storage medium, and an electronic device, so as to at least solve the problems in the related art that the update detection of the routing table is complicated and easily blocks the network.
- a method for updating a routing table comprising: configuring a routing table for a target device in a wireless ad hoc network, wherein the routing table comprises: routing table items, and the routing table items are set to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field comprises: an effective result and an effective time; and determining an update mechanism for the routing table according to a target state of the effective field.
- a routing table updating device comprising: a configuration module, configured to configure a routing table for a target device in a wireless ad hoc network, wherein the routing table comprises: routing table items, and the routing table items are configured to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field comprises: an effective result and an effective time; and a determination module, configured to determine an update mechanism for the routing table according to a target state of the effective field.
- a computer-readable storage medium in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned method for updating the routing table when running.
- an electronic device including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the routing table updating method through the computer program.
- a routing table is configured for a target device in a wireless ad hoc network, wherein the routing table includes: routing table items, and the routing table items are set to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field includes: an effective result and an effective time; an update mechanism for the routing table is determined according to a target state of the effective field; the above technical solution is used to solve the problems of complex update detection of routing tables and easy network blocking.
- FIG1 is a schematic diagram of a hardware environment of a method for updating a routing table according to an embodiment of the present disclosure
- FIG2 is a flow chart of a method for updating a routing table according to an embodiment of the present disclosure
- FIG3 is a schematic diagram of the structure of a routing table according to an optional embodiment of the present disclosure.
- FIG4 is a schematic diagram of an application of a routing table according to an optional embodiment of the present disclosure.
- FIG. 5 is a schematic diagram of updating a routing table through routing information according to an optional embodiment of the present disclosure
- FIG6 is a structural block diagram of a routing table updating device according to an embodiment of the present disclosure (I);
- FIG7 is a structural block diagram of a device for updating a routing table according to an embodiment of the present disclosure (II);
- FIG8 is a structural block diagram of an optional electronic device according to an embodiment of the present disclosure.
- a method for updating a routing table is provided.
- the method for updating the routing table should be widely set to smart home (Smart Home), smart home, smart home device ecology, smart house (Intelligence House) ecology and other whole-house intelligent digital control application scenarios.
- the method for updating the routing table can be set in a hardware environment composed of a terminal device 102 and a server 104 as shown in Figure 1.
- the server 104 is connected to the terminal device 102 through a network, and can be set to provide services (such as application services, etc.) for the terminal or a client installed on the terminal, a database can be set on the server or independently of the server, and it is set to provide data storage services for the server 104, cloud computing and/or edge computing services can be configured on the server or independently of the server, and it is set to provide data computing services for the server 104.
- services such as application services, etc.
- a database can be set on the server or independently of the server, and it is set to provide data storage services for the server 104
- cloud computing and/or edge computing services can be configured on the server or independently of the server, and it is set to provide data computing services for the server 104.
- the above network may include but is not limited to at least one of the following: wired network, wireless network.
- the above wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the above wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth.
- WIFI Wireless Fidelity
- the terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing equipment, a smart dishwasher, a smart projection equipment, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air equipment, a smart kitchen and bathroom equipment, a smart bathroom equipment, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification equipment, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
- FIG2 is a flow chart of the method for updating a routing table according to an embodiment of the present disclosure, and the flow chart includes the following steps:
- Step S202 configuring a routing table for a target device in the wireless ad hoc network, wherein the routing table includes: a routing table entry, and the routing table entry is set to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field includes: an effective result and an effective time;
- the above address combination includes: a node address corresponding to the current target device and a next hop address.
- the target device is one or more devices, which is not limited in the embodiments of the present disclosure.
- the routing table can be stored in a high-speed cache manner, that is, the routing table is given a high-speed cache attribute.
- the routing table in the wireless self-organizing network protocol has an expiration time, that is, an effective field set to record the effective time and the effective result is added to the routing table item in the routing table. For example, when a new routing table item enters the routing table, it is necessary to record the time when it enters the routing table.
- the recording method of the effective time in the above routing table is a countdown record, that is, after the new routing table item enters the routing table, when the effective result is set to a valid character, the corresponding effective time is set to the default maximum timing duration, and each time the status of the item is updated, the corresponding maximum timing duration needs to be updated. If there is no change for a period of time, the routing table item is invalid, and the subsequent route selection cannot rely on the routing table item; optionally, the effective time of the routing table item can be set to 5 minutes, or other durations; the embodiments of the present disclosure do not limit this.
- Step S204 determining an update mechanism for the routing table according to the target state of the effective field.
- a routing table is configured for a target device in a wireless ad hoc network, wherein the routing table includes: routing table items, and the routing table items are set to an address combination and an effective field for indicating that the target device performs data transmission, and the effective field includes: an effective result and an effective time; an update mechanism for the routing table is determined according to a target state of the effective field; the above technical solution is adopted to solve the problems of complex update detection of routing tables and easy network blocking.
- a corresponding routing table is configured for the wireless ad hoc network, and corresponding effective fields are set for routing table items in the routing table, and then the effective states of different routing table items are determined, and finally the corresponding update mechanism of the routing table is determined according to the effective state, and the corresponding update mechanism of the routing table is improved through the update mechanism of the routing table, thereby reducing the maintenance times of the routing table, reducing data traffic consumption, and ensuring smooth network during data transmission in the wireless ad hoc network.
- the refresh mechanism in the above step S204 includes: when the effectiveness field is in a valid state, updating the routing table according to the routing information corresponding to the data packet forwarded by the target device; or, updating the routing table according to the routing information reported by other devices, wherein the target device and the other devices are in the same wireless ad hoc network.
- the valid state is: the effective result included in the routing table entry is a valid character, and the effective time is not 0.
- the routing table item in the routing table when the effective state corresponding to the routing table item in the routing table is the valid state, it means that the routing table item can be quickly applied to data transmission at this time.
- the effective time included in the effective field is constantly changing, when the effective time is 0, the effective state corresponding to the routing table item in the routing table will be quickly updated from the valid state to the invalid state, making it impossible to continue to be set for data transmission. Therefore, in order to ensure that the routing table items in the routing table continue to be in the valid state, the routing table can be updated through the routing information obtained by the target device when forwarding the data message;
- the source address information carried in the forwarded data message is obtained, and if there is a next-hop address corresponding to the source address information in the current routing table, the target address combination corresponding to the next-hop address is determined, and the effective time corresponding to the effective field corresponding to the target address combination is readjusted to the maximum timing duration.
- 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 timing duration, a new routing table item is determined, and the routing table item is added to the routing table to complete the update of the routing table.
- next-hop address corresponding to the routing information reported by other devices it is also possible to determine, based on the next-hop address corresponding to the routing information reported by other devices, whether there is a routing table entry corresponding to the next-hop address, and then refresh the effective time of the routing table entry in the current routing table that matches the address and is in a valid state (that is, readjust the effective time to the maximum timing duration).
- next-hop address If there is no routing table entry corresponding to the next-hop address, combine the next-hop address and the node address corresponding to the target device into a new address combination, set the effective result included in the effective field corresponding to the new address combination to a valid character, and adjust the effective time included in the effective field corresponding to the new address combination to the maximum timing duration, determine a new routing table entry, and add the routing table entry to the routing table to complete the update of the routing table.
- the routing information between different devices can be synchronized through active reporting, thereby realizing the synchronization of routing information before data transmission, ensuring the subsequent effective use of the routing table.
- the update mechanism of the routing table is determined according to the target state of the effective field corresponding to the routing table entry, and also includes: when the effective field is in a valid state, updating the effective time corresponding to the effective field whose target state is a valid state according to 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 whose target state is an invalid state according to the query result of the routing table.
- the routing table can also be updated by initiating a routing query, but it should be noted that if the effective field corresponding to the routing table item in the routing table is in a valid state, then only the effective time corresponding to the effective field included in the routing table item is updated through the query result of the routing table, that is, the effective field of the routing table item is continuously kept in a valid state through the query, so that when the routing table item is used, it can be quickly applied to data transmission.
- the routing query requires a precondition, that is, when the target device needs to transmit data to the next hop address corresponding to the invalid routing table item, the query for the routing table item will be triggered, thereby avoiding unnecessary routing queries.
- updating the effectiveness result corresponding to the effectiveness field of the target state being 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 lifetime value corresponding to the number of times the first routing query request is allowed to be forwarded; based on the first response information corresponding to the first routing query request, adjusting the effectiveness result corresponding to the effectiveness field of the invalid state from invalid characters to valid characters, and adjusting the effectiveness time corresponding to the effectiveness field of the invalid state to the maximum timing duration.
- the target device when the target device needs to transmit data to the next hop address corresponding to the invalid routing table entry, the query for the routing table entry will be triggered, and in order to ensure that the routing query request will not be forwarded indefinitely, a lifetime value is added to the routing query request.
- the lifetime value is related to the maximum number of hops corresponding to the current self-organizing network. Then, after the routing query request carrying the lifetime value is forwarded once by other devices, the corresponding lifetime value is reduced by one. When the lifetime value becomes 0, the forwarding of the routing query request is stopped, thereby effectively avoiding the problem of routing loops in routing queries.
- the table entry should not be simply discarded and a broadcast routing query should be performed again. Instead, a unicast routing query should be performed based on the existing table entry. If successful, the routing table entry is refreshed, and if it fails, a broadcast routing query should be performed again. Finally, after obtaining the response information corresponding to the routing query request, the response information is used to update the invalid routing table item, and the effective result corresponding to the effective field included in the invalid routing table item is adjusted from invalid characters to valid characters, and the effective time corresponding to the effective field is adjusted to the maximum timing duration, so that the invalid routing table item can be restored to a valid routing table item in the routing table.
- the method further includes: obtaining a waiting response time after the first routing query request is issued; 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; 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.
- the first routing query request is essentially a unicast request for querying the next-hop address included in the routing table entry in the failed state, there is a certain waiting time for sending the first routing query request for the routing table entry in the failed state, and it is never avoided that the first routing query request cannot be terminated for a long time, thereby ensuring the timeliness of the routing query.
- the above method after determining that the first routing query request did not obtain the first response information corresponding to the first routing query request, also includes: broadcasting a second routing query request in the network where the target device is located; determining a newly added routing table item based on the second response information corresponding to the second routing query request, adding the newly added routing table item to the routing table, and setting the effectiveness result included in the effectiveness field of the newly added routing table item to a valid character, and adjusting the effectiveness time included in the effectiveness field in the newly added routing table item to the maximum timing duration.
- the target device should first initiate a unicast routing query request (equivalent to the first routing query request mentioned above) to the destination device corresponding to the next hop address included in the routing table entry in the invalid state in 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 routing query request, the target device waits for a period of time.
- a unicast routing query request equivalent to the first routing query request mentioned above
- the local routing information is refreshed (the timeout time of the expired table entry should be directly restored here) to complete the unicast routing query; if no response is received, the unicast routing query fails and is converted to a broadcast routing query; that is, when the first routing query request fails, the second routing query request is broadcast again in the network where the target device is located, and the newly added routing table entry set to update the routing table is determined according to the second response information corresponding to the second routing query request.
- a 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 information, determining the number of route reachable hops carried by 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 number of hops among the multiple route reachable hops as the target response information set to determine the newly added 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 newly added routing table entry.
- the route query response message should carry the number of hops that the route can reach, and the appropriate next hop address should be selected and recorded in the routing table of the target device (for example, the minimum number of hops, the highest next hop signal strength, etc.).
- the second response information received first here should have a high priority, at least it can reflect that the current data exchange time is the shortest.
- the above method after determining the update mechanism of the routing table according to the target state of the effective field, the above method also includes: when obtaining abnormal routing information in the wireless self-organizing network, deleting the target routing table entry corresponding to the abnormal routing information in the routing table, wherein the abnormal routing information is set to indicate routing information that is incorrectly used after a network change occurs in the wireless self-organizing network.
- the cached routing table also provides an immediate invalidation mechanism.
- the target routing table entry corresponding to the abnormal routing information can be directly deleted from the routing table through this mechanism, further improving the routing table's response speed to network changes.
- FIG3 is a schematic diagram of the structure of a routing table according to an optional embodiment of the present disclosure.
- Each routing table item is composed of fields corresponding to the node address, whether it is effective, the effective time, the next hop address, etc., and a refresh mechanism can also be added on the basis of the above fields:
- the refresh mechanism can include: a refresh mechanism corresponding to routing query, a refresh mechanism for passing data, and a refresh mechanism for device reporting.
- the routing table is the core function of the network layer.
- the main purpose of the routing table is to find the correct next-hop device based on an address, and finally send the data message to the destination address through multi-hop relay;
- the overall design idea of the above routing table is to realize the routing function of the wireless self-organizing network protocol stack based on a local routing table with high-speed cache characteristics and a series of transmission control messages.
- the updating process of the routing table corresponding to the target device is as follows:
- FIG4 is a schematic diagram of the application of a routing table according to an optional embodiment of the present disclosure.
- the node address of the first routing table item is reachable to the next hop address
- the effectiveness result corresponding to the effectiveness field of the first routing table item is a valid character
- the effectiveness time corresponding to the effectiveness field of the first routing table item is 180 seconds, indicating that the effectiveness field of the first routing table item enters an invalid state after 180 seconds, and the first routing table item will become an invalid table item after 180 seconds and needs to be updated before it can continue to be used.
- the maximum allowable value corresponding to the effectiveness time is 300 seconds. It should be noted that the maximum allowable value corresponding to the effectiveness time can be flexibly set according to the actual use of the routing table, and the present disclosure does not impose too many restrictions on this.
- the node address of the second routing table entry is reachable to the next hop address
- the effectiveness result corresponding to the effectiveness field of the second routing table entry is an invalid character
- the effectiveness time corresponding to the effectiveness field of the second routing table entry is 0 seconds, indicating that the second routing table entry becomes an invalid table 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;
- the node address of the third routing table item is reachable to the next hop address
- the effective result corresponding to the effective field of the third routing table item is a valid character
- the effective time corresponding to the effective field of the third routing table item is 180 seconds
- the effective time corresponding to the effective field of the third routing table item is adjusted from 180 seconds to the maximum allowed value of 300 seconds corresponding to the effective time.
- a new routing table item is generated based on the above routing information, such as the fourth routing table item can be determined according to the routing information corresponding to the data message, and the fifth routing table item can be determined according to the routing information sent by other devices, and due to the newly added items to the routing table, the effective results corresponding to the effective fields in the fourth routing table item and the fifth routing table item are both valid characters and the effective time corresponding to the effective field is the maximum allowed value of 300 seconds.
- Figure 5 is a schematic diagram of updating the routing table through routing information according to an optional embodiment of the present disclosure.
- the corresponding update mechanism of the first routing table item in the routing table is to initiate a routing query about the next hop address corresponding to the first routing table item, and adjust the effective time carried by the effective field corresponding to the first routing table item from 180 seconds to 300 seconds according to the query result of the routing query, and then keep the first routing table item valid in the routing table by updating the effective time, so as to facilitate the use of the target device during data transmission.
- the second routing table item in the routing table is in an invalid state because the effective field is in an invalid state.
- the second routing table item will be in a silent state when not used by the target, that is, only when the target device needs to transmit data to the next hop address corresponding to the second routing table item, will the update mechanism for the second routing table item be initiated.
- a unicast routing query (equivalent to the first routing query request in the embodiment of the present disclosure) is sent to the next hop address in the address combination corresponding to the effective field in the invalid state.
- the target device 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 routing query.
- the refresh process is specifically as follows: adjusting the effective result corresponding to the second routing table item from invalid characters to valid characters, and adjusting the effective time corresponding to the second routing table item to the maximum timing duration, and then adjusting the effective field corresponding to the second routing table item from an invalid state to a valid state.
- the unicast routing query request sent to the second routing table item does not receive a response after waiting for a period of time, the unicast routing query fails and is converted to a broadcast routing query; it should be noted that the length of the above-mentioned waiting period is the timeout period that allows the expired table item to be directly restored.
- a new routing table entry will be determined based on the response information corresponding to the broadcast routing query, and the new routing table entry will be added to the routing table to complete the update of the routing table.
- the route information that receives the response first will be determined as the information for generating a new route table entry, because the response has a high priority. At least it can reflect that the current data transaction time is the shortest, that is, the number of hops that can be reached by the route during transmission is the shortest, thereby improving the efficiency of data transmission and saving data transmission time.
- the above-mentioned routing table has a cache property, that is, the routing table in the wireless self-organizing network protocol has an expiration time. After a routing table entry enters the routing table, it is necessary to record the time when it enters the routing table. The time needs to be updated every time the status of the table entry is updated. If there is no change for a period of time, the table entry will become invalid, and the subsequent route selection cannot rely on the table entry; the recommended effective time is 5 minutes.
- the routing table should support multiple refresh mechanisms. As long as the device can obtain the routing information of a certain device, it will be added to the routing table or the lifetime of the existing entries in the routing table will be refreshed to avoid their invalidation; the timing of refreshing the routing information of the routing table can be: a) routing query results; b) source address information carried in passing data packets; c) the device actively reporting its own information, etc.
- the specific update mechanism is determined in combination with the state of the effective field in the routing table item (i.e., whether the item is valid or invalid);
- the effective field is in the effective state, which specifically corresponds to the address in the address combination being reachable, and the effective result is a valid character; the effective time does not change from a 5-minute countdown to 0;
- the effective field is in an invalid state, which means that the address in the address combination is reachable, and the effective result is an invalid character; the effective time countdown changes from 5 minutes to 0;
- the corresponding update method is: a) Update through routing query, set 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 in the routing table through the source address information carried in the data message passing through the target device; c) The device actively reports its own information, that is, the target device receives the routing information actively uploaded by other devices, and searches the current routing table for the routing table entry corresponding to the routing information to update the effective time (reset the countdown to 5 minutes). If there is no corresponding routing table entry in the routing table, add a new routing table entry in the routing table according to the routing information.
- the routing table entry When the routing table entry is invalid, it is determined that the target device needs to pass data to the routing address corresponding to the routing table entry. If the invalid table entry needs to be used, the effective time of the invalid routing table entry is reset to 5 minutes through routing query. When the corresponding query result is received, the effective result of the invalid routing table entry is refreshed from the invalid field to the valid field.
- routing technologies based on local routing table cache are already available, such as AODV (Ad Hoc On-Demand Distance Vector), but these technologies do not use cache technology in local routing tables, that is, once the routing information of a node is stored in the local routing table, the information will always be valid, so if the path to the node changes, or the node itself exits, moves or even shuts down, the technology cannot perceive it.
- AODV Ad Hoc On-Demand Distance Vector
- this type of technology usually requires additional design of routing fault detection technology (such as Hello message in AODV), and the above technical solution uses cache technology, that is, after the routing information of a node is stored locally, the information will expire after an agreed time, and once the information expires, the routing table needs to be updated and detected again when there is a data request sent to the node, and the routing information is refreshed.
- routing fault detection technology such as Hello message in AODV
- the routing information will not be deleted, but will be marked as invalid.
- this technology will not perform a normal network-wide broadcast routing query when refreshing the route, but will first perform a unicast routing query based on the original invalid routing information.
- a unicast routing query can complete the refresh of the local routing information. Only when the routing information is really wrong (the intermediate node or the destination node has exited, moved or closed, etc.), will a network-wide broadcast routing query be performed again. This will further reduce the overhead of routing refreshes caused by routing failures caused by cache.
- the mechanism of instant invalidation of the cache routing table can further speed up the detection and response of network changes.
- a method for introducing a cache technology into the routing table in an on-demand routing protocol of a wireless self-organizing network is provided, which can strike a balance between the overhead of maintaining routing information and the real-time response to changes in network routes; at the same time, an instant invalidation mechanism for the cache routing table is provided, which further speeds up the response to network changes, reduces resource waste, and improves user satisfaction.
- the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method.
- the technical solution of the present disclosure, or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of each embodiment of the present disclosure.
- a storage medium such as ROM/RAM, a disk, or an optical disk
- FIG. 6 is a structural block diagram (I) of a routing table updating device according to an embodiment of the present disclosure; as shown in FIG. 6 , it includes:
- the configuration module 42 is configured to configure a routing table for a target device in the wireless ad hoc network, wherein the routing table includes: a routing table item, and the routing table item is configured to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field includes: an effective result and an effective time;
- the above address combination includes: a node address corresponding to the current target device and a next hop address.
- the above-mentioned target device is one or more devices, and the embodiments of the present disclosure do not limit this.
- the routing table can be stored in a high-speed cache manner, that is, the routing table is given a high-speed cache attribute.
- the routing table in the wireless self-organizing network protocol has an expiration time, that is, an effective field set to record the effective time and the effective result is added to the routing table item in the routing table. For example, when a new routing table item enters the routing table, it is necessary to record the time when it enters the routing table.
- the recording method of the effective time in the above-mentioned routing table is a countdown record, that is, after the new routing table item enters the routing table, when the effective result is set to a valid character, the corresponding effective time is set to the default maximum timing duration, and each time the status of the table item is updated, the corresponding maximum timing duration needs to be updated. If there is no change for a period of time, the routing table item is invalid, and the subsequent route selection cannot rely on the routing table item; optionally, the effective time of the routing table item can be set to 5 minutes, or other durations; the embodiments of the present disclosure do not limit this.
- the determination module 44 is configured to determine the update mechanism of the routing table according to the target state of the effective field.
- a routing table is configured for the target device in the wireless ad hoc network, wherein the routing table includes: routing table items, and the routing table items are set to indicate the address combination and the effective field for the target device to perform data transmission, and the effective field includes: effective result and effective time; the update mechanism of the routing table is determined according to the target state of the effective field; the above technical solution is adopted to solve the problems of complex update detection of routing tables and easy network blocking.
- the corresponding routing table for the wireless ad hoc network, and by setting the corresponding effective field for the routing table items in the routing table, the effective state of different routing table items is determined, and finally the corresponding update mechanism of the routing table is determined according to the effective state.
- the corresponding update mechanism of the routing table is used to improve the update efficiency of the routing table, thereby reducing the maintenance times of the routing table, reducing the data traffic consumption, and ensuring the smooth network when data transmission is carried out in the wireless ad hoc network.
- the above-mentioned determination module 44 is also configured to update the routing table according to the routing information corresponding to the data message forwarded by the target device when the effective field is in a valid state; or, update 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.
- the valid state is: the effective result included in the routing table entry is a valid character, and the effective time is not 0.
- the routing table item in the routing table when the effective state corresponding to the routing table item in the routing table is the valid state, it means that the routing table item can be quickly applied to data transmission at this time.
- the effective time included in the effective field is constantly changing, when the effective time is 0, the effective state corresponding to the routing table item in the routing table will be quickly updated from the valid state to the invalid state, making it impossible to continue to be set for data transmission. Therefore, in order to ensure that the routing table items in the routing table continue to be in the valid state, the routing table can be updated through the routing information obtained by the target device when forwarding the data message;
- the source address information carried in the forwarded data message is obtained, and if there is a next-hop address corresponding to the source address information in the current routing table, the target address combination corresponding to the next-hop address is determined, and the effective time corresponding to the effective field corresponding to the target address combination is readjusted to the maximum timing duration.
- 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 timing duration, a new routing table item is determined, and the routing table item is added to the routing table to complete the update of the routing table.
- next-hop address corresponding to the routing information reported by other devices it is also possible to determine, based on the next-hop address corresponding to the routing information reported by other devices, whether there is a routing table entry corresponding to the next-hop address, and then refresh the effective time of the routing table entry in the current routing table that matches the address and is in a valid state (that is, readjust the effective time to the maximum timing duration).
- next-hop address If there is no routing table entry corresponding to the next-hop address, combine the next-hop address and the node address corresponding to the target device into a new address combination, set the effective result included in the effective field corresponding to the new address combination to a valid character, and adjust the effective time included in the effective field corresponding to the new address combination to the maximum timing duration, determine a new routing table entry, and add the routing table entry to the routing table to complete the update of the routing table.
- the above-mentioned determination module 44 is also configured to update the effective time corresponding to the effective field whose target state is a valid state according to the query result of the routing table when the effective field is in a valid state; and update the effective result corresponding to the effective field whose target state is an invalid state according to 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.
- the routing table is also updated by initiating a routing query, but it should be noted that if the effective field corresponding to the routing table item in the routing table is in a valid state, then only the effective time corresponding to the effective field included in the routing table item is updated through the query result of the routing table, that is, the effective field of the routing table item is continuously kept in a valid state through the query, so that when the routing table item is used, it can be quickly applied to data transmission.
- the routing query requires a precondition, that is, when the target device needs to transmit data to the next hop address corresponding to the invalid routing table item, it will trigger the query for the routing table item, thereby avoiding unnecessary routing queries.
- the determination 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 lifetime value corresponding to the number of times the first routing query request is allowed to be forwarded; based on the first response information corresponding to the first routing query request, the effectiveness result corresponding to the effectiveness field of the invalid state is adjusted from an invalid character to a valid character, and the effectiveness time corresponding to the effectiveness field of the invalid state is adjusted to the maximum timing duration.
- the target device when the target device needs to transmit data to the next hop address corresponding to the invalid routing table entry, the query for the routing table entry will be triggered, and in order to ensure that the routing query request will not be forwarded indefinitely, a lifetime value is added to the routing query request.
- the lifetime value is related to the maximum number of hops corresponding to the current self-organizing network. Then, after the routing query request carrying the lifetime value is forwarded once by other devices, the corresponding lifetime value is reduced by one. When the lifetime value becomes 0, the forwarding of the routing query request is stopped, thereby effectively avoiding the problem of routing loops in routing queries.
- the table entry should not be simply discarded and a broadcast routing query should be performed again. Instead, a unicast routing query should be performed based on the existing table entry. If successful, the routing table entry is refreshed, and if it fails, a broadcast routing query should be performed again. Finally, after obtaining the response information corresponding to the routing query request, the response information is used to update the invalid routing table item, and the effective result corresponding to the effective field included in the invalid routing table item is adjusted from invalid characters to valid characters, and the effective time corresponding to the effective field is adjusted to the maximum timing duration, so that the invalid routing table item can be restored to a valid routing table item in the routing table.
- the above-mentioned determination module 44 also includes: a waiting unit, configured to obtain the waiting response time after the first routing query request is issued; when the waiting response time is greater than the preset waiting time, determining that the first routing query request has not obtained the first response information corresponding to the first routing query request; when 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.
- a waiting unit configured to obtain the waiting response time after the first routing query request is issued; when the waiting response time is greater than the preset waiting time, determining that the first routing query request has not obtained the first response information corresponding to the first routing query request; when 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.
- the first routing query request is essentially a unicast request for querying the next-hop address included in the routing table entry in the failed state, there is a certain waiting time for sending the first routing query request for the routing table entry in the failed state, and it is never avoided that the first routing query request cannot be terminated for a long time, thereby ensuring the timeliness of the routing query.
- the above-mentioned determination module 44 also includes: a second request unit, configured to broadcast and send a second routing query request in the network where the target device is located; determine a newly added routing table item based on a second response information corresponding to the second routing query request, add the newly added routing table item to the routing table, and set the effective result included in the effective field of the newly added routing table item to a valid character, and adjust the effective time included in the effective field in the newly added routing table item to the maximum timing duration.
- a second request unit configured to broadcast and send a second routing query request in the network where the target device is located
- determine a newly added routing table item based on a second response information corresponding to the second routing query request, add the newly added routing table item to the routing table, and set the effective result included in the effective field of the newly added routing table item to a valid character, and adjust the effective time included in the effective field in the newly added routing table item to the maximum timing duration.
- the target device should first initiate a unicast routing query request (equivalent to the first routing query request mentioned above) to the destination device corresponding to the next hop address included in the invalid routing table entry in 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 routing query request, the target device will wait for a period of time.
- a unicast routing query request equivalent to the first routing query request mentioned above
- the local routing information will be refreshed (the timeout time of the expired entry should be directly restored here) to complete the unicast routing query; if no response is received, the unicast routing query fails and is converted to a broadcast routing query; that is, when the first routing query request fails, a second routing query request is broadcast again in the network where the target device is located, and a new routing table entry set to update the routing table is determined according to the second response information corresponding to the second routing query request.
- the above-mentioned second request unit is also configured to determine the number of route reachable hops carried by the response message corresponding to each of the multiple second response information when there are multiple second response information, so as to obtain multiple route reachable hops; determine the second response information with the smallest number of hops among the multiple route reachable hops as the target response information set to determine the newly added routing table entry, and use 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 newly added routing table entry.
- the route query response message should carry the number of hops that the route can reach, and the appropriate next hop address should be selected and recorded in the routing table of the target device (for example, the minimum number of hops, the highest next hop signal strength, etc.).
- the second response information received first here should have a high priority, at least it can reflect that the current data exchange time is the shortest.
- FIG. 7 is a structural block diagram (II) of a routing table updating device according to an embodiment of the present disclosure; as shown in FIG. 7 , the device further includes: a deletion module 50 .
- the above-mentioned device also includes: a deletion module, which is configured to delete the target routing table entry corresponding to the abnormal routing information in the routing table when the abnormal routing information in the wireless self-organizing network is obtained, wherein the abnormal routing information is configured to indicate routing information that is incorrectly used after a network change occurs in the wireless self-organizing network.
- a deletion module which is configured to delete the target routing table entry corresponding to the abnormal routing information in the routing table when the abnormal routing information in the wireless self-organizing network is obtained, wherein the abnormal routing information is configured to indicate routing information that is incorrectly used after a network change occurs in the wireless self-organizing network.
- the cached routing table also provides an immediate invalidation mechanism.
- the target routing table entry corresponding to the abnormal routing information can be directly deleted from the routing table through this mechanism, further improving the response speed of the routing table to network changes.
- An embodiment of the present disclosure further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
- the storage medium may be configured to store program codes configured to perform the following steps:
- routing table for a target device in a wireless ad hoc network
- the routing table includes: routing table items, and the routing table items are set to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field includes: an effective result and an effective time;
- An embodiment of the present disclosure further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
- 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.
- the above-mentioned storage medium may include but is not limited to: a U disk, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
- an electronic device for implementing the above-mentioned method for updating the routing table is also provided.
- FIG8 it is a structural block diagram of an optional electronic device according to the embodiments of the present disclosure.
- the electronic device includes a memory 702 and a processor 704.
- the memory 702 stores a computer program.
- the processor 704 is configured to execute the steps in any one of the above-mentioned method embodiments through the computer program.
- the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
- the processor may be configured to perform the following steps through a computer program:
- routing table for a target device in a wireless ad hoc network
- the routing table includes: routing table items, and the routing table items are set to indicate an address combination and an effective field for the target device to perform data transmission, and the effective field includes: an effective result and an effective time;
- the structure shown in FIG8 is for illustration only, and the electronic device can also be a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, and a mobile Internet device (Mobile Internet Devices, MID), PAD, etc.
- a terminal device such as a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, and a mobile Internet device (Mobile Internet Devices, MID), PAD, etc.
- FIG8 does not limit the structure of the above-mentioned electronic device.
- the electronic device can also include more or fewer components (such as a network interface, etc.) than those shown in FIG8, or have a configuration different from that shown in FIG8.
- the memory 702 can be used to store software programs and modules, such as the program instructions/modules corresponding to the updating method and device of the routing table in the embodiment of the present disclosure, and the processor 704 executes various functional applications and data processing by running the software programs and modules stored in the memory 702, that is, realizing the above-mentioned updating method of the routing table.
- the memory 702 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
- the memory 702 may further include a memory remotely arranged relative to the processor 704, and these remote memories may be connected to the terminal via a network.
- the above-mentioned network examples include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
- the above-mentioned memory 702 may include, but is not limited to, the configuration module 42 and the determination module 44 in the updating device of the above-mentioned routing table.
- other module units in the updating device of the above-mentioned routing table may also be included, but are not limited to, which will not be repeated in this example.
- the transmission device 706 is used to receive or send data via a network.
- the above-mentioned network may include a wired network and a wireless network.
- the transmission device 706 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices and routers via a network cable so as to communicate with the Internet or a local area network.
- the transmission device 706 is a radio frequency (Radio Frequency, RF) module, which is used to communicate with the Internet wirelessly.
- RF Radio Frequency
- the electronic device further comprises: a display 708 for displaying the update of the routing table; and a connection bus 710 for connecting various module components in the electronic device.
- modules or steps of the present disclosure can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation.
- the present disclosure is not limited to any specific combination of hardware and software.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本公开提供了一种路由表的更新方法和装置、存储介质及电子装置,涉及智慧家庭技术领域,该路由表的更新方法包括:为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制。
Description
本公开要求于2022年10月31日提交中国专利局、申请号为202211349587.8、发明名称“路由表的更新方法和装置、存储介质及电子装置”的中国专利申请的优先权,其全部内容通过引用结合在本公开中。
本公开涉及智慧家庭技术领域,具体而言,涉及一种路由表的更新方法和装置、存储介质及电子装置。
相关技术中,在网络建立以后即开始建立维护网络中的路由信息,维护一套路由信息其开销会很大,同时实时性和开销之间的权衡也很难取舍;因而提出在数据传输的时候才进行目的节点确定的路由检测机制,但是每次数据传输都需要等待本次路由检测结果才能进行实际传输,使得每次传输的时延极大,当检测过多时还可能会造成流量高峰,阻塞网络。
发明内容
本公开实施例提供了一种路由表的更新方法和装置、存储介质及电子装置,以至少解决相关技术中,路由表的更新检测复杂且容易阻塞网络等问题。
根据本公开实施例的一个实施例,提供了一种路由表的更新方法,包括:为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制。
根据本公开实施例的另一个实施例,还提供了一种路由表的更新装置,包括:配置模块,设置为无线自组网中的目标设备配置路由表,其中,所述路由表包括: 路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;确定模块,设置为根据所述生效字段的目标状态确定所述路由表的更新机制。
根据本公开实施例的又一方面,还提供了一种计算机可读的存储介质,该计算机可读的存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述路由表的更新方法。
根据本公开实施例的又一方面,还提供了一种电子装置,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其中,上述处理器通过计算机程序执行上述的路由表的更新方法。
在本公开实施例中,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制;采用上述技术方案,解决了路由表的更新检测复杂且容易阻塞网络等问题。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本公开实施例的一种路由表的更新方法的硬件环境示意图;
图2是根据本公开实施例的路由表的更新方法的流程图;
图3是根据本公开可选实施例的路由表的结构示意图;
图4是根据本公开可选实施例的路由表的应用示意图;
图5是根据本公开可选实施例的通过路由信息进行路由表更新的示意图;
图6是根据本公开实施例的一种路由表的更新装置的结构框图(一);
图7是根据本公开实施例的一种路由表的更新装置的结构框图(二);
图8是根据本公开实施例的一种可选的电子装置的结构框图。
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是设置为区别类似的对象,而不必设置为描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
根据本公开实施例的一个方面,提供了一种路由表的更新方法。该路由表的更新方法广泛应设置为智慧家庭(Smart Home)、智能家居、智能家用设备生态、智慧住宅(Intelligence House)生态等全屋智能数字化控制应用场景。可选地,在本实施例中,上述路由表的更新方法可以应设置为如图1所示的由终端设备102和服务器104所构成的硬件环境中。如图1所示,服务器104通过网络与终端设备102进行连接,可设置为为终端或终端上安装的客户端提供服务(如应用 服务等),可在服务器上或独立于服务器设置数据库,设置为为服务器104提供数据存储服务,可在服务器上或独立于服务器配置云计算和/或边缘计算服务,设置为为服务器104提供数据运算服务。
上述网络可以包括但不限于以下至少之一:有线网络,无线网络。上述有线网络可以包括但不限于以下至少之一:广域网,城域网,局域网,上述无线网络可以包括但不限于以下至少之一:WIFI(Wireless Fidelity,无线保真),蓝牙。终端设备102可以并不限定于为PC、手机、平板电脑、智能空调、智能烟机、智能冰箱、智能烤箱、智能炉灶、智能洗衣机、智能热水器、智能洗涤设备、智能洗碗机、智能投影设备、智能电视、智能晾衣架、智能窗帘、智能影音、智能插座、智能音响、智能音箱、智能新风设备、智能厨卫设备、智能卫浴设备、智能扫地机器人、智能擦窗机器人、智能拖地机器人、智能空气净化设备、智能蒸箱、智能微波炉、智能厨宝、智能净化器、智能饮水机、智能门锁等。
在本实施例中提供了一种路由表的更新方法,应设置为上述终端设备,图2是根据本公开实施例的路由表的更新方法的流程图,该流程包括如下步骤:
步骤S202,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;
可选的,上述地址组合包括:当前目标设备对应的节点地址以及下一跳地址。
需要说明的是,上述目标设备为一个或多个设备,本公开实施例对此不作限定。上述路由表中存储时,为了提升对路由表的更新效率,可以将路由表以高速缓存的方式进行存储,即为路由表赋予高速缓存属性,在这种情况下,使得无线自组织网络协议中的路由表具有了失效时间,即在路由表中的路由表项中增加了设置为记录生效时间以及生效结果的生效字段,例如,当一个新的路由表项进入路由表以后,需要记录其进入路由表的时间,在上述路由表中生效时间的记录方式为倒计时记录,即在新的路由表项进入路由表之后,在将生效结果设置为有效字符的情况下,将对应的生效时间设置为默认的最大计时时长,且每次更新该表项状态时都需要对应更新最大计时时长的时间,如果一段时间没有变化,则该路 由表项失效,其后的路由选择时不可再依赖该路由表项;可选的,路由表项的生效时间可以设置为5分钟,也可以是其他时长;本公开实施例对此不做限定。
步骤S204,根据所述生效字段的目标状态确定所述路由表的更新机制。
通过上述步骤,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制;采用上述技术方案,解决了路由表的更新检测复杂且容易阻塞网络等问题,本公开实施例中,通过为无线自组网络配置对应的路由表,并通过在该路由表中的路由表项设置对应的生效字段,继而确定不同路由表项的生效状态,最终通过生效状态确定对应适合的路由表的更新机制,通过路由表对应的更新机制提升路由表更新效率,从而减少路由表的维护次数,降低数据流量消耗,保证无线自组网中进行数据传输时的网络畅通。
作为一种可选的实施方式,上述步骤S204中的刷新机制包括:在所述生效字段为有效状态的情况下,根据所述目标设备转发的数据报文对应的路由信息对所述路由表更新;或,根据其他设备上报的路由信息对所述路由表更新,其中,所述目标设备与其他设备处于同一无线自组网。
可选的,上述有效状态是:路由表项包括的生效结果为有效字符,且生效时间不为0。
可以理解的是,当路由表中的路由表项对应的生效状态为有效状态时,说明此时该路由表项可以被快速应用至数据传输,但是由于生效字段包括的生效时间是在不断变化的,当生效时间为0时,路由表中的路由表项对应的生效状态将会快速从有效状态更新为无效状态,使得无法被继续设置为数据传输,因此,为了保证路由表中的路由表项持续表现为有效状态,可以通过目标设备在转发数据报文时获取的路由信息对路由表进行更新;
具体的,获取转发数据报文中携带的源地址信息,在当前路由表中存在与该源地址信息对应的下一跳地址的情况下,确定该下一跳地址对应的目标地址组合, 并将该目标地址组合对应的生效字段所对应的生效时间重新调整为最大计时时长。在当前路由表中不存在与该源地址信息对应的下一跳地址的情况下,将该源地址信息对应的地址作为新的下一跳地址与目标设备对应的节点地址组合成新的地址组合,并将该新的地址组合对应的生效字段包括的生效结果设置为有效字符,以及将该新的地址组合对应生效字段包括的生效时间调整为最大计时时长,确定出一个新的路由表项,将该路由表项添加至路由表中完成对路由表进行更新。
可选的,在获取到其他设备主动上报的路由信息后,也可以根据其他设备上报的路由信息对应的下一跳地址,确定存在与下一跳地址对应的路由表项的情况下,将地址匹配的当前路由表中为有效状态的路由表项包括的生效时间进行刷新(即将生效时间重新调整为最大计时时长),在不存在与下一跳地址对应的路由表项的情况下,将下一跳地址与目标设备对应的节点地址组合成新的地址组合,并将该新的地址组合对应的生效字段包括的生效结果设置为有效字符,以及将该新的地址组合对应生效字段包括的生效时间调整为最大计时时长,确定出一个新的路由表项,将该路由表项添加至路由表中完成对路由表进行更新。
需要说明的是,由于同一无线自组网内的设备存在网络联系,当网络处于不拥塞的情况下,或者是网络空闲的情况下,可以通过主动汇报的方式进行不同设备之间的路由信息同步,继而在数据传输之前实现了路由信息的同步,保证了后续对于路由表的有效使用。
在一个示例性实施例中,根据所述路由表项对应生效字段的目标状态确定所述路由表的更新机制,还包括:在所述生效字段为有效状态的情况下,根据所述路由表的查询结果对目标状态为有效状态的生效字段所对应的生效时间进行更新;在所述生效字段为失效状态,且目标设备需要向路由表项对应的下一跳地址进行数据传输的情况下,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新。
可选的,还可以通过发起路由查询的方式对路由表进行更新,但是需要注意的是,假如,路由表中路由表项对应的生效字段为有效状态,此时仅是是通过路由表的查询结果对路由表项包括的生效字段所对应的生效时间进行更新,即通过 查询将路由表项的生效字段持续保持为有效状态,使得在使用该路由表项在使用时可以快速应用至数据传输。此外,当路由表中路由表项对应的生效字段为失效状态,这时路由查询是需要前置条件的,即当目标设备需要向该失效状态的路由表项对应的下一跳地址进行数据传输时,才会触发对于该路由表项的查询,继而避免无谓的路由查询。
在一个示例性实施例中,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新,包括:向所述下一跳地址发送第一路由查询请求;其中,所述第一路由查询请求携带有设置为指示所述第一路由查询请求被允许转发次数对应的生存时间值;基于所述第一路由查询请求对应的第一回应信息将所述失效状态的生效字段所对应的生效结果由无效字符调整为有效字符,以及将所述失效状态的生效字段所对应的生效时间调整为最大计时时长。
简单来说,在目标设备需要向该失效状态的路由表项对应的下一跳地址进行数据传输时,才会触发对于该路由表项的查询,并且为了保证路由查询请求不会被无限制转发,在路由查询请求中添加生存时间值,该生存时间值与当前自组网络对应的最大跳数有关,进而当携带生存时间值的路由查询请求被其他设备转发一次之后,对应的生存时间值减一,当生存时间值变为0时,停止该路由查询请求的转发,从而有效的避免路由查询中出现路由环路的问题。可以理解的是,即使路由表中某一路由表项失效,在需要访问该设备的时候也不应简单丢弃该表项,重新进行一次广播路由查询,而是应基于已有表项进行一次单播路由查询,如果成功则刷新路由表项,失败再进行广播路由查询。最终,在获取到路由查询请求对应的回应信息之后,利用回应信息对该失效状态的路由表项进行更新,将该失效状态的路由表项包括的生效字段所对应的生效结果由无效字符调整为有效字符,以及将生效字段所对应的生效时间调整为最大计时时长,从而使得失效状态的路由表项可以在路由表中恢复成有效状态的路由表项。
在一个示例性实施例中,向所述下一跳地址发送第一路由查询请求之后,上述方法还包括:获取所述第一路由查询请求发出后的等待响应时间;在所述等待响应时间大于预设等待时间的情况下,确定所述第一路由查询请求未获取到所述 第一路由查询请求对应的第一回应信息;在所述等待响应时间小于等于预设等待时间的情况下,确定所述第一路由查询请求已获取到所述第一路由查询请求对应的第一回应信息。
可以理解的是,由于第一路由查询请求本质上是对于该失效状态的路由表项包括的下一跳地址进行查询的单播请求,因此,对于失效状态的路由表项发送第一路由查询请求是存在一定等待时间的,从未避免长时间无法结束该第一路由查询请求,保证路由查询的时效性。
在一个示例性实施例中,确定所述第一路由查询请求未获取到所述第一路由查询请求对应的第一回应信息之后,上述方法还包括:在所述目标设备所在网络中广播发送第二路由查询请求;根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,将所述新增的路由表项添加到所述路由表,并将所述新增的路由表项的生效字段包括的生效结果设置为有效字符,以及将所述新增的路由表项中的生效字段包括的生效时间调整为最大计时时长。
例如,目标设备应首先向路由表中失效状态的路由表项包括的下一跳地址对应的目的设备发起单播路由查询请求(相当于上述的第一路由查询请求),目的设备收到该请求以后如果自己路由表中存在路由信息则转发查询请求,否则丢弃请求,目标设备发送单播路由查询请求以后等待一段时间,如果得到了回应则刷新本地路由信息(此处应直接恢复过期表项的超时时间),完成单播路由查询;如果没有得到回应,则单播路由查询失败,转为广播路由查询;即当第一路由查询请求查询失败的情况下,重新在目标设备所在网络中广播发送第二路由查询请求,并根据第二路由查询请求对应的第二回应信息确定出设置为对路由表进行更新的新增的路由表项。
在一个示例性实施例中,根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,包括:在所述第二回应信息存在多个的情况下,确定多个所述第二回应信息中每一个回应信息对应的回应报文携带的路由可达跳数,得到多个路由可达跳数;将所述多个路由可达跳数中跳数最小的第二回应信息确定为设置为确定所述新增的路由表项的目标回应信息,并使用所述目标回应信息对应的 目标下一跳地址与所述目标设备对应的节点地址确定所述新增的路由表项对应的目标地址组合。
可以理解的是,由于第二路由查询请求对应广播方式,因此,可能同时接收到多个其他目的设备反馈的第二回应信息,为了提升路由表项所指示的数据传输效率,通过确定路由查询回应报文中应携带路由可达的跳数,并应选择合适的下一跳地址记入目标设备的路由表(例如,跳数最小,下一跳信号强度最高等)。事实上这里最先收到第二回应信息应具有高优先级,至少它可以体现出当前数据往来的时间最短。
在一个示例性实施例中,根据所述生效字段的目标状态确定所述路由表的更新机制之后,上述方法还包括:在获取所述无线自组网中的异常路由信息的情况下,将所述路由表中存在的与所述异常路由信息对应的目标路由表项进行删除,其中,所述异常路由信息设置为指示无线自组网中发生网络变化后被错误使用的路由信息。
为了避免在高速缓存失效以前发生网络变化造成的路由信息被错误使用的问题,高速缓存的路由表还会提供即时失效机制。这样一旦协议其他部分发现了路由信息有误的时候(例如:可靠的传输层发现了目的地址不可达)可以通过该机制直接将存在异常路由信息对应的目标路由表项从路由表中删除,进一步提高了路由表对于网络变动的反应速度。
为了更好的理解上述路由表的更新方法的过程,以下再结合可选实施例对上述路由表的更新的实现方法流程进行说明,但不设置为限定本公开实施例的技术方案。
在本实施例中提供了一种路由表的更新方法,图3是根据本公开可选实施例的路由表的结构示意图,如图3所示,路由表中同时存在多个路由表项,每一个路由表项由节点地址、是否生效、生效时间、下一跳地址等内容对应的字段组成,并且还可以在上述字段的基础上添加刷新机制:可选的,刷新机制可以包括:路由查询对应的刷新机制,路过数据的刷新机制,设备汇报的刷新机制。需要说明的是,路由表是网络层核心功能,作为一个松散分布式的多跳网络,路由表的主 要目的是基于一个地址,寻找正确的下一跳设备,通过多跳中继,最终把数据报文发送到目的地址;上述路由表的整体的设计思路是基于一个本地的具有高速缓存特性的路由表和一系列传输控制报文实现无线自组织网络协议栈的路由功能。
作为一种可选的实施方式,对于目标设备对应的路由表的更新过程如下:
可选的,图4是根据本公开可选实施例的路由表的应用示意图,假设,此时为目标设备确定的路由表中存在3个路由表项,其中,第一路由表项的节点地址与下一跳地址可达,第一路由表项的生效字段对应的生效结果为有效字符,第一路由表项的生效字段对应的生效时间为180秒,表明该第一路由表项的生效字段在180s秒之后进入失效状态,该第一路由表项在180秒之后将变为失效表项需通过更新后才能继续使用,可选的,该生效时间对应的最大允许值为300秒。需要说明的是,生效时间对应的最大允许值可以根据路由表的实际使用情况进行灵活设置,本公开对此不作过多限定。
其次,第二路由表项的节点地址与下一跳地址可达,第二路由表项的生效字段对应的生效结果为无效字符,第二路由表项的生效字段对应的生效时间为0秒,表明该第二路由表项在路由表中变为失效表项,该第二路由表项无法指示目标设备与该第二路由表项中下一跳地址对应的其他设备的数据传输;
再次,第三路由表项的节点地址与下一跳地址可达,第三路由表项的生效字段对应的生效结果为有效字符,第三路由表项的生效字段对应的生效时间为180秒,并且路由表中存在第三路由表项对应的下一跳地址的路由查询结果,这时,将第三路由表项的生效字段对应的生效时间由180秒调整为生效时间对应的最大允许值300秒。
在更新时,当目标设备通过其转发的数据报文获取到了路由信息,或者目标设备收到的处于同一无线自组网中的其他设备发送的路由信息,此时,基于上述路由信息生成新的路由表项,如,可以根据数据报文对应的路由信息确定第四路由表项,可以根据其他设备发送的路由信息确定第五路由表项,并且由于新增加至路由表的表项,第四路由表项与第五路由表项中的生效字段对应的生效结果均为有效字符以及生效字段对应的生效时间为最大允许值300秒。图5是根据本公 开可选实施例的通过路由信息进行路由表更新的示意图。
可选的,路由表中的第一路由表项由于生效字段为有效状态,因此,第一路由表项在路由表中对应的更新机制为发起关于第一路由表项对应的下一跳地址的路由查询,根据路由查询的查询结果将第一路由表项对应的生效字段携带的生效时间由180秒调整为300秒,继而通过更新第一路由表项中的生效时间使得第一路由表项在路由表中保持持续有效,便于目标设备在数据传输时的使用。
可选的,路由表中的第二路由表项由于生效字段为无效状态,此时,该第二路由表项在未被目标使用时将处于静默状态,即只有目标设备需要向第二路由表项对应的下一跳地址进行数据传输时,才会发起对第二路由表项的更新机制,具体的,向无效状态的生效字段对应的地址组合中的下一跳地址发送单播路由查询(相当是本公开实施例中的第一路由查询请求),目标设备发送单播路由查询请求以后等待一段时间,如果得到了回应则刷新路由表中的本地路由信息,完成单播路由查询;
可选的,刷新流程具体是:将第二路由表项所对应的生效结果由无效字符调整为有效字符,以及将第二路由表项所对应的生效时间调整为最大计时时长,继而将第二路由表项对应的生效字段由失效状态调整为有效状态。此外,当向第二路由表项发送的单播路由查询请求在等待一段时间之后没有得到回应,则单播路由查询失败,转为广播路由查询;需要说明的是,上述等待一段时间的时长为允许直接恢复过期表项的超时时间。
可选的,在转为广播路由查询(相当是本公开实施例中的第二路由查询请求)之后,将根据广播路由查询对应的回应信息确定新的路由表项,将该新的路由表项添加至路由表中完成路由表的更新。
此外,当广播路由查询的查询结果同时存在多个的情况下,将最先收到回应的路由信息确定为生成新的路由表项的信息,因为,该回应具有高优先级,至少它可以体现出当前数据往来的时间最短,即在传输时路由可达的跳数最短,从而可以提升数据传输的效率,节省数据传输时间。
需要说明的是,上述路由表具有高速缓存属性,也就是说无线自组织网络协议中的路由表是有失效时间的,一个路由表项进入路由表以后同时需要记录其进入路由表的时间,每次更新该表项状态时都需要更新时间,如果一段时间没有变化,则该表项失效,其后的路由选择时不可再依赖该表项;生效时间建议5分钟。
需要注意的是,为了避免无谓的路由查询(特别的,广播路由查询应该是一次代价很大的广播查询,应尽量减少其数量),路由表应支持多种刷新机制,只要设备能够得到某一台设备的路由信息,就将之加入路由表中或刷新路由表中已有表项的生存时间,避免其失效;路由表路由信息刷新的时机可以是:a)路由查询结果;b)路过的数据报文中携带的源地址信息;c)设备主动汇报自己信息等。
综上,就是在确定路由表之后进行路由表的更新时,结合路由表项中生效字段的状态(即表项是有效,还是无效)来确定具体的更新机制;
可选的,当路由表项为有效,生效字段为有效状态,具体对应的是地址组合中的地址可达,生效结果为有效字符;生效时间未从5分钟倒计时变为0;
当路由表项为无效,生效字段为无效状态,具体对应的是地址组合中的地址可达,生效结果为无效字符;生效时间从5分钟倒计时变为0;
需要说明的是,上述5分钟为预设的倒计时时最大时长,该有效时间值可以根据实际使用情况灵活调整。
当路由表项为有效时,无论该路由表项是否被用来指示数据传输,对应更新的方式都是:a)通过路由查询的方式更新,设置为将生效时间对应的倒计时重置为5分钟;b)通过路过目标设备的数据报文中携带的源地址信息,在路由表中新增加源地址信息对应的路由表项;c)设备主动汇报自己信息,即目标设备收到了其他设备主动上传的路由信息,在当前路由表中查找与该路由信息对应的路由表项进行生效时间的更新(将倒计时重置为5分钟),如果路由表中没有对应的路由表项,则根据路由信息在路由表中增加新的路由表项。
当路由表项为无效时,则是确定目标设备需要向该路由表项对应的路由地址 传递数据,在需要使用该无效表项的情况下,通过路由查询的方式,在收到对应查询结果的情况下,将该无效路由表项的生效时间重置为5分钟,并将该无效路由表项的生效结果从无效字段刷新为有效字段。
需要说明的是,基于本地路由表缓存的路由技术现在就已经有了,例如AODV(Ad Hoc On-Demand Distance Vector),但是这些技术并没有在本地路由表中应用高速缓存技术,也就是说一旦在本地路由表中存入了某一节点的路由信息以后,该信息就会一直有效,这样如果到达该节点的路径发生了变化,或者该节点自身退出,移动甚至关机了,该技术并无法感知。因此这类技术通常还需要额外设计路由故障检测技术(例如AODV中的Hello消息),而上述技术方案中由于采用了高速缓存技术,即在本地存入了某一节点的路由信息以后,该信息会在一个约定的时间以后失效,而一旦该信息失效,再有发往该节点的数据请求时就需要重新进行路由表的更新检测,刷新路由信息。如此一来一方面避免了几乎全设备都参与的频繁的全网路由信息维护的开销,同时也避免了本地路由信息对路有变动无法感知而不断使用错误路由信息的问题。
另外,在即使在本地路由信息失效以后,该路由信息也不会被删除,而是会被标记为无效。当有需要发往被标记为无效的路由目的地的数据的时候,进行路由刷新的时候本技术并不会进行普通的全网广播方式的路由查询,而是会首先依据原有失效的路由信息进行一次单播路由查询。一般来说,大多数情况下原有失效的路由信息应该还是可用的,这样一次单播的路由查询就可以完成本地路由信息的刷新工作,只有路由信息真的出现了错误(中间节点或者目的节点发生了退出,移动或者关闭等情况),才会再进行一次全网广播方式的路由查询。这样就会进一步减小由于高速缓存造成的路由失效而引起的路由刷新的开销。高速缓存路由表即时失效的机制可以进一步加快网络变动侦测和反应速度。
综上,根据上述实施例,提供一种无线自组织网络的按需路由协议中的路由表中引入高速缓存技术,可以兼顾路由信息维护的开销和对网络路由变动的实时反应之间的平衡;同时提供了高速缓存路由表的即时失效机制,进一步加快对网络变动的反应速度,减少资源浪费,提高用户满意度。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例的方法。
图6是根据本公开实施例的一种路由表的更新装置的结构框图(一);如图6所示,包括:
配置模块42,设置为为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;
可选的,上述地址组合包括:当前目标设备对应的节点地址以及下一跳地址。
需要说明的是,上述目标设备为一个或多个设备,本公开实施例对此不作限定。上述路由表中存储时,为了提升对路由表的更新效率,可以将路由表以高速缓存的方式进行存储,即为路由表赋予高速缓存属性,在这种情况下,使得无线自组织网络协议中的路由表具有了失效时间,即在路由表中的路由表项中增加了设置为记录生效时间以及生效结果的生效字段,例如,当一个新的路由表项进入路由表以后,需要记录其进入路由表的时间,在上述路由表中生效时间的记录方式为倒计时记录,即在新的路由表项进入路由表之后,在将生效结果设置为有效字符的情况下,将对应的生效时间设置为默认的最大计时时长,且每次更新该表项状态时都需要对应更新最大计时时长的时间,如果一段时间没有变化,则该路由表项失效,其后的路由选择时不可再依赖该路由表项;可选的,路由表项的生效时间可以设置为5分钟,也可以是其他时长;本公开实施例对此不做限定。
确定模块44,设置为根据所述生效字段的目标状态确定所述路由表的更新机制。通过上述装置,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址 组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制;采用上述技术方案,解决了路由表的更新检测复杂且容易阻塞网络等问题,本公开实施例中,通过为无线自组网络配置对应的路由表,并通过在该路由表中的路由表项设置对应的生效字段,继而确定不同路由表项的生效状态,最终通过生效状态确定对应适合的路由表的更新机制,通过路由表对应的更新机制提升路由表更新效率,从而减少路由表的维护次数,降低数据流量消耗,保证无线自组网中进行数据传输时的网络畅通。
在一个示例性实施例中,上述确定模块44,还设置为在所述生效字段为有效状态的情况下,根据所述目标设备转发的数据报文对应的路由信息对所述路由表更新;或,根据其他设备上报的路由信息对所述路由表更新,其中,所述目标设备与其他设备处于同一无线自组网。
可选的,上述有效状态是:路由表项包括的生效结果为有效字符,且生效时间不为0。
可以理解的是,当路由表中的路由表项对应的生效状态为有效状态时,说明此时该路由表项可以被快速应用至数据传输,但是由于生效字段包括的生效时间是在不断变化的,当生效时间为0时,路由表中的路由表项对应的生效状态将会快速从有效状态更新为无效状态,使得无法被继续设置为数据传输,因此,为了保证路由表中的路由表项持续表现为有效状态,可以通过目标设备在转发数据报文时获取的路由信息对路由表进行更新;
具体的,获取转发数据报文中携带的源地址信息,在当前路由表中存在与该源地址信息对应的下一跳地址的情况下,确定该下一跳地址对应的目标地址组合,并将该目标地址组合对应的生效字段所对应的生效时间重新调整为最大计时时长。在当前路由表中不存在与该源地址信息对应的下一跳地址的情况下,将该源地址信息对应的地址作为新的下一跳地址与目标设备对应的节点地址组合成新的地址组合,并将该新的地址组合对应的生效字段包括的生效结果设置为有效字符,以及将该新的地址组合对应生效字段包括的生效时间调整为最大计时时长,确定出一个新的路由表项,将该路由表项添加至路由表中完成对路由表进行更新。
可选的,在获取到其他设备主动上报的路由信息后,也可以根据其他设备上报的路由信息对应的下一跳地址,确定存在与下一跳地址对应的路由表项的情况下,将地址匹配的当前路由表中为有效状态的路由表项包括的生效时间进行刷新(即将生效时间重新调整为最大计时时长),在不存在与下一跳地址对应的路由表项的情况下,将下一跳地址与目标设备对应的节点地址组合成新的地址组合,并将该新的地址组合对应的生效字段包括的生效结果设置为有效字符,以及将该新的地址组合对应生效字段包括的生效时间调整为最大计时时长,确定出一个新的路由表项,将该路由表项添加至路由表中完成对路由表进行更新。
在一个示例性实施例中,上述确定模块44,还设置为在所述生效字段为有效状态的情况下,根据所述路由表的查询结果对目标状态为有效状态的生效字段所对应的生效时间进行更新;在所述生效字段为失效状态,且目标设备需要向路由表项对应的下一跳地址进行数据传输的情况下,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新。
可选的,还以通过发起路由查询的方式对路由表进行更新,但是需要注意的是,假如,路由表中路由表项对应的生效字段为有效状态,此时仅是是通过路由表的查询结果对路由表项包括的生效字段所对应的生效时间进行更新,即通过查询将路由表项的生效字段持续保持为有效状态,使得在使用该路由表项在使用时可以快速应用至数据传输。此外,当路由表中路由表项对应的生效字段为失效状态,这时路由查询是需要前置条件的,即当目标设备需要向该失效状态的路由表项对应的下一跳地址进行数据传输时,才会触发对于该路由表项的查询,继而避免无谓的路由查询。
在一个示例性实施例中,上述确定模块44还包括:第一请求单元,设置为向所述下一跳地址发送第一路由查询请求;其中,所述第一路由查询请求携带有设置为指示所述第一路由查询请求被允许转发次数对应的生存时间值;基于所述第一路由查询请求对应的第一回应信息将所述失效状态的生效字段所对应的生效结果由无效字符调整为有效字符,以及将所述失效状态的生效字段所对应的生效时间调整为最大计时时长。
简单来说,在目标设备需要向该失效状态的路由表项对应的下一跳地址进行数据传输时,才会触发对于该路由表项的查询,并且为了保证路由查询请求不会被无限制转发,在路由查询请求中添加生存时间值,该生存时间值与当前自组网络对应的最大跳数有关,进而当携带生存时间值的路由查询请求被其他设备转发一次之后,对应的生存时间值减一,当生存时间值变为0时,停止该路由查询请求的转发,从而有效的避免路由查询中出现路由环路的问题。可以理解的是,即使路由表中某一路由表项失效,在需要访问该设备的时候也不应简单丢弃该表项,重新进行一次广播路由查询,而是应基于已有表项进行一次单播路由查询,如果成功则刷新路由表项,失败再进行广播路由查询。最终,在获取到路由查询请求对应的回应信息之后,利用回应信息对该失效状态的路由表项进行更新,将该失效状态的路由表项包括的生效字段所对应的生效结果由无效字符调整为有效字符,以及将生效字段所对应的生效时间调整为最大计时时长,从而使得失效状态的路由表项可以在路由表中恢复成有效状态的路由表项。
在一个示例性实施例中,上述确定模块44还包括:等待单元,设置为获取所述第一路由查询请求发出后的等待响应时间;在所述等待响应时间大于预设等待时间的情况下,确定所述第一路由查询请求未获取到所述第一路由查询请求对应的第一回应信息;在所述等待响应时间小于等于预设等待时间的情况下,确定所述第一路由查询请求已获取到所述第一路由查询请求对应的第一回应信息。
可以理解的是,由于第一路由查询请求本质上是对于该失效状态的路由表项包括的下一跳地址进行查询的单播请求,因此,对于失效状态的路由表项发送第一路由查询请求是存在一定等待时间的,从未避免长时间无法结束该第一路由查询请求,保证路由查询的时效性。
在一个示例性实施例中,上述确定模块44还包括:第二请求单元,设置为在所述目标设备所在网络中广播发送第二路由查询请求;根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,将所述新增的路由表项添加到所述路由表,并将所述新增的路由表项的生效字段包括的生效结果设置为有效字符,以及将所述新增的路由表项中的生效字段包括的生效时间调整为最大计时时长。
例如,目标设备应首先向路由表中失效状态的路由表项包括的下一跳地址对应的目的设备发起单播路由查询请求(相当于上述的第一路由查询请求),目的设备收到该请求以后如果自己路由表中存在路由信息则转发查询请求,否则丢弃请求,目标设备发送单播路由查询请求以后等待一段时间,如果得到了回应则刷新本地路由信息(此处应直接恢复过期表项的超时时间),完成单播路由查询;如果没有得到回应,则单播路由查询失败,转为广播路由查询;即当第一路由查询请求查询失败的情况下,从新在目标设备所在网络中广播发送第二路由查询请求,并根据第二路由查询请求对应的第二回应信息确定出设置为对路由表进行更新的新增的路由表项。
在一个示例性实施例中,上述第二请求单元,还设置为在所述第二回应信息存在多个的情况下,确定多个所述第二回应信息中每一个回应信息对应的回应报文携带的路由可达跳数,得到多个路由可达跳数;将所述多个路由可达跳数中跳数最小的第二回应信息确定为设置为确定所述新增的路由表项的目标回应信息,并使用所述目标回应信息对应的目标下一跳地址与所述目标设备对应的节点地址确定所述新增的路由表项对应的目标地址组合。
可以理解的是,由于第二路由查询请求对应广播方式,因此,可能同时接收到多个其他目的设备反馈的第二回应信息,为了提升路由表项所指示的数据传输效率,通过确定路由查询回应报文中应携带路由可达的跳数,并应选择合适的下一跳地址记入目标设备的路由表(例如,跳数最小,下一跳信号强度最高等)。事实上这里最先收到第二回应信息应具有高优先级,至少它可以体现出当前数据往来的时间最短。
在一个示例性实施例中,图7是根据本公开实施例的一种路由表的更新装置的结构框图(二);如图7所示,上述装置还包括:删除模块50。
在一个示例性实施例中,上述装置还包括:删除模块,设置为在获取所述无线自组网中的异常路由信息的情况下,将所述路由表中存在的与所述异常路由信息对应的目标路由表项进行删除,其中,所述异常路由信息设置为指示无线自组网中发生网络变化后被错误使用的路由信息。
为了避免在高速缓存失效以前发生网络变化造成的路由信息被错误使用的问题,高速缓存的路由表还会提供即时失效机制。这样一旦协议其他部分发现了路由信息有误的时候(例如:可靠的传输层发现了目的地址不可达)可以通过该机制直接将存在异常路由信息对应的目标路由表项从路由表中删除,进一步提高了路由表对于网络变动的反应速度。
本公开的实施例还提供了一种存储介质,该存储介质包括存储的程序,其中,上述程序运行时执行上述任一项的方法。
可选地,在本实施例中,上述存储介质可以被设置为存储设置为执行以下步骤的程序代码:
S1,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;
S2,根据所述生效字段的目标状态确定所述路由表的更新机制。
本公开的实施例还提供了一种电子装置,包括存储器和处理器,该存储器中存储有计算机程序,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,上述电子装置还可以包括传输设备以及输入输出设备,其中,该传输设备和上述处理器连接,该输入输出设备和上述处理器连接。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
根据本公开实施例的又一个方面,还提供了一种用于实施上述路由表的更新方法的电子装置,如图8所示,是根据本公开实施例的一种可选的电子装置的结构框图,该电子装置包括存储器702和处理器704,该存储器702中存储有计算机程序,该处理器704被设置为通过计算机程序执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述电子装置可以位于计算机网络的多个网络设备中的至少一个网络设备。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;
S2,根据所述生效字段的目标状态确定所述路由表的更新机制。
可选地,本领域普通技术人员可以理解,图8所示的结构仅为示意,电子装置也可以是智能手机(如Android手机、iOS手机等)、平板电脑、掌上电脑以及移动互联网设备(Mobile Internet Devices,MID)、PAD等终端设备。图8其并不对上述电子装置的结构造成限定。例如,电子装置还可包括比图8中所示更多或者更少的组件(如网络接口等),或者具有与图8所示不同的配置。
其中,存储器702可用于存储软件程序以及模块,如本公开实施例中的路由表的更新方法和装置对应的程序指令/模块,处理器704通过运行存储在存储器702内的软件程序以及模块,从而执行各种功能应用以及数据处理,即实现上述的路由表的更新方法。存储器702可包括高速随机存储器,还可以包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器702可进一步包括相对于处理器704远程设置的存储器,这些远程存储器可以通过网络连接至终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。作为一种示例,如图8所示,上述存储器702中可以但不限于包括上述路由表的更新装置中的配置模块42、确定模块44。此外,还可以包括但不限于上述路由表的更新装置中的其他模块单元,本示例中不再赘述。
可选地,上述的传输装置706用于经由一个网络接收或者发送数据。上述的网络具体实例可包括有线网络及无线网络。在一个实例中,传输装置706包 括一个网络适配器(Network Interface Controller,NIC),其可通过网线与其他网络设备与路由器相连从而可与互联网或局域网进行通讯。在一个实例中,传输装置706为射频(Radio Frequency,RF)模块,其用于通过无线方式与互联网进行通讯。
此外,上述电子装置还包括:显示器708,用于显示上述路由表的更新;和连接总线710,用于连接上述电子装置中的各个模块部件。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
显然,本领域的技术人员应该明白,上述的本公开的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本公开不限制于任何特定的硬件和软件结合。
以上所述仅是本公开的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本公开原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本公开的保护范围。
Claims (18)
- 一种路由表的更新方法,包括:为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;根据所述生效字段的目标状态确定所述路由表的更新机制。
- 根据权利要求1所述的路由表的更新方法,其中,根据所述路由表项对应生效字段的目标状态确定所述路由表的更新机制,包括:在所述生效字段为有效状态的情况下,根据所述目标设备转发的数据报文对应的路由信息对所述路由表更新;或,根据其他设备上报的路由信息对所述路由表更新,其中,所述目标设备与其他设备处于同一无线自组网。
- 根据权利要求1所述的路由表的更新方法,其中,根据所述路由表项对应生效字段的目标状态确定所述路由表的更新机制,还包括:在所述生效字段为有效状态的情况下,根据所述路由表的查询结果对目标状态为有效状态的生效字段所对应的生效时间进行更新;在所述生效字段为失效状态,且目标设备需要向路由表项对应的下一跳地址进行数据传输的情况下,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新。
- 根据权利要求3所述的路由表的更新方法,其中,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新,包括:向所述下一跳地址发送第一路由查询请求;其中,所述第一路由查询请求携带有设置为指示所述第一路由查询请求被允许转发次数对应的生存时间值;基于所述第一路由查询请求对应的第一回应信息将所述失效状态的生效字段所对应的生效结果由无效字符调整为有效字符,以及将所述失效状态的生 效字段所对应的生效时间调整为最大计时时长。
- 根据权利要求4所述的路由表的更新方法,其中,向所述下一跳地址发送第一路由查询请求之后,所述方法还包括:获取所述第一路由查询请求发出后的等待响应时间;在所述等待响应时间大于预设等待时间的情况下,确定所述第一路由查询请求未获取到所述第一路由查询请求对应的第一回应信息;在所述等待响应时间小于等于预设等待时间的情况下,确定所述第一路由查询请求已获取到所述第一路由查询请求对应的第一回应信息。
- 根据权利要求5所述的路由表的更新方法,其中,确定所述第一路由查询请求未获取到所述第一路由查询请求对应的第一回应信息之后,所述方法还包括:在所述目标设备所在网络中广播发送第二路由查询请求;根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,将所述新增的路由表项添加到所述路由表,并将所述新增的路由表项的生效字段包括的生效结果设置为有效字符,以及将所述新增的路由表项中的生效字段包括的生效时间调整为最大计时时长。
- 根据权利要求6所述的路由表的更新方法,其中,根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,包括:在所述第二回应信息存在多个的情况下,确定多个所述第二回应信息中每一个回应信息对应的回应报文携带的路由可达跳数,得到多个路由可达跳数;将所述多个路由可达跳数中跳数最小的第二回应信息确定为设置为确定所述新增的路由表项的目标回应信息,并使用所述目标回应信息对应的目标下一跳地址与所述目标设备对应的节点地址确定所述新增的路由表项对应的目标地址组合。
- 根据权利要求1所述的路由表的更新方法,其中,根据所述生效字段的目标状态确定所述路由表的更新机制之后,所述方法还包括:在获取所述无线自组网中的异常路由信息的情况下,将所述路由表中存在的与所述异常路由信息对应的目标路由表项进行删除,其中,所述异常路由信息设置为指示无线自组网中发生网络变化后被错误使用的路由信息。
- 一种路由表的更新装置,包括:配置模块,设置为为无线自组网中的目标设备配置路由表,其中,所述路由表包括:路由表项,且所述路由表项设置为指示所述目标设备进行数据传输的地址组合和生效字段,所述生效字段包括:生效结果和生效时间;确定模块,设置为根据所述生效字段的目标状态确定所述路由表的更新机制。
- 根据权利要求9所述的路由表的更新装置,其中,所述确定模块,还设置为在所述生效字段为有效状态的情况下,根据所述目标设备转发的数据报文对应的路由信息对所述路由表更新;或,根据其他设备上报的路由信息对所述路由表更新,其中,所述目标设备与其他设备处于同一无线自组网。
- 根据权利要求9所述的路由表的更新装置,其中,所述确定模块,还设置为在所述生效字段为有效状态的情况下,根据所述路由表的查询结果对目标状态为有效状态的生效字段所对应的生效时间进行更新;在所述生效字段为失效状态,且目标设备需要向路由表项对应的下一跳地址进行数据传输的情况下,根据所述路由表的查询结果对目标状态为失效状态的生效字段所对应的生效结果更新。
- 根据权利要求11所述的路由表的更新装置,其中,所述确定模块还包括:第一请求单元,设置为向所述下一跳地址发送第一路由查询请求;其中,所述第一路由查询请求携带有设置为指示所述第一路由查询请求被允许转发次数对应的生存时间值;基于所述第一路由查询请求对应的第一回应信息将所述失效状态的生效字段所对应的生效结果由无效字符调整为有效字符,以及将所述失效状态的生效字段所对应的生效时间调整为最大计时时长。
- 根据权利要求12所述的路由表的更新装置,其中,所述确定模块还包括:等 待单元,设置为获取所述第一路由查询请求发出后的等待响应时间;在所述等待响应时间大于预设等待时间的情况下,确定所述第一路由查询请求未获取到所述第一路由查询请求对应的第一回应信息;在所述等待响应时间小于等于预设等待时间的情况下,确定所述第一路由查询请求已获取到所述第一路由查询请求对应的第一回应信息。
- 根据权利要求13所述的路由表的更新装置,其中,所述确定模块还包括:第二请求单元,设置为在所述目标设备所在网络中广播发送第二路由查询请求;根据所述第二路由查询请求对应的第二回应信息确定新增的路由表项,将所述新增的路由表项添加到所述路由表,并将所述新增的路由表项的生效字段包括的生效结果设置为有效字符,以及将所述新增的路由表项中的生效字段包括的生效时间调整为最大计时时长。
- 根据权利要求14所述的路由表的更新装置,其中,所述第二请求单元,还设置为在所述第二回应信息存在多个的情况下,确定多个所述第二回应信息中每一个回应信息对应的回应报文携带的路由可达跳数,得到多个路由可达跳数;将所述多个路由可达跳数中跳数最小的第二回应信息确定为设置为确定所述新增的路由表项的目标回应信息,并使用所述目标回应信息对应的目标下一跳地址与所述目标设备对应的节点地址确定所述新增的路由表项对应的目标地址组合。
- 根据权利要求9所述的路由表的更新装置,其中,所述装置还包括:删除模块,设置为在获取所述无线自组网中的异常路由信息的情况下,将所述路由表中存在的与所述异常路由信息对应的目标路由表项进行删除,其中,所述异常路由信息设置为指示无线自组网中发生网络变化后被错误使用的路由信息。
- 一种计算机可读的存储介质,所述计算机可读的存储介质包括存储的程序,其中,所述程序运行时执行上述权利要求1至8任一项中所述的方法。
- 一种电子装置,包括存储器和处理器,所述存储器中存储有计算机程序,所述处理器被设置为通过所述计算机程序执行所述权利要求1至8任一项中所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211349587.8A CN115734306A (zh) | 2022-10-31 | 2022-10-31 | 路由表的更新方法和装置、存储介质及电子装置 |
| CN202211349587.8 | 2022-10-31 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024092913A1 true WO2024092913A1 (zh) | 2024-05-10 |
Family
ID=85294169
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2022/134468 Ceased WO2024092913A1 (zh) | 2022-10-31 | 2022-11-25 | 路由表的更新方法和装置、存储介质及电子装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN115734306A (zh) |
| WO (1) | WO2024092913A1 (zh) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20250023819A1 (en) * | 2023-07-11 | 2025-01-16 | Korea University Research And Business Foundation | Device and method for lightweight container packet processing in iot environment |
| CN119743427A (zh) * | 2024-09-29 | 2025-04-01 | 中电信数智科技有限公司 | 一种基于标记进行选路的方法、系统、设备和介质 |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110225311A1 (en) * | 2010-03-10 | 2011-09-15 | Thomson Licensing | Unified cache and peer-to-peer method and apparatus for streaming media in wireless mesh networks |
| CN110691379A (zh) * | 2019-10-12 | 2020-01-14 | 湖南智领通信科技有限公司 | 一种适于无线自组网的主动式路由通信方法 |
| CN114786233A (zh) * | 2022-06-21 | 2022-07-22 | 广州慧睿思通科技股份有限公司 | 移动自组网通信方法、装置、系统及计算机存储介质 |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| GB0317372D0 (en) * | 2003-07-25 | 2003-08-27 | Royal Holloway University Of L | Routing protocol for ad hoc networks |
| CN101848157A (zh) * | 2010-05-14 | 2010-09-29 | 北京星网锐捷网络技术有限公司 | 控制路由更新报文产生的方法及网络设备 |
| CN113347088B (zh) * | 2021-06-25 | 2022-07-12 | 中国科学院软件研究所 | 一种改进的无线自组织网络多链路路由方法 |
| CN113992579B (zh) * | 2021-09-23 | 2023-03-31 | 新华三信息安全技术有限公司 | 一种路由表项存储方法、查找方法及装置 |
-
2022
- 2022-10-31 CN CN202211349587.8A patent/CN115734306A/zh active Pending
- 2022-11-25 WO PCT/CN2022/134468 patent/WO2024092913A1/zh not_active Ceased
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20110225311A1 (en) * | 2010-03-10 | 2011-09-15 | Thomson Licensing | Unified cache and peer-to-peer method and apparatus for streaming media in wireless mesh networks |
| CN110691379A (zh) * | 2019-10-12 | 2020-01-14 | 湖南智领通信科技有限公司 | 一种适于无线自组网的主动式路由通信方法 |
| CN114786233A (zh) * | 2022-06-21 | 2022-07-22 | 广州慧睿思通科技股份有限公司 | 移动自组网通信方法、装置、系统及计算机存储介质 |
Non-Patent Citations (2)
| Title |
|---|
| CHUNJIANG REN: "A Moving State Based Routing Algorithm Invehicular Ad Hoc Networks", COMPUTER ENGINEERING & SCIENCE, vol. 40, no. 3, 31 March 2018 (2018-03-31), pages 464 - 471, XP093168581 * |
| CHUNMEI ZHUANG: "Analysis and Improvement of Expired Routing Management Mechanism of AODV Routing Protocol", COMPUTER TECHNOLOGY AND DEVELOPMENT, vol. 19, no. 7, 31 July 2009 (2009-07-31), pages 44 - 47, XP093168578 * |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20250023819A1 (en) * | 2023-07-11 | 2025-01-16 | Korea University Research And Business Foundation | Device and method for lightweight container packet processing in iot environment |
| CN119743427A (zh) * | 2024-09-29 | 2025-04-01 | 中电信数智科技有限公司 | 一种基于标记进行选路的方法、系统、设备和介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN115734306A (zh) | 2023-03-03 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| RU2544985C2 (ru) | Выбор маршрута в беспроводных сетях | |
| Huhtonen | Comparing AODV and OLSR routing protocols | |
| KR101144243B1 (ko) | 하이브리드 메쉬 라우팅 프로토콜 | |
| JP4532554B2 (ja) | 無線ネットワークにおいて異なるタイプのノード間でデータのルーティングを行うためのシステム及び方法 | |
| CN112055343B (zh) | 蓝牙Mesh网络泛洪方法、装置及存储介质 | |
| CN108123873B (zh) | 数据转发路径选择方法及装置、存储介质、服务端 | |
| WO2024092913A1 (zh) | 路由表的更新方法和装置、存储介质及电子装置 | |
| CN106330731B (zh) | 一种无线自组网的多播树建立方法 | |
| WO2016086713A1 (zh) | 一种等价多路径的出接口更新方法及装置 | |
| CN115086923A (zh) | 蓝牙网络及其通信方法、设备和存储介质 | |
| CN106953683B (zh) | 一种适合基于mf-tdma卫星信道的大规模动态组网的路由实现方法 | |
| EP3496431B1 (en) | Message transmission method and apparatus | |
| CN110943918A (zh) | 无中心多路并发传输系统的组网方法 | |
| US20120155322A1 (en) | Method And Apparatus For Network Node Discovery | |
| JP5004999B2 (ja) | ハイブリッド型メッシュ・ルーティング・プロトコル | |
| Rajaram et al. | Power aware routing for MANET using on-demand multipath routing protocol | |
| CN102118826A (zh) | 网络中节点间的多跳通信方法 | |
| CN111555969A (zh) | 一种基于Sub-G星型网络和mesh网络的网关 | |
| WO2020150349A1 (en) | Device presence method and system for mesh network management | |
| CN114762389B (zh) | 具有组合节点的网络中的路由发现 | |
| WO2024092912A1 (zh) | 路由表的查询方法和装置、存储介质及电子装置 | |
| Shekhar et al. | Mobile agents aided multicast routing in mobile ad hoc networks | |
| CN114760676A (zh) | 一种智能终端的组网方法、装置、电子设备及存储介质 | |
| CN102547899A (zh) | 一种应用于无线传感网的自适应路由选择方法 | |
| JP5438711B2 (ja) | 無線通信システム |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22964209 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 22964209 Country of ref document: EP Kind code of ref document: A1 |