CN106488494A - A kind of method of monitoring network connection state - Google Patents

A kind of method of monitoring network connection state Download PDF

Info

Publication number
CN106488494A
CN106488494A CN201610199962.3A CN201610199962A CN106488494A CN 106488494 A CN106488494 A CN 106488494A CN 201610199962 A CN201610199962 A CN 201610199962A CN 106488494 A CN106488494 A CN 106488494A
Authority
CN
China
Prior art keywords
network
state
cloud server
privately owned
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.)
Pending
Application number
CN201610199962.3A
Other languages
Chinese (zh)
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.)
Shenzhen Meibeike Technology Co Ltd
Original Assignee
Shenzhen Meibeike 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 Shenzhen Meibeike Technology Co Ltd filed Critical Shenzhen Meibeike Technology Co Ltd
Priority to CN201610199962.3A priority Critical patent/CN106488494A/en
Publication of CN106488494A publication Critical patent/CN106488494A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/08Testing, supervising or monitoring using real traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0805Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability
    • H04L43/0811Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters by checking availability by checking connectivity
    • 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/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04MTELEPHONIC COMMUNICATION
    • H04M1/00Substation equipment, e.g. for use by subscribers
    • H04M1/72Mobile telephones; Cordless telephones, i.e. devices for establishing wireless links to base stations without route selection
    • H04M1/724User interfaces specially adapted for cordless or mobile telephones
    • H04M1/72403User interfaces specially adapted for cordless or mobile telephones with means for local support of applications that increase the functionality
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition

Landscapes

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

Abstract

The present invention provides a kind of method of monitoring network connection state, comprises the steps:Step 1, smart machine obtain the mobile phone terminal network state being connected with smart device communication;Step 2, the mobile phone terminal return conditional code, and the smart machine judges the network state of current network by the conditional code of return;Step 3, the smart machine obtain the state value of connection outer net, judge according to the state value whether current network connects and surf the Internet.Technical scheme is compared with prior art, there is provided a kind of correct method for judging network connection state.

Description

