A link selection method and device, electronic equipment and storage medium

By detecting and managing link health time, a target link with higher stability is selected to carry communication traffic, which solves the problem of unstable service traffic in traditional link selection methods and enables stable and continuous outbound service traffic.

CN115865793BActive Publication Date: 2026-04-21BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING TOPSEC NETWORK SECURITY TECH
Filing Date
2022-12-08
Publication Date
2026-04-21

AI Technical Summary

Technical Problem

Traditional link selection methods cause business traffic to switch frequently between multiple links, resulting in business instability.

Method used

By detecting and managing link health time, we select target links with higher stability to carry communication traffic, reducing the number of handovers caused by link anomalies and ensuring stable business traffic.

Benefits of technology

This reduces the number of times traffic switches between different links due to link anomalies, ensuring stable and continuous outbound traffic for services and improving service instability caused by multiple switches.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115865793B_ABST
    Figure CN115865793B_ABST
Patent Text Reader

Abstract

The application provides a link selection method and device, electronic equipment and storage medium. The method comprises: obtaining a candidate link for communication and a link health time of the candidate link; the link health time is obtained by timing the normal state of the candidate link detected; a target link is determined from the candidate link according to the link health time; and the target link is used to carry communication traffic. According to the link health time, the target link is determined from the candidate link, the number of times of switching back and forth between different links due to abnormal links of outgoing traffic is reduced, and the stable and continuous outgoing of service traffic is ensured. According to the link health time, the target link is determined to a certain extent, and a link with high stability is selected as the target link, so that the service is more stable; and after the preferred link is restored, the traffic does not need to be migrated back to the preferred link again, and the situation that the service is unstable due to multiple switching links is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network communication technology, and more specifically, to a link selection method, apparatus, electronic device, and storage medium. Background Technology

[0002] To mitigate network availability risks caused by network failures and address network access issues resulting from insufficient bandwidth, enterprises often utilize multiple carrier networks. This necessitates selecting a single link from among several options to optimize network resource allocation. Traditional policy-based routing can achieve static routing to some extent, prioritizing outbound traffic from the first link. If that link fails, traffic switches to the second link until the first link recovers and switches back. However, this current link selection method involves multiple link switches, leading to service fluctuations. Summary of the Invention

[0003] The purpose of this invention is to provide a link selection method, apparatus, electronic device, and storage medium that selects links based on health check detection time, thereby improving the problem of outgoing traffic switching back and forth between different links due to link instability in the case of multiple outgoing links.

[0004] In a first aspect, embodiments of this application provide a link selection method, including: obtaining candidate links for communication and the link health time of the candidate links; the link health time is obtained by timing the normal state of the candidate links when the link is detected to be in a normal state; determining a target link from the candidate links based on the link health time; the target link is used to carry communication traffic.

[0005] In the above implementation process, the target link is determined from the candidate links based on the link health time. Outgoing traffic will not switch frequently due to link fluctuations, reducing the number of times outgoing traffic switches back and forth between different links due to link anomalies, and ensuring stable and continuous outgoing business traffic.

[0006] Optionally, in this embodiment of the application, before determining the target link from the candidate links based on the link health time, the method further includes: determining the preferred link from the candidate links and distributing communication traffic to the preferred link; if the preferred link is abnormal, resetting the link health time of the preferred link; after determining the target link from the candidate links based on the link health time, the method further includes: migrating communication traffic to the target link.

[0007] In the above implementation process, if the preferred link experiences an anomaly, its link health time is reset. Based on this health time, a target link is selected from the candidate links, and communication traffic is migrated to the target link. Determining the target link based on its health time, to a certain extent, selects a more stable link, thus improving service stability. Furthermore, once the preferred link recovers, there is no need to migrate traffic back to it, mitigating the instability caused by multiple link switching.

[0008] Optionally, in this embodiment of the application, determining the target link from the candidate links based on the link health time includes: selecting the candidate link with the longest link health time as the target link.

[0009] In the above implementation process, the link health time can reflect the stability of the link within a certain period of time. By using the candidate link with the longest link health time as the target link, the stability of the service can be improved.

[0010] Optionally, in this embodiment of the application, the method further includes: if the preferred link recovers to a healthy state, then the health time of the preferred link is re-timed to obtain the health time of the preferred link; if the target link does not experience any abnormality, then the target link continues to carry communication traffic.

[0011] In the above implementation process, if the preferred link recovers to a healthy state, the health time of the preferred link is reset, while the health time of the target link continues to be counted. Since the health time of the target link is greater than that of the preferred link, there is no need to migrate traffic to the target link. This improves the situation where traffic frequently switches due to link fluctuations, reduces the number of times outbound traffic switches back and forth between different links due to link anomalies, and ensures stable and continuous outbound traffic for services.

[0012] Optionally, in this embodiment of the application, the method further includes: receiving a link manual switching request, the link manual switching request being used to manually switch the target link carrying the communication traffic; resetting the link health time of the target link; determining a new target link based on the link health time of the candidate link; and migrating the communication traffic to the new target link.

[0013] In the above implementation process, link switching is achieved by controlling the link health time, enriching the link load balancing algorithm and making link load balancing applicable to more scenarios.

[0014] Optionally, in this embodiment of the application, after receiving the manual link switching request, the method further includes: if the manual link switching request includes a target link to be switched; the target link to be switched is a new target link specified by the user; then the link health time of the candidate links other than the target link to be switched, as well as the target link, is batch reset so that the communication traffic is migrated to the target link to be switched.

[0015] In the above implementation process, the link health time of the candidate links other than the target link to be switched and the target link can be reset in batches to migrate communication traffic to the target link to be switched, thereby realizing the migration of communication traffic to the new target link specified by the user and enabling arbitrary switching of links.

[0016] Optionally, in this embodiment of the application, after obtaining the candidate links for communication and the link health time of the candidate links, the method further includes: if a link is detected to be in an abnormal state, the candidate link is removed; until the candidate link in the abnormal state is detected to have returned to normal state, the normal state timer for the candidate link that has returned to normal state is started.

[0017] In the above implementation process, the health status of the selected links is monitored in real time, and links in abnormal states are removed to ensure that all candidate links in the link pool are healthy links that can communicate.

[0018] Secondly, embodiments of this application also provide a link selection device, including: an acquisition module, used to acquire candidate links for communication and the link health time of the candidate links; the link health time is obtained by timing the normal state of the candidate links when the link is detected to be in a normal state; and a link determination module, used to determine a target link from the candidate links based on the link health time; the target link is used to carry communication traffic.

[0019] Thirdly, embodiments of this application also provide an electronic device, including: a processor and a memory, the memory storing machine-readable instructions executable by the processor, which, when executed by the processor, perform the method described above.

[0020] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program that, when executed by a processor, performs the methods described above.

[0021] The link selection method, apparatus, electronic device, and storage medium provided in this application determine the target link from the candidate links based on the link health time, reducing the number of times outbound traffic switches back and forth between different links due to link anomalies, and ensuring stable and continuous outbound service traffic. Determining the target link based on the link health time, to a certain extent, selects a link with higher stability as the target link, making the service more stable; and after the preferred link recovers, there is no need to migrate traffic back to the preferred link, improving the situation of service instability caused by multiple link switching. Attached Figure Description

[0022] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 A flowchart illustrating a link selection method provided in an embodiment of this application;

[0024] Figure 2 A flowchart illustrating the link selection method based on link health time provided in this application embodiment;

[0025] Figure 3 This is a schematic diagram of the link selection device provided in the embodiments of this application;

[0026] Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0027] The embodiments of the technical solution of this application will now be described in detail with reference to the accompanying drawings. These embodiments are only used to more clearly illustrate the technical solution of this application and are therefore merely examples, and should not be used to limit the scope of protection of this application.

[0028] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this application.

[0029] In the description of the embodiments of this application, technical terms such as "first" and "second" are used only to distinguish different objects and should not be construed as indicating or implying relative importance or implicitly specifying the number, specific order, or primary and secondary relationship of the indicated technical features. In the description of the embodiments of this application, "multiple" means two or more, unless otherwise explicitly defined.

[0030] Please see Figure 1 The illustrated diagram shows a flowchart of a link selection method provided in an embodiment of this application. The link selection method provided in this application can be applied to electronic devices, which may include a terminal and a server; specifically, the terminal may be a smartphone, tablet computer, computer, personal digital assistant (PDA), etc.; the server may be an application server or a web server.

[0031] Step S110: Obtain the candidate links for communication and the link health time of the candidate links; the link health time is obtained by timing the normal state of the candidate links when the links are detected to be in a normal state.

[0032] The physical channel between two nodes in a network is called a communication link. A communication link includes the physical media for transmission, the link protocol, related equipment, and related computer programs. The communication link is the candidate link used for communication in this embodiment of the application.

[0033] A typical enterprise user may deploy multiple candidate links on network equipment at the service egress point, such as China Unicom egress links and China Telecom egress links. The network equipment at the service egress point needs to periodically or according to other time policies check the health status of each candidate link. After performing a link health check on the candidate links and confirming that the links are in a normal and communicable state, the normal status of the links can be timed to obtain the link health time for each link.

[0034] The link health time of each candidate link can be recorded in real time using a timer. If a candidate link experiences an anomaly, the link health time needs to be reset; if the candidate link does not experience an anomaly, the link health time can be continuously timed.

[0035] Step S120: Determine the target link from the candidate links based on the link health time; the target link is used to carry communication traffic.

[0036] The target link can be a link selected from multiple alternative links for handover after the primary link fails. Alternatively, it can be a primary link determined based on the link health time of each candidate link before traffic is forwarded and no primary traffic is set. It should be noted that if the target link is a link selected from multiple alternative links for handover after the primary link fails, then after the primary link recovers, the communication traffic does not need to be automatically migrated to the primary link; instead, the target link continues to handle the communication traffic.

[0037] The implementation methods for determining the target link from candidate links based on link health time can include: First, selecting the link with the longest link health time as the target link; second, selecting the link with the fewest link health time resets as the target link. Resetting the link health time means resetting it to 0 after a link anomaly occurs. Therefore, the fewest link health time resets indicate the fewest anomalies the link has experienced, signifying its stability, and thus it is selected as the target link. In the second method of determining the target link, even if the link's link health time is not the longest, it can still be used as the target link.

[0038] In the above implementation process, the target link is determined from the candidate links based on the link health time. Outgoing traffic will not switch frequently due to link fluctuations, reducing the number of times outgoing traffic switches back and forth between different links due to link anomalies, and ensuring stable and continuous outgoing business traffic.

[0039] Optionally, in this embodiment of the application, before determining the target link from the candidate links based on the link health time, the method further includes: determining the preferred link from the candidate links and distributing communication traffic to the preferred link; if the preferred link is abnormal, resetting the link health time of the preferred link; after determining the target link from the candidate links based on the link health time, the method further includes: migrating communication traffic to the target link.

[0040] In the specific implementation process: Before determining the preferred link, all candidate links undergo a link health check. If a link is detected to be in an abnormal state, it is removed from the candidate list, and only links in a normal state are considered as candidate links. A normal state timer is then started for all normal candidate links in the link pool. Subsequently, the preferred link can be manually specified. When manually specifying the preferred link, link health times do not need to be compared; it is only necessary to ensure that the preferred link is in a normal state.

[0041] After the primary link is determined, it handles communication traffic until it encounters an anomaly. In this case, the primary link's health time is reset, which means setting the primary link's health time to 0. This reset is automatically triggered after the primary link experiences an anomaly. Furthermore, the primary link can be monitored in real time to confirm whether it has recovered. If it is detected that the primary link has recovered, its normal state time is reset.

[0042] Simultaneously, if the primary link fails, a target link is determined from the candidate links based on the link health time. Specifically, the link with the longest health time among the candidate links can be selected as the target link. Communication traffic is then migrated to the target link to ensure normal service operation. After the target link takes over the communication traffic, its link health time continues to be counted, as do the link health times of other candidate links in the link pool.

[0043] In the above implementation process, if the preferred link experiences an anomaly, its link health time is reset. Based on this health time, a target link is selected from the candidate links, and communication traffic is migrated to the target link. Determining the target link based on its health time, to a certain extent, selects a more stable link, thus improving service stability. Furthermore, once the preferred link recovers, there is no need to migrate traffic back to it, mitigating the instability caused by multiple link switching.

[0044] Optionally, in this embodiment of the application, determining the target link from the candidate links based on the link health time includes: selecting the candidate link with the longest link health time as the target link.

[0045] In the specific implementation process: After the primary link fails, traffic needs to be switched to the target link. The candidate link with the longest health time can be used as the target link. After the candidate link undergoes a link health check, the timer for its normal state can begin. If the candidate link fails midway, its health time is reset until it recovers and passes the link health check, at which point the timer for that candidate link can be restarted. If the link does not fail, the timer will continue. Therefore, the link health time can reflect the stability of the link within a certain period. When no primary link is specified, the candidate link with the longest health time can be used as the primary link.

[0046] In an optional embodiment, if a link experiences multiple anomalies, the link health time is reset multiple times. At the same time, the number of times the candidate link experiences anomalies can be marked. When the number of anomalies reaches a threshold, the link is removed until the candidate link recovers to a relatively stable state, such as no anomalies occurring within a preset period. Then, the removed link can be used as a candidate link again.

[0047] In the above implementation process, the link health time can reflect the stability of the link within a certain period of time. By using the candidate link with the longest link health time as the target link, the stability of the service can be improved.

[0048] Optionally, in this embodiment of the application, the method further includes: if the preferred link recovers to a healthy state, then the health time of the preferred link is re-timed to obtain the health time of the preferred link; if the target link does not experience any abnormality, then the target link continues to carry communication traffic.

[0049] In the specific implementation process: if the preferred link fails, the link health time of the preferred link is reset, and the preferred link is monitored in real time to confirm whether the preferred link has returned to normal. Once the preferred link passes the link health check again, that is, the check result indicates that the preferred link has returned to a healthy state, the health time of the preferred link is reset to obtain the preferred link health time.

[0050] If the target link is not abnormal, its health time continues to be counted, while the health time of the preferred link is reset after it recovers. Therefore, if the health time of the target link is greater than that of the preferred link, there is no need to migrate traffic to the target link; instead, the target link continues to carry the communication traffic.

[0051] In an optional embodiment, if the candidate link that is currently receiving communication traffic also malfunctions, the normal time of the candidate link is reset to 0. At this time, the communication traffic can be migrated back to the preferred link by manually setting a health event; alternatively, the link health time of the preferred link and other candidate links can be obtained, and the link with the longest health time can be selected as the next target link, and the traffic can be migrated to the next target link.

[0052] In the above implementation process, if the preferred link recovers to a healthy state, the health time of the preferred link is reset, while the health time of the target link continues to be counted. Since the health time of the target link is greater than that of the preferred link, there is no need to migrate traffic to the target link. This improves the situation where traffic frequently switches due to link fluctuations, reduces the number of times outbound traffic switches back and forth between different links due to link anomalies, and ensures stable and continuous outbound traffic for services.

[0053] Optionally, in this embodiment of the application, the method further includes: receiving a link manual switching request, the link manual switching request being used to manually switch the target link carrying the communication traffic; resetting the link health time of the target link; determining a new target link based on the link health time of the candidate link; and migrating the communication traffic to the new target link.

[0054] In the specific implementation process: if traffic leaves the target link and the target link does not experience any abnormalities, no automatic link switching action will be performed. In this case, if you want to migrate traffic to other candidate links, you can initiate a manual switching request. A manual switching request can specify a particular link, which means migrating traffic from the target link to the specified link; a manual switching request can also not specify a link, which means migrating traffic from the target link to a new target link.

[0055] Specific switching methods include: resetting the link health time of the target link so that the link health time of the target link is 0; if the manual switching request does not include the specified link, then the new target link is determined based on the link health time of other candidate links in the link pool. The new target link can be the one with the longest link health time among the target links, and the communication traffic is migrated to the new target link, which then takes over the communication traffic.

[0056] In the above implementation process, link switching is achieved by controlling the link health time, enriching the link load balancing algorithm and making link load balancing applicable to more scenarios.

[0057] Optionally, in this embodiment of the application, after receiving the manual link switching request, the method further includes: if the manual link switching request includes a target link to be switched; the target link to be switched is a new target link specified by the user; then the link health time of the candidate links other than the target link to be switched, as well as the target link, is batch reset so that the communication traffic is migrated to the target link to be switched.

[0058] In the specific implementation process: when a user specifies a new target link, they need to confirm that the target link to be switched to is in a normal state, but there is no need to compare the link health time. That is to say, even if the link health time of the candidate link is not the longest, it can still be used as the new target link specified by the user.

[0059] After identifying the target link to switch to, reset the health times of other candidate links in the link pool that are currently in health tracking, and also reset the health time of the target link. This process can be performed in batches. If the health time of the target link to be switched to has not been reset, then the target link's health time will be the longest, and communication traffic will be migrated to the target link to be switched to.

[0060] In the above implementation process, the link health time of the candidate links other than the target link to be switched and the target link can be reset in batches to migrate communication traffic to the target link to be switched, thereby realizing the migration of communication traffic to the new target link specified by the user and enabling arbitrary switching of links.

[0061] Optionally, in this embodiment of the application, after obtaining the candidate links for communication and the link health time of the candidate links, the method further includes: if a link is detected to be in an abnormal state, the candidate link is removed; until the candidate link in the abnormal state is detected to have returned to normal state, the normal state timer for the candidate link that has returned to normal state is started.

[0062] In the specific implementation process: Candidate links for communication are obtained, and a link health check is performed on these links. If the check indicates that the candidate link is in an abnormal state, it is removed from the list and will not be used as a candidate link for communication until it recovers to normal. Once a candidate link in an abnormal state is detected and recovers to normal, a normal state timer is started for that link, and it can then be considered as a candidate link.

[0063] In the above implementation process, the health status of the selected links is monitored in real time, and links in abnormal states are removed to ensure that all candidate links in the link pool are healthy links that can communicate.

[0064] Please see Figure 2 The diagram shown is a flowchart illustrating the link selection method based on link health time provided in an embodiment of this application.

[0065] In an optional embodiment, when there are multiple operators on the outgoing link, a health check method is configured for each link. When the link status is normal and available, the device link status normal timer starts counting, and a link status normal timetable is maintained. The timetable records the status health time of all links in the normal state.

[0066] Upon receiving outbound traffic, determine whether to select a link selection method based on link health time. If not, proceed with other link selection methods. If link selection based on link health time is selected, perform a link health check on all candidate links in the link pool used for communication to confirm whether the links in the link pool are in normal condition. Set link health timers for healthy links and remove links in abnormal condition.

[0067] Understandably, if the link pool contains only two links, and one of them is detected to be in an abnormal state, traffic will choose the other healthy link for outbound traffic. If all links in the link pool are normal, a preferred link and a backup link can be manually specified. In this case, traffic will outbound from the preferred link, and there is no need to compare link health times. Alternatively, a preferred link can not be specified, and the link can be determined by comparing the time the link has been in normal status. Outbound traffic will choose the link with the longer normal status time for outbound traffic.

[0068] When a link in the forwarding state becomes abnormal, such as when the primary link becomes abnormal, the normal health time of the primary link is reset to 0. At this time, the link with the longest health time is found in the link pool as the target link, and all service traffic goes out through the target link. When the primary link returns to normal, the timer of the primary link restarts. However, because the normal health time of the primary link is less than that of the target link, the traffic remains out through the target link and does not switch back and forth, thus ensuring the stability of user services.

[0069] You can also set a manual reset switch for the normal link status time. When you need to migrate traffic back to a specified link, you only need to reset the health time of the link that is currently forwarding to achieve the migration of business traffic.

[0070] In some application scenarios, such as live streaming and video calls, high network speed and stability are required, and network instability is undesirable. Typically, traffic is routed out through a primary link, with other links serving as backups. If the link carrying the service traffic fails, other healthy links will continue to handle all network access. However, if traffic migrates back to the primary link after it recovers, it can affect the stability of the live streaming service. Therefore, this application's embodiment determines the target link from the candidate links based on link health time, reducing the number of times outbound traffic switches between different links due to link anomalies, and to a certain extent ensuring a stable and continuous outbound flow of service traffic.

[0071] Please see Figure 3 The diagram shown is a structural schematic of a link selection device provided in an embodiment of this application; this application provides a link selection device 200, including:

[0072] The acquisition module is used to acquire candidate links for communication, as well as the link health time of the candidate links; the link health time is obtained by timing the normal state of the candidate links when they are detected to be in a normal state.

[0073] The link determination module is used to determine the target link from the candidate links based on the link health time; the target link is used to carry communication traffic.

[0074] Optionally, in this embodiment of the application, the link selection device further includes: a link switching module, configured to determine a preferred link from the candidate links and distribute communication traffic to the preferred link; if the preferred link is abnormal, the link health time of the preferred link is reset; after determining the target link from the candidate links according to the link health time, the method further includes: migrating communication traffic to the target link.

[0075] Optionally, in this embodiment of the application, the link selection device and the link determination module are specifically used to select the candidate link with the longest link health time as the target link.

[0076] Optionally, in this embodiment of the application, the link selection device further includes: a processing module, configured to, if the preferred link recovers to a healthy state, re-time the health time of the preferred link to obtain the health time of the preferred link; if the target link does not experience any abnormality, the target link continues to carry communication traffic.

[0077] Optionally, in this embodiment of the application, the link selection device further includes: a manual switching module, used to receive a manual link switching request, the manual link switching request being used to manually switch the target link carrying the communication traffic; reset the link health time of the target link; determine a new target link based on the link health time of the candidate link; and migrate the communication traffic to the new target link.

[0078] Optionally, in this embodiment of the application, the link selection device and the designated switching module are configured to, if the manual link switching request includes a target link to be switched; the target link to be switched is a new target link specified by the user; then, batch reset the link health time of the candidate links other than the target link to be switched, as well as the target link, so that the communication traffic is migrated to the target link to be switched.

[0079] Optionally, in this embodiment of the application, the link selection device and the detection module are used to remove the candidate link if an abnormal state is detected; until the candidate link in the abnormal state is detected to return to normal state, the normal state timer for the candidate link that has returned to normal state is started.

[0080] It should be understood that this device corresponds to the link selection method embodiment described above and is capable of performing the various steps involved in the above method embodiment. The specific functions of this device can be found in the description above, and detailed descriptions are omitted here to avoid repetition. The device includes at least one software functional module that can be stored in memory or embedded in the device's operating system (OS) in the form of software or firmware.

[0081] Please see Figure 4 The diagram shows a structural schematic of an electronic device provided in an embodiment of this application. An electronic device 300 provided in this application includes a processor 310 and a memory 320. The memory 320 stores machine-readable instructions executable by the processor 310. When the machine-readable instructions are executed by the processor 310, the method described above is performed.

[0082] This application also provides a storage medium storing a computer program, which is executed by a processor to perform the above-described method.

