CN107734528B - Wireless network detection method, device, storage medium and terminal - Google Patents

Wireless network detection method, device, storage medium and terminal Download PDF

Info

Publication number
CN107734528B
CN107734528B CN201711072963.2A CN201711072963A CN107734528B CN 107734528 B CN107734528 B CN 107734528B CN 201711072963 A CN201711072963 A CN 201711072963A CN 107734528 B CN107734528 B CN 107734528B
Authority
CN
China
Prior art keywords
terminal
data frame
address
wireless
local area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711072963.2A
Other languages
Chinese (zh)
Other versions
CN107734528A (en
Inventor
黄园
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711072963.2A priority Critical patent/CN107734528B/en
Publication of CN107734528A publication Critical patent/CN107734528A/en
Application granted granted Critical
Publication of CN107734528B publication Critical patent/CN107734528B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/04Arrangements for maintaining operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Abstract

The embodiment of the application discloses a wireless network detection method, a wireless network detection device, a storage medium and a terminal. The method comprises the following steps: acquiring a common data frame transmitted in a wireless local area network where a first terminal is located, wherein the common data frame is a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network; acquiring a source Internet Protocol (IP) address from a common data frame; and judging whether the source IP address is from the outside of the wireless local area network or not, and determining the reason why the first terminal cannot access the Internet according to the judgment result. By adopting the technical scheme, the embodiment of the application can analyze the reason that the terminal cannot access the Internet, enrich the wireless network detection function of the terminal and bring convenience to a user to take corresponding measures according to the analysis result.

Description

Wireless network detection method, device, storage medium and terminal
Technical Field
The embodiment of the application relates to the technical field of wireless communication, in particular to a wireless network detection method, a wireless network detection device, a wireless network detection storage medium and a wireless network detection terminal.
Background
At present, the functions of terminal equipment are becoming rich, so that the terminal equipment is more and more intelligent, and the mode of connecting the terminal to a wireless network for surfing the internet is more and more favored by users.
Wireless Fidelity (WiFi) technology is a technology that allows an electronic device to connect to a Wireless Local Area Network (WLAN), and is a mainstream Wireless internet access method adopted by a terminal user at present. Taking WiFi as an example, after a peripheral WiFi hotspot list is searched through a terminal, one of the WiFi hotspots is selected and a corresponding password is input (for an unencrypted hotspot, the password does not need to be input), so that the WiFi hotspot can be connected and a corresponding wireless local area network can be successfully added, and the internet surfing function is realized. However, after successfully connecting to the wireless network, the abnormal state may cause the failure of accessing the network, and a scheme is required to be provided for detecting the network disconnection.
Disclosure of Invention
The embodiment of the application provides a wireless network detection method, a wireless network detection device, a storage medium and a terminal, and can provide a scheme for detecting a wireless network when the terminal cannot access the network.
In a first aspect, an embodiment of the present application provides a wireless network detection method, including:
acquiring a common data frame transmitted in a wireless local area network where a first terminal is located, wherein the common data frame comprises a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network;
acquiring a source Internet Protocol (IP) address from the common data frame;
and judging whether the source IP address is from the outside of the wireless local area network, and determining the reason why the first terminal cannot access the Internet according to the judgment result.
In a second aspect, an embodiment of the present application provides a wireless network detection apparatus, including:
the system comprises a common data frame acquisition module, a first data frame acquisition module and a second data frame acquisition module, wherein the common data frame acquisition module is used for acquiring a common data frame transmitted in a wireless local area network where a first terminal is located, and the common data frame comprises a common data frame interacted between a second terminal and a wireless hot spot in the wireless local area network;
an address obtaining module, configured to obtain a source internet protocol IP address from the common data frame;
and the network detection module is used for judging whether the source IP address is from the outside of the wireless local area network or not and determining the reason why the first terminal cannot access the Internet according to the judgment result.
In a third aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements a wireless network detection method according to an embodiment of the present application.
In a fourth aspect, an embodiment of the present application provides a terminal, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the wireless network detection method according to the embodiment of the present application.
According to the wireless network detection scheme provided by the embodiment of the application, common data frames interacted between other terminals and a wireless hotspot in a wireless local area network where the terminal is located are obtained, a source IP address is obtained from the common data frames, whether the source IP address is from the outside of the wireless local area network or not is judged, and the reason why the terminal cannot access the internet is determined according to the judgment result. By adopting the technical scheme, the reason that the terminal cannot access the internet can be analyzed, the wireless network detection function of the terminal is enriched, and a user can take corresponding measures conveniently according to the analysis result.
Drawings
Fig. 1 is a schematic flowchart of a wireless network detection method according to an embodiment of the present application;
fig. 2 is a flowchart illustrating another wireless network detection method according to an embodiment of the present application;
fig. 3 is a flowchart illustrating another wireless network detection method according to an embodiment of the present application;
fig. 4 is a block diagram illustrating a structure of a wireless network detection apparatus according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another terminal provided in the embodiment of the present application.
Detailed Description
The technical scheme of the application is further explained by the specific implementation mode in combination with the attached drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and are not limiting of the application. It should be further noted that, for the convenience of description, only some of the structures related to the present application are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the steps as a sequential process, many of the steps can be performed in parallel, concurrently or simultaneously. In addition, the order of the steps may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
Fig. 1 is a schematic flowchart of a wireless network detection method according to an embodiment of the present disclosure, where the method may be executed by a wireless network detection apparatus, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a terminal device such as a mobile phone, a tablet computer, and a computer. As shown in fig. 1, the method includes:
step 101, obtaining a common data frame transmitted in a wireless local area network where a first terminal is located.
And the common data frame comprises a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network.
For example, specific types of the first terminal and the second terminal in the embodiment of the present application are not limited in the embodiment of the present application, and both the first terminal and the second terminal may be a mobile terminal or a fixed terminal, and one of the first terminal and the second terminal may also be a mobile terminal and one of the fixed terminal may be a fixed terminal, where the mobile terminal is a mobile phone, a tablet computer, or the like, and the fixed terminal is a desktop computer, or the like. In this embodiment, for example, the above-mentioned wireless network detection apparatus is integrated in the first terminal, the second terminal may be any other terminal in the wireless lan where the first terminal is located, and the first terminal and the second terminal may be collectively referred to as a terminal.
The wireless local area network in the embodiment of the application can be a wireless network corresponding to wireless network signals sent by a wireless router, a computer, a portable wireless fidelity WiFi or other wireless network hotspots and the like. The terminal can access the internet by opening a wireless network connection function, scanning nearby wireless hotspots and connecting the wireless hotspots. When a user uses a terminal, the situation that the user cannot access the internet (or called as surfing) may occur, and the specific reason for the situation that the terminal cannot know the situation may be that the currently connected wireless hotspot cannot access the internet, or the terminal cannot access the internet due to a problem. If the terminal cannot access the internet due to the terminal itself and the wireless hotspot is not abnormal, other normally operating terminals in the same wireless lan can access the internet, however, in the related art, the current terminal cannot know whether other terminals can access the internet because the terminal only receives and processes a unicast frame with a destination address matching with its own address information or a broadcast or multicast frame in the wireless lan, and therefore cannot know whether other terminals connected to the current wireless hotspot can access the internet.
In the embodiment of the application, when the first terminal receives the data frame of which the destination address is not matched with the address information of the first terminal, the first terminal cannot directly discard the data frame. For a normal data Frame (generic Frame) that interacts between the second terminal and the wireless hotspot within the wireless local area network, the first terminal is not directly discarded, but is received and used for subsequent analysis. In the wlan standard protocol (e.g. 802.11), the main frame types include management frames, control frames, and data frames, the management frames include, for example, Beacon frames (Beacon), Probe Request frames (Probe Request), Probe Response frames (Probe Response), and Authentication frames (Authentication), the control frames include Request frames, permission frames, and Response frames, and the data frames mainly include handshake data frames and normal data frames. The common data frame interacted between the second terminal and the wireless hotspot in the wireless local area network comprises the related information of the second terminal accessing the network.
In the embodiment of the application, step 101 may be executed after detecting that the first terminal is connected to the wireless hotspot, and the determination result in step 103 is recorded; step 101 may also be performed after detecting that the first terminal has no access to the internet.
And 102, acquiring a source IP address from the common data frame.
For a wireless hotspot, the connection of a terminal which cannot input a password correctly can be limited by setting the password; or the password is not set, so that the terminals needing to be connected can share the wireless hotspot. In this embodiment, the source IP address when the second terminal accesses the network is obtained from the obtained common data frame, where the network may include a wireless local area network or the internet, and the source IP address is an IP address corresponding to a network that sends a data packet to the second terminal. When the wireless hotspot is not provided with the password, the common data frame is not encrypted, and the source IP address can be directly extracted from the common data frame. Typically, the source IP address is contained in an IP datagram. When the wireless hotspot sets the password, the common data frame is encrypted, the common data frame needs to be decrypted, and then the source IP address is extracted.
And 103, judging whether the source IP address is from the outside of the wireless local area network, and determining the reason why the first terminal cannot access the Internet according to the judgment result.
For example, the source IP address may be compared with the IP address of the first terminal itself, so as to determine whether the terminal sending the data packet to the second terminal and the first terminal are in the same lan, and if not, the source IP address may be considered to be from outside the wlan. When the source IP address is from outside the wireless lan, it can be stated that the second terminal can access the internet, so the wireless hotspot can access the internet, and the reason that the first terminal cannot access the internet appears at the first terminal side, which may be that the first terminal itself is abnormal, or the wireless connection between the first terminal and the wireless hotspot is abnormal.
The wireless network detection method provided in the embodiment of the application obtains the common data frame interacted between other terminals and the wireless hotspot in the wireless local area network where the terminal is located, obtains the source IP address from the common data frame, judges whether the source IP address is from outside the wireless local area network, and determines the reason why the terminal cannot access the internet according to the judgment result. By adopting the technical scheme, the reason that the terminal cannot access the internet can be analyzed, the wireless network detection function of the terminal is enriched, and a user can take corresponding measures conveniently according to the analysis result.
In some embodiments, before the acquiring the normal data frame transmitted in the wireless local area network in which the first terminal is located, the method may further include: acquiring handshake data frames transmitted in the wireless local area network, wherein the handshake data frames comprise handshake data frames interacted between the second terminal and the wireless hotspot; and acquiring a target key from the handshake data frame, wherein the target key is used for decrypting the common data frame. The obtaining a source internet protocol IP address from the common data frame includes: and acquiring a source IP address from the common data frame according to the target key. The advantage of such an arrangement is that when the wireless hotspot sets the password, the target key can be obtained by acquiring the data in the handshake data frame, and the common data frame is decrypted by using the target key, so that the source IP address can be quickly obtained.
When the wireless hotspot sets the password, authentication is needed between the wireless hotspot and the terminal, and generally through a handshake mode. Taking WiFi as an example, encryption is generally performed in a wireless fidelity network secure Access (WPA) manner, and authentication manners are mainly WPA-PSK and WPA2-PSK, where PSK is a pre-shared Key mode (also referred to as a personal mode), authentication may be performed specifically by using four-way handshake, and the four-way handshake generates a Pairwise Transmission Key (PTK) from a Pairwise Master Key (PMK) through a series of interactions, and when a wireless local area network is a WiFi network, the PTK is a target Key described in this embodiment of the present application. Data transmitted between the WiFi hotspot and the terminal in the wireless local area network may be encrypted by the PTK. The generation of PTK requires 5 essential elements: PMK, ANonce (Nonce1), SNonce (Nonce2), authentication MAC (MAC1), and supplementary MAC (MAC2), wherein PMK is pre-agreed between WiFi hotspots and terminals, authentication represents WiFi hotspots, also called Access Points (APs), supplementary is terminals connected to WiFi hotspots, Nonce1 is a random number generated by WiFi hotspots, Nonce2 is a random number generated by terminals, and MAC represents a Media Access Control (Media Access Control) address, also called a physical address or a hardware address. In the process of four-way handshake, the WiFi hotspot will send Nonce1 and its MAC address to the terminal by sending handshake data frame, and the terminal will also send Nonce2 and its MAC address to the WiFi hotspot by sending handshake data frame. In the embodiment of the present application, the handshake data frame interacted between the second terminal and the wireless hotspot is obtained, that is, the address information of the second terminal (the MAC address of the second terminal, i.e., the MAC2 mentioned above) and the Nonce1, Nonce2, and MAC1 for generating the PTK are obtained from the handshake data frame, and since the first terminal knows the password for connecting the WiFi hotspot, the PMK can also be obtained, and therefore, the PTK between the WiFi hotspot and the second terminal can be generated.
In some embodiments, the source IP address may be included in an IP datagram, the obtaining the source IP address from the normal data frame according to the destination key comprises: decrypting the common data frame according to the target key to obtain an IP datagram; and acquiring a source IP address from the IP datagram. The IP source address is generally contained in the header of the IP datagram, and can be read from the corresponding data bit according to the format of the IP datagram, so that the reading process is quick and accurate.
In some embodiments, it may further include: and if the handshake data frame transmitted in the wireless local area network is not successfully acquired, notifying the second terminal to reconnect the wireless hotspot, and acquiring the handshake data frame transmitted in the wireless local area network again. This has the advantage that successful acquisition of the handshake data frame can be guaranteed. For example, if the first terminal is the last terminal that joins the wireless lan, the handshake data frame exchanged between the other terminals and the wireless hotspot may not be obtained, at this time, the second terminal may be notified to disconnect from the wireless hotspot and reconnect, a handshake data frame may be generated in the process of reconnection, and at this time, the first terminal may obtain the handshake data frame again. Optionally, it may be detected whether a terminal in bluetooth connection with the first terminal exists in the current wireless lan, and if so, the terminal is used as the second terminal to notify the second terminal of reconnecting the wireless hotspot; and if the Bluetooth connection does not exist, automatically establishing the Bluetooth connection with the second terminal in the wireless local area network, and informing the second terminal to reconnect the wireless hotspot.
In some embodiments, determining whether the source IP address is from outside the wireless local area network may include: performing bit AND operation on the IP address of the first terminal and the subnet mask of the wireless local area network to obtain a first operation result; performing bit AND operation on the source IP address and the subnet mask of the wireless local area network to obtain a second operation result; and judging whether the first operation result is matched with the second operation result, and if not, determining that the source IP address is from the outside of the wireless local area network. The advantage of this arrangement is that it can quickly and accurately determine whether the source IP address is from outside the wireless lan. For example, the IP address of the first terminal, the subnet mask of the wireless lan, and the source IP address may be first converted into binary data, and then a corresponding and operation may be performed.
In some embodiments, the determining, according to the determination result, a reason why the first terminal cannot access the internet includes: and when the source IP address comes from the outside of the wireless local area network, determining that the first terminal side is abnormal. When the source IP address is from outside the wireless lan, it indicates that the second terminal can successfully access the internet, and the reason that the first terminal cannot access the internet appears at the first terminal side, which may be that the first terminal itself is abnormal, or the wireless connection between the first terminal and the wireless hotspot is abnormal. Optionally, if it is determined that the first terminal side is abnormal, the first terminal may be controlled to perform a corresponding first prompting operation, such as prompting a user to approach the first terminal to a wireless hotspot, or reconnecting the first terminal to the wireless hotspot, or restarting the wireless network connection module. Optionally, the first terminal may also automatically perform a corresponding recovery operation, for example, the first terminal automatically reconnects the wireless hotspot, or the first terminal automatically restarts the wireless network connection module, and the like.
Further, the determining, according to the determination result, the reason why the first terminal cannot access the internet further includes: and if the common data frame of which the source IP address is from the outside of the wireless network is not acquired within the preset time, determining that the wireless hotspot side is abnormal. The preset duration may be set according to an actual situation, for example, according to the signal strength of the wireless hotspot detected by the first terminal. For example, the preset time period may be set to 10 minutes. If the common data frame with the source IP address from the outside of the wireless network is acquired within the preset time, it indicates that other terminals in the wireless network cannot normally access the internet, and it can be determined that the wireless hotspot side is abnormal, and may be that the wireless router is abnormal, or the broadband fails, etc. If the wireless hotspot side is judged to be abnormal, the first terminal can be controlled to perform corresponding second reminding operation, such as prompting a user to check whether the router or the broadband is normal.
Fig. 2 is a schematic flowchart of another wireless network detection method provided in the embodiment of the present application, which is described by taking an unencrypted WiFi hotspot as an example, and includes the following steps:
step 201, establishing a communication connection between the terminal a and the WiFi hotspot in a wireless manner, so as to join a wireless local area network to which the WiFi hotspot belongs.
For example, the terminal a in the embodiment of the present application may be understood as the above first terminal, and the terminal B may be understood as the above second terminal.
Step 202, detecting that the terminal A can not access the Internet.
Step 203, obtaining a common data frame interacted between the terminal B and the WiFi hotspot in the wireless local area network.
It is understood that when step 203 is executed again, terminal B may be replaced by other terminals in the wlan, such as terminal C, terminal D, and terminal E.
And step 204, acquiring the source IP address from the common data frame.
Step 205, performing bit-and operation on the IP address and the source IP address of the terminal a and the subnet mask of the wireless local area network, respectively, and determining whether two and operation results are the same, if yes, performing step 206; otherwise, step 208 is performed.
Step 206, judging whether the time length that the terminal A cannot access the Internet reaches the preset time length, if so, executing step 207; otherwise, return to execute step 203.
Step 207, determining that the WiFi hot spot side is abnormal, and the control terminal A reminds the user to check the wireless router or the broadband.
And 208, determining that the source IP address is from the outside of the wireless local area network, and controlling the terminal A to remind the user to reconnect the WiFi hotspot when the terminal A side is abnormal.
The wireless network detection method provided by the embodiment of the application is suitable for the situation that a WiFi hotspot is not encrypted, when a terminal connected with the WiFi hotspot cannot access the Internet, whether other terminals can access the Internet or not can be analyzed by analyzing common data frames transmitted between other terminals and the WiFi hotspot, and then the reason that the terminal cannot access the Internet is determined, more accurate and more effective reminding can be provided for a user, the wireless network detection function of the terminal is enriched, and the terminal is more intelligent.
Fig. 3 is a schematic flowchart of another wireless network detection method provided in the embodiment of the present application, which is described by taking an encrypted WiFi hotspot as an example, and includes the following steps:
step 301, establishing a communication connection between the terminal a and the WiFi hotspot in a wireless manner, so as to join a wireless local area network to which the WiFi hotspot belongs.
For example, the terminal a in the embodiment of the present application may be understood as the above first terminal, and the terminal B may be understood as the above second terminal.
Step 302, acquiring a handshake data frame interacted between the terminal B and the WiFi hotspot in the wireless local area network, and generating a PTK according to the content in the handshake data frame.
And step 303, detecting that the terminal A cannot access the Internet.
And step 304, acquiring a common data frame interacted between the terminal B and the WiFi hotspot in the wireless local area network.
It is understood that when step 304 is executed again, terminal B may be replaced by other terminals in the wlan, such as terminal C, terminal D, and terminal E.
And 305, decrypting the common data frame by using the PTK to obtain an IP datagram, and reading a source IP address from the IP datagram.
Step 306, performing bit and operation on the IP address and the source IP address of the terminal a and a subnet mask of the wireless local area network, respectively, judging whether two and operation results are the same, if yes, executing step 307; otherwise, step 309 is performed.
307, judging whether the time length that the terminal A cannot access the Internet reaches the preset time length or not, if so, executing a step 308; otherwise, return to execute step 304.
Step 308, determining that the WiFi hotspot side is abnormal, and the control terminal A reminds the user to check the wireless router or the broadband.
Step 309, determining that the source IP address is from outside the wireless local area network, and the terminal A side is abnormal, and controlling the terminal A to remind the user to reconnect the WiFi hotspot.
The wireless network detection method provided by the embodiment of the application is applicable to the situation of WiFi hotspot encryption, the handshake data frames transmitted between other terminals and the WiFi hotspot can be obtained firstly, the key PTK for decrypting the common data frame is obtained, when the terminal connected with the WiFi hotspot cannot access the Internet, whether the other terminals can access the Internet or not can be analyzed by analyzing the common data frames transmitted between the other terminals and the WiFi hotspot, the reason that the terminal cannot access the Internet is further determined, more accurate and more effective reminding can be provided for a user, the wireless network detection function of the terminal is enriched, and the terminal is more intelligent.
Optionally, in some embodiments, after the terminal is connected to the WiFi hotspot, the terminal may obtain a data frame in real time, where the data frame includes data frames transmitted between all terminals in the wireless local area network and the WiFi hotspot, and determine whether a target address of the data frame is an MAC address of the terminal, and if not, the target address is not directly discarded, but the type of the data frame is determined. It is determined whether the data frame is a four-way handshake frame or a normal data frame. Illustratively, whether it is a frame of a four-way handshake or a normal data frame may be distinguished by a protocol field of the data frame. For example, the Protocol field in the frame of the four-way handshake may be "Protocol: 802.1X Authentication (0X888 e)", the Protocol field of the normal IP data frame may be "Protocol: IPv4(0X 0800)", and it can be seen that the value of the Protocol field of the frame of the four-way handshake is 0X888e, and the value of the Protocol field of the normal data frame is 0X 0800. If the frame is a frame of four-time handshake, the MAC address of the terminal performing the four-time handshake and the generated secret key are saved; and if the data frame is the common data frame, finding the secret key corresponding to the MAC address of the terminal stored before according to the MAC address corresponding to the common data frame, and decrypting the data frame to obtain the decrypted IP datagram. For unencrypted hotspots, unencrypted IP datagrams can be extracted directly from the received data frames. Judging whether the source IP address (supposed to be marked as IP1) of the obtained IP datagram is from an external network, if the IP address and the IP1 of the terminal are respectively subjected to 'bit AND operation' with the subnet mask of the WLAN, if the operated results are different, the IP1 does not belong to the local area network, and if the IP datagram is from the external network, the terminal equipment is considered to be capable of accessing the Internet, and the result is recorded. When the terminal device cannot access the internet, whether only the terminal cannot access the internet can be known by inquiring the recorded result before, and then the terminal can be subjected to targeted prompt (for example, if only the terminal cannot access the internet, a user is prompted to be close to a hot spot or to reconnect WiFi, and if other terminals cannot access the internet, the user is prompted to check whether a router and a broadband are normal). Optionally, when a result recorded before querying is performed, the record of the time interval from the current moment in the preset time interval may be selected, so as to ensure the accuracy of the analysis result for the current terminal that cannot surf the internet.
Fig. 4 is a block diagram of a wireless network detection apparatus according to an embodiment of the present disclosure, where the apparatus may be implemented by software and/or hardware, and may be generally integrated in a mobile phone, a tablet computer, a computer, and other terminal devices, and may analyze a reason why a terminal cannot access the internet by executing a wireless network detection method. As shown in fig. 4, the apparatus includes:
a common data frame obtaining module 401, configured to obtain a common data frame transmitted in a wireless local area network where a first terminal is located, where the common data frame includes a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network;
an address obtaining module 402, configured to obtain a source internet protocol IP address from the common data frame;
a network detection module 403, configured to determine whether the source IP address is from outside the wireless lan, and determine, according to a determination result, a reason why the first terminal cannot access the internet.
The wireless network detection device provided in the embodiment of the application acquires common data frames interacted between other terminals and a wireless hotspot in a wireless local area network where the terminal is located, acquires a source IP address from the common data frames, judges whether the source IP address is from outside the wireless local area network, and determines the reason why the terminal cannot access the internet according to the judgment result. By adopting the technical scheme, the reason that the terminal cannot access the internet can be analyzed, the wireless network detection function of the terminal is enriched, and a user can take corresponding measures conveniently according to the analysis result.
Optionally, the apparatus may further comprise: a handshake data frame acquisition module, configured to acquire a handshake data frame transmitted in a wireless local area network before acquiring a common data frame transmitted in the wireless local area network in which a first terminal is located, where the handshake data frame includes a handshake data frame interacted between a second terminal and the wireless hotspot; and the key acquisition module is used for acquiring a target key from the handshake data frame, wherein the target key is used for decrypting the common data frame. The address acquisition module is used for: and acquiring a source IP address from the common data frame according to the target key.
Optionally, the address obtaining module is configured to:
decrypting the common data frame according to the target key to obtain an IP datagram;
and acquiring a source IP address from the IP datagram.
Optionally, the apparatus further includes a notification module, configured to notify the second terminal to reconnect the wireless hotspot and to reacquire the handshake data frame transmitted in the wireless local area network when the handshake data frame transmitted in the wireless local area network is not successfully acquired.
Optionally, the determining whether the source IP address is from outside the wireless local area network includes:
performing bit AND operation on the IP address of the first terminal and the subnet mask of the wireless local area network to obtain a first operation result;
performing bit AND operation on the source IP address and the subnet mask of the wireless local area network to obtain a second operation result;
and judging whether the first operation result is matched with the second operation result, and if not, determining that the source IP address is from the outside of the wireless local area network.
Optionally, the determining, according to the determination result, the reason why the first terminal cannot access the internet includes:
and when the source IP address comes from the outside of the wireless local area network, determining that the first terminal side is abnormal.
Optionally, the determining, according to the determination result, a reason why the first terminal cannot access the internet further includes:
and if the common data frame of which the source IP address is from the outside of the wireless network is not acquired within the preset time, determining that the wireless hotspot side is abnormal.
Embodiments of the present application also provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are configured to perform a wireless network detection method, the method including:
acquiring a common data frame transmitted in a wireless local area network where a first terminal is located, wherein the common data frame comprises a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network;
acquiring a source Internet Protocol (IP) address from the common data frame;
and judging whether the source IP address is from the outside of the wireless local area network, and determining the reason why the first terminal cannot access the Internet according to the judgment result.
Storage medium-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk, or tape devices; computer system memory or random access memory such as DRAM, DDRRAM, SRAM, EDORAM, Lanbas (Rambus) RAM, etc.; non-volatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a different second computer system connected to the first computer system through a network (such as the internet). The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media that may reside in different locations, such as in different computer systems that are connected by a network. The storage medium may store program instructions (e.g., embodied as a computer program) that are executable by one or more processors.
Of course, the storage medium provided in the embodiments of the present application contains computer-executable instructions, and the computer-executable instructions are not limited to the wireless network detection operation described above, and may also perform related operations in the wireless network detection method provided in any embodiments of the present application.
The embodiment of the application provides a terminal, and the wireless network detection device provided by the embodiment of the application can be integrated in the terminal. Fig. 5 is a schematic structural diagram of a terminal according to an embodiment of the present application. The terminal 500 may include: a memory 501, a processor 502 and a computer program stored on the memory 501 and executable by the processor 502, wherein the processor 502 executes the computer program to implement the wireless network detection method according to the embodiment of the present application.
The terminal provided by the embodiment of the application can analyze the reason that the terminal cannot access the Internet, enrich the wireless network detection function of the terminal and bring convenience to a user to take corresponding measures according to the analysis result.
Fig. 6 is a schematic structural diagram of another terminal provided in the embodiment of the present application, where the terminal may include: a housing (not shown), a memory 601, a Central Processing Unit (CPU) 602 (also called a processor, hereinafter referred to as CPU), a circuit board (not shown), and a power circuit (not shown). The circuit board is arranged in a space enclosed by the shell; the CPU602 and the memory 601 are disposed on the circuit board; the power supply circuit is used for supplying power to each circuit or device of the terminal; the memory 601 is used for storing executable program codes; the CPU602 executes a computer program corresponding to the executable program code by reading the executable program code stored in the memory 601 to implement the steps of:
acquiring a common data frame transmitted in a wireless local area network where a first terminal is located, wherein the common data frame comprises a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network;
acquiring a source Internet Protocol (IP) address from the common data frame;
and judging whether the source IP address is from the outside of the wireless local area network, and determining the reason why the first terminal cannot access the Internet according to the judgment result.
The terminal further comprises: peripheral interface 603, RF (Radio Frequency) circuitry 605, audio circuitry 606, speakers 611, power management chip 608, input/output (I/O) subsystem 609, other input/control devices 610, touch screen 612, other input/control devices 610, and external port 604, which communicate via one or more communication buses or signal lines 607.
It should be understood that the illustrated terminal 600 is merely one example of a terminal and that the terminal 600 may have more or fewer components than shown in the figures, may combine two or more components, or may have a different configuration of components. The various components shown in the figures may be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and/or application specific integrated circuits.
The following describes the terminal for wireless network detection provided in this embodiment in detail, and the terminal is taken as a mobile phone as an example.
A memory 601, the memory 601 being accessible by the CPU602, the peripheral interface 603, and the like, the memory 601 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic disk storage devices, flash memory devices, or other volatile solid state storage devices.
A peripheral interface 603, said peripheral interface 603 may connect input and output peripherals of the device to the CPU602 and the memory 601.
An I/O subsystem 609, the I/O subsystem 609 may connect input and output peripherals on the device, such as a touch screen 612 and other input/control devices 610, to the peripheral interface 603. The I/O subsystem 609 may include a display controller 6091 and one or more input controllers 6092 for controlling other input/control devices 610. Where one or more input controllers 6092 receive electrical signals from or transmit electrical signals to other input/control devices 610, the other input/control devices 610 may include physical buttons (push buttons, rocker buttons, etc.), dials, slide switches, joysticks, click wheels. It is noted that the input controller 6092 may be connected to any one of: a keyboard, an infrared port, a USB interface, and a pointing device such as a mouse.
A touch screen 612, which touch screen 612 is an input interface and an output interface between the user terminal and the user, displays visual output to the user, which may include graphics, text, icons, video, and the like.
The display controller 6091 in the I/O subsystem 609 receives electrical signals from the touch screen 612 or transmits electrical signals to the touch screen 612. The touch screen 612 detects a contact on the touch screen, and the display controller 6091 converts the detected contact into an interaction with a user interface object displayed on the touch screen 612, that is, to implement a human-computer interaction, where the user interface object displayed on the touch screen 612 may be an icon for running a game, an icon networked to a corresponding network, or the like. It is worth mentioning that the device may also comprise a light mouse, which is a touch sensitive surface that does not show visual output, or an extension of the touch sensitive surface formed by the touch screen.
The RF circuit 605 is mainly used to establish communication between the mobile phone and the wireless network (i.e., network side), and implement data reception and transmission between the mobile phone and the wireless network. Such as sending and receiving short messages, e-mails, etc. In particular, RF circuitry 605 receives and transmits RF signals, also referred to as electromagnetic signals, through which RF circuitry 605 converts electrical signals to or from electromagnetic signals and communicates with a communication network and other devices. RF circuitry 605 may include known circuitry for performing these functions including, but not limited to, an antenna system, an RF transceiver, one or more amplifiers, a tuner, one or more oscillators, a digital signal processor, a CODEC (CODEC) chipset, a Subscriber Identity Module (SIM), and so forth.
The audio circuit 606 is mainly used to receive audio data from the peripheral interface 603, convert the audio data into an electric signal, and transmit the electric signal to the speaker 611.
The speaker 611 is used to convert the voice signal received by the handset from the wireless network through the RF circuit 605 into sound and play the sound to the user.
And a power management chip 608 for supplying power and managing power to the hardware connected to the CPU602, the I/O subsystem, and the peripheral interface.
The wireless network detection device, the storage medium and the terminal provided in the above embodiments can execute the wireless network detection method provided in any embodiment of the present application, and have corresponding functional modules and beneficial effects for executing the method. For technical details that are not described in detail in the above embodiments, reference may be made to the wireless network detection method provided in any embodiment of the present application.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present application and the technical principles employed. It will be understood by those skilled in the art that the present application is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the application. Therefore, although the present application has been described in more detail with reference to the above embodiments, the present application is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the appended claims.

Claims (9)

1. A wireless network detection method is applied to a first terminal and comprises the following steps:
after detecting that the first terminal cannot access the internet, acquiring a common data frame transmitted in a wireless local area network where the first terminal is located, wherein the common data frame comprises a common data frame interacted between a second terminal and a wireless hotspot in the wireless local area network, and the second terminal is a terminal different from the first terminal;
acquiring a source Internet Protocol (IP) address from the common data frame;
judging whether the source IP address is from the outside of the wireless local area network, and determining the reason why the first terminal cannot access the Internet according to the judgment result;
wherein, the determining the reason why the first terminal cannot access the internet according to the judgment result comprises:
and when the source IP address comes from the outside of the wireless local area network, determining that the first terminal side is abnormal.
2. The method of claim 1, wherein before the obtaining the normal data frame transmitted in the wlan in which the first terminal is located, the method further comprises:
acquiring handshake data frames transmitted in the wireless local area network, wherein the handshake data frames comprise handshake data frames interacted between the second terminal and the wireless hotspot;
acquiring a target key from the handshake data frame, wherein the target key is used for decrypting the common data frame;
the obtaining a source internet protocol IP address from the common data frame includes:
and acquiring a source IP address from the common data frame according to the target key.
3. The method of claim 2, wherein the obtaining a source IP address from the normal data frame according to the target key comprises:
decrypting the common data frame according to the target key to obtain an IP datagram;
and acquiring a source IP address from the IP datagram.
4. The method of claim 2, further comprising: and if the handshake data frame transmitted in the wireless local area network is not successfully acquired, notifying the second terminal to reconnect the wireless hotspot, and acquiring the handshake data frame transmitted in the wireless local area network again.
5. The method of claim 1, wherein determining whether the source IP address is from outside the wireless local area network comprises:
performing bit AND operation on the IP address of the first terminal and the subnet mask of the wireless local area network to obtain a first operation result;
performing bit AND operation on the source IP address and the subnet mask of the wireless local area network to obtain a second operation result;
and judging whether the first operation result is matched with the second operation result, and if not, determining that the source IP address is from the outside of the wireless local area network.
6. The method of claim 1, wherein the determining the reason why the first terminal cannot access the internet according to the determination result further comprises:
and if the common data frame of which the source IP address is from the outside of the wireless network is not acquired within the preset time, determining that the wireless hotspot side is abnormal.
7. A wireless network detection apparatus, integrated in a first terminal, comprising:
the system comprises a common data frame acquisition module, a first terminal and a second terminal, wherein the common data frame acquisition module is used for acquiring a common data frame transmitted in a wireless local area network where the first terminal is located after detecting that the first terminal cannot access the internet, the common data frame comprises a common data frame interacted between the second terminal and a wireless hot spot in the wireless local area network, and the second terminal is a terminal different from the first terminal;
an address obtaining module, configured to obtain a source internet protocol IP address from the common data frame;
the network detection module is used for judging whether the source IP address is from the outside of the wireless local area network or not and determining the reason why the first terminal cannot access the Internet according to the judgment result;
wherein, the determining the reason why the first terminal cannot access the internet according to the judgment result comprises:
and when the source IP address comes from the outside of the wireless local area network, determining that the first terminal side is abnormal.
8. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the wireless network detection method according to any one of claims 1 to 6.
9. A terminal comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the wireless network detection method according to any one of claims 1 to 6 when executing the computer program.
CN201711072963.2A 2017-11-03 2017-11-03 Wireless network detection method, device, storage medium and terminal Active CN107734528B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711072963.2A CN107734528B (en) 2017-11-03 2017-11-03 Wireless network detection method, device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711072963.2A CN107734528B (en) 2017-11-03 2017-11-03 Wireless network detection method, device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN107734528A CN107734528A (en) 2018-02-23
CN107734528B true CN107734528B (en) 2021-01-15

Family

ID=61221434

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711072963.2A Active CN107734528B (en) 2017-11-03 2017-11-03 Wireless network detection method, device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN107734528B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109451530B (en) * 2019-01-03 2022-04-22 中国联合网络通信集团有限公司 Information collection method and information collection system
CN111131546A (en) * 2019-12-25 2020-05-08 宁波奥克斯电气股份有限公司 Method, device, system, terminal and medium for acquiring MAC address of terminal
CN111385631B (en) * 2020-03-04 2022-05-24 海信视像科技股份有限公司 Display device, communication method and storage medium
CN111093176B (en) * 2020-03-25 2020-07-07 炬星科技(深圳)有限公司 Robot network monitoring method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101765136A (en) * 2010-02-09 2010-06-30 深圳市同洲电子股份有限公司 Method, device and system for managing network dialing of mobile communication terminal
CN105357330A (en) * 2015-10-22 2016-02-24 上海斐讯数据通信技术有限公司 Method and system for preventing IP address conflict of network devices
CN106572010A (en) * 2015-10-12 2017-04-19 小米科技有限责任公司 Data package grabbing method and device, and terminal
CN106921956A (en) * 2015-12-28 2017-07-04 镇江坤泉电子科技有限公司 The method of automatic configuration on wireless network card equipment based on wireless network

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3665622B2 (en) * 2002-03-29 2005-06-29 株式会社東芝 Source address selection system, router device, communication node, and source address selection method
US7519991B2 (en) * 2002-06-19 2009-04-14 Alcatel-Lucent Usa Inc. Method and apparatus for incrementally deploying ingress filtering on the internet
CN1770709B (en) * 2004-11-01 2010-04-28 中兴通讯股份有限公司 ADSL fault diagnosis method
CN101136797B (en) * 2007-09-28 2012-11-21 深圳市利谱信息技术有限公司 Detection of inside and outside network physical connection, on-off control method and device for using the same
CN101917670A (en) * 2010-05-20 2010-12-15 中兴通讯股份有限公司 Method and system for transmitting wireless multicast data
CN102142981B (en) * 2010-11-01 2014-01-01 华为技术有限公司 Method and system for processing terminal disconnection and broadband remote access server
CN103067777B (en) * 2012-12-24 2017-07-25 深圳Tcl新技术有限公司 The reminding method and device of network state
CN104507132A (en) * 2014-12-23 2015-04-08 上海斐讯数据通信技术有限公司 Communication terminal and communication switching method implemented by same
CN104539464B (en) * 2015-01-19 2019-04-16 北京极科极客科技有限公司 Nodal fault diagnostics method and device
CN106034319A (en) * 2015-03-19 2016-10-19 小米科技有限责任公司 Connection method and device of wireless access point
CN104869665B (en) * 2015-04-10 2018-11-20 广东欧珀移动通信有限公司 Control method, wireless router and the mobile device of network connection
CN105263196A (en) * 2015-08-31 2016-01-20 小米科技有限责任公司 Connection state prompting method and device
CN105611564A (en) * 2016-02-25 2016-05-25 努比亚技术有限公司 Network stabilization control device and method
CN105897479B (en) * 2016-04-18 2019-10-22 上海斐讯数据通信技术有限公司 Detect the method and gateway of the Wide Area Network interface of gateway
CN106131906B (en) * 2016-06-16 2018-02-27 广东欧珀移动通信有限公司 Processing method, device and the mobile terminal of WiFi wireless roamings
CN106487584B (en) * 2016-09-30 2019-07-05 北京小米移动软件有限公司 Management method, router and the mobile terminal of router

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101765136A (en) * 2010-02-09 2010-06-30 深圳市同洲电子股份有限公司 Method, device and system for managing network dialing of mobile communication terminal
CN106572010A (en) * 2015-10-12 2017-04-19 小米科技有限责任公司 Data package grabbing method and device, and terminal
CN105357330A (en) * 2015-10-22 2016-02-24 上海斐讯数据通信技术有限公司 Method and system for preventing IP address conflict of network devices
CN106921956A (en) * 2015-12-28 2017-07-04 镇江坤泉电子科技有限公司 The method of automatic configuration on wireless network card equipment based on wireless network

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
相同无线环境下部分WLAN 用户"不能上网"问题的分析及解决方案;徐书军等;《信息通信》;20131115;第1-2页 *

Also Published As

Publication number Publication date
CN107734528A (en) 2018-02-23

Similar Documents

Publication Publication Date Title
US11741210B2 (en) Proximity unlock and lock operations for electronic devices
EP3823250B1 (en) Method and device for network configuration, router, and server
CN107734528B (en) Wireless network detection method, device, storage medium and terminal
WO2017198161A1 (en) Network connection method, apparatus, storage medium, and terminal
KR101830940B1 (en) Porting wifi settings
CN110278550B (en) Portable device, portable apparatus, and computer-readable medium
US11277744B2 (en) Wi-Fi hotspot connection method and terminal
WO2016173190A1 (en) Information providing method and device
US20060282541A1 (en) Method for setting communication parameters and communication device
KR20130044922A (en) Method and apparatus for wi-fi connecting using wi-fi protected setup in a portable terminal
CN107567017B (en) Wireless connection system, device and method
US10674353B2 (en) Association establishment method in wireless local area network, terminal, and access point
WO2016003311A1 (en) Device bootstrap to wireless network
EP3182787B1 (en) Communication method and device
CN104980919A (en) Method for acquiring network service information and equipment
WO2018120624A1 (en) Method, apparatus and system for obtaining authentication information
CN110621018B (en) WIFI detection terminal method
WO2018040805A1 (en) Method for establishing association in wireless local area network, terminal and access point
WO2021164312A1 (en) Wireless network information configuration method and apparatus for device
TW201328398A (en) Method for handling network connection and electrical apparatus using the same
KR20180121457A (en) Method and apparatus for wi-fi connecting using wi-fi protected setup in a portable terminal
KR20190057254A (en) Method and apparatus for wi-fi connecting using wi-fi protected setup in a portable terminal
CN117256166A (en) Information processing method and device, communication equipment and storage medium
CN117561749A (en) Pre-configured headless WIFI equipment and related systems, methods and equipment
CN117202313A (en) Automatic network distribution method and related device for intelligent equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant