CN103906122A - Network switch detection method and relevant devices - Google Patents

Network switch detection method and relevant devices Download PDF

Info

Publication number
CN103906122A
CN103906122A CN201210586378.5A CN201210586378A CN103906122A CN 103906122 A CN103906122 A CN 103906122A CN 201210586378 A CN201210586378 A CN 201210586378A CN 103906122 A CN103906122 A CN 103906122A
Authority
CN
China
Prior art keywords
network
terminal
wifi
connection
current
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
CN201210586378.5A
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201210586378.5A priority Critical patent/CN103906122A/en
Publication of CN103906122A publication Critical patent/CN103906122A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The embodiment of the invention discloses a network switch detection method and relevant devices. The network switch detection method and the relevant devices are used for reminding a user to use the internet under a non-WiFi condition. The network switch detection method comprises the steps of detecting the current network connection type of a terminal and sending a prompt message to the user if the network connection type is non-WiFi network connection.

Description

A kind of network switching detection method and relevant apparatus
Technical field
The present invention relates to terminal field, relate in particular to a kind of network switching detection method and relevant apparatus.
Background technology
The mobile phone users of China uses Wireless Fidelity (WiFi, wireless fidelity) generally limit flow not of network online, but, general packet radio service technology (GPRS, General Packet Radio Service) network or 3G (Third Generation) Moblie technology (3G, 3rd-generation) network generally charge by flow, therefore, if use GPRS network or 3G network online, campus network is more expensive; Especially be under use scenes at voice, picture and video, easily produce huge campus network, and a little less than user do not have perception or perception.
In the prior art, user generally should be used for monitoring flow amount situation by opening third party, can preset an alarm threshold value, while reaching this alarm threshold value, sends alarm to user; This alarm mode is owing to being to produce after flow just to send prompting, and user forgets that opening this third party's application monitors, and makes user cannot stop in time non-WiFi flow generation after restarting machine sometimes.
Summary of the invention
The embodiment of the present invention provides a kind of network switching detection method and relevant apparatus, and the network for reminding user under non-WiFi state uses.
The network switching detection method that the embodiment of the present invention provides, comprising:
The network that calls terminal detects application programming interface (API, Application Programming Interface);
Indicate the operating system of described terminal to return to the information of current network connection type;
Connect if described network connection type is non-Wireless Fidelity WiFi network, send information to user.
The terminal that the embodiment of the present invention provides, comprising:
Connect detecting unit, detect API for the network that calls terminal, indicate the operating system of described terminal to return to the information of current network connection type;
User's Tip element, if be that non-Wireless Fidelity WiFi network connects for described network connection type, sends information to user.
As can be seen from the above technical solutions, the embodiment of the present invention has the following advantages:
In embodiments of the present invention, the current network connection type of sense terminals; If being non-Wireless Fidelity WiFi network, described network connection type connects, send information to user, if continue operation with reminding user, can produce non-WiFi flow, user is taken appropriate measures, thereby avoid allowing user produce non-WiFi flow conscious in the situation that non-.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
Fig. 1 is a schematic flow sheet of embodiment of the present invention network switching detection method;
Fig. 2 is another schematic flow sheet of embodiment of the present invention network switching detection method;
Fig. 3 is another schematic flow sheet of embodiment of the present invention network switching detection method;
Fig. 4 is another schematic flow sheet of embodiment of the present invention network switching detection method;
Fig. 5 is the logical construction schematic diagram of embodiment of the present invention terminal.
Embodiment
The embodiment of the present invention provides a kind of network switching detection method and relevant apparatus, and the network for reminding user under non-WiFi state uses.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Refer to Fig. 1, in the embodiment of the present invention, network switching detection method embodiment comprises:
101, the current network connection type of sense terminals;
Terminal detects current network connection type, connects if described network connection type is non-WiFi network, performs step 102; Connect if described network connection type is WiFi network, finish the operation of current flow process.Concrete, the current network connection type of sense terminals can be: the network that calls described terminal detects API, and the operating system of indicating terminal is returned to the information of current network connection type.
102, send information to user.
Terminal sends information to user; Optionally, the content of described information can be: currently using non-WiFi network to carry out network operation, will produce non-WiFi flow process.
Optionally, after having sent information, can also push to user " handover network connect interface ", make user can be timely more switching network proceed network operation.
In embodiments of the present invention, the current network connection type of sense terminals; If being non-Wireless Fidelity WiFi network, described network connection type connects, send information to user, if continue operation with reminding user, can produce non-WiFi flow, user is taken appropriate measures, thereby avoid allowing user produce non-WiFi flow conscious in the situation that non-.
Below the triggering scene of the embodiment of the present invention is described, refers to Fig. 2, in the embodiment of the present invention, another embodiment of network switching detection method comprises:
In embodiments of the present invention, user has opened the connection of WiFi network simultaneously and has been connected with mobile network in mobile terminal, and is provided with preferential use WiFi network.
201, the detection of WiFi network;
In actual applications, mobile terminal can regularly detect the situation that WiFi in connection status or the surrounding environment of WiFi network can tie point.
Optionally, suppose to use the mobile terminal of WiFi network that movement has occurred, use mobile terminal to disconnect and being connected with current WiFi network, mobile terminal continues to detect the situation that WiFi in surrounding environment can tie point, if terminal cannot detect any WiFi tie point, or all failures of the connection of current all WiFi tie points, trigger step 202.
When terminal cannot detect any WiFi tie point, or current all WiFi can tie point connection all when failure, determine currently cannot use WiFi network, therefore, will there is the switching that network connects in terminal, can carry out the prompting flow process that the non-WiFi network in the embodiment of the present invention connects.
202, the current network connection type of sense terminals;
Terminal detects current network connection type, connects if described network connection type is non-WiFi network, performs step 203; Connect if described network connection type is WiFi network, finish the operation of current flow process.
Non-WiFi network connects the connection that refers to mobile network in embodiments of the present invention, and described mobile network comprises: 2G network or 3G network.
Concrete, the current network connection type of sense terminals can be: the network that calls described terminal detects API, and the operating system of indicating terminal is returned to the information of current network connection type.Optionally, the network connection type that API can know that terminal is current by obtaining network data message; Detect the Internet Transmission path of described network data message, if described network data message transmits by WLAN (wireless local area network), described current network connection type is that WiFi network connects; If described network data message is by base-station transmission, described current network connection type is mobile network's connection.
Optionally, in embodiments of the present invention, all right current network service state of sense terminals, if terminal request is carried out network service, triggers the step of the current network connection type of described sense terminals.Concrete, described network service can comprise: accessed web page, media content download, video calling etc.
Optionally, can also trigger every preset duration the step of the current network connection type of described sense terminals.
Be understandable that in actual applications, can also have other to trigger the condition that current network connection type detects, be not construed as limiting herein.
203, send information to user.
Terminal sends information to user; Optionally, the content of described information can be: currently using non-WiFi network to carry out network operation, will produce non-WiFi flow process.
Optionally, after having sent information, can also push to user " handover network connect interface ", make user can be timely more switching network proceed network operation.
Respectively network switching detection method of the present invention in installation system is described below, refers to Fig. 3, in the embodiment of the present invention, another embodiment of network switching detection method comprises:
301, the current network service state of sense terminals;
The network service state that sense terminals is current, if terminal request is carried out network service, performs step 302.
302, call the control interface of url management;
Terminal is called the control interface of url management, asks described Android system to return to respectively mobile network's connection status and the connection status of WiFi network.
The control interface (Connectivity Manager conMan) of described url management is a kind of API application under Android system, can be used for asking Android system to feed back current mobile network's connection status and the connection status of WiFi network.
303, receive mobile network's connection status and the connection status of WiFi network of Android system feedback;
Terminal receives mobile network's connection status and the connection status of WiFi network of Android system feedback; Concrete, the code information of Android system feedback can be: State mobile=conMan.getNetworkInfo (ConnectivityManager.TYPE_MOBILE) .getState (); Txt3G.setText (mobile.toString ()) (showing 3G network connection status), and State wifi=conMan.getNetworkInfo (ConnectivityManager.TYPE_WIFI) .getState (); TxtWifi.set Text (wifi.toString ()) (showing wifi network connection state); Terminal can determine that whether current network connection type is that non-WiFi network connects, and if so, performs step 304 by Android system feedack; If not, finish the operation of current flow process.
304, send information to user.
Terminal sends information to user; Optionally, the content of described information can be: currently using non-WiFi network to carry out network operation, will produce non-WiFi flow process.
Optionally, after having sent information, can also push to user " handover network connect interface ", make user can be timely more switching network proceed network operation.
Below network switching detection method of the present invention in IOS system is described, refers to Fig. 4, in the embodiment of the present invention, another embodiment of network switching detection method comprises:
401, the current network service state of sense terminals;
The network service state that sense terminals is current, if terminal request is carried out network service, performs step 402.
402, hyperlink target detects network address;
Terminal link target detection network address, described target detection network address is a default address test of terminal.
The code information that IOS system is carried out can be:
Reachability*r=[Reachability?reachabilityWithHostName:@“ www.apple.com”];
403, call current network connection status thread;
Terminal is called current network connection status thread, asks described IOS system to return to the current network connection state of terminal.
Three kinds of network connection state in the API application of IOS system, are defined: connect (NotReachable=0), mobile network's connection (ReachableViaWiFi) or WiFi network without network and connect (ReachableViaWiFi).
The code information that IOS system is carried out can be:
Figure BDA00002673367600061
Terminal can determine that whether current network connection type is that non-WiFi network connects, and if so, performs step 404 by the information of IOS system feedback; If not, finish the operation of current flow process.
404, send information to user.
Terminal sends information to user; Optionally, the content of described information can be: currently using non-WiFi network to carry out network operation, will produce non-WiFi flow process.
Optionally, after having sent information, can also push to user " handover network connect interface ", make user can be timely more switching network proceed network operation.
Only with some examples, the application scenarios in the embodiment of the present invention is illustrated above, is understandable that, in actual applications, can also have more application scenarios, be specifically not construed as limiting herein.
To realizing the terminal of above-mentioned network switching detection method, be described below, refer to Fig. 5, in the embodiment of the present invention, terminal embodiment comprises:
Connect detecting unit 501, detect API for the network that calls terminal, indicate the operating system of described terminal to return to the information of current network connection type;
User's Tip element 502, if be that non-Wireless Fidelity WiFi network connects for described network connection type, sends information to user.
Optionally, described connection detecting unit 501 may further include:
First detection module 5011, if be Android system for the operating system of described terminal, calls the control interface of url management, asks described Android system to return to respectively mobile network's connection status and the connection status of WiFi network.
Or,
The second detection module 5012, if be IOS system for the operating system of described terminal, hyperlink target detects network address; Call current network connection status thread, ask described IOS system to return to the current network connection state of terminal, described network connection state comprises: connect or the connection of WiFi network without network connection, mobile network.
Optionally, described terminal may further include:
Tie point detecting unit 503, for detection of the WiFi tie point in target zone, if terminal cannot detect any WiFi tie point, or all failures of the connection of current all WiFi tie points, trigger described connection detecting unit.
The specific operation process of above-mentioned unit/module refers to embodiment of the method, repeats no more herein.
In the several embodiment that provide in the application, should be understood that, disclosed apparatus and method can realize by another way.For example, device embodiment described above is only schematic, for example, the division of described unit, be only that a kind of logic function is divided, when actual realization, can have other dividing mode, for example multiple unit or assembly can in conjunction with or can be integrated into another system, or some features can ignore, or do not carry out.Another point, shown or discussed coupling each other or direct-coupling or communication connection can be by some interfaces, indirect coupling or the communication connection of device or unit can be electrically, machinery or other form.
The described unit as separating component explanation can or can not be also physically to separate, and the parts that show as unit can be or can not be also physical locations, can be positioned at a place, or also can be distributed in multiple network element.Can select according to the actual needs some or all of unit wherein to realize the object of the present embodiment scheme.
In addition, the each functional unit in each embodiment of the present invention can be integrated in a processing unit, can be also that the independent physics of unit exists, and also can be integrated in a unit two or more unit.Above-mentioned integrated unit both can adopt the form of hardware to realize, and also can adopt the form of SFU software functional unit to realize.
If described integrated unit is realized and during as production marketing independently or use, can be stored in a computer read/write memory medium using the form of SFU software functional unit.Based on such understanding, the all or part of of the part that technical scheme of the present invention contributes to prior art in essence in other words or this technical scheme can embody with the form of software product, this computer software product is stored in a storage medium, comprise that some instructions (can be personal computers in order to make a computer equipment, server, or the network equipment etc.) carry out all or part of step of method described in each embodiment of the present invention.And aforesaid storage medium comprises: various media that can be program code stored such as USB flash disk, portable hard drive, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disc or CDs.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, any be familiar with those skilled in the art the present invention disclose technical scope in; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should described be as the criterion with the protection range of claim.

Claims (10)

1. a network switching detection method, is characterized in that, comprising:
The network that calls terminal detects application programming interface API;
Indicate the operating system of described terminal to return to the information of current network connection type;
Connect if described network connection type is non-Wireless Fidelity WiFi network, send information to user.
2. method according to claim 1, is characterized in that, described in call the application programming interface API of described terminal, the operating system of indicating terminal is returned to the information of current network connection type, comprising:
Call the control interface of url management, ask the operating system of described terminal to return to respectively mobile network's connection status and the connection status of WiFi network.
3. method according to claim 1, is characterized in that, described in call described terminal network detect API, the operating system of indicating terminal is returned to the information of current network connection type, comprising:
Hyperlink target detects network address;
Call current network connection status thread, ask the operation of described terminal to return to the current network connection state of terminal, described network connection state comprises: connect or the connection of WiFi network without network connection, mobile network.
4. method according to claim 1, is characterized in that, described in call described terminal network detect API, the operating system of indicating terminal is returned to the information of current network connection type, comprising:
Obtain network data message;
Detect the Internet Transmission path of described network data message, if described network data message transmits by WLAN (wireless local area network), described current network connection type is that WiFi network connects; If described network data message is by base-station transmission, described current network connection type is mobile network's connection.
5. according to arbitrarily described method once of claim 1 to 4, it is characterized in that, described in call terminal network detect API, comprising:
In the time that terminal request is carried out network service, the network that calls terminal detects API;
Or,
The network that calls terminal every preset duration detects API.
6. according to arbitrarily described method once of claim 1 to 4, it is characterized in that, described in call terminal network detect API before, comprising:
If terminal cannot detect any WiFi tie point, or all failures of the connection of current all WiFi tie points, the step of the network detection API of terminal is called in triggering.
7. a terminal, is characterized in that, comprising:
Connect detecting unit, detect API for the network that calls terminal, indicate the operating system of described terminal to return to the information of current network connection type;
User's Tip element, if be that non-Wireless Fidelity WiFi network connects for described network connection type, sends information to user.
8. terminal according to claim 7, is characterized in that, described connection detecting unit comprises:
First detection module, for calling the control interface of url management, asks described Android system to return to respectively mobile network's connection status and the connection status of WiFi network.
Or,
The second detection module, detects network address for hyperlink target; Call current network connection status thread, ask described IOS system to return to the current network connection state of terminal, described network connection state comprises: connect or the connection of WiFi network without network connection, mobile network.
9. terminal according to claim 7, is characterized in that, described connection detecting unit is also in the time that terminal request is carried out network service, and the network that calls described terminal detects API; Or the network that calls described terminal every preset duration detects API.
10. terminal according to claim 7, is characterized in that, described terminal also comprises:
Tie point detecting unit, for detection of the WiFi tie point in target zone, if terminal cannot detect any WiFi tie point, or all failures of the connection of current all WiFi tie points, trigger described connection detecting unit.
CN201210586378.5A 2012-12-28 2012-12-28 Network switch detection method and relevant devices Pending CN103906122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210586378.5A CN103906122A (en) 2012-12-28 2012-12-28 Network switch detection method and relevant devices

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210586378.5A CN103906122A (en) 2012-12-28 2012-12-28 Network switch detection method and relevant devices

Publications (1)

Publication Number Publication Date
CN103906122A true CN103906122A (en) 2014-07-02

Family

ID=50997225

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210586378.5A Pending CN103906122A (en) 2012-12-28 2012-12-28 Network switch detection method and relevant devices

Country Status (1)

Country Link
CN (1) CN103906122A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105635448A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Message sending method and device
CN105657071A (en) * 2016-04-01 2016-06-08 太仓日森信息技术有限公司 Live telecast push method based on network environments
CN105703965A (en) * 2014-11-26 2016-06-22 中国移动通信集团公司 Detection method and detection device for access network, and terminal
CN105813143A (en) * 2014-12-29 2016-07-27 北京新媒传信科技有限公司 Method and device for supporting network handover of application program
CN106792816A (en) * 2016-12-21 2017-05-31 北京邮电大学 A kind of network state management and control detection method of intelligent terminal
CN109362111A (en) * 2018-12-24 2019-02-19 上海连尚网络科技有限公司 Information cuing method

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101651973A (en) * 2009-08-26 2010-02-17 广州市动景计算机科技有限公司 Network switching method for mobile communication equipment terminals and system thereof
CN101754187A (en) * 2009-12-30 2010-06-23 中兴通讯股份有限公司 Management method for connection setting and terminal thereof
US20100157960A1 (en) * 2008-12-18 2010-06-24 Microsoft Corporation Wireless access point supporting control by multiple applications
CN101894141A (en) * 2010-06-22 2010-11-24 惠州Tcl移动通信有限公司 Information prompting method for access of mobile terminal to mobile Internet website and mobile terminal
CN102316507A (en) * 2011-09-09 2012-01-11 深圳市朵唯志远科技有限公司 Method for detecting mobile terminal network signal, system and mobile terminal thereof
CN102438289A (en) * 2011-12-26 2012-05-02 中国电信股份有限公司 Wireless fidelity (Wi-Fi) flow guide method and device as well as mobile terminal
CN102799447A (en) * 2012-06-19 2012-11-28 优视科技有限公司 Method and system for updating internal software of mobile terminal

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100157960A1 (en) * 2008-12-18 2010-06-24 Microsoft Corporation Wireless access point supporting control by multiple applications
CN101651973A (en) * 2009-08-26 2010-02-17 广州市动景计算机科技有限公司 Network switching method for mobile communication equipment terminals and system thereof
CN101754187A (en) * 2009-12-30 2010-06-23 中兴通讯股份有限公司 Management method for connection setting and terminal thereof
CN101894141A (en) * 2010-06-22 2010-11-24 惠州Tcl移动通信有限公司 Information prompting method for access of mobile terminal to mobile Internet website and mobile terminal
CN102316507A (en) * 2011-09-09 2012-01-11 深圳市朵唯志远科技有限公司 Method for detecting mobile terminal network signal, system and mobile terminal thereof
CN102438289A (en) * 2011-12-26 2012-05-02 中国电信股份有限公司 Wireless fidelity (Wi-Fi) flow guide method and device as well as mobile terminal
CN102799447A (en) * 2012-06-19 2012-11-28 优视科技有限公司 Method and system for updating internal software of mobile terminal

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105703965A (en) * 2014-11-26 2016-06-22 中国移动通信集团公司 Detection method and detection device for access network, and terminal
CN105813143A (en) * 2014-12-29 2016-07-27 北京新媒传信科技有限公司 Method and device for supporting network handover of application program
CN105813143B (en) * 2014-12-29 2019-11-29 北京新媒传信科技有限公司 A kind of method and apparatus for supporting application program network switching
CN105635448A (en) * 2015-12-25 2016-06-01 小米科技有限责任公司 Message sending method and device
CN105635448B (en) * 2015-12-25 2019-02-19 小米科技有限责任公司 Message method and device
CN105657071A (en) * 2016-04-01 2016-06-08 太仓日森信息技术有限公司 Live telecast push method based on network environments
CN105657071B (en) * 2016-04-01 2018-11-30 盐城吉大智能终端产业研究院有限公司 A kind of live information method for pushing of Network Environment
CN106792816A (en) * 2016-12-21 2017-05-31 北京邮电大学 A kind of network state management and control detection method of intelligent terminal
CN109362111A (en) * 2018-12-24 2019-02-19 上海连尚网络科技有限公司 Information cuing method

Similar Documents

Publication Publication Date Title
CN110557777B (en) Network connection control method, terminal and storage medium
CN103906122A (en) Network switch detection method and relevant devices
EP3537734B1 (en) Method and device for connecting a bluetooth device
CN104657213A (en) Intersystem application switching method and terminal
CN104994466A (en) Multiple playing device bluetooth connection control method and device and music playing system
CN105407407A (en) Video playing method and device
CN111866937B (en) Information reporting and receiving method and device, related equipment and storage medium
CN103838648A (en) Terminal and data backup method
CN110677869B (en) Network connection control method, terminal and storage medium
CN111132382A (en) Connection mode control method, terminal and storage medium
CN109768884A (en) The implementation method of communication system and its high availability, device and computer equipment
CN104166591A (en) Method and device for avoiding forced interruption of game
US20230262572A1 (en) Communication method and related device
CN102724565B (en) Abnormal signal processing method and device for mobile terminal
CN105814934A (en) Method, mobility management entity and home subscriber server for handling callee service
CN108141901B (en) Method and terminal for controlling service connection
EP3585036B1 (en) Recording method for mobile terminal, and mobile terminal
US20160142956A1 (en) Method and Apparatus for Information Processing and Communication System
CN103106037B (en) A kind of mobile terminal switches the method and system of playout software song
CN104869445A (en) A method for realizing content sharing between intelligent terminals based on a cloud system and the cloud system
CN103873681A (en) Information processing method and electronic equipment
CN112637964B (en) Network dual-connection management method, device, equipment and storage medium
CN104639356A (en) Failure recovery method and device
CN104063033A (en) State switching method based on electronic equipment interlinking and electronic equipment
WO2020223862A1 (en) Mounting processing method and apparatus, electronic device, and computer readable 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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140702