A connection detection method, client, server, system and storage medium

By adjusting the detection cycle according to the server's traffic volume and connection status, the problem of frequent detection resulting in excessive pressure on the server is solved, and stable connection recovery and user experience are achieved.

CN115529255BActive Publication Date: 2024-11-15HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110713070.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-25
Publication Date
2024-11-15
Estimated Expiration
2041-06-25

AI Technical Summary

Technical Problem

In the prior art, the client frequently sends detection information to the server when the connection is abnormal, resulting in excessive processing pressure on the server and may cause the server to crash.

Method used

The client adjusts the detection cycle according to the current traffic volume and connection status of the server, and sends detection information in a timely manner to avoid frequent detection and excessive pressure on the server, while ensuring that the connection is restored as soon as possible.

Benefits of technology

By adapting the detection cycle, the load pressure on the server is reduced, the server crash is avoided, the user experience is improved, and the network connection is stable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115529255B_ABST
    Figure CN115529255B_ABST
Patent Text Reader

Abstract

A connection detection method, a client, and a server. When the method is applied to a client, the client determines that the connection with the server is abnormal; it sends detection information to the server in a first cycle, and the detection information is used to detect whether the connection is restored; wherein the first cycle is adapted to the current business volume of the server, and / or is related to the current connection state of the connection. In this way, the client takes into account the business pressure of the server when sending detection information to the server, avoiding the server from crashing due to excessive pressure.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a connection detection method, a client, and a server. Background Art

[0002] The client (such as a mobile terminal) connects to the server (such as an application server) to access the server content. For example, a TCP connection or a QUIC connection is established between the client and the server, and then the email sending and receiving, file transfer, instant messaging, etc. on the client rely on the TCP connection or the QUIC connection.

[0003] Currently, when the connection between the client and the server is abnormal, in order to restore the connection as soon as possible, the client will continuously detect whether the connection is restored at a locally configured period. This method of the client continuously detecting at a local period can easily increase the processing pressure on the server and cause the server to crash. Summary of the invention

[0004] The purpose of this application is to provide a connection detection method and device, which helps to alleviate the processing pressure on the server and avoid the server from crashing due to excessive pressure.

[0005] In the first aspect, a connection detection method is provided. The method is applied to a client. The client is, for example, a mobile phone, a tablet computer, a laptop computer, etc., and the embodiments of the present application are not limited thereto. The client determines that the connection with the server is abnormal; the client sends detection information to the server in a first cycle, and the detection information is used to detect whether the connection is restored; wherein the first cycle is adapted to the current traffic volume of the server, and / or is related to the current connection state of the connection. That is to say, in an embodiment of the present application, when the connection between the client and the server is abnormal, the cycle of the detection information sent by the client to the server is adapted to the current traffic volume of the server. For example, when the current traffic volume of the server is high, the client sends detection information in a smaller cycle to avoid frequent sending of detection information to the server, which causes the server to collapse due to excessive pressure; when the current traffic volume of the server is small, the client sends detection information in a larger cycle to ensure that the connection is restored as soon as possible.

[0006] The connection between the client and the server may be a UDP-based connection, such as a TCP connection, a QUIC connection, etc.; or, it may be a connection based on other protocols (different from UDP, TCP, and QUIC) that will appear in the future as technology evolves, which is not limited in the embodiments of the present application.

[0007] The detection information is used to detect whether the connection is restored, and may include: detecting whether at least one of the congestion situation, transmission rate, packet loss rate, etc. of the connection has returned to normal. The congestion situation returning to normal includes that the number of messages waiting to be processed received by the server on the connection is less than a preset number. The transmission rate returning to normal includes that the service transmission rate is greater than a threshold value 1 or is within a preset range. The packet loss rate returning to normal includes that the packet loss rate is less than a threshold value 2 or is within a preset range.

[0008] In one possible design, determining that the connection between the client and the server is abnormal includes: determining that the connection is abnormal when the connection satisfies at least one of the following conditions; the conditions include: the response delay of the server is greater than the first threshold, the data transmission rate is less than the second threshold, and the packet loss rate is greater than the third threshold. Exemplarily, when the response delay of the server is long or the data transmission efficiency is low, the user experience will be affected. For example, a user uses a mobile phone (client) to search for content online, but because the server response time is extended or the data transmission efficiency is low, the search results have not been found, or the mobile phone plays an online video, because the server response time is extended or the data transmission efficiency is low, the video is relatively stuck, etc. Similarly, a large packet loss rate will also affect the user experience, such as the network resources (pictures, videos, etc.) requested by the user, but because of the high packet loss rate, the resources returned by the server are inaccurate or cannot be opened. In the embodiment of the present application, when the client detects that the response delay of the server is large, the data transmission rate is small, and the packet loss rate is large, it is determined that the connection with the server is abnormal, and detection can be started to restore the connection as soon as possible to ensure the user's network experience.

[0009] In one possible design, determining that the connection between the client and the server is abnormal includes: the network access method of the client changes; wherein the network access method of the client changes, including at least one of the following: switching from a wireless local area network to a mobile communication network; or,

[0010] Switching from a first communication standard to a second communication standard of a mobile communication network; or,

[0011] Switch from the first LAN to the second LAN.

[0012] For example, after the user takes the client out of home, the client's network access method switches from the WIFI network to the mobile communication network (4G network, 3G network or 5G network). At this time, the client detects that the connection with the server is abnormal and can start detection to restore the connection as soon as possible to ensure the user's network experience.

[0013] In a possible design, the first period is adapted to the current service volume of the server, including at least one of the following: the first period is related to the current device access volume of the server; or,

[0014] The first period is related to the number of messages currently to be processed by the server; or,

[0015] The first period is related to the local running load of the server.

[0016] That is to say, when the connection between the client and the server is abnormal, the period of the detection information sent by the client to the server is adapted to the current business volume of the server, so as to avoid frequent sending of detection information to the server when the current business volume of the server is high, causing the server to crash due to excessive pressure.

[0017] In one possible design, the first period is related to the current connection state of the connection, including: the current connection state of the connection includes: the number of times, frequency, duration, and at least one of the response delay, transmission rate, and packet loss rate of abnormalities that have occurred in the connection; the first period is directly proportional or inversely proportional to the current connection state.

[0018] That is to say, when the connection between the client and the server is abnormal, the period of the detection information sent by the client to the server is adapted to the current connection status of the connection between the client and the server. For example, if the response time of the connection between the client and the server is long, the detection information is sent in a shorter period to avoid frequent sending of detection information to the server, which may cause the server to crash due to excessive pressure; when the response time of the connection is short, the detection information can be sent in a longer period to restore the connection as soon as possible.

[0019] In a possible design, the method further includes: the client receiving configuration information sent by the server, the configuration information including at least one of the following:

[0020] Minimum detection period, used to indicate the minimum period for the client to send detection information;

[0021] The first indication information is used to indicate whether the client starts backoff;

[0022] Backoff parameters, used to indicate backoff rules;

[0023] A maximum detection period, used to indicate the maximum period for the client to send detection information; wherein the minimum period and / or the maximum period is determined by the server according to the current business volume;

[0024] An effective connection, used to indicate a connection for which the configuration information is effective;

[0025] The second indication information is used to indicate whether the client uses other protocols to initiate detection, where the other protocols are different from the protocol corresponding to the connection;

[0026] A first protocol, used to instruct the client to send detection information based on the first protocol, where the first protocol is different from a protocol corresponding to the connection;

[0027] The first protocol related parameter is used to indicate the detection period supported by the first protocol.

[0028] That is to say, the server can configure the detection cycle for the client, and can also configure at least one of whether to start the backoff mode, backoff parameters, maximum detection cycle, application connection, whether to configure an external detection protocol, and external detection protocol parameters. In this way, the client does not need to calculate the detection cycle by itself, and the client is less stressed. Moreover, the detection cycle determined by the server itself is more accurate. Because the server knows the specific situation of the local business volume, it can determine the accurate detection cycle.

[0029] In one possible design, there are multiple connections between the client and the server, and the effective connection includes at least one of a specified connection, all connections, and a current connection; wherein the current connection refers to the connection through which the client and the server transmit the configuration information. In other words, the detection period configured by the server to the client can be applicable to all connections between the client and the server, or a specified connection, or a current connection. In other words, for a scenario in which there are multiple connections between the client and the server, some connections (such as a specified connection or a current connection) can be detected using the connection detection method provided in the present application, and some connections can be detected using an existing solution (i.e., detecting with a local period of the client without considering the service volume of the server), which is not limited in the embodiments of the present application.

[0030] In one possible design, the connection includes a first connection and a second connection; the client receives the first period configured by the server through the first connection; when the client determines that an abnormality occurs in the second connection, the client sends a detection signal to the server through the second connection in a second period, and the detection signal is used to detect whether the second connection is restored, and the second period is equal to the first period, or the second period is calculated based on the first period and a backoff parameter.

[0031] Exemplarily, it is assumed that there are a first TCP connection and a second TCP connection between the client and the server. The server configures a detection period (i.e., the first period) to the client through the first TCP connection. The client can apply the first period to the second TCP connection. For example, when the second TCP connection is abnormal, detection information can be sent on the second TCP connection according to the first period. In this way, when the client and the server have multiple connections, the server can indicate the detection period through a certain connection (such as the one in the best state or a pre-configured one), without having to indicate it once through each connection, which is more efficient. Among them, the connection in the best state can be the connection with the least current business volume.

[0032] In one possible design, the connection includes a first connection and a second connection, and the third period corresponding to the first connection is adapted to the business volume of the server on the first connection, and / or is related to the current connection state of the first connection; the fourth period corresponding to the second connection is adapted to the business volume of the server on the second connection, and / or is related to the current connection state of the second connection.

[0033] Exemplarily, it is assumed that there are a first TCP connection and a second TCP connection between the client and the server. The detection period corresponding to the first TCP connection is adapted to the traffic on the first TCP connection, and / or is related to the current connection state of the first TCP connection. The detection period corresponding to the second TCP connection is adapted to the traffic on the second TCP connection, and / or is related to the current connection state of the second TCP connection. In other words, when the client and the server have multiple connections, the detection period corresponding to each connection may be different. Specifically, the detection period of each connection is adapted to the traffic on the connection, and / or is related to the current connection state of the connection. In this way, each connection has detection information adapted to the connection, and the granularity is finer.

[0034] In a second aspect, a connection detection method is also provided. The method can be applied to a server. The server determines a current state, wherein the current state includes a current traffic volume of the server and / or a current connection state of a connection between the server and a client; and determines a first period according to the current state, wherein the first period is used to indicate a period for the client to send detection information to the server.

[0035] In one possible design, determining a first period according to the current state includes at least one of the following:

[0036] The first period is related to the current number of device accesses to the server; or,

[0037] The first period is related to the number of messages currently to be processed by the server; or,

[0038] The first period is related to the local running load of the server.

[0039] In a possible design, determining a first cycle according to the current state includes:

[0040] The current connection status of the connection includes: the number, frequency, duration, and at least one of the response delay, transmission rate, and packet loss rate of the abnormality occurred in the connection;

[0041] The first period is directly proportional or inversely proportional to the current connection state.

[0042] In one possible design, the method further includes:

[0043] Send configuration information to the client, the configuration information including at least one of the following:

[0044] Minimum detection period, used to indicate the minimum period for the client to send detection information;

[0045] The first indication information is used to indicate whether the client starts backoff;

[0046] Backoff parameters, used to indicate backoff rules;

[0047] A maximum detection period, used to indicate the maximum period for the client to send detection information; wherein the minimum period and / or the maximum period is determined by the server according to the current business volume;

[0048] An effective connection, used to indicate a connection for which the configuration information is effective;

[0049] The second indication information is used to indicate whether the client uses other protocols to initiate detection, where the other protocols are different from the protocol corresponding to the connection;

[0050] A first protocol, used to instruct the client to send detection information based on the first protocol, where the first protocol is different from a protocol corresponding to the connection;

[0051] The first protocol related parameter is used to indicate the detection period supported by the first protocol.

[0052] In one possible design, there are multiple connections between the network device and the server, and the effective connection includes at least one of a specified connection, all connections, and a current connection; wherein the current connection refers to the connection between the client and the server for transmitting the configuration information.

[0053] In a possible design, the connection includes a first connection and a second connection, and the third period corresponding to the first connection is adapted to the traffic of the server on the first connection, and / or is related to a current connection state of the first connection;

[0054] The fourth period corresponding to the second connection is adapted to the traffic of the server on the second connection and / or is related to the current connection state of the second connection.

[0055] In a third aspect, a client is also provided, comprising a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the client executes the method provided in the first aspect above.

[0056] In the fourth aspect, a client is also provided, including a module / unit for executing the method of the first aspect or any possible design of the first aspect; these modules / units can be implemented by hardware, or can be implemented by hardware executing corresponding software. For example, it includes a processing unit for determining that the connection between the client and the server is abnormal; a transceiver unit for sending detection information to the server in a first period, and the detection information is used to detect whether the connection is restored; wherein the first period is adapted to the current traffic volume of the server, and / or is related to the current connection state of the connection.

[0057] In a fifth aspect, a server is also provided, comprising a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the server executes the method provided in the second aspect above.

[0058] In the sixth aspect, a server is also provided, comprising: a module / unit for executing the method of the second aspect or any possible design of the second aspect; these modules / units can be implemented by hardware, or can be implemented by hardware executing corresponding software. For example, it includes a processing unit for determining the current state of the server, and the current state includes the current traffic volume of the server, and / or the current connection state of the connection between the server and the client; the processing unit is also used to determine a first period based on the current state, and the first period is used to indicate the period for the client to send detection information to the server. Optionally, it may also include a transceiver unit for sending indication information of the first period to the client.

[0059] In a seventh aspect, a communication system is also provided, including:

[0060] A client, used to execute the method provided in the first aspect above;

[0061] The server is used to execute the method provided in the second aspect as described above.

[0062] In an eighth aspect, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes program instructions, and when the program instructions are executed on a computer, the computer executes the method provided in the first aspect above.

[0063] In a ninth aspect, a computer-readable storage medium is also provided, wherein the computer-readable storage medium includes program instructions. When the program instructions are executed on a computer, the computer executes the method provided in the second aspect above.

[0064] In a tenth aspect, a computer program product is also provided, comprising a computer program, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.

[0065] In the eleventh aspect, a computer program product is also provided, comprising a computer program, which, when executed on a computer, enables the computer to execute the method described in the second aspect above.

[0066] For the beneficial effects of the second to eleventh aspects above, please refer to the beneficial effects of the first aspect and will not be repeated. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of a communication system provided in one embodiment of the present application;

[0068] Figure 2 A schematic diagram of the structure of a client provided in an embodiment of the present application;

[0069] Figure 3 A schematic diagram of a flow chart of a connection detection method provided in an embodiment of the present application;

[0070] Figure 4 A schematic diagram of connecting different network entrances of a client and a server provided in an embodiment of the present application;

[0071] Figure 5 A schematic diagram of a display interface of a client provided in an embodiment of the present application;

[0072] Figure 6 Another schematic diagram of a connection detection method provided in an embodiment of the present application;

[0073] Figure 7 A schematic diagram of an MPTCP connection scenario provided in an embodiment of the present application;

[0074] Figure 8 A flow chart of a connection detection method in an MPTCP connection scenario provided by an embodiment of the present application;

[0075] Fig. 9 A schematic diagram of an MPQUIC connection scenario provided in an embodiment of the present application;

[0076] Fig.10 A flowchart of a connection detection method in an MPQUIC connection scenario provided by an embodiment of the present application;

[0077] Fig.11 A schematic diagram of the structure of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0078] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. Among them, in the description of the embodiments of the present application, the terms "first" and "second" are used only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" can explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the meaning of "multiple" is two or more. In addition, in the embodiments of the present application, "and / or" is only a kind of association relationship describing the associated objects, indicating that there can be three kinds of relationships, for example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0079] Figure 1 A schematic diagram of a communication system provided in an embodiment of the present application. The communication system includes a client and a server, and the client and the server are connected via a network; or in other words, both the client and the server are connected to the network, and communication between the client and the server is achieved through the network.

[0080] The client can be a terminal device, such as a mobile phone, a tablet computer, a computer with a transceiver function, a virtual reality (VR) terminal device, an augmented reality (AR) terminal device, a wireless terminal in industrial control, a wireless terminal in self driving, a wireless terminal in remote medical, a wireless terminal in a smart grid, a wireless terminal in transportation safety, a wireless terminal in a smart city, a wireless terminal in a smart home, a wearable device, and a vehicle-mounted device; and a network device, such as a three-layer switch, a router, a broadband gateway, a firewall, a load balancer and other network devices.

[0081] The service end, which can also be called a server, can serve the client. For example, the service end can provide resources to the client and / or save client data, etc. The resource can be at least one of text, images, and videos. The service end can be a server or a server cluster, which is not limited in the embodiments of the present application. The service end can be an application server, that is, an application server that provides services for different applications in the client. It should be understood that the client includes various types of applications, such as Huawei Changlian, Instant messaging applications such as QQ, Weibo, forums, etc.; social networks such as TikTok, Xiaohongshu, etc.; video playback applications such as iQiyi, Tencent, etc. When the client uses different applications, the client establishes a connection with the application server corresponding to each application for communication. For example, if the client runs the Huawei Changlian application, the server is the Huawei Changlian server.

[0082] For example, Figure 1 As shown, the network includes a radio access network (RAN) and a core network (CN). The client accesses the core network through the access network, and the core network is connected to the server, so the client establishes a connection with the server.

[0083] The connection between the client and the server can be a Transmission Control Protocol (TCP) connection or a Quick UDP Internet Connection (QUIC). The following briefly introduces these two types of connections.

[0084] 1. TCP connection

[0085] Transport layer protocols include TCP and User Datagram Protocol (UDP). TCP connection, as one of them, provides network reliability. The process of a client using a TCP connection to access a server includes: the client sends a TCP request to the server, and the server responds to the TCP request and feeds back a TCP response to the client. In the original TCP protocol, TCP connections process TCP requests one by one. If the previous request or response has not been processed, the next one cannot be processed. This method is prone to head-of-line blocking, that is, if a request or response is delayed, then subsequent requests or responses will be blocked and cannot be processed.

[0086] To solve this problem, the TCP protocol supports sending TCP requests continuously on a TCP connection, without waiting for the response to be received before processing the next request. This technology is called "pipelining" on the TCP connection. Although this method can make continuous requests on a TCP connection, all responses must be processed in the order in which the requests were sent. Therefore, if a response is processed slowly, all subsequent responses will be blocked.

[0087] As network demands increase, the amount of data that needs to be transmitted increases. When a single TCP connection cannot meet network demands, the TCP protocol is extended to obtain the multi-path transmission control protocol (MPTCP). The parallel transmission of multiple TCP connections can improve resource utilization. For example, when a user is watching a video, the client transmits data simultaneously through the TCP connections corresponding to the Wi-Fi network and the cellular network. In this way, the download rate is higher, the jamming is reduced, and the playback is smoother.

[0088] In the embodiment of the present application, the connection between the client and the server can be a single TCP connection or an MPTCP connection, without limitation.

[0089] 2. QUIC Connection

[0090] QUIC is a transport layer protocol based on the UDP protocol. Compared with the TCP protocol, UDP is lighter, but has much less error checking, which means that UDP is often more efficient, but not as reliable as TCP. Therefore, games, streaming media and other applications usually use the UDP protocol, while web pages, emails, remote logins and other applications use the TCP protocol.

[0091] QUIC supports content priority settings. If all requests or responses are transmitted indiscriminately, some critical or important requests may be blocked when bandwidth is limited. Therefore, QUIC supports setting priorities for network content. For example, QUIC can provide management and resource allocation functions for multiple streams, making it possible to prioritize different streams, where different streams correspond to different network content.

[0092] In order to solve the problem of increasing network demand, a protocol was proposed based on QUIC to expand the physical link used for transmission to multiple physical links, namely multi-path QuickUDP Internet Connection (MPQUIC). The parallel transmission of multiple QUIC connections can improve resource utilization.

[0093] Currently, the connection between the client and the server (TCP connection or QUIC connection) may have anomalies, such as connection timeout. In this case, the client will periodically detect whether the connection is restored to the server. Specifically, the client periodically sends detection information to the server at a locally configured period. However, when the client periodically sends detection information, it does not take into account the current business volume of the server. Therefore, it is very likely that the client continuously sends detection information at a local period, which will increase the processing pressure on the server and cause the server to crash. For example, the server is currently blocked by a large number of pending messages due to an abnormal background service process. At this time, if the client frequently sends detection signals, it may further increase the processing burden on the server and cause the server to crash.

[0094] In view of this, the present application embodiment provides a connection detection method, which can be applied to Figure 1 The communication system shown. When the client determines that the connection between the client and the server is abnormal, the client sends a detection signal to the server in a first cycle. The first cycle is adapted to the current business volume of the server, and / or the first cycle is related to the current connection state of the connection. For example, when the current business volume of the server is large, the first cycle is longer to avoid frequently sending detection information to the server in a short cycle to increase the processing pressure of the server; or, when the current business volume of the server is small, the first cycle is shorter to restore the connection as soon as possible.

[0095] The following introduces the equipment related to the embodiments of the present application.

[0096] Figure 2 1 shows a schematic diagram of the structure of the electronic device 100. The electronic device 100 may be a client or a server. For example, the client is a mobile phone. Figure 2As shown, the mobile phone may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0097] The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). Among them, different processing units may be independent devices or integrated into one or more processors. Among them, the controller may be the nerve center and command center of the mobile phone. The controller may generate an operation control signal according to the instruction opcode and the timing signal to complete the control of fetching and executing instructions. A memory may also be set in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a high-speed cache memory. The memory may store instructions or data that the processor 110 has just used or circulated. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. Repeated access is avoided, the waiting time of the processor 110 is reduced, and the efficiency of the system is improved.

[0098] The USB interface 130 is an interface that complies with the USB standard specification, and specifically can be a Mini USB interface, a Micro USB interface, a USB Type C interface, etc. The USB interface 130 can be used to connect a charger to charge the mobile phone, and can also be used to transmit data between the mobile phone and peripheral devices. The charging management module 140 is used to receive charging input from the charger. The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193, and the wireless communication module 160.

[0099] The wireless communication function of the mobile phone can be realized by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor and baseband processor. Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the mobile phone can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antenna. For example, antenna 1 can be reused as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0100] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied on mobile phones. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.

[0101] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to mobile phones. The wireless communication module 160 can be one or more devices integrating at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, modulates the frequency of the electromagnetic wave signal and performs filtering, and sends the processed signal to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, modulate the frequency of it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.

[0102] In some embodiments, antenna 1 is coupled to mobile communication module 150, and antenna 2 is coupled to wireless communication module 160, so that the mobile phone can communicate with the network and other devices through wireless communication technology. The wireless communication technology may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long-term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS may include global positioning system (GPS), global navigation satellite system (GLONASS), Beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS) and / or satellite based augmentation system (SBAS).

[0103] The display screen 194 is used to display the display interface of the application, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light emitting diode (QLED), etc. In some embodiments, the mobile phone may include 1 or N display screens 194, where N is a positive integer greater than 1.

[0104] The mobile phone can realize the shooting function through ISP, camera 193, video codec, GPU, display 194 and application processor.

[0105] ISP is used to process the data fed back by camera 193. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to ISP for processing and converts it into an image visible to the naked eye. ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, ISP can be set in camera 193.

[0106] The camera 193 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the mobile phone may include 1 or N cameras 193, where N is a positive integer greater than 1.

[0107] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the mobile phone by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, and software code of at least one application (such as iQiyi application, WeChat application, etc.). The data storage area can store data (such as images, videos, etc.) generated during the use of the mobile phone. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0108] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as pictures and videos are stored in the external memory card.

[0109] The mobile phone can realize audio functions such as music playing and recording through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the earphone interface 170D, and the application processor.

[0110] The button 190 includes a power button, a volume button, etc. The button 190 can be a mechanical button. It can also be a touch button. The mobile phone can receive the button input and generate a key signal input related to the user settings and function control of the mobile phone. The motor 191 can generate a vibration prompt. The motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. The indicator 192 can be an indicator light, which can be used to indicate the charging status, power changes, and can also be used to indicate messages, missed calls, notifications, etc. The SIM card interface 195 is used to connect the SIM card. The SIM card can be inserted into the SIM card interface 195, or pulled out from the SIM card interface 195 to achieve contact and separation with the mobile phone.

[0111] Understandably, Figure 2 The components shown do not constitute a specific limitation on the mobile phone. The mobile phone in the embodiment of the present invention may include Figure 2 More or fewer components. For example, the mobile phone may also include a sensor module (not shown in the figure), and the sensor module includes a pressure sensor, a gyroscope sensor, a temperature sensor, etc. In addition, Figure 2The combination / connection relationship between the components can also be adjusted and modified.

[0112] The following takes a mobile phone as an example and describes the technical solution provided in the embodiment of the present application in conjunction with the accompanying drawings.

[0113] See also Figure 3 , is a flow chart of the connection detection method provided in the embodiment of the present application. The method is applicable to Figure 1 The communication system shown in FIG. Figure 3 As shown, the process of the method includes:

[0114] S1, the client establishes a connection with the server. The connection can be a TCP connection or a QUIC connection.

[0115] Exemplarily, S1 can be implemented through a three-way handshake process. A possible implementation method includes: the first handshake: the client sends a first handshake request to the server, and the first handshake request carries a flag bit SYN=1 and an initial sequence number seq=x. Among them, the flag bit SYN is set to 1 to indicate that the client enters the SYN-sent state. The sequence number seq=x is randomly generated by the client and is used in the subsequent handshake process. The second handshake: After the service endpoint receives the first handshake request, it knows from the flag bit SYN=1 in the first handshake request that the client requests to establish a connection. If the server agrees to establish a connection, it sends an acknowledgment (ACK) message to the client, and in the ACK message, the flag bit SYN=1, the acknowledgment number ack=x+1, and a randomly generated sequence number seq=y. Among them, the flag bit SYN=1 is used to indicate that the server enters the SYN-received state, and the acknowledgment number is generated by the server according to seq=x in the first handshake request. The server randomly generates a value seq=y, which is used in the subsequent handshake process. In the third handshake, after the client receives the ACK information sent by the server, it sends a confirmation message to the server, which includes the confirmation number ack=y+1 and the sequence number seq=x+1, and the client enters the established state. When the service endpoint receives the confirmation message, it also enters the established state. After the three-way handshake is completed, a connection is established between the client and the server. It should be noted that the three-way handshake is used as an example for the above introduction, and it can also be a four-time, more or less handshake process, which is not limited to the embodiments of the present application.

[0116] S2: Determine a detection period according to the current service volume of the server and / or the current connection state of the connection.

[0117] Specifically, there are two ways: the first way is to determine the detection period according to the current service volume of the server. The second way is to determine the detection period according to the current connection state of the connection. The following introduces these two implementation methods respectively.

[0118] The first method is to determine the detection period according to the current service volume of the server, wherein the current service volume of the server includes at least one of the current device access volume of the server, the current number of messages to be processed, and the local operation load of the server.

[0119] Method 1: Determine the detection period based on the current number of devices connected to the server.

[0120] Among them, the devices connected to the server include at least one of a mobile terminal, a gateway device, a load balancing device (LoadBalance, LB), a network address translation (Network Address Translation, NAT) device, etc. When the number of devices connected to the server is high, the detection cycle is longer; when the number of devices connected to the server is small, the detection cycle is shorter. Exemplarily, the mapping relationship between the device access volume of the service client and the detection cycle can be stored in the server. When the device access volume of the server is counted, the detection cycle is determined based on the mapping relationship.

[0121] Method 2: Determine the detection period based on the number of messages currently to be processed by the server.

[0122] The messages to be processed include at least one of a handshake message, a detection message, a network resource request message, etc. The handshake message may be the first or second handshake request (see the above description), and the network resource request refers to a request for requesting network resources, such as text, pictures, videos, etc. When the number of messages to be processed is large, a longer detection cycle is determined to alleviate the congestion. When the number of messages to be processed is small, a shorter detection cycle is determined to restore the connection with the client in a timely manner.

[0123] Method three: determine the detection period based on the local running load of the server.

[0124] Among them, the local operation load of the server side may include at least one of the local memory occupancy rate of the server side, the processor operation speed, the amount of running processes, the process operation speed, the amount of running threads, the thread operation speed, etc.; wherein, the processor may be a central processing unit (CPU) or other processors. When the local operation load is high, the determined detection cycle is longer, and when the local operation load is low, the determined detection cycle is shorter. Among them, the high local operation load of the server side includes: the local memory occupancy rate of the server side is greater than threshold 1, the processor operation speed is less than threshold 2, the amount of running processes is greater than threshold 3, the process operation speed is less than threshold 4, the amount of running threads is greater than threshold 5, the thread operation speed is less than threshold 6, etc.; wherein, the specific values ​​of thresholds 1 to 6 are not limited in the embodiments of the present application.

[0125] Furthermore, the first method can be further refined as follows: according to the current traffic volume of the network entrance of the server, the detection period corresponding to the network entrance is determined, and the detection period corresponding to the network entrance is applicable to the client accessing the network entrance. The current traffic volume of the network entrance includes at least one of the current device access volume of the network entrance, the current number of messages to be processed by the network entrance, and the local operation load consumed by the network entrance. For example, see Figure 4 , the server includes a network entrance A and a network entrance B, and the client 1 and the client 2 access the server through the network entrance A, and the client 3 accesses the server through the network entrance B. Therefore, the server can count the current traffic volume of each network entrance, determine the detection cycle 1 according to the current traffic volume of the network entrance A, and determine the detection cycle 2 according to the current traffic volume of the network entrance B, then the clients (i.e., the client 1 and the client 2) accessing the network entrance A send detection signals to the server with the detection cycle 1, and the clients (i.e., the client 3) accessing the network entrance B send detection signals to the server with the detection cycle 2. For example, when the network entrance A is abnormal (such as congestion, service upgrade, etc.), resulting in the abnormal connection corresponding to the network entrance A, the client 1 and the client 2 can send detection signals to the network entrance A with the detection cycle 1, and the detection cycle 1 is adapted to the current traffic volume of the network entrance A, so as to avoid the clients (client 1 and / or client 2) of the network entrance A frequently sending detection signals to the network entrance A, further aggravating the congestion of the network entrance A.

[0126] The second method is to determine the detection period according to the current connection state of the connection. The connection state includes: the number of times, frequency, duration of abnormalities in the connection, and at least one of response delay, transmission rate, and packet loss rate. Exemplarily, the detection period is related to the current connection state of the connection. For example, the detection period is proportional or inversely proportional to the current connection state of the connection.

[0127] As an example, the smaller the number, frequency or duration of abnormalities in the connection, the shorter the detection cycle; that is, when the abnormality just occurs or rarely occurs, a shorter detection cycle is used to ensure that the connection is restored as soon as possible and the user experience is not affected as much as possible. Alternatively, the greater the number, frequency or duration of abnormalities in the connection, the shorter the detection cycle; that is, for connections that often have abnormalities or have been abnormal for a long time, a shorter detection cycle is used to restore the connection as soon as possible.

[0128] As another example, the higher the response delay or packet loss rate of the connection, the shorter the detection cycle; generally, the higher the response delay or packet loss rate, the more obvious the network jam, and a shorter detection cycle can restore the connection as soon as possible. Alternatively, the lower the response delay or packet loss rate of the connection, the shorter the detection cycle; the lower the response delay or packet loss rate, the less obvious the network jam, and a shorter detection cycle can ensure that the user experience is not affected.

[0129] In some embodiments, the connection between the client and the server includes multiple connections, such as a first connection and a second connection. In this case, S2 can be refined to determine the first detection period according to the current traffic volume of the server on the first connection, and / or the current connection state of the first connection, and determine the second detection period according to the current traffic volume of the server on the second connection, and / or the current connection state of the second connection. The first detection period and the second detection period can be the same or different. That is to say, in the case where there are multiple connections between the client and the server, the detection period corresponding to each connection can be determined, and the granularity is finer.

[0130] Optionally, the detection period determined in S2 may be a value or a period range, which is not limited in the embodiment of the present application.

[0131] The first method and the second method can be used alone or in combination, and the embodiments of the present application are not limited thereto. For example, when the first method and the second method are combined, the first method is used to determine a period range, and then the second method is used to determine a specific period within the range; or, the second method is used to determine a period range, and then the first method is used to determine a specific period within the range.

[0132] Optionally, after S2, the step may also be included: determining whether to start the detection backoff function. The detection backoff function means that when the client sends a detection signal in a certain period, if no detection feedback is received, it will back off to a larger period to send the detection signal, so as to avoid a large number of clients sending detection signals in the same period, causing the server to be overstressed and crash. One way is that the client has configured the backoff mode or non-backoff mode locally, for example, the client is configured with the backoff mode or non-backoff mode by default after leaving the factory. Another implementation method is that the user can set the backoff mode or non-backoff mode. For example, the user sets it on the client. Another implementation method is that the server indicates to the client whether to back off. For example, the server sends a first indication message to the client to indicate whether to start the backoff mode. Exemplarily, when the first indication message is 1, it is used to indicate that the backoff mode needs to be started, and when the first indication message is 0, it is used to indicate that the backoff mode does not need to be started. It can be understood that the server can actively send the first indication message to the client, or the server sends the first indication message to the client after receiving the query message sent by the client, and the query message is used to query whether to start the backoff mode.

[0133] Optionally, after determining that a backoff is required, the step may also include: determining a backoff parameter. The backoff parameter includes a backoff rule, such as a Fibonacci sequence backoff rule, or other backoff rules; or, the backoff parameter includes a series of backoff values, such as five parameters a, b, c, d, and e. It is understandable that the backoff parameter may be locally configured by the client, or indicated by the server to the client, or set by the user, such as the user setting the backoff parameter on the client, and the specific method is not limited in the embodiments of this application. Two backoff examples are introduced below.

[0134] Example 1, the backoff parameter includes the Fibonacci sequence backoff rule. The Fibonacci sequence backoff rule means that each value is the sum of the previous two values. For example, the Fibonacci sequence is: 1, 2, 3, 5, 8, 13... Each value is the sum of the previous two values. Therefore, the backoff process includes: starting with the minimum detection period, and increasing the detection period according to the Fibonacci sequence rule. For example, if the minimum detection period is 5s, then according to the Fibonacci sequence rule, the detection period includes: 5s, 6s, 11s, 17s, 28s. Then the client first sends a detection signal with a detection period of 5s. If no feedback is received, the detection signal is sent with a detection period of 6s. If no feedback is still received, the detection period is sent with a detection period of 11s, and so on. The minimum detection period can be the detection period determined in S2, or the minimum value in the period range determined in S2.

[0135] Example 2, the backoff parameters include a series of backoff values, such as five parameters a, b, c, d, and e (the unit can be seconds or milliseconds, etc.). Then, the client starts with the minimum detection period, and gradually increases the detection period according to the five parameters a, b, c, d, and e. For example, if the minimum detection period is 5s, then the detection periods include: 5s, 5+as, 5+bs, 5+cs, 5+ds, and 5+es. Therefore, the client first sends a detection signal with a detection period of 5s. If no feedback is received, a detection signal is sent with a detection period of 5+as, and so on. Among them, the minimum detection period can be the detection period determined in S2, or the minimum value in the period range determined in S2.

[0136] In some embodiments, when the client continuously increases the detection period based on the minimum detection period and the backoff parameter, the backoff is stopped when the increased detection period exceeds the maximum detection period. For example, according to the minimum detection period and the Fibonacci sequence rule, the detection period sequence is determined to include: 5s, 6s, 11s, 17s, 28s. If the maximum detection period is 30s, then after reaching 28s, the subsequent use of the 30s detection period will not continue to increase the detection period, because the next period of 28s is 45s, which exceeds 30s. After reaching the maximum detection period, the client can always use the maximum detection period for detection. For example, after reaching 28s, if the detection response from the server is still not received, the 30s period will continue to be used for detection. The minimum detection period and the maximum detection period mentioned in the backoff process above. In one embodiment, the minimum detection period can be the detection period determined in S2, or the minimum value in the period range determined in S2. If S2 determines a cycle range, the maximum detection cycle may be a maximum value in the cycle range determined in S2, or a cycle specified by the user or by the system by default or indicated by the server and greater than the minimum detection cycle.

[0137] Optionally, after S2, the step may also include: determining the effective connection of the detection period; or determining the connection to which the detection period applies. The client and the server may include one or more connections. If there are multiple connections, the detection period determined in S2 above is applied to at least one of the multiple connections. One way is that the effective connection of the detection period is all connections. Another way is that the effective connection of the detection period is the current connection. The current connection refers to the connection between the client and the server that is currently in an active state, or a connection that is in an inactive state, or a connection that the client currently uses to send data to the server. Another way is that the effective connection of the detection period is a specified connection, and the specified connection may be one or more of the multiple connections. Among them, the specified connection may be a local default connection specified by the client, or a user-specified connection, or a connection specified by the server to the client.

[0138] It is understandable that after determining the effective connection of the detection period, the connection for starting the backoff mode can be further determined. For example, there are M effective connections, at least one of which can start the backoff mode, and then back off with the detection period as the minimum detection period. Among them, the connection for starting the backoff mode can be all effective connections, or a specified effective connection, which is not limited in the embodiment of the present application.

[0139] Optionally, after S2, the step may also be included: determine whether an external detection protocol is configured for detecting the connection, wherein the external detection protocol refers to a protocol different from the current protocol. For example, if the current connection between the client and the server is a QUIC connection, then the external detection protocol is another protocol different from the QUIC protocol, such as the Internet Control Message Protocol (ICMP), the sixth version of the Internet Control Message Protocol (ICMPv6), the Bidirectional Forwarding Detection (BFD) protocol, and the like. One possible implementation method is that the client locally configures the external detection protocol, for example, the client is configured with the external detection protocol by default after leaving the factory. Another possible implementation method is that the user can configure the external detection protocol, for example, the user can configure the external detection protocol on the client side. Another implementation method is that the server configures the external detection protocol and notifies the client, for example, the server sends a second indication information indicating whether the external detection protocol is configured. Exemplarily, when the second indication information is 1, it is used to indicate that the external detection protocol is configured, and when the second indication information is 0, it is used to indicate that the external detection protocol is not configured. It is understandable that when the second indication information sent by the server is 1, the server can also indicate the specific protocol type of the external detection protocol to the client, such as ICMP / ICMPv6 protocol or BFD protocol. If the external detection protocol is configured, the client can use the external detection protocol to detect the connection. Specifically, the client creates an external detection protocol session with the server, and sends a detection signal with the detection period supported by the external detection protocol session. Taking the external detection protocol as the BFD protocol as an example, the client creates a BFD protocol session with the server, and sends a detection signal with the detection period supported by the BFD protocol. Among them, the detection period supported by the external detection protocol can be the default configuration of the client, or specified by the user, or indicated by the server, or specified in the protocol, and the embodiments of the present application are not limited. In this way, the client can use other protocols different from the current protocol for connection detection, which is more flexible.

[0140] S3: The client determines that the connection with the server is abnormal.

[0141] In the embodiment of the present application, the connection abnormality between the client and the server includes multiple scenarios.

[0142] Scenario 1: determining that the connection between the client and the server is abnormal, including: when the connection between the client and the server satisfies at least one of: the server response delay is greater than a first threshold, the data transmission rate is less than a second threshold, and the packet loss rate is greater than a third threshold, determining that the connection is abnormal.

[0143] The server response delay refers to the time between the first moment when the client sends a network resource request and the second moment when the server receives the network resource feedback. The network resource request is used to request network resources, and the network resource can be at least one of text, pictures, and videos. In the embodiment of the present application, after the client sends a network resource request, a timer can be started. When the timer reaches a first threshold, it is determined that the connection between the client and the server is abnormal. For example, see Figure 5 In (a), the user uses a mobile phone (client) to search for content online, but no search results are found (for example, the progress bar 501 used to indicate the search progress changes slowly), which affects the user experience.

[0144] The data transmission rate affects the response delay of the server. For example, if the data transmission rate is too low, it takes a long time for the data to be sent to the other end. Therefore, in the embodiment of the present application, when the data transmission rate between the client and the server is less than the second threshold, it is determined that the connection between the client and the server is abnormal. For example, see Figure 5 In (b), the user uses a video player application on a mobile phone (client) to watch a movie. For example, the user clicks on episode 7, and area 502 displays information such as "preparing" and a transmission rate (such as 100 kb / s), and the video playback is relatively slow.

[0145] The packet loss rate refers to the correct rate of data sent on the connection between the client and the server. If the packet loss rate is high, it will affect the accuracy of the network resources requested by the user. Therefore, in the embodiment of the present application, if the packet loss rate of the connection between the client and the server is greater than the third threshold, the connection is determined to be abnormal.

[0146] The specific values ​​of the first threshold, the second threshold and the third threshold may be set by the client, the server, specified in the protocol, or set by the user, etc., and the embodiments of the present application do not limit this.

[0147] Scenario 2: Determining that the connection between the client and the server is abnormal, including: the client's network access method is changed. The client's network access method is changed, including at least one of the following:

[0148] (1) Switch from wireless LAN to mobile communication network.

[0149] The wireless local area network can be WIFI, such as WIFI at home or at work. For example, after the user takes the client out of the house, the network access mode of the client is switched from the WIFI network to the mobile communication network (4G network, 3G network or 5G network), and it is determined that the connection between the client and the server is abnormal.

[0150] (2) Switching from the first communication standard to the second communication standard of the mobile communication network.

[0151] The communication standard (or network standard) of the mobile communication network includes but is not limited to: long term evolution (LTE) network, global system of mobile communication (GSM) network, code division multiple access (CDMA) network, wideband code division multiple access (WCDMA) network, universal mobile telecommunications system (UMTS), etc. Taking LTE as an example, the communication standard may further include: second generation mobile communication technology (2G) network, third generation mobile communication technology (3G) network, fourth generation mobile communication technology (4G) network and fifth generation mobile communication technology (5G) network, or the future Nth generation mobile communication technology, N is greater than 5.

[0152] Exemplarily, when the client switches from 4G to 3G, or from 5G to 4G, it is determined that the connection between the client and the server is abnormal.

[0153] (3) Switch from the first LAN to the second LAN.

[0154] Exemplarily, the user enters room 2 from room 1, and then switches from the WIFI of room 1 to the WIFI of room 2, and determines that the connection between the client and the server is abnormal.

[0155] It should be noted that the phenomenon that the connection between the client and the server is abnormal when the client's network access method changes is called connection migration. Simply put, the connection between the client and the server has a client address and a server address. The client address is the address on the client that uses the connection to transmit data, and the server address is the address on the server that uses the connection to transmit data. When the client's network access method changes, the client address of the connection will change, so it is necessary to change the original client address of the connection to a new client address, that is, the connection is migrated from the original client address to the new client address. Taking the network access method from WIFI to 4G as an example, the client address changes. For the connection between the client and the server, the original client address of the connection can no longer be used and needs to be migrated to the new client address. Among them, the client address includes but is not limited to an IP address and a port tuple, and the tuple can be a binary tuple, a quadruple or more tuples, etc.

[0156] It should be noted that the execution order between the above S2 and S3 is not limited in this application. If S2 is executed first and then S3, that is, before an abnormality occurs in the connection between the client and the server, the detection cycle is determined in real time. For example, S2 is executed periodically at a certain period. When the connection abnormality is determined at a certain moment, the detection cycle most recently determined before that moment is used for detection. If S3 is executed first and then S2, that is, after an abnormality occurs in the connection between the client and the server, the detection cycle is determined. One possible implementation method is that the client perceives the service volume of the server in real time. When the connection is abnormal, the client determines the detection cycle based on the service volume perceived before the abnormality occurs or determines the detection cycle based on the current connection status.

[0157] S4: The client sends a detection signal to the server in the first cycle.

[0158] Specifically, S4 includes at least steps S41 and S42. In S41, the client sends a detection signal 1 to the server at the first moment, and if no detection feedback is received before the second moment, a detection signal 2 is sent to the server at the second moment, and the duration between the first moment and the second moment is the first cycle. The first cycle can be the detection cycle determined in S2, or any cycle within the cycle range determined in S2 (such as the minimum value within the cycle range). It should be understood that if the detection feedback from the server is still not received before the third moment, a detection signal 3 is sent to the server at the third moment, and the duration between the third moment and the second moment is the second cycle. The second cycle may be the same as or different from the first cycle. For example, if the backoff rule is activated, the second cycle may be a cycle calculated based on the first cycle and the backoff parameter. The second cycle may be the same as or different from the first cycle.

[0159] Optionally, the detection signal is used to detect whether the connection is restored, or whether the server address of the connection is reachable. It should be understood that the detection signal may carry a connection identifier of the connection, which may be a connection ID, a substream identifier, or the like. For example, if the connection between the client and the server is a TCP connection, the connection identifier may be a substream identifier, which may be an address identifier of the substream, and the address identifier includes an IP and port tuple, a dual-end IP and dual-port tuple, or more tuples. If the connection between the client and the server is a QUIC connection, the connection identifier may be a connection ID.

[0160] Exemplarily, the detection signal may be at least one of a PATH_CHALLENGE frame, a NEW_CONNECTION_ID frame, a PADDING frame, and a Sync frame.

[0161] S5, the server sends a detection feedback to the client segment.

[0162] Optionally, the detection feedback is used to indicate that the connection is restored; or, the server address of the connection is reachable.

[0163] Exemplarily, the detection feedback may be a PATH_RESPONSE frame or an ACK frame.

[0164] Therefore, in the above embodiment, when the connection between the client and the server is abnormal, the client sends a detection signal to the server in a first period, and the first period is adapted to the current business volume of the server to avoid frequent sending of detection signals causing the server to crash due to excessive business volume.

[0165] It should be noted that Figure 3S2 can be executed by the server or by the client. If it is executed by the client, it may include the client sensing the current traffic volume of the server (which can be sensed in real time), and then determining the detection period according to the current traffic volume of the server and / or the current connection status of the connection. There are many ways for the client to sense the current traffic volume of the server. For example, the client sends a query request to the server in real time to request the current traffic volume of the server, or the client determines the current traffic volume of the server according to at least one of the response delay, transmission rate, and packet loss rate of the server. Exemplarily, the longer the response delay of the server, the lower the transmission rate, or the higher the packet loss rate, the greater the traffic volume of the server. If it is executed by the server, the server determines the detection period according to the current traffic volume of the server and / or the current connection status of the connection, and then sends it to the client. The specific content will be described below. Figure 6 Introduced in.

[0166] See also Figure 6 , is another flow chart of the connection detection method provided in the embodiment of the present application. The flow includes S1 to S5. Among them, the implementation principle of S1, S3-S5 is the same as Figure 3 The implementation principles of S1, S3-S5 are the same, so they will not be repeated here. The following focuses on S2. S2 includes S21 to S23.

[0167] S21, the server determines a detection period according to the current business volume and / or the current connection state of the connection.

[0168] The way the server determines the detection cycle is the same as above. Figure 3 The principles of determining the detection period in S2 are the same. Specifically, they include the first method and the second method. The first method is to determine the detection period based on the current business volume of the server, and the second method is to determine the detection period based on the current connection status between the server and the client. In order to save space, they will not be repeated here.

[0169] S22, the server generates configuration information according to the detection cycle.

[0170] The configuration information includes at least one of the following information 1 to information 7:

[0171] Information 1: Minimum detection period: The minimum detection period may be the detection period determined in step S21.

[0172] Information 2: First indication information for indicating whether to start the backoff mode. Exemplarily, when the first indication information is 1, it indicates that the backoff mode needs to be started, and when the first indication information is 0, it indicates that the backoff mode does not need to be started.

[0173] Information 3: Backoff parameters. The backoff parameters include backoff rules, such as the Fibonacci sequence backoff rules or other backoff rules; or, the backoff parameters include a series of backoff values, such as five parameters a, b, c, d, and e. It is understandable that when the first indication information is 0, the backoff parameters may not be included in the configuration information, and when the first indication information is 1, the backoff parameters are included in the configuration information.

[0174] Information 4: Maximum detection period. The maximum detection period is used to indicate the maximum period that the client can reach. For example, when the client continuously increases the detection period based on the minimum detection period and the backoff parameter, the backoff stops when the increased detection period reaches the maximum detection period.

[0175] Signal five, application connection. The application connection refers to the effective connection of the configuration information. If there are multiple connections between the client and the server, information five can be used to indicate that at least one of the multiple connections can apply the configuration information. Mode A, the effective connection of the configuration information is all connections. Mode B, the effective connection of the configuration information is the current connection, and the current connection refers to the connection between the client and the server that is currently in an active state, or a connection that is in an inactive state, or a connection that the client currently uses to send data to the server, or a connection that is used to carry the configuration information when the server sends the configuration information to the client. Mode C, the effective connection of the configuration information is a designated connection. The designated connection can be at least one of the multiple connections between the client and the server.

[0176] Exemplarily, when information five is indication information 1 (such as 00), it is determined that the effective connection of the configuration information is all connections, when information five is indication information 2 (such as 01), it is determined that the effective connection of the configuration information is the current connection, and when information five is indication information 3 (such as 11), it is determined that the effective connection of the configuration information is the specified connection. When the effective connection of the configuration information is the current connection or the specified connection, information five may also carry a connection identifier of the specified connection. The connection identifier may be any identifier that can uniquely identify a connection, such as a connection ID, or may be a port address of a connection, wherein the port address includes a port quad or quintuple, etc.

[0177] Information six, second indication information for indicating whether an external detection protocol is configured. Exemplarily, when the second indication information is 1, it is used to indicate that an external detection protocol is configured, and when the second indication information is 0, it is used to indicate that an external detection protocol is not configured. In some embodiments, information six may also indicate the specific protocol type of the configured external detection protocol, such as ICMP / ICMPv6 protocol or BFD protocol.

[0178] Information 7, external detection protocol parameters. Information 7 refers to parameters related to information 6. For example, if information 6 indicates that the configured external detection protocol is the ICMP protocol, then information 7 may include the detection period corresponding to the ICMP protocol. If information 6 indicates that the configured external detection protocol is the BFD protocol, then information 7 may include the detection period corresponding to the BFD protocol.

[0179] S23, the server sends configuration information to the client.

[0180] Exemplarily, the server may actively send configuration information to the client, or passively send configuration information to the client. For example, when the server receives a configuration information query request sent by the client, it feeds back the configuration information to the client.

[0181] Optionally, S23 can be executed during the handshake phase, or when data is transmitted after the handshake. Taking the execution of S23 during the handshake phase as an example, for example, after the server receives the first handshake request, it sends configuration information to the client, and the configuration information can be carried in the ACK information in response to the first handshake request. Among them, please refer to the previous introduction for the process of the handshake phase. Taking the execution of S23 after the handshake is completed as an example, when the client detects that the connection between the client and the server is abnormal (such as the first abnormality), it sends a detection signal to the server with a local configuration cycle (regardless of the client's business volume). After the server sends a detection feedback to the client in response to the detection signal, it can also send configuration information to the client. Afterwards, when the connection between the client and the server is abnormal again, the second solution can be used to detect with the detection cycle indicated by the configuration information.

[0182] Optionally, if the scheme of using the client's local configuration period (regardless of the client's business volume) for detection is called the first detection scheme, the scheme of using the client to detect using the detection period determined according to the client's business volume is called the second detection method. Either of the two detection schemes can be selected for use, or a switching button is set on the client to switch between the first detection scheme and the second detection scheme.

[0183] The connection detection method provided in the embodiment of the present application (such as Figure 3 or Figure 6 The flowchart of FIG. 10 is applicable to a multi-connection scenario. The multi-connection refers to a plurality of connections between the client and the server, such as an MPTCP connection and an MPQUIC connection. The following is an introduction using the MPTCP connection scenario and the MPQUIC connection scenario as examples.

[0184] 1. MPTCP connection scenario

[0185] See also Figure 7, is a schematic diagram of an MPTCP connection scenario provided in an embodiment of the present application. Figure 7 , there are two TCP connections between the client and the server, namely the first TCP connection and the second TCP connection. Among them, the first TCP connection can be the client using Wi-Fi network resources to transmit data with the server, and the second TCP connection can be the client using LTE network resources to transmit data with the server. In some embodiments, the first TCP connection and the second TCP connection are different TCP subflows under the same TCP connection, or the first TCP connection and the second TCP connection are different TCP connections. The following is introduced by taking the first TCP connection and the second TCP connection as different TCP subflows under the same TCP connection as an example. Specifically, the MPTCP layer of the server decomposes the TCP stream into two TCP subflows and transmits them independently to the server through two TCP connections. After receiving the two TCP subflows, the server merges the two TCP subflows and sends them to the application layer. This method of parallel transmission of multiple TCP subflows improves data transmission efficiency.

[0186] See also Figure 8 , is a flow chart of a connection detection method in an MPTCP connection scenario provided in an embodiment of the present application. This method can be applied to Figure 7 The MPTCP connection scenario shown in Figure 1 is as follows. Figure 8 As shown, the method flow includes:

[0187] S801, the client establishes a first TCP connection with the server.

[0188] S802: The client establishes a second TCP connection with the server.

[0189] Taking the example that the first TCP connection and the second TCP connection are different TCP substreams under the same TCP connection, the connection identifier corresponding to the first TCP connection may be TCP substream identifier 1, and the connection identifier corresponding to the TCP connection may be TCP substream identifier 2. The TCP substream identifier may include a substream address (Address) or a substream address ID (Address ID), wherein the substream address may be a port address, and the port address may be a port binary tuple, a quadruple, or more tuples.

[0190] S803: The server determines a detection period according to the current business volume and / or the current connection status.

[0191] Among them, the principle of determining the detection cycle by the server is the same as Figure 3 The implementation principle of S2 is the same and will not be repeated.

[0192] S804: The server generates configuration information according to the detection period.

[0193] The process of generating configuration information on the server is similar to Figure 6 The principle of S2 is the same as that of S3, and will not be repeated here. The configuration information includes at least one of the following: minimum detection period, first indication information for indicating whether to start the backoff mode, backoff parameters, maximum detection period, application connection, second indication information for indicating whether to configure an external detection protocol, and external detection protocol parameters. For an introduction to configuration information, please refer to Figure 6 The description of S2 in will not be repeated.

[0194] S805: The server sends the configuration information to the client through the first TCP connection.

[0195] After the server generates the configuration information, it can select a TCP connection to send the configuration information to the client. The selected TCP connection can be any one of multiple TCP connections, or a TCP connection that is currently transmitting data, or a TCP connection that is currently in an activated state, and so on.

[0196] For example, the configuration information may refer to the following Table 1:

[0197]

[0198] Among them, the kind field is used to indicate MPTCP. Length is used to indicate the length of the configuration information, that is, the number of bytes occupied. The Subtype field is used to indicate that the information is configuration information, for example, indicating that the information is a PATH_DETECT_CTRL frame. The E field is 0, which is used to indicate that feedback is required to the sender, and E=1, which means that the sender has received it. The F field is used to indicate the application to the connection, for example, 0 is used to indicate all substreams; 1 is used to indicate the current substream; 2 is used to indicate the specified substream. r: Reserved bit, the default is 0. When the F field is 2, the substream identification field includes a substream identification, which can be a port address or a substream address ID of the substream. The port address of the substream can be a port and IP tuple, a dual-end IP and dual-end port quadruple, and so on. The ProbePeriod field is used to indicate the minimum detection period. It can be understood that the configuration information shown in Table 1 above can also include more or less information, such as whether to start backoff, backoff rules, whether to configure an external detection protocol, external detection protocol parameters, and so on.

[0199] S806: The client determines that the second TCP connection is abnormal.

[0200] S807: The client sends a detection signal to the server on the second TCP connection according to the first period indicated by the configuration information.

[0201] Exemplarily, S807 may at least include S807A and S807B. S807A, the client sends a detection signal 1 to the server at a first moment, and if no detection feedback is received before a second moment, a detection signal 2 is sent to the server at the second moment, and the duration between the first moment and the second moment is the first period. Among them, the first period may be the detection period indicated in the configuration information, or any period within the period range indicated by the configuration information. It should be understood that if the detection feedback from the server is still not received before a third moment, a detection signal 3 is sent to the server at the third moment, and the duration between the third moment and the second moment is the second period, and the second period may be the same as or different from the first period. For example, if the configuration information indicates that the backoff mode is started, then the first period may also be the minimum detection period, and the second period may be a period calculated based on the backoff rule and the first period.

[0202] Exemplarily, the detection signal may be a Sync frame or other frames, which is not limited in the embodiments of the present application.

[0203] S808: The client receives a detection response on the second TCP connection, restores the second TCP connection state, and can resend service data on the second TCP connection.

[0204] Exemplarily, the detection feedback may be a PATH_DETECT_CTRL frame.

[0205] That is, the client receives the configuration information sent by the server from the first TCP connection, and when the second TCP connection is abnormal, the detection period indicated by the configuration information can be used for detection.

[0206] 2. MPQUIC connection scenario

[0207] Please refer to 9, which is a schematic diagram of the MPQUIC connection scenario provided in the embodiment of the present application. Fig. 9 As shown, there are multiple connections between the client and the server, each of which corresponds to a connection identifier, which is a connection ID (CID). For example, Connection 1 corresponds to CID 1, Connection 2 corresponds to CID 2, and so on. In the MPQUIC scenario, CID can uniquely identify a connection.

[0208] See also Fig.10 , is a flow chart of a connection detection method in an MPQUIC connection scenario provided by an embodiment of the present application. The method can be applied to Fig. 9 The MPQUIC connection scenario shown in Figure 1 is as follows. Fig.10 As shown, the process includes:

[0209] S1001, the client and the server establish the first QUIC connection.

[0210] S1002, the client and the server establish a second QUIC connection.

[0211] S1003: The server determines a detection period according to the current business volume and / or the current connection status.

[0212] Among them, the principle of determining the detection cycle by the server is the same as Figure 3 The implementation principle of S2 is the same and will not be repeated.

[0213] S1004: The server generates configuration information according to the detection cycle.

[0214] Among them, the process of generating configuration information on the server is Figure 6 The principle of S2 is the same as that of S3, and will not be repeated here. The configuration information includes at least one of the following: minimum detection period, first indication information for indicating whether to start the backoff mode, backoff parameters, maximum detection period, application connection, second indication information for indicating whether to configure an external detection protocol, and external detection protocol parameters. For an introduction to configuration information, please refer to Figure 6 The description of S2 in will not be repeated.

[0215] Exemplarily, the configuration information may be a PATH_DETECT_CTRL frame. The definition of the PATH_DETECT_CTRL frame may refer to the following:

[0216] PATH_DETECT_CTRL Frame{

[0217] Type(i) = TBD1 (e.g., 0x3f)

[0218] minPP(i), / / used to describe the minimum detection period;

[0219] retreating Mode(i), / / used to indicate the retreat mode, for example, 0 means no retreat, 1 means retreat according to the Fibonacci sequence rule. It can be understood that when it is 0, the maxPP(i) parameter may not be included.

[0220] [maxPP(i)], / / used to describe the maximum detection period;

[0221] appliedconnectionflag(i), / / used to indicate the connection to which it is applied, for example, 0 is all connections of the current session; 1 is the current connection; 2 is the specified connection;

[0222] [applicated connection id list(…)], / / Used to indicate the connection ID of the specified connection. When applied connection flag(i) is 2, the applied connection id list contains the connection ID, which is used to indicate the specified connection.

[0223] S1005, the server sends configuration information to the client through the first QUIC connection.

[0224] S1006: The client determines that the second QUIC connection is abnormal.

[0225] S1007, the client sends a detection signal to the server on the second QUIC connection at the detection period indicated by the configuration information.

[0226] Exemplarily, the detection signal may be a PATH_CHALLENGE frame.

[0227] S1008, the client receives a probe response through the second QUIC connection.

[0228] Exemplarily, the probe response may be a PATH_RESPONSE frame.

[0229] It should be noted that the technical solution provided in the embodiment of the present application can also be applied to a single connection. A single connection can be understood as a connection between the client and the server, for example, it can be a single TCP connection or a single QUIC connection. Generally, when there is a single connection between the client and the server, if the connection is abnormal, the session is disconnected, and the application layer will perceive the connection abnormality, then the application layer can decide whether to start detection. When there are multiple connections between the client and the server, if one of the multiple connections is abnormal, the entire session will not be disconnected, so the application layer will not perceive the connection abnormality, so the protocol layer can start the detection function by itself. Therefore, when the technical solution provided in the embodiment of the present application is applicable to a single connection, the application layer can use the technical solution provided in the embodiment of the present application to start detection, and when the technical solution provided in the embodiment of the present application is applicable to multiple connections, the protocol layer can use the technical solution provided in the embodiment of the present application to start detection.

[0230] Based on the same concept, Fig.11 The electronic device 1100 provided by the present application is shown. The electronic device 1100 may be the client or server mentioned above. Fig.11As shown, the electronic device 1100 may include: one or more processors 1101; one or more memories 1102; a communication interface 1103, and one or more computer programs 1104, and the above-mentioned components may be connected via one or more communication buses 1105. The one or more computer programs 1104 are stored in the above-mentioned memory 1102 and are configured to be executed by the one or more processors 1101, and the one or more computer programs 1104 include instructions.

[0231] Exemplarily, when the electronic device 1100 is the client mentioned above, the instructions included in the one or more computer programs 1104 are used to execute the relevant steps of the client in the above corresponding embodiments. The communication interface 1103 is used to realize the communication between the client and other devices (such as the server), for example, the communication interface can be a transceiver.

[0232] Exemplarily, when the electronic device 1100 is the server mentioned above, the instructions included in the one or more computer programs 1104 are used to execute the relevant steps of the server in the above corresponding embodiments. The communication interface 1103 is used to realize the communication between the server and other devices (such as the client), for example, the communication interface can be a transceiver.

[0233] In the embodiments provided by the present application, the method provided by the embodiments of the present application is introduced from the perspective of an electronic device (such as a server or a client) as an execution subject. In order to implement the functions in the method provided by the embodiments of the present application, the electronic device may include a hardware structure and / or a software module, and the functions are implemented in the form of a hardware structure, a software module, or a hardware structure plus a software module. Whether a function in the above functions is executed in the form of a hardware structure, a software module, or a hardware structure plus a software module depends on the specific application and design constraints of the technical solution.

[0234] As used in the above embodiments, the term "when..." or "after..." may be interpreted to mean "if..." or "after..." or "in response to determining..." or "in response to detecting...", depending on the context. Similarly, the phrase "when determining..." or "if (the stated condition or event) is detected" may be interpreted to mean "if determining..." or "in response to determining..." or "when (the stated condition or event) is detected" or "in response to detecting (the stated condition or event)", depending on the context. In addition, in the above embodiments, relational terms such as first and second are used to distinguish one entity from another, without limiting any actual relationship and order between the entities.

[0235] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0236] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state hard disk Solid State Disk (SSD)), etc. In the absence of conflict, the solutions of the above embodiments can be used in combination.

[0237] Note: A portion of this patent application document contains material which is subject to copyright protection. The copyright owner reserves all rights reserved except for the production of copies of the material in the patent file or patent record in the Patent Office.

Claims

1. A connection detection method, It is characterized in that Applied to the client, including: The client receives a first period configured by the server through a first connection, where the first period is adapted to the current traffic volume of the server and / or is related to the current connection state of the first connection; When it is determined that the second connection between the client and the server is abnormal, detection information is sent to the server through the second connection in a second period, and the detection information is used to detect whether the second connection is restored. The second connection corresponds to a different protocol from the first connection, and the second period is equal to the first period, or the second period is calculated based on the first period and the backoff parameter.

2. The method according to claim 1, It is characterized in that Determining that a second connection between the client and the server is abnormal includes: When the second connection satisfies at least one of the following conditions, determining that the second connection is abnormal; The conditions include: the server response delay is greater than a first threshold, the data transmission rate is less than a second threshold, and the packet loss rate is greater than a third threshold.

3. The method according to claim 1, It is characterized in that Determining that the second connection between the client and the server is abnormal includes: a network access mode of the client is changed; The change in the network access mode of the client includes at least one of the following: Switch from wireless LAN to mobile communication network; or, Switching from a first communication standard to a second communication standard of a mobile communication network; or, Switch from the first LAN to the second LAN.

4. The method according to any one of claims 1 to 3, It is characterized in that The first period is adapted to the current traffic volume of the server, including at least one of the following: The first period is related to the current number of device accesses to the server; or, The first period is related to the number of messages currently to be processed by the server; or, The first period is related to the local running load of the server.

5. The method according to any one of claims 1 to 3, It is characterized in that The first cycle is related to a current connection state of the first connection, including: The current connection state of the first connection includes: the number, frequency, duration, and at least one of the response delay, transmission rate, and packet loss rate of the first connection that have been abnormal; The first period is directly proportional or inversely proportional to the current connection state.

6. The method according to any one of claims 1 to 3, It is characterized in that The method further comprises: The client receives configuration information sent by the server, wherein the configuration information includes at least one of the following: Minimum detection period, used to indicate the minimum period for the client to send detection information; The first indication information is used to indicate whether the client starts backoff; Backoff parameters, used to indicate backoff rules; A maximum detection period, used to indicate the maximum period for the client to send detection information; wherein the minimum period and / or the maximum period is determined by the server according to the current business volume; An effective connection, used to indicate a connection for which the configuration information is effective; second indication information, used to indicate whether the client uses other protocols to initiate detection, where the other protocols are different from the protocol corresponding to the first connection; A first protocol, used to instruct the client to send detection information based on the first protocol, where the first protocol is different from a protocol corresponding to the first connection; The first protocol related parameter is used to indicate the detection period supported by the first protocol.

7. The method according to claim 6, It is characterized in that There are multiple connections between the client and the server, and the effective connection includes at least one of a specified connection, all connections, and a current connection; wherein the current connection refers to a connection for transmitting the configuration information between the client and the server.

8. The method according to any one of claims 1 to 3, It is characterized in that The second period is adapted to the traffic of the server on the second connection and / or is related to the current connection state of the second connection.

9. A connection detection method, It is characterized in that Applied to the server, including: Determine a current state of the server, wherein the current state includes a current traffic volume of the server and / or a current connection state of a first connection between the server and a client; Determine a first period according to the current state, where the first period is used to indicate a period for the client to send detection information to the server; configuring the first period to the client through the first connection; Receive detection information sent by the client through a second connection in a second period, where the detection information is used to detect whether the second connection is restored, the second connection corresponds to a different protocol from the first connection, the second period is equal to the first period, or the second period is calculated based on the first period and a backoff parameter.

10. The method according to claim 9, It is characterized in that Determining a first period according to the current state includes at least one of the following: The first period is related to the current number of device accesses to the server; or, The first period is related to the number of messages currently to be processed by the server; or, The first period is related to the local running load of the server.

11. The method according to claim 10, It is characterized in that According to the current state, determining a first cycle includes: The current connection state of the first connection includes: the number, frequency, duration, and at least one of the response delay, transmission rate, and packet loss rate of the first connection that have been abnormal; The first period is directly proportional or inversely proportional to the current connection state.

12. The method according to any one of claims 9 to 11, It is characterized in that The method further comprises: Send configuration information to the client, the configuration information including at least one of the following: Minimum detection period, used to indicate the minimum period for the client to send detection information; The first indication information is used to indicate whether the client starts backoff; Backoff parameters, used to indicate backoff rules; A maximum detection period, used to indicate the maximum period for the client to send detection information; wherein the minimum period and / or the maximum period is determined by the server according to the current business volume; An effective connection, used to indicate a connection for which the configuration information is effective; The second indication information is used to indicate whether the client uses other protocols to initiate detection, where the other protocols are different from the protocol corresponding to the connection; A first protocol, used to instruct the client to send detection information based on the first protocol, where the first protocol is different from a protocol corresponding to the connection; The first protocol related parameter is used to indicate the detection period supported by the first protocol.

13. The method according to claim 12, It is characterized in that There are multiple connections between the client and the server, and the effective connection includes at least one of a specified connection, all connections, and a current connection; wherein the current connection refers to a connection for transmitting the configuration information between the client and the server.

14. The method according to any one of claims 9 to 11, It is characterized in that The second period is adapted to the traffic of the server on the second connection and / or is related to the current connection state of the second connection.

15. A client, It is characterized in that It comprises a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the client executes the method as claimed in any one of claims 1 to 8.

16. A server, It is characterized in that It comprises a memory and one or more processors; wherein the memory is used to store computer program code, and the computer program code comprises computer instructions; when the computer instructions are executed by the processor, the server executes the method as described in any one of claims 9 to 14.

17. A communication system, It is characterized in that include: A client, configured to execute the method according to any one of claims 1 to 8; A server, configured to execute the method according to any one of claims 9 to 14.

18. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes program instructions. When the program instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 1 to 8.

19. A computer-readable storage medium, It is characterized in that The computer-readable storage medium includes program instructions. When the program instructions are executed on a computer, the computer is caused to perform the method according to any one of claims 9 to 14.

20. A computer program product, It is characterized in that The invention comprises a computer program which, when being run on a computer, causes the computer to execute the method according to any one of claims 1 to 14.