CN113709086B - Network detection method, device, electronic device and storage medium - Google Patents
Network detection method, device, electronic device and storage medium Download PDFInfo
- Publication number
- CN113709086B CN113709086B CN202010441027.XA CN202010441027A CN113709086B CN 113709086 B CN113709086 B CN 113709086B CN 202010441027 A CN202010441027 A CN 202010441027A CN 113709086 B CN113709086 B CN 113709086B
- Authority
- CN
- China
- Prior art keywords
- network
- detection
- preset
- terminal
- status code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000001514 detection method Methods 0.000 title claims abstract description 150
- 238000000034 method Methods 0.000 claims abstract description 26
- 230000007246 mechanism Effects 0.000 claims abstract description 18
- 238000004590 computer program Methods 0.000 claims description 31
- 230000006870 function Effects 0.000 claims description 16
- 230000002618 waking effect Effects 0.000 claims description 5
- 238000012545 processing Methods 0.000 claims description 4
- 238000004891 communication Methods 0.000 abstract description 2
- 238000010586 diagram Methods 0.000 description 6
- 238000012546 transfer Methods 0.000 description 5
- 230000008569 process Effects 0.000 description 3
- 238000004458 analytical method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000012544 monitoring process Methods 0.000 description 2
- 239000000523 sample Substances 0.000 description 2
- 230000001360 synchronised effect Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
- H04L63/107—Network architectures or network communication protocols for network security for controlling access to devices or network resources wherein the security policies are location-dependent, e.g. entities privileges depend on current location or allowing specific operations only from locally connected terminals
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D30/00—Reducing energy consumption in communication networks
- Y02D30/70—Reducing energy consumption in communication networks in wireless communication networks
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Hardware Design (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及网络技术领域,特别是涉及一种网络侦测方法、装置、电子设备和存储介质。The present application relates to the field of network technology, in particular to a network detection method, device, electronic equipment and storage medium.
背景技术Background technique
随着科学技术的发展,智能手机、平板等移动终端在人们的生产生活中得到了广泛的应用。用户可以通过终端设备接入网络,从而获取各种资讯或者学习各种技能等,这些都极大地方便了人们的生产生活。With the development of science and technology, mobile terminals such as smartphones and tablets have been widely used in people's production and life. Users can access the network through terminal devices to obtain various information or learn various skills, which greatly facilitate people's production and life.
可以通过用户卡将终端设备接入网络,也可以将终端设备接入某些场所开放的无线网络。比如,在无线网络覆盖区域,用户可以在终端设备上通过网页登录认证的方式接入该无线网络。而受限于安卓原生的网络侦测机制,导致终端设备在某些地区无法接入网络。The terminal equipment can be connected to the network through the user card, and the terminal equipment can also be connected to the wireless network opened in some places. For example, in a wireless network coverage area, a user may access the wireless network through a web page login authentication method on a terminal device. However, limited by Android's native network detection mechanism, terminal devices cannot access the network in some areas.
发明内容Contents of the invention
基于此,有必要针对现有的终端设备在某些地区无法通过网页登录认证的方式接入网络的技术问题,提供一种网络侦测方法、装置、电子设备和存储介质。Based on this, it is necessary to provide a network detection method, device, electronic device and storage medium to address the technical problem that existing terminal equipment cannot access the network through web page login authentication in some areas.
一种网络侦测方法,所述方法包括:A network detection method, said method comprising:
获取终端的实时地理位置;Obtain the real-time geographic location of the terminal;
当所述实时地理位置在预设范围内时,获取网络状态侦测地址集合;When the real-time geographic location is within a preset range, acquiring a network status detection address set;
分别根据所述网络状态侦测地址集合中的地址发送探测请求,获得状态码;sending detection requests respectively according to the addresses in the network state detection address set to obtain status codes;
当所述状态码中存在预设状态码时,判定所述终端处于网络连通状态。When the preset status code exists in the status code, it is determined that the terminal is in a network connected state.
在一个实施例中,所述当所述状态码中存在预设状态码时,判定所述终端处于网络连通状态包括:In one embodiment, when there is a preset status code in the status code, determining that the terminal is in a network connection state includes:
当所述状态码中存在预设第一状态码时,判定所述终端处于网络直接连通状态;When there is a preset first status code in the status code, it is determined that the terminal is in a state of direct network connection;
当所述状态码中不存在所述预设第一状态码,且存在预设第二状态码时,判定所述终端处于网络转址连通状态。When the preset first status code does not exist in the status codes and the preset second status code exists, it is determined that the terminal is in a network forwarding connected state.
在一个实施例中,所述当所述状态码中不存在所述预设第一状态码,且存在预设第二状态码时,判定所述终端处于网络转址连通状态之后,还包括:In one embodiment, when the preset first status code does not exist in the status code and the preset second status code exists, after determining that the terminal is in the network forwarding connected state, it further includes:
获取与所述预设第二状态码对应的转址地址,通过所述转址地址显示网页登录认证页面。A forwarding address corresponding to the preset second status code is obtained, and a webpage login authentication page is displayed through the forwarding address.
在一个实施例中,所述方法还包括:In one embodiment, the method also includes:
当所述网页登录认证页面更新时,获取所述预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过所述目标地址进行网络直接连通侦测;When the webpage login authentication page is updated, obtain the target address in the network status detection address set corresponding to the preset second status code, and perform network direct connection detection through the target address;
当侦测到网络直接连通失败时,通过所述网络状态侦测地址集合中的备用地址进行网络直接连通侦测,以使所述终端接入网络。When it is detected that the network direct connection fails, the network direct connection detection is performed through the standby address in the network state detection address set, so that the terminal accesses the network.
在一个实施例中,所述当所述状态码中不存在所述第一状态码,且存在预设第二状态码时,判定所述终端处于网络转址连通状态之后,还包括:In one embodiment, when the first status code does not exist in the status code and there is a preset second status code, after determining that the terminal is in the network forwarding connected state, it further includes:
获取与所述预设第二状态码对应的转址地址,当所述转址地址中包含预设的应用程序标识时,唤醒对应的应用程序;Obtain a forwarding address corresponding to the preset second status code, and wake up the corresponding application when the forwarding address includes a preset application program identifier;
基于唤醒的所述应用程序显示登录认证页面。Upon waking up the application displays a login authentication page.
在一个实施例中,所述方法还包括:In one embodiment, the method also includes:
当所述转址地址中不包含预设的应用程序标识时,开启所述应用程序标识对应的应用程序的程序下载功能。When the forwarding address does not contain a preset application identifier, enable the program download function of the application corresponding to the application identifier.
在一个实施例中,所述获取终端的实时地理位置包括:In one embodiment, the acquiring the real-time geographic location of the terminal includes:
获取经纬度坐标,根据所述经纬度坐标得到终端的实时地理位置;Obtaining the latitude and longitude coordinates, and obtaining the real-time geographic location of the terminal according to the latitude and longitude coordinates;
或,or,
获取对应的基站信息,根据所述基站信息得到终端的实时地理位置;Obtain corresponding base station information, and obtain the real-time geographic location of the terminal according to the base station information;
或,or,
获取无线网络基站信息,识别所述无线网络基站信息对应的国家码,根据所述国家码得到终端的实时地理位置。Obtain wireless network base station information, identify a country code corresponding to the wireless network base station information, and obtain a real-time geographic location of the terminal according to the country code.
一种网络侦测装置,所述装置包括:A network detection device, said device comprising:
实时位置获取模块,用于获取终端的实时地理位置;A real-time location acquisition module, configured to acquire the real-time geographic location of the terminal;
侦测地址获取模块,用于当所述实时地理位置在预设范围内时,获取网络状态侦测地址集合;A detection address acquisition module, configured to acquire a network status detection address set when the real-time geographic location is within a preset range;
侦测地址处理模块,用于分别根据所述网络状态侦测地址集合中的地址发送探测请求,获得状态码;The detection address processing module is used to send detection requests according to the addresses in the network state detection address set to obtain status codes;
网络连通确定模块,用于当所述状态码中存在预设状态码时,判定所述终端处于网络连通状态。A network connection determining module, configured to determine that the terminal is in a network connection state when there is a preset state code in the state code.
一种电子设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现以下步骤:An electronic device, comprising a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
获取终端的实时地理位置;Obtain the real-time geographic location of the terminal;
当所述实时地理位置在预设范围内时,获取网络状态侦测地址集合;When the real-time geographic location is within a preset range, acquiring a network status detection address set;
分别根据所述网络状态侦测地址集合中的地址发送探测请求,获得状态码;sending detection requests respectively according to the addresses in the network state detection address set to obtain status codes;
当所述状态码中存在预设状态码时,判定所述终端处于网络连通状态。When the preset status code exists in the status code, it is determined that the terminal is in a network connected state.
一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现以下步骤:A computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
获取终端的实时地理位置;Obtain the real-time geographic location of the terminal;
当所述实时地理位置在预设范围内时,获取网络状态侦测地址集合;When the real-time geographic location is within a preset range, acquiring a network status detection address set;
分别根据所述网络状态侦测地址集合中的地址发送探测请求,获得状态码;sending detection requests respectively according to the addresses in the network state detection address set to obtain status codes;
当所述状态码中存在预设状态码时,判定所述终端处于网络连通状态。When the preset status code exists in the status code, it is determined that the terminal is in a network connected state.
上述网络侦测方法、装置、电子设备和存储介质,获取终端的实时地理位置,当实时地理位置在预设范围内时,获取网络状态侦测地址集合;分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码;当状态码中存在预设状态码时,判定终端处于网络连通状态,由此终端在受限于安卓原生的网络侦测机制,无法接入网络的地区,可以通过网络状态侦测地址集合中的地址实现网络连通。The above-mentioned network detection method, device, electronic equipment, and storage medium obtain the real-time geographic location of the terminal, and when the real-time geographic location is within a preset range, obtain a network status detection address set; The address sends a detection request to obtain a status code; when there is a preset status code in the status code, it is determined that the terminal is in a network connection state, so the terminal can be used in areas where it is limited by the native network detection mechanism of Android and cannot access the network. Network connectivity is achieved through the addresses in the network status detection address set.
附图说明Description of drawings
图1为一个实施例中网络侦测方法的流程示意图;FIG. 1 is a schematic flow diagram of a network detection method in an embodiment;
图2为另一个实施例中网络侦测方法的流程示意图;FIG. 2 is a schematic flow diagram of a network detection method in another embodiment;
图3为再一个实施例中网络侦测方法的流程示意图;FIG. 3 is a schematic flowchart of a network detection method in another embodiment;
图4为一个实施例中网络侦测装置的结构框图;Fig. 4 is a structural block diagram of a network detection device in an embodiment;
图5为一个实施例中电子设备的内部结构图。Fig. 5 is an internal structure diagram of an electronic device in one embodiment.
具体实施方式Detailed ways
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solution and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not intended to limit the present application.
在一个实施例中,如图1所示,提供了一种网络侦测方法,本实施例以该方法应用于终端进行举例说明,可以理解的是,该方法也可以应用于服务器,还可以应用于包括终端和服务器的系统,并通过终端和服务器的交互实现。本实施例中,该方法包括以下步骤:In one embodiment, as shown in FIG. 1 , a network detection method is provided. This embodiment uses the method applied to a terminal as an example for illustration. It can be understood that this method can also be applied to a server, and can also be applied It is based on a system including a terminal and a server, and is realized through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
步骤102,获取终端的实时地理位置。Step 102, acquiring the real-time geographic location of the terminal.
终端的实时地理位置是指终端发起网络接入请求时所处地区,用户可以通过终端连接网络热点的方式,发起网络接入请求。比如移动终端的常用使用地区为A,在地区A的无线网络覆盖区域使用移动终端时,可以通过安卓原生的网络侦测机制,显示登录认证页面,通过网页登录认证的方式接入无线网络。而当用户在地区B使用移动终端时,受限于安卓原生的网络侦测机制,移动终端无法正常显示登录认证页面。The real-time geographic location of the terminal refers to the area where the terminal is located when it initiates a network access request. The user can initiate a network access request by connecting the terminal to a network hotspot. For example, the commonly used area of mobile terminals is A. When using mobile terminals in the wireless network coverage area of area A, the native network detection mechanism of Android can be used to display the login authentication page and access the wireless network through web page login authentication. However, when a user uses a mobile terminal in region B, the mobile terminal cannot normally display the login authentication page due to the limitation of Android's native network detection mechanism.
步骤104,当实时地理位置在预设范围内时,获取网络状态侦测地址集合。Step 104, when the real-time geographic location is within a preset range, acquire a network status detection address set.
预设范围是指通过安卓原生的网络侦测机制,在移动终端发起网络接入请求时,无法正常显示登录认证页面所处区域。当检测到终端的实时地理位置在预设范围内时,获取网络状态侦测地址集合,网络侦测地址集合中包括多个网络状态侦测地址。其中,网络状态侦测地址是指与移动终端当前所处地区对应的服务器地址,比如,检测到移动终端处于地区A,获取地区A的公共服务器地址。The default range refers to the area where the login authentication page is not normally displayed when the mobile terminal initiates a network access request through the native network detection mechanism of Android. When it is detected that the real-time geographic location of the terminal is within a preset range, a network state detection address set is obtained, and the network detection address set includes a plurality of network state detection addresses. Wherein, the network status detection address refers to the server address corresponding to the region where the mobile terminal is currently located. For example, it is detected that the mobile terminal is in region A, and the public server address of region A is obtained.
步骤106,分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码。Step 106, sending detection requests respectively according to the addresses in the network status detection address set to obtain status codes.
探测请求具体可以是指HTTP访问请求,在安卓原生的网络侦测机制下,网络数据包分析工具Network Monitor基于HTTPS(Hyper Text Transfer Protocol over SecureSocket Layer,超文本传输安全协议)进行HTTP访问,以及基于HTTP(Hyper Text TransferProtocol,超文本传输协议)进行HTTP访问,根据访问的返回结果进行网络连通判断。其中,HTTP访问以HTTP状态码的形式返回结果,HTTP状态码是用于表示网页服务器超文本传输协议响应状态的3位数字代码。具体地,当返回的HTTP状态码为204时,判定网络状况为有网络。当返回的HTTP状态码为200至399之间的非204时,判定网络状况为转址,转址是指将用户所指定的某个网址,重新导向至另外一个网址。当返回的HTTP状态码为大于或等于400时,判定网络状况为无网络。由于在某些地区安卓原生的网络侦测机制无法对谷歌网站进行访问,因此,上述功能在部分地区是失效的。The detection request can specifically refer to an HTTP access request. Under the native network detection mechanism of Android, the network data packet analysis tool Network Monitor performs HTTP access based on HTTPS (Hyper Text Transfer Protocol over SecureSocket Layer, Hypertext Transfer Security Protocol), and based on HTTP (Hyper Text Transfer Protocol, hypertext transfer protocol) conducts HTTP access, and judges the network connection according to the return result of the access. Wherein, the HTTP access returns a result in the form of an HTTP status code, which is a 3-digit code used to indicate the response status of the hypertext transfer protocol of the web server. Specifically, when the returned HTTP status code is 204, it is determined that the network status is that there is a network. When the returned HTTP status code is not 204 between 200 and 399, it is determined that the network status is forwarding. Forwarding refers to redirecting a certain website specified by the user to another website. When the returned HTTP status code is greater than or equal to 400, it is determined that the network status is no network. Since the native network detection mechanism of Android cannot access the Google website in some regions, the above functions are invalid in some regions.
当侦测到终端处于上述功能失效的地区时,直接采用相应地区的公用服务器作为网络状态侦测地址集合,通过网络状态侦测地址集合中的地址进行网络侦测。具体地,网络状态侦测地址集合中的地址可以包括自架服务器地址、公用网站服务器地址和谷歌服务器地址。而考虑到过多的HTTP访问会造成耗电问题,因此,可以从自架服务器中选择一个,从公用网站服务器中选择一个,从谷歌服务器中选择一个,HTTPS服务器中选择一个,由此得到四组HTTP/HTTPS地址,组成网络状态侦测地址集合。When it is detected that the terminal is in an area where the above functions fail, the public server in the corresponding area is directly used as the network status detection address set, and the network detection is performed through the addresses in the network status detection address set. Specifically, the addresses in the network status detection address set may include self-hosted server addresses, public website server addresses, and Google server addresses. And considering that too many HTTP visits will cause power consumption problems, therefore, you can choose one from the self-supporting server, one from the public website server, one from the Google server, and one from the HTTPS server, thus obtaining four Group HTTP/HTTPS addresses to form a network status detection address set.
步骤108,当状态码中存在预设状态码时,判定终端处于网络连通状态。Step 108, when there is a preset status code in the status code, it is determined that the terminal is in a network connected state.
分别通过网络状态侦测地址集合中的地址发送探测请求,获得状态码,当状态码中存在预设第一状态码时,判定终端处于网络直接连通状态;当状态码中不存在第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态。具体可以分别通过网络状态侦测地址集合中的地址进行HTTP访问,获得HTTP状态码,当HTTP状态码中存在204时,判定网络状况为有网络。当HTTP状态码中不存在204,但存在200至399之间的状态码时,判定网络状况为转址。具体地,对网络状态侦测地址集合中的地址发送探测请求时,可以对多个地址依序发送探测请求。当依序发送探测请求时,将会依序获得HTTP状态码。只要从任一个地址获得存在204的HTTP状态码时,判定网络状况为有网络。具体地,对网络状态侦测地址集合中的地址发送探测请求时,也可以对多个地址同时发送探测请求。当同时发送探测请求时,将会获得多个HTTP状态码。只要从任一个地址获得存在204的HTTP状态码时,判定网络状况为有网络。Send detection requests through the addresses in the network status detection address set to obtain status codes. When there is a preset first status code in the status code, it is determined that the terminal is in the state of direct network connection; when there is no first status code in the status code , and when there is a preset second status code, it is determined that the terminal is in the connected state of network forwarding. Specifically, HTTP access can be performed through the addresses in the network status detection address set to obtain the HTTP status code. When 204 exists in the HTTP status code, it is determined that the network status is a network. When there is no 204 in the HTTP status code, but there is a status code between 200 and 399, it is determined that the network status is forwarding. Specifically, when sending a detection request to an address in the network state detection address set, the detection request may be sent to multiple addresses in sequence. When sending probe requests sequentially, HTTP status codes will be obtained sequentially. As long as the HTTP status code of 204 is obtained from any address, it is determined that the network status is that there is a network. Specifically, when sending a detection request to an address in the network state detection address set, the detection request may also be sent to multiple addresses at the same time. When sending probe requests at the same time, you will get multiple HTTP status codes. As long as the HTTP status code of 204 is obtained from any address, it is determined that the network status is that there is a network.
上述网络侦测方法,获取终端的实时地理位置,当实时地理位置在预设范围内时,获取网络状态侦测地址集合;分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码;当状态码中存在预设状态码时,判定终端处于网络连通状态,由此终端在受限于安卓原生的网络侦测机制,无法接入网络的地区,可以通过网络状态侦测地址集合中的地址实现网络连通。The above network detection method obtains the real-time geographic location of the terminal, and when the real-time geographic location is within the preset range, obtains the network status detection address set; respectively sends detection requests according to the addresses in the network status detection address set, and obtains the status code ; When there is a preset status code in the status code, it is determined that the terminal is in the network connection state. Therefore, the terminal is limited by the native network detection mechanism of Android and cannot access the network. It can detect the address set through the network status. address to achieve network connectivity.
在一个实施例中,当状态码中不存在第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态之后,还包括:获取与预设第二状态码对应的转址地址,通过转址地址显示网页登录认证页面。传统的网络侦测机制,当侦测到转址时,通过网络数据包分析工具Network Monitor类中的isCaptivePortal函数进行网络状况的判定。在处于有网络的网络状况,需要进行登录身份认证的情况下,唤醒对应的登录认证应用程序,引导用户完成登录认证。由于安卓原生的网络侦测机制,登录认证应用程序会根据转址地址使用WebView控件打开对应的网页,再透过WebView控件转址显示登录认证页面。而透过WebView控件转址,可能会出现转址的网页地址不完整的情况,导致无法显示登录认证页面。而在本申请方案中,当HTTP状态码中不存在204时,判断HTTP状态码中是否存在200至399之间的非204时,当HTTP状态码中存在200至399之间的非204时,判定网络状况为转址。当HTTP状态码中既不存在204,也存在200至399之间的非204时,判定网络状况为无网络。获取返回转址HTTP状态码对应的转址地址,通过该转址地址显示登录认证页面。也即在HTTP访问返回的结果为转址的网络状况时,获取判定为转址的网络状况对应的网页转址地址,登录认证应用程序会根据该网页转址地址使用WebView控件打开对应的网页。这样不但可以避免传统方法无法显示登录认证页面的问题,还可以减少对网页地址的访问次数,节省功耗以及流量。In one embodiment, when the first status code does not exist in the status code, and there is a preset second status code, after determining that the terminal is in the state of network forwarding connection, it also includes: obtaining the information corresponding to the preset second status code Forwarding address, display the web page login authentication page through the forwarding address. In the traditional network detection mechanism, when forwarding is detected, the network status is judged through the isCaptivePortal function in the Network Monitor class of the network packet analysis tool. In the case of a network with a network and a login identity authentication is required, wake up the corresponding login authentication application program and guide the user to complete the login authentication. Due to Android's native network detection mechanism, the login authentication application will use the WebView control to open the corresponding web page according to the forwarding address, and then display the login authentication page through the WebView control redirection. However, if the address is forwarded through the WebView control, the address of the forwarded web page may be incomplete, resulting in the failure to display the login authentication page. In this application scheme, when there is no 204 in the HTTP status code, when judging whether there is a non-204 between 200 and 399 in the HTTP status code, when there is a non-204 between 200 and 399 in the HTTP status code, It is determined that the network status is forwarding. When there is neither 204 nor non-204 between 200 and 399 in the HTTP status code, it is determined that the network status is no network. Obtain the forwarding address corresponding to the returned forwarding HTTP status code, and display the login authentication page through the forwarding address. That is to say, when the result returned by the HTTP access is the forwarded network status, obtain the webpage forwarding address corresponding to the forwarding network condition, and the login authentication application will use the WebView control to open the corresponding webpage according to the webpage forwarding address. This can not only avoid the problem that the login authentication page cannot be displayed by the traditional method, but also reduce the number of visits to the web page address, and save power consumption and traffic.
在一个实施例中,如图2所示,网络侦测方法还包括:步骤206,当网页登录认证页面更新时,获取预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过目标地址进行网络直接连通侦测;步骤207,当侦测到网络直接连通失败时,通过网络状态侦测地址集合中的备用地址进行网络直接连通侦测。传统的网络侦测机制,在用户通过登录认证页面登录成功后,在很大概率上,无法自动关闭登录认证应用程序,移动终端的网络状态标识仍然显示无网络,导致移动终端无法正常使用接入的网络。在安卓原生的网络侦测机制下,登录认证应用程序透过WebView控件的每次刷新判定用户完成登录认证。利用第一次侦测网络的网页地址重新进行网络侦测,当侦测返回的HTTP状态码为204时,关闭登录认证应用程序,并将移动终端的网络切换至登录认证页面对应的无线网络。这种方法受限于安卓原生的网络侦测机制,无法关闭登录认证应用程序,从而导致移动终端在某些地区无法通过网页登录认证的方式接入网络。而在本申请方案中,通过网络状态侦测地址集合中的地址进行HTTP访问,获得HTTP状态码,当状态码中不存在预设第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态,获取与预设第二状态码对应的转址地址,通过转址地址显示网页登录认证页面。在WebView控件更新登录认证页面时,判定用户已经成功登录认证。登录认证应用程序获取预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过目标地址进行网络直接连通侦测,当网络侦测返回的HTTP状态码为204时,关闭登录认证应用程序,控制移动终端接入登录认证页面对应的网络。当网络侦测返回的HTTP状态码不为204时,即侦测到网络直接连通失败,通过网络状态侦测地址集合中的备用地址进行网络直接连通侦测,当备用地址返回的HTTP状态码中存在204时,关闭登录认证应用程序,即关闭更新的登录认证页面,控制移动终端接入登录认证页面对应的网络。In one embodiment, as shown in FIG. 2 , the network detection method further includes: step 206, when the webpage login authentication page is updated, obtain the target address in the network state detection address set corresponding to the preset second state code, Perform network direct connection detection through the target address; step 207, when detecting that the network direct connection fails, perform network direct connection detection through the standby address in the network status detection address set. With the traditional network detection mechanism, after the user successfully logs in through the login authentication page, there is a high probability that the login authentication application cannot be automatically closed, and the network status indicator of the mobile terminal still shows no network, resulting in the failure of the mobile terminal to access normally. network of. Under Android's native network detection mechanism, the login authentication application judges that the user has completed the login authentication through each refresh of the WebView control. Use the web page address of the first detection network to perform network detection again. When the HTTP status code returned by detection is 204, close the login authentication application program, and switch the network of the mobile terminal to the wireless network corresponding to the login authentication page. This method is limited by the native network detection mechanism of Android, and cannot close the login authentication application, thus causing the mobile terminal to be unable to access the network through webpage login authentication in some areas. However, in the solution of this application, HTTP access is performed through the addresses in the network status detection address set to obtain the HTTP status code. When there is no preset first status code in the status code and there is a preset second status code, it is determined The terminal is in the network forwarding connection state, obtains the forwarding address corresponding to the preset second status code, and displays the webpage login authentication page through the forwarding address. When the WebView control updates the login authentication page, it is determined that the user has successfully logged in and authenticated. The login authentication application obtains the target address in the network status detection address set corresponding to the preset second status code, and performs network direct connection detection through the target address. When the HTTP status code returned by the network detection is 204, the login authentication is closed. The application program controls the mobile terminal to access the network corresponding to the login authentication page. When the HTTP status code returned by the network detection is not 204, it is detected that the direct network connection fails, and the network direct connection detection is performed through the backup address in the network status detection address set. When the HTTP status code returned by the backup address is When there is 204, close the login authentication application program, that is, close the updated login authentication page, and control the mobile terminal to access the network corresponding to the login authentication page.
在一个实施例中,如图3所示,网络侦测方法还包括:步骤305,获取与预设第二状态码对应的转址地址,当转址地址中包含预设的应用程序标识时,唤醒对应的应用程序;步骤306,基于唤醒的应用程序显示登录认证页面。在实际应用场景中,用户可以通过打开某些应用程序,请求通过登录认证页面的方式,接入对应的网络。具体地,当转址地址中包含预设的应用程序标识时,唤醒对应的应用程序,基于唤醒的应用程序显示登录认证页面;当转址地址中不包含预设的应用程序标识时,开启应用程序标识对应的应用程序的程序下载功能。扩充安卓原生登录认证应用程序的功能,使登录认证应用程序在其它地区可以登录认证正常,解决移动终端在某些地区无法通过网页登录认证的方式接入网络的问题。预先在登录认证应用程序的shouldOverrideUrlLoading接口中添加指定应用程序,后续当检测到待唤醒的应用程序属于指定应用程序时,唤醒对应的应用程序。具体地,登录认证应用程序的shouldOverrideUrlLoading接口中添加指定应用程序的网页地址判断,后续在检测到发起登录认证请求的网页地址与指定应用程序对应时,直接透过Intent机制唤醒对应的应用程序,通过该应用程序显示登录认证页面。此外,可以通过调用下载监听类,扩充安卓原生登录认证应用程序的应用程序下载功能。首先自定义DownLoadListener类,然后设置WebView监听事件监听下载。比如,在WebView中去setDownloadListener,然后带入MyWebViewDownLoadListener函数,利用其中的onDownloadStart callbackFunction(回调函数),即可以扩充安卓原生登录认证应用程序CaptivePortalLoginActivity的应用程序下载功能。In one embodiment, as shown in FIG. 3 , the network detection method further includes: step 305, obtaining a forwarding address corresponding to a preset second status code, and when the forwarding address contains a preset application identifier, Waking up the corresponding application program; step 306, displaying the login authentication page based on the awakened application program. In an actual application scenario, a user can access the corresponding network by opening certain applications and requesting to log in to the authentication page. Specifically, when the forwarding address contains a preset application identifier, the corresponding application is awakened, and the login authentication page is displayed based on the awakened application; when the forwarding address does not contain a preset application identifier, the application is started The program download function of the application program corresponding to the program identifier. Expand the functions of Android's native login authentication application, so that the login authentication application can log in and authenticate normally in other regions, and solve the problem that mobile terminals cannot access the network through webpage login authentication in some regions. Add the specified application in the shouldOverrideUrlLoading interface of the login authentication application in advance, and then wake up the corresponding application when it is detected that the application to be awakened belongs to the specified application. Specifically, the shouldOverrideUrlLoading interface of the login authentication application program is added to determine the webpage address of the specified application program. When it is detected that the webpage address that initiates the login authentication request corresponds to the specified application program, the corresponding application program is directly awakened through the Intent mechanism. The application displays a login authentication page. In addition, the application download function of the Android native login authentication application can be expanded by calling the download monitoring class. First customize the DownLoadListener class, and then set the WebView to listen for events to listen for downloads. For example, go to setDownloadListener in WebView, and then bring in the MyWebViewDownLoadListener function, and use the onDownloadStart callbackFunction (callback function) in it to expand the application download function of the Android native login authentication application CaptivePortalLoginActivity.
在一个实施例中,获取终端的实时地理位置包括:获取经纬度坐标,根据经纬度坐标得到终端的实时地理位置;或者获取对应的基站信息,根据基站信息得到终端的实时地理位置;或者获取无线网络基站信息,识别无线网络基站信息对应的国家码,根据国家码得到终端的实时地理位置。具体地,可以通过定位模块获取经纬度坐标,定位模块具体可以是GPS(Global Positioning System,全球定位系统)模块。以手机为例,在非飞航模式下,通信模块透过电信网络扫描获取基站信息,也可以通过SIM(Subscriber IdentificationModule,用户身份识别)卡获取基站信息。此外,还可以透过无线网络802.11d的标准规范,获得无线网络基站所在区域的国家码。In one embodiment, obtaining the real-time geographic location of the terminal includes: obtaining latitude and longitude coordinates, and obtaining the real-time geographic location of the terminal according to the latitude and longitude coordinates; or obtaining corresponding base station information, and obtaining the real-time geographic location of the terminal according to the base station information; or obtaining wireless network base stations Information, identifying the country code corresponding to the wireless network base station information, and obtaining the real-time geographic location of the terminal according to the country code. Specifically, the latitude and longitude coordinates may be acquired through a positioning module, and the positioning module may specifically be a GPS (Global Positioning System, Global Positioning System) module. Taking a mobile phone as an example, in the non-flight mode, the communication module obtains base station information by scanning the telecommunications network, or obtains base station information through a SIM (Subscriber Identification Module, user identification) card. In addition, the country code of the area where the wireless network base station is located can also be obtained through the standard specification of the wireless network 802.11d.
应该理解的是,虽然图1-3的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图1-3中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flow charts of FIGS. 1-3 are displayed sequentially as indicated by the arrows, these steps are not necessarily executed sequentially in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some of the steps in Figures 1-3 may include a plurality of sub-steps or stages, these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, these sub-steps or stages The order of execution is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一个实施例中,如图4所示,提供了一种网络侦测装置,网络侦测装置包括:实时位置获取模块402、侦测地址获取模块404、侦测地址处理模块406以及网络连通确定模块408。实时位置获取模块402,用于获取终端的实时地理位置。侦测地址获取模块404,用于当实时地理位置在预设范围内时,获取网络状态侦测地址集合。侦测地址处理模块406,用于分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码。网络连通确定模块408,用于当状态码中存在预设状态码时,判定终端处于网络连通状态。In one embodiment, as shown in FIG. 4 , a network detection device is provided. The network detection device includes: a real-time location acquisition module 402, a detection address acquisition module 404, a detection address processing module 406, and a network connection determination Module 408. The real-time location acquisition module 402 is configured to acquire the real-time geographic location of the terminal. The detection address obtaining module 404 is configured to obtain a set of network state detection addresses when the real-time geographic location is within a preset range. The detection address processing module 406 is configured to send detection requests according to the addresses in the network state detection address set to obtain status codes. A network connection determination module 408, configured to determine that the terminal is in a network connection state when there is a preset state code in the state code.
在一个实施例中,网络连通确定模块还用于当状态码中存在预设第一状态码时,判定终端处于网络直接连通状态;当状态码中不存在预设第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态。In one embodiment, the network connection determination module is also used to determine that the terminal is in the state of direct network connection when there is a preset first status code in the status code; when there is no preset first status code in the status code, and there is a preset When the second status code is set, it is determined that the terminal is in the network forwarding connected state.
在一个实施例中,网络侦测装置还包括登录认证模块,用于获取与预设第二状态码对应的转址地址,通过转址地址显示网页登录认证页面。In one embodiment, the network detection device further includes a login authentication module, configured to obtain a forwarding address corresponding to a preset second status code, and display a webpage login authentication page through the forwarding address.
在一个实施例中,网络侦测装置还包括网络接入模块,用于当网页登录认证页面更新时,获取预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过目标地址进行网络直接连通侦测;当侦测到网络直接连通失败时,通过网络状态侦测地址集合中的备用地址进行网络直接连通侦测,以使终端接入网络。In one embodiment, the network detection device further includes a network access module, which is used to obtain the target address in the network state detection address set corresponding to the preset second status code when the web page login authentication page is updated, and pass the target address Perform network direct connection detection; when detecting that the network direct connection fails, perform network direct connection detection through the standby address in the network status detection address set, so that the terminal can access the network.
在一个实施例中,网络侦测装置还包括功能拓展模块,用于获取与预设第二状态码对应的转址地址,当转址地址中包含预设的应用程序标识时,唤醒对应的应用程序;基于唤醒的应用程序显示登录认证页面。In one embodiment, the network detection device further includes a function expansion module, configured to obtain a forwarding address corresponding to a preset second status code, and wake up the corresponding application when the forwarding address contains a preset application program identifier Program; Wake-based application displays a login authentication page.
在一个实施例中,网络侦测装置还包括下载拓展模块,用于当转址地址中不包含预设的应用程序标识时,开启应用程序标识对应的应用程序的程序下载功能。In one embodiment, the network detection device further includes a download extension module, configured to enable the program download function of the application program corresponding to the application program identification when the forwarding address does not contain the preset application program identification.
在一个实施例中,实时位置获取模块还用于获取经纬度坐标,根据经纬度坐标得到终端的实时地理位置;或者获取对应的基站信息,根据基站信息得到终端的实时地理位置;或者获取无线网络基站信息,识别无线网络基站信息对应的国家码,根据国家码得到移动终端的实时地理位置。In one embodiment, the real-time location acquisition module is also used to acquire latitude and longitude coordinates, and obtain the real-time geographic location of the terminal according to the latitude and longitude coordinates; or obtain corresponding base station information, and obtain the real-time geographic location of the terminal according to the base station information; or obtain wireless network base station information , identify the country code corresponding to the wireless network base station information, and obtain the real-time geographic location of the mobile terminal according to the country code.
关于网络侦测装置的具体限定可以参见上文中对于网络侦测方法的限定,在此不再赘述。上述网络侦测装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For specific limitations on the network detection device, please refer to the above-mentioned limitations on the network detection method, which will not be repeated here. Each module in the above-mentioned network detection device can be fully or partially realized by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, and can also be stored in the memory of the computer device in the form of software, so that the processor can invoke and execute the corresponding operations of the above-mentioned modules.
在一个实施例中,提供了一种电子设备,该电子设备可以是移动终端,图5提供了一种移动终端的内部结构图。该移动终端包括通过系统总线连接的处理器、存储器和显示屏。其中,该处理器用于提供计算和控制能力。该存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。终端执行的方法具体可以由该移动终端的处理器来完成,即计算机程序被处理器执行时实现一种网络侦测方法。In an embodiment, an electronic device is provided, and the electronic device may be a mobile terminal, and FIG. 5 provides an internal structural diagram of the mobile terminal. The mobile terminal includes a processor, a memory and a display screen connected through a system bus. Among them, the processor is used to provide calculation and control capabilities. The memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The method executed by the terminal can be specifically completed by the processor of the mobile terminal, that is, a network detection method is implemented when the computer program is executed by the processor.
本领域技术人员可以理解,图5中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的终端的限定,具体的移动终端可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in Figure 5 is only a block diagram of a partial structure related to the solution of this application, and does not constitute a limitation on the terminal to which the solution of this application is applied. The specific mobile terminal may include There may be more or fewer components than shown in the figures, or certain components may be combined, or have different component arrangements.
在一个实施例中,提供了一种电子设备,包括存储器和处理器,该存储器存储有计算机程序,该处理器执行计算机程序时实现以下步骤:获取终端的实时地理位置,当实时地理位置在预设范围内时,获取网络状态侦测地址集合;分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码;当状态码中存在预设状态码时,判定终端处于网络连通状态。In one embodiment, an electronic device is provided, including a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program: acquire the real-time geographic location of the terminal, when the real-time geographic location is within the preset When within the set range, obtain the network status detection address set; respectively send detection requests according to the addresses in the network status detection address set to obtain the status code; when there is a preset status code in the status code, determine that the terminal is in the network connection state.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:当状态码中存在预设第一状态码时,判定终端处于网络直接连通状态;当状态码中不存在第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态。In one embodiment, when the processor executes the computer program, the following steps are also implemented: when there is a preset first status code in the status code, it is determined that the terminal is in a state of direct network connection; when there is no first status code in the status code, and When there is a preset second status code, it is determined that the terminal is in the connected state of network forwarding.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:获取与预设第二状态码对应的转址地址,通过转址地址显示网页登录认证页面。In one embodiment, when the processor executes the computer program, the following steps are further implemented: obtaining a forwarding address corresponding to the preset second status code, and displaying a webpage login authentication page through the forwarding address.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:当网页登录认证页面更新时,获取预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过目标地址进行网络直接连通侦测;当侦测到网络直接连通失败时,通过网络状态侦测地址集合中的备用地址进行网络直接连通侦测,以使终端接入网络。In one embodiment, when the processor executes the computer program, the following steps are also implemented: when the web page login authentication page is updated, obtain the target address in the network status detection address set corresponding to the preset second status code, and perform network monitoring through the target address. Direct connection detection: when it is detected that the network direct connection fails, the network direct connection detection is performed through the standby address in the network status detection address set, so that the terminal can access the network.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:获取与预设第二状态码对应的转址地址,当转址地址中包含预设的应用程序标识时,唤醒对应的应用程序;基于唤醒的应用程序显示登录认证页面。In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtaining the forwarding address corresponding to the preset second status code, and waking up the corresponding application program when the forwarding address contains the preset application program identifier ; The app displays the login authentication page upon wakeup.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:当转址地址中不包含预设的应用程序标识时,开启应用程序标识对应的应用程序的程序下载功能。In one embodiment, when the processor executes the computer program, the following steps are further implemented: when the forwarding address does not contain the preset application identification, enable the program download function of the application corresponding to the application identification.
在一个实施例中,处理器执行计算机程序时还实现以下步骤:获取经纬度坐标,根据经纬度坐标得到终端的实时地理位置;或者获取对应的基站信息,根据基站信息得到终端的实时地理位置;或者获取无线网络基站信息,识别无线网络基站信息对应的国家码,根据国家码得到终端的实时地理位置。In one embodiment, when the processor executes the computer program, the following steps are also implemented: obtain the latitude and longitude coordinates, and obtain the real-time geographic location of the terminal according to the latitude and longitude coordinates; or obtain corresponding base station information, and obtain the real-time geographic location of the terminal according to the base station information; or obtain The wireless network base station information identifies the country code corresponding to the wireless network base station information, and obtains the real-time geographic location of the terminal according to the country code.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时还实现以下步骤:获取终端的实时地理位置,当实时地理位置在预设范围内时,获取网络状态侦测地址集合;分别根据网络状态侦测地址集合中的地址发送探测请求,获得状态码;当状态码中存在预设状态码时,判定终端处于网络连通状态。In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are further implemented: acquiring the real-time geographic location of the terminal, when the real-time geographic location is within a preset range When it is inside, obtain the network status detection address set; respectively send detection requests according to the addresses in the network status detection address set to obtain the status code; when there is a preset status code in the status code, it is determined that the terminal is in the network connection state.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当状态码中存在预设第一状态码时,判定终端处于网络直接连通状态;当状态码中不存在第一状态码,且存在预设第二状态码时,判定终端处于网络转址连通状态。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the preset first status code exists in the status code, it is determined that the terminal is in a state of direct network connection; when there is no first status code in the status code, And when there is a preset second status code, it is determined that the terminal is in the connected state of network forwarding.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取与预设第二状态码对应的转址地址,通过转址地址显示网页登录认证页面。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining a forwarding address corresponding to the preset second status code, and displaying a webpage login authentication page through the forwarding address.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当网页登录认证页面更新时,获取预设第二状态码对应的网络状态侦测地址集合中的目标地址,通过目标地址进行网络直接连通侦测;当侦测到网络直接连通失败时,通过网络状态侦测地址集合中的备用地址进行网络直接连通侦测,以使终端接入网络。In one embodiment, when the computer program is executed by the processor, the following steps are also implemented: when the webpage login authentication page is updated, obtain the target address in the network status detection address set corresponding to the preset second status code, and perform the process through the target address Network direct connection detection; when it is detected that the network direct connection fails, the network direct connection detection is performed through the standby address in the network status detection address set, so that the terminal can access the network.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取与预设第二状态码对应的转址地址,当转址地址中包含预设的应用程序标识时,唤醒对应的应用程序;基于唤醒的应用程序显示登录认证页面。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining a forwarding address corresponding to a preset second status code, and waking up the corresponding application when the forwarding address contains a preset application program identifier Program; Wake-based application displays a login authentication page.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:当转址地址中不包含预设的应用程序标识时,开启应用程序标识对应的应用程序的程序下载功能。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: when the forwarding address does not contain the preset application identification, enable the program download function of the application corresponding to the application identification.
在一个实施例中,计算机程序被处理器执行时还实现以下步骤:获取经纬度坐标,根据经纬度坐标得到终端的实时地理位置;或者获取对应的基站信息,根据基站信息得到终端的实时地理位置;或者获取无线网络基站信息,识别无线网络基站信息对应的国家码,根据国家码得到终端的实时地理位置。In one embodiment, when the computer program is executed by the processor, the following steps are further implemented: obtaining the latitude and longitude coordinates, obtaining the real-time geographic location of the terminal according to the latitude and longitude coordinates; or obtaining corresponding base station information, and obtaining the real-time geographic location of the terminal according to the base station information; or Obtain wireless network base station information, identify the country code corresponding to the wireless network base station information, and obtain the real-time geographic location of the terminal according to the country code.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的计算机程序可存储于一非易失性计算机可读取存储介质中,该计算机程序在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above-mentioned embodiments can be completed by instructing related hardware through computer programs, and the computer programs can be stored in a non-volatile computer-readable memory In the medium, when the computer program is executed, it may include the processes of the embodiments of the above-mentioned methods. Wherein, any references to memory, storage, database or other media used in the various embodiments provided in the present application may include non-volatile and/or volatile memory. Nonvolatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Chain Synchlink DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
以上实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。The technical features of the above embodiments can be combined arbitrarily. To make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be It is considered to be within the range described in this specification.
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对发明专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。The above-mentioned embodiments only represent several implementation modes of the present application, and the description thereof is relatively specific and detailed, but it should not be construed as limiting the scope of the patent for the invention. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the scope of protection of the patent application should be based on the appended claims.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010441027.XA CN113709086B (en) | 2020-05-22 | 2020-05-22 | Network detection method, device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010441027.XA CN113709086B (en) | 2020-05-22 | 2020-05-22 | Network detection method, device, electronic device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113709086A CN113709086A (en) | 2021-11-26 |
CN113709086B true CN113709086B (en) | 2023-07-18 |
Family
ID=78646260
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010441027.XA Active CN113709086B (en) | 2020-05-22 | 2020-05-22 | Network detection method, device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113709086B (en) |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104735736A (en) * | 2013-12-24 | 2015-06-24 | 中国移动通信集团公司 | Network access method and user terminal |
CN105873053A (en) * | 2016-03-29 | 2016-08-17 | 上海斐讯数据通信技术有限公司 | Method and system for embedding webpage on access authentication page, and wireless access point |
CN106341413A (en) * | 2016-09-29 | 2017-01-18 | 上海斐讯数据通信技术有限公司 | Portal authentication method and device |
CN106973386A (en) * | 2017-03-29 | 2017-07-21 | 联想(北京)有限公司 | A kind of wireless network access method, device and electronic equipment |
CN107294811A (en) * | 2017-07-28 | 2017-10-24 | 广东欧珀移动通信有限公司 | Network detection method, network detection device and intelligent terminal |
CN107483594A (en) * | 2017-08-22 | 2017-12-15 | 北京小米移动软件有限公司 | Method and device for displaying updated items |
CN108737350A (en) * | 2017-04-24 | 2018-11-02 | 腾讯科技(深圳)有限公司 | A kind of information processing method and client |
CN109640374A (en) * | 2017-10-09 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Wireless network access, processing method, device, storage medium and computer equipment |
CN109802925A (en) * | 2017-11-17 | 2019-05-24 | 广州市动景计算机科技有限公司 | A kind of authentication method and system of public WiFi access |
Family Cites Families (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8131847B2 (en) * | 2009-08-12 | 2012-03-06 | Cellco Partnership | Mechanism to detect restricted access via internet hotspot |
CN105007581B (en) * | 2015-08-12 | 2018-03-20 | 腾讯科技(深圳)有限公司 | A kind of network access authentication method and client |
CN106209970B (en) * | 2016-06-17 | 2018-02-23 | 上海连尚网络科技有限公司 | Determine the method and apparatus of network state connected between user equipment and routing device |
CN106714206B (en) * | 2016-09-29 | 2020-06-16 | 腾讯科技(深圳)有限公司 | Method and device for detecting wireless network access point connecting network |
CN108664493B (en) * | 2017-03-29 | 2021-09-03 | 北京京东尚科信息技术有限公司 | Method and device for counting validity of URL (Uniform resource locator), electronic equipment and storage medium |
CN108282783B (en) * | 2017-09-15 | 2021-03-09 | 阿里巴巴(中国)有限公司 | Public wifi authentication method, device, user terminal and storage medium |
CN109787811A (en) * | 2018-12-15 | 2019-05-21 | 深圳壹账通智能科技有限公司 | Network status data update method, device, computer equipment and storage medium |
CN110677852A (en) * | 2019-11-22 | 2020-01-10 | 广东睿盟计算机科技有限公司 | Network connection method, device, computer equipment and storage medium |
-
2020
- 2020-05-22 CN CN202010441027.XA patent/CN113709086B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104735736A (en) * | 2013-12-24 | 2015-06-24 | 中国移动通信集团公司 | Network access method and user terminal |
CN105873053A (en) * | 2016-03-29 | 2016-08-17 | 上海斐讯数据通信技术有限公司 | Method and system for embedding webpage on access authentication page, and wireless access point |
CN106341413A (en) * | 2016-09-29 | 2017-01-18 | 上海斐讯数据通信技术有限公司 | Portal authentication method and device |
CN106973386A (en) * | 2017-03-29 | 2017-07-21 | 联想(北京)有限公司 | A kind of wireless network access method, device and electronic equipment |
CN108737350A (en) * | 2017-04-24 | 2018-11-02 | 腾讯科技(深圳)有限公司 | A kind of information processing method and client |
CN107294811A (en) * | 2017-07-28 | 2017-10-24 | 广东欧珀移动通信有限公司 | Network detection method, network detection device and intelligent terminal |
CN107483594A (en) * | 2017-08-22 | 2017-12-15 | 北京小米移动软件有限公司 | Method and device for displaying updated items |
CN109640374A (en) * | 2017-10-09 | 2019-04-16 | 腾讯科技(深圳)有限公司 | Wireless network access, processing method, device, storage medium and computer equipment |
CN109802925A (en) * | 2017-11-17 | 2019-05-24 | 广州市动景计算机科技有限公司 | A kind of authentication method and system of public WiFi access |
Also Published As
Publication number | Publication date |
---|---|
CN113709086A (en) | 2021-11-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10638320B2 (en) | Wireless network type detection method and apparatus, and electronic device | |
WO2022057429A1 (en) | Network registration method and apparatus, and user terminal and storage medium | |
CN109660979B (en) | Internet of Things over-the-air card opening method and device, computing device and storage medium | |
CN110809255A (en) | Card information activation method and device and storage medium | |
CN114157536A (en) | Equipment access method, device, equipment and storage medium based on intelligent gateway | |
CN111328068B (en) | Card writing method and device, computer equipment and storage medium | |
CN113873450A (en) | Short message configuration method and device, computer equipment and storage medium | |
CN104994501A (en) | Connection method of wireless network and terminal equipment | |
CN113709086B (en) | Network detection method, device, electronic device and storage medium | |
CN114170700A (en) | Attendance checking method and device | |
CN118175137A (en) | Domain name resolution method and system based on multi-blockchain system, electronic device and storage medium | |
CN113609881B (en) | Method, device, equipment and storage medium for determining analog card to be activated | |
CN113759405B (en) | GPS positioning acceleration system, method, device, computer equipment and storage medium | |
CN114363461A (en) | Application control method, apparatus, electronic device, and computer-readable storage medium | |
CN114928620A (en) | User information synchronization method, device, equipment, storage medium and program product | |
CN112188591A (en) | Network access method, device, computer equipment and storage medium | |
CN114286400B (en) | Method and device for acquiring long-term evolution network service and computer equipment | |
CN117155890B (en) | Method and device for processing applet message and electronic equipment | |
CN115379446B (en) | Network control method, device, user terminal and storage medium | |
US20240251033A1 (en) | 5g icon display control method, apparatus, terminal device, and storage medium | |
CN111757326B (en) | Vulnerability prevention and control method, vulnerability prevention and control device, mobile terminal and computer readable storage medium | |
US20230073492A1 (en) | Connecting method, apparatus of screen transmission device based on nfc, and computer device | |
CN116456504A (en) | Public network connection method, device, computer equipment and storage medium | |
CN116156508A (en) | Web page access method, device, equipment and storage medium | |
CN119996954A (en) | Message sending method, device, communication equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20250214 Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18 Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd. Country or region after: China Address before: 518000 Room 201, building A, 1 front Bay Road, Shenzhen Qianhai cooperation zone, Shenzhen, Guangdong Patentee before: ONEPLUS TECHNOLOGY (SHENZHEN) Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |