CN106209970B - Determine the method and apparatus of network state connected between user equipment and routing device - Google Patents

Determine the method and apparatus of network state connected between user equipment and routing device Download PDF

Info

Publication number
CN106209970B
CN106209970B CN201610438179.8A CN201610438179A CN106209970B CN 106209970 B CN106209970 B CN 106209970B CN 201610438179 A CN201610438179 A CN 201610438179A CN 106209970 B CN106209970 B CN 106209970B
Authority
CN
China
Prior art keywords
network
network state
response information
candidate
access response
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610438179.8A
Other languages
Chinese (zh)
Other versions
CN106209970A (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.)
Shanghai Shangxiang Network Technology Co.,Ltd.
Original Assignee
Shanghai Lianshang Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Lianshang Network Technology Co Ltd filed Critical Shanghai Lianshang Network Technology Co Ltd
Priority to CN201610438179.8A priority Critical patent/CN106209970B/en
Publication of CN106209970A publication Critical patent/CN106209970A/en
Application granted granted Critical
Publication of CN106209970B publication Critical patent/CN106209970B/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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/142Managing session states for stateless protocols; Signalling session states; State transitions; Keeping-state mechanisms
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session

Landscapes

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

Abstract

The purpose of the application is to provide a kind of for the method and apparatus for the network state for determining to connect between user equipment and routing device.Compared with prior art, the application initiates multiple network access requests by being connected between user equipment and routing device, then access response information corresponding to the network access request is received, and the network state of the connection is determined according to one or more access response information.This mode can fast and accurately judge the network state connected between the user equipment and routing device, the accuracy of judged result be improved, so as to provide effective data basis.

Description

Determine the method and apparatus of network state connected between user equipment and routing device
Technical field
The application is related to computer realm, more particularly to a kind of for determining the net connected between user equipment and routing device The technology of network state.
Background technology
In the prior art, for the judgement of network state that is connected between user equipment and routing device generally by access Corresponding website information simultaneously determines corresponding network state according to obtained return value, and this mode is detected based on single thread Network state, the accuracy of obtained testing result is relatively low, and therefore, that this mode can not be provided the user preferably is accurate, have The data of effect.
The content of the invention
The purpose of the application is to provide a kind of for the side for the network state for determining to connect between user equipment and routing device Method and equipment.
According to the one side of the application, there is provided a kind of to be used to determine the network connected between user equipment and routing device The method of state, wherein, this method includes:
Multiple network access requests are initiated in connection between user equipment and routing device;
Receive access response information corresponding to the network access request;
The network state of the connection is determined according to one or more access response information.
According to the another aspect of the application, additionally provide a kind of for determining the net connected between user equipment and routing device The equipment of network state, wherein, the equipment includes:
First device, for the multiple network access requests of connection initiation between user equipment and routing device;
Second device, for receiving access response information corresponding to the network access request;
3rd device, for determining the network state of the connection according to one or more access response information.
Compared with prior art, the application initiates multiple network access by being connected between user equipment and routing device Request, access response information corresponding to the network access request is then received, and according to one or more access responses Information determines the network state of the connection.This mode can fast and accurately judge that the user equipment is set with route The network state connected between standby, the accuracy of judged result is improved, so as to provide effective data basis.
Moreover, the application can also determine each access response information by the reception time sequencing of each access response information Corresponding candidate network state, until the candidate network state currently determined is to be successfully connected to network, if the time currently determined Network state is selected to be successfully connected to network, the network state for determining the connection is to be successfully connected to network.It is this according to when Between sequentially determine the mode of candidate network state corresponding to each access response information, when the network state of the connection is successfully When being connected to network, the network state can be determined faster, can preferably be saved the time, be saved power consumption.
In addition, network state and timeout threshold that the application can also connect according to current network state information updating Information, and the access response information according to corresponding to the timeout threshold information after renewal receives the network access request.This Kind mode, time-out time setting can be dynamically adjusted, reduces the generation of erroneous judgement, and judged result can be made more accurate.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, of the invention is other Feature, objects and advantages will become more apparent upon:
Fig. 1 shows to be used to determine the network connected between user equipment and routing device according to a kind of of the application one side The method flow diagram of state;
Fig. 2 shows to determine the method flow of network state that connects between user equipment and routing device based on three threads Figure;
Fig. 3 shows to be used to determine to connect between user equipment and routing device according to one kind of one preferred embodiment of the application Network state method flow diagram;
Fig. 4 shows to be used to determine the net connected between user equipment and routing device according to a kind of of the application other side The equipment schematic diagram of network state;
Fig. 5 shows to be used to determine to connect between user equipment and routing device according to one kind of the application another preferred embodiment The equipment schematic diagram of the network state connect.
Same or analogous reference represents same or analogous part in accompanying drawing.
Embodiment
The present invention is described in further detail below in conjunction with the accompanying drawings.
In one typical configuration of the application, terminal, the equipment of service network and trusted party include one or more Processor (CPU), input/output interface, network interface and internal memory.
Internal memory may include computer-readable medium in volatile memory, random access memory (RAM) and/or The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data. The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM), Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, magnetic disk storage or other magnetic storage apparatus or Any other non-transmission medium, the information that can be accessed by a computing device available for storage.Defined according to herein, computer Computer-readable recording medium does not include non-temporary computer readable media (transitory media), such as the data-signal and carrier wave of modulation.
It is below in conjunction with the accompanying drawings and preferably real for the technological means and the effect of acquirement that further elaboration the application is taken Example is applied, to the technical scheme of the application, carries out clear and complete description.
Fig. 1 shows that the application provides a kind of for determining the network connected between user equipment and routing device on one side The method of state, wherein, this method includes:
S1 is connected between user equipment and routing device initiates multiple network access requests;
S2 receives access response information corresponding to the network access request;
S3 determines the network state of the connection according to one or more access response information.
In this embodiment, in the step S1, it is multiple that equipment 1 connects initiation between user equipment and routing device Network access request, here, equipment 1 can be the mobile terminal that any one can carry out network service, include but is not limited to Mobile phone, palm PC (PPC), tablet personal computer or notebook computer etc..Wherein, connected between the user equipment and routing device Including wired connection and wireless connection, wherein, the network access request includes the access request sent to different network address, excellent Selection of land, wherein, the multiple network access request includes following at least two:Access request on third party website;On The access request of custom link address.Wherein, the third party website includes but is not limited to some conventional websites, for example, washing in a pan Precious net, Sina website etc.;Wherein, the custom link address includes the network address of some self-defined erections.Specifically, equipment 1 Based on http protocol, (hypertext transfer protocol, hypertext pass for connection between user equipment and routing device Defeated agreement) to corresponding multiple network address initiate multiple network access requests.Preferably, wherein, the step S1 includes:Via with Multiple network access requests are initiated in connection between family equipment and routing device, wherein, the multiple network access request is respectively by phase Mutually independent thread performs.Specifically, equipment 1 connects through multiple separate lines between user equipment and routing device Journey initiates multiple network access requests to multiple different network address, for example, as shown in Fig. 2 sharing three separate threads A, B, C, thread A and B can access the network address of self-defined erection, and thread C can access some conventional third party websites, example Such as, Taobao etc., therefore, equipment 1 can initiate network access respectively by these three different threads to corresponding network address please Ask, and obtain corresponding request results.
Continue in this embodiment, in the step S2, equipment 1, which receives to access corresponding to the network access request, rings Information is answered, wherein, the access response information includes but is not limited to numerical information, text information etc., to indicate whether into Work(is connected to website etc..Specifically, equipment 1 can obtain corresponding after initiating multiple network access requests to corresponding multiple network address Access response information, correspondingly, equipment 1 receive the access response information.For example, when user is accessing some websites, if Access unsuccessful, to be fed back by the website unsuccessful code information of access etc..
Continue in this embodiment, in the step S3, equipment 1 is true according to one or more access response information The network state of the fixed connection.Specifically, equipment 1 can be rung according to default rule according to one or more described access Information is answered to determine the network state of the connection.Preferably, wherein, the network state includes:It is not connected to network, successfully connects It is connected to network or connection is to be certified.For example, the network state that the connection is determined when being not received by access response information is It is not connected to network;Or the network state of the connection is determined when receiving access response information to be successfully connected to net Network or connection are to be certified etc..
In a preferred embodiment, join shown in Fig. 3, wherein, in step S1', S2' and Fig. 1 embodiment in Fig. 3 Step S1, S2 is identical or essentially identical, therefore will not be repeated here, and is only incorporated herein by reference.Preferably, wherein, institute Stating step S3' includes:S31' determines candidate network state corresponding to each access response information;S32' is according to one or more institutes State the network state that candidate network state determines the connection.In the step S31', equipment 1 determines each access response letter Candidate network state corresponding to breath, wherein, the candidate network state includes being not connected to network, is successfully connected to network or company Certification etc. is received, specifically, different access response information may correspond to different candidate network states, and therefore, equipment 1 can be with Each access response information is determined according to the corresponding relation between default access response information and different candidate network states Corresponding candidate network state.Further, in the step S32', equipment 1 is according to one or more candidate networks State determines the network state of the connection, and specifically, equipment 1 is according to one or more candidate network states and makes a reservation for Rule determine the network state of the connection.As long as example, when have a candidate network state for be successfully connected to network when, The network state for determining the connection is to be successfully connected to network;In another example when all candidate network states are all not connected During to network, the network state for determining the connection is to be not connected to network;Further for example, wrapped when in multiple candidate network states During containing being not connected to network and connection to be certified, determine that the network state of the connection is to be certified to connect;For another example it can incite somebody to action Different value corresponding to different network states compares the size of the result to determine the network state as returning result, For example, setting, which is connected to network, corresponds to numerical value 2, corresponding numerical value 1 to be certified is connected, network is not connected to and corresponds to numerical value 0, other are not Know state corresponding -1, be defined as institute by comparing the result of return, and by candidate network state corresponding to the maximum of the result The network state of connection is stated, for example, sharing three returning results, wherein maximum is 2, it is determined that the network state of the connection To be connected to network.
It is highly preferred that wherein, the step S31' includes:Each access response information is determined based on the first predetermined rule Corresponding candidate network state;Wherein, first rule includes following at least any one:When the access response information and institute Predetermined response information match corresponding to network access request is stated, then corresponding candidate network state is to be successfully connected to network; When access response information predetermined response information mismatch corresponding with the network access request, then corresponding candidate network shape State is to be certified to connect;When the access response information is sky, then corresponding candidate network state is to be not connected to network.At this In embodiment, equipment 1 determines candidate network state corresponding to each access response information based on the first predetermined rule, specifically Ground, when access response information predetermined response information match corresponding with the network access request, then corresponding candidate Network state is to be successfully connected to network, wherein, the predetermined response information includes but is not limited to numerical information, text information etc. Deng, the predetermined response information is pre-set, for example, when predetermined response information is represented with some numerical value, then when access rings When to answer information be the numerical value, the candidate network state is judged to be successfully connected to network;When the access response information and institute Predetermined response information mismatch corresponding to network access request is stated, then corresponding candidate network state is to be certified to connect, for example, in advance When provisioning response information is represented with some numerical value, when numerical value corresponding to access response information is with predetermined some numerical value difference, It is determined that corresponding candidate network state is to be certified to connect;And when the access response information is space-time, it is determined that corresponding time Network state is selected to be not connected to network.For example, as shown in Fig. 2 thread A be self-defined erection network address, ask the network address, such as Fruit returned content is consistent with preset value, then is judged to being successfully connected to network, no returned content is then judged to being not connected to net Network, have returned content but with preset value it is inconsistent be judged to being connected it is to be certified;Thread B is also the network address of self-defined erection, if returning Return HTTP CODE (conditional code) 204, be judged to being successfully connected to network, if return 200~399 be judged to connecting it is to be certified, if Other values are returned to be judged to being not connected to network;Thread C is third party website, if returned content is consistent with preset value, is judged To be successfully connected to network, no returned content then judges to be not connected to network, if there is returned content but inconsistent with preset value, Then it is judged to connecting to be certified, therefore, can correspondingly obtains multiple candidate network states based on multiple threads.Here, this is more Individual thread is under singleton pattern, and return value corresponding to acquisition is returned to by the way that callback is asynchronous based on asynchronous detection function.
It is highly preferred that wherein, the step S32' includes:Based on predetermined Second Rule and one or more candidates Network state determines the network state of the connection;Wherein, the Second Rule includes following at least any one:According to described one Individual or multiple candidate network state ballots determine the network state of the connection;When in one or more of candidate network states At least one candidate network state be present to be successfully connected to network, the network state for determining the connection is to be successfully connected to net Network.In the step S32', equipment 1 determines institute based on predetermined Second Rule and one or more candidate network states The network state of connection is stated, wherein, the Second Rule includes following at least any one:(1) according to one or more of times Network state ballot is selected to determine the network state of the connection, here, the ballot is based on the principle that the minority is subordinate to the majority, example Such as, 3 candidate network states are shared, wherein, there are two candidate network states to be not connected to network, there is a candidate network shape State is to be certified to connect, it is determined that the network state of the connection is to be not connected to network;(2) as one or more of candidates At least one candidate network state in network state be present to be successfully connected to network, the network state for determining the connection be into Work(is connected to network, here, those skilled in the art will be understood that when in the candidate network state comprising it is at least one into When work(is connected to network, it may be determined that the network state of the connection is to be successfully connected to network.
Preferably, wherein, the step S3' includes:Determined by the reception time sequencing of each access response information each Candidate network state corresponding to access response information, until the candidate network state currently determined is to be successfully connected to network;If For the candidate network state currently determined to be successfully connected to network, the network state for determining the connection is to be successfully connected to net Network.Specifically, the time that equipment 1 receives each access response information is probably different, different access response information pair Different candidate network states is answered, therefore, can be waited according to corresponding to the priority for receiving the time determines each access response information Network state is selected, if the candidate network state currently determined is is successfully connected to network, the network state for determining the connection is It is successfully connected to network.For example, if candidate network state corresponding to the first access response information received is to be successfully connected to Network, then the network state of the connection can be determined to be successfully connected to network, without further according to follow-up candidate network shape State judges the network state of the connection.
It is highly preferred that wherein, the step S3' also includes:If in the absence of candidate network state to be successfully connected to network, The network state of the connection is determined according to one or more candidate network state ballots.Here, rung when by each access Answer to be not present in candidate network state corresponding to each access response information that the reception time sequencing of information determines and be successfully connected During to network, then the network state of the connection is determined according to one or more candidate network state ballots, for example, shared 3 candidate network states, wherein, there have two candidate network states to be to be certified to connect, and has a candidate network state not connect It is connected to network, it is determined that the network state of the connection is to be certified to connect.
Preferably, wherein, methods described also includes:S4 (not shown) connects according to current network state information updating Network state and timeout threshold information;Wherein, the step S2' includes:Connect according to the timeout threshold information after renewal Receive access response information corresponding to the network access request.Wherein, the timeout threshold information refer to it is presetting, limiting The temporal information of fixed effective access response information, i.e., the access response information obtained in the timeout threshold information is judging The network state of the connection.For example, as shown in Fig. 2 the timeout threshold information that can preset these three threads is 8s, then The access response information received within the time is effective access response information, can be according to the access response information in the 8s Judge candidate network state corresponding to each access response information;It is in another example any when not received in the timeout threshold information Access response information, the network state of the connection can be directly judged to be not connected to network.Specifically, equipment 1 is according to one Or the network state that multiple access response information determine may have erroneous judgement, for example, real network state is It is successfully connected to network or connects to be certified and be mistaken for being not connected to network, if current net can be got according to other modes Network status information, then the network state of the connection, those skilled in the art can be updated according to the current network state information Member is mistaken for being not connected to network, it is possible to be due to it will be understood that when erroneous judgement be present for example, network will be successfully connected to Timeout threshold information is too small, causes not receiving access response information within the time, therefore, can be believed according to current network state Breath updates the timeout threshold information, to reduce erroneous judgement.Further, in the step S2', after equipment 1 is according to renewal The timeout threshold information receives access response information corresponding to the network access request.
Compared with prior art, the application initiates multiple network access by being connected between user equipment and routing device Request, access response information corresponding to the network access request is then received, and according to one or more access responses Information determines the network state of the connection.This mode can fast and accurately judge that the user equipment is set with route The network state connected between standby, the accuracy of judged result is improved, so as to provide effective data basis.
Moreover, the application can also determine each access response information by the reception time sequencing of each access response information Corresponding candidate network state, until the candidate network state currently determined is to be successfully connected to network, if the time currently determined Network state is selected to be successfully connected to network, the network state for determining the connection is to be successfully connected to network.It is this according to when Between sequentially determine the mode of candidate network state corresponding to each access response information, when the network state of the connection is successfully When being connected to network, the network state can be determined faster, can preferably be saved the time, be saved power consumption.
In addition, network state and timeout threshold that the application can also connect according to current network state information updating Information, and the access response information according to corresponding to the timeout threshold information after renewal receives the network access request.This Kind mode, time-out time setting can be dynamically adjusted, reduces the generation of erroneous judgement, and judged result can be made more accurate.
Fig. 4 shows that the application provides a kind of for determining the net connected between user equipment and routing device on the other hand The equipment of network state, wherein, the equipment includes:
First device, the multiple network access requests of connection initiation between user equipment and routing device;
Second device, receive access response information corresponding to the network access request;
3rd device, the network state of the connection is determined according to one or more access response information.
In this embodiment, it is multiple to connect initiation between user equipment and routing device for the first device of the equipment 1 Network access request, here, equipment 1 can be the mobile terminal that any one can carry out network service, include but is not limited to Mobile phone, palm PC (PPC), tablet personal computer or notebook computer etc..Wherein, connected between the user equipment and routing device Including wired connection and wireless connection, wherein, the network access request includes the access request sent to different network address, excellent Selection of land, wherein, the multiple network access request includes following at least two:Access request on third party website;On The access request of custom link address.Wherein, the third party website includes but is not limited to some conventional websites, for example, washing in a pan Precious net, Sina website etc.;Wherein, the custom link address includes the network address of some self-defined erections.Specifically, equipment 1 Based on http protocol, (hypertext transfer protocol, hypertext pass for connection between user equipment and routing device Defeated agreement) to corresponding multiple network address initiate multiple network access requests.Preferably, wherein, the first device is used for:Via Multiple network access requests are initiated in connection between user equipment and routing device, wherein, the multiple network access request respectively by Separate thread performs.Specifically, the first device of equipment 1 connects through multiple between user equipment and routing device Separate thread initiates multiple network access requests to multiple different network address, for example, as shown in Fig. 2 sharing three phases Mutually independent thread A, B, C, thread A and B can access the network address of self-defined erection, thread C can access some conventional the Tripartite website, for example, Taobao etc., therefore, equipment 1 can be initiated respectively by these three different threads to corresponding network address Network access request, and obtain corresponding request results.
Continue in this embodiment, the second device of the equipment 1, which receives to access corresponding to the network access request, rings Information is answered, wherein, the access response information includes but is not limited to numerical information, text information etc., to indicate whether into Work(is connected to website etc..Specifically, equipment 1 can obtain corresponding after initiating multiple network access requests to corresponding multiple network address Access response information, correspondingly, equipment 1 receive the access response information.For example, when user is accessing some websites, if Access unsuccessful, to be fed back by the website unsuccessful code information of access etc..
Continue in this embodiment, the 3rd device of the equipment 1 is true according to one or more access response information The network state of the fixed connection.Specifically, the 3rd device of equipment 1 can be according to default rule, according to one or more The access response information determines the network state of the connection.Preferably, wherein, the network state includes:It is not connected to Network, it is successfully connected to network or connects to be certified.For example, determine the connection when being not received by access response information Network state is to be not connected to network;Or determined when receiving access response information the connection network state be into Work(is connected to network or connected to be certified etc..
In a preferred embodiment, join shown in Fig. 5, wherein, first device, second device and Fig. 4 in Fig. 5 are implemented First device, second device in example is identical or essentially identical, therefore will not be repeated here, and is only incorporated herein by reference. Preferably, wherein, the 3rd device includes:First module, it is determined that candidate network state corresponding to each access response information; Second unit, the network state of the connection is determined according to one or more candidate network states.In this embodiment, institute The first module for stating equipment 1 determines candidate network state corresponding to each access response information, wherein, the candidate network state Including being not connected to network, being successfully connected to network or connection is to be certified etc., specifically, different access response information may be right Different candidate network states is answered, therefore, the first module of equipment 1 can be according to default access response information and different times The corresponding relation between network state is selected to determine candidate network state corresponding to each access response information.Further, it is described The second unit of equipment 1 determines the network state of the connection according to one or more candidate network states, specifically, if Standby 1 second unit determines the network-like of the connection according to one or more candidate network states and predetermined rule State.As long as example, when have a candidate network state for be successfully connected to network when, determine the connection network state be into Work(is connected to network;In another example when all candidate network states are all to be not connected to network, the network of the connection is determined State is to be not connected to network;It is not connected to network for another example being included when in multiple candidate network states and connects to be certified When, determine that the network state of the connection is to be certified to connect;For another example can be by different value corresponding to different network states As returning result, and compare the size of the result to determine the network state, for example, setting is connected to network and corresponds to numerical value 2, corresponding numerical value 1 to be certified is connected, network is not connected to and corresponds to numerical value 0, other unknown states corresponding -1, by comparing return As a result, and by candidate network state corresponding to the maximum of the result it is defined as the network state of the connection, for example, sharing three Individual returning result, wherein maximum are 2, it is determined that the network state of the connection is to be connected to network.
It is highly preferred that wherein, the first module is used for:Each access response information is determined based on the first predetermined rule Corresponding candidate network state;Wherein, first rule includes following at least any one:When the access response information and institute Predetermined response information match corresponding to network access request is stated, then corresponding candidate network state is to be successfully connected to network; When access response information predetermined response information mismatch corresponding with the network access request, then corresponding candidate network shape State is to be certified to connect;When the access response information is sky, then corresponding candidate network state is to be not connected to network.At this In embodiment, the first module of equipment 1 determines candidate network corresponding to each access response information based on the first predetermined rule State is specifically, when access response information predetermined response information match corresponding with the network access request, then right The candidate network state answered is to be successfully connected to network, wherein, the predetermined response information includes but is not limited to numerical information, text Word information etc., the predetermined response information are pre-set, for example, when predetermined response information is represented with some numerical value, then When access response information is the numerical value, the candidate network state is judged to be successfully connected to network;When the access response Information predetermined response information mismatch corresponding with the network access request, then corresponding candidate network state is to connect to wait to recognize Card, for example, when predetermined response information is represented with some numerical value, when numerical value corresponding to access response information and predetermined certain number When being worth different, it is determined that corresponding candidate network state is to be certified to connect;And when the access response information is space-time, it is determined that Corresponding candidate network state is to be not connected to network.For example, as shown in Fig. 2 thread A be self-defined erection network address, request The network address, if returned content is consistent with preset value, it is judged to being successfully connected to network, no returned content is then determined as not Be connected to network, have returned content but with preset value it is inconsistent be judged to being connected it is to be certified;Thread B is also the net of self-defined erection Location, if returning to HTTP CODE (conditional code) 204, it is judged to being successfully connected to network, if returning to 200~399 is determined as that connection is treated Certification, it is judged to being not connected to network if returning to other values;Thread C is third party website, if returned content is consistent with preset value, Then it is judged to being successfully connected to network, no returned content then judges to be not connected to network, if having returned content but and preset value It is inconsistent, then it is judged to connecting to be certified, therefore, can correspondingly obtains multiple candidate network states based on multiple threads. This, the plurality of thread is under singleton pattern, is returned based on asynchronous detection function by callback asynchronous return corresponding to acquisition Return value.
It is highly preferred that wherein, the second unit is used for:Based on predetermined Second Rule and one or more candidates Network state determines the network state of the connection;Wherein, the Second Rule includes following at least any one:According to described one Individual or multiple candidate network state ballots determine the network state of the connection;When in one or more of candidate network states At least one candidate network state be present to be successfully connected to network, the network state for determining the connection is to be successfully connected to net Network.Here, the second unit of the equipment 1 is determined based on predetermined Second Rule and one or more candidate network states The network state of the connection, wherein, the Second Rule includes following at least any one:(1) according to one or more of The ballot of candidate network state determines the network state of the connection, here, the ballot is based on the principle that the minority is subordinate to the majority, example Such as, 3 candidate network states are shared, wherein, there are two candidate network states to be not connected to network, there is a candidate network shape State is to be certified to connect, it is determined that the network state of the connection is to be not connected to network;(2) as one or more of candidates At least one candidate network state in network state be present to be successfully connected to network, the network state for determining the connection be into Work(is connected to network, here, those skilled in the art will be understood that when in the candidate network state comprising it is at least one into When work(is connected to network, it may be determined that the network state of the connection is to be successfully connected to network.
Preferably, wherein, the 3rd device is used for:Determined by the reception time sequencing of each access response information each Candidate network state corresponding to access response information, until the candidate network state currently determined is to be successfully connected to network;If For the candidate network state currently determined to be successfully connected to network, the network state for determining the connection is to be successfully connected to net Network.Specifically, the time that equipment 1 receives each access response information is probably different, different access response information pair Different candidate network states is answered, therefore, 3rd device can determine each access response information according to the priority for receiving the time Corresponding candidate network state, if the candidate network state currently determined determines the net of the connection to be successfully connected to network Network state is to be successfully connected to network.If for example, receive first access response information corresponding to candidate network state be into Work(is connected to network, then the network state of the connection can be determined to be successfully connected to network, without further according to follow-up time The network state connected described in network selection network condition adjudgement.
It is highly preferred that wherein, the 3rd device is additionally operable to:If it is to be successfully connected to net in the absence of candidate network state Network, the network state of the connection is determined according to one or more candidate network state ballots.Here, accessed when by each It is not present in candidate network state corresponding to each access response information that the reception time sequencing of response message determines and successfully connects When being connected to network, then the network state of the connection is determined according to one or more candidate network state ballots, for example, altogether There are 3 candidate network states, wherein, there have two candidate network states to be to be certified to connect, and has a candidate network state for not It is connected to network, it is determined that the network state of the connection is to be certified to connect.
Preferably, wherein, the equipment also includes:4th device (not shown), according to current network state information updating The network state and timeout threshold information of the connection;Wherein, the second device is used for:According to the overtime threshold after renewal Value information receives access response information corresponding to the network access request.Wherein, the timeout threshold information refers to preset , limiting the temporal information of effective access response information, i.e., the access response letter that is obtained in the timeout threshold information Cease to judge the network state of the connection.For example, as shown in Fig. 2 the timeout threshold of these three threads can be preset Information is 8s, then the access response information received within the time is effective access response information, can be according in the 8s Access response information judges candidate network state corresponding to each access response information;In another example when in the timeout threshold information Do not receive any access response information inside, can directly judge the network state of the connection to be not connected to network.Specifically, if Standby 1 network state determined according to one or more access response information may have erroneous judgement, for example, actual Network state for be successfully connected to network or connection it is to be certified be mistaken for being not connected to network, if can be obtained according to other modes Current network state information is got, then the network state of the connection, ability can be updated according to the current network state information The technical staff in domain will be understood that when erroneous judgement be present, is mistaken for being not connected to network for example, network will be successfully connected to, has It is probably because timeout threshold information is too small, causes not receiving access response information within the time, therefore, can be according to current Network state information updates the timeout threshold information, to reduce erroneous judgement.Further, the second device of the equipment 1 according to The timeout threshold information after renewal receives access response information corresponding to the network access request.
Compared with prior art, the application initiates multiple network access by being connected between user equipment and routing device Request, access response information corresponding to the network access request is then received, and according to one or more access responses Information determines the network state of the connection.This mode can fast and accurately judge that the user equipment is set with route The network state connected between standby, the accuracy of judged result is improved, so as to provide effective data basis.
Moreover, the application can also determine each access response information by the reception time sequencing of each access response information Corresponding candidate network state, until the candidate network state currently determined is to be successfully connected to network, if the time currently determined Network state is selected to be successfully connected to network, the network state for determining the connection is to be successfully connected to network.It is this according to when Between sequentially determine the mode of candidate network state corresponding to each access response information, when the network state of the connection is successfully When being connected to network, the network state can be determined faster, can preferably be saved the time, be saved power consumption.
In addition, network state and timeout threshold that the application can also connect according to current network state information updating Information, and the access response information according to corresponding to the timeout threshold information after renewal receives the network access request.This Kind mode, time-out time setting can be dynamically adjusted, reduces the generation of erroneous judgement, and judged result can be made more accurate.
It is obvious to a person skilled in the art that the invention is not restricted to the details of above-mentioned one exemplary embodiment, Er Qie In the case of without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, the scope of the present invention is by appended power Profit requires rather than described above limits, it is intended that all in the implication and scope of the equivalency of claim by falling Change is included in the present invention.Any reference in claim should not be considered as to the involved claim of limitation.This Outside, it is clear that the word of " comprising " one is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in device claim is multiple Unit or device can also be realized by a unit or device by software or hardware.The first, the second grade word is used for table Show title, and be not offered as any specific order.

Claims (16)

1. it is a kind of for the method for the network state for determining to connect between user equipment and routing device, wherein, this method includes:
Multiple network access requests are initiated in connection between user equipment and routing device, wherein, the multiple network access please Ask including the access request on third party website and the access request on custom link address;Wherein, the multiple net Network access request is performed by separate thread respectively, and multiple separate threads are initiated to multiple different network address Multiple network access requests;
Receive access response information corresponding to the network access request;
The network of the connection is determined according to one or more of the access response information received the access response information State.
2. according to the method for claim 1, wherein, the network state includes:It is not connected to network, is successfully connected to net Network or connection are to be certified.
3. the method according to claim 11, wherein, it is described according to determining one or more access response information The network state of connection includes:
It is determined that candidate network state corresponding to each access response information;
The network state of the connection is determined according to one or more candidate network states.
4. the method according to claim 11, wherein, it is described to determine candidate network state corresponding to each access response information Including:
Candidate network state corresponding to each access response information is determined based on the first predetermined rule;
Wherein, first rule includes following at least any one:
When access response information predetermined response information match corresponding with the network access request, then corresponding candidate Network state is to be successfully connected to network;
When access response information predetermined response information mismatch corresponding with the network access request, then corresponding candidate's net Network state is to be certified to connect;
When the access response information is sky, then corresponding candidate network state is to be not connected to network.
5. the method according to claim 11, wherein, it is described according to determining one or more candidate network states The network state of connection includes:
The network state of the connection is determined based on predetermined Second Rule and one or more candidate network states;
Wherein, the Second Rule includes following at least any one:
The network state of the connection is determined according to the ballot of one or more of candidate network states;
When at least one candidate network state in one or more of candidate network states be present to be successfully connected to network, really The network state of the fixed connection is to be successfully connected to network.
6. the method according to claim 11, wherein, it is described according to determining one or more access response information The network state of connection includes:
The candidate network state as corresponding to the reception time sequencing of each access response information determines each access response information, directly It is to be successfully connected to network to the candidate network state currently determined;
If for the candidate network state currently determined to be successfully connected to network, the network state for determining the connection is to be successfully connected To network.
7. the method according to claim 11, wherein, it is described according to determining one or more access response information The network state of connection also includes:
If in the absence of candidate network state to be successfully connected to network, voted according to one or more candidate network states true The network state of the fixed connection.
8. according to the method for claim 1, wherein, methods described also includes:
The network state and timeout threshold information connected according to current network state information updating;
Wherein, access response information corresponding to the reception network access request includes:
The access response information according to corresponding to the timeout threshold information after renewal receives the network access request.
9. it is a kind of for the equipment for the network state for determining to connect between user equipment and routing device, wherein, the equipment includes:
First device, for the multiple network access requests of connection initiation between user equipment and routing device, wherein, it is described more Individual network access request includes the access request on the access request of third party website and on custom link address;Its In, the multiple network access request is performed by separate thread respectively, and multiple separate threads are to multiple Different network address initiates multiple network access requests;
Second device, for receiving access response information corresponding to the network access request;
3rd device, for determining institute according to one or more of the access response information received the access response information State the network state of connection.
10. equipment according to claim 9, wherein, the network state includes:It is not connected to network, is successfully connected to Network or connection are to be certified.
11. equipment according to claim 9, wherein, the 3rd device includes:
First module, for determining candidate network state corresponding to each access response information;
Second unit, for determining the network state of the connection according to one or more candidate network states.
12. equipment according to claim 11, wherein, the first module is used for:
Candidate network state corresponding to each access response information is determined based on the first predetermined rule;
Wherein, first rule includes following at least any one:
When access response information predetermined response information match corresponding with the network access request, then corresponding candidate Network state is to be successfully connected to network;
When access response information predetermined response information mismatch corresponding with the network access request, then corresponding candidate's net Network state is to be certified to connect;
When the access response information is sky, then corresponding candidate network state is to be not connected to network.
13. equipment according to claim 11, wherein, the second unit is used for:
The network state of the connection is determined based on predetermined Second Rule and one or more candidate network states;
Wherein, the Second Rule includes following at least any one:
The network state of the connection is determined according to the ballot of one or more of candidate network states;
When at least one candidate network state in one or more of candidate network states be present to be successfully connected to network, really The network state of the fixed connection is to be successfully connected to network.
14. equipment according to claim 9, wherein, the 3rd device is used for:
The candidate network state as corresponding to the reception time sequencing of each access response information determines each access response information, directly It is to be successfully connected to network to the candidate network state currently determined;
If for the candidate network state currently determined to be successfully connected to network, the network state for determining the connection is to be successfully connected To network.
15. equipment according to claim 14, wherein, the 3rd device is additionally operable to:
If in the absence of candidate network state to be successfully connected to network, voted according to one or more candidate network states true The network state of the fixed connection.
16. equipment according to claim 9, wherein, the equipment also includes:
4th device, for the network state and timeout threshold information connected according to current network state information updating;
Wherein, the second device is used for:
The access response information according to corresponding to the timeout threshold information after renewal receives the network access request.
CN201610438179.8A 2016-06-17 2016-06-17 Determine the method and apparatus of network state connected between user equipment and routing device Active CN106209970B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610438179.8A CN106209970B (en) 2016-06-17 2016-06-17 Determine the method and apparatus of network state connected between user equipment and routing device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610438179.8A CN106209970B (en) 2016-06-17 2016-06-17 Determine the method and apparatus of network state connected between user equipment and routing device

Publications (2)

Publication Number Publication Date
CN106209970A CN106209970A (en) 2016-12-07
CN106209970B true CN106209970B (en) 2018-02-23

Family

ID=57460647

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610438179.8A Active CN106209970B (en) 2016-06-17 2016-06-17 Determine the method and apparatus of network state connected between user equipment and routing device

Country Status (1)

Country Link
CN (1) CN106209970B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107154959A (en) * 2016-03-02 2017-09-12 阿里巴巴集团控股有限公司 A kind of method and apparatus of the access network address
CN107070739A (en) * 2017-02-24 2017-08-18 上海斐讯数据通信技术有限公司 A kind of router operation troubles intelligent detecting method and system
CN107734032B (en) * 2017-10-16 2020-01-03 北京旷视科技有限公司 Network connection establishing method and device
CN110022240B (en) * 2018-01-09 2021-03-23 香港理工大学深圳研究院 Network state testing method and device and terminal equipment
CN113709086B (en) * 2020-05-22 2023-07-18 深圳市万普拉斯科技有限公司 Network detection method, device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1433615A (en) * 2000-05-05 2003-07-30 诺玛迪克斯公司 Network usage monitoring device and associated method
CN105263196A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Connection state prompting method and device
CN105392185A (en) * 2015-10-20 2016-03-09 广东欧珀移动通信有限公司 Intelligent equipment networking method and device, and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107071867B (en) * 2012-06-30 2020-07-24 华为终端有限公司 Wireless network access method, Wifi access point and terminal
CN105228227A (en) * 2014-11-24 2016-01-06 东莞市步步高通信软件有限公司 The method choosing network of mobile terminal and mobile terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1433615A (en) * 2000-05-05 2003-07-30 诺玛迪克斯公司 Network usage monitoring device and associated method
CN105263196A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Connection state prompting method and device
CN105392185A (en) * 2015-10-20 2016-03-09 广东欧珀移动通信有限公司 Intelligent equipment networking method and device, and system

Also Published As

Publication number Publication date
CN106209970A (en) 2016-12-07

Similar Documents

Publication Publication Date Title
CN106209970B (en) Determine the method and apparatus of network state connected between user equipment and routing device
US10257187B2 (en) Prompting login account
US8856945B2 (en) Dynamic security question compromise checking based on incoming social network postings
CN107040494B (en) User account abnormity prevention method and system
CN104217169B (en) Method and device, terminal are recommended in a kind of encryption
CN105095737A (en) Method and device for detecting weak password
US20160248771A1 (en) Methods, apparatus, and systems for identity authentication
CN107197462B (en) Wireless network type detection method and device and electronic equipment
CN103812906B (en) Website recommendation method and device and communication system
CN106102059A (en) For determining the possessory method and apparatus of hotspot
CN106777072B (en) Method, equipment and system for providing presentation information
CN108259518A (en) A kind of network connection authentication method, device, electronic equipment and storage medium
US11263283B1 (en) Method and system for asynchronous correlation of data entries in spatially separated instances of heterogeneous databases
CN106294702A (en) A kind of information query method and device
CN108834171B (en) Image method and device
CN112131502A (en) Data processing method, data processing apparatus, electronic device, and medium
CN106611100B (en) User behavior analysis method and device
KR102340976B1 (en) Deep learning-based customized content provision system using web service user experience
US20160225049A1 (en) Research system and method
CN105681458B (en) A kind of network data method for down loading and terminal
US20130339502A1 (en) Techniques to manage transitions between private and public networks
CN107851165B (en) Key system, key client and key management method
CN110059272A (en) A kind of page feature recognition methods and device
CN106534327A (en) Location reminding method and device, user order processing platform and merchant side
CN110334260B (en) Data analysis method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20210409

Address after: 201203 Zone E, 9th floor, No.1 Lane 666, zhangheng Road, China (Shanghai) pilot Free Trade Zone, Pudong New Area, Shanghai

Patentee after: Shanghai Shangxiang Network Technology Co.,Ltd.

Address before: 201306 N2025 room 24, 2 New Town Road, mud town, Pudong New Area, Shanghai

Patentee before: SHANGHAI LIANSHANG NETWORK TECHNOLOGY Co.,Ltd.

TR01 Transfer of patent right