CN109831359B - Method for detecting connection state of data network and terminal equipment thereof - Google Patents

Method for detecting connection state of data network and terminal equipment thereof Download PDF

Info

Publication number
CN109831359B
CN109831359B CN201910103707.8A CN201910103707A CN109831359B CN 109831359 B CN109831359 B CN 109831359B CN 201910103707 A CN201910103707 A CN 201910103707A CN 109831359 B CN109831359 B CN 109831359B
Authority
CN
China
Prior art keywords
data network
connection
terminal device
terminal equipment
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910103707.8A
Other languages
Chinese (zh)
Other versions
CN109831359A (en
Inventor
罗佳玮
李中煌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Vivo Mobile Communication Co Ltd
Original Assignee
Vivo Mobile Communication Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Vivo Mobile Communication Co Ltd filed Critical Vivo Mobile Communication Co Ltd
Priority to CN201910103707.8A priority Critical patent/CN109831359B/en
Publication of CN109831359A publication Critical patent/CN109831359A/en
Application granted granted Critical
Publication of CN109831359B publication Critical patent/CN109831359B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Telephone Function (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The invention discloses a method for detecting the connection state of a data network and terminal equipment thereof, which are used for solving the problem that the use of a user is influenced because the abnormal connection between the terminal equipment and the data network cannot be detected in time in the prior art. The method comprises the following steps: obtaining RTT round trip time of at least one TCP transmission control protocol connection service of the terminal equipment; and determining the connection state of the data network of the terminal equipment according to the RTT of at least one TCP connection service of the terminal equipment.

Description

Method for detecting connection state of data network and terminal equipment thereof
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method for detecting a connection state of a data network and a terminal device thereof.
Background
At present, with the rapid development of terminal devices, more and more application programs can be installed on terminals of the terminal devices, and users can also use multiple application programs simultaneously, for example, a video application or a web page can be opened while using a chat application.
However, these applications usually need to establish a connection with the data network before being used, and once the connection with the data network is abnormal, these applications cannot be used normally, which will affect the use experience of the user.
Therefore, how to detect the abnormal connection between the terminal device and the data network in time still needs to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a method for detecting a connection state of a data network and terminal equipment thereof, which are used for solving the problem that the use of a user is influenced because the abnormal connection between the terminal equipment and the data network cannot be detected in time in the prior art.
In order to solve the technical problem, the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a method for detecting a connection state of a data network, where the method is applied to a terminal device, and the method includes:
obtaining RTT round trip time of at least one TCP transmission control protocol connection service of the terminal equipment;
and determining the connection state of the data network of the terminal equipment according to the RTT of at least one TCP connection service of the terminal equipment.
Preferably, the determining the connection state of the data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device specifically includes:
if RTTs of M TCP connection services of the terminal equipment are all larger than or equal to a first threshold, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time delay of the RTTs of the N TCP connection services of the terminal equipment is greater than or equal to a second threshold value, determining that the data network connection of the terminal equipment is abnormal.
Preferably, after determining that the data network connection of the terminal device is abnormal, the method further includes:
and reestablishing connection with the network side equipment or restarting a data network switch in the terminal equipment so as to reestablish connection with the data network.
Preferably, the determining the connection state of the data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device specifically includes:
if RTTs of continuous M TCP connection services of the terminal equipment are all larger than or equal to a first threshold value, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time of the RTTs of the continuous N TCP connection services of the terminal equipment is greater than or equal to a second threshold, determining that the data network connection of the terminal equipment is abnormal.
In a second aspect, an embodiment of the present invention provides a terminal device, including:
an obtaining unit, configured to obtain RTT round trip delay of at least one TCP connection service of the terminal device;
a determining unit, configured to determine a connection state of the data network of the terminal device according to the RTT of the at least one TCP connection service of the terminal device.
Preferably, the determining unit is specifically configured to:
if RTTs of M TCP connection services of the terminal equipment are all larger than or equal to a first threshold, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time delay of the RTTs of the N TCP connection services of the terminal equipment is greater than or equal to a second threshold value, determining that the data network connection of the terminal equipment is abnormal.
Preferably, the terminal device further includes:
and the connection unit is used for reestablishing connection with network side equipment or restarting a data network switch in the terminal equipment after the determination unit determines that the data network connection of the terminal equipment is abnormal so as to reestablish connection with a data network.
Preferably, the determining unit is configured to:
if RTTs of continuous M TCP connection services of the terminal equipment are all larger than or equal to a first threshold value, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time of the RTTs of the continuous N TCP connection services of the terminal equipment is greater than or equal to a second threshold, determining that the data network connection of the terminal equipment is abnormal.
In a third aspect, an embodiment of the present invention provides a terminal device, including: a memory, a processor and a computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method for detecting a data network connection status according to the first aspect.
In a fourth aspect, the embodiments of the present invention further provide a readable storage medium, where a computer program is stored on the readable storage medium, and when being executed by a processor, the computer program implements the steps of the method for detecting a connection state of a data network according to the first aspect.
In the embodiment of the invention, the RTT of at least one TCP connection service in the terminal equipment can be obtained, and the connection state of the data network of the terminal equipment can be determined according to the RTT of at least one TCP connection service of the terminal equipment. Therefore, when at least one TCP connection service exists in the terminal equipment, whether the connection state of the data network of the terminal equipment is abnormal or not can be determined by acquiring the RTT duration of the TCP connection services. If it is determined that the connection of the data network of the terminal device is abnormal, the terminal device may take some measures in time to recover the connection between the terminal device and the data network, for example, the connection between the terminal device and the data network may be recovered by restarting a data network switch or performing measures such as data network re-registration.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
Fig. 1 is a schematic flowchart illustrating an embodiment of a method for detecting a connection status of a data network according to the present invention;
fig. 2 is a schematic flowchart illustrating another embodiment of a method for detecting a connection status of a data network according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a terminal device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of another terminal device according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another terminal device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The technical solutions provided by the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
In order to solve the problem that the user use is affected due to the fact that the abnormal connection between the terminal device and the data network cannot be detected in time in the prior art, the invention provides a method for detecting the connection state of the data network.
For convenience of description, the following description will be made of an embodiment of the method taking as an example that an execution subject of the method is a terminal device capable of executing the method. It is understood that the implementation of the method by the terminal device is only an exemplary illustration, and should not be construed as a limitation of the method.
Specifically, the method for detecting the connection state of the data network provided by the invention comprises the following steps: firstly, obtaining RTT round trip time of at least one TCP transmission control protocol connection service of the terminal equipment; and then, determining the connection state of the data network of the terminal equipment according to the RTT of at least one TCP connection service of the terminal equipment.
In the embodiment of the invention, the RTT of at least one TCP connection service in the terminal equipment can be obtained, and the connection state of the data network of the terminal equipment can be determined according to the RTT of at least one TCP connection service of the terminal equipment. Therefore, when at least one TCP connection service exists in the terminal equipment, whether the connection state of the data network of the terminal equipment is abnormal or not can be determined by acquiring the RTT duration of the TCP connection services. If it is determined that the connection of the data network of the terminal device is abnormal, the terminal device may take some measures in time to recover the connection between the terminal device and the data network, for example, the connection between the terminal device and the data network may be recovered by restarting a data network switch or performing measures such as data network re-registration.
The following describes in detail an implementation process of the method with reference to a schematic flow chart of a specific implementation of the method for detecting a connection state of a data network shown in fig. 1, and includes:
step 101, obtaining RTT (Round-Trip Time ) of at least one TCP (Transmission Control Protocol) connection service in a terminal device;
as described in the background art, in the prior art, a terminal device often can execute a plurality of TCP connection services at the same time, for example, when a user browses a web page through the terminal device, all applications such as a chat application, a map application, and a shopping application in the terminal device may run in the background, if the connection between the terminal device and a data network is abnormal at this time, the user may not browse the web page normally, and other applications such as the chat application, the map application, and the shopping application in the terminal device may not receive and update data in time, so that the use experience of the user may be affected.
In order to solve the problem, the embodiment of the present invention may detect a connection state of a data network of a terminal device, that is, a connection state of a Long Term Evolution (LTE) network of the terminal device, by obtaining an RTT duration of at least one TCP connection service in the terminal device, and if it is determined that the connection state of the data network of the terminal device is abnormal, the terminal device may reestablish a connection between the terminal device and the data network based on the connection state between the terminal device and the data network, so that a user can normally use an application in the terminal device.
Step 102, determining a connection state of a data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device.
Optionally, determining the connection state of the data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device may include the following two cases:
in the first case, if the RTTs of the M TCP connection services of the terminal device are all greater than or equal to the first threshold, it may be determined that the data network connection of the terminal device is abnormal;
assuming that a terminal device executes a number of TCP connection services including browsing a webpage, chatting, paying, subscribing and the like at the same time within a preset time period, after obtaining the RTTs of the a TCP connection services, if it is determined that the RTTs of M TCP connection services existing in the a TCP connection services are all greater than or equal to a first threshold, it may be determined that the connection of the data network of the terminal device is abnormal, where M is less than or equal to a.
Optionally, when determining the data network connection state of the terminal device, in order to determine the data network connection state of the terminal device more accurately, the data network connection state of the terminal device may also be determined based on RTTs of consecutive M TCP connection services of the terminal device, that is, if the RTTs of consecutive M TCP connection services of the terminal device are all greater than or equal to the first threshold, it may be determined that the data network connection of the terminal device is abnormal.
In the second case, if the average RTT round trip delay of the RTTs of the N TCP connection services of the terminal device is greater than or equal to the second threshold, it may be determined that the data network connection of the terminal device is abnormal.
Continuously assuming that the terminal device simultaneously executes a number of TCP connection services within a preset time period, including a number of TCP connection services such as web page browsing, chatting, payment, subscription, and the like, after obtaining the RTTs of the a number of TCP connection services, if it is determined that the average value of the RTTs of N number of TCP connection services exists in the a number of TCP connection services is greater than or equal to a preset threshold, it may be determined that the connection of the data network of the terminal device is abnormal, where N is less than or equal to a.
Optionally, when determining the data network connection state of the terminal device, in order to determine the data network connection state of the terminal device more accurately, the data network connection state of the terminal device may also be determined based on an average value of RTTs of consecutive N TCP connection services of the terminal device, and if an average RTT round trip delay of RTTs of consecutive N TCP connection services of the terminal device is greater than or equal to a second threshold, it may be determined that the data network connection of the terminal device is abnormal.
Optionally, in order to enable the data network connection state of the terminal device to be recovered to normal as soon as possible so as to meet the use requirement of the user, in the embodiment of the present invention, after the data network connection of the terminal device is determined to be abnormal, a connection may be reestablished with the network side device or the data network switch in the terminal device may be restarted so as to reestablish a connection with the data network.
Optionally, after determining that the data network connection of the terminal device is abnormal, since the connection state between the terminal device and the data network may include a disconnected state and an un-disconnected state, in order to reestablish the connection between the terminal device and the data network according to the connection state between the terminal device and the data network, the connection state between the terminal device and the data network may also be acquired, and if the mobile data of the terminal device is in the disconnected state, the connection may be reestablished with the network-side device or the data network switch in the terminal device may be restarted to reestablish the connection with the data network.
For example, when the terminal device is in a space where signals of an elevator, a basement or other data networks are weak or even no signals of the data networks, the connection state between the terminal device and the data networks is a disconnected state, and at this time, in order to reestablish the connection between the terminal device and the data networks as soon as possible, the terminal device may restart the terminal device or switch a flight model to reestablish the connection with the network-side device every preset time period, or may restart the data network switch to send a connection request to the data networks, thereby reestablishing the connection with the data networks.
Optionally, when the connection state between the terminal device and the data network is not disconnected, the connection may be reestablished with the network side device or the data network switch in the terminal device may be restarted to reestablish the connection with the data network. Specifically, the method comprises the following steps:
in the first mode, connection is reestablished with network side equipment so as to reestablish connection with a data network;
in practical application, the terminal device may be restarted, or the "flight mode" in the terminal device is started first and then closed, so as to reestablish connection with the network-side device and reestablish connection with the data network.
In a second way, the data network switch in the terminal device may be restarted to reestablish a connection with the data network.
As shown in fig. 2, a schematic flow chart of another specific implementation of the method for detecting a connection state of a data network according to an embodiment of the present invention includes:
step 201, obtaining RTT of at least one TCP connection service in a terminal device;
step 202, if RTTs of M TCP connection services of the terminal device are all greater than or equal to a first threshold, or if an average RTT round trip delay of RTTs of N TCP connection services of the terminal device is greater than or equal to a second threshold, it may be determined that the data network connection of the terminal device is abnormal;
step 203, reestablishing the connection with the network side device or restarting the data network switch in the terminal device to reestablish the connection with the data network.
In the embodiment of the invention, the RTT of at least one TCP connection service in the terminal equipment can be obtained, and the connection state of the data network of the terminal equipment can be determined according to the RTT of at least one TCP connection service of the terminal equipment. Therefore, when at least one TCP connection service exists in the terminal equipment, whether the connection state of the data network of the terminal equipment is abnormal or not can be determined by acquiring the RTT duration of the TCP connection services. If it is determined that the connection of the data network of the terminal device is abnormal, the terminal device may take some measures in time to recover the connection between the terminal device and the data network, for example, the connection between the terminal device and the data network may be recovered by restarting a data network switch or performing measures such as data network re-registration.
Referring to fig. 3, a schematic structural diagram of a terminal device 300 according to an embodiment of the present invention is shown in fig. 3, which includes an obtaining unit 301 and a determining unit 302, where:
an obtaining unit 301, configured to obtain RTT round trip delay of at least one TCP connection service of the terminal device;
a determining unit 302, configured to determine a connection state of a data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device.
In this embodiment of the present invention, since the obtaining unit 301 can obtain the RTT of at least one TCP connection service in the terminal device, the determining unit 302 can determine the connection state of the data network of the terminal device according to the RTT of the at least one TCP connection service of the terminal device. Therefore, when at least one TCP connection service exists in the terminal equipment, whether the connection state of the data network of the terminal equipment is abnormal or not can be determined by acquiring the RTT duration of the TCP connection services. If it is determined that the connection of the data network of the terminal device is abnormal, the terminal device may take some measures in time to recover the connection between the terminal device and the data network, for example, the connection between the terminal device and the data network may be recovered by restarting a data network switch or performing measures such as data network re-registration.
Optionally, in an embodiment, the determining unit 302 is specifically configured to:
if RTTs of M TCP connection services of the terminal equipment are all larger than or equal to a first threshold, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time delay of the RTTs of the N TCP connection services of the terminal equipment is greater than or equal to a second threshold value, determining that the data network connection of the terminal equipment is abnormal.
Optionally, in an embodiment, as shown in fig. 4, in order to enable the data network connection state of the terminal device to be recovered to normal as soon as possible to meet the use requirement of the user, the terminal device further includes:
a connection unit 303, configured to reestablish a connection with a network-side device or restart a data network switch in the terminal device after the determination unit 302 determines that the data network connection of the terminal device is abnormal, so as to reestablish a connection with a data network;
optionally, in an embodiment, when the determining unit 302 determines the data network connection state of the terminal device, in order to determine the data network connection state of the terminal device more accurately, the determining unit 302 is configured to:
if RTTs of continuous M TCP connection services of the terminal equipment are all larger than or equal to a first threshold value, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time of the RTTs of the continuous N TCP connection services of the terminal equipment is greater than or equal to a second threshold, determining that the data network connection of the terminal equipment is abnormal.
The terminal device 300 provided in the embodiment of the present invention can implement each process that can be implemented by the terminal device in the foregoing method embodiments, and for avoiding repetition, details are not described here again.
Figure 5 is a schematic diagram of a hardware configuration of a terminal device 500 implementing various embodiments of the present invention,
the terminal device 500 includes but is not limited to: a radio frequency unit 501, a network module 502, an audio output unit 503, an input unit 504, a sensor 505, a display unit 506, a user input unit 507, an interface unit 508, a memory 509, a processor 510, and a power supply 511. Those skilled in the art will appreciate that the terminal device configuration shown in fig. 5 does not constitute a limitation of the terminal device, and that the terminal device may include more or fewer components than shown, or combine certain components, or a different arrangement of components. In the embodiment of the present invention, the terminal device includes, but is not limited to, a mobile phone, a tablet computer, a notebook computer, a palm computer, a vehicle-mounted terminal, a wearable device, a pedometer, and the like.
The processor 510 is configured to obtain RTT round trip delay of at least one TCP connection service of the terminal device; and determining the connection state of the data network of the terminal equipment according to the RTT of at least one TCP connection service of the terminal equipment.
In the embodiment of the invention, the RTT of at least one TCP connection service in the terminal equipment can be obtained, and the connection state of the data network of the terminal equipment can be determined according to the RTT of at least one TCP connection service of the terminal equipment. Therefore, when a plurality of TCP connection services exist in the terminal equipment, whether the connection state of the data network of the terminal equipment is abnormal or not can be determined by acquiring the RTT duration of the TCP connection services. If the RTT duration of the TCP connection services with the preset number is greater than or equal to a preset threshold, it may be determined that the connection between the terminal device and the data network is abnormal. At this time, the terminal device may take some measures in time to recover the connection between the terminal device and the data network, for example, the connection between the terminal device and the data network may be recovered by restarting the data network switch or performing measures such as data network re-registration.
It should be understood that, in the embodiment of the present invention, the radio frequency unit 501 may be used for receiving and sending signals during a message sending and receiving process or a call process, and specifically, receives downlink data from a base station and then processes the received downlink data to the processor 510; in addition, the uplink data is transmitted to the base station. In general, radio frequency unit 501 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 501 can also communicate with a network and other devices through a wireless communication system.
The terminal device provides the user with wireless broadband internet access through the network module 502, such as helping the user send and receive e-mails, browse webpages, access streaming media, and the like.
The audio output unit 503 may convert audio data received by the radio frequency unit 501 or the network module 502 or stored in the memory 509 into an audio signal and output as sound. Also, the audio output unit 503 may also provide audio output related to a specific function performed by the terminal apparatus 500 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 503 includes a speaker, a buzzer, a receiver, and the like.
The input unit 504 is used to receive an audio or video signal. The input Unit 504 may include a Graphics Processing Unit (GPU) 5041 and a microphone 5042, and the Graphics processor 5041 processes image data of a still picture or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 503. The image frames processed by the graphic processor 5041 may be stored in the memory 509 (or other storage medium) or transmitted via the radio frequency unit 501 or the network module 502. The microphone 5042 may receive sounds and may be capable of processing such sounds into audio data. The processed audio data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 501 in case of the phone call mode.
The terminal device 500 further comprises at least one sensor 505, such as light sensors, motion sensors and other sensors. Specifically, the light sensor includes an ambient light sensor that adjusts the brightness of the display panel 5061 according to the brightness of ambient light, and a proximity sensor that turns off the display panel 5061 and/or a backlight when the terminal device 500 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally three axes), detect the magnitude and direction of gravity when stationary, and can be used to identify the terminal device posture (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration identification related functions (such as pedometer, tapping), and the like; the sensors 505 may also include fingerprint sensors, pressure sensors, iris sensors, molecular sensors, gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which are not described in detail herein.
The display unit 506 is used to display information input by the user or information provided to the user. The Display unit 506 may include a Display panel 5061, and the Display panel 5061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 507 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the terminal device. Specifically, the user input unit 507 includes a touch panel 5071 and other input devices 5072. Touch panel 5071, also referred to as a touch screen, may collect touch operations by a user on or near it (e.g., operations by a user on or near touch panel 5071 using a finger, stylus, or any suitable object or attachment). The touch panel 5071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 510, and receives and executes commands sent by the processor 510. In addition, the touch panel 5071 may be implemented in various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 5071, the user input unit 507 may include other input devices 5072. In particular, other input devices 5072 may include, but are not limited to, a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which are not described in detail herein.
Further, the touch panel 5071 may be overlaid on the display panel 5061, and when the touch panel 5071 detects a touch operation thereon or nearby, the touch operation is transmitted to the processor 510 to determine the type of the touch event, and then the processor 510 provides a corresponding visual output on the display panel 5061 according to the type of the touch event. Although in fig. 5, the touch panel 5071 and the display 5061 are two independent components to implement the input and output functions of the terminal device, in some embodiments, the touch panel 5071 and the display 5061 may be integrated to implement the input and output functions of the terminal device, and is not limited herein.
The interface unit 508 is an interface for connecting an external device to the terminal apparatus 500. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 508 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the terminal apparatus 500 or may be used to transmit data between the terminal apparatus 500 and the external device.
The memory 509 may be used to store software programs as well as various data. The memory 509 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 509 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid-state storage device.
The processor 510 is a control center of the terminal device, connects various parts of the entire terminal device by using various interfaces and lines, and performs various functions of the terminal device and processes data by running or executing software programs and/or modules stored in the memory 509 and calling data stored in the memory 509, thereby performing overall monitoring of the terminal device. Processor 510 may include one or more processing units; preferably, the processor 510 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into processor 510.
The terminal device 500 may further include a power supply 511 (e.g., a battery) for supplying power to various components, and preferably, the power supply 511 may be logically connected to the processor 510 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
In addition, the terminal device 500 includes some functional modules that are not shown, and are not described in detail herein.
Preferably, an embodiment of the present invention further provides a terminal device, which includes a processor 510, a memory 509, and a computer program that is stored in the memory 509 and can be run on the processor 510, and when the computer program is executed by the processor 510, the various processes of the above-mentioned method for detecting a connection state of a data network are implemented, and the same technical effect can be achieved, and in order to avoid repetition, details are not described here again.
The embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program implements each process of the above-mentioned method for detecting a connection state of a data network, and can achieve the same technical effect, and is not described herein again to avoid repetition. The computer-readable storage medium may be a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal (such as a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
While the present invention has been described with reference to the embodiments shown in the drawings, the present invention is not limited to the embodiments, which are illustrative and not restrictive, and it will be apparent to those skilled in the art that various changes and modifications can be made therein without departing from the spirit and scope of the invention as defined in the appended claims.

Claims (6)

1. A method for detecting the connection state of a data network is applied to terminal equipment, and is characterized in that the method comprises the following steps:
obtaining RTT round trip time of at least one TCP transmission control protocol connection service of the terminal equipment;
determining the connection state of the data network of the terminal equipment according to the RTT of at least one TCP connection service of the terminal equipment;
wherein, the determining the connection state of the data network of the terminal device according to the RTT of at least one TCP connection service of the terminal device specifically includes:
if RTTs of continuous M TCP connection services of the terminal equipment are all larger than or equal to a first threshold value, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time of the RTTs of the continuous N TCP connection services of the terminal equipment is greater than or equal to a second threshold, determining that the data network connection of the terminal equipment is abnormal.
2. The method of claim 1, wherein after determining that the data network connection of the terminal device is abnormal, the method further comprises:
and reestablishing connection with the network side equipment or restarting a data network switch in the terminal equipment so as to reestablish connection with the data network.
3. A terminal device, comprising:
an obtaining unit, configured to obtain RTT round trip delay of at least one TCP connection service of the terminal device;
a determining unit, configured to determine a connection state of a data network of the terminal device according to RTT of at least one TCP connection service of the terminal device;
wherein, the determining unit is specifically configured to:
if RTTs of continuous M TCP connection services of the terminal equipment are all larger than or equal to a first threshold value, determining that the data network connection of the terminal equipment is abnormal;
or if the average round-trip time of the RTTs of the continuous N TCP connection services of the terminal equipment is greater than or equal to a second threshold, determining that the data network connection of the terminal equipment is abnormal.
4. The terminal device of claim 3, wherein the terminal device further comprises:
and the connection unit is used for reestablishing connection with network side equipment or restarting a data network switch in the terminal equipment after the determination unit determines that the data network connection of the terminal equipment is abnormal so as to reestablish connection with a data network.
5. A terminal device, comprising: memory, processor and computer program stored on the memory and executable on the processor, the computer program, when executed by the processor, implementing the steps of the method of detecting a connection status of a data network according to any one of claims 1-2.
6. A computer-readable storage medium, having stored thereon a computer program which, when being executed by a processor, carries out the steps of the method for detecting a connection status of a data network according to any one of claims 1-2.
CN201910103707.8A 2019-02-01 2019-02-01 Method for detecting connection state of data network and terminal equipment thereof Active CN109831359B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910103707.8A CN109831359B (en) 2019-02-01 2019-02-01 Method for detecting connection state of data network and terminal equipment thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910103707.8A CN109831359B (en) 2019-02-01 2019-02-01 Method for detecting connection state of data network and terminal equipment thereof

Publications (2)

Publication Number Publication Date
CN109831359A CN109831359A (en) 2019-05-31
CN109831359B true CN109831359B (en) 2021-04-02

Family

ID=66863336

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910103707.8A Active CN109831359B (en) 2019-02-01 2019-02-01 Method for detecting connection state of data network and terminal equipment thereof

Country Status (1)

Country Link
CN (1) CN109831359B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110868746B (en) * 2019-11-18 2022-04-05 RealMe重庆移动通信有限公司 Network switching method and device, electronic equipment and storage medium
CN111770522B (en) * 2020-06-05 2023-10-17 Oppo广东移动通信有限公司 Method, device, terminal and storage medium for identifying data dialing abnormality
CN113840313B (en) * 2020-06-24 2024-02-06 深圳市万普拉斯科技有限公司 Network mode control method and device of mobile terminal and computer equipment
CN112260897A (en) * 2020-10-19 2021-01-22 海尔优家智能科技(北京)有限公司 Method and device for identifying connection abnormity

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018222007A1 (en) * 2017-06-02 2018-12-06 Samsung Electronics Co., Ltd. Methods and systems for accounting for data usage in mptcp
CN107332739B (en) * 2017-07-28 2019-01-15 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN107294812B (en) * 2017-08-03 2019-04-12 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN107333287B (en) * 2017-08-04 2019-03-12 Oppo广东移动通信有限公司 Network detecting method, network detection device and intelligent terminal
CN108566315B (en) * 2018-03-30 2019-10-08 中国联合网络通信集团有限公司 A kind of detection method of faulty link, device and server

Also Published As

Publication number Publication date
CN109831359A (en) 2019-05-31

Similar Documents

Publication Publication Date Title
CN109831359B (en) Method for detecting connection state of data network and terminal equipment thereof
CN108282759B (en) Service processing method and mobile communication terminal
CN108712555B (en) Method and device for sending alarm information
CN113301603A (en) Data transmission method, device and medium
CN111343710B (en) Power adjustment method and electronic equipment
CN110597437A (en) Screen capturing method and terminal equipment
CN111107223B (en) Message processing method and electronic equipment
CN110505279B (en) Method and device for setting time delay
CN109639738B (en) Voice data transmission method and terminal equipment
CN109831582B (en) Non-response event processing method and terminal
CN109151741B (en) Multimedia message receiving method and terminal
CN111093289A (en) Service transmission method and electronic equipment
US11523442B2 (en) Random access resource selection method and terminal device
CN110475303B (en) Data transmission method and terminal equipment
CN111315039B (en) Integrity protection failure processing method and terminal
CN110475372B (en) Uplink transmission method and terminal
CN108234745B (en) Signal receiving method, mobile terminal and computer readable storage medium
CN107864294B (en) Do not disturb mode starting method and mobile terminal
CN108646928B (en) Character input method and terminal equipment
CN110365842B (en) Terminal control method and terminal equipment
CN108668005B (en) Terminal detection method and terminal
CN111435907B (en) Transmission processing method, device, terminal and medium
CN108683793B (en) Display method of application icon and mobile terminal
CN108810245B (en) Anti-interference method for depth camera shooting and mobile terminal
CN108733458B (en) Method and terminal for playing content

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant