CN106658756B - Method and device for identifying connection between terminal equipment and hotspot - Google Patents
Method and device for identifying connection between terminal equipment and hotspot Download PDFInfo
- Publication number
- CN106658756B CN106658756B CN201611144990.1A CN201611144990A CN106658756B CN 106658756 B CN106658756 B CN 106658756B CN 201611144990 A CN201611144990 A CN 201611144990A CN 106658756 B CN106658756 B CN 106658756B
- Authority
- CN
- China
- Prior art keywords
- message
- hotspot
- type message
- terminal type
- matching
- 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
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The embodiment of the invention discloses a method and a device for identifying connection between terminal equipment and a hotspot, wherein the method comprises the following steps: acquiring a message group to be identified, and analyzing messages in the message group; dividing the message into a terminal type message and a hotspot type message according to the information carried in the message; aiming at the terminal type message, matching BSSID in the obtained terminal type message with MAC address in the hotspot type message; and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message. In the embodiment of the invention, the received message is analyzed, the BSSID in the acquired terminal type message is matched with the MAC address in the hotspot type message, and whether the sending end corresponding to the terminal type message is connected with the hotspot is determined according to whether the matching is successful, so that whether each terminal device is connected with the hotspot can be accurately identified, and the data sending state of the terminal device can be known and monitored.
Description
Technical Field
The present invention relates to the field of wireless communication technologies, and in particular, to a method and an apparatus for identifying a connection between a terminal device and a hotspot.
Background
With the development and progress of science, network equipment begins to go into thousands of households, and is closely related to the production and life of people. Compared with a wired network, the application of the wireless network solves the problem that the equipment is limited by factors such as lines, environment and the like, so that the interconnection becomes simple and convenient, and the application is more and more extensive. The interconnection of intelligent household appliances in the family, the connection of various types of mobile phones, tablet computers and the like with wireless routes, the connection of various monitoring devices in security protection and the like bring great convenience to aspects such as production and life. In a very rare way, people can not leave the wireless network in production and life.
With the increasingly wide application of the terminal device, the terminal device plays an increasingly greater role in production and life, and in order to ensure normal production and life, the data sending state of the terminal device needs to be known and monitored, and whether the terminal device is connected with a hotspot is identified. For example: when the terminal device is a wireless network camera, it needs to know whether the terminal device can normally send the acquired video data. However, in the prior art, when it is necessary to identify whether the terminal device is connected to the hotspot, only the terminal device or the hotspot connected to the terminal device can be logged in to check, which is greatly limited.
Disclosure of Invention
The embodiment of the invention discloses a method and a device for identifying connection between terminal equipment and a hotspot, which are used for knowing and monitoring the data transmission state of the terminal equipment.
In order to achieve the above object, an embodiment of the present invention discloses a method for identifying a connection between a terminal device and a hotspot, which is applied to a wireless network card, and the method includes:
acquiring a first message group to be identified, and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card;
dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
aiming at the terminal type message, matching a first Basic Service Set Identifier (BSSID) in the terminal type message obtained by analysis with a first Media Access Control (MAC) address in a hotspot type message;
and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message.
Further, the method further comprises:
and acquiring the information of the hot spot connected with the sending end according to the information carried in the hot spot type message successfully matched with the terminal type message.
Further, the information of the hot spot includes:
one or more of an encryption manner of the hotspot, a name of the hotspot, and a channel connected with the hotspot.
Further, the acquiring the first packet group to be identified includes:
determining the time length of message receiving according to the current time and the last identification time;
and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
Further, the acquiring the first packet group to be identified includes:
receiving a message and caching the message;
and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
Further, the dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message includes:
detecting whether each message carries a Beacon identifier or not;
if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
Further, the method further comprises:
and adding the information of the MAC address carried in the hotspot type message into a hotspot database.
Further, the method further comprises:
acquiring a second message group to be identified, and analyzing messages in the second message group, wherein the messages in the second message group are received by the wireless network card;
dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
aiming at the terminal type message, matching a second BSSID in the terminal type message obtained by analysis with a second MAC address in the hotspot type message;
and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
Further, the wireless network card is a multi-antenna wireless network card based on 2.4GHz and/or 5GHz wireless standard protocols.
The embodiment of the invention discloses a device for identifying connection between terminal equipment and a hotspot, which is applied to a wireless network card, and comprises:
the first acquisition module is used for acquiring a first message group to be identified and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card;
the dividing module is used for dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
the matching module is used for matching a first Basic Service Set Identifier (BSSID) in the analyzed and obtained terminal type message with a first Media Access Control (MAC) address in a hotspot type message aiming at the terminal type message; and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message.
Further, the apparatus further comprises:
and the second acquisition module is used for acquiring the information of the hot spot connected with the sending end according to the information carried in the hot spot type message successfully matched with the terminal type message.
Further, the second obtaining module is specifically configured to obtain one or more of an encryption manner of the hotspot, a name of the hotspot, and a channel connected to the hotspot.
Further, the first obtaining module is specifically configured to determine a time length for receiving the message according to the current time and the time of last identification; and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
Further, the first obtaining module is specifically configured to receive a packet and cache the packet; and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
Further, the dividing module is specifically configured to detect, for each packet, whether the packet carries a Beacon identifier; if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
Further, the apparatus further comprises:
and the storage module is used for adding the information of the MAC address carried in the hotspot type message into a hotspot database.
Further, the apparatus further comprises:
the first obtaining module is further configured to obtain a second packet group to be identified, and analyze packets in the second packet group, where the packets in the second packet group are received by the wireless network card;
the dividing module is also used for dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
the matching module is also used for matching a second BSSID in the terminal type message obtained by analysis with a second MAC address in the hotspot type message aiming at the terminal type message; and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
Further, the wireless network card is a multi-antenna wireless network card based on 2.4GHz and/or 5GHz wireless standard protocols.
The embodiment of the invention provides a method and a device for identifying connection between terminal equipment and a hotspot, wherein the method comprises the following steps: acquiring a first message group to be identified, and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card; dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message; aiming at the terminal type message, matching a first Basic Service Set Identifier (BSSID) in the terminal type message obtained by analysis with a first Media Access Control (MAC) address in a hotspot type message; and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message. In the embodiment of the invention, the wireless network card analyzes the received message, matches the BSSID in the acquired terminal type message with the MAC address in the hotspot type message, and determines whether the sending end corresponding to the terminal type message is connected with the hotspot according to whether the matching is successful, so that whether each terminal device is connected with the hotspot can be accurately identified, and the data sending state of the terminal device can be known and monitored.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a method for identifying a connection between a terminal device and a hotspot according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram of a wireless network card according to embodiment 1 of the present invention;
fig. 3 is a flowchart of a method for identifying a connection between a terminal device and a hotspot according to embodiment 6 of the present invention;
fig. 4 is a flowchart of a method for identifying a connection between a terminal device and a hotspot according to another embodiment of the present invention;
fig. 5 is a schematic diagram of an apparatus for identifying a connection between a terminal device and a hotspot according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
fig. 1 is a flowchart of a method for identifying a connection between a terminal device and a hotspot, provided by an embodiment of the present invention, specifically including the following steps:
s101: and acquiring a first message group to be identified, and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card.
The embodiment of the invention is applied to the wireless network card, and the wireless network card can be a wireless network card arranged in the electronic equipment or a wireless network card connected with the electronic equipment through a USB interface. For example: the wireless network card may be a wireless network card arranged in a personal computer, a wireless network card in a mobile terminal, or a wireless network card connected with an electronic device through a USB interface.
In the following, a wireless network card connected to an electronic device network camera (IPC) through a USB2.0 interface is taken as an example to describe the structure of the wireless network card, and as shown in fig. 2, the wireless network card includes: antenna module, wifi chip module, power module, clock module. The antenna module is used for receiving and transmitting messages; the wifi chip module is used for realizing data processing of a wireless MAC layer in an 802.11 protocol; the power supply module is used for supplying power to each module in the wireless network card; the clock module is used for providing information such as clock frequency for the wifi chip module.
The wireless network card is based on 2.4GHz or 5GHz wireless standard protocols, and can also be a wireless network card simultaneously supporting 2.4GHz and 5GHz wireless standard protocols.
When a message is analyzed, a Media Access Control (MAC) address of a sending end, an MAC address of a receiving end, content in the message, and other information corresponding to the message may be obtained. The process of parsing the message belongs to the prior art, and is not described in detail in the embodiment of the present invention.
S102: and dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message.
Specifically, in the embodiment of the present invention, each message in the first message group is analyzed, and the messages are divided according to information carried in the message, where the carried information may be information of an MAC address of a sending end carried in the message, or information of a beacon carried in the message. The terminal type message refers to a message sent by terminal equipment, and the hotspot type message refers to a message sent by a hotspot.
After the message is divided, a Basic Service Set Identifier (BSSID) and an MAC address contained in the terminal type message are identified for the terminal type message, where the MAC address is a source MAC address in the terminal type message, that is, an MAC address of a transmitting end. In the embodiment of the present invention, the analyzing of the terminal type packet to obtain the BSSID and the source MAC address belongs to the prior art, and the process is not described in the embodiment of the present invention.
For each hotspot type message, identifying a first MAC address contained in the hotspot type message, wherein the first MAC address is a source MAC address in the hotspot type message, namely the MAC address of a sending end. In the embodiment of the present invention, the hotspot type message is analyzed to obtain the source MAC address thereof, which belongs to the prior art, and the process is not described in the embodiment of the present invention.
S103: and aiming at the terminal type message, matching a first Basic Service Set Identifier (BSSID) in the terminal type message obtained by analysis with a first Media Access Control (MAC) address in a hotspot type message.
S104: and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message.
In the embodiment of the invention, for each terminal type message, a first BSSID in the terminal type message is matched with a first MAC address of each hotspot type message, and when the matching is successful, a corresponding sending end connection hotspot in the terminal type message is determined. And when the matching is unsuccessful, determining that the corresponding transmitting end in the terminal type message is not connected with the hot spot. The BSSID in the terminal type message is matched with the MAC address in the hotspot type message, which belongs to the prior art, and the process is not described in the embodiment of the present invention.
In the embodiment of the invention, the wireless network card analyzes the received message, matches the BSSID in the acquired terminal type message with the MAC address in the hotspot type message, and determines whether the sending end corresponding to the terminal type message is connected with the hotspot according to whether the matching is successful, so that whether each terminal device is connected with the hotspot can be accurately identified, and the data sending state of the terminal device can be known and monitored.
Example 2:
in this embodiment of the present invention, to further obtain information of a terminal device connecting to a hotspot, on the basis of embodiment 1, the method in this embodiment of the present invention further includes:
and acquiring the information of the hot spot connected with the sending end according to the information carried in the hot spot type message successfully matched with the terminal type message.
The information of the hot spot includes:
one or more of an encryption manner of the hotspot, a name of the hotspot, and a channel connected with the hotspot.
Specifically, after determining that a corresponding sending end in the terminal type message is connected with a hot spot, analyzing the hot spot type message successfully matched with the terminal type message, and acquiring one or more of an encryption mode of the hot spot connected with the sending end, a name of the hot spot and a channel connected with the hot spot corresponding to the terminal type message. After the terminal device serves as a sending end to connect the hotspot, the hotspot type message sent by the hotspot connected with the terminal device contains the information of the hotspot, so that the hotspot type message is analyzed, and the information of the hotspot connected with the terminal device can be obtained. Specifically, parsing the hotspot type message to obtain hotspot information belongs to the prior art, and details thereof are not repeated in the embodiment of the present invention.
Example 3:
in the embodiment of the present invention, when identifying whether the terminal device is connected to the hotspot, the identification is performed on the received message, and in order to ensure the accuracy of the identification, at least two messages need to be obtained, and the at least two messages preferably include a terminal type message and a hotspot type message. Therefore, on the basis of the embodiment shown in fig. 1, in the embodiment of the present invention, the acquiring the first packet group to be identified includes:
determining the time length of message receiving according to the current time and the last identification time;
and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
Specifically, the wireless network card switches channels circularly to receive messages, and because the wireless network card can acquire the time on the operating system through the operating system connected with the wireless network card, the wireless network card can constantly judge whether the time length between the current time and the last identification time of each channel reaches a set time threshold value, and if so, the messages received within the time length are divided into a first message group to be identified. The set time threshold may be 100ms, 200ms, and the like, and may be flexibly set as required, and generally, the received message may be guaranteed within a time length corresponding to the time threshold, and the message includes a terminal type message and a hotspot type message. In the embodiment of the present invention, it is the prior art that the wireless network card circularly switches the channel to receive the message, and details are not described in the embodiment of the present invention.
Example 4:
in the embodiment of the present invention, when identifying whether the terminal device is connected to the hotspot, the identification is performed on the received message, and in order to ensure the accuracy of the identification, at least two messages need to be obtained, and the at least two messages preferably include a terminal type message and a hotspot type message. Therefore, on the basis of the embodiment shown in fig. 1, in the embodiment of the present invention, the acquiring the first packet group to be identified includes:
receiving a message and caching the message;
and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
Specifically, the received messages are stored in a cache, whether the number of the messages stored in the cache reaches a set number threshold value is judged, if yes, the messages stored in the cache are divided into a first message group to be identified, and the messages stored in the cache are emptied after the first message group is acquired. The number threshold may be, for example, 40 or 60, and it may be ensured that the stored message includes the terminal type message and the hotspot type message at the same time.
Example 5:
in order to accurately divide the packet into the terminal type packet and the hot spot type packet, on the basis of the embodiment shown in fig. 1, the dividing the packet into the terminal type packet and the hot spot type packet according to the information carried in the analyzed packet includes:
detecting whether each message carries a Beacon identifier or not;
if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
Specifically, only the message sent by the hotspot carries the Beacon identifier, so that after the message is analyzed, whether the message is a hotspot type message can be judged according to whether the message carries the Beacon identifier. In the embodiment of the present invention, it is prior art to detect whether a message carries a Beacon identifier, and the process is not described in the embodiment of the present invention.
Example 6:
on the basis of the embodiment shown in fig. 1, in order to further improve the accuracy of identifying the terminal device and the hotspot connection in the embodiment of the present invention, the method further includes:
and adding the information of the MAC address carried in the hotspot type message into a hotspot database.
The hot spot database stores the MAC address of the hot spot, so that when matching is carried out, the MAC address carried in the hot spot type message in the message group can be adopted for identification, and the MAC address in the hot spot database can also be used for identification, therefore, in the embodiment of the invention, even if the message does not contain the hot spot type message, the identification of whether the hot spot is connected or not can be carried out, and the identification accuracy is improved.
Specifically, the method further comprises:
acquiring a second message group to be identified, and analyzing messages in the second message group, wherein the messages in the second message group are received by the wireless network card;
dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
aiming at the terminal type message, matching a second BSSID in the terminal type message obtained by analysis with a second MAC address in the hotspot type message;
and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
As shown in fig. 3, the process of identifying a connection between a terminal device and a hotspot in this embodiment includes:
s301: and acquiring a message group to be identified, and analyzing messages in the message group, wherein the messages in the message group are received by the wireless network card.
S302: and dividing the message into a terminal type message and a hotspot type message according to the information carried in the message in the analyzed message group.
S303: and matching the BSSID in the analyzed terminal type message with the MAC address in the hotspot type message aiming at the terminal type message in the message group, and performing S305 when the matching is successful, or performing S304 otherwise.
S304: and matching the BSSID with the MAC address stored in the hotspot database, and if the matching is successful, performing S305, otherwise, performing S306.
S305: and determining a corresponding sending end connection hot spot in the terminal type message.
S306: and determining that the corresponding sending end in the terminal type message is not connected with the hot spot.
And at the moment, whether the MAC address of the sending end in each hotspot type message in the message group is stored in a hotspot database can be identified, if not, the MAC is stored in the hotspot database, so that the subsequent use is facilitated.
In the above embodiments of the present invention, the wireless network card may be a single-antenna wireless network card based on a 2.4GHz and/or 5GHz wireless standard protocol, or may be a multi-antenna wireless network card based on a 2.4GHz and/or 5GHz wireless standard protocol. Because the 2.4GHz wireless standard protocol includes the 802.11n protocol, and the 802.11n protocol includes a Multiple-Input Multiple-Output (MIMO) technology, the 5GHz wireless standard protocol includes the 802.11ac protocol, and the 802.11ac protocol also includes a Multiple-Input Multiple-Output (MIMO) technology, when the wireless network card is a multi-antenna wireless network card based on the 2.4GHz and/or 5GHz wireless standard protocols, the wireless network card can receive not only a message sent by a single-antenna terminal device, but also a message sent by a multi-antenna terminal device. Therefore, the wireless network card can receive all messages based on 2.4GHz and/or 5GHz wireless standard protocols, and the comprehensiveness of subsequent identification can be ensured.
In the embodiment of the invention, before the wireless network card identifies the connection between the terminal equipment and the hotspot, the initialization is required, the initialization comprises wireless drive loading and wireless protocol stack initialization, after the initialization is completed, the drive mode of the wireless network card can be set to be a monitoring mode, and the wireless network card can receive messages based on 2.4GHz and/or 5GHz wireless standard protocols in the air in the monitoring mode.
Fig. 4 is a schematic diagram of a detailed identification process of a terminal device connected to a hotspot, which is provided by an embodiment of the present invention, and the process includes:
s401: initialization is performed, which includes wireless driver loading and initializing the wireless protocol stack.
S402: and when the monitoring mode is set, receiving a message based on a 2.4GHz and/or 5GHz wireless standard protocol in the air.
S403: and acquiring a message group to be identified, and analyzing messages in the message group, wherein the messages in the message group are received by the wireless network card.
S404: and dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message.
S405: and aiming at the terminal type message, matching the basic service set identifier BSSID in the terminal type message obtained by analysis with the media access control MAC address in the hotspot type message.
S406: and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message.
Fig. 5 is a schematic diagram of an apparatus for identifying a connection between a terminal device and a hotspot, which is provided by an embodiment of the present invention and employs a wireless network card, and the apparatus includes:
a first obtaining module 51, configured to obtain a first packet group to be identified, and analyze packets in the first packet group, where the packets in the first packet group are received by the wireless network card;
a dividing module 52, configured to divide the message into a terminal type message and a hotspot type message according to information carried in the analyzed message;
a matching module 53, configured to match, for the terminal type packet, a first basic service set identifier BSSID in the terminal type packet obtained through analysis with a first media access control MAC address in the hotspot type packet; and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message.
The device further comprises:
a second obtaining module 55, configured to obtain, according to information carried in a hotspot type message that is successfully matched with the terminal type message, information of the hotspot connected to the sending end.
The second obtaining module 55 is specifically configured to obtain one or more of an encryption manner of a hotspot, a name of the hotspot, and a channel connected to the hotspot.
The first obtaining module 51 is specifically configured to determine a time length for receiving a message according to a current time and a time of last identification; and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
The first obtaining module 51 is specifically configured to receive a packet and cache the packet; and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
The dividing module 52 is specifically configured to detect, for each packet, whether the packet carries a Beacon identifier; if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
The device further comprises:
the storage module 54 is configured to add the information of the MAC address carried in the hotspot type message to a hotspot database.
The first obtaining module 51 is further configured to obtain a second packet group to be identified, and analyze a packet in the second packet group, where the packet in the second packet group is received by the wireless network card.
The dividing module 52 is further configured to divide the message into a terminal type message and a hotspot type message according to information carried in the analyzed message.
The matching module 53 is further configured to match, for the terminal type packet, a second BSSID in the terminal type packet obtained through analysis with a second MAC address in the hotspot type packet; and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
As shown in fig. 5, the wireless network card is a multi-antenna wireless network card based on 2.4GHz and/or 5GHz wireless standard protocols.
The embodiment of the invention provides a method and a device for identifying connection between terminal equipment and a hotspot, wherein the method comprises the following steps: acquiring a first message group to be identified, and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card; dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message; aiming at the terminal type message, matching a first Basic Service Set Identifier (BSSID) in the terminal type message obtained by analysis with a first Media Access Control (MAC) address in a hotspot type message; and when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message. In the embodiment of the invention, the wireless network card analyzes the received message, matches the BSSID in the acquired terminal type message with the MAC address in the hotspot type message, and determines whether the sending end corresponding to the terminal type message is connected with the hotspot according to whether the matching is successful, so that whether each terminal device is connected with the hotspot can be accurately identified, and the data sending state of the terminal device can be known and monitored.
For the system/apparatus embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for relevant points.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.
Claims (18)
1. A method for identifying connection between terminal equipment and a hotspot is characterized in that the method is applied to a wireless network card and comprises the following steps:
acquiring a first message group to be identified, and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card;
dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
aiming at the terminal type message, matching a first Basic Service Set Identifier (BSSID) in the terminal type message obtained by analysis with a first Media Access Control (MAC) address in a hotspot type message;
when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message;
and when the matching is unsuccessful, determining that the corresponding transmitting end in the terminal type message is not connected with the hot spot.
2. The method of claim 1, wherein the method further comprises:
and acquiring the information of the hot spot connected with the sending end according to the information carried in the hot spot type message successfully matched with the terminal type message.
3. The method of claim 2, wherein the information of the hotspot comprises:
one or more of an encryption manner of the hotspot, a name of the hotspot, and a channel connected with the hotspot.
4. The method of claim 1, wherein the obtaining the first packet group to be identified comprises:
determining the time length of message receiving according to the current time and the last identification time;
and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
5. The method of claim 1, wherein the obtaining the first packet group to be identified comprises:
receiving a message and caching the message;
and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
6. The method of claim 1, wherein the dividing the message into a terminal type message and a hotspot type message according to the information carried in the parsed message comprises:
detecting whether each message carries a Beacon identifier or not;
if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
7. The method of claim 1, wherein the method further comprises:
and adding the information of the MAC address carried in the hotspot type message into a hotspot database.
8. The method of claim 7, wherein the method further comprises:
acquiring a second message group to be identified, and analyzing messages in the second message group, wherein the messages in the second message group are received by the wireless network card;
dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
aiming at the terminal type message, matching a second BSSID in the terminal type message obtained by analysis with a second MAC address in the hotspot type message;
and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
9. The method of any one of claims 1-8, wherein the wireless network card is a multi-antenna wireless network card based on 2.4GHz and/or 5GHz wireless standard protocols.
10. The utility model provides a recognition device that terminal equipment and hot spot are connected which is characterized in that, is applied to wireless network card, the device includes:
the first acquisition module is used for acquiring a first message group to be identified and analyzing messages in the first message group, wherein the messages in the first message group are received by the wireless network card;
the dividing module is used for dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
the matching module is used for matching a first Basic Service Set Identifier (BSSID) in the analyzed and obtained terminal type message with a first Media Access Control (MAC) address in a hotspot type message aiming at the terminal type message; when the matching is successful, determining a corresponding sending end connection hotspot in the terminal type message; and when the matching is unsuccessful, determining that the corresponding transmitting end in the terminal type message is not connected with the hot spot.
11. The apparatus of claim 10, wherein the apparatus further comprises:
and the second acquisition module is used for acquiring the information of the hot spot connected with the sending end according to the information carried in the hot spot type message successfully matched with the terminal type message.
12. The apparatus of claim 11, wherein the second obtaining module is specifically configured to obtain one or more of an encryption manner of a hotspot, a name of the hotspot, and a channel connected to the hotspot.
13. The apparatus according to claim 10, wherein the first obtaining module is specifically configured to determine a time length for receiving the packet according to a current time and a time of last recognition; and judging whether the time length reaches a set time threshold value, and if so, dividing the messages received within the time length into a first message group to be identified.
14. The apparatus according to claim 10, wherein the first obtaining module is specifically configured to receive a packet and cache the packet; and judging whether the number of the messages stored in the cache reaches a set number threshold value, if so, dividing the messages stored in the cache into a first message group to be identified, and emptying the cache.
15. The apparatus according to claim 10, wherein the partitioning module is specifically configured to detect, for each packet, whether the packet carries a Beacon identifier; if so, dividing the message into a hotspot type message, otherwise, dividing the message into a terminal type message.
16. The apparatus of claim 10, wherein the apparatus further comprises:
and the storage module is used for adding the information of the MAC address carried in the hotspot type message into a hotspot database.
17. The apparatus of claim 10, wherein the apparatus further comprises:
the first obtaining module is further configured to obtain a second packet group to be identified, and analyze packets in the second packet group, where the packets in the second packet group are received by the wireless network card;
the dividing module is also used for dividing the message into a terminal type message and a hotspot type message according to the information carried in the analyzed message;
the matching module is also used for matching a second BSSID in the terminal type message obtained by analysis with a second MAC address in the hotspot type message aiming at the terminal type message; and when the matching is successful, determining that the corresponding sending end in the terminal type message is connected with a hot spot, otherwise, matching the second BSSID with the MAC address stored in a hot spot database, and when a third MAC address successfully matched with the second BSSID exists, determining that the corresponding sending end in the terminal type message is connected with the hot spot.
18. The apparatus of any one of claims 10-17, wherein the wireless network card is a multi-antenna wireless network card based on 2.4GHz and/or 5GHz wireless standard protocols.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611144990.1A CN106658756B (en) | 2016-12-13 | 2016-12-13 | Method and device for identifying connection between terminal equipment and hotspot |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611144990.1A CN106658756B (en) | 2016-12-13 | 2016-12-13 | Method and device for identifying connection between terminal equipment and hotspot |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106658756A CN106658756A (en) | 2017-05-10 |
CN106658756B true CN106658756B (en) | 2020-05-26 |
Family
ID=58824421
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611144990.1A Active CN106658756B (en) | 2016-12-13 | 2016-12-13 | Method and device for identifying connection between terminal equipment and hotspot |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106658756B (en) |
Families Citing this family (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107729202A (en) * | 2017-11-06 | 2018-02-23 | 深圳开发微电子有限公司 | Method for tracing USB production source |
CN108282551B (en) * | 2018-03-07 | 2021-04-09 | 成都众网行科技有限公司 | Message identification processing method and device, monitoring equipment and readable storage medium |
CN109803264B (en) * | 2018-12-24 | 2022-04-29 | 奇安信科技集团股份有限公司 | Method and device for recognizing wireless intrusion |
CN109451530B (en) * | 2019-01-03 | 2022-04-22 | 中国联合网络通信集团有限公司 | Information collection method and information collection system |
CN109982413B (en) * | 2019-02-19 | 2023-04-07 | 北京三快在线科技有限公司 | Mobile hotspot identification method and device, electronic equipment and storage medium |
CN109743745B (en) * | 2019-02-19 | 2021-01-22 | 北京三快在线科技有限公司 | Mobile network access type identification method and device, electronic equipment and storage medium |
CN110650516B (en) * | 2019-09-23 | 2021-10-08 | 芯海科技(深圳)股份有限公司 | Network distribution method and device, Internet of things equipment, terminal equipment and storage medium |
CN112235849A (en) * | 2020-10-19 | 2021-01-15 | 展讯半导体(成都)有限公司 | Method, system, electronic device, and medium for identifying Wi-Fi hotspot type |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN100403719C (en) * | 2006-02-10 | 2008-07-16 | 华为技术有限公司 | Virtual-link set-up method and apparatus |
CN102480729B (en) * | 2010-11-22 | 2015-11-25 | 中兴通讯股份有限公司 | Method and the access point of fake user is prevented in wireless access network |
CN102437897B (en) * | 2011-11-11 | 2016-06-29 | 杭州华三通信技术有限公司 | The sending method of a kind of Beacon and equipment |
CN104023336B (en) * | 2014-06-13 | 2018-12-21 | 张力军 | The radio switch-in method and mobile terminal of mobile terminal |
CN105429695B (en) * | 2015-10-28 | 2019-01-25 | 京信通信系统(中国)有限公司 | A kind of method and device for finding out wireless device information |
-
2016
- 2016-12-13 CN CN201611144990.1A patent/CN106658756B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN106658756A (en) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106658756B (en) | Method and device for identifying connection between terminal equipment and hotspot | |
US10993166B2 (en) | Data transmission method, electronic device, and computer readable storage medium | |
CN103428818B (en) | Terminal device discovery method, device and system | |
CN111542081B (en) | Communication switching method and device and Internet of things communication module | |
CN105072012A (en) | Quick network access method of intelligent device | |
RU2012151940A (en) | METHOD AND DEVICE FOR DETERMINING OPPORTUNITIES OF PROVIDING SERVICES BY ACCESS POINT | |
RU2015107560A (en) | METHODS, TERMINALS, AND SYSTEMS FOR FACILITATING THE COMMON USE OF DATA | |
WO2014121630A1 (en) | Method and device for transferring file | |
CN105940720A (en) | Method for triggering registration machine protocol interaction, access point and station point | |
CN106487847B (en) | Information processing method and transfer server | |
CN111263377B (en) | Network configuration method, device, equipment and system and distribution network testing method and system | |
CN104883242A (en) | Method and system for transmitting access points, stations and beacon frames | |
CN112203263A (en) | Broadcast message interaction method, terminal, device and medium | |
CN113225792B (en) | Communication method, device and system in unlicensed spectrum | |
CN111757317B (en) | Request processing method, related device and system | |
CN107454659B (en) | Terminal identification method, system, terminal equipment and base station | |
CN107483236B (en) | Method and device for backing up access point of Internet of things | |
CN107548058B (en) | Equipment access method and intelligent terminal | |
CN108112021B (en) | Method and device for returning radio frequency channel detection data | |
CN111093238B (en) | Wireless network control method and device, storage medium and electronic equipment | |
CN110278600B (en) | Communication between terminal and base station, and network access method and device of terminal | |
CN107079270B (en) | Downlink information receiving and sending method, user equipment and network equipment | |
CN103517373A (en) | Network access method and device | |
CN114222255B (en) | Method and device for device ad hoc network, electronic device and storage medium | |
CN105357078A (en) | Detection method and system of network state of 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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |