CN107332741A - A kind of network detecting method, network detection means and intelligent terminal - Google Patents

A kind of network detecting method, network detection means and intelligent terminal Download PDF

Info

Publication number
CN107332741A
CN107332741A CN201710740270.XA CN201710740270A CN107332741A CN 107332741 A CN107332741 A CN 107332741A CN 201710740270 A CN201710740270 A CN 201710740270A CN 107332741 A CN107332741 A CN 107332741A
Authority
CN
China
Prior art keywords
network
tcp
http
wlan
intelligent terminal
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.)
Granted
Application number
CN201710740270.XA
Other languages
Chinese (zh)
Other versions
CN107332741B (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 CN201710740270.XA priority Critical patent/CN107332741B/en
Publication of CN107332741A publication Critical patent/CN107332741A/en
Application granted granted Critical
Publication of CN107332741B publication Critical patent/CN107332741B/en
Active 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/50Testing arrangements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]
    • H04L69/161Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields
    • H04L69/162Implementation details of TCP/IP or UDP/IP stack architecture; Specification of modified or new header fields involving adaptations of sockets based mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/24Negotiation of communication capabilities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Abstract

The invention discloses a kind of network detecting method, network detection means, intelligent terminal and computer-readable recording medium, wherein, the network detecting method includes:After intelligent terminal access WLAN, while starting HTTP HTTP detections and transmission control protocol TCP detection;The HTTP is detected as:HTTP connection requests are sent to default first server by the WLAN, HTTP testing results are obtained according to the connection state of the intelligent terminal and the first server;The TCP is detected as:The TCP state of the intelligent terminal current network connection is periodically detected, TCP testing results are obtained according to the TCP state;In default detection time, the TCP testing results obtained by HTTP testing results and/or this TCP detections obtained by being detected based on this HTTP determine that the WLAN that the intelligent terminal is currently accessed is can surf the Net network or the network that can not surf the Net.The present invention program improves the efficiency of the network state of detection WLAN.

Description

A kind of network detecting method, network detection means and intelligent terminal
Technical field
The invention belongs to net application technology field, more particularly to a kind of network detecting method, network detection means, intelligence Terminal and computer-readable recording medium.
Background technology
With the fast development of mechanics of communication, wireless network, particularly WLAN (Wireless Local Area Net, WLAN) various aspects are obtained for extensive use in life.Because WLAN need not be connected up, and transmission speed Comparatively fast, it is thus possible to make up the deficiency of limited LAN well.And current almost all of intelligent terminal is all supported by nothing Line fidelity (Wireless Fidelity, Wi-Fi) accesses the focus (Hotspot) of WLAN to realize function of surfing the Net.
However, the focus that many public places are provided is web authentication focus, user needs after access web authentication focus Input authentication information, could access internet;The focus that also some public places are provided is because the number of visiting people is excessive so that user The speed for accessing internet is excessively slow, or even can not access internet.Which results under many circumstances, because user can not be known The state of focus, and be unaware of intelligent terminal access focus after still cannot get online, waste the time of user.
The content of the invention
In view of this, can the invention provides a kind of network detecting method, network detection means, intelligent terminal and computer Read storage medium, it is intended to know the network state for the WLAN being currently accessed in time, improve the wireless office to being currently accessed The speed and efficiency of the network detection of domain net.
First aspect present invention provides a kind of network detecting method, and above-mentioned network detecting method includes:
After intelligent terminal access WLAN, while starting HTTP HTTP detections and passing transport control protocol Discuss TCP detections;
Above-mentioned HTTP is detected as:HTTP connection requests are sent to default first server by above-mentioned WLAN, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server;
Above-mentioned TCP is detected as:The TCP state of above-mentioned intelligent terminal current network connection is periodically detected, according to above-mentioned TCP State obtains TCP testing results;
In default detection time, HTTP testing results and/or this TCP inspections obtained by being detected based on this HTTP TCP testing results obtained by surveying determine WLAN that above-mentioned intelligent terminal is currently accessed for can surf the Net network or can not on Net network.
Second aspect of the present invention provides a kind of network detection means, and above-mentioned network detection means includes:
Detection unit, for after intelligent terminal access WLAN, while starting HTTP HTTP inspections Survey and transmission control protocol TCP detection;
Determining unit, in default detection time, resulting HTTP testing results to be detected based on this HTTP And/or the TCP testing results obtained by this TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can on Net network or the network that can not surf the Net;
Wherein, above-mentioned detection unit includes:
HTTP detection units, please for sending HTTP connections to default first server by above-mentioned WLAN Ask, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server;
TCP detection units, the TCP state for being periodically detected above-mentioned intelligent terminal current network connection, according to above-mentioned TCP state obtains TCP testing results.
Third aspect present invention provides a kind of intelligent terminal, including memory, processor and stores on a memory simultaneously The computer program that can be run on a processor, is realized during above-mentioned computing device above computer program in above-mentioned first aspect The network detecting method referred to.
Fourth aspect present invention is provided to be stored with a kind of computer-readable recording medium, the computer-readable recording medium Computer program, above computer program realizes the network detecting method referred in above-mentioned first aspect when being executed by processor.
Therefore, in the present invention program, after intelligent terminal access WLAN, while starting Hyper text transfer Agreement HTTP is detected and transmission control protocol TCP is detected, wherein, above-mentioned HTTP is detected as:By above-mentioned WLAN to pre- If first server send HTTP connection requests, obtained according to above-mentioned intelligent terminal and the connection state of above-mentioned first server HTTP testing results, above-mentioned TCP is detected as:The TCP state of above-mentioned intelligent terminal current network connection is periodically detected, according to upper State TCP state and obtain TCP testing results, then in default detection time, the HTTP obtained by being detected based on this HTTP TCP testing results obtained by testing result and/or this TCP detections determine the wireless local that above-mentioned intelligent terminal is currently accessed Net is can surf the Net network or the network that can not surf the Net.After intelligent terminal access WLAN, due to being in WLAN When under heterogeneous networks state, it is different to obtain the time used in the result of HTTP detections and TCP detections, thus the present invention program pass through it is same Shi Jinhang HTTP are detected and TCP detections, are capable of the network state of the WLAN for knowing intelligent terminal access of prestissimo, Reduce the stand-by period of user, it is to avoid the WLAN for intelligent terminal access occur can not surf the Net, and user is unwitting Situation.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art In required for the accompanying drawing that uses be briefly described, it should be apparent that, drawings in the following description are only some of the present invention Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these Accompanying drawing obtains other accompanying drawings.
Fig. 1 is network detecting method one embodiment implementation process schematic diagram that the present invention is provided;
Fig. 2 be in the network detecting method step 101 that provides of the present invention HTTP detect implement schematic flow sheet;
Fig. 3 be in the network detecting method step 101 that provides of the present invention TCP detect implement schematic flow sheet;
Fig. 4 is network detecting method another embodiment implementation process schematic diagram that the present invention is provided;
Fig. 5 is network detection means one embodiment structural representation that the present invention is provided;
Fig. 6 is intelligent terminal one embodiment structural representation that the present invention is provided.
Embodiment
In describing below, in order to illustrate rather than in order to limit, it is proposed that such as tool of particular system structure, technology etc Body details, thoroughly to understand 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 can also be realized in the other embodiments of details.In other situations, omit to well-known system, device, electricity Road and the detailed description of method, in case unnecessary details hinders description of the invention.
In order to illustrate the technical solution of the present invention, illustrated below by specific embodiment.
Embodiment one
A kind of network detecting method provided in an embodiment of the present invention is described below, referring to Fig. 1, the present invention is implemented Network detecting method in example includes:
In a step 101, after intelligent terminal access WLAN, while starting HTTP HTTP detections And transmission control protocol TCP detection;
In embodiments of the present invention, above-mentioned intelligent terminal access WLAN can be intelligent terminal for reception user The link order of input, and the WLAN based on determined by above-mentioned link order accesses above-mentioned link order, or, also may be used To be the WLAN that can be accessed under intelligent terminal active scan current environment under the Wi-Fi mode of intelligent terminal, And any WLAN that intelligent terminal can be accessed under current environment is actively accessed by intelligent terminal, wherein, it is above-mentioned by intelligence Any WLAN that energy terminal actively accesses intelligent terminal under current environment and can accessed can be accessed under current environment A WLAN being randomly assigned under a signal most strong WLAN or access current environment, may be used also To be to access above-mentioned intelligent terminal under current environment once to access a most WLAN of number of times, it is not construed as limiting herein. Intelligent terminal access WLAN after, can immediately or wait certain time triggering intelligent terminal simultaneously start HTTP detection And TCP detections;Wherein, above-mentioned HTTP is detected as:HTTP is sent by above-mentioned WLAN to default first server to connect Request is connect, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server;Above-mentioned TCP detections For:The TCP state of above-mentioned intelligent terminal current network connection is periodically detected, TCP detection knots are obtained according to above-mentioned TCP state Really.
Further, Fig. 2 shows that what HTTP in step 101 detected implements flow, and details are as follows:
In step 201, HTTP is sent to default first server by above-mentioned WLAN HTTP connection requests;
In step 202., if with above-mentioned first server successful connection, it is determined that this HTTP testing result is connects into Work(;
In step 203, if with above-mentioned first server connection failure, in the HTTP state values determination that basis is received Whether state WLAN is certification network;
Alternatively, the HTTP state values that above-mentioned basis is received determine whether above-mentioned WLAN is certification network, tool Body includes:After it have sent HTTP connection requests to above-mentioned first server, the HTTP state values received are consulted;If Above-mentioned HTTP state values are indicated during above-mentioned first server is connected, asking access with above-mentioned first server The URL (Uniform Resource Locator, URL) of association is redirected, then further detection is redirected Whether the page associated by URL afterwards includes default keyword, the keyword such as " user name ", " login name ", " password "; If the page associated by URL after redirecting includes default keyword, it is determined that above-mentioned WLAN is certification network.When So, it can also detect whether above-mentioned WLAN is certification network, is not construed as limiting herein otherwise.It should be noted , what above-mentioned default keyword was merely exemplary.
In step 204, however, it is determined that above-mentioned WLAN is certification network, it is determined that this HTTP testing result is company Receive limit;
In step 205, however, it is determined that above-mentioned WLAN is not certification network, it is determined that this HTTP testing result is Connection failure.
Alternatively, it is contemplated that the reason for above-mentioned first server connection failure may not be above-mentioned WLAN, and The reason for being above-mentioned first server itself, in step 201, in addition to sending HTTP connection requests to first server, Can also be by way of multi-thread concurrent to default second server transmission HTTP connection requests;If with above-mentioned first service Device and/or above-mentioned second server successful connection, it is determined that this HTTP testing result is successful connection;If with the above-mentioned first clothes Business device and second server are all connected with failure, then perform again and determine that above-mentioned WLAN is according to the HTTP state values received It is no be certification network the step for and subsequent step.
Further, Fig. 3 shows that what TCP in step 101 detected implements flow, and details are as follows:
In step 301, socket Socket all in the kernel of current above-mentioned intelligent terminal ginseng is periodically obtained Number information;
In embodiments of the present invention, when being periodically detected the TCP state of current network connection, first from intelligent terminal In kernel, the parameter information for all Socket that there is currently periodically is obtained.Specifically, for any Socket, The Socket obtained in step 201 parameter information includes but is not limited to state (state) information, retransmission time out (Retransmission Time-Out, rto) information, round-trip delay (Round-Trip Time, rtt) information, response timeout (ACKnowledge Time-Out, ato) information.
Alternatively, above-mentioned steps 301 are specially:
It whether there is Socket in the kernel of the current above-mentioned intelligent terminal of detection;
If Socket is not present in the kernel of current above-mentioned intelligent terminal, it is determined that the TCP state of current network connection is Connection failure;
If there is Socket in the kernel of current above-mentioned intelligent terminal, the interior of current above-mentioned intelligent terminal is periodically obtained All Socket parameter information in core.
Wherein, once intelligent terminal has accessed WLAN, then can detect in the kernel of current intelligent terminal whether There is Socket.Because when intelligent terminal is in the state that can be surfed the Net, the system background of most intelligent terminals can be created actively Build Socket and carry out TCP connections, therefore, it is possible to by the quantity of the Socket in kernel, primarily determine that and currently whether there is TCP Connection.If Socket is not present in the kernel of above-mentioned intelligent terminal, mean current also in the absence of chain corresponding with Socket Road, i.e. there is currently no TCP connections, therefore, it is possible to which the TCP state for determining current network connection is connection failure;And current When there is Socket in kernel, then current each Socket parameter information can be periodically obtained.
In step 302, the parameter information based on each Socket, judges the class of link corresponding with each Socket respectively Type;
In embodiments of the present invention, the parameter information based on each Socket in kernel, judges and each Socket pairs respectively The Linktype answered.Specifically, above-mentioned Linktype includes the poor link of network, and network limited link does not use link, do not closed Closed chain road.Wherein, if Socket state parameters are not TCP_SYN_SENT, and rtt parameters are more than default rtt threshold values (ratio As 10000000), and when there is the packet retransmitted or the packet not responded in link corresponding with the Socket, it is determined that Link corresponding with the Socket is the poor link of network;If Socket state parameters be TCP_SYN_SENT, and with this When the corresponding link last time transmission packet times of Socket are equal with the last time received data packet time, it is determined that with The corresponding links of the Socket are network limited link;If Socket corresponding links last time sends packet time, most A received data packet time and last time reception response (Acknowledge, ACK) time are all higher than default cycle threshold afterwards During value, it is determined that link corresponding with the Socket is not use link;If Socket state parameters are not TCP_ CLOSE_WAIT, it is determined that link corresponding with the Socket is to be not turned off link.It should be noted that allowing a Socket institutes The type for the link that corresponding link belongs to more than above two simultaneously, is not construed as limiting, for example, network limited link is inevitable herein To be not turned off link, then a link for network limited link and can be not turned off link simultaneously.
In step 303, according to the quantitative relation between different types of link, the TCP shapes of current network connection are determined State;
In embodiments of the present invention, according to the quantitative relation between the link of each type obtained in step 202, it is determined that The TCP state of current network connection.It is alternatively possible to which whether the TCP state for determining current network connection first is successful connection; If the TCP state of current network connection is not successful connection, whether the TCP state for continuing to detect current network connection is connection Failure;If the TCP state of current network connection is not connection failure, the TCP state for being further continued for detecting current network connection is It is no to be limited for connection.Specifically, it is determined that current network connection TCP state whether be successful connection before, can first count The quantity of the not good link of network, wherein, the quantity of the not good link of above-mentioned network is the poor chain of quantity and network of network limited link The quantity sum on road.
Wherein, whether the TCP state of above-mentioned determination current network connection is successful connection, is specially:
If the first ratio is not more than default fractional threshold C1, and the second ratio is not more than default fractional threshold D1, then Determine current network connection TCP state be successful connection, wherein, above-mentioned first ratio for the not good link of network quantity with not The ratio of the quantity of link is closed, above-mentioned second ratio is the ratio for the quantity for not using the quantity of link and being not turned off link Value, above-mentioned C1, D1 value can voluntarily be set by developer or user, is not construed as limiting herein.
Wherein, after above-mentioned TCP state is determined for successful connection, the TCP state of above-mentioned determination current network connection Whether it is connection failure, is specially:
If above-mentioned first ratio is not less than default fractional threshold C2, and above-mentioned second ratio is not less than default ratio threshold Value D2, and the 3rd ratio is not less than default fractional threshold E2, it is determined that the TCP state of current network connection is connection failure, Wherein, above-mentioned 3rd ratio is the quantity of network limited link and is not turned off the ratio of the quantity of link, above-mentioned C2, D2, E2's Value can voluntarily be set by developer or user, be not construed as limiting herein.
Wherein, after above-mentioned TCP state is determined for connection failure, the TCP state of above-mentioned determination current network connection Whether it is even limited, is specially:
If above-mentioned first ratio is not less than default fractional threshold C3, and above-mentioned second ratio is not less than default ratio threshold Value D3, and the 3rd ratio is not less than default fractional threshold E3, it is determined that the TCP state of current network connection is connection failure, Wherein, above-mentioned fractional threshold C3 is different from above-mentioned fractional threshold C2, and above-mentioned fractional threshold D3 is different from above-mentioned fractional threshold D2, on Fractional threshold E3 is stated different from above-mentioned fractional threshold E2, above-mentioned C3, D3, E3 value can voluntarily be set by developer or user Put, be not construed as limiting herein.
In step 304, if determining for continuous N1 times, above-mentioned TCP state is successful connection, it is determined that this TCP testing result For successful connection;
In embodiments of the present invention, once the above-mentioned TCP state of continuous N1 determination is successful connection in step 303, then really This fixed TCP testing result is successful connection, and stops performing the above-mentioned current all socket Socket's of periodicity acquisition The step of parameter information, it is to avoid waste the operation resource of intelligent terminal.
In step 305, if determining for continuous N2 times, above-mentioned TCP state is connection failure, it is determined that this TCP testing result For connection failure;
Within step 306, if continuous N3 times determines that above-mentioned TCP state is limited for connection, it is determined that this TCP testing result It is limited for connection;
In embodiments of the present invention, when above-mentioned TCP state for it is network limited when, it is meant that the now net residing for intelligent terminal Network is restricted network, i.e. the WLAN that now intelligent terminal is connected is likely to certification network.Therefore, once It is the limited state of connection to detect above-mentioned TCP state, then exports reminder message at once, to point out user to carry out authentication. Above-mentioned reminder message can be exported in the way of audio, can also the mode of word export, be not construed as limiting herein.
Alternatively, above-mentioned N1 is less than above-mentioned N2, and above-mentioned N2 is less than above-mentioned N3.Due to obtaining the time phase of TCP state every time Together, enable to when the network connection state of above-mentioned WLAN is good, in a short time can be by detecting current net The TCP state of network connection quickly determines above-mentioned WLAN for the network that can surf the Net;In the network connection of above-mentioned WLAN When being not in good state, by the detection of the TCP state slightly connected for a long time to current network, it is to avoid to the net of above-mentioned WLAN Network connection status makes false judgment;And when above-mentioned WLAN is restricted network, needed due to being authenticated operation The regular hour is expended, in order to be set apart to user, higher value can be taken to above-mentioned N3, therefore N3 can be made to be more than herein N2。
In a step 102, in default detection time, the HTTP testing results obtained by being detected based on this HTTP And/or the TCP testing results obtained by this TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can on Net network or the network that can not surf the Net.
In embodiments of the present invention, above-mentioned steps 102 are shown as:If the HTTP testing results obtained by this HTTP detections For successful connection, it is determined that the WLAN that above-mentioned intelligent terminal is currently accessed is the network that can surf the Net;If this TCP detects institute Obtained TCP testing results are connection failure, or, if HTTP testing results and this TCP obtained by this HTTP detections TCP testing results obtained by detection are that connection is limited, it is determined that the WLAN that above-mentioned intelligent terminal is currently accessed is Can not be surfed the Net network.In fact, if intelligent terminal can be surfed the Net by above-mentioned WLAN, the speed of HTTP detections is usual It is faster than the speed of TCP detections, i.e., before TCP testing results are obtained, is just had been able to really by obtained HTTP testing results The WLAN that fixed above-mentioned intelligent terminal is currently accessed is the network that can surf the Net, also, is the net that can surf the Net when WLAN During network, HTTP testing results can generally be obtained within the default very first time;It is corresponding, in above-mentioned WLAN not In the case of for certification network, if intelligent terminal can not be surfed the Net by above-mentioned WLAN, the speed of TCP detections is usual It is faster than the speed of HTTP detections, i.e., before HTTP testing results are obtained, is just had been able to really by obtained TCP testing results The WLAN that fixed above-mentioned intelligent terminal is currently accessed is the network that can not surf the Net, also, when WLAN for can not on During net network, TCP testing results can generally be obtained within default second time;Therefore in this step, due to HTTP inspections The speed of successful connection is surveyed, TCP detects the speed of connection failure, detected by combining HTTP detections and TCP, can The quick WLAN for determining that intelligent terminal is currently accessed is can not surf the Net network or the network that can not surf the Net.Further, by It is complex relative to the state of connection failure and the state of successful connection in the limited state of connection, in order to improve network detection Accuracy rate, only HTTP testing results and TCP testing results be connection by limited time, just determine that above-mentioned intelligent terminal currently connects The WLAN entered is the network that can not surf the Net.
Alternatively, obtained by the above-mentioned detection based on this HTTP HTTP testing results and/or this TCP detections is resulting TCP testing results determine WLAN that above-mentioned intelligent terminal is currently accessed for can surf the Net network or can not surf the Net network it Afterwards, or, above-mentioned detection time arrival after, above-mentioned network detecting method also includes:
If this TCP is detected and/or this HTTP is detected still in operation, stop this TCP and detect and/or this HTTP is detected.
Wherein, slightly larger than the one time HTTP detection of above-mentioned default detection time or a TCP detection normally expend most For a long time.Once have determined that whether above-mentioned WLAN can surf the Net, in order to save the operation resource of intelligent terminal, it is to avoid Intelligent terminal performs unnecessary network detection operation, when this TCP is detected and/or this HTTP is detected still in operation, Stop this TCP detections and/or this HTTP detections.Further, if after the arrival of above-mentioned detection time, not determining yet above-mentioned Whether the WLAN that intelligent terminal is currently accessed can surf the Net, then is probably during HTTP detections and/or TCP detections This network detection time-out caused by there is a problem, now, if this TCP detections and/or this HTTP detections are still in fortune In row, similarly stop this TCP detections and/or this HTTP detections, and wait certain time to trigger under intelligent terminal startup Secondary HTTP detections and TCP detections.
Therefore, by the embodiment of the present invention, after intelligent terminal access WLAN, due in WLAN When under heterogeneous networks state, time difference used in the result of HTTP detections and TCP detections is obtained, thus passes through progress simultaneously HTTP is detected and TCP detections, is capable of the network state for knowing WLAN of prestissimo, is reduced the stand-by period of user, Avoiding the occurrence of the WLAN of intelligent terminal access can not surf the Net, and the unwitting situation of user.
It should be understood that the size of the sequence number of each step is not meant to the priority of execution sequence, each process in above-described embodiment Execution sequence should determine that the implementation process without tackling the embodiment of the present invention constitutes any limit with its function and internal logic It is fixed.
Embodiment two
On the basis of embodiment one, another network detecting method provided in an embodiment of the present invention is retouched below State, referring to Fig. 4, the network detecting method in the embodiment of the present invention includes:
In step 401, after intelligent terminal access WLAN, while starting HTTP HTTP detections And transmission control protocol TCP detection;
In embodiments of the present invention, above-mentioned steps 401 are identical with above-mentioned steps 101, for details, reference can be made to the correlation of step 101 Description, will not be repeated here.
In step 402, in default detection time, the HTTP testing results obtained by being detected based on this HTTP And/or the TCP testing results obtained by this TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can on Net network or the network that can not surf the Net;
In embodiments of the present invention, above-mentioned steps 402 are identical with above-mentioned steps 102, for details, reference can be made to the correlation of step 102 Description, will not be repeated here.
In step 403, if above-mentioned WLAN is confirmed as the network that can not surf the Net, disconnect above-mentioned intelligent terminal with The connection of above-mentioned WLAN;
In embodiments of the present invention, because above-mentioned WLAN has been confirmed as the network that can not surf the Net, if intelligent terminal Still keep accessing above-mentioned WLAN, then can give tacit consent to using the WLAN of access to carry out network access, and currently connect The WLAN entered can not be actually attached with outer net again, and this can be brought to user using upper inconvenience, influence The operability of intelligent terminal.In order to avoid it is above-mentioned the occurrence of, be confirmed as the net that can not surf the Net in above-mentioned WLAN After network, the connection of above-mentioned intelligent terminal and above-mentioned WLAN is disconnected, it is to avoid brought to user and accessed wireless local Net still can not but access the doubt of outer net.Disconnect with after the connection of above-mentioned WLAN, can in the way of word or The mode active warning user of person's audio is not good due to the network state of current wireless Local Area Network, intelligent terminal it is already off with it is upper State the connection of WLAN.
Alternatively, if above-mentioned WLAN is confirmed as the network that can not surf the Net, above-mentioned network detecting method also includes:
Within the default disabling time, above-mentioned WLAN is disabled.
Wherein, because above-mentioned WLAN has been determined the network that can not surf the Net, in order to avoid intelligent terminal is manual Disconnect or automatic disconnection with automatically accessing above-mentioned WLAN again after the connection of above-mentioned WLAN, can be default In the disabling time, above-mentioned WLAN is disabled, and record the disabled number of times of above-mentioned WLAN.Alternatively, it is above-mentioned pre- If the disabling time can be intelligent terminal set a definite value, such as five minutes, be not construed as limiting herein.
Alternatively, above-mentioned within the default disabling time, disabling above-mentioned WLAN includes:
Obtain the disabled number of times of the above-mentioned WLAN of current record;
The disabling time of above-mentioned WLAN is set according to the disabled number of times of the above-mentioned WLAN of current record;
Within the disabling time of above-mentioned WLAN, above-mentioned WLAN is disabled;
Update the disabled number of times of the above-mentioned WLAN of current record.
Wherein, the number of times direct proportionality that the above-mentioned disabling time can be disabled with above-mentioned WLAN.For example, right In a certain WLAN A, when first time disabling WLAN A, the disabling time is 5 minutes;Should in second of disabling During WLAN A, the disabling time is 10 minutes;When third time disables WLAN A, the disabling time is 15 minutes, That is, the disabling time of the WLAN is incremented by with being incremented by for the disabling number of times of the WLAN.It should be noted It is, what the above-mentioned disabling time was merely exemplary, in actual applications, the above-mentioned disabling time can enter according to the demand of user Row change, is not construed as limiting herein.Also, when WLAN is disabled, its corresponding disabled number of times can also be obtained Update.
Alternatively, in order to improve the efficiency that user manually selects WLAN, above-mentioned network detecting method also includes:
In WLAN alternate list, show that each attachable WLAN is once accessed by above-mentioned intelligent terminal Number of times and the number of times that is once disabled by above-mentioned intelligent terminal.
Wherein, it is each due to generally only being shown in WLAN alternate list when user connects WLAN manually The signal intensity of WLAN so that the signal that user has also only taken into account WLAN when selecting WLAN is strong Degree, and whether the WLAN that have ignored selection can carry out network access.In fact, nothing open in many public places The focus of line LAN, although the signal intensity of focus is stronger, but because the number of access is excessively or due to the nothing of the focus Line LAN is certification network, and function of surfing the Net can not be realized at all by causing intelligent terminal to access after the WLAN.In order to Enable each WLAN live network connection status before user manually selects network for known to user, Ke Yi In WLAN alternate list, number of times that each attachable WLAN once accessed by above-mentioned intelligent terminal and once is shown The number of times disabled by above-mentioned intelligent terminal, wherein, the above-mentioned attachable current intelligent terminal of WLAN is not accessed also WLAN.If for example, there are tri- attachable WLANs of A, B, C, A total connection in WLAN list Number of times is 10 times, and disabled number of times is 8 times, and signal intensity is strong;B total connection number of times is 5 times, and disabled number of times is 0 time, letter Number intensity is stronger;C total connection number of times is 8 times, and disabled number of times is 3 times, and signal intensity is strong, and above-mentioned total connection number of times is The number of times that WLAN was once accessed by above-mentioned intelligent terminal, above-mentioned disabled number of times is that WLAN was once whole by above-mentioned intelligence Hold the number of times of disabling.Because the history that user directly can know each WLAN by WLAN alternate list is connected Situation, with reference to the signal intensity of each WLAN, selects suitable WLAN to be attached, thus in above-mentioned example In, it is contemplated that the once disabled situation of each focus, user very greatly may selection signal intensity be only stronger wireless local Net B, rather than signal strong WLAN A or C.
Therefore, by the embodiment of the present invention, determine intelligence eventually in the testing result detected by HTTP and TCP is detected After the WLAN being currently accessed is held for the network that can not surf the Net, active is disconnected to the connection of the WLAN with being currently accessed Avoid bringing to user and accessed WLAN and still can not but access the doubt of outer net;It will also disable above-mentioned nothing simultaneously Line LAN for a period of time, to avoid intelligent terminal from mistakenly actively accessing the WLAN that can not be surfed the Net.
Embodiment three
The embodiment of the present invention also provides a kind of network detection means, as shown in figure 5, the network detection in the embodiment of the present invention Device 500 includes:
Detection unit 501, for after intelligent terminal access WLAN, while starting HTTP HTTP Detection and transmission control protocol TCP detection;
Determining unit 502, in default detection time, the HTTP obtained by being detected based on this HTTP to detect knot TCP testing results obtained by fruit and/or this TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can Online network or the network that can not surf the Net;
Wherein, above-mentioned detection unit 501 includes:
HTTP detection units 5011, for sending HTTP connections to default first server by above-mentioned WLAN Request, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server;
TCP detection units 5012, the TCP state for being periodically detected above-mentioned intelligent terminal current network connection, according to Above-mentioned TCP state obtains TCP testing results.
Alternatively, above-mentioned network detection means 500 also includes:
Stop element, for the HTTP testing results obtained by being detected based on this HTTP and/or this TCP detections institute Obtained TCP testing results determine that the WLAN that above-mentioned intelligent terminal is currently accessed is can surf the Net network or the net that can not surf the Net After network, or, after the arrival of above-mentioned detection time, if this TCP detections and/or this HTTP detections are still in operation, Then stop this TCP detections and/or this HTTP detections.
Alternatively, above-mentioned network detection means 500 also includes:
Switching units are connected, for being the network that can not surf the Net when the WLAN that the above-mentioned intelligent terminal of determination is currently accessed When, disconnect the connection of above-mentioned intelligent terminal and above-mentioned WLAN.
Alternatively, above-mentioned network detection means 500 also includes:
WLAN forbidden cell, for when determining WLAN that above-mentioned intelligent terminal is currently accessed for can not During net network, within the default disabling time, above-mentioned WLAN is disabled.
Alternatively, above-mentioned WLAN forbidden cell includes:
Disable number of times and obtain subelement, the disabled number of times of the above-mentioned WLAN for obtaining current record;
The disabling time sets subelement, the number of times setting disabled for the above-mentioned WLAN according to current record State the disabling time of WLAN;
Network disables subelement, within the disabling time of above-mentioned WLAN, disabling above-mentioned WLAN;
Disable number of times and update subelement, the disabled number of times of the above-mentioned WLAN for updating current record.
Alternatively, above-mentioned network detection means 500 also includes:
Alternate list display unit, in WLAN alternate list, showing each attachable wireless local Number of times that net was once accessed by above-mentioned intelligent terminal and the number of times once disabled by above-mentioned intelligent terminal, above-mentioned attachable wireless local Net is the WLAN that current intelligent terminal is not accessed.
Alternatively, above-mentioned determining unit 502, specifically for if HTTP inspection of the above-mentioned HTTP detection units obtained by this Survey result is successful connection, it is determined that the WLAN that above-mentioned intelligent terminal is currently accessed is the network that can surf the Net;
Alternatively, above-mentioned determining unit 502, specifically for if TCP detection of the above-mentioned HTTP detection units obtained by this As a result it is connection failure, or, if HTTP testing result and above-mentioned TCP detection of the above-mentioned HTTP detection units obtained by this are single TCP testing result of the member obtained by this is that connection is limited, it is determined that the WLAN that above-mentioned intelligent terminal is currently accessed For the network that can not surf the Net.
Alternatively, above-mentioned HTTP detection units 5011 include:
HTTP request subelement, please for sending HTTP connections to default first server by above-mentioned WLAN Ask;
HTTP determination subelements, if for above-mentioned first server successful connection, it is determined that this HTTP testing result For successful connection;
HTTP detection sub-units, if for the HTTP states received with above-mentioned first server connection failure, basis Value determines whether above-mentioned WLAN is certification network;
Above-mentioned HTTP determination subelements, if being additionally operable to above-mentioned HTTP detection sub-units determines that above-mentioned WLAN is certification Network, it is determined that this HTTP testing result is limited for connection, if above-mentioned HTTP detection sub-units determine above-mentioned WLAN It is not certification network, it is determined that this HTTP testing result is connection failure.
Alternatively, above-mentioned TCP detection units 5012 include:
Acquisition of information subelement, sockets all in the kernel of current above-mentioned intelligent terminal are obtained for periodicity Socket parameter information;
Link judgment sub-unit, for the parameter information based on each Socket, judges chain corresponding with each Socket respectively The type on road;
TCP state determination subelement, for according to the quantitative relation between different types of link, determining that current network connects The TCP state connect;
TCP determination subelements, if being company for the above-mentioned TCP state of the continuous N1 determination of above-mentioned TCP state determination subelement Work(is connected into, it is determined that this TCP testing result is successful connection, if in the continuous N2 determination of above-mentioned TCP state determination subelement TCP state is stated for connection failure, it is determined that this TCP testing result is connection failure, if above-mentioned TCP state determination subelement connects The above-mentioned TCP state of continuous N3 determination is limited for connection, it is determined that this TCP testing result is limited to connect.
Alternatively, above- mentioned information obtains subelement and included:
It whether there is Socket in quantity detection sub-unit, the kernel for detecting current intelligent terminal;
Subelement is obtained, if there are Socket in the kernel for current intelligent terminal, current intelligence is periodically obtained The parameter information of all Socket in the kernel of energy terminal.
Alternatively, above-mentioned TCP state determination subelement, specifically for detecting current intelligence when above-mentioned quantity detection sub-unit When Socket is not present in the kernel of energy terminal, the TCP state for determining current network connection is connection failure.
Therefore, by the embodiment of the present invention, after intelligent terminal access WLAN, due in WLAN When under heterogeneous networks state, time difference used in the result of HTTP detections and TCP detections, thus network detection means are obtained By carrying out HTTP detections and TCP detections simultaneously, it is capable of the network state for knowing WLAN of prestissimo, reduces user Stand-by period, it is to avoid the WLAN for intelligent terminal access occur can not surf the Net, and the unwitting situation of user.
Example IV
The embodiment of the present invention provides a kind of intelligent terminal, referring to Fig. 6, the intelligent terminal in the embodiment of the present invention includes: Memory 601, one or more processors 602 (one is only shown in Fig. 6) and is stored on memory 601 and can be in processor The computer program of upper operation.Wherein:Memory 601 is used to store software program and module, and processor 602 is deposited by operation The software program and unit in memory 601 are stored up, so that various function application and data processing are performed, it is above-mentioned pre- to obtain If the corresponding resource of event.Specifically, reality when processor 602 is stored in the above computer program of memory 601 by operation Existing following steps:
After intelligent terminal access WLAN, while starting HTTP HTTP detections and passing transport control protocol Discuss TCP detections;
Above-mentioned HTTP is detected as:HTTP connection requests are sent to default first server by above-mentioned WLAN, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server;
Above-mentioned TCP is detected as:The TCP state of above-mentioned intelligent terminal current network connection is periodically detected, according to above-mentioned TCP State obtains TCP testing results;
In default detection time, HTTP testing results and/or this TCP inspections obtained by being detected based on this HTTP TCP testing results obtained by surveying determine WLAN that above-mentioned intelligent terminal is currently accessed for can surf the Net network or can not on Net network.
Assuming that it is above-mentioned be the first possible embodiment, then based on the first above-mentioned possible embodiment and There is provided second of possible embodiment in, it is above-mentioned based on this HTTP detect obtained by HTTP testing results and/or TCP testing results obtained by this TCP detections determine that the WLAN that above-mentioned intelligent terminal is currently accessed is the net that can surf the Net After network or the network that can not surf the Net, or, after the arrival of above-mentioned detection time, processor 602 is stored in storage by operation Following steps are also realized during the above computer program of device 601:
If this TCP is detected and/or this HTTP is detected still in operation, stop this TCP and detect and/or this HTTP is detected.
In the third the possible embodiment provided based on the first above-mentioned possible embodiment, if really The WLAN that fixed above-mentioned intelligent terminal is currently accessed is the network that can not surf the Net, then processor 602 is stored in by operation Following steps are also realized during the above computer program of reservoir 601:
Disconnect the connection of above-mentioned intelligent terminal and above-mentioned WLAN.
In the 4th kind of possible embodiment provided based on the first above-mentioned possible embodiment, if really The WLAN that fixed above-mentioned intelligent terminal is currently accessed is the network that can not surf the Net, then processor 602 is stored in by operation Following steps are also realized during the above computer program of reservoir 601:
Within the default disabling time, above-mentioned WLAN is disabled.
It is above-mentioned in the 5th kind of possible embodiment provided based on above-mentioned 4th kind of possible embodiment Within the default disabling time, above-mentioned WLAN is disabled, including:
Obtain the disabled number of times of the above-mentioned WLAN of current record;
The disabling time of above-mentioned WLAN is set according to the disabled number of times of the above-mentioned WLAN of current record;
Within the disabling time of above-mentioned WLAN, above-mentioned WLAN is disabled;
Update the disabled number of times of the above-mentioned WLAN of current record.
In the 6th kind of possible embodiment provided based on above-mentioned 5th kind of possible embodiment, processing Device 602 also realizes following steps when being stored in the above computer program of memory 601 by operation:
In WLAN alternate list, show that each attachable WLAN is once accessed by above-mentioned intelligent terminal Number of times and the number of times that is once disabled by above-mentioned intelligent terminal, above-mentioned attachable WLAN is that current intelligent terminal is not accessed WLAN.
Based on the first above-mentioned possible embodiment, or above-mentioned second of possible embodiment is used as base Plinth, either based on the third above-mentioned possible embodiment or based on above-mentioned 4th kind of possible embodiment, Either carried based on above-mentioned 5th kind of possible embodiment or based on above-mentioned 6th kind of possible embodiment Supply the 7th kind of possible embodiment in, it is above-mentioned based on this HTTP detect obtained by HTTP testing results and/or this TCP testing results obtained by TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can surf the Net network or Can not be surfed the Net network, including:
If the HTTP testing results obtained by this HTTP detections are successful connection, it is determined that above-mentioned intelligent terminal currently connects The WLAN entered is the network that can surf the Net;
Based on the first above-mentioned possible embodiment, or above-mentioned second of possible embodiment is used as base Plinth, either based on the third above-mentioned possible embodiment or based on above-mentioned 4th kind of possible embodiment, Either carried based on above-mentioned 5th kind of possible embodiment or based on above-mentioned 6th kind of possible embodiment Supply the 8th kind of possible embodiment in, it is above-mentioned based on this HTTP detect obtained by HTTP testing results and/or this TCP testing results obtained by TCP detections determine WLAN that above-mentioned intelligent terminal is currently accessed for can surf the Net network or Can not be surfed the Net network, including:
If the TCP testing results obtained by this TCP detections are connection failure, or, if obtained by this HTTP detections HTTP testing results and this TCP detections obtained by TCP testing results be that connection is limited, it is determined that above-mentioned intelligent terminal The WLAN being currently accessed is the network that can not surf the Net.
Based on the first above-mentioned possible embodiment, or above-mentioned second of possible embodiment is used as base Plinth, either based on the third above-mentioned possible embodiment or based on above-mentioned 4th kind of possible embodiment, Either carried based on above-mentioned 5th kind of possible embodiment or based on above-mentioned 6th kind of possible embodiment In the 9th kind of possible embodiment supplied, send HTTP to default first server above by above-mentioned WLAN and connect Request is connect, HTTP testing results are obtained according to the connection state of above-mentioned intelligent terminal and above-mentioned first server, including:
HTTP connection requests are sent to default first server by above-mentioned WLAN;
If with above-mentioned first server successful connection, it is determined that this HTTP testing result is successful connection;
If with above-mentioned first server connection failure, above-mentioned WLAN is determined according to the HTTP state values received Whether it is certification network;
If it is determined that above-mentioned WLAN is certification network, it is determined that this HTTP testing result is limited for connection;
If it is determined that above-mentioned WLAN is not certification network, it is determined that this HTTP testing result is connection failure.
Based on the first above-mentioned possible embodiment, or above-mentioned second of possible embodiment is used as base Plinth, either based on the third above-mentioned possible embodiment or based on above-mentioned 4th kind of possible embodiment, Either carried based on above-mentioned 5th kind of possible embodiment or based on above-mentioned 6th kind of possible embodiment In the tenth kind of possible embodiment supplied, the above-mentioned TCP state for being periodically detected above-mentioned intelligent terminal current network connection, root TCP testing results are obtained according to above-mentioned TCP state, including:
Periodically obtain socket Socket all in the kernel of current above-mentioned intelligent terminal parameter information;
Based on each Socket parameter information, the type of link corresponding with each Socket is judged respectively;
According to the quantitative relation between different types of link, the TCP state of current network connection is determined;
If continuous N1 times determines that above-mentioned TCP state is successful connection, it is determined that this TCP testing result is successful connection;
If continuous N2 times determines that above-mentioned TCP state is connection failure, it is determined that this TCP testing result is connection failure;
If continuous N3 times determines that above-mentioned TCP state is limited for connection, it is determined that this TCP testing result is limited for connection.
In the tenth a kind of possible embodiment provided based on the above-mentioned ten kind of possible embodiment, on Socket Socket all in the kernel for periodically obtaining current above-mentioned intelligent terminal parameter information is stated, including:
It whether there is Socket in the kernel of the current above-mentioned intelligent terminal of detection;
If there is Socket in the kernel of current above-mentioned intelligent terminal, the interior of current above-mentioned intelligent terminal is periodically obtained All Socket parameter information in core.
In the 12nd kind of possible embodiment provided based on the above-mentioned ten kind of possible embodiment, on Stating network detecting method also includes:
If Socket is not present in the kernel of current above-mentioned intelligent terminal, it is determined that the TCP state of current network connection is Connection failure.
Further, as shown in fig. 6, above-mentioned intelligent terminal may also include:One or more input equipments 603 (only show in Fig. 6 Go out one) and one or more output equipments 604 (one is only shown in Fig. 6).Memory 601, processor 602, input equipment 603 and output equipment 604 connected by bus 605.
It should be appreciated that in embodiments of the present invention, alleged processor 602 can be CPU (Central Processing Unit, CPU), the processor can also be other general processors, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-Programmable Gate Array, FPGA) or other FPGAs Device, discrete gate or transistor logic, discrete hardware components etc..General processor can be microprocessor or this at It can also be any conventional processor etc. to manage device.
Input equipment 603 can include keyboard, Trackpad, fingerprint adopt sensor (finger print information that is used to gathering user and The directional information of fingerprint), microphone etc., output equipment 604 can include display, loudspeaker etc..
Memory 601 can include read-only storage and random access memory, and provide instruction sum to processor 602 According to.Part or all of memory 601 can also include nonvolatile RAM.For example, memory 601 may be used also With the information of storage device type.
Therefore, by the embodiment of the present invention, after access WLAN, due to being in difference in WLAN When under network state, it is different that intelligent terminal obtains the time used in the result of HTTP detections and TCP detections, thus intelligent terminal passes through Carry out HTTP detections and TCP detections simultaneously, be capable of the network state for knowing WLAN of prestissimo, reduce user etc. Treat the time, it is to avoid the WLAN for intelligent terminal access occur can not surf the Net, and the unwitting situation of user.
It is apparent to those skilled in the art that, for convenience of description and succinctly, only with above-mentioned each work( Energy unit, the division progress of module are for example, in practical application, as needed can distribute above-mentioned functions by different Functional unit, module are completed, i.e., the internal structure of said apparatus is divided into different functional unit or module, more than completion The all or part of function of description.Each functional unit, module in embodiment can be integrated in a processing unit, also may be used To be that unit is individually physically present, can also two or more units it is integrated in a unit, it is above-mentioned integrated Unit can both be realized in the form of hardware, it would however also be possible to employ the form of SFU software functional unit is realized.In addition, each function list Member, the specific name of module are also only to facilitate mutually differentiation, is not limited to the protection domain of the application.Said system The specific work process of middle unit, module, may be referred to the corresponding process in preceding method embodiment, will not be repeated here.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, without detailed description or note in some embodiment The part of load, may refer to the associated description of other embodiments.
Those of ordinary skill in the art are it is to be appreciated that the list of each example described with reference to the embodiments described herein Member and algorithm steps, can be realized with the combination of electronic hardware or computer software and electronic hardware.These functions are actually Performed with hardware or software mode, depending on the application-specific and design constraint of technical scheme.Professional and technical personnel Described function can be realized using distinct methods to each specific application, 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 apparatus and method, others can be passed through Mode is realized.For example, system embodiment described above is only schematical, for example, the division of above-mentioned module or unit, It is only a kind of division of logic function, there can be other dividing mode when actually realizing, such as multiple units or component can be with With reference to or be desirably integrated into another system, or some features can be ignored, or not perform.It is another, it is shown or discussed Coupling each other or direct-coupling or communication connection can be by some interfaces, the INDIRECT COUPLING of device or unit or Communication connection, can be electrical, machinery or other forms.
The above-mentioned unit illustrated as separating component can be or may not be it is physically separate, it is aobvious as unit The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs 's.
If above-mentioned integrated unit is realized using in the form of SFU software functional unit and as independent production marketing or used When, it can be stored in a computer read/write memory medium.Understood based on such, the present invention realizes above-described embodiment side All or part of flow in method, can also instruct the hardware of correlation to complete, above-mentioned computer by computer program Program can be stored in a computer-readable recording medium, and the computer program can be achieved above-mentioned each when being executed by processor The step of individual embodiment of the method.Wherein, above computer program includes computer program code, and above computer program code can Think source code form, object identification code form, executable file or some intermediate forms etc..Above computer computer-readable recording medium can be with Including:Any entity or device, recording medium, USB flash disk, mobile hard disk, magnetic disc, light of above computer program code can be carried Disk, computer storage, read-only storage (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 computer The content that computer-readable recording medium is included can carry out appropriate increase and decrease according to legislation in jurisdiction and the requirement of patent practice, for example In some jurisdictions, according to legislation and patent practice, computer-readable medium does not include being 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 with reference to foregoing reality Example is applied the present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each Technical scheme described in embodiment is modified, or carries out equivalent substitution to which part technical characteristic;And these are changed Or replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme, all should Within protection scope of the present invention.

Claims (26)

1. a kind of network detecting method, it is characterised in that the network detecting method includes:
After intelligent terminal access WLAN, while starting HTTP HTTP detections and transmission control protocol TCP is detected;
The HTTP is detected as:HTTP connection requests are sent to default first server by the WLAN, according to The intelligent terminal and the connection state of the first server obtain HTTP testing results;
The TCP is detected as:The TCP state of the intelligent terminal current network connection is periodically detected, according to the TCP state Obtain TCP testing results;
In default detection time, HTTP testing results and/or this TCP detections institute obtained by being detected based on this HTTP Obtained TCP testing results determine that the WLAN that the intelligent terminal is currently accessed is can surf the Net network or the net that can not surf the Net Network.
2. network detecting method as claimed in claim 1, it is characterised in that obtained by the detection based on this HTTP It is wireless that TCP testing results obtained by HTTP testing results and/or this TCP detections determine that the intelligent terminal is currently accessed After LAN is can surf the Net network or the network that can not surf the Net, or, after detection time arrival, the network detection Method also includes:
If this TCP is detected and/or this HTTP is detected still in operation, stop this TCP detections and/or this HTTP inspections Survey.
3. network detecting method as claimed in claim 1, it is characterised in that if it is determined that the nothing that the intelligent terminal is currently accessed Line LAN is the network that can not surf the Net, then the network detecting method also includes:
Disconnect the connection of the intelligent terminal and the WLAN.
4. network detecting method as claimed in claim 1, it is characterised in that if it is determined that the nothing that the intelligent terminal is currently accessed Line LAN is the network that can not surf the Net, then the network detecting method also includes:
Within the default disabling time, the WLAN is disabled.
5. network detecting method as claimed in claim 4, it is characterised in that described within the default disabling time, disables institute WLAN is stated, including:
Obtain the disabled number of times of the WLAN of current record;
The disabling time of the WLAN is set according to the disabled number of times of the WLAN of current record;
Within the disabling time of the WLAN, the WLAN is disabled;
Update the disabled number of times of the WLAN of current record.
6. network detecting method as claimed in claim 5, it is characterised in that the network detecting method also includes:
In WLAN alternate list, time that each attachable WLAN was once accessed by the intelligent terminal is shown Number and the number of times once disabled by the intelligent terminal, the attachable WLAN are the nothing that current intelligent terminal is not accessed Line LAN.
7. the network detecting method as described in any one of claim 1 to 6, it is characterised in that described based on this HTTP detections TCP testing results obtained by resulting HTTP testing results and/or this TCP detections determine that the intelligent terminal currently connects The WLAN entered can to surf the Net network or the network that can not surf the Net, including:
If the HTTP testing results obtained by this HTTP detections are successful connection, it is determined that what the intelligent terminal was currently accessed WLAN is the network that can surf the Net.
8. the network detecting method as described in any one of claim 1 to 6, it is characterised in that described based on this HTTP detections TCP testing results obtained by resulting HTTP testing results and/or this TCP detections determine that the intelligent terminal currently connects The WLAN entered can to surf the Net network or the network that can not surf the Net, including:
If the TCP testing results obtained by this TCP detections are connection failure, or, if obtained by this HTTP detections TCP testing results obtained by HTTP testing results and this TCP detections are that connection is limited, it is determined that the intelligent terminal is worked as The WLAN of preceding access is the network that can not surf the Net.
9. the network detecting method as described in any one of claim 1 to 6, it is characterised in that described to pass through the wireless local Net sends HTTP connection requests to default first server, according to the intelligent terminal and the connection shape of the first server Condition obtains HTTP testing results, including:
HTTP connection requests are sent to default first server by the WLAN;
If with the first server successful connection, it is determined that this HTTP testing result is successful connection;
If with the first server connection failure, whether the WLAN is determined according to the HTTP state values received For certification network;
If it is determined that the WLAN is certification network, it is determined that this HTTP testing result is limited for connection;
If it is determined that the WLAN is not certification network, it is determined that this HTTP testing result is connection failure.
10. the network detecting method as described in any one of claim 1 to 6, it is characterised in that described to be periodically detected the intelligence The TCP state of energy terminal current network connection, TCP testing results are obtained according to the TCP state, including:
Periodically obtain socket Socket all in the kernel of presently described intelligent terminal parameter information;
Based on each Socket parameter information, the type of link corresponding with each Socket is judged respectively;
According to the quantitative relation between different types of link, the TCP state of current network connection is determined;
If continuous N1 times determines that the TCP state is successful connection, it is determined that this TCP testing result is successful connection;
If continuous N2 times determines that the TCP state is connection failure, it is determined that this TCP testing result is connection failure;
If continuous N3 times determines that the TCP state is limited for connection, it is determined that this TCP testing result is limited for connection.
11. network detecting method as claimed in claim 10, it is characterised in that the periodicity obtains presently described intelligence eventually All socket Socket parameter information in the kernel at end, including:
Detect and whether there is Socket in the kernel of presently described intelligent terminal;
If there is Socket in the kernel of presently described intelligent terminal, in the kernel for periodically obtaining presently described intelligent terminal All Socket parameter information.
12. network detecting method as claimed in claim 11, it is characterised in that the network detecting method also includes:
If Socket is not present in the kernel of presently described intelligent terminal, it is determined that the TCP state of current network connection is connection Failure.
13. a kind of network detection means, it is characterised in that the network detection means includes:
Detection unit, for after intelligent terminal access WLAN, while start HTTP HTTP detection and Transmission control protocol TCP is detected;
Determining unit, in default detection time, HTTP testing results obtained by being detected based on this HTTP and/or TCP testing results obtained by this TCP detections determine that the WLAN that the intelligent terminal is currently accessed is the net that can surf the Net Network or the network that can not surf the Net;
Wherein, the detection unit includes:
HTTP detection units, for sending HTTP connection requests, root to default first server by the WLAN HTTP testing results are obtained according to the connection state of the intelligent terminal and the first server;
TCP detection units, the TCP state for being periodically detected the intelligent terminal current network connection, according to the TCP shapes State obtains TCP testing results.
14. network detection means as claimed in claim 13, it is characterised in that the network detection means also includes:
Stop element, for obtained by the HTTP testing results obtained by being detected based on this HTTP and/or this TCP detections TCP testing results determine WLAN that the intelligent terminal is currently accessed for can surf the Net network or can not surf the Net network it Afterwards, or, the detection time arrival after, if this TCP detection and/or this HTTP detection still in operation, stop Only this TCP detections and/or this HTTP detections.
15. network detection means as claimed in claim 13, it is characterised in that the network detection means also includes:
Connect switching units, for when it is determined that the WLAN that is currently accessed of the intelligent terminal for can not surf the Net network when, Disconnect the connection of the intelligent terminal and the WLAN.
16. network detection means as claimed in claim 13, it is characterised in that the network detection means also includes:
WLAN forbidden cell, for being the net that can not surf the Net when the WLAN that the determination intelligent terminal is currently accessed During network, within the default disabling time, the WLAN is disabled.
17. network detection means as claimed in claim 14, it is characterised in that the WLAN forbidden cell includes:
Disable number of times and obtain subelement, the disabled number of times of the WLAN for obtaining current record;
The disabling time sets subelement, and the number of times disabled for the WLAN according to current record sets the nothing The disabling time of line LAN;
Network disables subelement, within the disabling time of the WLAN, disabling the WLAN;
Disable number of times and update subelement, the disabled number of times of the WLAN for updating current record.
18. network detection means as claimed in claim 17, it is characterised in that the network detection means also includes:
Alternate list display unit, in WLAN alternate list, showing each attachable WLAN once The number of times accessed by the intelligent terminal and the number of times once disabled by the intelligent terminal, the attachable WLAN is The WLAN that current intelligent terminal is not accessed.
19. the network detection means as described in any one of claim 13 to 18, it is characterised in that the determining unit, specifically If being successful connection for HTTP testing result of the HTTP detection units obtained by this, it is determined that the intelligent terminal is worked as The WLAN of preceding access is the network that can surf the Net.
20. the network detection means as described in any one of claim 13 to 18, it is characterised in that described to state determining unit, tool If it is connection failure that body, which is used for TCP testing result of the HTTP detection units obtained by this, or, if the HTTP is detected TCP testing result of HTTP testing result and the TCP detection unit of the unit obtained by this obtained by this is connection It is limited, it is determined that the WLAN that the intelligent terminal is currently accessed is the network that can not surf the Net.
21. the network detection means as described in any one of claim 13 to 18, it is characterised in that the HTTP detection units bag Include:
HTTP request subelement, for sending HTTP connection requests to default first server by the WLAN;
HTTP determination subelements, if for the first server successful connection, it is determined that this HTTP testing result for connect It is connected into work(;
HTTP detection sub-units, if for the first server connection failure, the HTTP state values that basis is received to be true Whether the fixed WLAN is certification network;
The HTTP determination subelements, if being additionally operable to the HTTP detection sub-units determines that the WLAN is certificate web Network, it is determined that this HTTP testing result is limited for connection, if the HTTP detection sub-units determine the WLAN not For certification network, it is determined that this HTTP testing result is connection failure.
22. the network detection means as described in any one of claim 13 to 18, it is characterised in that the TCP detection units bag Include:
All socket Socket in acquisition of information subelement, the kernel for periodically obtaining presently described intelligent terminal Parameter information;
Link judgment sub-unit, for the parameter information based on each Socket, judges link corresponding with each Socket respectively Type;
TCP state determination subelement, for according to the quantitative relation between different types of link, determining current network connection TCP state;
TCP determination subelements, if being to connect into for the TCP state determination subelement continuous N1 determination TCP state Work(, it is determined that this TCP testing result is successful connection, if the TCP state determination subelement continuous N2 determination TCP State is connection failure, it is determined that this TCP testing result is connection failure, if the continuous N3 of TCP state determination subelement It is secondary to determine that the TCP state is limited for connection, it is determined that this TCP testing result is limited for connection.
23. network detection means as claimed in claim 22, it is characterised in that described information obtains subelement, including:
It whether there is Socket in quantity detection sub-unit, the kernel for detecting current intelligent terminal;
Subelement is obtained, if there are Socket in the kernel for current intelligent terminal, current intelligence is periodically obtained eventually The parameter information of all Socket in the kernel at end.
24. network detection means as claimed in claim 23, it is characterised in that the TCP state determination subelement, specific to use In when the quantity detection sub-unit detects and Socket is not present in the kernel of current intelligent terminal, determine that current network connects The TCP state connect is connection failure.
25. a kind of intelligent terminal, including memory, processor and it is stored in the memory and can be on the processor The computer program of operation, it is characterised in that realize such as claim 1 to 12 described in the computing device during computer program The step of any one methods described.
26. a kind of computer-readable recording medium, the computer-readable recording medium storage has computer program, its feature exists In the step of realizing such as any one of claim 1 to 12 methods described when the computer program is executed by processor.
CN201710740270.XA 2017-08-25 2017-08-25 A kind of network detecting method, network detection device and intelligent terminal Active CN107332741B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710740270.XA CN107332741B (en) 2017-08-25 2017-08-25 A kind of network detecting method, network detection device and intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710740270.XA CN107332741B (en) 2017-08-25 2017-08-25 A kind of network detecting method, network detection device and intelligent terminal

Publications (2)

Publication Number Publication Date
CN107332741A true CN107332741A (en) 2017-11-07
CN107332741B CN107332741B (en) 2019-03-29

Family

ID=60228451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710740270.XA Active CN107332741B (en) 2017-08-25 2017-08-25 A kind of network detecting method, network detection device and intelligent terminal

Country Status (1)

Country Link
CN (1) CN107332741B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107682909A (en) * 2017-11-22 2018-02-09 广东欧珀移动通信有限公司 A kind of control method and device for connecting access point
CN110113744A (en) * 2019-04-18 2019-08-09 杭州涂鸦信息技术有限公司 Communication means, device, equipment and storage medium
CN110324391A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
CN114826750A (en) * 2022-04-29 2022-07-29 阿里巴巴(中国)有限公司 Network anomaly detection method, server cluster and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176377A1 (en) * 2001-05-22 2002-11-28 Hamilton Thomas E. Service platform on wireless network
CN105940640A (en) * 2014-01-30 2016-09-14 高通股份有限公司 Determination of end-to-end transport quality
CN106714206A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting network connection by wireless network access point

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020176377A1 (en) * 2001-05-22 2002-11-28 Hamilton Thomas E. Service platform on wireless network
CN105940640A (en) * 2014-01-30 2016-09-14 高通股份有限公司 Determination of end-to-end transport quality
CN106714206A (en) * 2016-09-29 2017-05-24 腾讯科技(深圳)有限公司 Method and device for detecting network connection by wireless network access point

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107682909A (en) * 2017-11-22 2018-02-09 广东欧珀移动通信有限公司 A kind of control method and device for connecting access point
CN110324391A (en) * 2018-03-30 2019-10-11 武汉斗鱼网络科技有限公司 A kind of barrage server connection method, client and readable storage medium storing program for executing
CN110324391B (en) * 2018-03-30 2022-03-25 武汉斗鱼网络科技有限公司 Bullet screen server connection method, client and readable storage medium
CN110113744A (en) * 2019-04-18 2019-08-09 杭州涂鸦信息技术有限公司 Communication means, device, equipment and storage medium
CN114826750A (en) * 2022-04-29 2022-07-29 阿里巴巴(中国)有限公司 Network anomaly detection method, server cluster and storage medium
CN114826750B (en) * 2022-04-29 2024-02-06 阿里巴巴(中国)有限公司 Network anomaly detection method, server cluster and storage medium

Also Published As

Publication number Publication date
CN107332741B (en) 2019-03-29

Similar Documents

Publication Publication Date Title
CN107332741B (en) A kind of network detecting method, network detection device and intelligent terminal
CN109729131A (en) A kind of processing method of application request, device and router
CN105306318B (en) intelligent scene configuration method, device and server
CN107395633A (en) A kind of network detecting method, network detection means and intelligent terminal
WO2018142862A1 (en) Communication processing system, communication processing method, base station, and control method and control program for said base station
CN107333287B (en) Network detecting method, network detection device and intelligent terminal
CN111885680A (en) Method, system and core equipment for establishing network connection
CN107566233A (en) The resource share method and device of home appliance
CN108886486B (en) Virtualized network function interworking
CN102594912A (en) Data processing method under server architecture, server and server architecture
CN107332740B (en) A kind of network detecting method, network detection device and intelligent terminal
CN107277881A (en) Method for switching network, network switching device and intelligent terminal
Wette et al. DCT2Gen: A traffic generator for data centers
CN107197493B (en) A kind of method for switching network, network switching device and intelligent terminal
CN107241758A (en) Network control method, network control unit and intelligent terminal
CN107343326A (en) A kind of data transmission method and device
CN107404752A (en) Frequency choosing method and internet-of-things terminal based on signal intensity
CN107332739B (en) Network detecting method, network detection device and intelligent terminal
CN107276856A (en) Network detecting method, network detection means and intelligent terminal
US10203882B2 (en) Method for managing multiple bandwidth boost solutions co-existing in an electronic device
CN107360059B (en) Network detecting method, network detection device and intelligent terminal
CN107294812B (en) Network detecting method, network detection device and intelligent terminal
WO2020147081A1 (en) Data transmission method, related device, and computer storage medium
CN107493206B (en) A kind of network detecting method, network detection device and intelligent terminal
CN107333286B (en) Wifi hotspot connection management method, apparatus and terminal device

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