CN107360059B - Network detecting method, network detection device and intelligent terminal - Google Patents
Network detecting method, network detection device and intelligent terminal Download PDFInfo
- Publication number
- CN107360059B CN107360059B CN201710632877.6A CN201710632877A CN107360059B CN 107360059 B CN107360059 B CN 107360059B CN 201710632877 A CN201710632877 A CN 201710632877A CN 107360059 B CN107360059 B CN 107360059B
- Authority
- CN
- China
- Prior art keywords
- network
- intelligent terminal
- testing result
- dialing
- state
- 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
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0805—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
- H04L43/0811—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/75—Indicating network or usage conditions on the user display
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/16—Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
- H04L69/161—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
- H04L69/162—Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Environmental & Geological Engineering (AREA)
- Computer Security & Cryptography (AREA)
- Mobile Radio Communication Systems (AREA)
- Data Exchanges In Wide-Area Networks (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 first network testing result;If the continuous N1 first network testing result determined indicates network-in-dialing, network detection is carried out to intelligent terminal based on HTTP, obtains the second network testing result;If the continuous N2 first network testing result determined indicates network-in-dialing and the second network testing result instruction 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 go up net state when, export preset surf the Internet indicate information.Technical solution provided by the invention can be improved the accuracy of network detection, and inform the network state of the current connected network of user in time.
Description
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 improve the accuracy of network detection, and 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 first network testing result,
In, the first network testing result instruction network is not connected to or network-in-dialing;
If the continuous N1 first network testing result determined indicates network-in-dialing, it is based on Hyper text transfer
Agreement carries out network detection to the intelligent terminal, obtains the second network testing result, wherein the second network testing result
Instruction network is not connected to or network-in-dialing, wherein the N1 is the natural number not less than 1;
If the continuous N2 first network testing result determined indicates network-in-dialing and second network is examined
It surveys result and indicates network-in-dialing, it is determined that the intelligent terminal, which is currently at, can go up net state, wherein the N2 is greater than N1;
When determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information, with refer to
Net state can be gone up by showing that the intelligent terminal is currently at.
Based on first aspect present invention, in the first possible implementation, the preset instruction of surfing the Internet of output
Information, comprising:
It can surf the Internet described in display in the status bar of the intelligent terminal and indicate information.
The first possible implementation based on first aspect present invention, in the second possible implementation, institute
If stating the continuous N1 first network testing result determined indicates network-in-dialing, it is based on hypertext transfer protocol pair
The intelligent terminal carries out network detection, are as follows:
If the continuous N1 first network testing result determined indicates network-in-dialing, and the intelligent terminal is worked as
It does not show that described can surf the Internet indicates information in preceding status bar, then net is carried out to the intelligent terminal based on hypertext transfer protocol
Network detection;
If the continuous N1 first network testing result determined indicates network-in-dialing, and the intelligent terminal is worked as
Described can surf the Internet has been displayed in preceding status bar and indicates information, it is determined that presently described intelligent terminal be currently at can go up it is netted
State.
The first possible implementation or this hair based on first aspect present invention perhaps first aspect present invention
The possible implementation of second of bright first aspect is determined when continuous N1 times in the third possible implementation
When the first network testing result indicates network-in-dialing, the network detecting method further include:
The connection status of each socket of the intelligent terminal is obtained, with preset another period to improve described in acquisition
The frequency of the connection status of each socket of intelligent terminal.
The first possible implementation or this hair based on first aspect present invention perhaps first aspect present invention
The possible implementation of second of bright first aspect, it is in the fourth possible implementation, described to be based on Hyper text transfer
Agreement carries out network detection to the intelligent terminal, obtains the second network testing result, comprising:
Hypertext transfer protocol connection request is sent respectively to preset N number of server;
It is successfully established when based on the hypertext transfer protocol connection request and any server in N number of server
When connection, determine that the second network testing result is network-in-dialing;
It can not succeed with any server in N number of server when based on the hypertext transfer protocol connection request
When establishing connection, determine that the second network testing result is that network is not connected to.
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 first network testing result, wherein the first network testing result instruction network is not connected to or network-in-dialing;
Http detection unit, the first network detection knot for being determined when first determination unit continuous N1 times
When fruit indicates network-in-dialing, network detection is carried out to the intelligent terminal based on hypertext transfer protocol, obtains the second network
Testing result, wherein the second network testing result instruction network is not connected to or network-in-dialing, wherein the N1 is not small
In 1 natural number;
Second determination unit, the first network detection knot for being determined when first determination unit continuous N2 times
When fruit indicates network-in-dialing, and the second network testing result instruction network-in-dialing that the http detection unit obtains
When, net state can be gone up by determining that the intelligent terminal is currently at, wherein the N2 is greater than N1;
Network state indicating unit, for that can surf the Internet when second determination unit determines that the intelligent terminal is currently at
When state, exports preset surf the Internet and indicate information, net state can be gone up to indicate that the intelligent terminal is currently at.
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 go up net state when, in the intelligent terminal
It can surf the Internet described in display in status bar and indicate information.
The first possible implementation based on second aspect of the present invention, in the second possible implementation, institute
It states http detection unit to be specifically used for: when the first network testing result that first determination unit continuous N1 times is determined
Indicate network-in-dialing, and do not shown in the current status bar of the intelligent terminal it is described can surf the Internet when indicating information, based on super
Text transfer protocol carries out network detection to the intelligent terminal;
Second determination unit is also used to: when continuous N1 times first network determined of first determination unit
Testing result indicates network-in-dialing, and described can surf the Internet has been displayed in the current status bar of the intelligent terminal and indicates information
When, net state can be gone up by determining that presently described intelligent terminal is currently at.
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 is simultaneously determined based on the connection status of each socket of acquisition when secondary first network detects knot
Fruit, and when the first network testing result determined at continuous N1 times indicates network-in-dialing, it is based on hypertext transfer protocol pair
The intelligent terminal carries out network detection, obtains the second network testing result, the first network detection knot determined at continuous N2 times
Fruit indicate network-in-dialing and the second network testing result instruction network-in-dialing when, determine the intelligent terminal be currently at can on
Net state.It, can by combining the network detection mode based on socket and the network detection mode based on hypertext transfer protocol
To avoid the situation for leading to testing result inaccuracy using single network detection mode, the accuracy of network detection is improved, separately
Outside, the present invention determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information so that
User can be 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 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 101, it may be determined that when
Secondary first network testing result.
Optionally, step 102 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 disconnected state is not connected to threshold value greater than this, it is determined that when secondary
First 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 first 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 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 103, the continuous N1 above-mentioned first network testing result determined indicate network-in-dialing, based on super
Text transfer protocol (HTTP, HyperText Transfer Protocol) carries out network detection to above-mentioned intelligent terminal, obtains
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 101 and step 102 detects network-in-dialing
When, triggering HTTP detection, 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 103
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 103 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 network-in-dialing, with preset another
One period obtained the connection status of each socket of above-mentioned intelligent terminal, to improve each socket for obtaining above-mentioned intelligent terminal
The frequency of the connection status of word.That is, when the first network testing result determined when continuous N1 times indicates network-in-dialing, contracting
The execution period of " connection status for obtaining each socket of above-mentioned intelligent terminal " This move in short step 101, so as to
The neighbouring period for obtaining the second network testing result can obtain (N2-N1) a first network testing result again.For example, if
Originally step 101 obtain the connection status of each socket of above-mentioned intelligent terminal period be 5 seconds, then when continuous N1 determination
When first network testing result out indicates network-in-dialing, then each of above-mentioned intelligent terminal can be obtained with 2 seconds periods
The connection status of socket.
If step 104, the continuous N2 first network testing result determined indicate network-in-dialing and above-mentioned second net
Network testing result indicates network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can 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 network-in-dialing, and at this time
Above-mentioned second network testing result (such as also in HTTP detection) is not obtained, then may wait for the second network testing result and obtain
After obtaining, judge whether the second network testing result obtained indicates network-in-dialing, if the second network testing result instruction obtained
Network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can go up net state.Further, if the second network testing result indicates
Network is not connected to, then can reset the statistical number of first network testing result, step 101 be returned to later, according to initial
Period obtains the connection status of each socket of above-mentioned intelligent terminal, further the exportable preset instruction letter that can not surf the Internet
Breath can not go up net state and (such as can show in the status bar of above-mentioned intelligent terminal to indicate that the intelligent terminal is currently at
Above-mentioned can not surf the Internet indicates information).Alternatively, after obtaining above-mentioned second network testing result, if the second network testing result
It indicates network-in-dialing, then monitors and whether obtained (N2-N1) a first network testing result again after triggering HTTP detection, if not
(N2-N1) a first network testing result is obtained, then waits, if obtaining (N2-N1) a first network testing result again, sentences
It is disconnected that whether the continuous N2 times first network testing result determined indicates network-in-dialing, if judge to determine for continuous N2 times the
One network testing result indicates network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can go up net state.When second net
Network testing result instruction network is not connected to, or the first network testing result for judging that not continuous N2 times is determined indicates net
When network is connected to, the statistical number of first network testing result can be reset, step 101 be returned to later, according to the initial period
The connection status of each socket of above-mentioned intelligent terminal is obtained, further exportable preset can not surf the Internet indicates information, with
Indicate the intelligent terminal be currently at can not go up net state (such as can be shown in the status bar of above-mentioned intelligent terminal it is above-mentioned not
It can surf the Internet and indicate information).
Step 105, when determine above-mentioned intelligent terminal be currently at can go up net state when, export it is preset surf the Internet instruction letter
Breath, can go up net state to indicate that above-mentioned intelligent terminal is currently at;
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 when, export preset surf the Internet indicate information so that
Obtaining 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: that can go up net state when determining above-mentioned intelligent terminal is currently at
When, show that above-mentioned surf the Internet indicates that (above-mentioned surf the Internet indicates that information for example can be with to information in the status bar of above-mentioned intelligent terminal
For preset label of surfing the Internet), so as to user view this can surf the Internet indicate information when, would know that the intelligent terminal is currently located
In net state can be gone up.Specifically, net state can be gone up when determining that above-mentioned intelligent terminal is currently at, and the state of above-mentioned intelligent terminal
It can not be surfed the Internet when indicating information in column, show that above-mentioned surf the Internet indicates information in the status bar of above-mentioned intelligent terminal;Work as determination
Above-mentioned intelligent terminal, which is currently at, can go up net state, and has been displayed to surf the Internet in the status bar of above-mentioned intelligent terminal and indicate information
When, keep above-mentioned surf the Internet 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 be based on hypertext transfer protocol when indicating network-in-dialing
Network detection is carried out to the intelligent terminal, obtains the second network testing result, the first network detection determined at continuous N2 times
When as a result indicating network-in-dialing and the second network testing result instruction network-in-dialing, determining that the intelligent terminal is currently at can
Upper net state.By combining the network detection mode based on socket and the network detection mode based on hypertext transfer protocol,
The accuracy of network detection can be improved to avoid the situation for leading to testing result inaccuracy using single network detection mode,
In addition, the present invention determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information so that
Obtaining user 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, the first net that the embodiment of the present invention is determined at continuous N1 times
Network testing result indicates network-in-dialing, and does not show to surf the Internet in the status bar of intelligent terminal and indicate the connection of information intelligent terminal
Under net state, ability further progress HTTP detection, a possibility that reduce erroneous judgement.As shown in Fig. 2, the net in the embodiment of the present invention
Network detection 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 testing 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 disconnected state is not connected to threshold value greater than this, it is determined that when secondary
First 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 first 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 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 network-in-dialing, and above-mentioned intelligence
It can not show that above-mentioned surf the Internet indicates information in the current status bar of terminal, then network be carried out to above-mentioned intelligent terminal based on HTTP
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 network-in-dialing,
And do not show that above-mentioned surf the Internet indicates information in the current status bar of above-mentioned intelligent terminal, in order to reduce the probability of erroneous judgement, at this time
Further triggering HTTP detection, 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 network-in-dialing, with preset another
One period obtained the connection status of each socket of above-mentioned intelligent terminal, to improve each socket for obtaining above-mentioned intelligent terminal
The frequency of the connection status of word, alternatively, when the continuous N1 times first network testing result determined indicate network-in-dialing and on
State do not shown in the current status bar of intelligent terminal it is above-mentioned surf the Internet when indicating information, above-mentioned intelligence is obtained with preset another period
The connection status of each socket of energy terminal, to improve the frequency of the connection status for each socket for obtaining above-mentioned intelligent terminal
Rate.Above-mentioned raising obtains the frequency of the connection status of each socket of above-mentioned intelligent terminal namely shortens in step 201 and " obtains
The execution period of the connection status of each socket of above-mentioned intelligent terminal " This move.
If step 204, the continuous N1 first network testing result determined indicate network-in-dialing, and above-mentioned intelligence is eventually
It holds and above-mentioned surf the Internet has been displayed in current status bar indicates information, it is determined that current above-mentioned intelligent terminal is currently at and can surf the Internet
State;
In the embodiment of the present invention, the first network testing result determined when continuous N1 times indicates network-in-dialing, and on
It states and above-mentioned surf the Internet has been displayed in the current status bar of intelligent terminal indicates information, then above-mentioned intelligent terminal has been in front of showing
Net state can be gone up, the process of HTTP detection can be skipped at this time, current above-mentioned intelligent terminal is directly determined and is currently at and can surf the Internet
State.
If step 205, the continuous N2 first network testing result determined indicate network-in-dialing and above-mentioned second net
Network testing result indicates network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can 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 network-in-dialing, and at this time
Above-mentioned second network testing result (such as also in HTTP detection) is not obtained, then may wait for the second network testing result and obtain
After obtaining, judge whether the second network testing result obtained indicates network-in-dialing, if the second network testing result instruction obtained
Network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can go up net state.Further, if the second network testing result indicates
Network is not connected to, then can reset the statistical number of first network testing result, step 201 be returned to later, according to initial
Period obtains the connection status of each socket of above-mentioned intelligent terminal, further the exportable preset instruction letter that can not surf the Internet
Breath can not go up net state and (such as can show in the status bar of above-mentioned intelligent terminal to indicate that the intelligent terminal is currently at
Above-mentioned can not surf the Internet indicates information).Alternatively, after obtaining above-mentioned second network testing result, if the second network testing result
It indicates network-in-dialing, then monitors and whether obtained (N2-N1) a first network testing result again after triggering HTTP detection, if not
(N2-N1) a first network testing result is obtained, then waits, if obtaining (N2-N1) a first network testing result again, sentences
It is disconnected that whether the continuous N2 times first network testing result determined indicates network-in-dialing, if judge to determine for continuous N2 times the
One network testing result indicates network-in-dialing, it is determined that above-mentioned intelligent terminal, which is currently at, can go up net state.When second net
Network testing result instruction network is not connected to, or the first network testing result for judging that not continuous N2 times is determined indicates net
When network is connected to, the statistical number of first network testing result can be reset, step 201 be returned to later, according to the initial period
The connection status of each socket of above-mentioned intelligent terminal is obtained, further exportable preset can not surf the Internet indicates information, with
Indicate the intelligent terminal be currently at can not go up net state (such as can be shown in the status bar of above-mentioned intelligent terminal it is above-mentioned not
It can surf the Internet and indicate information).
Step 206, when determine above-mentioned intelligent terminal be currently at can go up net state when, in the status bar of above-mentioned intelligent terminal
Above-mentioned surf the Internet of middle display indicates information;
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 when, export preset surf the Internet indicate information so that
Obtaining user can be with the real-time network state of the above-mentioned intelligent terminal of timely learning.
Specifically, net state can be gone up when determining that above-mentioned intelligent terminal is currently at, and in the status bar of above-mentioned intelligent terminal
It can not surf the Internet when indicating information, show that above-mentioned surf the Internet indicates information in the status bar of above-mentioned intelligent terminal;It is above-mentioned when determining
Intelligent terminal, which is currently at, can go up net state, and has been displayed and can be surfed the Internet when indicating information in the status bar of above-mentioned intelligent terminal,
Above-mentioned 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 be based on hypertext transfer protocol when indicating network-in-dialing
Network detection is carried out to the intelligent terminal, obtains the second network testing result, the first network detection determined at continuous N2 times
When as a result indicating network-in-dialing and the second network testing result instruction network-in-dialing, determining that the intelligent terminal is currently at can
Upper net state.By combining the network detection mode based on socket and the network detection mode based on hypertext transfer protocol,
The accuracy of network detection can be improved to avoid the situation for leading to testing result inaccuracy using single network detection mode,
In addition, the present invention determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information so that
Obtaining user can be with the network state of the current connected network of timely learning.In addition, the embodiment of the present invention is determined at continuous N1 times
First network testing result indicate network-in-dialing, and do not show to surf the Internet in the status bar of intelligent terminal and indicate information intelligent
Under the connected state of terminal, on the one hand ability further progress HTTP detection can reduce a possibility that judging by accident under the scene, another
Aspect, 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 first network testing result, wherein the first network testing result instruction network is not connected to or network connects
It is logical;
Http detection unit 303, for when the 302 continuous N1 times first network detection determined of the first determination unit
When as a result indicating network-in-dialing, network detection is carried out to the intelligent terminal based on hypertext transfer protocol, obtains the second net
Network testing result, wherein the second network testing result instruction network is not connected to or network-in-dialing, wherein the N1 is not
Natural number less than 1;
Second determination unit 304, for when the 302 continuous N2 times first network detection determined of the first determination unit
When as a result indicating network-in-dialing, and the second network testing result instruction network-in-dialing that the http detection unit obtains
When, net state can be gone up by determining that the intelligent terminal is currently at, wherein the N2 is greater than N1;
Network state indicating unit 305, for when the second determination unit 304 determines that the intelligent terminal is currently at can
When net state, exports preset surf the Internet and indicate information, net state can be gone up to indicate that the intelligent terminal is currently at.
Optionally, network state indicating unit 305 is specifically used for: when the second determination unit 304 determines the intelligent terminal
It is currently at when can go up net state, can surf the Internet described in display in the status bar of the intelligent terminal and indicate information.
Optionally, http detection unit 303 is specifically used for: described in determining for continuous N1 times when the first determination unit 302
First network testing result indicates network-in-dialing, and does not show that described can surf the Internet refers in the current status bar of the intelligent terminal
When showing information, network detection is carried out to the intelligent terminal based on HTTP;Second determination unit 304 is also used to: when first determines
Unit 302 continuous N1 times the first network testing result determined indicates network-in-dialing, and the intelligent terminal is current
Status bar in have been displayed it is described can surf the Internet when indicating information, net state can be gone up by determining that presently described intelligent terminal is currently at.
Optionally, acquiring unit 301 is also used to: the first network testing result determined when continuous N1 times indicates
When network-in-dialing, the connection status of each socket of the intelligent terminal is obtained with preset another period, is obtained with improving
The frequency of the connection status of each socket of the intelligent terminal.
Optionally, http detection unit 303 is specifically used for: described in determining for continuous N1 times when the first determination unit 302
When first network testing result indicates network-in-dialing, HTTP connection request is sent respectively to preset N number of server;When being based on
When any server in above-mentioned HTTP connection request and above-mentioned N number of server is successfully established connection, above-mentioned second network is determined
Testing result is network-in-dialing;When based on above-mentioned HTTP connection request can not with any server in above-mentioned N number of server at
When function establishes connection, determine that above-mentioned second network testing result is that network is not connected to.
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 first network detect
As a result, and the first network testing result determined at continuous N1 times be based on hypertext transfer protocol when indicating network-in-dialing
Network detection is carried out to the intelligent terminal, obtains the second network testing result, the first network detection determined at continuous N2 times
When as a result indicating network-in-dialing and the second network testing result instruction network-in-dialing, determining that the intelligent terminal is currently at can
Upper net state.By combining the network detection mode based on socket and the network detection mode based on hypertext transfer protocol,
The accuracy of network detection can be improved to avoid the situation for leading to testing result inaccuracy using single network detection mode,
In addition, the present invention determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information so that
Obtaining user 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 each socket of acquisition is worked as, determine when secondary first network testing result,
In, the first network testing result instruction network is not connected to or network-in-dialing;
If the continuous N1 first network testing result determined indicates network-in-dialing, it is based on Hyper text transfer
Agreement carries out network detection to the intelligent terminal, obtains the second network testing result, wherein the second network testing result
Instruction network is not connected to or network-in-dialing, wherein the N1 is the natural number not less than 1;
If the continuous N2 first network testing result determined indicates network-in-dialing and second network is examined
It surveys result and indicates network-in-dialing, it is determined that the intelligent terminal, which is currently at, can go up net state, wherein the N2 is greater than N1;
When determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information, with refer to
Net state can be gone up by showing that the intelligent terminal is currently at.
Assuming that above-mentioned is the first possible embodiment, then provided based on the first possible embodiment
Second of possible embodiment in, preset surf the Internet of the output indicates information, comprising:
It can surf the Internet described in display in the status bar of the intelligent terminal and indicate information.
It is described in the third the possible embodiment provided based on above-mentioned second of possible embodiment
If the continuous N1 first network testing result determined indicates network-in-dialing, based on hypertext transfer protocol to institute
It states intelligent terminal and carries out network detection, are as follows:
If the continuous N1 first network testing result determined indicates network-in-dialing, and the intelligent terminal is worked as
It does not show that described can surf the Internet indicates information in preceding status bar, then net is carried out to the intelligent terminal based on hypertext transfer protocol
Network detection;
If the continuous N1 first network testing result determined indicates network-in-dialing, and the intelligent terminal is worked as
Described can surf the Internet has been displayed in preceding status bar and indicates information, it is determined that presently described intelligent terminal be currently at can go up it is netted
State.
In the first above-mentioned possible implementation perhaps above-mentioned second possible implementation or above-mentioned third
In the 4th kind of possible embodiment provided based on the possible implementation of kind, processor 402 passes through operation storage
It is also performed the steps of in the above-mentioned computer program of memory 401
If the continuous N1 first network testing result determined indicates network-in-dialing, with preset another week
Phase obtains the connection status of each socket of the intelligent terminal, obtains each socket of the intelligent terminal with raising
The frequency of connection status.
In the first above-mentioned possible implementation perhaps above-mentioned second possible implementation or above-mentioned third
It is described to be based on hypertext transfer protocol in the 5th kind of possible embodiment provided based on the possible implementation of kind
Network detection is carried out to the intelligent terminal, obtains the second network testing result, comprising:
Hypertext transfer protocol connection request is sent respectively to preset N number of server;
It is successfully established when based on the hypertext transfer protocol connection request and any server in N number of server
When connection, determine that the second network testing result is network-in-dialing;
It can not succeed with any server in N number of server when based on the hypertext transfer protocol connection request
When establishing connection, determine that the second network testing result is that network is not connected to.
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 first network detect
As a result, and the first network testing result determined at continuous N1 times be based on hypertext transfer protocol when indicating network-in-dialing
Network detection is carried out to the intelligent terminal, obtains the second network testing result, the first network detection determined at continuous N2 times
When as a result indicating network-in-dialing and the second network testing result instruction network-in-dialing, determining that the intelligent terminal is currently at can
Upper net state.By combining the network detection mode based on socket and the network detection mode based on hypertext transfer protocol,
The accuracy of network detection can be improved to avoid the situation for leading to testing result inaccuracy using single network detection mode,
In addition, the present invention determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information so that
Obtaining user 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 (9)
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 first network testing result, wherein institute
First network testing result instruction network is stated not to be connected to or network-in-dialing;
If the continuous N1 first network testing result determined indicates network-in-dialing, obtained with preset another period
The connection status of each socket of the intelligent terminal is taken, to improve the connection for each socket for obtaining the intelligent terminal
The frequency of state, and network detection is carried out to the intelligent terminal based on hypertext transfer protocol, obtain the second network detection knot
Fruit, to obtain N2-N1 first network testing result again in the period that closes on for obtaining the second network testing result,
In, the second network testing result instruction network is not connected to or network-in-dialing, wherein and the N1 is the natural number not less than 1,
The N2 is greater than N1;
If the continuous N2 first network testing result determined indicates network-in-dialing and second network detection knot
Fruit indicates network-in-dialing, it is determined that the intelligent terminal, which is currently at, can go up net state;
When determine the intelligent terminal be currently at can go up net state when, export preset surf the Internet indicate information, to indicate
Net state can be gone up by stating intelligent terminal and being currently at.
2. network detecting method according to claim 1, which is characterized in that the preset instruction letter of surfing the Internet of the output
Breath, comprising:
It can surf the Internet described in display in the status bar of the intelligent terminal and indicate information.
3. network detecting method according to claim 2, which is characterized in that if determine for described continuous N1 times described the
One network testing result indicates network-in-dialing, then carries out network detection to the intelligent terminal based on hypertext transfer protocol,
Are as follows:
If the continuous N1 first network testing result determined indicate network-in-dialing, and the intelligent terminal is currently
It does not show that described can surf the Internet indicates information in status bar, then network inspection is carried out to the intelligent terminal based on hypertext transfer protocol
It surveys;
If the continuous N1 first network testing result determined indicate network-in-dialing, and the intelligent terminal is currently
Described can surf the Internet has been displayed in status bar and indicates information, it is determined that presently described intelligent terminal, which is currently at, can go up net state.
4. network detecting method according to any one of claims 1 to 3, which is characterized in that described to be based on Hyper text transfer
Agreement carries out network detection to the intelligent terminal, obtains the second network testing result, comprising:
Hypertext transfer protocol connection request is sent respectively to preset N number of server;
It is connect when being successfully established based on the hypertext transfer protocol connection request with any server in N number of server
When, determine that the second network testing result is network-in-dialing;
It can not be successfully established with any server in N number of server when based on the hypertext transfer protocol connection request
When connection, determine that the second network testing result is that network is not connected to.
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 first network testing result, wherein the first network testing result instruction network is not connected to or network-in-dialing;
Http detection unit, it is equal for working as the first determination unit continuous N1 times first network testing result determined
When indicating network-in-dialing, the connection status of each socket of the intelligent terminal is obtained with preset another period, to improve
The frequency of the connection status of each socket of the intelligent terminal is obtained, and whole to the intelligence based on hypertext transfer protocol
End carries out network detection, obtains the second network testing result, to close on the period again in the second network testing result of acquisition
N2-N1 first network testing result of secondary acquisition, wherein the second network testing result instruction network is not connected to or network connects
It is logical, wherein the N1 is the natural number not less than 1, and the N2 is greater than N1;
Second determination unit, it is equal for working as the first determination unit continuous N2 times first network testing result determined
Indicate network-in-dialing when, and the http detection unit obtain the second network testing result instruction network-in-dialing when, really
The fixed intelligent terminal, which is currently at, can go up net state;
Network state indicating unit, for net state can be gone up when second determination unit determines that the intelligent terminal is currently at
When, it exports preset surf the Internet and indicates information, net state can be gone up to indicate that the intelligent terminal is currently at.
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 go up net state when, in the shape of the intelligent terminal
It can surf the Internet described in display in state column and indicate information.
7. network detection device according to claim 6, which is characterized in that
The http detection unit is specifically used for: the first network inspection determined when first determination unit continuous N1 times
Survey result and indicate network-in-dialing, and do not shown in the current status bar of the intelligent terminal it is described can surf the Internet when indicating information,
Network detection is carried out to the intelligent terminal based on hypertext transfer protocol;
Second determination unit is also used to: the first network detection determined when first determination unit continuous N1 times
As a result indicate network-in-dialing, and had been displayed in the current status bar of the intelligent terminal it is described can surf the Internet when indicating information, really
Fixed presently described intelligent terminal, which is currently at, can go up net state.
8. 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.
9. 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.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710632877.6A CN107360059B (en) | 2017-07-28 | 2017-07-28 | Network detecting method, network detection device and intelligent terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710632877.6A CN107360059B (en) | 2017-07-28 | 2017-07-28 | Network detecting method, network detection device and intelligent terminal |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107360059A CN107360059A (en) | 2017-11-17 |
CN107360059B true CN107360059B (en) | 2019-03-01 |
Family
ID=60286393
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710632877.6A Active CN107360059B (en) | 2017-07-28 | 2017-07-28 | Network detecting method, network detection device and intelligent terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107360059B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114338461A (en) * | 2021-12-30 | 2022-04-12 | 武汉斗鱼鱼乐网络科技有限公司 | Network connection monitoring method and related equipment |
CN114826750B (en) * | 2022-04-29 | 2024-02-06 | 阿里巴巴(中国)有限公司 | Network anomaly detection method, server cluster and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101202704A (en) * | 2007-09-07 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Method and system for transmitting data |
CN103067777A (en) * | 2012-12-24 | 2013-04-24 | 深圳Tcl新技术有限公司 | Method and device of prompting of network state |
CN104579842A (en) * | 2015-01-12 | 2015-04-29 | 浪潮电子信息产业股份有限公司 | Processing method for acquiring cluster monitoring computing node state based on socket communication |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104244290B (en) * | 2014-09-27 | 2018-04-17 | 昆明钢铁集团有限责任公司 | A kind of controllable IOS Intranet accessible detecting System and method fors of time |
CN106714206B (en) * | 2016-09-29 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Method and device for detecting wireless network access point connecting network |
-
2017
- 2017-07-28 CN CN201710632877.6A patent/CN107360059B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101202704A (en) * | 2007-09-07 | 2008-06-18 | 深圳市同洲电子股份有限公司 | Method and system for transmitting data |
CN103067777A (en) * | 2012-12-24 | 2013-04-24 | 深圳Tcl新技术有限公司 | Method and device of prompting of network state |
CN104579842A (en) * | 2015-01-12 | 2015-04-29 | 浪潮电子信息产业股份有限公司 | Processing method for acquiring cluster monitoring computing node state based on socket communication |
Also Published As
Publication number | Publication date |
---|---|
CN107360059A (en) | 2017-11-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107231647B (en) | Network detecting method, network detection device and intelligent terminal | |
CN107332739B (en) | Network detecting method, network detection device and intelligent terminal | |
TWI672027B (en) | Data processing method, device and system in webpage | |
CN108566312A (en) | Off-line checking method, device and computer readable storage medium | |
CN107333287B (en) | Network detecting method, network detection device and intelligent terminal | |
CN102904794A (en) | Method and device for mapping virtual network | |
CN110134711A (en) | Processing method, device, equipment and the computer readable storage medium of big data | |
CN107276856B (en) | Network detecting method, network detection device and intelligent terminal | |
CN109167699A (en) | The method and apparatus for handling the state of the node of block chain | |
CN107360059B (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 | |
CN107332741B (en) | A kind of network detecting method, network detection device and intelligent terminal | |
CN107294812B (en) | Network detecting method, network detection device and intelligent terminal | |
CN103345432A (en) | Multi-core CPU overload detection device and multi-core CPU overload detection method | |
CN108520043A (en) | Data object acquisition method, apparatus and system, computer readable storage medium | |
CN107241758A (en) | Network control method, network control unit and intelligent terminal | |
CN111147330A (en) | Network quality evaluation method and device, storage medium and processor | |
CN112367215B (en) | Network traffic protocol identification method and device based on machine learning | |
CN111786898B (en) | Monitoring equipment information acquisition method, device, equipment and medium | |
CN107038053A (en) | A kind of statistical method, device and mobile terminal for loading Web page picture | |
CN109991967A (en) | A kind of control method of robot motion, system and terminal device | |
CN103631944A (en) | Webpage dividing method based on content similarity | |
CN106897208A (en) | A kind of quantization method and device of application software Consumer's Experience | |
CN109361674A (en) | Bypass stream data detection method, device and the electronic equipment of access |
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 | ||
CB02 | Change of applicant information |
Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant after: OPPO Guangdong Mobile Communications Co., Ltd. Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong Applicant before: Guangdong OPPO Mobile Communications Co., Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant |