Link determination method, device and electronic device

By detecting the quality information of the P2P link and the transit link in audio and video calls, dynamically switch to the link with better quality, the call interruption problem caused by the degradation of link quality in the prior art is solved and the user experience is improved.

CN112532738BActive Publication Date: 2024-11-12BIGO TECH PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202011419432.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-07
Publication Date
2024-11-12
Estimated Expiration
2040-12-07

AI Technical Summary

Technical Problem

In audio and video calls, due to changes in the network environment, the quality of P2P links is degraded, and the existing technology cannot switch to the transit link in time, resulting in interruption or abnormality of user calls, affecting the user experience.

Method used

When at least two links are established between the first terminal and the second terminal, link quality information (such as link round trip delay, link additional delay and packet loss rate) is detected, and the target link dynamically determines the target link based on this information. , send media packets through the target link to reduce the lag in network handover.

Benefits of technology

This has achieved reduced lag during user network switching, improved user experience, and ensured the stability of audio and video calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112532738B_ABST
    Figure CN112532738B_ABST
Patent Text Reader

Abstract

The embodiments of the present invention provide a link determination method, device and electronic device, which relate to the field of link switching technology. The method includes: when at least two links are established between a first terminal and a second terminal, detecting link quality information of the at least two links, the link quality information including at least one of link round-trip delay, link additional delay and packet loss rate; determining a target link among the at least two links according to the link quality information of each link; and sending a media packet through the target link. The above scheme can dynamically switch the target link with better quality to send the media packet, reduce the freeze in the user network switching process, and improve the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of link switching, and in particular to a link determination method, device and electronic equipment. Background Art

[0002] In current audio and video calls, some calls will use the Network Address Translation (NAT) traversal technology to simultaneously establish two links, a peer-to-peer (P2P) link and a transit link. The existing solution is generally to use the P2P link instead of the transit link after the P2P link is successfully established. In audio and video calls, since the network environment is in a changing process, the quality of the P2P link will also change with the user's usage. When the service quality of a routing node in the P2P link deteriorates, the user's call will be interrupted or abnormal due to the inability to switch to the transit link in time, affecting the user experience. Summary of the invention

[0003] The present invention provides a link determination method, device and electronic equipment, so as to solve the problem that the prior art cannot dynamically switch links to a certain extent.

[0004] In a first aspect of the implementation of the present invention, a link determination method is provided, which is applied to a first terminal, and the method includes:

[0005] In the case where the first terminal and the second terminal establish at least two links, detecting link quality information of the at least two links, the link quality information including: at least one of a link round-trip delay, a link additional delay, and a packet loss rate;

[0006] Determining a target link among the at least two links according to link quality information of each link;

[0007] A media packet is sent via the target link.

[0008] In a second aspect of the implementation of the present invention, a link determination device is provided, which is applied to a first terminal, and the device includes:

[0009] A detection module, configured to detect link quality information of the at least two links when the first terminal and the second terminal establish at least two links, wherein the link quality information includes at least one of a link round trip delay, a link additional delay, and a packet loss rate;

[0010] A determination module, configured to determine a target link among the at least two links according to link quality information of each link;

[0011] The sending module is used to send the media packet through the target link.

[0012] In a third aspect of the present invention, there is also provided an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0013] Memory, used to store computer programs;

[0014] The processor is used to implement the steps in the link determination method as described above when executing the program stored in the memory.

[0015] In a fourth aspect of the implementation of the present invention, a computer-readable storage medium is further provided, on which a computer program is stored, and when the program is executed by a processor, the link determination method as described above is implemented.

[0016] In a fifth aspect of the embodiments of the present invention, a computer program product comprising instructions is also provided, which, when executed on a computer, enables the computer to execute the link determination method as described above.

[0017] Compared with the prior art, the present invention has the following advantages:

[0018] In an embodiment of the present invention, when at least two links are established between a first terminal and a second terminal, link quality information of the at least two links is detected, and a target link with better link quality among the at least two links is determined based on the link quality information of each link, and media packets are sent through the target link. The target link with better quality can be dynamically switched to send media packets, thereby reducing freezes during user network switching and improving user experience.

[0019] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented according to the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for describing the embodiments are briefly introduced below.

[0021] Figure 1 A flow chart of a link determination method provided by an embodiment of the present invention;

[0022] Figure 2 A schematic diagram of the structure of a link connection provided by an embodiment of the present invention;

[0023] Figure 3 A schematic diagram of a detection process of a first terminal provided in an embodiment of the present invention;

[0024] Figure 4 A structural block diagram of a link determination device provided by an embodiment of the present invention;

[0025] Figure 5 This is a structural block diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0026] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0028] When describing the embodiments of the present invention, some concepts used in the following description are first explained.

[0029] P2P: Peer-to-peer network communication, different from the traditional server / client (Client / Server, C / S) structure, has no central node and is a technology for direct communication between users.

[0030] NAT: Network Address Translation, a technology that solves network address exhaustion and hides devices within the network.

[0031] Traversal Using Relays around NAT (TURN): A technology that uses relays to traverse NAT. It ensures that two terminals can communicate when other NAT traversals fail.

[0032] The existing solution of using detection packets to count delay and packet loss cannot accurately count the packet loss of the link due to the small number of detection packets, resulting in the inability to make accurate judgments; and this detection method is performed when one link is unloaded and the other link is loaded, and it is impossible to detect the actual situation under the network load condition, which is prone to misjudgment and thus affects the user experience; and the existing method of sending media packets simultaneously on the P2P link and the transit link is used to prevent the P2P link quality from deteriorating and affecting the service to users, but the cost of this solution is to increase the server traffic cost and increase the network traffic pressure on the terminal side. Under the condition of terminal network restrictions, it will further deteriorate the network environment and affect the service quality.

[0033] Therefore, the embodiments of the present invention provide a link determination method, device and electronic device, which can dynamically switch the target link with better quality to send media packets, reduce the jamming during the user network switching process, and improve the user experience.

[0034] like Figure 1 As shown, an embodiment of the present invention provides a link determination method, which is applied to a first terminal and specifically includes the following steps:

[0035] Step 101, when at least two links are established between a first terminal and a second terminal, link quality information of the at least two links is detected, wherein the link quality information includes at least one of a link round trip delay, a link additional delay, and a packet loss rate.

[0036] Specifically, when the first terminal establishes at least two links with the second terminal, the first terminal detects link quality information of each of the at least two links at intervals of a period of time (which can be set as needed).

[0037] The link quality information includes packet loss rate and link round-trip delay; or the link quality information includes link round-trip delay, link additional delay, packet loss rate and other situations, which are not specifically limited here.

[0038] It should be noted that the first terminal is a called terminal, and the second terminal is a calling terminal.

[0039] Optionally, the at least two links may include: a peer-to-peer network communication P2P link and a transit link.

[0040] Specifically, Figure 2As shown, the first terminal 21 establishes a P2P link and a transit link with the second terminal 22, wherein the first terminal 21 and the second terminal 22 are directly connected via the P2P link, and the transit link connects the first terminal 21 and the second terminal 22 via the relay server 23. It can be set that the first terminal 21 preferentially uses the P2P link to send media packets. If the first terminal 21 uses the P2P link to send media packets to the second terminal 22, the second terminal 22 also uses the P2P link to send media packets to the first terminal 21. The media packets may be audio packets, video packets, audio and video packets, etc. sent during the communication process, which are not specifically limited here.

[0041] Step 102: Determine a target link among the at least two links according to link quality information of each link.

[0042] Specifically, the first terminal can obtain the link with the best quality among at least two links, ie, the target link, based on the link quality information of each link through comparison or other methods, and can use the link quality information as a basis for determining link switching.

[0043] Step 103: Send the media packet through the target link.

[0044] Specifically, after the first terminal determines a target link with better quality, the first terminal sends a media packet to the second terminal through the target link to reduce freezes during user network switching and improve user experience.

[0045] For example: if before determining the target link, the first terminal uses the P2P link to send media packets; if the determined target link is a P2P link, the first terminal continues to use the P2P link to send media packets; if the determined target link is a transit link, the first terminal needs to switch the link for sending media packets from the P2P link to the transit link; if the determined target link is a P2P link and a transit link, that is, entering a redundant mode, the first terminal needs to send media packets through the P2P link and the transit link.

[0046] It should be noted that if the first terminal enters the redundant mode, the P2P link and the transit link are used to send the media packet, and a redundant mode is introduced. In this mode, the media packet is sent on the P2P link and the transit link at the same time. The media packet can be an audio packet. The reason for using the audio packet instead of the video packet is that the video traffic is relatively large, and directly sending two copies through two links will cause congestion in the user's exit network. Among them, the load conditions of the two links can be made the same, and a relatively fair link condition can be detected as a basis for switching links. In this mode, the second terminal sends the media packet through the link that received the media packet before entering the redundant mode.

[0047] In the above embodiment of the present invention, when at least two links are established between the first terminal and the second terminal, the link quality information of the at least two links is detected, and based on the link quality information of each link, a target link with better link quality among the at least two links is determined, and media packets are sent through the target link. The target link with better quality can be dynamically switched to send media packets, thereby reducing the jamming during the user network switching process and improving the user experience.

[0048] Optionally, detecting the link quality information of the at least two links in step 101 may specifically include:

[0049] Step A1: Send a detection packet to the second terminal through the at least two links.

[0050] Specifically, in the above step A1, the first terminal sends a detection packet to the second terminal through the at least two links to detect link quality. After receiving the detection packet, the second terminal feeds back the detection packet to the first terminal, that is, the second terminal sends a feedback packet corresponding to the detection packet to the first terminal.

[0051] Step A2: detecting whether a feedback packet sent by the second terminal through the at least two links is received at intervals of a first preset time length.

[0052] Specifically, in step A2, if the first terminal sends a media packet through one of the at least two links, the first terminal will detect whether a feedback packet sent by the second terminal is received at every first preset time interval. If the feedback packet is received, it is necessary to know the link where the feedback packet is received, that is, the link quality of the link where the feedback packet is received can be calculated based on the feedback packet.

[0053] It should be noted that if the first terminal is in redundant mode, after entering redundant mode, it is necessary to wait until the redundant period ends before the first terminal detects whether it has received the feedback packet sent by the second terminal through the at least two links, that is, the first preset time length is the redundant period.

[0054] Optionally, the link quality information includes: packet loss rate. After step A1, the method further includes:

[0055] At intervals of the first preset time length, the packet loss rate within the preset time period of the current time is obtained.

[0056] Specifically, at each first preset time interval, the first terminal needs to obtain the packet loss rate in a preset time period before the current time, wherein the preset time period is greater than the first preset time period to ensure the reliability of the packet loss rate.

[0057] Step A3: when no feedback packet is detected in a first link among the at least two links, obtaining link quality information of the first link according to the current time.

[0058] Specifically, if the first link in the at least chain of links does not receive the feedback packet, the current time is acquired, and the link quality information of the first link is calculated according to the current time and the time when the first link sends the detection packet.

[0059] It should be noted that, if the at least two links include a P2P link and a transit link, the first link may be a P2P link, a transit link, or a P2P link and a transit link.

[0060] Step A4: when the first link detects a feedback packet, obtain link quality information of the first link according to the first time when the feedback packet is received.

[0061] Specifically, if the first terminal receives a feedback packet through the first link, the first terminal may calculate the link quality information of the first link according to the first time when the feedback packet is received and the time when the first link sends the detection packet.

[0062] Optionally, the link quality information includes: link round-trip delay. In the case where the first link of the at least two links does not detect the feedback packet in step A3, acquiring the link quality information of the first link according to the current time may specifically include:

[0063] When no feedback packet is detected in a first link of the at least two links, acquiring a historical link round trip delay of the first link acquired before a current time;

[0064] According to the historical round-trip delay of the first link, the current round-trip delay of the first link is acquired.

[0065] Specifically, if the first terminal does not receive the feedback packet through the first link, the link round-trip delay cannot be calculated because the first terminal does not receive the feedback packet. In this case, the first terminal needs to obtain the historical link round-trip delay of the first link obtained before the current time; and use the historical link round-trip delay as the link round-trip delay of the first link at the current time.

[0066] It should be noted that the historical link round-trip delay is the smooth link round-trip delay calculated by a first-order filtering algorithm, that is, the link round-trip delay at the current time is also the smooth link round-trip delay.

[0067] Optionally, the link quality information includes: link additional delay, and in the step A3, when the first link of the at least two links does not detect the feedback packet, acquiring the link quality information of the first link according to the current time may also include:

[0068] Acquire a first duration between a second time at which a detection packet is sent through the first link and the current time;

