CN107294812B - Network detecting method, network detection device and intelligent terminal - Google Patents

Network detecting method, network detection device and intelligent terminal Download PDF

Info

Publication number
CN107294812B
CN107294812B CN201710655488.5A CN201710655488A CN107294812B CN 107294812 B CN107294812 B CN 107294812B CN 201710655488 A CN201710655488 A CN 201710655488A CN 107294812 B CN107294812 B CN 107294812B
Authority
CN
China
Prior art keywords
network
socket
state
intelligent terminal
testing result
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.)
Expired - Fee Related
Application number
CN201710655488.5A
Other languages
Chinese (zh)
Other versions
CN107294812A (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710655488.5A priority Critical patent/CN107294812B/en
Publication of CN107294812A publication Critical patent/CN107294812A/en
Application granted granted Critical
Publication of CN107294812B publication Critical patent/CN107294812B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present invention provides a kind of network detecting method, network detection device, intelligent terminal and computer readable storage medium, which includes: the connection status that each socket of intelligent terminal is periodically acquired under the connected state of intelligent terminal;It determines according to time connection status of each socket of acquisition is worked as when secondary network testing result;If the continuous N1 network testing result determined indicates that network is not connected to, it is determined that intelligent terminal, which is currently at, can not go up net state;If the continuous N2 network testing result determined indicates network-in-dialing, it is determined that intelligent terminal, which is currently at, can go up net state;When determine intelligent terminal be currently at can not go up net state or net state can be gone up when, export corresponding network state instruction information.Technical solution provided by the invention can inform the network state of the current connected network of user in time.

Description

Network detecting method, network detection device and intelligent terminal
Technical field
The invention belongs to net application technology field more particularly to a kind of network detecting methods, network detection device, intelligence Terminal and computer readable storage medium.
Background technique
With the fast development of mechanics of communication, wireless network, especially WLAN (WLAN, Wireless Local Area Net) various aspects are all widely applied in life.Since WLAN does not need to be routed, and transmission speed Comparatively fast, it is thus possible to make up the deficiency of limited local area network well.And current almost all of intelligent terminal is all supported to pass through nothing Line fidelity (WiFi, Wireless Fidelity) accesses the hot spot (i.e. Hotspot) of WLAN to realize function of surfing the Net.
However, in the case where having connected network, often will appear due to the online etc. in limited time of network congestion or network The case where page accessed is not opened for a long time needs user to carry out a variety of online and attempts (such as to attempt to brush in this case The new or other links of access) just it is capable of determining whether that network goes wrong, waste the time of user.
Summary of the invention
It can in view of this, the present invention provides a kind of network detecting method, network detection device, intelligent terminal and computers Read storage medium, it is intended to inform the network state of the current connected network of user in time.
The first aspect of the embodiment of the present invention provides a kind of network detecting method, comprising:
Under the connected state of intelligent terminal, the connection status of each socket of the intelligent terminal is periodically acquired, Wherein, the connected state is to have connected the state of wireless network;
According to time connection status of each socket of acquisition is worked as, determine when secondary network testing result, wherein institute Network testing result instruction network is stated not to be connected to or network-in-dialing;
If the continuous N1 network testing result determined indicates that network is not connected to, it is determined that the intelligent terminal Net state can not be gone up by being currently at, wherein the N1 is the natural number not less than 2;
If the continuous N2 network testing result determined indicates network-in-dialing, it is determined that the intelligent terminal is worked as Preceding be in can go up net state, wherein the N2 is the natural number not less than 2;
When determine the intelligent terminal be currently at can go up net state or net state can not be gone up when, output is corresponding network-like State indicates information, can go up net state to indicate that the intelligent terminal is currently at or can not go up net state.
It is in the first possible implementation, described when the determining intelligent terminal is worked as based on first aspect present invention It is preceding in when can go up net state or net state can not be gone up, exporting corresponding network state instruction information, comprising:
When determine the intelligent terminal be currently at can not go up net state when, the status bar of the intelligent terminal will be set to In network state mark update or remain the preset label that can not surf the Internet;
And/or
When determine the intelligent terminal be currently at can go up net state when, will be set in the status bar of the intelligent terminal Network state mark update or remain preset label of surfing the Internet.
It, can at second based on the possible implementation of the first of first aspect present invention or first aspect present invention In the implementation of energy, the basis works as time connection status of each socket of acquisition, determines and works as secondary network detection As a result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the socket of disconnected state Whether number, which is greater than, preset is not connected to threshold value;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value greater than this, it is determined that when secondary Network testing result be network be not connected to;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value no more than this, it is determined that when Secondary network testing result is network-in-dialing.
Based on the possible implementation of the first of first aspect present invention or first aspect present invention, at the third In possible implementation, the basis works as time connection status of each socket of acquisition, determines when secondary network inspection Survey result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the socket of disconnected state Whether the ratio of quantity and the quantity when secondary total socket is greater than preset fractional threshold;
If detecting, the ratio is greater than the fractional threshold, it is determined that when secondary network testing result is that network does not connect It is logical;
If detecting the ratio no more than the fractional threshold, it is determined that when secondary network testing result is network company It is logical.
The second aspect of the embodiment of the present invention provides a kind of network detection device, comprising: acquiring unit, in intelligence Under the connected state of terminal, the connection status of each socket of the intelligent terminal is periodically acquired, wherein the networking shape State is to have connected the state of wireless network;
First determination unit works as the connection status for each socket that time acquiring unit obtains for basis, It determines when secondary network testing result, wherein the network testing result instruction network is not connected to or network-in-dialing;
Second determination unit, it is equal for working as the first determination unit continuous N1 times network testing result determined When instruction network is not connected to, net state can not be gone up by determining that the intelligent terminal is currently at;When first determination unit is continuous When N2 times the network testing result determined indicates network-in-dialing, determine the intelligent terminal be currently at can go up it is netted State, wherein the N1 and N2 is the natural number not less than 2;
Network state indicating unit, for that can surf the Internet when second determination unit determines that the intelligent terminal is currently at State or when can not go up net state, exports corresponding network state instruction information, can to indicate that the intelligent terminal is currently at Upper net state can not go up net state.
Based on second aspect of the present invention, in the first possible implementation, the network state indicating unit is specific For: when second determination unit determine the intelligent terminal be currently at can not go up net state when, the intelligence will be set to Network state mark in the status bar of energy terminal updates or remains the preset label that can not surf the Internet;And/or when described second Determination unit determines that the intelligent terminal is currently at when can go up net state, will be set in the status bar of the intelligent terminal Network state mark updates or remains preset label of surfing the Internet.
Based on the possible implementation of the first of second aspect of the present invention or second aspect of the present invention, at second In possible implementation, first determination unit, comprising:
First sub- detection unit, for the connection shape according to each socket obtained when time acquiring unit State, detection connection status are whether the number of the socket of disconnected state is greater than and preset is not connected to threshold value;
First sub- judging unit, for detecting that connection status is the set of disconnected state when the described first sub- detection unit The number for connecing word is greater than this when not being connected to threshold value, determine when time network testing result be that network is not connected to;When first son When the number that detection unit detects that connection status is the socket of disconnected state is not connected to threshold value no more than this, determine when secondary Network testing result be network-in-dialing.
Based on the possible implementation of the first of second aspect of the present invention or second aspect of the present invention, at the third In possible implementation, first determination unit, comprising:
Second sub- detection unit, for the connection shape according to each socket obtained when time acquiring unit State, detection connection status are whether the ratio of the quantity and the quantity when secondary total socket of the socket of disconnected state is greater than Preset fractional threshold;
Second sub- judging unit, for detecting that the ratio is greater than the fractional threshold when the described second sub- detection unit When, it determines when secondary network testing result is that network is not connected to;When the described second sub- detection unit detects that the ratio is little When the fractional threshold, determine when secondary network testing result is network-in-dialing.
Third aspect present invention provides a kind of intelligent terminal, including memory, and processor and storage are on a memory and can The computer program run on a processor, above-mentioned processor realized when executing above-mentioned computer program above-mentioned first aspect or The network detecting method referred in any possible implementation of above-mentioned first aspect.
Fourth aspect present invention provides a kind of computer readable storage medium, is stored on the computer readable storage medium Computer program, above-mentioned computer program realize any of above-mentioned first aspect or above-mentioned first aspect when being executed by processor The network detecting method referred in possible implementation.
Therefore in the present invention program, under the connected state of intelligent terminal, the intelligent terminal is periodically acquired The connection status of each socket, which is simultaneously determined based on the connection status of each socket of acquisition, works as secondary network testing result, and When the network testing result determined at continuous N1 times indicates that network is not connected to, determine the intelligent terminal be currently at can not on Net state when the network testing result determined at continuous N2 times indicates network-in-dialing, determines that the intelligent terminal is currently at Net state can be gone up.Network detection is carried out automatically by the connection status of each socket based on intelligent terminal, and should determining Intelligent terminal is in when can go up net state or can not go up net state, corresponding network state instruction information is exported, so that user can With the network state of the current connected network of timely learning.
Detailed description of the invention
It to describe the technical solutions in the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art Needed in attached drawing be briefly described, it should be apparent that, the accompanying drawings in the following description is only of the invention some Embodiment for those of ordinary skill in the art without any creative labor, can also be according to these Attached drawing obtains other attached drawings.
Fig. 1 is network detecting method one embodiment flow diagram provided by the invention;
Fig. 2 is another embodiment flow diagram of network detecting method provided by the invention;
Fig. 3 is network detection device one embodiment structural schematic diagram provided by the invention;
Fig. 4 is intelligent terminal one embodiment structural schematic diagram provided by the invention.
Specific embodiment
In being described below, for illustration and not for limitation, the tool of such as particular system structure, technology etc is proposed Body details, to understand thoroughly the embodiment of the present invention.However, it will be clear to one skilled in the art that there is no these specific The present invention also may be implemented in the other embodiments of details.In other situations, it omits to well-known system, device, electricity The detailed description of road and method, in case unnecessary details interferes description of the invention.
It should be understood that the size of the serial number of each step is not meant that the order of the execution order in following methods embodiment, respectively The execution sequence of process should be determined by its function and internal logic, and the implementation process without coping with each embodiment constitutes any limit It is fixed.
In order to illustrate technical solutions according to the invention, the following is a description of specific embodiments.
Embodiment one
The embodiment of the present invention provides a kind of network detecting method, referring to Fig. 1, the network detection side in the embodiment of the present invention Method includes:
Step 101, under the connected state of intelligent terminal, periodically acquire the company of each socket of above-mentioned intelligent terminal Connect state;
In the embodiment of the present invention, above-mentioned connected state is to have connected the state of wireless network.In a step 101, Ke Yizhou Phase property from transmission control protocol (TCP, Transmission Control Protocol) kernel of above-mentioned intelligent terminal (such as TCP protocol stack information) in obtain the attribute information of each socket (namely socket), based on as each socket time obtained Attribute information determine the connection status of corresponding socket.
In embodiments of the present invention, the attribute of socket includes but is not limited to state (i.e. state) information, retransmission time out (RTO, Retransmission Time-Out) information, round-trip delay (RTT, Round-Trip Time) information, response timeout (ATO, ACKnowledge Time-Out) information.In a step 101, based on when time attribute information of each socket of acquisition It can determine the connection status of corresponding socket.For example, in a kind of application scenarios, for any socket, when what is got The value of the state attribute of the socket is not TCP_SYN_SENT, and the value of the RTT attribute of the socket is greater than preset RTT Threshold value (such as 10000000), and there is the data packet retransmitted and (can belong to based on the RTO of the socket in the corresponding link of the socket Property determine) or do not respond data packet (can based on the ATO attribute of the socket determine) when, it is determined that the connection with the Socket State is disconnected state;When the value of the state attribute of the socket got is not TCP_SYN_SENT, and the socket The value of RTT attribute be greater than preset RTT threshold value (such as 10000000), and there is the number retransmitted in the corresponding link of the socket According to packet (can based on the RTO attribute of the socket determine) or the data packet not responded (can the ATO attribute based on the socket it is true It is fixed) when, it is determined that the connection status with the Socket is disconnected state.
Specifically, obtain the connection status of each socket of intelligent terminal implementation be also referred to it is other existing Technology realizes that details are not described herein again.
Step 102, basis work as time connection status of each socket of acquisition, determine and work as secondary network testing result;
Wherein, above-mentioned network testing result instruction network is not connected to or network-in-dialing.
In the embodiment of the present invention, the distribution of the connection status of each socket got based on step 101, it may be determined that when Secondary network testing result.
Optionally, step 102 may include:
According to when time connection status of each socket of acquisition, detection connection status is the socket of disconnected state Whether number, which is greater than, preset is not connected to threshold value;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value greater than this, it is determined that when secondary Network testing result be network be not connected to;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value no more than this, it is determined that when Secondary network testing result is network-in-dialing.
It certainly,, can also according to the distribution situation of the connection status when the secondary each socket obtained in the embodiment of the present invention To be determined based on other preset algorithms when secondary network testing result.For example, according to when time connection of each socket of acquisition State, the quantity (such as M1) and the quantity (example when secondary total socket that detection connection status is the socket of disconnected state Such as M2) ratio (such as M1/M2) whether be greater than preset fractional threshold;If detecting, M1/M2 is greater than the fractional threshold, really Settled network testing result is that network is not connected to;If detecting M1/M2 no more than the fractional threshold, it is determined that when secondary net Network testing result is network-in-dialing.For example, setting step 101 when the secondary connection status for obtaining 10 sockets, without even The quantity of the socket of logical state is 6, then M1/M2 is equal to 6/10.
If step 103, the continuous N1 above-mentioned network testing result determined indicate that network is not connected to, it is determined that above-mentioned Intelligent terminal, which is currently at, can not go up net state;
Wherein, the N1 is the natural number not less than 2.
In step 103, when indicating that network is not connected to by the step 102 continuous N1 times network testing result determined When, it is believed that the network that above-mentioned intelligent terminal is connected at this time can not surf the Internet, at this point, determining that above-mentioned intelligent terminal is currently at not Net state can be gone up.
If step 104, the continuous N2 network testing result determined indicate network-in-dialing, it is determined that above-mentioned intelligence is eventually End, which is currently at, can go up net state;
Wherein, above-mentioned N2 is the natural number not less than 2.Above-mentioned N2 can be equal to above-mentioned N1, can also be not equal to above-mentioned N1, Herein without limitation.
At step 104, when indicating network-in-dialing by the step 102 continuous N2 times network testing result determined When, it is believed that the network that above-mentioned intelligent terminal is connected at this time can surf the Internet, at this point, determine above-mentioned intelligent terminal be currently at can on Net state.
Step 105, when determine above-mentioned intelligent terminal be currently at can go up net state or net state can not be gone up when, output phase is answered Network state indicate information, can go up net state to indicate that above-mentioned intelligent terminal is currently at or can not go up net state;
In the embodiment of the present invention, in order to enable user is capable of the network of current the networked network of the above-mentioned intelligent terminal of timely learning State, when determine every time above-mentioned intelligent terminal be currently at can go up net state or net state can not be gone up when, export corresponding network Status indication information, so that user can be with the real-time network state of the above-mentioned intelligent terminal of timely learning.
In a kind of application scenarios, step 105 may include: when determine above-mentioned intelligent terminal be currently at can not go up it is netted When state, the network state mark in the status bar for being set to above-mentioned intelligent terminal, which is updated or remained, preset can not go up network mark Note, so as to user view this can not surf the Internet mark when, would know that the intelligent terminal is currently at can not go up net state.Specifically , net state can not be gone up when determining that above-mentioned intelligent terminal is currently at, and without network state in the status bar of above-mentioned intelligent terminal When mark, the label that can not surf the Internet is set in the status bar of above-mentioned intelligent terminal;When determining that above-mentioned intelligent terminal is currently at not It, will be upper when the network state mark that net state can be gone up, and be set in the status bar of above-mentioned intelligent terminal marks for that can not surf the Internet It states network state mark and remains the label that can not surf the Internet (namely not being modified to above-mentioned network state mark).
In another application scenarios, step 105 may include: when determine above-mentioned intelligent terminal be currently at can go up it is netted When state, the network state mark in the status bar for being set to above-mentioned intelligent terminal is updated or remained and preset goes up network mark Note, so as to user view this can surf the Internet mark when, would know that the intelligent terminal is currently at can go up net state.Specifically, Net state can be gone up when determining that above-mentioned intelligent terminal is currently at, and without network state mark in the status bar of above-mentioned intelligent terminal When, the label that can surf the Internet is set in above-mentioned status bar;Net state can be gone up when determining that above-mentioned intelligent terminal is currently at, and is set to Network state mark in the status bar of above-mentioned intelligent terminal is when can surf the Internet to mark, and above-mentioned network state mark is remained can Online label (namely above-mentioned network state mark not being modified).
In another application scenarios, step 105 may include: when determining above-mentioned intelligent terminal is currently at and can not surf the Internet When state, the network state mark in the status bar for being set to above-mentioned intelligent terminal, which is updated or remained, preset can not surf the Internet Label;When determine above-mentioned intelligent terminal be currently at can go up net state when, will be set in the status bar of above-mentioned intelligent terminal Network state mark updates or remains preset label of surfing the Internet, so as to user view this can not surf the Internet mark when, can Net state can not be gone up by knowing that the intelligent terminal is currently at, alternatively, when user view this can surf the Internet mark when, would know that the intelligence Energy terminal, which is currently at, can go up net state.Specifically, net state can not be gone up when determining that above-mentioned intelligent terminal is currently at, and above-mentioned Network state mark in the status bar of intelligent terminal is when can surf the Internet to mark, by above-mentioned network state mark be updated to can not on Network mark note;Net state can not be gone up when determining that above-mentioned intelligent terminal is currently at, and is set in the status bar of above-mentioned intelligent terminal Network state mark be that can not surf the Internet when marking, above-mentioned network state mark is remained into the label that can not surf the Internet, when in determination Net state can be gone up by stating intelligent terminal and being currently at, and the network state mark in the status bar of above-mentioned intelligent terminal is that can not surf the Internet When label, above-mentioned network state mark is updated to the label that can surf the Internet;When determine above-mentioned intelligent terminal be currently at can go up it is netted State, and the network state mark being set in the status bar of above-mentioned intelligent terminal is when can surf the Internet to mark, by above-mentioned network state Mark remains the label that can surf the Internet.
Further, the network detecting method in the embodiment of the present invention can also include: the result for recording each network detection (such as above-mentioned network testing result) is analyzed or other with the result for facilitating user or technical staff that the network is called to detect Using.
It should be noted that the network detecting method in the embodiment of the present invention can be applied in network detection device, it is above-mentioned Network detection device can be independent equipment, or also can integrate in intelligent terminal (such as mobile phone, tablet computer etc.) or In other equipment, it is not construed as limiting herein.
Therefore in embodiments of the present invention, under the connected state of intelligent terminal, the intelligent terminal is periodically acquired Each socket connection status and based on the connection status of each socket of acquisition determine when time network testing result, And the network testing result determined at continuous N1 times is when indicating that network is not connected to, determining that the intelligent terminal is currently at can not Upper net state when the network testing result determined at continuous N2 times indicates network-in-dialing, determines that the intelligent terminal is currently located In net state can be gone up.Network detection is carried out automatically by the connection status of each socket based on intelligent terminal, and in determination The intelligent terminal is in when can go up net state or can not go up net state, corresponding network state instruction information is exported, so that user It can be with the network state of the current connected network of timely learning.
Embodiment two
The difference of the embodiment of the present invention and embodiment one is that the network that the embodiment of the present invention is determined at continuous N1 times is examined It surveys result and indicates that network is not connected to, and do not show to surf the Internet in the status bar of intelligent terminal and indicate the connection of information intelligent terminal Under net state, detected in conjunction with HTTP, a possibility that reduce erroneous judgement.As shown in Fig. 2, the network detection side in the embodiment of the present invention Method includes:
Step 201, under the connected state of intelligent terminal, periodically acquire the company of each socket of above-mentioned intelligent terminal Connect state;
In the embodiment of the present invention, above-mentioned connected state is to have connected the state of wireless network.In step 201, Ke Yizhou Phase property obtains each socket (namely socket) from the TCP kernel (such as TCP protocol stack information) of above-mentioned intelligent terminal Attribute information, based on the connection status for determining corresponding socket when time attribute information of each socket of acquisition.
In embodiments of the present invention, the attribute of socket include but is not limited to state (i.e. state) information, RTO information, RTT information, ATO information.In step 201, it can be determined accordingly based on when time attribute information of each socket of acquisition The connection status of socket.For example, in a kind of application scenarios, for any socket, when the socket's got The value of state attribute is not TCP_SYN_SENT, and the value of the RTT attribute of the socket be greater than preset RTT threshold value (such as 10000000), and the corresponding link of the socket exist the data packet (can be determined based on the RTO attribute of the socket) retransmitted or When data packet (can be determined based on the ATO attribute of the socket) not responded, it is determined that the connection status with the Socket is not Connected state;When the value of the state attribute of the socket got is not TCP_SYN_SENT, and the RTT of the socket belongs to Property value be greater than preset RTT threshold value (such as 10000000), and the corresponding link of the socket there is the data packet retransmitted (can Determined based on the RTO attribute of the socket) or do not respond data packet (can based on the ATO attribute of the socket determine) when, then The determining connection status with the Socket is disconnected state.
Specifically, obtain the connection status of each socket of intelligent terminal implementation be also referred to it is other existing Technology realizes that details are not described herein again.
Step 202, basis work as the connection status of the secondary each socket obtained, determine and work as secondary first network detection knot Fruit;
Wherein, above-mentioned first network testing result instruction network is not connected to or network-in-dialing.
In the embodiment of the present invention, the distribution of the connection status of each socket got based on step 201, it may be determined that when Secondary first network result.
Optionally, step 202 may include:
Detection connection status is whether the number of the socket of disconnected state is greater than and preset is not connected to threshold value;
If detecting, the number that connection status is the socket of off-state is not connected to threshold value greater than this, it is determined that when secondary First network testing result is that network is not connected to;
If detecting, the number that connection status is the socket of off-state is not connected to threshold value no more than this, it is determined that when secondary First network testing result be network-in-dialing.
It certainly,, can also according to the distribution situation of the connection status when the secondary each socket obtained in the embodiment of the present invention To be determined based on other preset algorithms when secondary first network testing result.For example, detection connection status is disconnected state It is pre- whether the ratio (such as M1/M2) of the quantity (such as M1) of socket and the quantity (such as M2) when secondary total socket is greater than If fractional threshold;If detect M1/M2 be greater than the fractional threshold, it is determined that when secondary first network testing result be network not Connection;If detecting M1/M2 no more than the fractional threshold, it is determined that when secondary first network testing result is network-in-dialing.
If step 203, the continuous N1 above-mentioned first network testing result determined indicate that network is not connected to, and above-mentioned It does not show that above-mentioned can not surf the Internet indicates information in the current status bar of intelligent terminal, then above-mentioned intelligent terminal is carried out based on HTTP Network detection, obtains the second network testing result;
Wherein, above-mentioned second network testing result instruction network is not connected to or network-in-dialing, wherein above-mentioned N1 be not less than 1 natural number.In the embodiment of the present invention, when mode continuous N1 times based on step 201 and step 202 detects that network does not connect It is logical, and do not show that above-mentioned can not surf the Internet indicates information in the current status bar of above-mentioned intelligent terminal, in order to reduce the probability of erroneous judgement, Further triggering HTTP detection at this time, namely network detection is carried out to above-mentioned intelligent terminal based on HTTP.
Optionally, it carries out network to above-mentioned intelligent terminal to detect including: to preset n based on HTTP in step 203 Server sends HTTP connection request respectively;If above-mentioned intelligent terminal is based on above-mentioned HTTP connection request and above-mentioned n server In any server be successfully established connection, it is determined that when the second secondary network testing result be network-in-dialing;If above-mentioned intelligence Terminal can not be successfully established with any server in above-mentioned N number of server based on above-mentioned HTTP connection request and be connect, it is determined that When the second secondary network testing result is that network is not connected to.Wherein, above-mentioned n is the natural number not less than 2.Further, it is possible to create N thread is built, and the n thread parallel based on creation sends HTTP connection request to n server respectively, to improve detection effect Rate.
Certainly, in the embodiment of the present invention, being detected based on HTTP to above-mentioned intelligent terminal progress network in step 203 can also Think and only initiates HTTP connection request to carry out HTTP detection, herein without limitation to single server.
Optionally, when the first network testing result determined when continuous N1 times indicates that network is not connected to, with preset Another period obtains the connection status of each socket of above-mentioned intelligent terminal, to improve each set for obtaining above-mentioned intelligent terminal The frequency of the connection status of word is connect, alternatively, when the continuous N1 times first network testing result determined indicates that network is not connected to And do not shown in the current status bar of above-mentioned intelligent terminal it is above-mentioned can not surf the Internet when indicating information, obtained with preset another period The connection status of each socket of above-mentioned intelligent terminal, to improve the connection shape for each socket for obtaining above-mentioned intelligent terminal The frequency of state.Above-mentioned raising obtains the frequency of the connection status of each socket of above-mentioned intelligent terminal namely shortens step 201 In " connection status for obtaining each socket of above-mentioned intelligent terminal " This move the execution period.
If step 204, the continuous N1 first network testing result determined indicate that network is not connected to, and above-mentioned intelligence Above-mentioned can not surf the Internet has been displayed in the current status bar of terminal and indicates information, it is determined that current above-mentioned intelligent terminal is currently at not Net state can be gone up;
In the embodiment of the present invention, the first network testing result determined when continuous N1 times indicates that network is not connected to, and Above-mentioned can not surf the Internet has been displayed in the current status bar of above-mentioned intelligent terminal and indicates information, then shows that above-mentioned intelligent terminal is before In net state can not be gone up, the process of HTTP detection can be skipped at this time, directly determined current above-mentioned intelligent terminal and be currently at Net state can not be gone up.
If step 205, the continuous N2 first network testing result determined indicate network and are not connected to and above-mentioned second Network testing result instruction network is not connected to, it is determined that above-mentioned intelligent terminal, which is currently at, can not go up net state;
In the embodiment of the present invention, above-mentioned N2 is greater than N1.
It should be noted that if the continuous N2 first network testing result determined indicates that network is not connected to, and this Shi Wei obtains above-mentioned second network testing result (such as also in HTTP detection), then may wait for the second network testing result After acquisition, judge whether the second network testing result obtained indicates that network is not connected to, if the second network testing result obtained Instruction network is not connected to, it is determined that above-mentioned intelligent terminal, which is currently at, can not go up net state.Further, if second network detects As a result it indicates network-in-dialing, then the statistical number of first network testing result can be reset, return to step 201 later, according to The initial period obtains the connection status of each socket of above-mentioned intelligent terminal.Alternatively, obtaining above-mentioned second network detection As a result it after, if the second network testing result instruction network is not connected to, monitors and whether has been obtained again after triggering HTTP detection (N2-N1) a first network testing result waits, if not obtaining (N2-N1) a first network testing result if obtaining again (N2-N1) a first network testing result, then the first network testing result for judging whether that continuous N2 times is determined indicate net Network is not connected to, if judging, the first network testing result that continuous N2 times is determined indicates that network is not connected to, it is determined that above-mentioned intelligence Energy terminal, which is currently at, can not go up net state.When the second network testing result instruction network-in-dialing, or judge not continuous It, can be clear by the statistical number of first network testing result when N2 times the first network testing result determined indicates that network is not connected to Zero, step 201 is returned to later, and the connection status of each socket of above-mentioned intelligent terminal is obtained according to the initial period.
Step 206, when determine above-mentioned intelligent terminal be currently at can not go up net state when, in the state of above-mentioned intelligent terminal Show that above-mentioned can not surf the Internet indicates information in column;
In the embodiment of the present invention, in order to enable user is capable of the network of current the networked network of the above-mentioned intelligent terminal of timely learning State, when determine every time above-mentioned intelligent terminal be currently at can not go up net state when, in the status bar of above-mentioned intelligent terminal show Show that above-mentioned can not surf the Internet indicates information, so that user can be with the real-time network state of the above-mentioned intelligent terminal of timely learning.
Specifically, net state can not be gone up when determining that above-mentioned intelligent terminal is currently at, and the status bar of above-mentioned intelligent terminal It is middle to surf the Internet when indicating information, show that above-mentioned can not surf the Internet indicates information in the status bar of above-mentioned intelligent terminal;When true Fixed above-mentioned intelligent terminal, which is currently at, can not go up net state, and the instruction that can not surf the Internet has been displayed in the status bar of above-mentioned intelligent terminal When information, above-mentioned can not surf the Internet is kept to indicate the display of information in the status bar of above-mentioned intelligent terminal.
Further, the network detecting method in the embodiment of the present invention can also include: the result for recording each network detection (such as above-mentioned first network testing result and/or above-mentioned second network testing result), to facilitate user or technical staff to call The result of network detection carries out analysis or other application.
It should be noted that the network detecting method in the embodiment of the present invention can be applied in network detection device, it is above-mentioned Network detection device can be independent equipment, or also can integrate in intelligent terminal (such as mobile phone, tablet computer etc.) or In other equipment, it is not construed as limiting herein.
Therefore in embodiments of the present invention, under the connected state of intelligent terminal, the intelligent terminal is periodically acquired Each socket connection status and based on the connection status of each socket of acquisition determine when time first network detect As a result, and the first network testing result determined at continuous N1 times assisted based on Hyper text transfer when indicating that network is not connected to View carries out network detection to the intelligent terminal, obtains the second network testing result, the first network inspection determined at continuous N2 times When survey result indicates that network is not connected to and the second network testing result instruction network is not connected to, determine that the intelligent terminal is current In net state can not be gone up.By combining the network detection mode based on socket and the network inspection based on hypertext transfer protocol Survey mode can further improve the accuracy of network detection, in addition, of the invention relative to single network detection mode is used Determine the intelligent terminal be currently at can not go up net state when, export preset can not surf the Internet indicate information so that user It can be with the network state of the current connected network of timely learning.In addition, the embodiment of the present invention determined at continuous N1 times first Network testing result indicates that network is not connected to, and does not show to surf the Internet in the status bar of intelligent terminal and indicate information intelligent end Under the connected state at end, on the one hand ability further progress HTTP detection can reduce a possibility that judging by accident, another party under the scene Face, which can also have been displayed surf the Internet in the status bar of intelligent terminal, indicates that information skips HTTP detection, improves detection efficiency.
Embodiment three
The embodiment of the present invention also provides a kind of network detection device, as shown in figure 3, the network in the embodiment of the present invention detects Device 300 includes:
Acquiring unit 301, under the connected state of intelligent terminal, periodically acquiring each set of the intelligent terminal Connect the connection status of word, wherein the connected state is to have connected the state of wireless network;
First determination unit 302, for the connection shape according to each socket obtained when time acquiring unit 301 State is determined when secondary network testing result, wherein the network testing result instruction network is not connected to or network-in-dialing;
Second determination unit 303, for being referred both to when the 302 continuous N1 times network testing result determined of the first determination unit When showing that network is not connected to, net state can not be gone up by determining that above-mentioned intelligent terminal is currently at, when the first determination unit 302 is N2 times continuous When the network testing result determined indicates network-in-dialing, net state can be gone up by determining that above-mentioned intelligent terminal is currently at, wherein Above-mentioned N1 and above-mentioned N2 is the natural number not less than 2, and above-mentioned N1 and N2 may be the same or different.
Network state indicating unit 304, for when the second determination unit 303 determines that above-mentioned intelligent terminal is currently at can Net state or when can not go up net state, exports corresponding network state instruction information, to indicate that the intelligent terminal is currently at Net state can be gone up or net state can not be gone up.
Optionally, network state indicating unit 305 is specifically used for: when the second determination unit 303 determines above-mentioned intelligent terminal It is currently at when can not go up net state, the network state mark in the status bar for being set to above-mentioned intelligent terminal is updated or kept For the preset label that can not surf the Internet;And/or when the second determination unit 303 determine above-mentioned intelligent terminal be currently at can go up it is netted When state, the network state mark in the status bar for being set to above-mentioned intelligent terminal is updated or remained and preset goes up network mark Note.
Optionally, the first determination unit 302, comprising: the first sub- detection unit, for being obtained according to when time acquiring unit 301 The connection status of each socket taken, it is preset whether detection connection status is greater than for the number of the socket of disconnected state It is not connected to threshold value;First sub- judging unit, for detecting that connection status is disconnected state when the above-mentioned first sub- detection unit The number of socket be greater than this when not being connected to threshold value, determine when time network testing result be that network is not connected to;When above-mentioned When the number that one sub- detection unit detects that connection status is the socket of disconnected state is not connected to threshold value no more than this, determine When secondary network testing result is network-in-dialing.
Optionally, the first determination unit 302, comprising: the second sub- detection unit, for being obtained according to when time acquiring unit 301 The connection status of each socket taken, detection connection status is for the quantity of the socket of disconnected state and when secondary total socket Whether the ratio of the quantity of word is greater than preset fractional threshold;Second sub- judging unit, for working as the above-mentioned second sub- detection unit When detecting that above-mentioned ratio is greater than above-mentioned fractional threshold, determine when secondary network testing result is that network is not connected to;When above-mentioned When two sub- detection units detect above-mentioned ratio no more than above-mentioned fractional threshold, determine when secondary network testing result is network company It is logical.
It should be noted that the network detection device in the embodiment of the present invention can be independent equipment, or can also be with It is integrated in intelligent terminal (such as mobile phone, tablet computer etc.) or other equipment, is not construed as limiting herein.
Therefore in embodiments of the present invention, under the connected state of intelligent terminal, the intelligent terminal is periodically acquired Each socket connection status and based on the connection status of each socket of acquisition determine when time network testing result, And the network testing result determined at continuous N1 times is when indicating that network is not connected to, determining that the intelligent terminal is currently at can not Upper net state when the network testing result determined at continuous N2 times indicates network-in-dialing, determines that the intelligent terminal is currently located In net state can be gone up.Network detection is carried out automatically by the connection status of each socket based on intelligent terminal, and in determination The intelligent terminal is in when can go up net state or can not go up net state, corresponding network state instruction information is exported, so that user It can be with the network state of the current connected network of timely learning.
Example IV
The embodiment of the present invention provides a kind of intelligent terminal, referring to Fig. 4, the intelligent terminal in the embodiment of the present invention includes: Memory 401, one or more processors 402 (one is only shown in Fig. 4) and is stored on memory 401 and can be in processor The computer program of upper operation.Wherein: memory 401 is deposited for storing software program and module, processor 402 by operation The software program and unit in memory 401 are stored up, thereby executing various function application and data processing.Specifically, it handles Device 402 is stored by operation and is performed the steps of in the above-mentioned computer program of memory 401
Under the connected state of intelligent terminal, the connection status of each socket of the intelligent terminal is periodically acquired, Wherein, the connected state is to have connected the state of wireless network;
According to time connection status of above-mentioned each socket of acquisition is worked as, determine when secondary network testing result, wherein on Network testing result instruction network is stated not to be connected to or network-in-dialing;
If the continuous N1 above-mentioned network testing result determined indicates that network is not connected to, it is determined that above-mentioned intelligent terminal Net state can not be gone up by being currently at, wherein above-mentioned N1 is the natural number not less than 2;
If the continuous N2 above-mentioned network testing result determined indicates network-in-dialing, it is determined that above-mentioned intelligent terminal is worked as Preceding be in can go up net state, wherein above-mentioned N2 is the natural number not less than 2;
When determine above-mentioned intelligent terminal be currently at can go up net state or net state can not be gone up when, output is corresponding network-like State indicates information, can go up net state to indicate that above-mentioned intelligent terminal is currently at or can not go up net state.
Assuming that above-mentioned is the first possible embodiment, then provided based on the first possible embodiment Second of possible embodiment in, can go up net state when determining that above-mentioned intelligent terminal is currently at or can not go up net state When, export corresponding network state instruction information, comprising:
When determine above-mentioned intelligent terminal be currently at can not go up net state when, the status bar of above-mentioned intelligent terminal will be set to In network state mark update or remain the preset label that can not surf the Internet;
And/or
When determine above-mentioned intelligent terminal be currently at can go up net state when, will be set in the status bar of above-mentioned intelligent terminal Network state mark update or remain preset label of surfing the Internet.
It is provided based on the first above-mentioned possible implementation or above-mentioned second of possible implementation The third possible embodiment in, above-mentioned basis when time obtain above-mentioned each socket connection status, determine when time Network testing result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the socket of disconnected state Whether number, which is greater than, preset is not connected to threshold value;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value greater than this, it is determined that when secondary Network testing result be network be not connected to;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value no more than this, it is determined that when Secondary network testing result is network-in-dialing.
It is provided based on the first above-mentioned possible implementation or above-mentioned second of possible implementation The 4th kind of possible embodiment in, above-mentioned basis when time obtain above-mentioned each socket connection status, determine when time Network testing result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the socket of disconnected state Whether the ratio of quantity and the quantity when secondary total socket is greater than preset fractional threshold;
If detecting, the ratio is greater than the fractional threshold, it is determined that when secondary network testing result is that network does not connect It is logical;
If detecting the ratio no more than the fractional threshold, it is determined that when secondary network testing result is network company It is logical.
Further, as shown in figure 4, above-mentioned intelligent terminal may also include that one or more input equipments 403 (only show in Fig. 4 One out) and one or more output equipments 404 (one is only shown in Fig. 4).Memory 401, processor 402, input equipment 403 and output equipment 404 connected by bus 405.
It should be appreciated that in embodiments of the present invention, alleged processor 402 can be central processing unit (Central Processing Unit, CPU), which can also be other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at Reason device is also possible to any conventional processor etc..
Input equipment 403 may include keyboard, Trackpad, fingerprint adopt sensor (for acquire user finger print information and The directional information of fingerprint), microphone etc., output equipment 404 may include display, loudspeaker etc..
Memory 404 may include read-only memory and random access memory, and provide instruction sum number to processor 401 According to.Part or all of memory 404 can also include nonvolatile RAM.For example, memory 404 may be used also With the information of storage device type.
Therefore in embodiments of the present invention, under the connected state of intelligent terminal, the intelligent terminal is periodically acquired Each socket connection status and based on the connection status of each socket of acquisition determine when time network testing result, And the network testing result determined at continuous N1 times is when indicating that network is not connected to, determining that the intelligent terminal is currently at can not Upper net state when the network testing result determined at continuous N2 times indicates network-in-dialing, determines that the intelligent terminal is currently located In net state can be gone up.Network detection is carried out automatically by the connection status of each socket based on intelligent terminal, and in determination The intelligent terminal is in when can go up net state or can not go up net state, corresponding network state instruction information is exported, so that user It can be with the network state of the current connected network of timely learning.
It is apparent to those skilled in the art that for convenience of description and succinctly, only with above-mentioned each function Can unit, module division progress for example, in practical application, can according to need and by above-mentioned function distribution by different Functional unit, module are completed, i.e., the internal structure of above-mentioned apparatus is divided into different functional unit or module, more than completing The all or part of function of description.Each functional unit in embodiment, module can integrate in one processing unit, can also To be that each unit physically exists alone, can also be integrated in one unit with two or more units, it is above-mentioned integrated Unit both can take the form of hardware realization, can also realize in the form of software functional units.In addition, each function list Member, the specific name of module are also only for convenience of distinguishing each other, the protection scope being not intended to limit this application.Above system The specific work process of middle unit, module, can refer to corresponding processes in the foregoing method embodiment, and details are not described herein.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, is not described in detail or remembers in some embodiment The part of load may refer to the associated description of other embodiments.
Those of ordinary skill in the art may be aware that list described in conjunction with the examples disclosed in the embodiments of the present disclosure Member and algorithm steps can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually It is implemented in hardware or software, the specific application and design constraint depending on technical solution.Professional technician Each specific application can be used different methods to achieve the described function, but this realization is it is not considered that exceed The scope of the present invention.
In embodiment provided by the present invention, it should be understood that disclosed device and method can pass through others Mode is realized.For example, system embodiment described above is only schematical, for example, the division of above-mentioned module or unit, Only a kind of logical function partition, there may be another division manner in actual implementation, such as multiple units or components can be with In conjunction with or be desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed Mutual coupling or direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING of device or unit or Communication connection can be electrical property, mechanical or other forms.
Above-mentioned unit as illustrated by the separation member may or may not be physically separated, aobvious as unit The component shown may or may not be physical unit, it can and it is in one place, or may be distributed over multiple In network unit.It can select some or all of unit therein according to the actual needs to realize the mesh of this embodiment scheme 's.
If above-mentioned integrated unit is realized in the form of SFU software functional unit and sells or use as independent product When, it can store in a computer readable storage medium.Based on this understanding, the present invention realizes above-described embodiment side All or part of the process in method can also instruct relevant hardware to complete, above-mentioned computer by computer program Program can be stored in a computer readable storage medium, and the computer program is when being executed by processor, it can be achieved that above-mentioned each The step of a embodiment of the method.Wherein, above-mentioned computer program includes computer program code, and above-mentioned computer program code can Think source code form, object identification code form, executable file or certain intermediate forms etc..Above-mentioned computer-readable medium can be with It include: any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disk, light that can carry above-mentioned computer program code Disk, computer storage, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It should be noted that above-mentioned computer The content that readable medium includes can carry out increase and decrease appropriate according to the requirement made laws in jurisdiction with patent practice, such as In certain jurisdictions, according to legislation and patent practice, computer-readable medium do not include be electric carrier signal and telecommunications letter Number.
Above above-described embodiment is merely illustrative of the technical solution of the present invention, rather than its limitations;Although referring to aforementioned reality Applying example, invention is explained in detail, those skilled in the art should understand that: it still can be to aforementioned each Technical solution documented by embodiment is modified or equivalent replacement of some of the technical features;And these are modified Or replacement, the spirit and scope for technical solution of various embodiments of the present invention that it does not separate the essence of the corresponding technical solution should all It is included within protection scope of the present invention.

Claims (10)

1. a kind of network detecting method characterized by comprising
Under the connected state of intelligent terminal, the connection status of each socket of the intelligent terminal is periodically acquired, wherein The connected state is to have connected the state of wireless network;
According to time connection status of each socket of acquisition is worked as, determine when secondary network testing result, wherein the net Network testing result instruction network is not connected to or network-in-dialing;
If the continuous N1 network testing result determined indicates that network is not connected to, it is determined that the intelligent terminal is current In net state can not be gone up, wherein the N1 is the natural number not less than 2;
If the continuous N2 network testing result determined indicates network-in-dialing, it is determined that the intelligent terminal is currently located In net state can be gone up, wherein the N2 is the natural number not less than 2;
When determine the intelligent terminal be currently at can go up net state or net state can not be gone up when, export corresponding network state and refer to Show information, can go up net state to indicate that the intelligent terminal is currently at or can not go up net state;
Wherein, the connection status of each socket for periodically acquiring the intelligent terminal, comprising:
The attribute information that each socket is periodically obtained from the transmission control protocol TCP kernel of above-mentioned intelligent terminal, is based on When the attribute information of each socket of secondary acquisition determines the connection status of corresponding socket, wherein the attribute of above-mentioned socket Information includes: state state information, retransmission time out RTO information, round-trip delay RTT information, response timeout ATO information;
For any socket, when the value of the state attribute of the socket got is not TCP_SYN_SENT, and it is described The value of the RTT attribute of socket is greater than preset RTT threshold value, and determines the socket based on the RTO attribute of the socket There is the data packet retransmitted or determine that the corresponding link of the socket is deposited based on the ATO attribute of the socket in corresponding link In the data packet not responded, it is determined that the connection status with the socket is disconnected state.
2. network detecting method according to claim 1, which is characterized in that described when the determining intelligent terminal is currently located When can go up net state or net state can not be gone up, corresponding network state instruction information is exported, comprising:
When determine the intelligent terminal be currently at can not go up net state when, will be set in the status bar of the intelligent terminal Network state mark updates or remains the preset label that can not surf the Internet;
And/or
When determine the intelligent terminal be currently at can go up net state when, by the net in the status bar for being set to the intelligent terminal Network Status Flag updates or remains preset label of surfing the Internet.
3. network detecting method according to claim 1 or 2, which is characterized in that the basis is described each when time acquisition The connection status of a socket is determined when secondary network testing result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the number of the socket of disconnected state Whether it is greater than and preset is not connected to threshold value;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value greater than this, it is determined that when secondary net Network testing result is that network is not connected to;
If detecting, the number that connection status is the socket of disconnected state is not connected to threshold value no more than this, it is determined that when secondary Network testing result is network-in-dialing.
4. network detecting method according to claim 1 or 2, which is characterized in that the basis is described each when time acquisition The connection status of a socket is determined when secondary network testing result, comprising:
According to when time connection status of each socket of acquisition, detection connection status is the quantity of the socket of disconnected state Whether it is greater than preset fractional threshold with the ratio of the quantity when secondary total socket;
If detecting, the ratio is greater than the fractional threshold, it is determined that when secondary network testing result is that network is not connected to;
If detecting the ratio no more than the fractional threshold, it is determined that when secondary network testing result is network-in-dialing.
5. a kind of network detection device characterized by comprising
Acquiring unit, under the connected state of intelligent terminal, periodically acquiring each socket of the intelligent terminal Connection status, wherein the connected state is to have connected the state of wireless network;
First determination unit is determined for the connection status according to each socket obtained when time acquiring unit When secondary network testing result, wherein the network testing result instruction network is not connected to or network-in-dialing;
Second determination unit, for being indicated when the first determination unit continuous N1 times network testing result determined When network is not connected to, net state can not be gone up by determining that the intelligent terminal is currently at;When first determination unit is N2 times continuous When the network testing result determined indicates network-in-dialing, net state can be gone up by determining that the intelligent terminal is currently at, Wherein, the N1 and N2 is the natural number not less than 2;
Network state indicating unit, for net state can be gone up when second determination unit determines that the intelligent terminal is currently at Or when can not go up net state, corresponding network state instruction information is exported, can be surfed the Internet with indicating that the intelligent terminal is currently at State can not go up net state;
The acquiring unit is obtained from the transmission control protocol TCP kernel of above-mentioned intelligent terminal each specifically for periodicity The attribute information of socket determines the connection status of corresponding socket based on the attribute information of each socket when secondary acquisition, Wherein, the attribute information of above-mentioned socket include: state state information, retransmission time out RTO information, round-trip delay RTT information, Response timeout ATO information;For any socket, when the value of the state attribute of the socket got is not TCP_ SYN_SENT, and the value of the RTT attribute of the socket is greater than preset RTT threshold value, and the RTO attribute based on the socket Determine that the corresponding link of the socket has the data packet retransmitted or determines the socket based on the ATO attribute of the socket When there is the data packet not responded in the corresponding link of word, it is determined that the connection status with the socket is disconnected state.
6. network detection device according to claim 5, which is characterized in that the network state indicating unit is specifically used In: when second determination unit determine the intelligent terminal be currently at can not go up net state when, the intelligence will be set to Network state mark in the status bar of terminal updates or remains the preset label that can not surf the Internet;And/or when described second really Order member determines that the intelligent terminal is currently at when can go up net state, by the net in the status bar for being set to the intelligent terminal Network Status Flag updates or remains preset label of surfing the Internet.
7. network detection device according to claim 5 or 6, which is characterized in that first determination unit, comprising:
First sub- detection unit, for the connection status according to each socket obtained when time acquiring unit, inspection Whether the number for surveying the socket that connection status is disconnected state, which is greater than, preset is not connected to threshold value;
First sub- judging unit, for detecting that connection status is the socket of disconnected state when the described first sub- detection unit Number be greater than this when not being connected to threshold value, determine when time network testing result be that network is not connected to;When the first son detection When the number that unit detects that connection status is the socket of disconnected state is not connected to threshold value no more than this, determine when secondary net Network testing result is network-in-dialing.
8. network detection device according to claim 5 or 6, which is characterized in that first determination unit, comprising:
Second sub- detection unit, for the connection status according to each socket obtained when time acquiring unit, inspection It is default whether the ratio of the quantity and the quantity when secondary total socket of surveying the socket that connection status is disconnected state is greater than Fractional threshold;
Second sub- judging unit, for when the described second sub- detection unit detect the ratio be greater than the fractional threshold when, It determines when secondary network testing result is that network is not connected to;When the described second sub- detection unit detects the ratio no more than institute When stating fractional threshold, determine when secondary network testing result is network-in-dialing.
9. a kind of intelligent terminal, including memory, processor and storage are in the memory and can be on the processor The computer program of operation, which is characterized in that the processor realizes such as Claims 1-4 when executing the computer program The step of any one the method.
10. a kind of computer readable storage medium, the computer-readable recording medium storage has computer program, and feature exists In when the computer program is executed by processor the step of any one of such as Claims 1-4 of realization the method.
CN201710655488.5A 2017-08-03 2017-08-03 Network detecting method, network detection device and intelligent terminal Expired - Fee Related CN107294812B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710655488.5A CN107294812B (en) 2017-08-03 2017-08-03 Network detecting method, network detection device and intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710655488.5A CN107294812B (en) 2017-08-03 2017-08-03 Network detecting method, network detection device and intelligent terminal

Publications (2)

Publication Number Publication Date
CN107294812A CN107294812A (en) 2017-10-24
CN107294812B true CN107294812B (en) 2019-04-12

Family

ID=60104400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710655488.5A Expired - Fee Related CN107294812B (en) 2017-08-03 2017-08-03 Network detecting method, network detection device and intelligent terminal

Country Status (1)

Country Link
CN (1) CN107294812B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109831359B (en) * 2019-02-01 2021-04-02 维沃移动通信有限公司 Method for detecting connection state of data network and terminal equipment thereof
CN112395151B (en) * 2019-08-19 2024-09-10 无锡飞翎电子有限公司 Clothes dryer, filter screen installation state detection method and device thereof and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103067777A (en) * 2012-12-24 2013-04-24 深圳Tcl新技术有限公司 Method and device of prompting of network state
CN103684897A (en) * 2012-09-11 2014-03-26 北京百度网讯科技有限公司 Method, system and device for detecting network connectivity in client
CN105263196A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Connection state prompting method and device
CN105763394A (en) * 2016-03-22 2016-07-13 杭州华三通信技术有限公司 Method, device and system for detecting network link
CN105940640A (en) * 2014-01-30 2016-09-14 高通股份有限公司 Determination of end-to-end transport quality

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050114496A1 (en) * 2003-10-31 2005-05-26 Zheng Fang Method and apparatus for monitoring network connectivity between a home network device and a network

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103684897A (en) * 2012-09-11 2014-03-26 北京百度网讯科技有限公司 Method, system and device for detecting network connectivity in client
CN103067777A (en) * 2012-12-24 2013-04-24 深圳Tcl新技术有限公司 Method and device of prompting of network state
CN105940640A (en) * 2014-01-30 2016-09-14 高通股份有限公司 Determination of end-to-end transport quality
CN105263196A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Connection state prompting method and device
CN105763394A (en) * 2016-03-22 2016-07-13 杭州华三通信技术有限公司 Method, device and system for detecting network link

Also Published As

Publication number Publication date
CN107294812A (en) 2017-10-24

Similar Documents

Publication Publication Date Title
TWI672027B (en) Data processing method, device and system in webpage
CN107231647B (en) Network detecting method, network detection device and intelligent terminal
CN110275958A (en) Site information recognition methods, device and electronic equipment
CN107396287A (en) The choosing method and device of a kind of working frequency points
CN107332739B (en) Network detecting method, network detection device and intelligent terminal
CN107342952A (en) Service link selects control method and equipment
CN107333287B (en) Network detecting method, network detection device and intelligent terminal
CN107294811A (en) Network detecting method, network detection means and intelligent terminal
CN107203470B (en) Page adjustment method and device
CN109167699A (en) The method and apparatus for handling the state of the node of block chain
CN110134711A (en) Processing method, device, equipment and the computer readable storage medium of big data
CN105279023A (en) Virtual machine migration method and device
CN107294812B (en) Network detecting method, network detection device and intelligent terminal
CN107276856B (en) Network detecting method, network detection device and intelligent terminal
CN108965575A (en) A kind of gesture motion recognition methods, device and terminal device
CN108520043A (en) Data object acquisition method, apparatus and system, computer readable storage medium
CN107360059B (en) Network detecting method, network detection device and intelligent terminal
CN110380925A (en) A kind of network equipment detection middle port selection method and system
CN108737204A (en) A kind of acquisition method and communication terminal of network performance information
CN107332741A (en) A kind of network detecting method, network detection means and intelligent terminal
CN107332740A (en) A kind of network detecting method, network detection means and intelligent terminal
CN107529213A (en) A kind of resource control method and device
CN111147330A (en) Network quality evaluation method and device, storage medium and processor
CN111786898B (en) Monitoring equipment information acquisition method, device, equipment and medium
CN104834958B (en) A kind of method and apparatus judged the step of answer

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
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20190412

CF01 Termination of patent right due to non-payment of annual fee