CN107666662B - Terminal identification method and access point - Google Patents

Terminal identification method and access point Download PDF

Info

Publication number
CN107666662B
CN107666662B CN201610613646.6A CN201610613646A CN107666662B CN 107666662 B CN107666662 B CN 107666662B CN 201610613646 A CN201610613646 A CN 201610613646A CN 107666662 B CN107666662 B CN 107666662B
Authority
CN
China
Prior art keywords
terminal
mac address
type identifier
identified
terminal type
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
CN201610613646.6A
Other languages
Chinese (zh)
Other versions
CN107666662A (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.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201610613646.6A priority Critical patent/CN107666662B/en
Publication of CN107666662A publication Critical patent/CN107666662A/en
Application granted granted Critical
Publication of CN107666662B publication Critical patent/CN107666662B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/005Discovery of network devices, e.g. terminals
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/22Processing or transfer of terminal data, e.g. status or physical capabilities
    • H04W8/24Transfer of terminal data

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The present application relates to the field of communications technologies, and in particular, to a terminal identification method and an AP, which are used for identifying a type of a terminal when the terminal only opens a WLAN function but does not establish a connection with the AP. The AP determines a first MAC address and a second MAC address from a corresponding relation table according to the corresponding relation table of the MAC addresses and the terminal type identifiers, wherein the second MAC address is the smallest MAC address in all MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; and determining the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address in the corresponding relation table and the second terminal type identifier corresponding to the second MAC address in the corresponding relation table.

Description

Terminal identification method and access point
Technical Field
The present application relates to the field of communications technologies, and in particular, to a terminal identification method and an Access Point (AP).
Background
At present, with the development and popularization of Wireless Local Area Networks (WLANs), users often carry terminals, such as mobile phones, tablets and the like, to go to various occasions and access different WLANs. Different users will usually carry different types of terminals, and the users will also have a tendency to behave and get used. Such as a type of terminal being a business type, the user of the terminal may be inclined to manage money, business related information, etc. If the type of the terminal is adolescent, the user of the terminal may prefer information related to music, animation, and the like. If the terminal type is identified, the information type required by the user of the terminal can be determined according to the terminal type, and then the promotion information which is more interesting to the user of the terminal can be pushed to different terminals by a market or a retail store and the like according to the terminal type, so that the promotion scheme is optimized.
The traditional method for identifying the type of the terminal comprises the following steps: after the terminal is connected to the AP, the terminal may send various messages to the AP, for example, a Dynamic Host Configuration Protocol (DHCP) message for acquiring an Internet Protocol (IP) address, a Domain Name Server (DNS) message when the terminal accesses the Internet, a HyperText Transfer Protocol (HTTP) message including user agent (user agent) information, and the like, and may analyze the type of the terminal according to the messages. However, in the conventional method for identifying the terminal type, the terminal must establish a connection with the AP, and then a message for analyzing the terminal type can be obtained, and then the terminal type can be analyzed according to the message. If the user does not establish connection with the AP and accesses the WLAN, the type of the terminal cannot be determined.
Disclosure of Invention
The application provides a terminal identification method and an AP (access point), which are used for identifying the type of a terminal under the condition that a user only opens a WLAN (wireless local area network) function of the terminal but does not establish connection with the AP.
In a first aspect, the present application provides a terminal identification method, including:
the AP acquires the MAC address of the terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
the AP determines a first MAC address and a second MAC address from the corresponding relation table when determining that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and the AP determines the terminal type identification corresponding to the MAC address of the terminal to be identified according to the first terminal type identification corresponding to the first MAC address and the second terminal type identification corresponding to the second MAC address.
In the application, optionally, according to the correspondence table of the MAC address and the terminal type identifier, when the MAC address of the terminal to be recognized is determined to exist in the correspondence table, the terminal type identifier corresponding to the MAC address of the terminal to be recognized is directly determined from the correspondence table of the MAC address and the terminal type identifier, the terminal type identifier of the terminal to be recognized is obtained, and an advertisement, activity information and the like can be pushed to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Optionally, the determining, by the AP, the terminal type identifier corresponding to the MAC address of the terminal to be recognized according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address includes: and when the AP determines that the first terminal type identifier is the same as the second terminal type identifier and the difference value between the second MAC address and the first MAC address is not larger than a first threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is presumed that it is highly probable that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, and in order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is not greater than the first threshold, it is determined that the first MAC address and the second MAC address are closer to each other, it is determined that the first MAC address and the second MAC address are the MAC addresses in the same batch, and it is further presumed that the first MAC address, the second MAC address, and the terminal type identifiers corresponding to the consecutive MAC addresses between the first MAC address and the second MAC address are the same with a high probability, because the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address, the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identifier. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, when the AP determines that the first terminal type identifier and the second terminal type identifier are the same and that the difference between the second MAC address and the first MAC address is greater than the first threshold, the AP determines the MAC address closest to the MAC address of the terminal to be identified, from among the first MAC address and the second MAC address; and when determining that the absolute value of the difference between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not greater than the second threshold, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same and the difference between the second MAC address and the first MAC address is greater than the first threshold, the first MAC address and the second MAC address are far apart, and are likely to be MAC addresses in two batches. Further, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is closer, and it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, when it is determined that the first terminal type identifier is different from the second terminal type identifier, the AP determines an MAC address closest to an MAC address of the terminal to be identified, from the first MAC address and the second MAC address; and when determining that the absolute value of the difference between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not greater than the second threshold, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identifier is different from the second terminal type identifier, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is relatively short, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
Optionally, after the AP determines a terminal type identifier corresponding to the MAC address of the terminal to be identified, after the terminal to be identified establishes a connection with the AP, the AP determines a confirmation type identifier of the terminal to be identified according to a message sent by the terminal to be identified; and the AP checks the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the AP determines that the type identifier is different from the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the AP modifies the terminal type identifier corresponding to the MAC address of the terminal to be recognized into: confirming the type identification.
Optionally, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be recognized is correct without correction according to the fact that the confirmation type identifier is the same as the terminal type identifier corresponding to the MAC address of the terminal to be recognized.
Optionally, determining the recognition accuracy according to the confirmation type identifier of each terminal to be recognized in the plurality of terminals to be recognized and the terminal type identifier corresponding to the MAC address of the terminal to be recognized; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased.
Optionally, the method further comprises: in the corresponding relation table, if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold, then: and the AP determines two MAC addresses, and all the MAC addresses between the two MAC addresses correspond to the third terminal type identification.
Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
In a second aspect, the present application provides an AP, comprising:
the device comprises an acquisition unit, a judging unit and a judging unit, wherein the acquisition unit is used for acquiring the MAC address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
the processing unit is used for determining a first MAC address and a second MAC address from the corresponding relation table when determining that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and determining the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address.
In this application, optionally, the processing unit is further configured to, according to the correspondence table between the MAC address and the terminal type identifier, when it is determined that the MAC address of the terminal to be recognized exists in the correspondence table, directly determine the terminal type identifier corresponding to the MAC address of the terminal to be recognized from the correspondence table between the MAC address and the terminal type identifier, obtain the terminal type identifier of the terminal to be recognized, and push an advertisement, activity information, and the like to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Optionally, the processing unit is configured to determine, when it is determined that the first terminal type identifier is the same as the second terminal type identifier and it is determined that the difference between the second MAC address and the first MAC address is not greater than the first threshold, that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is presumed that it is highly probable that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, and in order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is not greater than the first threshold, it is determined that the first MAC address and the second MAC address are closer to each other, it is determined that the first MAC address and the second MAC address are the MAC addresses in the same batch, and it is further presumed that the first MAC address, the second MAC address, and the terminal type identifiers corresponding to the consecutive MAC addresses between the first MAC address and the second MAC address are the same with a high probability, because the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address, the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identifier. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processing unit is further configured to determine, when it is determined that the first terminal type identifier and the second terminal type identifier are the same and it is determined that a difference between the second MAC address and the first MAC address is greater than a first threshold, a MAC address closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same and the difference between the second MAC address and the first MAC address is greater than the first threshold, the first MAC address and the second MAC address are far apart, and are likely to be MAC addresses in two batches. Further, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is closer, and it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processing unit is further configured to determine, when it is determined that the first terminal type identifier is different from the second terminal type identifier, a MAC address closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identifier is different from the second terminal type identifier, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is relatively short, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
Optionally, the processing unit is further configured to determine, according to a message sent by the terminal to be identified, a confirmation type identifier of the terminal to be identified after the terminal to be identified establishes a connection with the AP; and checking the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the type identifier is determined to be different from the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the processing unit modifies the terminal type identifier corresponding to the MAC address of the terminal to be recognized into: confirming the type identification.
Optionally, when the terminal type identifier corresponding to the MAC address of the terminal to be recognized is the same according to the confirmation type identifier, the processing unit determines that the terminal type identifier corresponding to the MAC address of the terminal to be recognized is correct, and does not need to correct the terminal type identifier.
Optionally, the processing unit is further configured to determine an identification accuracy according to the confirmation type identifier of each to-be-identified terminal in the plurality of to-be-identified terminals and the terminal type identifier corresponding to the MAC address of the to-be-identified terminal; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased.
Optionally, the processing unit is further configured to determine, in the correspondence table, two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold.
Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
In a third aspect, the present application provides an AP, comprising:
the memory is used for storing programs and instructions, and a corresponding relation table of the MAC address and the terminal type identifier;
a processor for executing, by calling programs and instructions stored in the memory:
acquiring an MAC address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
according to the corresponding relation table, when the MAC address of the terminal to be identified does not exist in the corresponding relation table, determining a first MAC address and a second MAC address from the corresponding relation table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and determining the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address.
In this application, optionally, the processor is further configured to, according to the correspondence table between the MAC address and the terminal type identifier, when it is determined that the MAC address of the terminal to be recognized exists in the correspondence table, directly determine the terminal type identifier corresponding to the MAC address of the terminal to be recognized from the correspondence table between the MAC address and the terminal type identifier, obtain the terminal type identifier of the terminal to be recognized, and push an advertisement, activity information, and the like to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Optionally, a processor for:
and when the first terminal type identifier and the second terminal type identifier are determined to be the same and the difference value between the second MAC address and the first MAC address is determined not to be larger than a first threshold value, determining the terminal type identifier corresponding to the MAC address of the terminal to be identified as the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is presumed that it is highly probable that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, and in order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is not greater than the first threshold, it is determined that the first MAC address and the second MAC address are closer to each other, it is determined that the first MAC address and the second MAC address are the MAC addresses in the same batch, and it is further presumed that the first MAC address, the second MAC address, and the terminal type identifiers corresponding to the consecutive MAC addresses between the first MAC address and the second MAC address are the same with a high probability, because the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address, the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identifier. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processor is further configured to determine, when it is determined that the first terminal type identifier and the second terminal type identifier are the same and it is determined that a difference between the second MAC address and the first MAC address is greater than a first threshold, a MAC address closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same and the difference between the second MAC address and the first MAC address is greater than the first threshold, the first MAC address and the second MAC address are far apart, and are likely to be MAC addresses in two batches. Further, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is closer, and it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processor is further configured to determine, when it is determined that the first terminal type identifier is different from the second terminal type identifier, a MAC address closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identifier is different from the second terminal type identifier, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is relatively short, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
Optionally, the processor is further configured to determine, according to a message sent by the terminal to be identified, a confirmation type identifier of the terminal to be identified after the terminal to be identified establishes a connection with the AP; and checking the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the terminal type identifier corresponding to the MAC address of the terminal to be recognized is different from the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the processor modifies the terminal type identifier corresponding to the MAC address of the terminal to be recognized into: confirming the type identification.
Optionally, when the terminal type identifier corresponding to the MAC address of the terminal to be recognized is the same as the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the processor determines that the terminal type identifier corresponding to the MAC address of the terminal to be recognized is correct, and does not need to correct the terminal type identifier.
Optionally, the processor is further configured to determine an identification accuracy according to the confirmation type identifier of each to-be-identified terminal in the plurality of to-be-identified terminals and the terminal type identifier corresponding to the MAC address of the to-be-identified terminal; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased.
Optionally, the processor is further configured to determine, in the correspondence table, two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold. Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
In the application, an AP acquires an MAC address of a terminal to be identified; the AP determines a first MAC address and a second MAC address from the corresponding relation table when determining that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and the AP determines the terminal type identification corresponding to the MAC address of the terminal to be identified according to the first terminal type identification corresponding to the first MAC address and the second terminal type identification corresponding to the second MAC address. And the terminal to be identified starts the WLAN function and does not establish connection with the AP. The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Drawings
In order to more clearly explain the technical solutions in the present application, the drawings that are needed in the description of the embodiments will be briefly introduced below.
FIG. 1 is a system architecture diagram provided herein;
fig. 2 is a schematic flow chart of a terminal identification method provided in the present application;
fig. 2a is a schematic flowchart of another terminal identification method provided in the present application;
fig. 2b is a schematic diagram of terminal type identifier discrimination provided in the present application;
fig. 2c is a schematic diagram of another terminal type identifier determination provided in the present application;
fig. 3 is a schematic flow chart of an AP provided in the present application;
fig. 4 is a schematic flow chart of an AP provided in the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more clearly apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Fig. 1 is a schematic diagram of a system architecture provided in the present application, which is used in a Wireless Local Area Network (WLAN). As shown in fig. 1, the system includes a plurality of terminals, such as a terminal 101 and a terminal 102, which turn on the WLAN function; also included are one or more APs, such as AP 103; the terminal in the present application may or may not establish a connection with the AP103, for example, in fig. 1, the terminal 101 only turns on the WLAN function, but does not establish a connection with the AP103, and the terminal 102 not only turns on the WLAN function but also establishes a connection with the AP 103. The terminal to be identified in the present application is any terminal, and is a terminal which starts a WLAN function and does not establish a connection with an AP through a WLAN.
The AP103 is an access point of a WLAN, colloquially referred to as a "hot spot". The terminal 101 and the terminal 102 may be any form of device having WLAN functionality, such as a WLAN-enabled cell phone, a tablet, a vehicle-mounted device, a wearable device, and so on.
In the embodiment of the present invention, "first", "second", and "third" are used only for distinction and do not have a limiting function, such as "first" and "second" in "first MAC address" and "second MAC address", and further such as "first", "second", and "third" in "first terminal type identifier", "second terminal type identifier", and "third terminal type identifier".
Fig. 2 is a schematic flow chart of a terminal identification method provided in the present application. Based on the system architecture shown in fig. 1, as shown in fig. 2, the terminal identification method includes:
step 201, the AP obtains a Media Access Control (MAC) address of the terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
step 202, the AP determines that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier;
step 203, the AP determines a first MAC address and a second MAC address from the correspondence table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table;
and 204, the AP determines the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address.
Optionally, the terminal to be identified establishes a connection with the AP through the WLAN, specifically, the terminal to be identified passes authentication of the AP, and sends an association request frame to the AP, and the AP returns an association response frame to the terminal to be identified, so as to complete a connection process, and then the terminal to be identified may send a data frame to the AP. Optionally, the to-be-identified terminal starts a WLAN function and does not establish a connection with the AP, specifically, the to-be-identified terminal starts the WLAN function but does not pass authentication of the AP, or the to-be-identified terminal does not send an association request frame to the AP, or the AP does not return an association response frame to the to-be-identified terminal. In summary, in step 201, the terminal to be identified does not complete the connection process with the AP.
In the application, optionally, according to the correspondence table of the MAC address and the terminal type identifier, when the MAC address of the terminal to be recognized is determined to exist in the correspondence table, the terminal type identifier corresponding to the MAC address of the terminal to be recognized is directly determined from the correspondence table of the MAC address and the terminal type identifier, the terminal type identifier of the terminal to be recognized is obtained, and an advertisement, activity information and the like can be pushed to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
In the application, one corresponding relation in the corresponding relation table of the MAC address and the terminal type identifier can be obtained in various ways.
In the first obtaining manner, the terminal type identifier corresponding to the MAC address of the terminal to be identified may be determined according to the methods in steps 201 to 204 provided in the present application, and the correspondence table between the MAC address of the terminal to be identified and the terminal type identifier is stored in the correspondence table, so as to become one entry in the correspondence table.
The second acquisition mode is that after the connection between the terminal and the AP is determined, the terminal which establishes the connection with the AP is acquired to send a plurality of messages; and determining the MAC address of the terminal and the type identifier of the terminal according to the plurality of messages. That is, after the terminal establishes connection with the AP, the terminal confirmation type identifier is obtained according to a plurality of messages sent by the terminal, and the correspondence between the MAC address of the terminal and the confirmation type identifier is stored in the correspondence table, which becomes an entry in the table. In this way, after a period of time, more and more entries, i.e. the correspondence table of the MAC address of the terminal and the identification of the type of acknowledgement, are stored.
Specifically, when the terminal establishes a connection with the AP through the WLAN, the terminal may send various messages, and the AP collects some specific messages sent by the terminal, such as a DHCP Message that can obtain an IP address, a DNS Message when the terminal accesses the internet, an HTTP Message including user agent information, a Simple Network Management Protocol (SNMP) Message, a Server Message Block (SMB) Message, and the like. And then determining the confirmation type identifier of the terminal according to the specific messages and the rule base, or analyzing the behavior habit of the user according to the specific messages, thereby determining the confirmation type identifier of the terminal.
In the third obtaining manner, optionally, in the correspondence table, if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold, it is determined that the two MAC addresses and all the MAC addresses between the two MAC addresses correspond to the third terminal type identifier. The third terminal type identifier is any one terminal type identifier in the corresponding relation table.
In view of the implementation, the MAC addresses of the same terminal type of the same lot or lots are generally consecutive. That is, the terminal types corresponding to one batch of consecutive MAC addresses are the same with a high probability, and the terminal types corresponding to a plurality of batches of consecutive MAC addresses may be the same. Therefore, the table entry in the corresponding relationship table can be determined through the third obtaining mode.
After determining that the two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier, a correspondence table between the terminal type identifier and the MAC address interval may be stored in the correspondence table. Therefore, through the third obtaining method, the corresponding relation between all the MAC addresses between the two MAC addresses and the terminal type identifier is obtained. Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
For example, for some correspondence tables of MAC addresses and terminal type identifiers already stored in the correspondence table, for example, the correspondence table stores MAC1 and MAC105, but does not store MAC addresses between MAC1 and MAC105, at this time, if it is determined that terminal type identifiers corresponding to MAC1 and MAC105 are the same, for example, both identifiers 1, and it is determined that the difference between MAC105 and MAC1 is not greater than the first threshold, all MAC addresses between MAC1 and MAC105 (including MAC1 and MAC105) in the correspondence table may be stored, and the corresponding identifier 1 is stored in the table as one entry, for example, as shown in table 2 below.
Optionally, the correspondence table between the MAC address and the terminal type identifier in the present application may have a plurality of presentation manners, and the following two examples are provided in the present application.
In a first example, one terminal class identifier in the correspondence table corresponds to one MAC address. Table 1 is one possible form of the correspondence table.
As shown in table 1, the terminal type identifier corresponding to MAC1 in table 1 is P1, the terminal type identifier corresponding to MAC20 is P1, the terminal type identifier corresponding to MAC2000 is P9, and so on.
TABLE 1
MAC address Terminal type identification
MAC1 P1
MAC20 P1
MAC35 P1
MAC105 P1
MAC699 P5
MAC2000 P9
As a second example, one terminal class identifier in the correspondence table may correspond to one MAC address interval. Table 2 is one possible form of correspondence table.
Optionally, as shown in table 2, in the correspondence table, a MAC address interval (including the MAC start address and the MAC end address) composed of the MAC start address and the MAC end address corresponds to a terminal type identifier, which may be expressed as [ MAC start address, MAC end address ] < - > terminal type identifier, for example.
For example, the first entry in table 2 is a terminal type identifier P1 corresponding to a MAC address interval composed of MAC1 to MAC105, which may be represented as [ MAC1, MAC105] < > P1; the terminal type identifiers of the terminals corresponding to all MAC addresses in the MAC address interval from MAC205 to MAC255 are P2, which can be represented as [ MAC205, MAC255] < - > P2. The difference between the MAC start address and the MAC end address in table 2 is not greater than the first threshold.
There may also be some special expressions in table 2, such as MAC start address is MAC2000, MAC end address is MAC2000, and its corresponding terminal type is identified as P9. It is stated that the MAC address of one entry stored in table 2 is MAC2000, and the corresponding terminal type identifier is P9.
Optionally, there may also be some MAC address intervals in table 2 that have only a start address, or only an end address, etc., and after storing more and more entries in the later stage, table 2 may be completed. For example, the MAC start address is MAC900, but the terminal class identifier corresponding to the interval in which the MAC end address does not exist is P6. For another example, the MAC ending address is MAC1501, but the terminal class identifier corresponding to the interval without the MAC starting address is P9.
TABLE 2
MAC start address MAC end address Terminal type identification
MAC1 MAC105 P1
MAC205 MAC255 P2
MAC388 MAC405 P3
MAC699 MAC899 P5
MAC2000 MAC2000 P9
In this application, one MAC address interval corresponding to the terminal type identifier in one entry in table 2 may be obtained through any one or any several obtaining manners, for example, through the third obtaining manner. For example, after determining that the terminal type identifier corresponding to the MAC1 is P1 and the terminal type identifier corresponding to the MAC105 is P1 through the first obtaining manner or the second obtaining manner, the terminal type identifier corresponding to the MAC address between the MAC105 and the MAC1 may be further determined through a third obtaining manner, specifically: the difference between MAC105 and MAC1 is 104, less than 120, the first threshold is 120, and a table entry in table 2 is determined to be: the starting address is MAC1, the ending address is MAC105, and the corresponding terminal type is P1, so that the consumption of storage resources can be reduced, and the speed of terminal type identification can be increased.
Optionally, the terminal type identifier includes a terminal model, an operating system, a manufacturer, and the like.
In step 201, optionally, a WLAN probe request frame (english: probe request) sent by the terminal is obtained; and determining the MAC address of the terminal to be identified according to the WLAN detection request frame. Specifically, the terminal to be identified starts the WLAN function, and does not establish a connection with the AP through the WLAN. At this time, the terminal to be identified may send a WLAN probe request frame, where the WLAN probe request frame includes the MAC address of the terminal to be identified, and the AP may detect the WLAN probe request frame and analyze the WLAN probe request frame to obtain the MAC address of the terminal to be identified.
When determining that the MAC address of the terminal to be identified does not exist in the correspondence table, optionally, the AP determines the first MAC address and the second MAC address from the correspondence table. For example, all MAC addresses in the correspondence table that are smaller than the MAC address of the terminal to be identified are referred to as a first MAC set, and all MAC addresses in the correspondence table that are larger than the MAC address of the terminal to be identified are referred to as a second MAC set; the largest MAC address in the first MAC set is the first MAC address, and the smallest MAC address in the second MAC set is the second MAC address.
Optionally, determining a terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier and the second terminal type identifier includes: and when the AP determines that the first terminal type identifier is the same as the second terminal type identifier and the difference value between the second MAC address and the first MAC address is not larger than a first threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is assumed that it is likely that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, but there is also a possibility that: that is, the first MAC address is a MAC address in the first batch, the terminal type identifiers corresponding to some consecutive MAC addresses of the batch are the same, but the second MAC address is a MAC address in the second batch, the terminal type identifiers corresponding to some consecutive MAC addresses of the batch are the same as the terminal type identifiers corresponding to the MAC address in the first batch, but the MAC address in the first batch and the MAC address in the second batch are not consecutive MAC addresses, but are discontinuous batches with a plurality of MAC addresses therebetween. For example, MAC1 and MAC105 are the first lot, and the terminal type corresponding to the MAC address interval (including MAC1 and MAC105) from MAC1 to MAC105 is identified as P1; the MAC580 and the MAC780 are in the second batch, and a terminal type identifier corresponding to a MAC address interval (including the MAC580 and the MAC780) from the MAC580 to the MAC780 is P1; however, the inter-zone MACs 1-105 are different from the inter-zone MACs 580-780 by a plurality of MAC addresses, for example, the terminal type identifier corresponding to the MAC 200-300 may be P2.
In order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, further determining whether a difference value between the second MAC address and the first MAC address is not larger than a first threshold value, and if the difference value between the second MAC address and the first MAC address is larger than the first threshold value, indicating that the first MAC address and the second MAC address are far away from each other and are likely to be MAC addresses in two batches; if the difference value between the second MAC address and the first MAC address is not larger than the first threshold value, the first MAC address and the second MAC address are relatively close to each other, the first MAC address and the second MAC address are determined to be MAC addresses in the same batch, the first MAC address, the second MAC address and terminal type identifications corresponding to continuous MAC addresses between the first MAC address and the second MAC address are estimated to be the same with high probability, and the terminal type identification corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identification as the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address.
Optionally, determining a terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier and the second terminal type identifier includes:
when the AP determines that the first terminal type identifier is the same as the second terminal type identifier and the difference value between the second MAC address and the first MAC address is larger than a first threshold value, determining the MAC address which is closest to the MAC address of the terminal to be identified; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same, it is assumed that it is highly probable that the terminal type identifiers corresponding to a batch of consecutive MAC addresses from the first MAC address to the second MAC address are the same with a high probability. But there is also the possibility that: that is, the first MAC address is a MAC address in the first batch, the terminal type identifiers corresponding to some consecutive MAC addresses of the batch are the same, but the second MAC address is a MAC address in the second batch, the terminal type identifiers corresponding to some consecutive MAC addresses of the batch are the same as the terminal type identifiers corresponding to the MAC address in the first batch, but the MAC address in the first batch and the MAC address in the second batch are not consecutive MAC addresses, but are discontinuous batches with a plurality of MAC addresses that are directly different.
In order to determine whether a batch of consecutive MAC addresses from the first MAC address to the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is greater than the first threshold, it indicates that the first MAC address and the second MAC address are far apart, and it is likely that the MAC addresses in the two batches are.
In order to further determine the type identification of the terminal to be identified, the MAC address which is closest to the MAC address of the terminal to be identified is determined from the first MAC address and the second MAC address, i.e., it is presumed that the terminal type identification of the terminal to be identified is likely to be the same as the terminal type identification of the nearest-neighbor MAC address of the terminal to be identified, and further, in order to determine whether the terminal type identification of the terminal to be identified is the same as the terminal type identification of the nearest neighbor MAC address of the terminal to be identified, when determining whether the absolute value of the difference between the nearest neighbor MAC address and the MAC address of the terminal to be identified is not greater than the second threshold value, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is greater than the second threshold value, the distance between the nearest MAC address and the MAC address of the terminal to be identified is too far, so that the terminal type identifier corresponding to the MAC address of the terminal to be identified cannot be determined; and if the absolute value of the difference value between the nearest MAC address and the MAC address of the terminal to be identified is not larger than the second threshold, the nearest MAC address is closer to the MAC address of the terminal to be identified, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address.
Optionally, determining a terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier and the second terminal type identifier, further comprising: when determining that the first terminal type identifier is different from the second terminal type identifier, the AP determines an MAC address which is closest to the MAC address of the terminal to be identified; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identification is different from the second terminal type identification, the MAC address which is nearest to the MAC address of the terminal to be identified is determined from the first MAC address and the second MAC address, i.e., it is presumed that the terminal type identification of the terminal to be identified is likely to be the same as the terminal type identification of the nearest-neighbor MAC address of the terminal to be identified, and further, in order to determine whether the terminal type identification of the terminal to be identified is the same as the terminal type identification of the nearest neighbor MAC address of the terminal to be identified, when determining whether the absolute value of the difference between the nearest neighbor MAC address and the MAC address of the terminal to be identified is not greater than the second threshold value, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is greater than the second threshold value, the distance between the nearest MAC address and the MAC address of the terminal to be identified is too far, so that the terminal type identifier corresponding to the MAC address of the terminal to be identified cannot be determined; and if the absolute value of the difference value between the nearest MAC address and the MAC address of the terminal to be identified is not larger than the second threshold, the nearest MAC address is closer to the MAC address of the terminal to be identified, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address.
Optionally, calculating an absolute value of a difference value between the first MAC address and the MAC address of the terminal to be identified to obtain a first absolute value; calculating the absolute value of the difference between the second MAC address and the MAC address of the terminal to be identified to obtain a second absolute value; from the smaller value of the first absolute value and the second absolute value, the MAC address corresponding to the smaller value is: the MAC address closest to the MAC address of the terminal to be identified.
In order to introduce the above method flow more clearly, fig. 2a exemplarily shows a flow diagram of another terminal identification method provided in the present application, and as shown in fig. 2a, the method includes:
step 2101, the AP obtains the MAC address of the terminal to be identified;
step 2102, the AP judges whether the MAC address of the terminal to be identified exists in the correspondence table of the MAC address and the terminal type identifier; if yes, go to step 2103; if not, go to step 2104;
step 2103, the AP determines a terminal type identifier corresponding to the MAC address of the terminal to be identified from the correspondence table, to obtain a terminal type identifier of the terminal to be identified; the AP may push advertisements, activity information, and the like to the terminal to be recognized according to the obtained terminal type identifier of the terminal to be recognized.
Step 2104, the AP determines the first MAC address and the second MAC address from the correspondence table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table;
step 2105, the AP determines whether the first terminal type identifier and the second terminal type identifier are the same; if yes, executing step 2106, and if not, executing step 2108;
step 2106, the AP determines whether the difference between the second MAC address and the first MAC address is not greater than a first threshold, if so, then step 2107 is executed; if not, go to step 2108;
step 2107, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier;
step 2108, the AP determines the MAC address closest to the MAC address of the terminal to be identified from the first MAC address and the second MAC address;
step 2109, the AP determines whether the absolute value of the difference between the MAC address of the nearest neighbor and the MAC address of the terminal to be identified is not greater than a second threshold; if yes, go to step 2110; if not, go to step 2111;
step 2110, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address by the AP;
step 2111, end; that is, at this time, the terminal type identifier of the terminal to be identified cannot be determined.
In the application, optionally, after the AP determines the terminal type identifier corresponding to the MAC address of the terminal to be identified, after the terminal to be identified establishes a connection with the AP, the AP determines the confirmation type identifier of the terminal to be identified according to a message sent by the terminal to be identified; and the AP checks the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier. Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the AP determines that the type identifier is different from the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the AP modifies the terminal type identifier corresponding to the MAC address of the terminal to be recognized into: confirming the type identification.
Optionally, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be recognized is correct without correction according to the fact that the confirmation type identifier is the same as the terminal type identifier corresponding to the MAC address of the terminal to be recognized.
For example, according to the above steps 201 to 204, it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is P1, when the terminal to be identified accesses the AP, the AP determines that the confirmation type identifier of the terminal to be identified is P2 according to the message reported by the terminal to be identified, and then corrects the terminal type identifier corresponding to the MAC address of the terminal to be identified to P2; when the to-be-identified terminal accesses the AP, the AP determines that the confirmation type identifier of the to-be-identified terminal is P1 according to the message reported by the to-be-identified terminal, and then determines that the terminal type identifier corresponding to the MAC address of the to-be-identified terminal determined in the above steps 201 to 204 is correct, and does not need to be corrected.
Alternatively, the MAC address of the terminal to be identified and the confirmation type identifier of the terminal may be stored in the correspondence table, and become an entry in the correspondence table. Optionally, the MAC address of the terminal to be identified and the determined terminal type identifier corresponding to the MAC address of the terminal to be identified may also be stored in the correspondence table, so as to become an entry in the correspondence table. And when the terminal to be recognized is connected with the AP in the later period, checking and correcting the terminal type identifier corresponding to the MAC address of the terminal to be recognized corresponding to the terminal to be recognized in the corresponding relation table by determining the confirmation type identifier of the terminal to be recognized.
Optionally, determining the recognition accuracy according to the confirmation type identifier of each terminal to be recognized in the plurality of terminals to be recognized and the terminal type identifier corresponding to the MAC address of the terminal to be recognized; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Optionally, adjusting the first threshold and the second threshold according to the recognition accuracy and the accuracy threshold includes: the AP narrows the first threshold and the second threshold upon determining that the identification accuracy is not greater than the accuracy threshold.
For example, when at least one terminal to be identified is five terminals to be identified, none of the five terminals to be identified establishes a connection with the AP, and all of the five terminals to be identified have the WLAN function turned on, the AP identifies the MAC addresses of the five terminals to be identified. The corresponding relation table does not store the MAC addresses of the five terminals to be identified. And determining a terminal type identifier corresponding to the MAC address of each terminal to be identified in the five terminals to be identified according to the corresponding relation table. Then, when the five terminals to be identified are accessed to the AP, each of the five terminals to be identified may send a plurality of messages, such as a DHCP message for acquiring an IP address, a DNS message when the terminal accesses the internet, an HTTP message including User-Agent information, an SNMP message, an SMB message, and the like. And determining the confirmation type identification of each terminal to be identified according to the plurality of messages sent by each terminal to be identified.
Further, for each terminal to be recognized in the five terminals to be recognized, when the terminal type identifier corresponding to the MAC address of the terminal to be recognized is the same as the confirmation type identifier of the terminal to be recognized, it is determined that the terminal type identifier of the terminal to be recognized is recognized accurately; and if the terminal type identifier corresponding to the MAC address of the terminal to be identified is different from the confirmation type identifier of the terminal to be identified, determining that the terminal type identifier of the terminal to be identified is identified wrongly.
For example, in five terminals to be recognized, the terminal type identifiers of three terminals to be recognized are accurately recognized, the terminal type identifiers of two terminals to be recognized are wrongly recognized, and at this time, the recognition accuracy of the terminal type identifiers is equal to three divided by five, that is, the recognition accuracy of the terminal type identifiers is 60%. That is to say, the identification accuracy of the terminal type identifier is the proportion of the accurately identified terminal to be identified in the plurality of terminals to be identified.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased. Further, in order to increase the accuracy of the first threshold and the second threshold, the sample range may be expanded as much as possible, that is, the number of the at least one terminal to be identified is expanded, for example, the number of all terminals to be identified that have been identified historically is considered as the number of the at least one terminal to be identified, or the number of all terminals to be identified that have been identified within one month is considered as the number of the at least one terminal to be identified.
Fig. 2b exemplarily shows a schematic diagram of terminal type identifier determination, as shown in fig. 2b, the MAC address of the terminal to be identified is MAC4, and the correspondence table includes the following MAC addresses: MAC1, MAC2, and MAC3, wherein the terminal type identifier corresponding to MAC1 is P1, the terminal type identifier corresponding to MAC2 is P6, and the terminal type identifier corresponding to MAC3 is P7. MAC4 is larger than MAC2 and smaller than MAC 3. Since the terminal type identifications of MAC2 and MAC3 are different, if it is further determined that the difference between MAC4 and MAC2 is less than the second threshold, it may be determined that the terminal type identification of MAC4 is the same as the terminal type identification of MAC2, which is also P6.
Fig. 2c exemplarily shows a schematic diagram of terminal type identifier determination, as shown in fig. 2c, the MAC address of the terminal to be identified is MAC4, and the correspondence table includes the following MAC addresses: MAC1, MAC2, and MAC3, wherein the terminal type identifier corresponding to MAC1 is P1, the terminal type identifier corresponding to MAC2 is P6, and the terminal type identifier corresponding to MAC3 is P6. MAC4 is larger than MAC2 and smaller than MAC 3. Since the terminal type identifications of MAC2 and MAC3 are the same, if it is further determined that the difference between MAC3 and MAC2 is less than the first threshold, it may be determined that the terminal type identification of MAC4 is the same as the terminal type identifications of MAC2 and MAC3, which is also P6.
As can be seen from fig. 2b and fig. 2c, the accuracy of the determination in fig. 2c is higher, and therefore, optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
In the application, the terminal type identifier of the terminal can be identified even under the condition that the terminal does not establish connection with the AP. For example, in a market, a retail store, or the like, an operator needs to analyze the user behavior of a terminal using different terminal type identifiers according to the terminal type identifiers, so as to optimize a sales promotion strategy, attract more users to meet and consume, increase income, improve user satisfaction, and the like. And the merchant such as the operator can also push more appropriate popularization information for the terminal according to the terminal type identifier. In addition, the administrator can also set different network access authorities for different terminals according to the terminal type identification.
From the above, it can be seen that: in the application, because the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, the MAC address of the terminal to be identified can be obtained, and further, because the first MAC address and the second MAC address which are most adjacent to the MAC address of the terminal to be identified are determined from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or multiple batches are usually continuous in the actual production process of the terminal, the terminal type identifier corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identifier and the second terminal type identifier which are nearest to the MAC address of the terminal to be identified, so that the problem that the terminal type identifier cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Based on the same concept, the present application provides an AP 300 for executing the above method flow, and fig. 3 exemplarily shows a schematic structural diagram of an AP provided by the present application. The AP 300 comprises an acquisition unit 301 and a processing unit 302, wherein:
an obtaining unit 301, configured to obtain an MAC address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
a processing unit 302, configured to determine, according to the correspondence table between the MAC address and the terminal type identifier, when it is determined that the MAC address of the terminal to be identified does not exist in the correspondence table, a first MAC address and a second MAC address from the correspondence table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and determining the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address.
In this application, optionally, the processing unit is further configured to, according to the correspondence table between the MAC address and the terminal type identifier, when it is determined that the MAC address of the terminal to be recognized exists in the correspondence table, directly determine the terminal type identifier corresponding to the MAC address of the terminal to be recognized from the correspondence table between the MAC address and the terminal type identifier, obtain the terminal type identifier of the terminal to be recognized, and push an advertisement, activity information, and the like to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Optionally, the processing unit 302 is configured to determine, when it is determined that the first terminal type identifier is the same as the second terminal type identifier and it is determined that the difference between the second MAC address and the first MAC address is not greater than the first threshold, that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is presumed that it is highly probable that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, and in order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is not greater than the first threshold, it is determined that the first MAC address and the second MAC address are closer to each other, it is determined that the first MAC address and the second MAC address are the MAC addresses in the same batch, and it is further presumed that the first MAC address, the second MAC address, and the terminal type identifiers corresponding to the consecutive MAC addresses between the first MAC address and the second MAC address are the same with a high probability, because the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address, the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identifier. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processing unit 302 is further configured to determine, when it is determined that the first terminal type identifier and the second terminal type identifier are the same and it is determined that a difference between the second MAC address and the first MAC address is greater than a first threshold, a MAC address closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same and the difference between the second MAC address and the first MAC address is greater than the first threshold, the first MAC address and the second MAC address are far apart, and are likely to be MAC addresses in two batches. Further, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is closer, and it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processing unit 302 is further configured to determine, when it is determined that the first terminal type identifier is different from the second terminal type identifier, a MAC address closest to a MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identifier is different from the second terminal type identifier, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is relatively short, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
Optionally, the processing unit 302 is further configured to determine, according to a message sent by the terminal to be identified, a confirmation type identifier of the terminal to be identified after the terminal to be identified establishes a connection with the AP; and checking the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the type identifier is determined to be different from the terminal type identifier corresponding to the MAC address of the terminal to be identified, the processing unit 302 modifies the terminal type identifier corresponding to the MAC address of the terminal to be identified into: confirming the type identification.
Optionally, when the terminal type identifier corresponding to the MAC address of the terminal to be identified is the same according to the confirmation type identifier, the processing unit 302 determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is correct, and does not need to correct the terminal type identifier.
Optionally, the processing unit 302 is further configured to determine an identification accuracy according to the confirmation type identifier of each to-be-identified terminal in the multiple to-be-identified terminals and the terminal type identifier corresponding to the MAC address of the to-be-identified terminal; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased.
Optionally, the processing unit 302 is further configured to determine, in the correspondence table, two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold. Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
From the above, it can be seen that: in the application, because the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, the MAC address of the terminal to be identified can be obtained, and further, because the first MAC address and the second MAC address which are most adjacent to the MAC address of the terminal to be identified are determined from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Based on the same concept, the present application provides an AP400 for performing the above method flow. Fig. 4 is a schematic structural diagram of an AP provided in the present application. The AP400 includes a processor 401, a memory 402, and a communication interface 403; the processor 401, the memory 402, and the communication interface 403 are connected to each other via a bus 404.
The bus 404 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
The memory 402 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviation: HDD), or a solid-state drive (english: SSD); the memory 410 may also comprise a combination of memories of the kind described above.
The communication interface 403 may be a wired communication access port, a wireless communication interface, or a combination thereof, wherein the wired communication interface may be an ethernet interface, for example. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a WLAN interface.
The processor 401 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor 401 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The aforementioned PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
A processor 401, configured to obtain an MAC address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
according to the corresponding relation table, when the MAC address of the terminal to be identified does not exist in the corresponding relation table, determining a first MAC address and a second MAC address from the corresponding relation table; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the minimum MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and determining the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address.
And a memory 402 for a correspondence table.
Optionally, the memory 402 may also be used to store program instructions, and the processor 401 may call the program instructions stored in the memory 402 to execute one or more steps in the embodiment shown in fig. 2, or an alternative implementation thereof, so that the AP400 implements the functions of the AP in the above-described method.
In this application, optionally, the processor 401 is further configured to, according to the correspondence table between the MAC address and the terminal type identifier, when determining that the MAC address of the terminal to be recognized exists in the correspondence table, directly determine the terminal type identifier corresponding to the MAC address of the terminal to be recognized from the correspondence table between the MAC address and the terminal type identifier, obtain the terminal type identifier of the terminal to be recognized, and push an advertisement, activity information, and the like to the terminal to be recognized according to the terminal type identifier.
The terminal can acquire the MAC address of the terminal to be identified when the terminal starts the WLAN function and does not establish connection with the AP through the WLAN, and further determines a first MAC address and a second MAC address which are closest to the MAC address of the terminal to be identified from the corresponding relation table of the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
Optionally, the processor 401 is configured to: and when the first terminal type identifier and the second terminal type identifier are determined to be the same and the difference value between the second MAC address and the first MAC address is determined not to be larger than a first threshold value, determining the terminal type identifier corresponding to the MAC address of the terminal to be identified as the first terminal type identifier.
Since the first terminal type identifier and the second terminal type identifier are the same, it is presumed that it is highly probable that the terminal type identifiers corresponding to the MAC addresses between the first MAC address and the second MAC address are the same with a high probability, and in order to determine whether the MAC addresses between the first MAC address and the second MAC address correspond to the same terminal type identifier, it is further determined whether a difference between the second MAC address and the first MAC address is not greater than a first threshold, and if the difference between the second MAC address and the first MAC address is not greater than the first threshold, it is determined that the first MAC address and the second MAC address are closer to each other, it is determined that the first MAC address and the second MAC address are the MAC addresses in the same batch, and it is further presumed that the first MAC address, the second MAC address, and the terminal type identifiers corresponding to the consecutive MAC addresses between the first MAC address and the second MAC address are the same with a high probability, because the MAC address of the terminal to be identified is located between the first MAC address and the second MAC address, the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the first terminal type identifier. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processor 401 is further configured to determine, when it is determined that the first terminal type identifier and the second terminal type identifier are the same and it is determined that a difference between the second MAC address and the first MAC address is greater than a first threshold, a MAC address closest to a MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Since the first terminal type identifier and the second terminal type identifier are the same and the difference between the second MAC address and the first MAC address is greater than the first threshold, the first MAC address and the second MAC address are far apart, and are likely to be MAC addresses in two batches. Further, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is closer, and it is determined that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the processor 401 is further configured to determine, when it is determined that the first terminal type identifier is different from the second terminal type identifier, a MAC address closest to a MAC address of the terminal to be identified in the first MAC address and the second MAC address; and when the absolute value of the difference value between the MAC address of the most adjacent terminal and the MAC address of the terminal to be identified is not larger than the second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the most adjacent MAC address.
Because the first terminal type identifier is different from the second terminal type identifier, if the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than the second threshold, it indicates that the distance between the nearest MAC address and the MAC address of the terminal to be identified is relatively short, and the terminal type identifier corresponding to the MAC address of the terminal to be identified is determined to be the terminal type identifier corresponding to the nearest MAC address. Therefore, the terminal category identification of the terminal to be identified is accurately determined through the scheme.
Optionally, the first threshold may be larger than the second threshold, which is beneficial to improving the terminal type identification rate. Optionally, in order to improve the terminal type identifier identification accuracy, the first threshold is not less than twice the second threshold.
Optionally, the processor 401 is further configured to determine, according to a packet sent by the terminal to be identified, a confirmation type identifier of the terminal to be identified after the terminal to be identified establishes a connection with the AP; and checking the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
Therefore, when the terminal to be recognized is connected with the AP, the confirmation type identifier of the terminal to be recognized can be determined according to the message reported by the terminal to be recognized, and the confirmation type identifier of the terminal to be recognized is the accurate terminal type identifier of the terminal to be recognized, so that the terminal type identifier corresponding to the MAC address of the terminal to be recognized can be corrected, and the accuracy of the method provided by the embodiment of the invention can be further determined.
Optionally, when the type identifier is determined to be different from the terminal type identifier corresponding to the MAC address of the terminal to be recognized, the processor 401 modifies the terminal type identifier corresponding to the MAC address of the terminal to be recognized into: confirming the type identification.
Optionally, when the terminal type identifier corresponding to the MAC address of the terminal to be identified is the same according to the confirmation type identifier, the processor 401 determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is correct, and does not need to correct the terminal type identifier.
Optionally, the processor 401 is further configured to determine an identification accuracy according to the confirmation type identifier of each to-be-identified terminal in the multiple to-be-identified terminals and the terminal type identifier corresponding to the MAC address of the to-be-identified terminal; the identification accuracy rate is the ratio of the number of the accurately identified terminals to the number of the plurality of terminals to be identified, and the accurately identified terminals are the terminals which are in the plurality of terminals to be identified and have the same confirmation type identification as the terminal type identification corresponding to the MAC address of the terminal to be identified; and adjusting the first threshold value and the second threshold value according to the identification accuracy and the accuracy threshold value.
Therefore, the first threshold and the second threshold are adjusted by the method, so that the identification accuracy of the terminal category identification can be increased.
Optionally, the processor 401 is further configured to determine, in the correspondence table, two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold.
Therefore, the number of the entries stored in the corresponding relation table can be increased, and the accuracy of terminal type identification is further increased.
As can be seen from the above, in the present application, since the terminal starts the WLAN function and does not establish a connection with the AP through the WLAN, the MAC address of the terminal to be identified can be obtained, and further, since the first MAC address and the second MAC address that are closest to the MAC address of the terminal to be identified are determined from the correspondence table between the MAC address and the terminal type identifier. Considering that the MAC addresses of the same terminal type in the same batch or a plurality of batches are usually continuous, the terminal type identification corresponding to the MAC address of the terminal to be identified can be determined through the first terminal type identification and the second terminal type identification which are nearest to the MAC address of the terminal to be identified, and therefore the problem that the terminal type identification cannot be identified under the condition that the terminal starts the WLAN function but does not establish connection with the AP through the WLAN is solved.
It should be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention 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 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 preferred embodiments of the present invention 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 such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present invention without departing from the scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A terminal identification method, comprising:
an Access Point (AP) acquires a Media Access Control (MAC) address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
the AP determines a first MAC address and a second MAC address from the corresponding relation table when determining that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table, and the second MAC address is the smallest MAC address in all MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; and is
The AP determines a terminal type identifier corresponding to the MAC address of the terminal to be identified according to a first terminal type identifier corresponding to the first MAC address and a second terminal type identifier corresponding to the second MAC address;
the determining, by the AP, the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the first terminal type identifier corresponding to the first MAC address and the second terminal type identifier corresponding to the second MAC address includes:
and when the AP determines that the first terminal type identifier is the same as the second terminal type identifier and that the difference value between the second MAC address and the first MAC address is not greater than a first threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
2. The method of claim 1, further comprising:
when the AP determines that the first terminal type identifier is the same as the second terminal type identifier and determines that the difference value between the second MAC address and the first MAC address is larger than a first threshold value; or, when it is determined that the first terminal type identifier is different from the second terminal type identifier, performing:
the AP determines the MAC address which is closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address;
and when determining that the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is not greater than a second threshold value, the AP determines that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address.
3. The method of claim 2, wherein the first threshold is not less than twice the second threshold.
4. The method according to claim 2, wherein after the AP determines the terminal type identifier corresponding to the MAC address of the terminal to be identified, the method further comprises:
after the terminal to be identified is connected with the AP, the AP determines a confirmation type identifier of the terminal to be identified according to a message sent by the terminal to be identified;
and the AP checks the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
5. The method of any of claims 1 to 4, further comprising:
in the correspondence table, if it is determined that the difference between the two MAC addresses corresponding to the third terminal type identifier is smaller than the first threshold, the AP determines the two MAC addresses and all the MAC addresses between the two MAC addresses correspond to the third terminal type identifier.
6. An access point, AP, comprising:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a Media Access Control (MAC) address of a terminal to be identified; the terminal to be identified starts a WLAN function and does not establish connection with the AP;
the processing unit is used for determining a first MAC address and a second MAC address from the corresponding relation table when determining that the MAC address of the terminal to be identified does not exist in the corresponding relation table according to the corresponding relation table of the MAC address and the terminal type identifier; the first MAC address is the largest MAC address in all MAC addresses which are smaller than the MAC address of the terminal to be identified in the corresponding relation table; the second MAC address is the smallest MAC address in all the MAC addresses which are larger than the MAC address of the terminal to be identified in the corresponding relation table; determining a terminal type identifier corresponding to the MAC address of the terminal to be identified according to a first terminal type identifier corresponding to the first MAC address and a second terminal type identifier corresponding to the second MAC address; and when the first terminal type identifier is determined to be the same as the second terminal type identifier and the difference value between the second MAC address and the first MAC address is determined not to be larger than a first threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the first terminal type identifier.
7. The AP of claim 6, the processing unit to further:
when the first terminal type identifier and the second terminal type identifier are determined to be the same and the difference value between the second MAC address and the first MAC address is determined to be larger than a first threshold value; or, when it is determined that the first terminal type identifier is different from the second terminal type identifier, performing:
determining a MAC address which is closest to the MAC address of the terminal to be identified in the first MAC address and the second MAC address;
and when the absolute value of the difference between the nearest MAC address and the MAC address of the terminal to be identified is determined to be not larger than a second threshold value, determining that the terminal type identifier corresponding to the MAC address of the terminal to be identified is the terminal type identifier corresponding to the nearest MAC address.
8. The AP of claim 7, wherein the first threshold is not less than twice the second threshold.
9. The AP of claim 7, the processing unit to further:
after the connection between the terminal to be identified and the AP is established, determining a confirmation type identifier of the terminal to be identified according to a message sent by the terminal to be identified;
and checking the terminal type identifier corresponding to the MAC address of the terminal to be identified according to the confirmation type identifier.
10. The AP of any one of claims 7 to 9, wherein the processing unit is further configured to:
in the correspondence table, if it is determined that the difference between two MAC addresses corresponding to a third terminal type identifier is smaller than the first threshold, it is determined that the two MAC addresses and all MAC addresses between the two MAC addresses correspond to the third terminal type identifier.
CN201610613646.6A 2016-07-28 2016-07-28 Terminal identification method and access point Active CN107666662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610613646.6A CN107666662B (en) 2016-07-28 2016-07-28 Terminal identification method and access point

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610613646.6A CN107666662B (en) 2016-07-28 2016-07-28 Terminal identification method and access point

Publications (2)

Publication Number Publication Date
CN107666662A CN107666662A (en) 2018-02-06
CN107666662B true CN107666662B (en) 2020-04-14

Family

ID=61115672

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610613646.6A Active CN107666662B (en) 2016-07-28 2016-07-28 Terminal identification method and access point

Country Status (1)

Country Link
CN (1) CN107666662B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110503451A (en) * 2018-05-18 2019-11-26 苏宁易购集团股份有限公司 Location-based entity shops information and merchandise promotion information method for pushing and system
CN110572187B (en) * 2019-09-12 2021-09-03 南方电网科学研究院有限责任公司 Networking method for broadband power line communication network
CN113132503B (en) * 2019-12-31 2022-05-24 华为技术有限公司 Address allocation method and device
CN113271644A (en) * 2020-02-14 2021-08-17 大唐移动通信设备有限公司 Terminal identification method, base station and terminal
CN113452802A (en) * 2020-03-24 2021-09-28 华为技术有限公司 Equipment model identification method, device and system
CN112202610B (en) * 2020-09-29 2023-10-24 苏州迈科网络安全技术股份有限公司 Terminal model identification system and identification method based on MAC address

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101835145A (en) * 2010-03-30 2010-09-15 北京傲天动联技术有限公司 User information management method based on thin AP
CN102421097A (en) * 2010-09-27 2012-04-18 中国移动通信集团公司 User authorization method, device and system
CN102624700A (en) * 2012-01-21 2012-08-01 伯泰雄森(北京)网络科技有限公司 Method and system for user identification based on specific information
CN102724188A (en) * 2012-06-08 2012-10-10 成都欣点科技有限公司 System and method for identifying identity of client in service field
CN102946590A (en) * 2012-10-31 2013-02-27 北京众思铭信息技术有限公司 Method and system for information issue by wifi (wireless fidelity) network
CN104702628A (en) * 2013-12-04 2015-06-10 广州优亿信息科技有限公司 WIFI-based precision ad pushing method
CN105792174A (en) * 2014-12-26 2016-07-20 华为技术有限公司 Wireless local area network roaming method, access point and wireless controller

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9413691B2 (en) * 2013-01-11 2016-08-09 Brocade Communications Systems, Inc. MAC address synchronization in a fabric switch

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101835145A (en) * 2010-03-30 2010-09-15 北京傲天动联技术有限公司 User information management method based on thin AP
CN102421097A (en) * 2010-09-27 2012-04-18 中国移动通信集团公司 User authorization method, device and system
CN102624700A (en) * 2012-01-21 2012-08-01 伯泰雄森(北京)网络科技有限公司 Method and system for user identification based on specific information
CN102724188A (en) * 2012-06-08 2012-10-10 成都欣点科技有限公司 System and method for identifying identity of client in service field
CN102946590A (en) * 2012-10-31 2013-02-27 北京众思铭信息技术有限公司 Method and system for information issue by wifi (wireless fidelity) network
CN104702628A (en) * 2013-12-04 2015-06-10 广州优亿信息科技有限公司 WIFI-based precision ad pushing method
CN105792174A (en) * 2014-12-26 2016-07-20 华为技术有限公司 Wireless local area network roaming method, access point and wireless controller

Also Published As

Publication number Publication date
CN107666662A (en) 2018-02-06

Similar Documents

Publication Publication Date Title
CN107666662B (en) Terminal identification method and access point
CN108881448B (en) API request processing method and device
CN108810116B (en) Message processing method and related product
CN106658652B (en) Method and device for connecting WiFi hotspot
CN107800678B (en) Method and device for detecting abnormal registration of terminal
CN113473576B (en) Roaming networking processing method and device, mobile terminal and readable storage medium
WO2023020187A1 (en) Data obtaining methods and apparatuses, electronic device and storage medium
CN108901035B (en) Identification method and device for terminal of Internet of things
WO2020258102A1 (en) Content pushing method and apparatus, mobile terminal and storage medium
WO2023020253A1 (en) Data acquisition method and apparatus, electronic device, and storage medium
CN112580730A (en) Terminal type identification method and device
CN111263377A (en) Network configuration method, device, equipment and system and distribution network testing method and system
WO2019015040A1 (en) Signal strength based frequency point selection method and internet of things terminal
CN108197958B (en) Method and device for counting off-line cattle and storage medium
CA3052015A1 (en) Network service exchange system and method of using same
CN109951549B (en) Network page access method and device and computer readable storage medium
CN108112031B (en) Network type determination method and device
WO2017054405A1 (en) Bluetooth paging method and device
CN108847999B (en) Equipment network connectivity detection method, device, terminal equipment and storage medium
CN108810821B (en) Attendance tracking method, device, terminal, server and storage medium
TW201806329A (en) System for detecting interference sources and method thereof
CN110943989A (en) Equipment identification method and device, electronic equipment and readable storage medium
CN110611678B (en) Method for identifying message and access network equipment
CN111866995B (en) WeChat applet-based intelligent device network distribution method and system
CN110769462B (en) Network access control method and device

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