Aging Method, Device, and Readable Storage Medium for Address Translation Protocol Entries

By maintaining the available state of ARP table entry when confirming the connection state with the second electronic device in the physical layer in the first electronic device, the problem of device network lag caused by aging of ARP table entry is solved, and the user experience is improved.

CN115883427BActive Publication Date: 2025-06-13HUAWEI TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202111154499.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-29
Publication Date
2025-06-13
Estimated Expiration
2041-09-29

AI Technical Summary

Technical Problem

During network communication, ARP table entry aging causes the device to sleep and may not reply to ARP packets, resulting in the ARP table entry being deleted, which will affect the speed of the device when it re-surfs the Internet.

Method used

By confirming the connection state with the second electronic device in the physical layer in the first electronic device, the available state of the ARP table entry is maintained and the timing is re-aging, deleting the ARP table entry in the physical layer connection state is avoided.

Benefits of technology

It effectively avoids unnecessary deletion of ARP table items, improves the speed of the device when it re-surfs the Internet, and improves the user's communication experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115883427B_ABST
    Figure CN115883427B_ABST
Patent Text Reader

Abstract

The present application provides an aging method, device, and readable storage medium for address translation protocol entries, belonging to the field of electronic communication technologies, including: a first electronic device establishes an address translation protocol entry for a second electronic device that accesses it, and ages the address translation protocol entry; when the timing time reaches a first preset time, the first electronic device confirms the connection status with the second electronic device at the physical layer; when it is confirmed that the connection with the second electronic device at the physical layer is in a connected state, the first electronic device maintains the available state of the address translation protocol entry and ages the address translation protocol entry again, and when the first electronic device confirms that the connection with the second electronic device at the physical layer is in a disconnected state, the first electronic device continues to perform aging processing on the address translation protocol entry. This method does not delete the address translation protocol entry when it is determined that the physical layer link between devices is in a connected state, avoiding affecting the speed when the devices communicate again.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a method, device, and readable storage medium for aging address translation protocol entries. Background Art

[0002] In the process of network communication, it often occurs that packets are forwarded across local area networks. That is, communication between a sending device and a receiving device requires an intermediate device. For example, a switching device resolves IP addresses and MAC addresses. The switching device resolves IP addresses and MAC addresses according to address resolution protocol (ARP) entries to achieve packet forwarding across local area networks.

[0003] In the prior art, there is an aging time for ARP entries. During the aging time, an ARP request is sent to confirm whether the connection with the electronic device is smooth. When a response packet corresponding to the ARP request is obtained, the aging time of the entry will be extended, and it will enter another state of aging to extend the aging time. If no response packet is received, the entry will be deleted after a certain time to release memory. However, when the sending device is in a sleep state, it may not reply to ARP packets, resulting in the deletion of ARP entries. When the sending device is used again, since the ARP entry has been deleted, the corresponding ARP entry needs to be recreated, which is time-consuming and causes the sending device to experience network lag when accessing the Internet. Summary of the Invention

[0004] In view of this, the present invention provides a method, device, and readable storage medium for aging address translation protocol entries to improve the user communication experience.

[0005] Some embodiments of the present application provide a method for aging address translation protocol entries. The present application is introduced from multiple aspects below, and the embodiments and beneficial effects of the following multiple aspects can be mutually referred to.

[0006] In a first aspect, the present invention provides a method for aging address translation protocol entries, which is applied to a first electronic device. The method includes: the first electronic device creates an address translation protocol entry for a second electronic device that accesses; the first electronic device ages and times the address translation protocol entry; when the timing time reaches a first preset time, the first electronic device confirms the connection state with the second electronic device at the physical layer; when the first electronic device confirms that the connection state with the second electronic device at the physical layer is a connected state, the first electronic device maintains the available state of the address translation protocol entry and ages and times the address translation protocol entry again, and when the first electronic device confirms that the connection state with the second electronic device at the physical layer is a disconnected state, the first electronic device continues to perform aging processing on the address translation protocol entry.

[0007] According to the method of the embodiments of the present application, when the first electronic device determines that it is in a physical layer connection state with the second electronic device, it can maintain the availability of the address translation protocol entry established by the second electronic device. Therefore, when the mobile phone reconnects to the Internet, there is no need to recreate the address translation protocol entry corresponding to the second electronic device, and the speed of communication between the mobile phone and the router again will not be affected.

[0008] In a possible implementation of the first aspect above, when the timing time reaches the first preset time, when the address translation protocol entry is in the stale state during the aging timing period, and the timer for the stale state in which the first electronic device confirms the address translation protocol entry expires and no device references the address translation protocol entry, the first electronic device confirms that it is in a connected state with the second electronic device at the physical layer. This method can, when the address translation protocol entry is in the stale state and the timer expires, not directly delete it, but increase the confirmation that when the first electronic device is in a connected state with the second electronic device at the physical layer, the address translation protocol entry corresponding to the second electronic device can be maintained as available.

[0009] In a possible implementation of the first aspect above, for the first electronic device to maintain the available state of the address translation protocol entry, it includes: the first electronic device re-ages the stale state of the address translation protocol entry, or jumps to and executes any state before the stale state for aging timing. Thus, it is ensured that the address translation protocol entry is maintained as available.

[0010] In a possible implementation of the first aspect above, in the case where the first electronic device confirms that it is in a disconnected state with the second electronic device at the physical layer, the first electronic device continues to perform aging processing on the address translation protocol entry, including: when the aging time of the address translation protocol entry expires, the first electronic device deletes the address translation protocol entry. In a possible implementation of the first aspect above, when the timing time reaches the first preset time, the address translation protocol entry is in the delay state during the aging timing period, and when the delay state timer expires, the first electronic device confirms that it is in a connected state with the second electronic device at the physical layer. That is to say, setting the confirmation of being in a connected state with the second electronic device at the physical layer before the probing state can directly maintain the availability of the address translation protocol entry when the first electronic device confirms that it is in a connected state with the second electronic device at the physical layer, without entering the probing state, saving communication resources.

[0011] In a possible implementation of the first aspect above, maintaining the available state of the address translation protocol entry includes: the first electronic device re-ages the delay state of the address translation protocol entry, or jumps to and executes any state before the delay state for aging timing. Thus, it is ensured that the address translation protocol entry is maintained as available.

[0012] In a possible implementation of the first aspect above, when the first electronic device confirms that the connection with the second electronic device is in a disconnected state at the physical layer, the first electronic device continues to perform aging processing on the address translation protocol entry, including: when the first electronic device confirms that the connection with the second electronic device is in a disconnected state at the physical layer, the address translation protocol entry is deleted.

[0013] In a possible implementation of the first aspect above, the first electronic device confirms the connection state with the second electronic device at the physical layer according to the device information recorded in the online device list.

[0014] In a possible implementation of the first aspect above, the method includes: the first electronic device establishes an address translation protocol entry, and if the first electronic device does not receive a message sent by the second electronic device within a preset time period, the first electronic device performs aging timing on the address translation protocol entry.

[0015] In a second aspect, the present application also provides an electronic device, including:

[0016] A generation unit, configured to establish an address translation protocol entry for the accessed second electronic device;

[0017] A timer, configured to perform aging timing for the address translation protocol entry;

[0018] A processing unit, configured to confirm the connection state with the second electronic device at the physical layer when the timing time reaches a first preset time;

[0019] The processing unit is configured to maintain the available state of the address translation protocol entry when it is confirmed that the connection with the second electronic device is in a connected state at the physical layer, and re-perform aging timing for the address translation protocol entry through the timer, and continue to perform aging processing on the address translation protocol entry when it is confirmed that the connection with the second electronic device is in a disconnected state at the physical layer.

[0020] According to the electronic device of the embodiment of the present application, when it is determined that the connection with the second electronic device is in a physical layer connection state, the address translation protocol entry established by the second electronic device can be maintained to be available, so that when the mobile phone reconnects to the Internet, there is no need to re-establish the address translation protocol entry corresponding to the second electronic device, and the speed of communication between the mobile phone and the router again will not be affected.

[0021] In a possible implementation of the second aspect described above, when the timing time reaches the first preset time, and the Address Resolution Protocol (ARP) entry is in the stale state during the aging timer period, and the processing unit confirms that the timer for the stale state of the ARP entry has expired and no device references the ARP entry, the processing unit confirms that it is in a connected state with the second electronic device at the physical layer. This method can, when the ARP entry is in the stale state and the timer expires, not directly delete it, but instead increase the availability of the ARP entry corresponding to the second electronic device when the first electronic device confirms that it is in a connected state with the second electronic device at the physical layer.

[0022] In a possible implementation of the second aspect described above, the processing unit maintains the available state of the ARP entry, including: the processing unit is used to re-age the stale state of the ARP entry through the timing module, or jump to and execute any state before the stale state for aging timing. Thus, it ensures the maintenance of the availability of the ARP entry.

[0023] In a possible implementation of the second aspect described above, in the case where the processing unit confirms that it is in a disconnected state from the second electronic device at the physical layer, the processing unit is used to delete the ARP entry when the aging time of the ARP entry expires.

[0024] In a possible implementation of the second aspect described above, when the timing time reaches the first preset time, the ARP entry is in the delay state during the aging timer period, and when the delay state timer expires, the processing unit confirms that it is in a connected state with the second electronic device at the physical layer. That is to say, setting the confirmation of the connected state with the second electronic device at the physical layer before the probing state can directly maintain the availability of the ARP entry when the first electronic device confirms that it is in a connected state with the second electronic device at the physical layer, without entering the probing state, saving communication resources.

[0025] In a possible implementation of the second aspect described above, the processing unit is used to re-age the delay state of the ARP entry through the timer, or jump to and execute any state before the delay state for aging timing to maintain the available state of the ARP entry. Thus, it ensures the maintenance of the availability of the ARP entry.

[0026] In a possible implementation of the second aspect described above, the electronic device further includes a communication unit. When the processing unit confirms that it is in a disconnected state from the second electronic device at the physical layer, the ARP entry is deleted.

[0027] In a possible implementation of the second aspect described above, the processing unit confirms the connection status with the second electronic device at the physical layer according to the device information recorded in the online device list.

[0028] In a possible implementation of the second aspect described above, the method includes: if the processing unit does not receive a message sent by the second electronic device within a preset duration, the processing unit performs aging timing on the address translation protocol table entry.

[0029] In a third aspect, the present application further provides an electronic device, including:

[0030] A memory for storing instructions executed by one or more processors of the device;

[0031] A processor for executing the instructions, so that the electronic device executes the method of the embodiment of the first aspect described above.

[0032] In a fourth aspect, the present application provides a computer-readable storage medium. When the computer-readable storage medium stores a computer program and the computer program is run by a processor, the processor is caused to execute the method of the embodiment of the first aspect described above.

[0033] In a fifth aspect, the present application discloses a computer program product containing instructions. When it runs on a computer, the computer is caused to execute the method of the embodiment of the first aspect described above. Description of the Drawings

[0034] Figure 1 It is a scenario diagram of the system communication of the embodiment of the present application;

[0035] Figure 2 It is the overall state flowchart of the aging method of the address translation protocol table entry of an embodiment of the present application;

[0036] Figure 3 It is the state flowchart of the aging of the existing Linux ARP table entry;

[0037] Figure 4 It is the flowchart of the aging method of the address translation protocol table entry of an embodiment of the present application;

[0038] Figure 5 It is the flowchart of the aging method of the address translation protocol table entry of another embodiment of the present application;

[0039] Figure 6 It is the structural schematic diagram of a router of an embodiment of the present application;

[0040] Figure 7 It is the structural schematic diagram of an electronic device of an embodiment of the present application;

[0041] Figure 8Schematic structural diagram of an electronic device according to an embodiment of the present application;

[0042] Figure 9 Block diagram of a system-on-chip according to some embodiments of the present application. Detailed implementation manners

[0043] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application.

[0044] Next, the technical solutions of the present application will be described in detail with reference to the accompanying drawings.

[0045] Referring to Figure 1 , Figure 1 shows a scenario diagram of system communication. As Figure 1 shown, the system in this scenario diagram includes a mobile phone 101, a mobile phone 102, and an intermediate node for assisting the mobile phone 101 and the mobile phone 102 to complete wireless communication, such as a router 103. The process of the mobile phone 101 completing communication with the mobile phone 102 will be described in conjunction with the accompanying drawings. Assume that the IP address of the mobile phone 101 is IP_1 and the physical address MAC address is M1; the IP address of the mobile phone 102 is IP_2 and the physical address MAC address is M2; the IP address of the router is IP_3 and the physical address MAC address is M2. When the mobile phone 101 sends a data packet to the mobile phone 102, the mobile phone 101 first needs to send an ARP request to the router 103. If the router 103 checks that the destination IP address (IP address is IP_3) in the request is the same as its own, it will establish or update the address translation protocol table entry (ARP table entry) for the mobile phone 101 and send the MAC address M3 to the mobile phone 101. The mobile phone 101 finds the M3 address, encapsulates its own IP_1, M1, the target address (the IP address IP_2 of the mobile phone 102), and the MAC address M3 of the router into the data packet, and sends it to the router 103. The router 103 finds M2 according to IP_2 in the data packet and sends the data packet to the mobile phone 103. When the mobile phone 102 returns data to the mobile phone 101 through the router 103, the router 103 can directly find the MAC address of the mobile phone 101 as M1 according to the ARP table entry of the mobile phone and send the returned data to the mobile phone 101. The data transmission process between the mobile phone 101 and the mobile phone 102 is completed.

[0046] In some embodiments, if the router 103 does not receive an ARP packet from the mobile phone 101 to refresh the access time of the ARP packet in the ARP entry established for the mobile phone 101 within a certain period of time, for example, within 5 minutes, the timeout detection mechanism of the ARP entry will be triggered. In the timeout detection mechanism, the router 103 will send ARP requests to the mobile phone 101 to detect whether the mobile phone 101 is online. The requests are continuously sent a set number of times, for example, three times, with an interval of 6 seconds each time. If no ARP response is received from the mobile phone 101 during the process of sending three times, it will enter the Incomplete state, and the ARP entry of the mobile phone 101 will enter the aging delay stage. When the aging delay expires, if no response from the mobile phone 101 to the request sent by the router is received, the ARP entry corresponding to the mobile phone 101 will be deleted.

[0047] However, in the actual measurement environment, it is found that when the router actively pings the IP of the mobile phone 101, among the three ping packets sent, the ping delay of the first one is as high as about 6000 ms, and the subsequent two ping packets have normal delays. At this time, the device goes online normally. This indicates that the wifi physical layer link between the mobile phone 101 and the router 103 is not disconnected. That is to say, there is a phenomenon that the mobile phone 101 probabilistically does not reply to ARP requests. In another actual measurement environment, it is found that when the mobile phone receives the ARP unicast request for timeout detection, it does not fail to reply to the ARP request, but fails to respond to the ARP request in a timely manner, and at this time the wifi physical layer link is also not disconnected. Therefore, after entering the Incomplete state, although the mobile phone 101 and the router 103 are in the connected state of the wifi physical layer, due to the mobile phone 101 not replying to the ARP request or replying in a timely manner, the router will delete the ARP entry established for the mobile phone 101. When the mobile phone 101 sends data packets to the mobile phone 103 or other devices again, the router needs to re-establish the ARP entry for the mobile phone 101, thereby affecting the speed at which the mobile phone 101 sends data packets to the mobile phone 103.

[0048] For example, after the user connects to the Internet through the mobile phone and the router, the router completes the establishment of the ARP entry. When the user's mobile phone is placed on the table for about 10 minutes after the screen is turned off and then starts surfing the Internet again. Since there is no interaction of data packets between the router and the mobile phone for about 10 minutes, based on the ARP aging mechanism of the existing technology, the ARP entry on the router ages and will be deleted. At this time, when the user uses the mobile phone to surf the Internet again, there is no ARP entry of the mobile phone on the router. If you want to send data packets to the mobile phone, you need to obtain the ARP entry of the mobile phone device by sending an ARP request again, which is a time-consuming process and causes the mobile phone to experience Internet lag.

[0049] To solve the above problems, the present application provides an aging method for address translation protocol entries. After the ARP entry enters an incomplete state, when it is confirmed that the mobile phone 101 and the router 103 are in a connected state at the physical layer, even if the mobile phone 101 does not reply to the ARP single-cast request or replies in a timely manner, the router 103 can maintain the available state of the address translation protocol entry corresponding to the mobile phone instead of deleting it. Thus, it can effectively avoid the need to recreate the ARP entry when the mobile phone reconnects to the Internet while the mobile phone 101 and the router 103 are still in the connected state at the wifi physical layer, and will not affect the speed of communication between the mobile phone and the router again.

[0050] The following specifically describes the aging method for address translation protocol entries in combination with the embodiments of the present invention.

[0051] In an embodiment of the present application, the aging method for address translation protocol entries is an improvement to the aging method for ARP entries after the ARP entry enters the Incomplete state. In the following embodiments, the aging method for address translation protocol entries in the embodiments of the present application is described in detail after the ARP entry enters the Incomplete state.

[0052] Refer to Figure 2 , Figure 2 which shows the overall state flow chart of the aging method for address translation protocol entries in the embodiments of the present application. In the following embodiments, the mobile phone is used as the second electronic device and the router is used as the first electronic device for description. In combination with Figure 1 and Figure 2 as shown, after the address translation protocol entry enters the incomplete state, that is, enters the aging delay detection mechanism, the router 103 will unicast a set number of ARP requests to the mobile phone 101. As Figure 2 shown, when "the ARP request reaches the limit and there is no response", it is determined that "the request fails", then the router 103 considers that the mobile phone 101 times out and goes offline, and "deletes the entry". If an ARP response is received, the ARP entry then enters the reachable state, indicating that the cache of the ARP entry is valid. Subsequently, when in the reachable state, when the timer expires, it enters the stale state. Before the timer expires in this state, if the router 103 determines that a device uses this entry to send data packets, it enters the delay state; if the timer expires and no device references this entry, the router 103 determines whether it is in a connected state with the mobile phone at the physical layer. When it is determined that it is in a connected state with the mobile phone at the physical layer, the ARP entry is maintained as available, that is, set to the stale state or the reachable state. Otherwise, it is confirmed that the mobile phone 103 is offline and the entry is deleted.

[0053] In the delayed state, if the timer expires and a local confirmation is received, that is, the router determines that a neighbor device actively sends a data packet to the local machine, and the router 103 confirms that the entry is valid, it enters the Reachable state. If in the Delay state, the timer expires and there is no local confirmation, the router 103 determines whether it is in a connected state with the mobile phone at the physical layer. When it is determined that it is in a connected state with the mobile phone at the physical layer, the ARP entry is maintained as available, that is, set to the Delay state or the Reachable state. Otherwise, the entry is deleted.

[0054] In some embodiments of the present application, in the Delay state, when the timer expires and there is no local confirmation, it can enter the Probe state. In this state, the router 103 will send a set number of probe requests within a preset time. If a response is received, the entry enters the Reachable state. If no response is received, the router 103 determines whether it is in a connected state with the mobile phone at the physical layer. When it is determined that it is in a connected state with the mobile phone at the physical layer, the ARP entry is maintained as available. Otherwise, the entry is deleted.

[0055] For the aging method of the address translation protocol entry of the present application, when the router confirms that it is in a connected state with the mobile phone at the physical layer, the router will not delete the ARP entry corresponding to the mobile phone. When the mobile phone reconnects to the Internet, there is no need to recreate the ARP entry, which will not affect the speed when the mobile phone and the router communicate again, improving the user experience.

[0056] Reference Figure 3 , Figure 3 exemplarily shows the state flow chart of the aging of the Linux ARP entry. Figure 3 As Figure 2 a comparative example, in combination with Figure 1 、 2 and Figure 3, after the address translation protocol entry enters the incomplete state, it enters the aging delay detection mechanism. When the address translation protocol entry enters the garbage collection (Stale) state, before the timer in this state expires, if Router 103 determines that a device is using this entry to send data packets, it enters the Delay state; if the timer expires and no device references this entry, then Router 103 confirms that the mobile phone 103 is offline and deletes this entry. At this time, Router 103 does not check whether it is physically connected to the mobile phone 101. There is a situation where the mobile phone 101 is physically connected, but it is in a dormant state and does not use the address translation protocol entry (which can be understood as the mobile phone has no response). At this time, the ARP entry corresponding to the mobile phone 101 is deleted. If the mobile phone uses it again, or when the router sends data packets to the mobile phone 101, an ARP entry needs to be re-established for the mobile phone 101. Since re-establishment requires request and response time, the communication speed between the mobile phone and the router will be reduced. When the ARP entry is in the Delay state and the timer expires without confirmation from the local device, it enters the Probe state. In this state, Router 103 will send a set number of probe requests within a preset time. If a response is received, this entry enters the reachable state; if no response is received, the request fails and this entry is deleted. Since the probing process requires sending requests at regular intervals and waiting for responses, and there may be no response or slow response, which is considered as the mobile phone having no response (offline), and thus this entry is deleted. When communicating again, an ARP entry needs to be re-established for the mobile phone 101. Since re-establishment requires request and response time, the communication speed between the mobile phone and the router will be reduced.

[0057] Therefore, in this application, Figure 2 and Figure 3 The aging methods of the address translation protocol entries shown are compared. By adding steps to judge whether it is physically connected to the mobile phone between the garbage collection state and deleting the entry, and adding steps to judge whether it is physically connected to the mobile phone between the Delay state and the Probe state, and when judging that it is in a state of being physically connected to the mobile phone, maintaining the ARP entry available, that is, setting it to the garbage collection state, the Delay state or the reachable state. Thus, when the router confirms that it is in a state of being physically connected to the mobile phone, the router will not delete the ARP entry corresponding to the mobile phone. When the mobile phone reconnects to the Internet, there is no need to re-establish the ARP entry, which will not affect the communication speed when the mobile phone and the router communicate again, improving the user experience.

[0058] The following describes the aging method of the address translation protocol entry in combination with specific embodiments.

[0059] Referring to Figure 4 shown, Figure 4 shows a flowchart of the aging method of the address translation protocol entry, whereFigure 4 It is in the Figure 2 aging status of the ARP entry shown in the figure. The following is the aging flowchart after the ARP entry enters the garbage collection status. As Figure 4 shown, when the router determines that the ARP entry enters the garbage collection status, it executes S410 - S440.