A kind of method of monitoring network connection state
Technical field
The present invention relates to intelligent hardware devices field, particularly a kind of method of monitoring network connection state.
Background technology
At this stage, Internet service tells development, and various intelligent terminals also become indispensable in people's daily life A part.Intelligent terminal is required for obtaining data from network mostly at present, so it is inevitable to access network.
Under android system platform, we access network before, network state should be first determined whether, according to work as Front network state is carrying out judgement process, and is not to directly access network.A lot of developers directly judge this network One step is directly skipped, and is directly accessed network, if be currently at suspension state, various experience can be caused bad.Another a lot of feelings It is to download pictures or download a film that under condition, intelligent terminal accesses network, and user is it is desirable that in Wi-Fi shape File is downloaded under state, and general generic access is then unrestricted.For such case, network state is monitored then unavoidable.
Wherein Wi-Fi and wired connection are connected in router, and a lot of routers all do and excessive do not connect at this stage When connecing network, the terminal request for being connected to router accesses network, and the network address is intercepted and is redirected to one newly by router Address, now network judge return ResponseCode value be 200, cause terminal network connection judgment mistake.
Content of the invention
The present invention is directed to above-mentioned problems of the prior art, provides a kind of method of monitoring network state, the side Method needs the router of a mobile terminal and mobile terminal connection, by the privately owned Cloud Server of router access outer net. The technical scheme that the present invention is provided is by smart machine monitoring when mobile phone terminal accesses network, provides network connection state, with Just program subsequent treatment, in addition the privately owned Cloud Server of monitoring intelligent equipment whether can correctly have access to external network.Have The domestic intelligent equipment of These characteristics has following technical scheme.
A kind of method of monitoring network connection state, comprises the steps:
Step 1, intelligent terminal judge intelligent terminal current network state by obtaining conditional code;
Step 2, according to step 1, when judging intelligent terminal current network state for Wi-Fi network state by conditional code, described Connection status value of the intelligent terminal by the privately owned Cloud Server of router solicitation;
Step 3, the privately owned Cloud Server return the connection that the privately owned Cloud Server is connected with router network according to request State value;
Step 4, the intelligent terminal analyze connection status value, judge router whether with external network successful connection.
The mobile phone terminal returns conditional code, judges the network state of current network by the conditional code that returns, if Current network state is mobile network's state, then can judge whether subsequent network request can access according to agreement.
The ground that the address of privately owned Cloud Server is that the request agreement and private clound cannot be accessed asked by the intelligent terminal Location.
When smart machine receives the state value of privately owned Cloud Server return, judge that whether state value is the ground of the request Location returns, and can if it is connect external network.
When smart machine receives the state value of privately owned Cloud Server return, judge that whether state value is the ground of the request Location returns, if not then not connecting external network.
Technical scheme compared with prior art, has the advantage that:Provide one kind and correctly judge that network connects The method for connecing state, obtaining outer net by router, to connect the connection status value of privately owned Cloud Server outer to judge whether to be connected to Net, it is to avoid frequently read the data of the privately owned Cloud Server of outer net, so as to mitigate the pressure of privately owned Cloud Server.
Description of the drawings
Fig. 1 is a kind of FB(flow block) of the method for monitoring network connection state of the present invention.
Specific embodiment
Embodiments of the invention are described in detail below in conjunction with accompanying drawing, but the present invention can be defined by the claims Implement with the multitude of different ways for covering.
A kind of method of monitoring network connection state, methods described need a kind of smart machine with double Wi-Fi, wherein One WIFI and mobile phone connection constructing local network, the 2nd WIFI by the privately owned Cloud Server of the smart machine be connected with router because Special net, the smart machine with above-mentioned technical characteristic, the method for the monitoring network connection state which includes, be as follows Realize:
Step 1, smart machine obtain the mobile phone terminal network state being connected with smart device communication;
Step 2, the mobile phone terminal return conditional code, and the smart machine judges current network by the conditional code of return Network state;
Step 3, the smart machine obtain the state value of connection outer net, judge according to the state value whether current network connects Connect internet
By the specific embodiment of the present invention, in conjunction with the step listed by Fig. 1, illustrate.
In step 1, before smart machine accesses external network, judge that current network connects.
In smart machine, NetworkInfo is obtained by software and is obtaining NetworkInfo networkInfo- connMgr.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
In step 2, current phone intelligence is obtained by obtaining NetworkInfo state value networkInfo.getType () Can terminal network state.The state value of acquisition is as follows:
NetworkInfo.getType ()==0 current network is mobile network's state;
NetworkInfo.getType ()==1 current network is WIFI network state.
In step 3, by the conditional code that returns judging the network state of current network, if current network state is According to agreement, mobile network's state, then can judge whether subsequent network request can access, for example:Common protocol can be accessed Request, does not allow to access and downloads upload function request.
If current network state is WIFI network state, " get " request connection connect private clound address, privately owned Cloud returns connection status value.
Judge whether current network connects according to the state value for returning to connect to the Net.
The address that address is defined with privately owned cloud server terminal for client, privately owned cloud server terminal can not find the address and access Resource.
State value is generally numerical value 404 or 405, when client is can not find with the address resource of service end protocol definition, State value is 404, or when private clound forbids that accessing " get " asks, state value is 405, and Web server returns the state value To client.
When client receives the state value of privately owned Cloud Server return, determine whether 404 or 405, if it is may be used To connect external network, if not then not connecting external network.
It is to access an address accessed less than resource that why client accesses private clound?This is because having at this stage A lot of routers, when router does not connect external network, and client is by WIFI or wired connection router, client Network state is connected during the network connection state that end shows, this is incorrect.
And when client request connect connects private clound, correct in spite of address, router all can be by network Connect address intercepts and redirects a new address, and the state value for now returning is then 200, generally, state value 200 resources that have found the network address for privately owned Cloud Server, connection are correct.But now because address is reset to router To arriving another address, so can not judge successively to connect external network whether successful connection, so needing with private clound Define a wrong address to carry out network judgement.For example:Client sends the address of definition to private clound, through router When, router finds not connecting external network, and new address is redirected in address, and it is 200 to return client, then client is sentenced Disconnected current network connection failure, if the address for accessing return be 404 or 405 if, then affirm that this 404 or 405 is The conditional code that outside WEB server is returned, then can determine that currently and can connect external network.
The preferred embodiments of the present invention are these are only, the present invention is not limited to, for those skilled in the art For member, the present invention can have various modifications and variations.All any modifications that within the spirit and principles in the present invention, is made, Equivalent, improvement etc., should be included within the scope of the present invention.

Claims (5)

1. a kind of monitoring network connection state method, it is characterised in that comprise the steps:
Step 1, intelligent terminal judge intelligent terminal current network state by obtaining conditional code;
Step 2, according to step 1, when judging intelligent terminal current network state for Wi-Fi network state by conditional code, described Connection status value of the intelligent terminal by the privately owned Cloud Server of router solicitation;
Step 3, the privately owned Cloud Server return the connection that the privately owned Cloud Server is connected with router network according to request State value;
Step 4, the intelligent terminal analyze connection status value, judge router whether with external network successful connection.
2. method according to claim 1, it is characterised in that the conditional code that the intelligent terminal is obtained, by returned Conditional code is judging the network state of current network, if current network state is mobile network's state, can be according to agreement Judge whether subsequent network request can access.
3. method according to claim 1, it is characterised in that the intelligent terminal asks the address of privately owned Cloud Server to be The address that the request agreement and private clound cannot be accessed.
4. method according to claim 3, it is characterised in that smart machine receives the state of privately owned Cloud Server return During value, judge that whether state value is that the address of the request returns, can if it is connect external network.
5. method according to claim 3, it is characterised in that smart machine receives the state of privately owned Cloud Server return During value, judge that whether state value is that the address of the request returns, if not then not connecting external network.
CN201610199962.3A 2016-03-31 2016-03-31 A kind of method of monitoring network connection state Pending CN106488494A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610199962.3A CN106488494A (en) 2016-03-31 2016-03-31 A kind of method of monitoring network connection state

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610199962.3A CN106488494A (en) 2016-03-31 2016-03-31 A kind of method of monitoring network connection state

Publications (1)

Publication Number Publication Date
CN106488494A true CN106488494A (en) 2017-03-08

Family

ID=58238356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610199962.3A Pending CN106488494A (en) 2016-03-31 2016-03-31 A kind of method of monitoring network connection state

Country Status (1)

Country Link
CN (1) CN106488494A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294811A (en) * 2017-07-28 2017-10-24 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
US11082816B2 (en) * 2017-08-09 2021-08-03 Qualcomm Incorporated Environmental sensing with wireless communication devices

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8036132B1 (en) * 2007-02-06 2011-10-11 At&T Intellectual Property Ii, Lp Systems, devices, and methods for determining network failures
CN103036735A (en) * 2011-10-06 2013-04-10 升泰科技股份有限公司 Network connection state detection system and method thereof
CN103812728A (en) * 2014-02-13 2014-05-21 普联技术有限公司 Network diagnostic method, system and router

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8036132B1 (en) * 2007-02-06 2011-10-11 At&T Intellectual Property Ii, Lp Systems, devices, and methods for determining network failures
CN103036735A (en) * 2011-10-06 2013-04-10 升泰科技股份有限公司 Network connection state detection system and method thereof
CN103812728A (en) * 2014-02-13 2014-05-21 普联技术有限公司 Network diagnostic method, system and router

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107294811A (en) * 2017-07-28 2017-10-24 广东欧珀移动通信有限公司 Network detecting method, network detection means and intelligent terminal
US11082816B2 (en) * 2017-08-09 2021-08-03 Qualcomm Incorporated Environmental sensing with wireless communication devices

Similar Documents

Publication Publication Date Title
CN107995215B (en) Control method and device of intelligent household equipment and cloud platform server
CN108156240B (en) Method and system for accessing industrial adapter to server
CN109582684A (en) A kind of update method of local cache data, device, server and storage medium
CN111796858A (en) Method, system and related equipment for access detection of application programs in Kubernetes cluster
CN106507383B (en) Real name auditing method, equipment and system
CN105992390A (en) Method and system for enabling mobile terminal to be connected with WIFI router
CN115335803B (en) Equipment upgrading method, intelligent equipment and computer readable storage medium
CN106559856B (en) WIFI hotspot identification method and device
CN107395451B (en) Processing method, device and equipment for internet traffic abnormity and storage medium
CN106488494A (en) A kind of method of monitoring network connection state
CN108093097A (en) The connection method of camera and home gateway and home gateway
CN104582011B (en) A kind of method and apparatus for mobile terminal to be connected to network
CN111405059A (en) Data transmission method of cloud equipment, electronic equipment and Internet of things system
CN106992893A (en) The management method and device of router
KR20180050001A (en) Firmware upgrade system and method for IoT
CN103997416B (en) The error correction method and error correction device of mobile terminal Internet access
CN109640181A (en) A method of home gateway is upgraded by set-top box
US20140136597A1 (en) Relay enabled dynamic virtual private network
CN114115074B (en) Device control method and apparatus, computer readable storage medium, and processor
CN103002564B (en) Wireless Internet access method, radio networking device, server and wireless networking system
CN106470252B (en) The method and communication terminal of application program inquiry IP address
CN113448607B (en) Method and device for firmware upgrading and intelligent household appliance
CN113132333B (en) Networking login method, household appliance equipment, household appliance system and storage medium
CN111124445B (en) Home gateway upgrading method and home gateway
CN111898117A (en) Mutually exclusive application processing method, device, terminal and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20170308

WD01 Invention patent application deemed withdrawn after publication