[0069] Determining whether the first duration is greater than a second preset duration;

[0070] When the first duration is greater than the second preset duration, obtaining a third time after the second time has passed the second preset duration;

[0071] The link additional delay in the link quality information is acquired according to the current time and the third time.

[0072] Specifically, if the first terminal does not receive the feedback packet through the first link, the first terminal needs to obtain the second time for sending the detection packet through the first link and the current time, and calculate the first duration between the current time and the second time, that is, the time difference between the current time and the second time; if the first duration is greater than the second preset duration, the first terminal determines that the current time has timed out and needs to calculate the additional link delay, then the first terminal needs to obtain the third time after the second time has passed the second preset duration, that is, the time threshold for determining whether it has timed out; based on the time difference between the current time and the third time, the additional link delay can be calculated, that is, the time when the current time has timed out.

[0073] For example, taking the first link as a P2P link, Figure 3 As shown, the first preset duration is 100ms, the second preset duration is 200ms, and the second time for the first terminal to send a detection packet through the P2P link is 0ms. If the current time is 100ms and the feedback packet is not received at this time, the historical link round-trip delay of the P2P link is obtained, and the historical link round-trip delay is used as the link round-trip delay of the current time. Since the current time 100ms minus the second time 0ms results in the first duration being 100ms, and the first duration is less than the second preset duration, that is, 100ms is less than 200ms, the additional link delay is not calculated. If the feedback packet has not been received within 100ms, a detection packet can be sent every 10ms (which can be set as needed) according to the packet loss detection interval until the feedback packet is received, and the detection packet continues to be sent at an interval of 200ms.

[0074] If the feedback packet has not been received at 200ms, the link additional delay is calculated. If the current time is 250ms and the feedback packet is not received at this time, the historical link round-trip delay of the P2P link is obtained, and the historical link round-trip delay is used as the link round-trip delay of the current time. Since the current time 250ms minus the second time 0ms results in the first duration of 250ms, and the first duration is greater than the second preset duration, that is, 250ms is greater than 200ms, it is necessary to calculate the link additional delay. The third time after the second preset duration of the second time is 200ms. According to the time difference of 50ms between the current time 250ms and the third time 200ms, it can be obtained that the link additional delay is 50ms.

[0075] Optionally, the link quality information includes: a link round trip delay. In step A4, when the first link detects a feedback packet, acquiring the link quality information of the first link according to the first time of receiving the feedback packet may specifically include:

[0076] When a feedback packet is detected on the first link, acquiring a first time of receiving the feedback packet and a fourth time of sending a corresponding detection packet;

[0077] A link round trip delay in the link quality information is acquired according to the first time and the fourth time.

[0078] Specifically, if the first link detects a feedback packet, the first terminal needs to obtain the first time of receiving the feedback packet and the fourth time of sending the corresponding detection packet, calculate the time difference between the first time and the fourth time, and obtain the link round-trip delay in the link quality information through a first-order filtering algorithm.

[0079] It should be noted that if the first terminal receives a feedback packet sent by the second terminal through the first link, then the additional link delay of the first link is zero.

[0080] The following takes at least two links including a P2P link and a transit link as an example to describe the specific content of step 102 in detail:

[0081] Optionally, when the link quality information includes a link round trip delay, a link additional delay, and a packet loss rate, and a media packet is currently sent through a P2P link, determining a target link among the at least two links according to the link quality information of each link in step 102 includes:

[0082] Obtaining a first value of the sum of the link round-trip delay and the link additional delay of the P2P link and a second value of the sum of the link round-trip delay and the link additional delay of the transit link;

[0083] If the media packet is currently sent through the P2P link, and the first value is greater than the product of the second value and the delay switching coefficient, and the product of the packet loss rate of the P2P link and the packet loss switching coefficient is greater than the packet loss rate of the transit link, then the target link is determined to be the P2P link and the transit link;

[0084] If a media packet is currently being sent through a transit link, and the first value is less than or equal to the product of the second value and the delay switching coefficient, and / or the product of the packet loss rate of the P2P link and the packet loss switching coefficient is less than or equal to the packet loss rate of the transit link, then the target link is determined to be a P2P link and a transit link.

[0085] Specifically, if the first terminal sends a media packet through a P2P link, the first terminal calculates a first value of the sum of the link round-trip delay and the link additional delay of the P2P link, and calculates a second value of the sum of the link round-trip delay and the link additional delay of the transit link. If the first value is greater than the product of the second value and the delay switching coefficient, and the product of the packet loss rate of the P2P link and the packet loss switching coefficient is greater than the packet loss rate of the transit link, the first terminal enters a redundant mode and sends media packets through the P2P link and the transit link. At this time, the second terminal sends media packets through the P2P link used by the first terminal to send media packets before entering the redundant mode.

[0086] Further, if the first terminal sends a media packet through a P2P link, the first terminal determines whether the P2P link and the transit link satisfy a first formula. If so, the first terminal enters a redundant mode and sends the media packet through the P2P link and the transit link; wherein the first formula is specifically:

[0087] P2P RTT +P2P AddValue >α*(UDP RTT +UDP AddValue )

[0088] and

[0089] P2P Loss +β>UDP Loss

[0090] Among them, P2P RTT Indicates the round-trip delay of the P2P link;

[0091] P2P AddValue Indicates the additional link delay of the P2P link;

[0092] P2P Loss Indicates the packet loss rate of the P2P link;

[0093] UDP RTT Indicates the round-trip delay of the transit link;

[0094] UDP AddValue Indicates the additional link delay of the transit link;

[0095] UDP Loss Indicates the packet loss rate of the transit link;

[0096] α represents the delay switching coefficient;

[0097] β represents the packet loss switching coefficient.

[0098] Specifically, if the current first terminal sends a media packet through a transit link, the first terminal calculates a first value of the sum of the link round-trip delay and the link additional delay of the P2P link, and calculates a second value of the sum of the link round-trip delay and the link additional delay of the transit link. If the first value is less than or equal to the product of the second value and the delay switching coefficient, and / or the product of the packet loss rate of the P2P link and the packet loss switching coefficient is less than or equal to the packet loss rate of the transit link, the first terminal enters a redundant mode and sends media packets through the P2P link and the transit link. At this time, the second terminal sends media packets through the transit link used by the first terminal to send media packets before entering the redundant mode.

[0099] Furthermore, if the first terminal sends a media packet via a transit link, the first terminal determines whether the P2P link and the transit link satisfy the first formula. If not, the first terminal enters a redundant mode and sends the media packet via the P2P link and the transit link.

[0100] Optionally, when the link quality information includes a link round-trip delay and a packet loss rate, and the media packet is currently sent through a P2P link and a transit link, determining the target link among the at least two links according to the link quality information of each link in step 102 includes:

[0101] Obtaining a third value of the sum of the round-trip delay and the packet loss rate of the P2P link and a fourth value of the sum of the round-trip delay and the packet loss rate of the transit link;

[0102] If the third value is greater than the product of the fourth value and the delay switching coefficient, determining that the target link is a transit link;

[0103] If the third value is less than or equal to the product of the fourth value and the delay switching coefficient, it is determined that the target link is a P2P link.

[0104] Specifically, if the first terminal is in redundant mode, that is, the first terminal sends media packets through the P2P link and the transit link within the redundant period, then after the redundant period ends, the first terminal calculates a third value of the sum of the link round-trip delay and the packet loss rate of the P2P link, and calculates a fourth value of the sum of the link round-trip delay and the packet loss rate of the transit link. If the third value is greater than the product of the fourth value and the delay switching coefficient, the first terminal sends the media packet through the transit link. At this time, the second terminal also sends the media packet through the transit link.

[0105] Further, if the first terminal sends the media packet through the P2P link and the transit link, the first terminal determines whether the P2P link and the transit link satisfy the second formula. If so, the first terminal sends the media packet through the transit link; wherein the second formula is specifically:

[0106] P2P RTT +P2P Loss >α*(UDP RTT +UDP Loss )

[0107] Among them, P2P RTT Indicates the round-trip delay of the P2P link;

[0108] P2P Loss Indicates the packet loss rate of the P2P link;

[0109] UDP RTT Indicates the round-trip delay of the transit link;

[0110] UDP Loss Indicates the packet loss rate of the transit link;

[0111] α represents the delay switching coefficient.

[0112] Specifically, if the first terminal is in redundant mode, that is, the first terminal sends media packets through the P2P link and the transit link within the redundant period, then after the redundant period ends, the first terminal calculates a third value of the sum of the link round-trip delay and the packet loss rate of the P2P link, and calculates a fourth value of the sum of the link round-trip delay and the packet loss rate of the transit link. If the third value is less than or equal to the product of the fourth value and the delay switching coefficient, the first terminal sends the media packet through the P2P link. At this time, the second terminal also sends the media packet through the P2P link.

[0113] Further, if the first terminal sends the media packet through the P2P link and the transit link, the first terminal determines whether the P2P link and the transit link satisfy the second formula. If not, the first terminal sends the media packet through the P2P link.

[0114] To sum up, in the above embodiments of the present invention, in the stable mode, the first terminal (i.e., the called terminal) periodically detects the P2P link and the transit link at the same time. After receiving the detection packet, the second terminal (i.e., the calling terminal) provides feedback on the detection packet. The second terminal sends a feedback packet to the first terminal. The first terminal can obtain the link quality information of the P2P link and the transit link through detection. By comparing the link quality information, the first terminal selects a link with better quality to send a media packet, and the second terminal switches the link according to the link selected by the first terminal, thereby reducing the freeze in the user network switching process and improving the user experience.

[0115] like Figure 4 As shown, an embodiment of the present invention provides a link determination device 400, the device comprising:

[0116] The detection module 401 is used to detect link quality information of the at least two links when the first terminal and the second terminal establish at least two links, wherein the link quality information includes at least one of a link round-trip delay, a link additional delay, and a packet loss rate;

[0117] A determination module 402, configured to determine a target link among the at least two links according to link quality information of each link;

[0118] The sending module 403 is configured to send the media packet via the target link.

[0119] In the above embodiment of the present invention, when at least two links are established between the first terminal and the second terminal, the link quality information of the at least two links is detected, and based on the link quality information of each link, a target link with better link quality among the at least two links is determined, and media packets are sent through the target link. The target link with better quality can be dynamically switched to send media packets, thereby reducing the jamming during the user network switching process and improving the user experience.

[0120] Optionally, the detection module 401 includes:

[0121] A sending unit, configured to send a detection packet to the second terminal through the at least two links;

[0122] a detection unit, configured to detect, at intervals of a first preset time length, whether a feedback packet sent by the second terminal through the at least two links is received;

[0123] A first acquisition unit, configured to acquire link quality information of a first link among the at least two links according to a current time when no feedback packet is detected in the first link;

[0124] The second acquisition unit is configured to acquire link quality information of the first link according to a first time of receiving the feedback packet when the feedback packet is detected by the first link.

[0125] Optionally, the link quality information includes: a link round trip delay, and the first acquisition unit includes:

[0126] A first acquisition subunit is used to acquire a historical link round-trip delay of the first link acquired before a current time when no feedback packet is detected in the first link of the at least two links;

[0127] The second acquisition subunit is used to acquire the current round-trip delay of the first link according to the historical round-trip delay of the first link.

[0128] Optionally, the link quality information includes: link additional delay, and the first acquisition unit further includes:

[0129] A third acquisition subunit, configured to acquire a first duration between a second time at which the detection packet is sent through the first link and a current time;

[0130] A judging subunit, used to judge whether the first duration is greater than a second preset duration;

[0131] A fourth acquisition subunit is used to acquire a third time after the second time has passed the second preset time when the first time is greater than the second preset time;

[0132] The fifth acquisition subunit is used to acquire the link additional delay in the link quality information according to the current time and the third time.

[0133] Optionally, the link quality information includes: link round trip delay, and the second acquisition unit includes:

[0134] a sixth acquisition subunit, configured to acquire, when the first link detects a feedback packet, a first time of receiving the feedback packet and a fourth time of sending a corresponding detection packet;

[0135] The seventh acquisition subunit is used to acquire the link round-trip delay in the link quality information according to the first time and the fourth time.

[0136] Optionally, the link quality information includes: a packet loss rate, and after sending the detection packet to the second terminal through the at least two links, the detection module 401 further includes:

[0137] The third acquisition unit is used to acquire the packet loss rate within a preset time period of the current time at intervals of the first preset time length.

[0138] Optionally, the at least two links include: a peer-to-peer network communication P2P link and a transit link.

[0139] Optionally, when the link quality information includes a link round trip delay, a link additional delay, and a packet loss rate, and a media packet is currently sent through a P2P link, the determining module 402 includes:

[0140] A fourth acquisition unit, used to acquire a first value of the sum of the link round-trip delay and the link additional delay of the P2P link and a second value of the sum of the link round-trip delay and the link additional delay of the transit link;

[0141] a first determining unit, configured to determine that the target link is a P2P link and a transit link if a media packet is currently being sent via a P2P link, and the first value is greater than a product of the second value and a delay switching coefficient, and the product of a packet loss rate of the P2P link and a packet loss switching coefficient is greater than a packet loss rate of a transit link;

[0142] The second determination unit is used to determine that the target link is a P2P link and a transit link if a media packet is currently being sent via a transit link and the first value is less than or equal to the product of the second value and the delay switching coefficient, and / or the product of the packet loss rate of the P2P link and the packet loss switching coefficient is less than or equal to the packet loss rate of the transit link.

[0143] Optionally, when the link quality information includes a link round trip delay and a packet loss rate, and the media packet is currently sent through a P2P link and a transit link, the determining module 402 further includes:

[0144] A fifth acquisition unit, configured to acquire a third value of the sum of the round-trip delay and the packet loss rate of the P2P link and a fourth value of the sum of the round-trip delay and the packet loss rate of the transit link;

[0145] a third determining unit, configured to determine that the target link is a transit link if the third value is greater than a product of the fourth value and a delay switching coefficient;

[0146] The fourth determining unit is configured to determine that the target link is a P2P link if the third value is less than or equal to the product of the fourth value and the delay switching coefficient.

[0147] To sum up, in the above embodiments of the present invention, in the stable mode, the first terminal (i.e., the called terminal) periodically detects the P2P link and the transit link at the same time. After receiving the detection packet, the second terminal (i.e., the calling terminal) provides feedback on the detection packet. The second terminal sends a feedback packet to the first terminal. The first terminal can obtain the link quality information of the P2P link and the transit link through detection. By comparing the link quality information, the first terminal selects a link with better quality to send a media packet, and the second terminal switches the link according to the link selected by the first terminal, thereby reducing the freeze in the user network switching process and improving the user experience.

[0148] It should be noted that the link determination device embodiment is a device corresponding to the above-mentioned link determination method. All implementation methods of the above-mentioned method embodiment are applicable to the device embodiment and can achieve the same technical effects, which will not be repeated here.

[0149] The embodiment of the present invention also provides an electronic device. Figure 5 As shown, it includes a processor 501 , a communication interface 502 , a memory 503 and a communication bus 504 , wherein the processor 501 , the communication interface 502 , and the memory 503 communicate with each other via the communication bus 504 .

[0150] The memory 503 is used to store computer programs.

[0151] When the processor 501 is used to execute the program stored in the memory 503, part or all of the steps in a link determination method provided by an embodiment of the present invention are implemented.

[0152] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0153] The communication interface is used for communication between the above terminal and other devices.

[0154] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0155] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0156] In another embodiment of the present invention, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the link determination method described in the above embodiment.

[0157] In another embodiment of the present invention, a computer program product including instructions is provided. When the computer program product is run on a computer, the computer executes the link determination method described in the above embodiment.

[0158] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0159] The above description is only a preferred embodiment of the present invention and is not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.

Claims

1. A link determination method, applied to a first terminal, characterized in that: The method comprises: In the case where the first terminal and the second terminal establish at least two links, detecting link quality information of the at least two links, the link quality information including: at least one of a link round-trip delay, a link additional delay, and a packet loss rate; Determining a target link among the at least two links according to link quality information of each link; sending a media packet via the target link; The at least two links include: a peer-to-peer network communication P2P link and a transit link; When it is determined that the target link is a P2P link and a transit link, the first terminal enters a redundant mode and sends a media packet through the P2P link and the transit link; After the redundancy period ends, the first terminal detects whether a feedback packet sent by the second terminal through the at least two links is received; wherein the redundancy period is a first preset duration.

2. The method according to claim 1, characterized in that The detecting link quality information of the at least two links includes: sending a detection packet to the second terminal through the at least two links; At intervals of a first preset time length, detecting whether a feedback packet sent by the second terminal through the at least two links is received; When no feedback packet is detected in a first link of the at least two links, acquiring link quality information of the first link according to a current time; In a case where the first link detects a feedback packet, link quality information of the first link is acquired according to a first time when the feedback packet is received.

3. The method according to claim 2, characterized in that The link quality information includes: a link round trip delay, and when a first link among the at least two links does not detect a feedback packet, acquiring the link quality information of the first link according to the current time includes: When no feedback packet is detected in a first link of the at least two links, acquiring a historical link round trip delay of the first link acquired before a current time; According to the historical round-trip delay of the first link, the current round-trip delay of the first link is acquired.

4. The method according to claim 2, characterized in that: The link quality information includes: link additional delay, and when a first link among the at least two links does not detect a feedback packet, acquiring the link quality information of the first link according to the current time, further includes: Acquire a first duration between a second time at which a detection packet is sent through the first link and the current time; Determining whether the first duration is greater than a second preset duration; When the first duration is greater than the second preset duration, obtaining a third time after the second time has passed the second preset duration; The link additional delay in the link quality information is acquired according to the current time and the third time.

5. The method according to claim 2, characterized in that: The link quality information includes: a link round trip delay, wherein when the first link detects a feedback packet, acquiring the link quality information of the first link according to a first time of receiving the feedback packet includes: When a feedback packet is detected on the first link, acquiring a first time of receiving the feedback packet and a fourth time of sending a corresponding detection packet; A link round trip delay in the link quality information is acquired according to the first time and the fourth time.

6. The method according to claim 2, characterized in that The link quality information includes: packet loss rate. After sending the detection packet to the second terminal through the at least two links, the method further includes: At intervals of the first preset time length, the packet loss rate within the preset time period of the current time is obtained.

7. The method according to claim 1, characterized in that In a case where the link quality information includes a link round trip delay, a link additional delay, and a packet loss rate, and a media packet is currently sent through a P2P link, determining a target link among the at least two links according to the link quality information of each link includes: Obtaining a first value of the sum of a link round-trip delay and a link additional delay of a P2P link and a second value of the sum of a link round-trip delay and a link additional delay of a transit link; If the media packet is currently sent through the P2P link, and the first value is greater than the product of the second value and the delay switching coefficient, and the product of the packet loss rate of the P2P link and the packet loss switching coefficient is greater than the packet loss rate of the transit link, then the target link is determined to be the P2P link and the transit link; If a media packet is currently being sent through a transit link, and the first value is less than or equal to the product of the second value and the delay switching coefficient, and / or the product of the packet loss rate of the P2P link and the packet loss switching coefficient is less than or equal to the packet loss rate of the transit link, then the target link is determined to be a P2P link and a transit link.

8. The method according to claim 1, characterized in that In a case where the link quality information includes a link round-trip delay and a packet loss rate, and the media packet is currently sent through a P2P link and a transit link, determining a target link among the at least two links according to the link quality information of each link includes: Obtaining a third value of the sum of the round-trip delay and the packet loss rate of the P2P link and a fourth value of the sum of the round-trip delay and the packet loss rate of the transit link; If the third value is greater than the product of the fourth value and the delay switching coefficient, determining that the target link is a transit link; If the third value is less than or equal to the product of the fourth value and the delay switching coefficient, it is determined that the target link is a P2P link.

9. A link determination device, applied to a first terminal, characterized in that: The device comprises: A detection module, configured to detect link quality information of the at least two links when the first terminal and the second terminal establish at least two links, wherein the link quality information includes at least one of a link round trip delay, a link additional delay, and a packet loss rate; A determination module, configured to determine a target link among the at least two links according to link quality information of each link; A sending module, used for sending a media packet through the target link; The at least two links include: a peer-to-peer network communication P2P link and a transit link; When it is determined that the target link is a P2P link and a transit link, the first terminal enters a redundant mode and sends a media packet through the P2P link and the transit link; After the redundancy period ends, the first terminal detects whether a feedback packet sent by the second terminal through the at least two links is received; wherein the redundancy period is a first preset duration.

10. An electronic device, characterized in that: include: A processor, a communication interface, a memory and a communication bus; wherein the processor, the communication interface and the memory communicate with each other via the communication bus; Memory, used to store computer programs; A processor, configured to implement the steps of the link determination method according to any one of claims 1 to 8 when executing a program stored in the memory.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the link determination method according to any one of claims 1 to 8 is implemented.