[0060] S410, perform aging countdown on the ARP entry in the garbage collection status. For example, the clock (timer) in the mobile phone can be used to count down for the ARP entry.

[0061] S420, when the timer expires, determine whether there is a device referencing this entry.

[0062] When there is a device referencing this entry, set this ARP entry to the garbage collection status and continue to execute S420.

[0063] When there is no device referencing this entry, execute S430.

[0064] In S430, determine whether it is connected to the mobile phone at the physical layer.

[0065] In an embodiment of the present application, the router can confirm whether it is in a connected state with the mobile phone at the physical layer according to the device information recorded in the online device list. For example, if the recorded information is in a connected state, it is determined as connected; if the record is in a disconnected state, it is determined as disconnected. In an embodiment of the present application, the router and the mobile phone can negotiate through the wifi protocol and inform each other whether the physical link is disconnected through message interaction. Thus, it is determined whether the wifi physical link is disconnected, that is, the connection state of the physical layer is determined. In some embodiments, if there is no negotiation process between the router and the mobile phone and the wifi disconnects by itself, and the router determines that there is no message interaction for a long time (such as 120 seconds), it is determined that the physical layer is disconnected.

[0066] When the router determines that it is in a connected state with the mobile phone at the physical layer, set this ARP entry to the garbage collection status or the previous status, for example, an achievable status, and re - execute the aging timing in the corresponding status.

[0067] When the router determines that it is disconnected from the mobile phone at the physical layer, the router executes S440 and deletes this ARP entry.

[0068] The aging method of the address translation protocol entry according to the embodiment of the present application adds the judgment of the router on the state of the connection with the mobile phone at the physical layer on the basis of the existing aging state of the ARP entry. When the ARP enters the garbage collection state, the timer expires, and in the case that no device references the entry, the ARP entry will not be directly deleted. Instead, when it is judged that the connection between the router and the mobile phone at the physical layer is disconnected, the ARP entry will be deleted. When it is judged that the connection between the router and the mobile phone at the physical layer is connected, the ARP entry will continue to be kept available, that is, its state is reset, and the aging timing of the ARP in the set state is restarted, so as to avoid deleting the ARP entry corresponding to the mobile phone when the mobile phone is connected to the router at the physical layer.

[0069] Reference Figure 5 shown Figure 5 shows a flowchart of another aging method of the address translation protocol entry, where Figure 5 is in Figure 2 the aging state of the ARP entry shown, and it is a flowchart of the aging after the ARP entry enters the delay state. As Figure 5 shown, when the router judges that the ARP entry enters the delay state, S510 - S530 are executed.

[0070] S510, perform aging countdown on the ARP entry in the delay state. For example, the clock (timer) in the mobile phone can be used to count down the ARP entry.

[0071] S520, when the timer in the delay state expires, judge whether it is connected to the mobile phone at the physical layer.

[0072] In an embodiment of the present application, the router can confirm whether it is in a connected state with the mobile phone at the physical layer according to the device information recorded in the online device list.

[0073] When the router judges that it is in a connected state with the mobile phone at the physical layer, the ARP entry is set to the delay state or the state before the delay state, for example, the reachable state, and the aging timing in the corresponding state is restarted.

[0074] When the router judges that it is disconnected from the mobile phone at the physical layer, the router executes S530.

[0075] In S530, the ARP entry is deleted. In the present application, when it is judged that the physical layer is disconnected, it no longer enters the detection state, saving the communication process through the detection state.

[0076] In the embodiments of the present application, the determination in S520 of whether the mobile phone is connected at the physical layer is set before the detection state. Compared with the prior art, when the mobile phone and the router are in a connected state at the physical layer, the ARP entry is directly set to a delayed state or an achievable state to maintain the availability of the ARP entry, and there is no need to execute the detection state of the ARP entry, saving the time for obtaining a response by sending a detection request and the communication resources occupied. It should be noted that for the router to determine whether it is in a connected state with the mobile phone at the physical layer in the embodiments of the present application, it is not limited to being set at positions such as Figure 2 , Figure 4 and Figure 5 shown. For example, the determination of whether the mobile phone is connected at the physical layer can also be set after the detection state determines no response and before deleting the entry. Thus, if it is determined that the devices are in a connected state at the physical layer before deleting the ARP entry, the corresponding ARP entry will remain available, avoiding deleting the ARP entry when the router and the mobile phone are in a connected state at the physical layer, which affects the speed of the mobile phone's subsequent communication.

[0077] The aging method of the address translation protocol entry in the embodiments of the present application will be described below in conjunction with the structure of the router.

[0078] Refer to Figure 6 , Figure 6 which is a schematic structural diagram of a router disclosed in the embodiments of the present application. The router 600 includes: a memory 601, a processor 602, an interface 603, a power supply unit 604, and a clock 605.

[0079] It can be understood that the structure schematically shown in the embodiments of the present application does not constitute a specific limitation on the router 600. In other embodiments of the present application, the router 600 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The components shown can be implemented in hardware, software, or a combination of software and hardware.

[0080] The processor 602 may include one or more processing units. For example, it may include processing modules or circuits such as a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a Digital Signal Processor (DSP), a Micro-programmed Control Unit (MCU), an Artificial Intelligence (AI) processor, or a Field Programmable Gate Array (FPGA). Among them, different processing units may be independent devices or integrated in one or more processors.

[0081] A storage unit may be provided in the processor 602 for storing instructions and data. In some embodiments, the memory in the processor 602 is a cache memory. This memory can save the instructions or data that the processor 602 has just used or recycled. If the processor 602 needs to use the instruction or data again, it can be directly called from the memory. This avoids repeated accesses, reduces the waiting time of the processor 602, and thus improves the efficiency of the system.

[0082] In some embodiments, the processor 602 may store the ARP table established with the devices connected to it in the storage unit, and the processor 602 may age-countdown each entry in the ARP table through the control clock 605 to ensure the accuracy of the information in the ARP table.

[0083] In some embodiments of the present application, the memory 601 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a Universal Flash Storage (UFS), etc. The processor 602 executes various functions and data processing of the processor 602 by running the instructions stored in the memory 601 and / or the instructions stored in the memory provided in the processor.

[0084] The communication unit 603 may implement the wireless communication function of the router 600. For example, it may include an antenna and a wireless communication module, etc.

[0085] In one embodiment of the present application, the communication unit 603 can establish a wireless communication connection with other electronic devices, and receive ARP requests sent or broadcast by other electronic devices. The router 600 can send ARP requests to other electronic devices through the communication unit 603 and receive response information of the ARP requests, etc., so as to confirm whether other devices are online and whether the communication is smooth.

[0086] In some embodiments of the present application, after the processor 602 confirms the connection with another electronic device, such as the mobile phone 101 mentioned above, Figure 1 first, the address translation protocol entry corresponding to the mobile phone is established in the ARP table stored in the memory 601. The processor 602 performs aging timing for the ARP entry through the clock 605. When the ARP entry enters the aging mechanism of the ARP cache as shown in Figure 2 If, after the timer in the garbage collection state expires and no device references the entry, the processor 602 determines whether the mobile phone 101 is in a wifi physical layer connection state with the interface 603 of the router. If it is in a wifi physical layer connection state, the ARP entry jumps back to the garbage collection state to keep the ARP entry available instead of being deleted. Or when the timer in the delay state expires, it is determined whether the mobile phone 101 is in a wifi physical layer connection state with the communication unit 603 of the router. If it is determined to be in a wifi physical layer connection state, the ARP entry jumps back to the delay state to keep the ARP entry available, so as to avoid deleting the ARP entry when the mobile phone and the router are in a wifi physical layer connection state, thereby affecting the speed during subsequent communication.

[0087] The power supply unit 604 may include a power supply, a power management component, etc. The power management component is used to manage the charging of the power supply and the power supply from the power supply to other components to maintain the normal operation of the functions of each component.

[0088] In the above embodiments, a mobile phone is used as the first electronic device and a router is used as the second electronic device for illustration. The aging method of the address translation protocol entry of the present application can also be applied to other electronic devices. For example, the first electronic device can be a mobile phone, a tablet computer, a laptop computer, a super mobile personal computer, a personal digital assistant (PDA), a television, or a wearable electronic device such as a watch or a bracelet. The second electronic device can be an intermediate medium such as a switch. The device types of the electronic devices in the present application are not specifically limited. Referring to Figure 7 , embodiments of the present application also disclose an electronic device, which includes:

[0089] A generating unit 710, configured to establish an address translation protocol entry for an accessed second electronic device;

[0090] A timer 720, configured to age the address translation protocol entry;

[0091] A processing unit 730, configured to confirm a connection state with the second electronic device at a physical layer when a timing time reaches a first preset time;

[0092] The processing unit 730 is configured to maintain an available state of the address translation protocol entry when it is confirmed that the connection state with the second electronic device at the physical layer is a connected state, and re-age the address translation protocol entry through the timer 720, and

[0093] When it is confirmed that the connection state with the second electronic device at the physical layer is a disconnected state, continue to perform aging processing on the address translation protocol entry. In an embodiment of the present application, when the timing time reaches the first preset time, when the address translation protocol entry is in the stale state during the aging timing period, and the processing unit 730 confirms that the timer of the stale state in which the address translation protocol entry is located expires and no device references the address translation protocol entry, the processing unit 730 confirms that the connection state with the second electronic device at the physical layer is a connected state.

[0094] In an embodiment of the present application, the processing unit maintaining the available state of the address translation protocol entry includes:

[0095] The processing unit 730 is configured to re-age the stale state of the address translation protocol entry through a timing module, or jump to and execute any state before the stale state for aging timing.

[0096] In an embodiment of the present application, when the processing unit 730 confirms that the connection state with the second electronic device at the physical layer is a disconnected state, the processing unit 730 is configured to delete the address translation protocol entry when the aging time of the address translation protocol entry expires. In an embodiment of the present application, when the timing time reaches the first preset time, the address translation protocol entry is in the delay state during the aging timing period, and when the delay state timer expires, the processing unit 730 confirms that the connection state with the second electronic device at the physical layer is a connected state.

[0097] In an embodiment of the present application, the processing unit 730 is configured to re-age the delay state of the address translation protocol entry through a timer, or jump to and execute any state before the delay state for aging timing to maintain the available state of the address translation protocol entry.

[0098] In one embodiment of the present application, the electronic device also includes: a communication unit 740, when the processing unit confirms that it is disconnected from the second electronic device at the physical layer, the address conversion protocol table entry is deleted; or, the address conversion protocol table entry enters the probe state, and the communication unit 740 is used to send an address conversion protocol detection request to the second electronic device. After sending the detection request a preset number of times, if no response message corresponding to the address conversion protocol detection request is received, the processing unit 730 deletes the address conversion protocol table entry.

[0099] In one embodiment of the present application, the processing unit confirms the connection status with the second electronic device at the physical layer according to the device information recorded in the online device list.

[0100] In one embodiment of the present application, the processing unit is further configured to perform aging timing on the address translation protocol entry if the processing unit fails to receive a message sent by the second electronic device within a preset time period.

[0101] In addition, in the above-mentioned embodiments, the functions and working procedures of each module of the electronic device have been described in detail. Figure 2 , Figure 4 and Figure 5 The method described will not be repeated here.

[0102] According to the electronic device of the embodiment of the present application, when it is confirmed that the electronic device corresponding to the ARP table entry is connected at the physical layer, the electronic device will not delete the ARP table entry. When the electronic device corresponding to the ARP table entry goes back online, there is no need to re-establish the ARP table entry, which will not affect the speed at which the electronic device communicates with the electronic device again, thereby improving the user experience.

[0103] refer to Figure 8 , the present application also provides an electronic device, including:

[0104] A memory 810 for storing instructions executed by one or more processors of the device, and

[0105] Processor 820, used to execute the above embodiment combined with Figures 4 to 6 The method explained.

[0106] The present application also provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, the processor executes the above-mentioned embodiment. Figures 4 to 6 The method explained.

[0107] The present application also provides a computer program product comprising instructions, which, when executed on an electronic device, enables a processor to execute the above-mentioned embodiments. Figure 2 ,Figure 4 and Figure 5 the method shown.

[0108] Now refer to Figure 9 , which shows a block diagram of a System on Chip (SoC) 1300 according to an embodiment of the present application. In Figure 9 , similar components have the same reference numerals. Additionally, the dashed boxes are optional features of a more advanced SoC. In Figure 9 , the SoC 1300 includes: an interconnect unit 1350, which is coupled to an application processor 1310; a system agent unit 1380; a bus controller unit 1390; an integrated memory controller unit 1340; one or a group of one or more coprocessors 1320, which may include integrated graphics logic, an image processor, an audio processor, and a video processor; a Static Random Access Memory (SRAM) unit 1330; and a Direct Memory Access (DMA) unit 1360. In one embodiment, the coprocessor 1320 includes a dedicated processor, such as, for example, a network or communication processor, a compression engine, a GPGPU, a high throughput MIC processor, or an embedded processor, etc.

[0109] The Static Random Access Memory (SRAM) unit 1330 may include one or more computer-readable media for storing data and / or instructions. Instructions may be stored in the computer-readable storage medium, specifically, temporary and permanent copies of the instructions are stored. The instructions may include: when executed by at least one unit in the processor, causing the Soc 1300 to execute the method for establishing a device communication connection according to the above-described embodiment, specifically, reference may be made to the above-described embodiment Figure 2 , Figure 5 and Figure 6 the method explained, which will not be elaborated here.

[0110] Embodiments of the mechanisms disclosed in the present application may be implemented in hardware, software, firmware, or combinations of these implementation methods. Embodiments of the present application may be implemented as a computer program or program code executed on a programmable system, the programmable system including at least one processor, a storage system (including volatile and non-volatile memory and / or storage elements), at least one input device, and at least one output device.

[0111] Program code can be applied to the input instructions to perform the various functions described in this application and generate output information. The output information can be applied to one or more output devices in a known manner. For the purposes of this application, a processing system includes any system having a processor such as, for example, a Digital Signal Processor (DSP), a microcontroller, an Application Specific Integrated Circuit (ASIC), or a microprocessor.

[0112] The program code can be implemented in a high-level procedural language or an object-oriented programming language in order to communicate with the processing system. When needed, the program code can also be implemented in assembly language or machine language. In fact, the mechanisms described in this application are not limited to the scope of any particular programming language. In any case, the language can be a compiled language or an interpreted language.

[0113] In some cases, the disclosed embodiments can be implemented in hardware, firmware, software, or any combination thereof. The disclosed embodiments can also be implemented as instructions carried or stored on one or more transient or non-transient machine-readable (e.g., computer-readable) storage media, which can be read and executed by one or more processors. For example, the instructions can be distributed via a network or via other computer-readable media. Thus, a machine-readable medium can include any mechanism for storing or transmitting information in a machine (e.g., computer) readable form, including but not limited to, floppy disks, optical disks, optical discs, Compact Disc Read Only Memories (CD-ROMs), magneto-optical disks, Read Only Memories (ROMs), Random Access Memories (RAM), Erasable Programmable Read Only Memories (EPROMs), Electrically Erasable Programmable Read Only Memories (EEPROMs), magnetic or optical cards, flash memory, or tangible machine-readable memories for transmitting information (e.g., carrier waves, infrared signals, digital signals, etc.) in electrical, optical, acoustic, or other forms using the Internet. Thus, a machine-readable medium includes any type of machine-readable medium suitable for storing or transmitting electronic instructions or information in a machine (e.g., computer) readable form.

[0114] In the accompanying drawings, some structural or method features may be shown in a particular arrangement and / or order. However, it should be understood that such a particular arrangement and / or ordering may not be required. Instead, in some embodiments, these features may be arranged in a manner and / or order different from that shown in the drawings of the specification. Additionally, the inclusion of a structural or method feature in a particular figure does not imply that such a feature is required in all embodiments, and in some embodiments, these features may not be included or may be combined with other features.

[0115] It should be noted that each unit / module mentioned in the device embodiments of this application is a logical unit / module. Physically, a logical unit / module can be a physical unit / module, a part of a physical unit / module, or can be implemented as a combination of multiple physical units / module. The physical implementation manner of these logical units / module themselves is not the most important. The combination of the functions implemented by these logical units / module is the key to solving the technical problems proposed in this application. In addition, to highlight the innovative part of this application, the above device embodiments of this application do not introduce units / modules that are not closely related to solving the technical problems proposed in this application. This does not mean that there are no other units / modules in the above device embodiments.

[0116] It should be noted that in the examples and the specification of this patent, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising one" does not exclude the presence of additional identical elements in the process, method, article or device comprising the element.

[0117] Although this application has been illustrated and described by reference to certain preferred embodiments thereof, those of ordinary skill in the art should understand that various changes in form and detail may be made thereto without departing from the spirit and scope of this application.

Claims

1. A method for aging an address translation protocol entry, which is applied to a first electronic device. Characterized in that, The method includes: The first electronic device creates an address translation protocol entry for a second electronic device that accesses; The first electronic device ages and times the address translation protocol entry; When the timing time reaches a first preset time, the first electronic device confirms the connection status with the second electronic device at the physical layer; When the first electronic device confirms that the connection status with the second electronic device at the physical layer is a connected state, the first electronic device maintains the available state of the address translation protocol entry, and ages and times the address translation protocol entry again, and When the first electronic device confirms that the connection status with the second electronic device at the physical layer is a disconnected state, the first electronic device continues to perform aging processing on the address translation protocol entry.

2. The method according to claim 1, Characterized in that, When the timing time reaches the first preset time, when the address translation protocol entry is in the stale state during the aging timing period, and the first electronic device confirms that the timer of the stale state where the address translation protocol entry is located expires and no device references the address translation protocol entry, the first electronic device confirms that the connection status with the second electronic device at the physical layer is a connected state.

3. The method according to claim 2, Characterized in that, The first electronic device maintaining the available state of the address translation protocol entry includes: The first electronic device ages and times the stale state of the address translation protocol entry again, or jumps and executes any state before the stale state for aging and timing.

4. The method according to any one of claims 1-3, Characterized in that, When the first electronic device confirms that the connection status with the second electronic device at the physical layer is a disconnected state, the first electronic device continuing to perform aging processing on the address translation protocol entry includes: When the aging time of the address translation protocol entry expires, the first electronic device deletes the address translation protocol entry.

5. The method according to claim 1, Characterized in that, When the timing time reaches the first preset time, the address translation protocol entry is in the delay state during the aging timing period, and when the delay state timer expires, the first electronic device confirms that the connection status with the second electronic device at the physical layer is a connected state.

6. The method according to claim 5, Characterized in that, The maintaining the available state of the address translation protocol entry includes: The first electronic device ages and times the delay state of the address translation protocol entry again, or jumps and executes any state before the delay state for aging and timing.

7. The method according to claim 5 or 6, Characterized in that, When the first electronic device confirms that the connection with the second electronic device is in a disconnected state at the physical layer, the first electronic device continues to perform aging processing on the address translation protocol entry, including: When the first electronic device confirms that the connection with the second electronic device is in a disconnected state at the physical layer, the address translation protocol entry is deleted.

8. The method according to any one of claims 1-3, 5-6, wherein, The first electronic device confirms the connection state with the second electronic device at the physical layer according to the device information recorded in the online device list.

9. The method according to any one of claims 1-3, 5-6, wherein, The method includes: The first electronic device establishes the address translation protocol entry, and if the first electronic device does not receive a message sent by the second electronic device within a preset time period, the first electronic device performs aging timing on the address translation protocol entry.

10. An electronic device, wherein, including: A generation unit for establishing an address translation protocol entry for the accessed second electronic device; A timer for aging timing of the address translation protocol entry; A processing unit for confirming the connection state with the second electronic device at the physical layer when the timing time reaches a first preset time; The processing unit is used to maintain the available state of the address translation protocol entry when confirming that the connection with the second electronic device is in a connected state at the physical layer, and re-perform aging timing on the address translation protocol entry through the timer, and When confirming that the connection with the second electronic device is in a disconnected state at the physical layer, continue to perform aging processing on the address translation protocol entry.

11. The electronic device according to claim 10, wherein, When the timing time reaches the first preset time, when the address translation protocol entry is in the stale state during the aging timing period, and the processing unit confirms that the timer for the stale state of the address translation protocol entry expires and no device references the address translation protocol entry, the processing unit confirms that the connection with the second electronic device is in a connected state at the physical layer.

12. The electronic device according to claim 11, wherein, The processing unit maintaining the available state of the address translation protocol entry includes: The processing unit is used to re-perform aging timing on the stale state of the address translation protocol entry through a timing module, or jump to and execute any state before the stale state for aging timing.

13. The electronic device according to any one of claims 10-12, wherein, When the processing unit confirms that the connection with the second electronic device is in a disconnected state at the physical layer, the processing unit is used to delete the address translation protocol entry when the aging time of the address translation protocol entry expires.

14. The electronic device according to claim 10, wherein, When the timing time reaches the first preset time, the address translation protocol entry is in the delay state during the aging timing period, and when the delay state timer expires, the processing unit confirms that it is in a connected state with the second electronic device at the physical layer.

15. The electronic device according to claim 14, wherein, the processing unit is configured to re-aging-time the delay state of the address translation protocol entry through the timer, or jump to and execute any state before the delay state for aging timing, so as to maintain the available state of the address translation protocol entry.

16. The electronic device according to claim 14 or 15, wherein, the processing unit is further configured to confirm that it is in a disconnected state with the second electronic device at the physical layer, and then delete the address translation protocol entry.

17. The electronic device according to any one of claims 10-12, wherein, the processing unit confirms the connection state with the second electronic device at the physical layer according to the device information recorded in the online device list.

18. The electronic device according to any one of claims 10-12, wherein, the processing unit is further configured to, if no packet sent by the second electronic device is received within a preset duration, the processing unit performs aging timing on the address translation protocol entry.

19. An electronic device, wherein, comprising: a memory for storing instructions executed by one or more processors of the device, and a processor for executing the aging method of the address translation protocol entry according to any one of claims 1-9.

20. A computer-readable storage medium, wherein, the computer-readable storage medium stores a computer program, and when the computer program is run by a processor, the processor is caused to execute the aging method of the address translation protocol entry according to any one of claims 1-9.

21. A computer program product containing instructions, wherein, when the computer program product runs on an electronic device, the processor is caused to execute the aging method of the address translation protocol entry according to any one of claims 1-9.

Citation Information

Patent Citations

  • Ageing method for address analytic protocol cache table item in network device

    CN1783874A