[0083] The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0084] It should be understood that the disclosed apparatus and methods can also be implemented in other ways, given the several embodiments provided in this application. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, or they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0085] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0086] The above description is only an optional implementation of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the embodiments of this application should be covered within the protection scope of the embodiments of this application.

Claims

1. A link selection method, characterized by, The method comprises the following steps: obtaining candidate links for communication and link health time of the candidate links; the link health time is obtained by timing the normal state of the candidate link detected to be in the normal state; a plurality of candidate links are deployed on a network device at a user service outlet; wherein the link health time of each candidate link is recorded in real time by a timing table, and if the candidate link is abnormal, the link health time is reset; if the candidate link is not abnormal, the link health time is continuously timed; determining a target link from the candidate links according to the link health time; the target link is used to carry communication traffic; before determining the target link from the candidate links according to the link health time, the method further comprises: determining a preferred link from the candidate links, and distributing the communication traffic to the preferred link; if the preferred link is abnormal, resetting the link health time of the preferred link; after determining the target link from the candidate links according to the link health time, the method further comprises: migrating the communication traffic to the target link; the method further comprises: if the preferred link recovers to a healthy state, re-timing the health time of the preferred link to obtain a preferred link health time; if the target link is not abnormal, the target link continues to carry the communication traffic; the way of determining the target link comprises: taking the candidate link with the longest link health time as the target link, or taking the candidate link with the least number of link health time resets as the target link; after obtaining the candidate links for communication and the link health time of the candidate links, the method further comprises: if it is detected that the candidate link is in an abnormal state, the candidate link is excluded; until it is detected that the candidate link in the abnormal state recovers to a normal state, the candidate link recovering to the normal state is timed in the normal state.

2. The method of claim 1, wherein, the method further comprises: receiving a link manual switching request, the link manual switching request being used to manually switch a target link carrying the communication traffic; resetting the link health time of the target link; determining a new target link according to the link health time of the candidate links, and migrating the communication traffic to the new target link.

3. The method of claim 2, wherein, after receiving the link manual switching request, the method further comprises: if the link manual switching request includes a target link to be switched; the target link to be switched is a new target link specified by a user; then, resetting the link health time of the candidate links other than the target link to be switched and the target link in batches, so as to migrate the communication traffic to the target link to be switched.

4. A link selection apparatus characterized by comprising: The method comprises the following steps: an obtaining module is configured to obtain candidate links for communication and link health time of the candidate links; The link health time is obtained by timing a normal state of the candidate link detected in the normal state; a plurality of the candidate links are deployed on a network device at a user service outlet; wherein the link health time of each candidate link is recorded in real time by a timing table, and the link health time is reset if the candidate link is abnormal; and the link health time is continuously timed if the candidate link is not abnormal; The determining link module is configured to determine a target link from the candidate links according to the link health time; and the target link is used to carry communication traffic; The link switching module is configured to determine a preferred link from the candidate links, and distribute the communication traffic to the preferred link; and the link health time of the preferred link is reset if the preferred link is abnormal; and after the target link is determined from the candidate links according to the link health time, the communication traffic is migrated to the target link; The processing module is configured to re-time the health time of the preferred link to obtain a preferred link health time if the preferred link recovers to the normal state; and the target link continues to carry the communication traffic if the target link is not abnormal; The way of determining the target link includes: taking a candidate link with the longest link health time as the target link; or taking a candidate link with the least number of times of resetting the link health time as the target link; The detecting module is configured to exclude the candidate link if it is detected that the candidate link is in an abnormal state; and the candidate link in the abnormal state is timed to the normal state until the candidate link in the abnormal state recovers to the normal state.

5. An electronic device, comprising: Comprising: A processor and a memory, the memory stores machine readable instructions executable by the processor, and the machine readable instructions are executed by the processor to perform the method in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the method in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Link duration based routing protocol for multihop ad hoc networks

    US20070195702A1