[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

WO2021017987A1 - 一种设备识别的方法及相关装置 - Google Patents

一种设备识别的方法及相关装置 Download PDF

Info

Publication number
WO2021017987A1
WO2021017987A1 PCT/CN2020/103624 CN2020103624W WO2021017987A1 WO 2021017987 A1 WO2021017987 A1 WO 2021017987A1 CN 2020103624 W CN2020103624 W CN 2020103624W WO 2021017987 A1 WO2021017987 A1 WO 2021017987A1
Authority
WO
WIPO (PCT)
Prior art keywords
access device
mac address
wifi hotspot
information
address
Prior art date
Application number
PCT/CN2020/103624
Other languages
English (en)
French (fr)
Inventor
张波
黄平
朱凯
刘书生
王海燕
周宾
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to JP2022506253A priority Critical patent/JP7476297B2/ja
Priority to EP20846775.3A priority patent/EP3989641A4/en
Publication of WO2021017987A1 publication Critical patent/WO2021017987A1/zh
Priority to US17/585,188 priority patent/US20220150216A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/16Discovering, processing access restriction or access information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/695Types of network addresses using masks or ranges of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Definitions

  • This application relates to the field of Internet technology, and in particular to a method and related devices for device identification.
  • home users With the development of Internet technology, more and more families use the home network. Generally, home users realize the establishment of a home network by purchasing broadband Internet services provided by operators. In general, operators often only provide users with network access equipment (such as home gateways) for users to access the network. In some scenarios, in order to enable more devices to access the network, users usually choose to purchase access point (AP) devices (such as routers, etc.) by themselves to implement home networking.
  • AP access point
  • the person responsible for network maintenance needs to intuitively know whether the user has self-purchased AP equipment at home to judge Whether the network failure problem is introduced by the AP equipment purchased by the user.
  • judging whether there is a self-purchased AP device in the user's home is usually to identify the specific information (such as manufacturer, model, etc.) of the device connected to the network in the user's home, and then further determine whether the device is an AP device based on the information such as the device manufacturer and model. .
  • This kind of scheme often needs to establish an identification library first, and the identification library includes information such as manufacturers and models corresponding to various AP devices on the market.
  • the identification library includes information such as manufacturers and models corresponding to various AP devices on the market.
  • AP devices there are many manufacturers that can produce AP devices, and each manufacturer will launch a large number of new and different types of AP devices at different times, and the maintenance cost of the identification library is relatively high. Therefore, there is a need for a low-cost identification solution for identifying whether a device connected to the network is an AP device.
  • the embodiments of the present application provide a device identification method and related devices, which are used to reduce the cost of identifying whether a device connected to the network is an AP device.
  • the first aspect of the embodiments of the present application provides a device identification method, including:
  • the MAC address of the access device can be obtained by the network access device (such as a gateway device) and the WIFI located around the network access device The MAC address of the hotspot; then, the network access device compares the MAC address of the access device with the MAC address of the WIFI hotspot. If the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, it can The access device and the device that turns on the WIFI hotspot are considered to be the same device, that is, the access device can be considered to be an AP device that can provide wireless access services.
  • the network access device such as a gateway device
  • the server can obtain the MAC address of the access device through the network access device (such as the gateway device connected to the server), and the MAC address of the WIFI hotspot located around the network access device ; Then, the server compares and judges the MAC address of the access device and the MAC address of the WIFI hotspot. If the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address range, it can be considered that the access device and the WIFI are turned on The hotspot devices are the same device, that is, the access device can be considered as an AP device that can provide wireless access services.
  • the network access device such as the gateway device connected to the server
  • the server compares and judges the MAC address of the access device and the MAC address of the WIFI hotspot. If the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address range, it can be considered that the access device and the WIFI are turned on
  • the hotspot devices are the same device, that is,
  • the identification database is no longer required to be maintained, and therefore, the identification cost can be reduced.
  • the specific way to determine whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address range may be: Whether the absolute value of the difference between the MAC address and the MAC address of the WIFI hotspot is less than or equal to the preset threshold, if the absolute value of the difference is less than or equal to the preset threshold, it can be determined that the access device is an AP device.
  • a specific implementation method for judging whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment is proposed.
  • the absolute value of the difference between the two MAC addresses can be determined Whether it is less than or equal to a preset threshold is used to determine whether the two belong to the same address segment, which enhances the feasibility of the solution.
  • the specific way to determine whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment may be: Whether the first to the Nth digit of the MAC address is the same as the first to the Nth digit of the MAC address of the WIFI hotspot, if they are the same, it can be determined that the access device is an AP device.
  • a specific implementation method for judging whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment is proposed.
  • the first digit corresponding to the two MAC addresses can be judged to Whether the value of the Nth bit is the same to determine whether the two belong to the same address segment, which enhances the feasibility of the solution.
  • the server can send an address acquisition request to the network access device.
  • the address acquisition request is used to instruct the network access device to obtain the MAC address of the access device and the WIFI hotspot MAC address, where the address acquisition request can specifically be a request message used to request the MAC address of the access device and the MAC address of the WIFI hotspot; the address acquisition request can also be two request messages, each used to request acquisition The MAC address of the access device and the MAC address of the WIFI hotspot; then, after the network access device obtains the corresponding MAC address according to the address obtaining request sent by the server, the server can receive the access device's MAC address returned by the network access device MAC address and MAC address of WIFI hotspot.
  • the server sends an address acquisition request to the network access device to obtain the MAC address of the access device and the MAC address of the WIFI hotspot returned by the network access device, which enhances the implementation flexibility of the solution.
  • the first implementation manner of the first aspect, or the second implementation manner of the first aspect, in the fourth implementation manner of the first aspect of the embodiments of the present application is not limited to the first aspect, the first implementation manner of the first aspect, or the second implementation manner of the first aspect, in the fourth implementation manner of the first aspect of the embodiments of the present application.
  • the software built into the network access device can generate a device information acquisition command, and then the network access device can acquire it according to the device information Command to obtain DHCP information (that is, information corresponding to the access device connected to the network access device), where the DHCP information includes the name of the access device and the MAC address of the access device.
  • the MAC address of the access device can be obtained; in addition, the hotspot information acquisition command can be generated by the software built in the network access device, and then the network access device starts the WIFI chip according to the hotspot information acquisition command to collect the surrounding WIFI hotspots
  • the WIFI hotspot information includes information such as the WIFI hotspot name and the WIFI hotspot MAC address, so the MAC address of the WIFI hotspot can be obtained by obtaining the WIFI hotspot information.
  • the implementation manner for the network access device to obtain the MAC address of the access device and the MAC address of the WIFI hotspot is clarified, which enhances the implementation flexibility of the solution.
  • the network access device After the network access device determines that the access device is an AP device, the network access device can actively report the information of the access device determined to be an AP device to the server, so that the server side can obtain the information of the access device in time.
  • the information of the access device includes one or more of the name of the access device or the MAC address of the access device.
  • the network access device determines that the access device is an AP device
  • the network access device actively reports the information of the access device to the server, which is beneficial for the server to obtain the information of the access device in time.
  • the network access device After the network access device determines that the access device is an AP device, the network access device can temporarily save the information of the access device locally, and after the network access device receives the device identification request sent by the server, it sends the received device to the server.
  • the network access device only sends the information of the access device to the server after receiving the device identification request sent by the server, which avoids frequently sending information to the server and saves signaling consumption.
  • the network access device After the network access device determines that the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, the network access device can determine that the access device and the device that turns on the WIFI hotspot are the same device, and can connect The information of the incoming device is correlated with the information of the WIFI hotspot, so that when the server needs to obtain information about whether the access device and the device that turns on the WIFI hotspot are the same device, it can quickly provide corresponding information.
  • the network access device can determine that the access device and the device that turns on the WIFI hotspot are the same device, so that In some scenarios where it is necessary to determine whether the access device and the device that turns on the WIFI hotspot are the same device, the corresponding information is quickly provided, which improves the flexibility of the solution.
  • the second aspect of the embodiments of the present application provides an apparatus for device identification, including: an acquisition module for acquiring the MAC address of the media access control of the access device; the acquisition module is also used for acquiring the MAC address of a Wi-Fi hotspot ; Determining module for determining that the access device is an access point AP device if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, where the address segment includes multiple consecutive MAC addresses .
  • the access device can be judged by obtaining the MAC address of the access device and the MAC address of the WIFI hotspot in the user's home, and then comparing the MAC address of the access device and the MAC address of the WIFI hotspot in the same continuous address range. Whether the access device is an AP device. Since only the MAC address of the access device and the MAC of the WIFI hotspot need to be obtained during the identification process, the identification database is no longer required to be maintained, and therefore, the cost of identification can be reduced.
  • the determining module is further configured to: if the absolute value of the difference between the MAC address of the access device and the MAC address of the WIFI hotspot is less than or equal to If the threshold is preset, the access device is determined to be an AP device.
  • the determining module is further configured to determine if the value from the first digit to the Nth digit of the MAC address of the access device and the MAC address of the WIFI hotspot If the first digit to the Nth digit are the same, it is determined that the access device is an AP device, where N is an integer greater than 1.
  • the first implementation manner of the second aspect, or the second implementation manner of the second aspect, the third implementation manner of the second aspect of the embodiments of the present application further includes: a sending module; the sending module, Used to send an address acquisition request to the network access device, the address acquisition request is used to instruct the network access device to acquire the MAC address of the access device and the MAC address of the WIFI hotspot; the acquisition module is also used to acquire the network access device to send The MAC address of the access device; the acquisition module is also used to acquire the MAC address of the WIFI hotspot sent by the network access device.
  • the server sends an address acquisition request to the network access device to obtain the MAC address of the access device and the MAC address of the WIFI hotspot returned by the network access device, which enhances the implementation flexibility of the solution.
  • the first implementation manner of the second aspect, or the second implementation manner of the second aspect, the fourth implementation manner of the second aspect of the embodiments of the present application further includes: a generation module; the generation module, Used to generate device information acquisition commands; the acquisition module is also used to obtain DHCP information according to the device information acquisition commands, where the DHCP information includes the MAC address of the access device; the generation module is also used to generate hotspot information acquisition commands; The acquisition module is also used to acquire the WIFI hotspot information in the target area according to the hotspot information acquisition command, where the WIFI hotspot information includes the MAC address of the WIFI hotspot.
  • the implementation manner for the network access device to obtain the MAC address of the access device and the MAC address of the WIFI hotspot is clarified, which enhances the implementation flexibility of the solution.
  • the sending module is further configured to send the information of the access device determined as the AP device to the server, and access The information of the device includes one or more of the MAC address or the device name.
  • the network access device determines that the access device is an AP device
  • the network access device actively reports the information of the access device to the server, which is beneficial for the server to obtain the information of the access device in time.
  • the sixth implementation manner of the second aspect of the embodiments of the present application further includes: a receiving module; the receiving module is configured to receive a device identification request sent by the server; and the sending module, It is also used to send the information of the access device identified as the AP device to the server according to the device identification request.
  • the information of the access device includes one or more of the MAC address or the device name.
  • the network access device only sends the information of the access device to the server after receiving the device identification request sent by the server, which avoids frequently sending information to the server and saves signaling consumption.
  • the determining module is also used for if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address Segment, it is determined that the access device and the device that turns on the WIFI hotspot are the same device.
  • the network access device can determine that the access device and the device that turns on the WIFI hotspot are the same device, so that In some scenarios where it is necessary to determine whether the access device and the device that turns on the WIFI hotspot are the same device, the corresponding information is quickly provided, which improves the flexibility of the solution.
  • a third aspect of the embodiments of the present application provides a network device, including: at least one processor, at least one processor is configured to couple with a memory, read and execute instructions in the memory, to implement the method of the first aspect.
  • the fourth aspect of the embodiments of the present application provides a computer-readable storage medium, and the computer storage medium stores a computer program.
  • the computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the method of the first aspect.
  • the fifth aspect of the embodiments of the present application provides a computer program product, which when the computer program product runs on a computer, causes the computer to execute the method as in the first aspect.
  • the connection is determined. Whether the incoming device and the device that turns on the WIFI hotspot are the same device, and then identify whether the access device is an AP device. Since only the MAC address of the access device and the MAC of the WIFI hotspot need to be obtained during the identification process, the identification database is no longer required to be maintained, and therefore, the cost of identification can be reduced.
  • Figure 1 is an example diagram of a system architecture provided in an embodiment of the application
  • FIG. 2 is an example flowchart of a method for device identification according to an embodiment of the application
  • FIG. 3 is a diagram of another example flow of a method for device identification according to an embodiment of the application.
  • FIG. 4 is an example flowchart of a method for device identification according to an embodiment of the application.
  • Figure 5 is a schematic structural diagram of a network device provided by this embodiment.
  • FIG. 6 is a schematic structural diagram of a device identification device provided by this embodiment.
  • the embodiments of the present application provide a device identification method and related devices, which are used to reduce the cost of identifying whether an access device is an AP device.
  • network access equipment refers to equipment that can provide network access services; for example, network access equipment can be gateways, routers, switches, and digital subscriber lines (DSL) Or passive optical network (PON) and so on.
  • DSL digital subscriber lines
  • PON passive optical network
  • the access device refers to a device that can access the network by connecting to the network access device; for example, the access device can be a personal computer, a laptop, a mobile phone, or a smart speaker Or routers and other devices that have access to the network.
  • an AP device refers to a device that can provide wireless access services.
  • the AP device can access the network through a network access device and can provide wireless hotspots. To share the network, so that other devices can access the network shared by the AP device to achieve network access.
  • an AP device is essentially an access device, for example, an AP device can be a smart phone or a laptop. Terminal devices such as computers or routers that can provide wireless hotspots.
  • MAC address is also called Ethernet ID or physical address, and is an address used to confirm the location of network devices.
  • the MAC address has a total of 48 bits (that is, 6 bytes), usually expressed as 12 hexadecimal numbers, and each 2 hexadecimal numbers are separated by a colon. For example, 08:00:20:0A:8C:6D is a MAC address, and the first 6 hexadecimal numbers 08:00:20 represent the network hardware manufacturer’s serial number, which is the number issued by the Institute of Electrical and Electronics Engineers (Institute of Electrical and Electronics Engineers).
  • the next 6-digit hexadecimal number 0A: 8C: 6D represents the serial number of a certain network product (such as a network card) manufactured by the manufacturer.
  • a certain network product such as a network card
  • the MAC address is unique in the world.
  • WIFI Wireless fidelity
  • API refers to some pre-defined functions, or refers to the agreement between different components of the software system, and is a collection of definitions, procedures, and protocols.
  • the purpose of the API is to enable the Agent service to obtain network access device information through the API.
  • Agent service refers to a software service built into the network access device, which can be installed on the network access device through a communication protocol (for example, the TR069 protocol). Send commands to the network access device to obtain the required MAC address.
  • a communication protocol for example, the TR069 protocol.
  • DHCP Dynamic host configuration protocol
  • DHCP is a network protocol of a local area network. Its main function is to centrally manage and allocate IP addresses, so that devices in the network environment can dynamically obtain IP addresses and other information , DHCP information refers to the information corresponding to the access device that has been assigned an IP address.
  • MQTT Message queuing telemetry transport
  • MQTT is a message protocol based on a publish/subscribe paradigm. In this embodiment, MQTT is mainly used for communication between a server and a network access device.
  • the method proposed in the embodiment of the present application can be used in the scenario of identifying whether there is an AP device in the user's home.
  • FIG. 1 is an example diagram of a system architecture provided in an embodiment of the application.
  • the server communicates with the Agent service built in the network access device through the network, and the server and the Agent service can send and receive information to each other;
  • the network access device has multiple access devices connected to it through its own network interface, namely Multiple access devices can access the network by connecting to the network access device; among them, access device 1 is an AP device at the same time, which can provide wireless access services for other devices by turning on wireless hotspots.
  • AP The device can have one or more access devices attached to it. These access devices attached to the AP device can access the network through the AP device; in addition, the network access device can obtain the AP by searching for wireless hotspots Wireless hotspot information corresponding to the device.
  • the network access device referred to in the embodiment of the present application may specifically be a device capable of providing network access services, such as a gateway, router, switch, DSL, or PON, which is not specifically limited here. In this embodiment and subsequent embodiments, only the network access device is taken as an example for introduction.
  • the access device can be a personal computer, a laptop, a mobile phone, a smart speaker, or a router that has a network access function, which is not specifically limited here.
  • the access device is taken as an example for introduction.
  • the process of identifying devices can be performed on the network access device side or on the server side.
  • the following will be performed from the network access device and the server respectively.
  • the method for device identification provided in the embodiments of the present application will be introduced in detail from different perspectives.
  • FIG. 2 is an example flowchart of a device identification method provided by an embodiment of the present application.
  • An embodiment of the application provides a device identification method, including:
  • the network access device obtains the MAC address of the access device
  • the network access device may obtain the MAC address of the access device. It is understandable that in the network, since each device connected to the network needs to be assigned a unique IP address, in order to be able to assign a unique IP address to each device connected to the network, the access device usually uses DHCP The protocol is connected to the network access equipment.
  • DHCP when DHCP assigns an IP address to an access device, it usually needs to obtain information about the access device, such as the MAC address of the access device and the name of the access device, and then assign a unique IP address to the access device , And associate the relevant information of the access device with the IP address assigned to the access device to ensure that each access device can be assigned a unique IP address.
  • the relevant information of the access device and the IP address assigned to the access device are recorded in the network access device as DHCP information. Therefore, when the network access device needs to obtain the MAC address of the The DHCP information corresponding to the device can obtain the MAC address of the access device.
  • the network access device can acquire the MAC address of the access device by collecting the corresponding DHCP information in the list of attached devices.
  • the agent service is built into the network access device, and the agent service can obtain the MAC address of the access device by sending commands to the network access device.
  • the Agent service built in the network access device first generates a GET_SUB_DEVICE_LIST command (ie, device information acquisition command), and then the Agent service sends the GET_SUB_DEVICE_LIST command to the network access device, and the network access device collects its downloads according to the GET_SUB_DEVICE_LIST command.
  • the corresponding DHCP information in the device list includes the devices connected to the network access device through the local area network interface (LAN interface) and the WIFI hotspot connection enabled by the network access device.
  • the devices connected to the network access device in other words, the list of devices connected to the network access device includes devices that are connected in a wired manner and devices that are connected in a wireless manner.
  • the GET_SUB_DEVICE_LIST command can generally be a JSON format command, which is mainly used to request information about the connected device.
  • the GET_SUB_DEVICE_LIST command can be as follows:
  • the GET_SUB_DEVICE_LIST command instructs the network access device to obtain the DHCP information corresponding to the attached device by requesting the network access device to obtain parameter values.
  • the network access device can return response information to the Agent service.
  • the response information corresponds to the GET_SUB_DEVICE_LIST command, which can be specifically as follows:
  • the Agent service After the Agent service obtains the DHCP information returned by the network access device, the Agent service can obtain the MAC address corresponding to each access device in the attached device list in the DHCP information.
  • the Agent service can be provided with callable APIs and dynamic link library (DLL) files in advance.
  • the DLL file can provide code, data or functions to the Agent service, so that the Agent service can call functions that do not belong to its executable code.
  • the Agent service can call the pre-provided API according to the instructions in the DLL file. , So as to realize sending commands to the network access device and obtaining the corresponding MAC address.
  • the aforementioned API and DLL files can be provided to the Agent service by the server connected to the network access device, or can be provided to the Agent service by the operation and maintenance personnel through pre-installation in the network access device Yes, there is no specific limitation here.
  • the server can provide the API and DLL files to the Agent service. This ensures reliable acquisition of the list of connected devices.
  • the network access device obtains the MAC address of the WIFI hotspot
  • the WIFI hotspot refers to the WIFI hotspot located around the network access device (ie the target area).
  • the Agent service can first generate a GET_NEIGH_BOUR command (ie hotspot information acquisition command), and then send the GET_NEIGH_BOUR command to the network access device.
  • the network access device can start the WIFI chip according to the GET_NEIGH_BOUR command to collect the surrounding WIFI hotspot information; finally the network access device returns the collected WIFI hotspot information to the Agent service, where the WIFI hotspot information usually includes WIFI Information such as the MAC address of the hotspot and the name of the WIFI hotspot, the Agent service can obtain the MAC address of the WIFI hotspot in the surrounding area of the network access device based on the WIFI hotspot information.
  • the WIFI hotspot information usually includes WIFI Information such as the MAC address of the hotspot and the name of the WIFI hotspot
  • the Agent service can obtain the MAC address of the WIFI hotspot in the surrounding area of the network access device based on the WIFI hotspot information.
  • the effective transmission distance of the WIFI signals emitted by these AP devices is usually about tens of meters (10 to 30 meters), generally
  • the self-purchased AP equipment in the user's home network can effectively cover every corner of the user's home.
  • the network access equipment provided by the operator is usually arranged in the user's home. Therefore, in this embodiment, the WIFI hotspot information covered in the user's home can be effectively collected through the network access device arranged in the user's home.
  • the GET_NEIGH_BOUR command can generally be a JSON format command, which is mainly used to request the network access device to obtain WIFI hotspot information in its surrounding area.
  • the specific information structure of the GET_NEIGH_BOUR command is similar to the above-mentioned GET_SUB_DEVICE_LIST command. For details, please refer to the above description. I won't repeat them here.
  • Step 201 can be performed first, or step 202 can be performed first, or steps 201 and 202 can be performed at the same time. Specifically, it is not done here. limited.
  • the network access device determines that the access device is an AP device
  • the Agent service can compare the MAC address of the access device with the MAC address of the WIFI hotspot to determine the access device’s MAC address. Whether the MAC address and the MAC address of the WIFI hotspot belong to the same address range.
  • judging whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment refers to judging whether the MAC address of the access device and the MAC address of the WIFI hotspot are adjacent addresses, or judging the two Whether the addresses are all located in a continuous address segment, if the two addresses are adjacent addresses or both are located in a continuous address segment, it can be determined that the access device is an AP device.
  • the first 6 hexadecimal numbers in the MAC address represent the network hardware manufacturer's number, which is a fixed number assigned by IEEE; and the last 6 digits of the MAC address are hexadecimal numbers.
  • the system number represents the serial number of a certain network product manufactured by the manufacturer, and the serial number can be considered as the unique "identity mark" of the network product.
  • the last 6 hexadecimal numbers of the MAC address are customized by the manufacturer, and in general, the manufacturer has a certain number of the MAC address of the network product in order to facilitate the management of network products Regular.
  • the manufacturer will assign a continuous address segment to the AP device for different MAC addresses, such as WIFI hotspot MAC address, uplink MAC address, LAN port MAC address, etc. These MAC addresses are all continuous.
  • the router has 1 WAN port (wide area network interface, used to connect to network access equipment), 4 LAN ports (local area network interface, used to access other network equipment , Such as personal computers or laptops, etc.) and a WIFI hotspot frequency band (for example, a WIFI hotspot running in the 2.4GHz or 5GHz frequency band). Then, the router has at least 6 consecutive MAC addresses.
  • One WAN port of the router corresponds to an upstream connection MAC address.
  • the upstream connection MAC address can be obtained by the network access device by obtaining the DHCP information of the list of connected devices
  • the router’s 4 LAN ports correspond to the 4 LAN port MAC addresses
  • the router’s 1 WIFI hotspot frequency band corresponds to 1 hotspot MAC address.
  • These 6 MAC addresses are continuous.
  • the above 6 MAC addresses can be specifically as follows:
  • Uplink MAC address 08:00:20:0A:8C:00;
  • Hotspot MAC address 08:00:20:0A:8C:05.
  • the MAC address used by the AP device when accessing the network access device is an uplink connection MAC address, and the AP device is providing wireless
  • the MAC address used when accessing the service is another MAC address (that is, the hotspot MAC address), and the two MAC addresses belong to the same address segment. Therefore, in this embodiment, the MAC address of the access device acquired by the network access device can be compared with the MAC address of the WIFI hotspot.
  • the address is the address of the same device, that is, it is determined that the access device is an AP device with the function of turning on the WIFI hotspot to provide wireless access services.
  • the length of the MAC address segment of different AP devices is also different, so in this embodiment, to determine whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, the following two methods can be used:
  • the absolute value of the difference between the MAC address of the access device and the MAC address of the WIFI hotspot is less than or equal to the preset threshold, it is determined that the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment.
  • the MAC address Since the MAC address is usually expressed as 12 hexadecimal numbers, the MAC address can actually be regarded as a value composed of 12 hexadecimal numbers. Therefore, when obtaining the MAC address of the access device and the MAC address of the WIFI hotspot After the address, the two MAC addresses can be converted into specific values, and the absolute value of the difference between the two values can be calculated. If the absolute value of the difference is less than or equal to the preset threshold (for example, 256), you can The two MAC addresses are considered to belong to the same address range. Among them, the preset threshold is set according to the habit of most manufacturers to allocate address segments to AP devices.
  • the preset threshold for example, 256
  • the preset threshold can be set to 256. It is understandable that in practical applications, the preset threshold can be adjusted according to the actual situation. The larger the preset threshold, the more access devices will eventually be identified as AP devices, and the wrong identification of AP devices will be. Access devices will also increase, and the recognition error rate will increase, but it is not easy to miss AP devices (that is, some AP devices are not recognized); the smaller the preset threshold, the higher the recognition accuracy, and accordingly, it is easier Leak recognition. Therefore, in practical applications, the preset threshold can be adjusted accordingly according to specific identification requirements.
  • the MAC address of the access device is 07:16:76:00:02:FF
  • the MAC address of the WIFI hotspot is 07:16:76:00:03:00.
  • the first 8 of these two MAC addresses The hexadecimal numbers are all the same, that is, the absolute value of the difference between the two MAC addresses is determined by the last 4 hexadecimal numbers, where the value corresponding to 02:FF is 767(0*163+ 2*162+16*161+16*160), the value corresponding to 03:00 is specifically 768 (0*163+3*162+0*161+0*160), so the difference between the two MAC addresses The absolute value of the difference is 1.
  • the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment.
  • the corresponding absolute value of the difference can be calculated from the low-order value of the two MAC addresses. After the absolute value of the difference between the low-order values of, satisfies the condition that it is less than or equal to the preset threshold, then continue to calculate the absolute value of the difference between the high-order values of the two MAC addresses. For example, suppose the preset threshold is 10, the MAC address of the access device is 07:16:76:00:02:20, and the MAC address of the WIFI hotspot is 07:16:76:00:02:30.
  • the process of the absolute value of the difference between the MAC addresses you can first compare the absolute value of the difference between the last two digits of the two MAC addresses, where the last two digits of the MAC address of the access device are 20 (converted to The decimal system is 32). The last two digits of the MAC address of the WIFI hotspot are 30 (48 after conversion to decimal). Obviously, the difference between the MAC address of the access device and the last two digits of the MAC address of the WIFI hotspot The absolute value of the difference is 16 (48:32), which is greater than the preset threshold value of 10.
  • the MAC address of the access device and the MAC address of the WIFI hotspot do not belong to the same address range, and there is no need to continue Comparing the difference between the other digits of the two MAC addresses, there is no need to convert the entire MAC address to a specific value (such as a hexadecimal value or a decimal value) and then make a difference, reducing the amount of calculation .
  • a specific value such as a hexadecimal value or a decimal value
  • the first few digits of multiple MAC addresses assigned to AP devices are usually the same. of. For example, taking the 6 MAC addresses corresponding to the above router as an example, the 6 MAC addresses are:
  • N is an integer greater than 1, and specifically can be a value such as 9, 10, or 11. In practical applications, the value of N can be set according to specific needs. It is understandable that the greater the value of N, the higher the conditions that the access device needs to meet to be recognized as an AP device.
  • the MAC address of the access device only has the same value as the first 11 digits. Only when the first 11 digits of the MAC address of the WIFI hotspot have the same value, it will be recognized as an AP device.
  • the larger the value of N the higher the recognition accuracy, but the greater the probability of missed recognition; and
  • the smaller the value of N the lower the accuracy of recognition, but the lower the probability of missing recognition. Therefore, in practical applications, the value of N can be adjusted adaptively according to actual recognition needs, so as to achieve a better balance between recognition accuracy and miss-recognition probability.
  • the access device can also be determined It is the same device as the device that turns on the WIFI hotspot, that is, the information of the access device can be associated with the information of the WIFI hotspot, and the access device is regarded as the device that turns on the WIFI hotspot.
  • the device information that turns on the Wi-Fi hotspot can be quickly provided, which provides a feasible solution for how to determine the device that turns on the Wi-Fi hotspot , To enhance the flexibility of the program.
  • the network access device receives the device identification request sent by the server.
  • the operation and maintenance personnel responsible for home network management need to obtain whether there is a self-purchased AP device in the user's home
  • the operation and maintenance personnel can send a device identification request instruction on the home network management system of the server to
  • the server sends a device identification request to the network access device in the user's home.
  • the home network management system is a software system deployed on the server, which can communicate with the network access device in the user's home, and is mainly used to implement Management of the user's home network. Among them, the home network management system can send a device identification request to the network access device through the MQTT channel.
  • the home network management system may periodically send device identification requests to the network access device through the server (for example, the operation and maintenance personnel pre-set the home network management system to periodically trigger the sending of the device identification request instruction), or it may be in operation and maintenance.
  • the server for example, the operation and maintenance personnel pre-set the home network management system to periodically trigger the sending of the device identification request instruction
  • the server may be in operation and maintenance.
  • the network access device sends the information of the access device identified as the AP device to the server.
  • the network access device obtains the MAC address of the access device, obtains the MAC address of the WIFI hotspot, and determines whether the access device is an AP device according to the MAC address of the access device and the MAC address of the WIFI hotspot. It is executed after the network access device is started, or the network access device performs the above steps at a certain interval during the working process, and the network access device determines that a specific one or several access devices are AP devices After that, the network access device can save the information corresponding to the access devices identified as AP devices in a local storage space.
  • the network access device After the network access device obtains the device identification request sent by the server, it can send the information corresponding to the access device identified as the AP device and stored in the local storage space in advance to the server.
  • the information of the access device identified as the AP device may specifically include one or more of the MAC address of the access device or the device name of the access device. It is understandable that the information of the access device can be obtained when the DHCP information is obtained.
  • the DHCP information usually includes information such as the name of the access device, the MAC address of the access device, etc.
  • the DHCP corresponding to the access device can be saved in the local storage space as the information to be reported by the access device until the network access device obtains the device identification issued by the server Upon request, the information to be reported corresponding to the access device is sent to the server.
  • the network access device can quickly feed back the corresponding information to the server when it obtains the device identification request. , To ensure the speed of AP device information acquisition, which is conducive to the rapid troubleshooting of operation and maintenance personnel.
  • the network access device in addition to the network access device sending the corresponding access device information to the server after receiving the device identification request sent by the server, the network access device may also actively send the network access device to the server at regular intervals. Send the information of the access device identified as the AP device, that is, the network access device regularly actively feeds back the information of the access device identified as the AP device to the server. For example, the network access device periodically recognizes whether there is an AP device among the currently accessed access devices, and after obtaining the recognition result, actively sends the information of the access device recognized as the AP device to the server.
  • the network access device can feed back the current recognition result to the server after each AP device recognition, regardless of whether the recognition result recognizes the existence of AP devices or does not recognize the existence of AP devices; in addition, because After the server receives the information corresponding to the access devices identified as AP devices from the network access device, it usually saves the information of these access devices in the database. Therefore, the network access device can also be recognized After there is a new AP device, the information corresponding to the newly recognized AP device is fed back to the server, without the need to feed back the corresponding recognition result to the server every time after the AP device is recognized.
  • the server can send The information of these access devices is stored in the database so that the information can be displayed in time when needed. For example, when the operation and maintenance personnel need to know whether there is an AP device in the home network of a certain home user, they can pass the home The network management system obtains this information by querying the database.
  • the connection is determined. Whether the incoming device and the device that turns on the WIFI hotspot are the same device, and then identify whether the access device is an AP device. Since only the MAC address of the access device and the MAC of the WIFI hotspot need to be obtained during the identification process, the identification database is no longer required to be maintained, and therefore, the cost of identification can be reduced.
  • the home network management system deployed on the server provides callable API and DLL files to the Agent service built in the network access device; after the network access device is started, the API provided by the home network management system can be obtained And DLL files, the network access device can start its built-in Agent service, and the Agent service loads API and DLL files; when the access device accesses the network access device through the DHCP protocol, the network access device can record the access
  • the DHCP information corresponding to the device specifically includes the MAC address of the access device and the device name of the access device;
  • the Agent service loads the API and DLL file, the Agent service calls the pre-provided API according to the instructions in the DLL file ,
  • the network access device collects the DHCP information corresponding to the access device connected to the network access device according to the GET_SUB_DEVICE_LIST command, and then returns the collected information to the Agent service after collecting the DHCP information
  • the DHCP information specifically includes the MAC address of the access device and the device name of the access device;
  • the Agent service also calls the pre-provided API according to the instructions in the DLL file to send the GET_NEIGH_BOUR command to the network access device;
  • the access device starts the WIFI chip to collect the surrounding WIFI hotspot information, and returns the corresponding WIFI hotspot information to the Agent service after the collection is completed, including information such as the MAC address of the WIFI hotspot and the name of the WIFI hotspot; finally ,
  • the Agent service determines whether the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment. If so, it is determined that the access device is an AP device, and the access device information is sent to the server.
  • FIG. 3 is a diagram of another example flow of a device identification method provided by an embodiment of the application.
  • An embodiment of the application provides a device identification method, including:
  • the network access device receives a device identification request sent by a server
  • the operation and maintenance personnel on the server side need to determine whether there is an AP device in the access device connected to the network access device
  • the operation and maintenance personnel can send the device identification through the home network management system of the server
  • the request instruction allows the server to send a device identification request to the network access device in the user's home.
  • the server can provide API and DLL files to the Agent service before or after sending the device identification request to the network access device.
  • the functions of the API and DLL files can be referred to The above steps 201 and 202 are not repeated here.
  • the device identification request in the embodiment of the present application may specifically be one request information or two request information.
  • the request information is used to simultaneously request access to the device.
  • these two requests The information can be sent at the same time or in any order, and there is no restriction on the sending order of the two request messages.
  • the network access device obtains the MAC address of the access device according to the device identification request.
  • the Agent service built in the network access device receives the device identification request sent by the server, and then obtains the MAC address of the access device according to the device identification request, that is, in this embodiment , Agent service is to obtain the MAC address of the access device after receiving the device identification request.
  • the step for the Agent service to obtain the MAC address of the access device is similar to the above step 201.
  • the above step 201 please refer to the above step 201, which will not be repeated here.
  • the network access device obtains the MAC address of the WIFI hotspot according to the device identification request;
  • the Agent service built in the network access device receives the device identification request sent by the server, and then obtains the MAC address of the WIFI hotspot according to the device identification request. Similarly, in this embodiment, the Agent The service also obtains the MAC address of the WIFI hotspot after receiving the device identification request.
  • the step for the Agent service to obtain the MAC address of the WIFI hotspot is similar to the above step 202. For details, please refer to the above step 202, which will not be repeated here.
  • Step 302 can be performed first, or step 303 can be performed first, or steps 302 and 303 can be performed at the same time. Specifically, it is not done here. limited.
  • the network access device determines that the access device is an AP device
  • step 304 is similar to step 203 described above.
  • step 203 described above which will not be repeated here.
  • the network access device sends the information of the access device identified as the AP device to the server.
  • step 305 is similar to step 205 described above.
  • step 205 described above which will not be repeated here.
  • the main difference between step 301 to step 305 and the above step 201 to step 205 is that: in step 301 to step 305, the network access device receives the device identification request sent by the server and then The device identification request obtains the MAC address of the access device and the MAC address of the WIFI hotspot, and determines whether the access device is an AP device based on these two MAC addresses, and finally sends the information of the access device determined to be the AP device to the server; In steps 201 to 205, the network access device actively obtains the MAC address of the access device and the MAC address of the WIFI hotspot, and determines whether the access device is an AP device based on these two MAC addresses, and then the network access device Actively send the information of the access device determined to be an AP device to the server, or first store the information of the access device determined to be an AP device locally and access it after obtaining the device identification request sent by the server The device information is sent to the server.
  • step 301 to step 305 the network access device performs AP device identification after receiving the device identification request sent by the server; and in step 201 to step 205, the network access device is active Perform AP device identification, and then actively feed back the identification result to the server, or send the pre-obtained identification result after receiving the device identification request sent by the server.
  • the network access device performs device identification after receiving the device identification request sent by the server, which can ensure that the identification result is based on the access device currently connected to the network access device and the current network connection.
  • Access to the WIFI hotspots around the device ensures the timeliness of the recognition results, and at the same time prevents the network access device from frequently sending the recognition results to the server, saving signaling consumption.
  • FIG. 4 is an example flowchart of a device identification method provided by an embodiment of this application.
  • An embodiment of the application provides a device identification method, including:
  • the server sends an address acquisition request to the network access device.
  • the address acquisition request is mainly used to instruct the network access device to acquire the MAC address of the access device and the MAC address of the WIFI hotspot.
  • the address acquisition request may specifically be a request message for simultaneously requesting the MAC address of the access device.
  • the address and the MAC address of the WIFI hotspot; the address acquisition request may also be two request information, which are respectively used to request the MAC address of the access device and the MAC address of the WIFI hotspot, which are not specifically limited here.
  • the network access device obtains the MAC address of the access device according to the address obtaining request.
  • the process for the network access device to obtain the MAC address of the access device is similar to the above step 201.
  • the above step 201 please refer to the above step 201, which will not be repeated here.
  • the network access device obtains the MAC address of the WIFI hotspot according to the address obtaining request;
  • the process for the network access device to obtain the MAC address of the WIFI hotspot is similar to the above step 202.
  • the above step 202 please refer to the above step 202, which will not be repeated here.
  • step 402 can be performed first, or step 403 can be performed first, or steps 402 and 403 can be performed simultaneously. Specifically, it is not done here. limited.
  • the server receives the MAC address of the access device and the MAC address of the WIFI hotspot sent by the network access device;
  • the network access device can send the MAC address of the access device and the MAC address of the WIFI hotspot to the server.
  • the two MAC addresses may be sent by the network access device at the same time, or they may have any sequence of sending. The sending sequence of the two MAC addresses is not limited here.
  • the server determines that the access device is an AP device.
  • the process of identifying whether the access device is an AP device is mainly performed by the server, that is, the network access device is mainly responsible for obtaining the MAC address of the access device and the MAC address of the WIFI hotspot, and according to the access
  • the MAC address of the device and the MAC address of the WIFI hotspot determine whether the access device is an AP device or not, then the server executes.
  • the process for the server to determine whether the access device is an AP device is similar to step 203, and will not be repeated here.
  • the network access device mainly obtains the MAC address of the access device and the MAC address of the WIFI hotspot according to the address obtaining request sent by the server, and judges access according to the MAC address of the access device and the MAC address of the WIFI hotspot. Whether the device is an AP device is executed by the server. By transferring the judgment process to a server with higher processing efficiency, the load of the network access device is reduced, and the efficiency of the judgment process is improved.
  • the device identification method proposed in the embodiment of the application is described above.
  • the network device 50 involved in the device identification method will be introduced below.
  • FIG. 5 it is a network device provided by this embodiment.
  • the network device 50 may have relatively large differences due to different configurations or performances. It may include one or more processors 501 and a memory 502, and one or more storage media 503 for storing application programs or data (such as one or A storage device in Shanghai). Among them, the memory 502 and the storage medium 503 may be short-term storage or persistent storage.
  • the network device also includes one or more input/output devices 505, and the input/output devices 505 are used to obtain performance indicators or output and display analysis results.
  • the processor 501 may be configured to communicate with a storage medium 503, and the processor 501 is configured to execute an application program in the storage medium 503. Specifically, the processor is configured to perform the following steps: obtain the MAC address of the access device; obtain The MAC address of the WIFI hotspot; if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, the access device is determined to be an access point AP device, where the address segment includes multiple consecutive MAC addresses .
  • the processor is specifically configured to determine that the access device is an AP device if the absolute value of the difference between the MAC address of the access device and the MAC address of the WIFI hotspot is less than or equal to a preset threshold. .
  • the processor is also configured to: if the first digit to the Nth digit of the MAC address of the access device are the same as the first to the Nth digit of the MAC address of the WIFI hotspot ,
  • the access device is determined to be an AP device, where N is an integer greater than 1.
  • the processor is further configured to send an address acquisition request to the network access device.
  • the address acquisition request is used to instruct the network access device to acquire the MAC address of the access device and the MAC address of the WIFI hotspot.
  • the processor is further configured to generate a device information acquisition command; obtain DHCP information according to the device information acquisition command, where the DHCP information includes the MAC address of the access device; and, generate a hotspot information acquisition command ; Acquire WIFI hotspot information in the target area according to the hotspot information acquisition command, where the WIFI hotspot information includes the MAC address of the WIFI hotspot.
  • the processor is further configured to send information of an access device determined to be an AP device to the server, where the information of the access device includes one or more of a MAC address or a device name.
  • the processor is further configured to receive a device identification request sent by the server; according to the device identification request, send to the server information about the access device identified as an AP device, and the information about the access device includes MAC One or more of address or device name.
  • the processor is further configured to determine that the access device and the device that turns on the WIFI hotspot are the same device if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment.
  • FIG. 6 is a schematic structural diagram of a device identification device provided by this embodiment.
  • An apparatus for device identification includes: an obtaining module 601, which is used to obtain the media access control MAC address of an access device; and the obtaining module 601 is also used to obtain the MAC address of a Wi-Fi hotspot;
  • the determining module 602 is configured to determine that the access device is an access point AP device if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment, wherein the address segment includes multiple consecutive MAC addresses .
  • the determining module 602 is further configured to determine that the access device is an AP if the absolute value of the difference between the MAC address of the access device and the MAC address of the WIFI hotspot is less than or equal to a preset threshold. equipment.
  • the determining module 602 is also used to determine if the first to the Nth value of the MAC address of the access device and the first to the Nth value of the MAC address of the WIFI hotspot are both If they are the same, it is determined that the access device is an AP device, where N is an integer greater than 1.
  • the apparatus 60 for device identification further includes: a sending module 603; the sending module 603 is configured to send an address acquisition request to the network access device, and the address acquisition request is used to instruct the network access device to acquire The MAC address of the access device and the MAC address of the WIFI hotspot; the acquisition module 601 is also used to acquire the MAC address of the access device sent by the network access device; the acquisition module 601 is also used to acquire the MAC address sent by the network access device The MAC address of the WIFI hotspot.
  • the apparatus 60 for device identification further includes: a generation module 604; the generation module 604 is used to generate a device information acquisition command; the acquisition module 601 is also used to obtain a DHCP command according to the device information acquisition command Information, where the DHCP information includes the MAC address of the access device; the generation module 604 is also used to generate hotspot information acquisition commands; the acquisition module 601 is also used to acquire the hotspot information acquisition commands to acquire WIFI hotspot information in the target area , Where the WIFI hotspot information includes the MAC address of the WIFI hotspot.
  • the sending module 603 is further configured to send information of an access device determined to be an AP device to the server, and the information of the access device includes one or more of MAC address or device name .
  • the device identification device 60 further includes: a receiving module 605; the receiving module 605 is used to receive a device identification request sent by the server; the sending module 603 is also used to send a request to the device according to the device identification request
  • the server sends the information of the access device identified as the AP device, and the information of the access device includes one or more of the MAC address or the device name.
  • the determining module 602 is also used to determine that the access device and the device enabling the WIFI hotspot are the same device if the MAC address of the access device and the MAC address of the WIFI hotspot belong to the same address segment .
  • the connection is determined. Whether the incoming device and the device that turns on the WIFI hotspot are the same device, and then identify whether the access device is an AP device. Since only the MAC address of the access device and the MAC of the WIFI hotspot need to be obtained during the identification process, the identification database is no longer required to be maintained, and therefore, the cost of identification can be reduced.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation, for example, multiple units or components can be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • each unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of this application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code .

Landscapes

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

Abstract

本申请实施例公开了一种设备识别的方法及相关装置,用于降低识别接入网络中的设备是否为AP设备的成本。本申请实施例方法包括:当需要对接入到网络中的设备的类型进行识别时,获取接入设备的MAC地址,以及位于网络接入设备周边的WIFI热点的MAC地址;然后,对接入设备的MAC地址和WIFI热点的MAC地址进行对比,如果接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备为AP设备。

Description

一种设备识别的方法及相关装置
本申请要求于2019年7月31日提交中国专利局、申请号为CN 201910714829.0、发明名称为“一种设备识别的方法及相关装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及互联网技术领域,尤其涉及一种设备识别的方法及相关装置。
背景技术
随着互联网技术的发展,越来越多的家庭使用上了家庭网络。通常,家庭用户是通过购买运营商提供的宽带上网业务来实现家庭网络的组建。一般情况下,运营商往往只给用户提供网络接入设备(例如家庭网关等),以供用户接入到网络中。在一些场景中,为了能够使更多的设备接入到网络中,用户通常会选择自行购买接入点(access point,AP)设备(例如路由器等)来实现家庭组网。
在用户自购AP设备进行家庭组网的场景下,当用户由于家庭网络出现问题而向运营商报障时,负责维护网络的人员需要直观地知道用户家里是否有自购的AP设备,以判断网络故障问题是否是由用户自购的AP设备引入的。
目前,判断用户家里是否有自购的AP设备通常是识别用户家中接入网络的设备具体的信息(例如厂商、型号等),然后基于设备的厂商、型号等信息进一步判断该设备是否是AP设备。这种方案往往需要先建立识别库,识别库中包括有市面上各种AP设备对应的厂商以及型号等信息。然而,对于AP设备而言,能够生产AP设备的厂商众多,且每个厂商在不同的时期还会推出大量新的不同型号的AP设备,识别库的维护成本较高。因此,需要一种低成本的识别方案,用于识别接入网络中的设备是否为AP设备。
发明内容
本申请实施例提供了一种设备识别的方法及相关装置,用于降低识别接入网络中的设备是否为AP设备的成本。
本申请实施例第一方面提供了一种设备识别的方法,包括:
当需要对接入到网络中的设备(即接入设备)的类型进行识别时,可以由网络接入设备(例如网关设备)获取接入设备的MAC地址,以及位于网络接入设备周边的WIFI热点的MAC地址;然后,由网络接入设备对接入设备的MAC地址和WIFI热点的MAC地址进行对比判断,如果接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则可以认为接入设备和开启WIFI热点的设备是同一个设备,也就是说,可以认为该接入设备是一个能够提供无线接入服务的AP设备。
或,
当需要对接入设备的类型进行识别时,可以由服务器通过网络接入设备(例如与服务器连接的网关设备)获取接入设备的MAC地址,以及位于网络接入设备周边的WIFI热点的MAC地址;然后,由服务器对接入设备的MAC地址和WIFI热点的MAC地址进行对比判断,如果接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则可以认为接入设备和开启WIFI热点的设备是同一个设备,也就是说,可以认为该接入设备是一个能够提供无线接入服务的AP设备。
本申请实施例中,通过获取接入设备的MAC地址以及用户家庭中WIFI热点的MAC地址,然后通过比较接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个连续的地址段,即可判断该接入设备是否为AP设备。由于识别过程中只需要获取接入设备的MAC地址以及WIFI热点的MAC地址,不再需要维护识别库,因此,可以降低识别的成本。
根据第一方面,本申请实施例第一方面的第一种实施方式中,判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段的具体方式可以是:判断接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值是否小于或等于预设阈值,如果该差值绝对值小于或等于预设阈值,则可以确定接入设备为AP设备。
本实施方式中,提出了判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段的具体实现方式,在实际应用中,可以通过判断两个MAC地址之间的差值绝对值是否小于或等于预设阈值的方式来判断两者是否属于同一个地址段,增强了方案的可行性性。
根据第一方面,本申请实施例第一方面的第二种实施方式中,判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段的具体方式可以是:判断接入设备的MAC地址的第一位数值至第N位数值与WIFI热点的MAC地址的第一位数值至第N位数值是否相同,如果相同,则可以确定接入设备为AP设备。
本实施方式中,提出了判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段的具体实现方式,在实际应用中,可以通过判断两个MAC地址对应的第一位数值至第N位数值是否相同的方式来判断两者是否属于同一个地址段,增强了方案的可行性。
根据第一方面、第一方面的第一种实施方式或第一方面的第二种实施方式,本申请实施例第一方面的第三种实施方式中,
若需要对接入设备的类型进行识别的设备为服务器时,服务器可以向网络接入设备发送地址获取请求,该地址获取请求用于指示网络接入设备获取接入设备的MAC地址以及WIFI热点的MAC地址,其中,该地址获取请求具体可以是一个请求信息,用于请求获取接入设备的MAC地址以及WIFI热点的MAC地址;该地址获取请求也可以是两个请求信息,分别用于请求获取接入设备的MAC地址以及WIFI热点的MAC地址;然后,在网络接入设备根据服务器发送的地址获取请求获取到相应的MAC地址之后,服务器可以接收到网络接入设备所返回的接入设备的MAC地址以及WIFI热点的MAC地址。
本实施方式中,明确了是由服务器向网络接入设备发送地址获取请求,来获取到网络接入设备返回的接入设备的MAC地址以及WIFI热点的MAC地址,增强了方案的实现灵活性。
根据第一方面、第一方面的第一种实施方式或第一方面的第二种实施方式,本申请实施例第一方面的第四种实施方式中,
若需要对接入设备的类型进行识别的设备为网络接入设备时,可以由内置于网络接入设备的软件(例如Agent服务)生成设备信息获取命令,然后网络接入设备根据该设备信息获取命令,获取DHCP信息(即接入到网络接入设备中的接入设备对应的信息),其中DHCP信息中包括有接入设备的名称以及接入设备的MAC地址等信息,通过获取DHCP信息,即可获取到接入设备的MAC地址;另外,还可以由内置于网络接入设备的软件生成热点信息获取命令,然后网络接入设备根据该热点信息获取命令启动WIFI芯片来采集周边的WIFI热点信息,其中WIFI热点信息中包括有WIFI热点名称以及WIFI热点MAC地址等信息,因此通过获取WIFI热点信息可以获取到WIFI热点的MAC地址。
本实施方式中,明确了网络接入设备获取接入设备的MAC以及WIFI热点的MAC地址的实现方式,增强了方案的实现灵活性。
根据第一方面的第四种实施方式,本申请实施例第一方面的第五种实施方式中,
在网络接入设备确定了接入设备为AP设备之后,网络接入设备可以主动向服务器上报被确定为AP设备的接入设备的信息,以使得服务器侧能够及时获取到接入设备的信息,其中,接入设备的信息包括接入设备的名称或接入设备的MAC地址中的一种或多种。
本实施方式中,明确了网络接入设备在确定了接入设备为AP设备之后,由网络接入设备主动向服务器上报接入设备的信息,有利于服务器能够及时获取到接入设备的信息。
根据第一方面的第四种实施方式,本申请实施例第一方面的第六种实施方式中,
在网络接入设备确定了接入设备为AP设备之后,网络接入设备可以将接入设备的信息暂时保存在本地,在网络接入设备接收到服务器发送的设备识别请求之后,向服务器发送被识别为AP设备的接入设备的信息,其中,接入设备的信息包括接入设备的名称或接入设备的MAC地址中的一种或多种。
本实施方式中,明确了网络接入设备在接收到服务器发送的设备识别请求之后,才将接入设备的信息发送给服务器,避免了频繁向服务器发送信息,节省了信令消耗。
根据第一方面的第四种实施方式,本申请实施例第一方面的第七种实施方式中,
在网络接入设备判断得到接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段之后,网络接入设备可以确定接入设备和开启WIFI热点的设备为同一个设备,并且可以将接入设备的信息和WIFI热点的信息关联起来,以使得后续在服务器需要获取接入设备和开启WIFI热点的设备是否为同一个设备的信息时,可以快速提供相应的信息。
本实施方式中,提出了在确定接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段之后,网络接入设备可以确定接入设备和开启WIFI热点的设备为同一个设备,从而使得在一些需要判断接入设备和开启WIFI热点的设备是否为同一个设备的场景下,快速提供相应的信息,提高了方案的灵活性。
本申请实施例第二方面提供了一种设备识别的装置,包括:获取模块,用于获取接入设备的媒体访问控制MAC地址;该获取模块,还用于获取无线保真WIFI热点的MAC地址;确定模块,用于若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备为接入点AP设备,其中,地址段内包括有多个连续的MAC地址。
本申请实施例中,通过获取接入设备的MAC地址以及用户家庭中WIFI热点的MAC地址,然后通过比较接入设备的MAC地址和WIFI热点的MAC是否属于同一个连续的地址段,即可判断该接入设备是否为AP设备。由于识别过程中只需要获取接入设备的MAC地址以及WIFI热点的MAC,不再需要维护识别库,因此,可以降低识别的成本。
根据第二方面,本申请实施例第二方面的第一种实施方式中,该确定模块,还用于若接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值小于或等于预设阈值,则确定接入设备为AP设备。
本实施方式中,提出了判断接入设备的MAC地址和WIFI热点的MAC是否属于同一个地址段的具体实现方式,在实际应用中,可以通过判断两个MAC地址之间的差值绝对值是否小于或等于预设阈值的方式来判断两者是否属于同一个地址段,增强了方案的可行性性。
根据第二方面,本申请实施例第二方面的第二种实施方式中,该确定模块,还用于若接入设备的MAC地址的第一位数值至第N位数值与WIFI热点的MAC地址的第一位数值至第N位数值均相同,则确定接入设备为AP设备,其中,N为大于1的整数。
本实施方式中,提出了判断接入设备的MAC地址和WIFI热点的MAC是否属于同一个地址段的具体实现方式,在实际应用中,可以通过判断两个MAC地址对应的第一位数值至第N位数值是否相同的方式来判断两者是否属于同一个地址段,增强了方案的可行性。
根据第二方面、第二方面的第一种实施方式或第二方面的第二种实施方式,本申请实施例第二方面的第三种实施方式中,还包括:发送模块;该发送模块,用于向网络接入设备发送地址获取请求,该地址获取请求用于指示网络接入设备获取接入设备的MAC地址以及WIFI热点的MAC地址;该获取模块,还用于获取网络接入设备发送的接入设备的MAC地址;该获取模块,还用于获取网络接入设备发送的WIFI热点的MAC地址。
本实施方式中,明确了是由服务器向网络接入设备发送地址获取请求,来获取到网络接入设备返回的接入设备的MAC地址以及WIFI热点的MAC地址,增强了方案的实现灵活性。
根据第二方面、第二方面的第一种实施方式或第二方面的第二种实施方式,本申请实施例第二方面的第四种实施方式中,还包括:生成模块;该生成模块,用于生成设备信息获取命令;该获取模块,还用于根据设备信息获取命令,获取DHCP信息,其中,DHCP信息包括接入设备的MAC地址;该生成模块,还用于生成热点信息获取命令;该获取模块,还用于根据热点信息获取命令,获取目标区域内的WIFI热点信息,其中,WIFI热点信息包括WIFI热点的MAC地址。
本实施方式中,明确了网络接入设备获取接入设备的MAC以及WIFI热点的MAC地址的实现方式,增强了方案的实现灵活性。
根据第二方面的第四种实施方式,本申请实施例第二方面的第五种实施方式中,该发送模块,还用于向服务器发送被确定为AP设备的接入设备的信息,接入设备的信息包括MAC地址或设备名称中的一种或多种。
本实施方式中,明确了网络接入设备在确定了接入设备为AP设备之后,由网络接入设备主动向服务器上报接入设备的信息,有利于服务器能够及时获取到接入设备的信息。
根据第二方面的第四种实施方式,本申请实施例第二方面的第六种实施方式中,还包括:接收模块;该接收模块,用于接收服务器发送的设备识别请求;该发送模块,还用于根据设备识别请求,向服务器发送被识别为AP设备的接入设备的信息,接入设备的信息包括MAC地址或设备名称中的一种或多种。
本实施方式中,明确了网络接入设备在接收到服务器发送的设备识别请求之后,才将接入设备的信息发送给服务器,避免了频繁向服务器发送信息,节省了信令消耗。
根据第二方面的第四种实施方式,本申请实施例第二方面的第七种实施方式中,该确定模块,还用于若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备和开启WIFI热点的设备为同一个设备。
本实施方式中,提出了在确定接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段之后,网络接入设备可以确定接入设备和开启WIFI热点的设备为同一个设备,从而使得在一些需要判断接入设备和开启WIFI热点的设备是否为同一个设备的场景下,快速提供相应的信息,提高了方案的灵活性。
本申请实施例第三方面提供了一种网络设备,包括:至少一个处理器,至少一个处理器用于与存储器耦合,读取并执行存储器中的指令,以实现如第一方面的方法。
本申请实施例第四方面提供了一种计算机可读存储介质,计算机存储介质存储有计算机程序,计算机程序包括程序指令,程序指令当被处理器执行时使处理器执行如第一方面的方法。
本申请实施例第五方面提供了一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如第一方面的方法。
从以上技术方案可以看出,本申请实施例具有以下优点:
本申请实施例中,通过获取接入设备对应的MAC地址,以及用户家中WIFI热点的MAC地址,然后比较接入设备的MAC地址和WIFI热点的MAC是否属于同一个连续的地址段,从而判断接入设备和开启WIFI热点的设备是否为同一个设备,进而识别接入设备是否为AP设备。由于识别过程中只需要获取接入设备的MAC地址以及WIFI热点的MAC,不再需要维护识别库,因此,可以降低识别的成本。
附图说明
图1为本申请实施例中提供的系统架构的示例图;
图2为本申请实施例提供的一种设备识别的方法的流程示例图;
图3为本申请实施例提供的一种设备识别的方法的另一流程示例图;
图4为本申请实施例提供的一种设备识别的方法的流程示例图;
图5为本实施例提供的一种网络设备的结构示意图;
图6为本实施例提供的一种设备识别的装置的结构示意图。
具体实施方式
本申请实施例提供了一种设备识别的方法及相关装置,用于可以降低识别接入设备是否为AP设备的成本。
本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的 或对于这些过程、方法、产品或设备固有的其它步骤或单元。
为了便于理解,下面将对本申请实施例涉及的一些术语进行介绍:
网络接入设备:本实施例中,网络接入设备指的是能够提供网络接入服务的设备;例如,网络接入设备可以是网关、路由器、交换机、数字用户线路(Digital Subscriber Line,DSL)或无源光纤网络(passive optical network,PON)等等。
接入设备:本实施例中,接入设备指的是通过接入到网络接入设备上,而实现接入网络的设备;例如,接入设备可以是个人电脑、笔记本电脑、手机、智能音箱或路由器等具有接入网络功能的设备。
接入点(access point,AP)设备:本实施例中,AP设备指的是能够提供无线接入服务的设备,AP设备可以通过网络接入设备接入到网络中,并且可以提供无线热点,以共享网络,从而使得其他的设备可以通过接入AP设备共享的网络来实现网络的接入,一般来说,AP设备实质上也是一种接入设备,例如,AP设备可以是智能手机、笔记本电脑或路由器等能够提供无线热点的终端设备。
媒体访问控制(media access control,MAC)地址:MAC地址也称为以太网ID或物理地址,是一个用来确认网络设备位置的地址。MAC地址共48位(即6个字节),通常表示为12个16进制数,每2个16进制数之间用冒号隔开。如08:00:20:0A:8C:6D就是一个MAC地址,其中前6位16进制数08:00:20代表网络硬件制造商的编号,它是由电气与电子工程师协会(institute of electrical and electronics engineers,IEEE)分配的,而后6位16进制数0A:8C:6D代表该制造商所制造的某个网络产品(如网卡)的系列号。一般来说,只要不特意更改MAC地址,那么MAC地址在世界上就是唯一的。
无线保真(wireless fidelity,WIFI):WIFI是一种无线局域网技术,其作用是将电子终端以无线方式互相连接,一般来说,AP设备所提供的无线热点可以称为WIFI热点。
应用程序接口(Application Programming Interface,API):API指的是一些预先定义的函数,或指软件系统不同组成部分衔接的约定,是一组定义、程序及协议的集合。在本实施例中,API的目的是使得Agent服务可以通过API获取到网络接入设备的信息。
代理(Agent)服务:本实施例中,Agent服务指的是内置于网络接入设备中的一种软件服务,可以通过通讯协议(例如TR069协议)安装到网络接入设备上,其作用是通过向网络接入设备发送命令,来获取所需的MAC地址。
动态主机设置协议(dynamic host configuration protocol,DHCP):本实施例中,DHCP是一个局域网的网络协议,主要作用是集中的管理、分配IP地址,使网络环境中的设备动态的获得IP地址等信息,DHCP信息指的是已被分配有IP地址的接入设备所对应的信息。
消息队列遥测传输(message queuing telemetry transport,MQTT):MQTT是一种基于发布/订阅范式的消息协议,本实施例中,MQTT主要是用于服务器与网络接入设备之间的通信。
下面对本申请实施例所适用的应用场景以及系统架构进行介绍:
在用户自购AP设备进行家庭组网的场景下,当用户由于家庭网络出现问题而向运营商报障时,负责维护网络的人员需要直观地知道用户家里是否有自购的AP设备,以判断网络故障问题是否是由用户自购的AP设备引入的。因此,本申请实施例所提出的方法可以用于识别用户家庭中是否存在有AP设备的场景中。
如图1所示,图1为本申请实施例中提供的系统架构的示例图。其中,服务器通过网络与内置于网络接入设备中的Agent服务通信连接,服务器与Agent服务之间可以互相收发信息;网络接入设备通过其自身的网络接口接入有多个接入设备,即多个接入设备通过接入到网络接入设备来实现接入网络;其中,接入设备1同时为一个AP设备,能够通过开启无线热点的方式来为其他的设备提供无线接入服务,AP设备可以下挂有一个或多个接入设备,这些下挂于AP设备的接入设备能够通过AP设备实现网络的接入;此外,网络接入设备可以通过搜索无线热点的方式来获取到AP设备对应的无线热点信息。
本申请实施例中所指的网络接入设备具体可以是网关、路由器、交换机、DSL或PON等能够提供网络接入服务的设备,具体此处不做限定。在本实施例以及后续实施例中,仅以网络接入设备为例进行介绍。
此外,接入设备可以是个人电脑、笔记本电脑、手机、智能音箱或路由器等具有接入网络功能的设备,具体此处不做限定。在本实施例以及后续实施例中,仅以接入设备为例进行介绍。
值得注意的是,在本申请实施例中,对设备进行识别的过程可以在网络接入设备侧进行,也可以在服务器侧进行,为了便于理解,下面将分别从网络接入设备和服务器这两个角度对本申请实施例提供的设备识别的方法进行详细的介绍。
首先,以下将从网络接入设备的角度对本申请实施例提供的设备识别的方法进行介绍,如图2所示,图2为本申请实施例提供的一种设备识别的方法的流程示例图。
本申请实施例提供的一种设备识别的方法,包括:
201、网络接入设备获取接入设备的MAC地址;
本实施例中,当需要确定接入到网络接入设备的接入设备中是否存在有AP设备时,可以由网络接入设备获取接入设备的MAC地址。可以理解的是,在网络中,由于每个连接网络的设备都需要分配唯一的IP地址,因此为了能够给每一个接入到网络中的设备分配唯一的IP地址,接入设备通常是通过DHCP协议接入到网络接入设备中的。其中,DHCP在给接入设备分配IP地址时,通常需要获取接入设备的相关信息,例如接入设备的MAC地址和接入设备的名称等信息,然后给接入设备分配一个唯一的IP地址,并且将接入设备的相关信息和分配给接入设备的IP地址关联起来,以确保每个接入设备能够分配到一个唯一的IP地址。通常,接入设备的相关信息和分配给接入设备的IP地址会作为DHCP信息记录在网络接入设备中,因此,网络接入设备在需要获取接入设备的MAC地址时,通过获取接入设备对应的DHCP信息即可实现接入设备MAC地址的获取,具体地,网络接入设备可以通过采集其下挂设备列表中对应的DHCP信息的方式,来获取接入设备的MAC地址。
在实际应用中,网络接入设备中内置有Agent服务,Agent服务可以通过向网络接入设备发送命令来获取接入设备的MAC地址。具体地,首先由网络接入设备内置的Agent服务生成一个GET_SUB_DEVICE_LIST命令(即设备信息获取命令),然后Agent服务向网络接入设备发送该GET_SUB_DEVICE_LIST命令,网络接入设备根据该GET_SUB_DEVICE_LIST命令采集其下挂设备列表中对应的DHCP信息,其中,网络接入设备的下挂设备列表中包括有通过局域网接口(LAN接口)接入到网络接入设备的设备以及通过网络接入设备所开启的WIFI热点接入到网络接入设备的设备,换句话说,网络接入设备的下挂设备列表中包括有通过有线的方式接入的设备以及通过无线的方式接入的设备。
其中,GET_SUB_DEVICE_LIST命令一般可以为JSON格式的命令,主要用于请求获取下 挂设备的信息,具体地,GET_SUB_DEVICE_LIST命令可以如下所示:
Figure PCTCN2020103624-appb-000001
显然,通过以上的示例可以看出,GET_SUB_DEVICE_LIST命令通过向网络接入设备请求获取参数值的方式来指示网络接入设备获取下挂设备对应的DHCP信息。
具体地,网络接入设备在获取到下挂设备对应的DHCP信息之后,可以向Agent服务返回响应信息,该响应信息与GET_SUB_DEVICE_LIST命令相对应,具体可以如下所示:
Figure PCTCN2020103624-appb-000002
在Agent服务获取到网络接入设备返回的DHCP信息之后,Agent服务便可以在DHCP信息中获取到下挂设备列表中每个接入设备对应的MAC地址。
值得注意的是,为了能够实现Agent服务主动向网络接入设备发送命令并且获取相应的MAC地址,可以预先给Agent服务提供可调用的API和动态链接库(dynamic link library,DLL)文件,其中,DLL文件可以向Agent服务提供代码、数据或函数,使Agent服务可以调用不属于其可执行代码的函数,具体地,在本实施例中,Agent服务可以根据DLL文件中的指令调用预提供的API,从而实现向网络接入设备发送命令并且获取相应的MAC地址。
在本实施例中,上述的API和DLL文件可以是由与网络接入设备连接的服务器提供给Agent服务的,也可以是由运维人员通过预先安装在网络接入设备中来提供给Agent服务的,此处不做具体限定。通常来说,在需要通过Agent服务获取网络接入设备下挂设备列表信息且网络接入设备中没有安装有相应的API和DLL文件的情况下,可以由服务器向Agent服务提供API和DLL文件,从而保证能够可靠地获取下挂设备列表信息。
202、网络接入设备获取WIFI热点的MAC地址;
在本实施例中,同样可以通过内置于网络接入设备中的Agent服务向网络接入设备发送命令来获取WIFI热点的MAC地址。其中,该WIFI热点指的是位于网络接入设备周边(即目标区域)的WIFI热点,Agent服务可以先生成一个GET_NEIGH_BOUR命令(即热点信息获取命令),然后向网络接入设备发送该GET_NEIGH_BOUR命令,以使得网络接入设备可以根据该GET_NEIGH_BOUR命令启动WIFI芯片,来采集周边的WIFI热点信息;最后由网络接入设备向Agent服务返回采集到的WIFI热点信息,其中,WIFI热点信息中通常包括有WIFI热点的MAC地址以及WIFI热点的名称等信息,Agent服务基于该WIFI热点信息即可以获取到网络接入设备周边区域的WIFI热点的MAC地址。
可以理解的是,由于用户家庭网络中所采用的AP设备通常为功率较小的设备,这些 AP设备所发射的WIFI信号的有效传输距离通常为数十米左右(10米至30米),一般来说,用户家庭网络中自购的AP设备可以有效地覆盖用户家中的各个角落。此外,用户在组建家庭网络的过程中,运营商所提供的网络接入设备通常也是布置于用户家中的。因此,在本实施例中,通过布置于用户家中的网络接入设备能够有效地采集到覆盖在用户家中的WIFI热点信息。
具体地,GET_NEIGH_BOUR命令一般可以为JSON格式的命令,主要用于请求网络接入设备获取其周边区域的WIFI热点信息,GET_NEIGH_BOUR命令的具体信息结构与上述的GET_SUB_DEVICE_LIST命令类似,具体可以参阅上面的描述,此处不再赘述。
值得注意的是,本实施例中,步骤201与步骤202之间没有必然的先后顺序,可以先执行步骤201,也可以先执行步骤202,也可以同时执行步骤201和202,具体此处不做限定。
203、若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,网络接入设备确定接入设备为AP设备;
在本实施例中,在Agent服务获取到接入设备的MAC地址和WIFI热点的MAC地址之后,Agent服务可以对接入设备的MAC地址和WIFI热点的MAC地址进行比较,来判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段。
其中,判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段指的是判断接入设备的MAC地址和WIFI热点的MAC地址是否是相邻的地址,或者是判断这两个地址是否均位于一个连续的地址段内,如果两个地址是相邻的地址或者均位于一个连续的地址段内,则可以确定该接入设备为AP设备。
可以理解的是,由上述的介绍可知,MAC地址中的前6位16进制数代表网络硬件制造商的编号,是由IEEE所分配的一个固定的编号;而MAC地址的后6位16进制数则代表该制造商所制造的某个网络产品的系列号,该系列号可以认为是该网络产品的唯一“身份标识”。也就是说,MAC地址的后6位16进制数是由制造商自定义的,而在一般情况下,制造商为了便于网络产品的管理,其对于网络产品的MAC地址的编号是有一定的规律的。
对于一个AP设备,制造商会分配一个连续的地址段给AP设备以用于不同的MAC地址,例如WIFI热点MAC地址、上行连接MAC地址、LAN口MAC地址等等,这些MAC地址都是连续的。具体地,以AP设备为路由器为例,假设该路由器有1个WAN口(广域网接口,用于连接网络接入设备的接口),4个LAN口(局域网接口,用于接入其他的网络设备,例如个人电脑或笔记本电脑等)以及1个WIFI热点频段(例如运行于2.4GHz或5GHz频段的WIFI热点)。那么,该路由器至少有6个连续的MAC地址,其中,路由器的1个WAN口对应一个上行连接MAC地址,该上行连接MAC地址即为网络接入设备通过获取下挂设备列表的DHCP信息能够获取到的MAC地址,路由器的4个LAN口对应4个LAN口MAC地址,路由器的1个WIFI热点频段对应1个热点MAC地址,这6个MAC地址是连续的。例如,上述的6个MAC地址具体可以如下所示:
上行连接MAC地址:08:00:20:0A:8C:00;
4个LAN口MAC地址:08:00:20:0A:8C:01,08:00:20:0A:8C:02,08:00:20:0A:8C:03,08:00:20:0A:8C:04;
热点MAC地址:08:00:20:0A:8C:05。
由以上示例可以看出,上述的6个MAC地址的前十位十六进制数值均相同,后两位十 六进制数值分别为00至05,也就是说,这6个MAC地址是连续的。
基于上述的分析可以得知,对于用户家庭中的一个AP设备来说,该AP设备在接入到网络接入设备时所使用的MAC地址是一个上行连接MAC地址,而该AP设备在提供无线接入服务时(即开启WIFI热点时)所使用的MAC地址则是另一个MAC地址(即热点MAC地址),而这两个MAC地址又是属于同一个地址段内的。因此,在本实施例中,可以将网络接入设备获取到的接入设备的MAC地址与WIFI热点的MAC进行对比,如果这两个MAC地址属于同一个地址段,则可以认为这两个MAC地址是同一个设备的地址,即确定该接入设备是一个具有开启WIFI热点以提供无线接入服务功能的AP设备。
具体地,考虑到不同的制造商在给AP设备分配MAC地址时可能会采用不同的习惯,并且对于不同的AP设备来说,不同的AP设备所具有的MAC地址段的长度也是不同的,因此,在本实施例中,判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段,可以采用以下的两种方式:
1、若接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值小于或等于预设阈值,则确定接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段。
由于MAC地址通常表示为12个16进制数,因此,MAC地址实际上可以看做为一个由12个16进制数构成的数值,因此,在获得接入设备的MAC地址和WIFI热点的MAC地址之后,可以分别将这两个MAC地址转换为具体的数值,并且求取这两个数值之间的差值绝对值,如果差值绝对值小于或等于预设阈值(例如256),则可以认为两个MAC地址是属于同一个地址段的。其中,预设阈值是根据大部分制造商给AP设备分配地址段的习惯来设置的,一般来说,制造商给AP设备所分配的地址段的长度不会大于256,即同一个AP设备中差值最大的两个MAC之间的差值也不会大于256,因此,在本实施例中可以设置预设阈值为256。可以理解的是,在实际应用中,该预设阈值是可以根据实际情况进行调整的,预设阈值越大,则最终识别为AP设备的接入设备则会越多,错误识别为AP设备的接入设备也会增加,识别错误率会提高,但是不容易漏识别AP设备(即一些AP设备没有被识别出来);预设阈值越小,则识别精度会越高,相应的,也更容易漏识别。因此,在实际应用中,可以根据具体的识别需要,相应地调整预设阈值。
例如,假设接入设备的MAC地址为07:16:76:00:02:FF,WIFI热点的MAC地址为07:16:76:00:03:00,显然,这两个MAC地址的前8位16进制数均是相同的,即两个MAC地址之间的差值绝对值是由后4位16进制数决定的,其中,02:FF对应的数值具体为767(0*163+2*162+16*161+16*160),03:00对应的数值具体为768(0*163+3*162+0*161+0*160),因此,这两个MAC地址之间的差值绝对值为1,显然,接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段。
在实际应用中,可以分别将接入设备的MAC地址以及WIFI热点的MAC地址转换为一个由12个16进制数构成的数值之后,再对两个转换后的16进制数值作差,求取两个MAC地址的差值绝对值;另外,也可以是分别将接入设备的MAC地址以及WIFI热点的MAC地址转换为一个由10进制数构成的数值之后,再对两个转换后的10进制数值作差,求取两个MAC地址的差值绝对值,在此不对具体求取差值绝对值的过程进行限定。
此外,在确定接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值的过程中,可以从两个MAC地址的低位数值开始计算相应的差值绝对值,在两个MAC地址的低位数值之间的差值绝对值满足小于或等于预设阈值的条件之后,再继续计算两个MAC地址的 高位数值之间的差值绝对值。例如,假设预设阈值为10,接入设备的MAC地址为07:16:76:00:02:20,WIFI热点的MAC地址为07:16:76:00:02:30,在确定两个MAC地址之间的差值绝对值的过程中,可以先比较两个MAC地址的后两位数值之间的差值绝对值,其中,接入设备的MAC地址后两位数值为20(转换为十进制后即为32),WIFI热点的MAC地址后两位数值为30(转换为十进制后即为48),显然,接入设备的MAC地址与WIFI热点的MAC地址的后两位数值之间的差值绝对值为16(48:32),大于数值为10的预设阈值,因此,此时可以确定接入设备的MAC地址与WIFI热点的MAC地址不属于同一个地址段,而不需要继续比对两个MAC地址中其他位数值之间的差值,也不需要将整个MAC地址转换为一个具体的数值(例如16进制数值或者10进制数值)之后再作差,降低了计算量。
2、若接入设备的MAC地址的第一位数值至第N位数值与WIFI热点的MAC地址的第一位数值至第N位数值均相同,则确定接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,其中,N为大于1的整数。
可以理解的是,对于一些制造商来说,为了便于对AP设备进行生产管理,其在给AP设备分配MAC地址的时候,分配给AP设备的多个MAC地址的前几位数值通常都是相同的。例如,以上述的路由器对应的6个MAC地址为例,6个MAC地址分别为:
08:00:20:0A:8C:00,
08:00:20:0A:8C:01,
08:00:20:0A:8C:02,
08:00:20:0A:8C:03,
08:00:20:0A:8C:04,
08:00:20:0A:8C:05。
显然,这6个MAC地址的前十位数值均是相同的,只有后两位数值是不相同的。基于此,在本实施例中,可以通过比较接入设备的MAC地址和WIFI热点的MAC地址这两个MAC地址的前N位数值是否相同,来判断两个MAC地址是否属于同一个地址段。其中,N为大于1的整数,具体可以为9、10或11等数值,在实际应用中,可以根据具体需要来设置N的数值。可以理解的是,N的数值越大时,接入设备被识别为AP设备所需要满足的条件也越高,例如,N为11时,接入设备的MAC地址只有在其前11位数值与WIFI热点的MAC地址的前11位数值相同时,才会被识别为AP设备,换句话说,N的数值越大时,识别的精度会越高,但是漏识别的概率也会越大;而N的数值越小时,识别的精度越低,但是漏识别的概率也会越小。因此,在实际应用中,可以根据实际的识别需要适应性地调整N的数值,从而在识别精度和漏识别概率中取得一个较好的平衡。
另外,在本实施例中,在判断得接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段之后,除了可以确定该接入设备为AP设备之外,还可以确定该接入设备与开启WIFI热点的设备为同一个设备,也就是说,可以将接入设备的信息和WIFI热点的信息关联起来,将该接入设备视为开启该WIFI热点的设备。这样一来,在一些场景下(例如需要确定开启WIFI热点的设备是哪一个设备的场景下),可以快速地提供开启WIFI热点的设备信息,为如何确定开启WIFI热点的设备提供了可行的方案,增强了方案的灵活性。
204、网络接入设备接收服务器发送的设备识别请求;
在本实施例中,在负责家庭网络管理的运维人员需要获取用户家庭中是否存在有自购的AP设备时,运维人员可以通过在服务器的家庭网络管理系统上下发设备识别请求指令, 以使得服务器向用户家庭中的网络接入设备发送设备识别请求,其中,家庭网络管理系统是部署于服务器上的一种软件系统,能够与用户家庭中的网络接入设备通信连接,主要用于实现对用户家庭网络的管理。其中,家庭网络管理系统可以通过MQTT通道向网络接入设备发送设备识别请求。具体地,家庭网络管理系统可以是定期通过服务器向网络接入设备发送设备识别请求(例如由运维人员预先设置好家庭网络管理系统定期触发发送设备识别请求的指令),也可以是在运维人员需要查询用户的家庭网络中是否存在有AP设备时再通过服务器向网络接入设备发送设备识别请求,在此不做具体限定。
205、网络接入设备向服务器发送被识别为AP设备的接入设备的信息。
在本实施例中,网络接入设备获取接入设备的MAC地址、获取WIFI热点的MAC地址以及根据接入设备的MAC地址和WIFI热点的MAC地址确定接入设备是否为AP设备等步骤均可以在网络接入设备启动之后便执行,或者是网络接入设备在工作过程中间隔一定的周期便执行上述的步骤,在网络接入设备确定得到具体某个或某几个接入设备为AP设备之后,网络接入设备可以将这些被识别为AP设备的接入设备对应的信息保存在本地的存储空间中。在网络接入设备获取到服务器发送的设备识别请求之后,便可以将预先保存在本地存储空间中的被识别为AP设备的接入设备对应的信息发送给服务器。其中,被识别为AP设备的接入设备的信息具体可以包括接入设备的MAC地址或接入设备的设备名称中的一种或多种。可以理解的是,接入设备的信息可以在获取DHCP信息的时候获取到,由于DHCP信息中通常会包括有接入设备的名称、接入设备的MAC地址等信息,因此,在确定了某个接入设备为AP设备之后,便可以将该接入设备对应的DHCP保存在本地的存储空间中,以作为该接入设备的待上报信息,直到网络接入设备获取到服务器下发的设备识别请求时,将该接入设备对应的待上报信息发送给服务器。显然,通过由网络接入设备主动执行识别接入设备的步骤并且保存被识别为AP设备的接入设备的信息,能够使得网络接入设备获取到设备识别请求时,快速向服务器反馈相应的信息,确保了AP设备信息的获取速度,有利于运维人员快速排障。
此外,在本实施例中,除了在接收到服务器发送的设备识别请求之后再由网络接入设备向服务器发送相应的接入设备信息,还可以是由网络接入设备间隔一定的周期主动向服务器发送被识别为AP设备的接入设备的信息,即网络接入设备定期主动向服务器反馈被识别为AP设备的接入设备的信息。例如,网络接入设备定期识别当前已接入的接入设备中是否存在有AP设备,并且在获得识别结果之后,主动向服务器发送被识别为AP设备的接入设备的信息。值得注意的是,网络接入设备可以在每一次进行AP设备的识别之后均向服务器反馈当前的识别结果,无论识别结果是识别到存在有AP设备还是未识别到存在有AP设备;此外,由于服务器在接收到网络接入设备发送的被识别为AP设备的接入设备对应的信息之后,通常都会将这些接入设备的信息保存在数据库中,因此,网络接入设备也可以是在识别到有新的AP设备之后,再给服务器反馈新识别到的AP设备对应的信息,而不需要每次在进行AP设备的识别之后都向服务器反馈相应的识别结果。可以理解的是,在网络接入设备主动向服务器发送接入设备的信息的情况下,在服务器接收到网络接入设备所发送的被识别为AP设备的接入设备的信息之后,服务器可以将这些接入设备的信息保存在数据库中,以便于在需要时能够及时显示该信息,例如在运维人员需要获知某一个家庭用户的家庭网络中是否存在有AP设备时,可以通过在服务器的家庭网络管理系统上通过查询数据库中来获取该信息。
本申请实施例中,通过获取接入设备对应的MAC地址,以及用户家中WIFI热点的MAC地址,然后比较接入设备的MAC地址和WIFI热点的MAC是否属于同一个连续的地址段,从而判断接入设备和开启WIFI热点的设备是否为同一个设备,进而识别接入设备是否为AP设备。由于识别过程中只需要获取接入设备的MAC地址以及WIFI热点的MAC,不再需要维护识别库,因此,可以降低识别的成本。
为了便于理解,以下将结合具体的例子对本申请实施例提供的设备识别的方法进行详细的介绍。
首先,由部署于服务器上的家庭网络管理系统向内置于网络接入设备中的Agent服务提供可调用的API和DLL文件;在网络接入设备启动之后,可以获取到家庭网络管理系统提供的API和DLL文件,网络接入设备可以启动其内置的Agent服务,并且由Agent服务加载API和DLL文件;在接入设备通过DHCP协议接入到网络接入设备时,网络接入设备可以记录接入设备对应的DHCP信息,具体包括接入设备的MAC地址和接入设备的设备名称等信息;其次,在Agent服务加载好API和DLL文件之后,Agent服务根据DLL文件中的指令调用预提供的API,来向网络接入设备发送GET_SUB_DEVICE_LIST命令;网络接入设备根据该GET_SUB_DEVICE_LIST命令采集连接到网络接入设备下的接入设备对应的DHCP信息,然后在采集完DHCP信息之后,向Agent服务返回采集到的DHCP信息,具体包括接入设备的MAC地址和接入设备的设备名称等信息;此外,Agent服务还根据DLL文件中的指令调用预提供的API,来向网络接入设备发送GET_NEIGH_BOUR命令;网络接入设备根据该GET_NEIGH_BOUR命令,启动WIFI芯片来采集周边的WIFI热点信息,并且在采集完毕之后向Agent服务返回相应的WIFI热点信息,具体包括WIFI热点的MAC地址和WIFI热点的名称等信息;最后,由Agent服务判断接入设备的MAC地址和WIFI热点的MAC地址是否属于同一个地址段内,如果是,则确定该接入设备为AP设备,并且向服务器发送该接入设备的信息。
请参阅图3,图3为本申请实施例提供的一种设备识别的方法的另一流程示例图。
本申请实施例提供的一种设备识别的方法,包括:
301、网络接入设备接收服务器发送的设备识别请求;
在本实施例中,当服务器侧的运维人员需要确定接入到网络接入设备的接入设备中是否存在有AP设备时,运维人员可以通过在服务器的家庭网络管理系统上下发设备识别请求指令,以使得服务器向用户家庭中的网络接入设备发送设备识别请求。
另外,若Agent服务中没有相应的API和DLL文件,那么服务器可以在向网络接入设备发送设备识别请求之前或者之后,向Agent服务提供API和DLL文件,其中,API和DLL文件的作用可以参考上述的步骤201和步骤202,在此不再赘述。
可以理解的是,本申请实施例中的设备识别请求具体可以是一个请求信息,也可以是两个请求信息,在设备识别请求为一个请求信息时,该请求信息用于同时请求获取接入设备的MAC地址和WIFI热点的MAC地址;在设备识别请求为两个请求信息时,这两个请求信息分别用于请求获取接入设备的MAC地址以及WIFI热点的MAC地址,另外,这两个请求信息可以是同时发送,也可以是具有任意的先后顺序,在此并不对两个请求信息的发送顺序做任何限定。
302、网络接入设备根据设备识别请求,获取接入设备的MAC地址;
在本实施例中,网络接入设备中内置的Agent服务在接收到服务器发送的设备识别请 求之后,再根据该设备识别请求来获取接入设备的MAC地址,也就是说,在本实施例中,Agent服务是在接收到设备识别请求之后,再获取接入设备的MAC地址。具体地,Agent服务获取接入设备的MAC地址的步骤与上述的步骤201相似,具体可以参阅上述的步骤201,在此不再赘述。
303、网络接入设备根据设备识别请求,获取WIFI热点的MAC地址;
在本实施例中,网络接入设备中内置的Agent服务在接收到服务器发送的设备识别请求之后,再根据该设备识别请求来获取WIFI热点的MAC地址,同样地,在本实施例中,Agent服务也是在接收到设备识别请求之后,再获取WIFI热点的MAC地址。具体地,Agent服务获取WIFI热点的MAC地址的步骤与上述的步骤202相似,具体可以参阅上述的步骤202,在此不再赘述。
值得注意的是,本实施例中,步骤302与步骤303之间没有必然的先后顺序,可以先执行步骤302,也可以先执行步骤303,也可以同时执行步骤302和303,具体此处不做限定。
304、若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,网络接入设备确定接入设备为AP设备;
本实施例中,步骤304与上述的步骤203相似,具体可以参阅上述的步骤203,在此不再赘述。
305、网络接入设备向服务器发送被识别为AP设备的接入设备的信息。
本实施例中,步骤305与上述的步骤205相似,具体可以参阅上述的步骤205,在此不再赘述。
在本实施例中,步骤301至步骤305与上述的步骤201至步骤205主要的区别在于:在步骤301至步骤305中,网络接入设备是在接收到服务器发送的设备识别请求后,再根据设备识别请求获取接入设备的MAC地址和WIFI热点的MAC地址,并且根据这两个MAC地址确定接入设备是否为AP设备,最后将被确定为AP设备的接入设备的信息发送给服务器;而在步骤201至步骤205中,网络接入设备是主动获取接入设备的MAC地址和WIFI热点的MAC地址,并且根据这两个MAC地址确定接入设备是否为AP设备,然后网络接入设备主动将被确定为AP设备的接入设备的信息发送给服务器,或者是先将被确定为AP设备的接入设备的信息存储在本地并且在获取到服务器发送的设备识别请求之后再将接入设备的信息发送给服务器。换句话说,在步骤301至步骤305中,网络接入设备是在接收到服务器发送的设备识别请求后,再进行AP设备的识别;而在步骤201至步骤205中,网络接入设备是主动进行AP设备的识别,然后主动向服务器反馈识别结果,或者是在接收到服务器发送的设备识别请求后,再发送预先获得的识别结果。
显然,在本实施例中,网络接入设备在接收到服务器发送的设备识别请求后再进行设备识别,能够确保识别结果是基于当前接入到网络接入设备中的接入设备以及当前网络接入设备周边的WIFI热点得到的,保证了识别结果的时效性,同时也避免了网络接入设备频繁向服务器发送识别结果,节省了信令消耗。
以上为从网络接入设备的角度对本申请实施例提供的设备识别的方法所进行的描述,以下将从服务器的角度对本申请实施例提供的设备识别的方法进行详细的介绍。如图4所示,图4为本申请实施例提供的一种设备识别的方法的流程示例图。
本申请实施例提供的一种设备识别的方法,包括:
401、服务器向网络接入设备发送地址获取请求;
本实施例中,地址获取请求主要用于指示网络接入设备获取接入设备的MAC地址以及WIFI热点的MAC地址,该地址获取请求具体可以是一个请求信息,用于同时请求接入设备的MAC地址以及WIFI热点的MAC地址;该地址获取请求也可以是两个请求信息,分别用于请求接入设备的MAC地址以及WIFI热点的MAC地址,在此不做具体限定。
402、网络接入设备根据地址获取请求获取接入设备的MAC地址;
本实施例中,网络接入设备获取接入设备的MAC地址的过程与上述的步骤201相似,具体可以参阅上述的步骤201,在此不再赘述。
403、网络接入设备根据地址获取请求获取WIFI热点的MAC地址;
本实施例中,网络接入设备获取WIFI热点的MAC地址的过程与上述的步骤202相似,具体可以参阅上述的步骤202,在此不再赘述。
值得注意的是,本实施例中,步骤402与步骤403之间没有必然的先后顺序,可以先执行步骤402,也可以先执行步骤403,也可以同时执行步骤402和403,具体此处不做限定。
404、服务器接收网络接入设备发送的接入设备的MAC地址和WIFI热点的MAC地址;
在本实施例中,网络接入设备在根据地址获取请求获取到接入设备的MAC地址和WIFI热点的MAC地址之后,便可以将接入设备的MAC地址和WIFI热点的MAC地址发送至服务器。其中,这两个MAC地址可以是由网络接入设备同时发送的,也可以是具有任意的先后发送顺序,在此并不对两个MAC地址的发送顺序做任何限定。
405、若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,服务器确定接入设备为AP设备。
在本实施例中,识别接入设备是否为AP设备的过程主要由服务器来执行,也就是说,网络接入设备主要负责获取接入设备的MAC地址以及WIFI热点的MAC地址,而根据接入设备的MAC地址以及WIFI热点的MAC地址判断接入设备是否为AP设备则由服务器来执行。具体地,服务器确定接入设备是否为AP设备的过程与步骤203类似,在此不再赘述。
在本实施例中,网络接入设备主要根据服务器发送的地址获取请求来获取接入设备的MAC地址和WIFI热点的MAC地址,而根据接入设备的MAC地址和WIFI热点的MAC地址判断接入设备是否为AP设备则由服务器来执行,通过将判断过程转至由具有更高的处理效率的服务器来执行,降低了网络接入设备的负载,同时提高了判断过程的效率。
上面对本申请实施例所提出的设备识别的方法进行了介绍,下面将对该设备识别的方法所涉及的网络设备50进行介绍,如图5所示,是本实施例提供的一种网络设备的结构示意图,该网络设备50可因配置或性能不同而产生比较大的差异,可以包括一个或一个以上处理器501和存储器502,一个或一个以上存储应用程序或数据的存储介质503(例如一个或一个以上海量存储设备)。其中,存储器502和存储介质503可以是短暂存储或持久存储。该网络设备还包括一个或一个以上输入/输出设备505,该输入/输出设备505,用于获取性能指标,或者,输出并展示分析结果。
进一步地,该处理器501可以设置为与存储介质503通信,处理器501用于执行存储介质503中的应用程序,具体地,该处理器用于执行如下步骤:获取接入设备的MAC地址;获取WIFI热点的MAC地址;若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备为接入点AP设备,其中,地址段内包括有多个连续的MAC地址。
在一些可行的实施方式中,该处理器,具体用于若接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值小于或等于预设阈值,则确定接入设备为AP设备。
在一些可行的实施方式中,该处理器,还用于若接入设备的MAC地址的第一位数值至第N位数值与WIFI热点的MAC地址的第一位数值至第N位数值均相同,则确定接入设备为AP设备,其中,N为大于1的整数。
在一些可行的实施方式中,该处理器,还用于向网络接入设备发送地址获取请求,地址获取请求用于指示网络接入设备获取接入设备的MAC地址以及WIFI热点的MAC地址。
在一些可行的实施方式中,该处理器,还用于生成设备信息获取命令;根据设备信息获取命令,获取DHCP信息,其中,DHCP信息包括接入设备的MAC地址;以及,生成热点信息获取命令;根据热点信息获取命令,获取目标区域内的WIFI热点信息,其中,WIFI热点信息包括WIFI热点的MAC地址。
在一些可行的实施方式中,该处理器,还用于向服务器发送被确定为AP设备的接入设备的信息,接入设备的信息包括MAC地址或设备名称中的一种或多种。
在一些可行的实施方式中,该处理器,还用于接收服务器发送的设备识别请求;根据设备识别请求,向服务器发送被识别为AP设备的接入设备的信息,接入设备的信息包括MAC地址或设备名称中的一种或多种。
在一些可行的实施方式中,该处理器,还用于若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备和开启WIFI热点的设备为同一个设备。
请参阅图6,图6为本实施例提供的一种设备识别的装置的结构示意图。
本申请实施例供的一种设备识别的装置,包括:获取模块601,用于获取接入设备的媒体访问控制MAC地址;该获取模块601,还用于获取无线保真WIFI热点的MAC地址;确定模块602,用于若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备为接入点AP设备,其中,地址段内包括有多个连续的MAC地址。
在一些可行的实施方式中,该确定模块602,还用于若接入设备的MAC地址与WIFI热点的MAC地址之间的差值绝对值小于或等于预设阈值,则确定接入设备为AP设备。
在一些可行的实施方式中,该确定模块602,还用于若接入设备的MAC地址的第一位数值至第N位数值与WIFI热点的MAC地址的第一位数值至第N位数值均相同,则确定接入设备为AP设备,其中,N为大于1的整数。
在一些可行的实施方式中,该设备识别的装置60还包括:发送模块603;该发送模块603,用于向网络接入设备发送地址获取请求,该地址获取请求用于指示网络接入设备获取接入设备的MAC地址以及WIFI热点的MAC地址;该获取模块601,还用于获取网络接入设备发送的接入设备的MAC地址;该获取模块601,还用于获取网络接入设备发送的WIFI热点的MAC地址。
在一些可行的实施方式中,该设备识别的装置60还包括:生成模块604;该生成模块604,用于生成设备信息获取命令;该获取模块601,还用于根据设备信息获取命令,获取DHCP信息,其中,DHCP信息包括接入设备的MAC地址;该生成模块604,还用于生成热点信息获取命令;该获取模块601,还用于根据热点信息获取命令,获取目标区域内的WIFI热点信息,其中,WIFI热点信息包括WIFI热点的MAC地址。
在一些可行的实施方式中,该发送模块603,还用于向服务器发送被确定为AP设备的接入设备的信息,该接入设备的信息包括MAC地址或设备名称中的一种或多种。
在一些可行的实施方式中,该设备识别的装置60还包括:接收模块605;该接收模块605,用于接收服务器发送的设备识别请求;该发送模块603,还用于根据设备识别请求,向服务器发送被识别为AP设备的接入设备的信息,接入设备的信息包括MAC地址或设备名称中的一种或多种。
在一些可行的实施方式中,该确定模块602,还用于若接入设备的MAC地址和WIFI热点的MAC地址属于同一个地址段,则确定接入设备和开启WIFI热点的设备为同一个设备。
本申请实施例中,通过获取接入设备对应的MAC地址,以及用户家中WIFI热点的MAC地址,然后比较接入设备的MAC地址和WIFI热点的MAC是否属于同一个连续的地址段,从而判断接入设备和开启WIFI热点的设备是否为同一个设备,进而识别接入设备是否为AP设备。由于识别过程中只需要获取接入设备的MAC地址以及WIFI热点的MAC,不再需要维护识别库,因此,可以降低识别的成本。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。

Claims (11)

  1. 一种设备识别的方法,其特征在于,包括:
    获取接入设备的媒体访问控制MAC地址;
    获取无线保真WIFI热点的MAC地址;
    若所述接入设备的MAC地址和所述WIFI热点的MAC地址属于同一个地址段,则确定所述接入设备为接入点AP设备,其中,所述地址段内包括有多个连续的MAC地址。
  2. 根据权利要求1所述的设备识别的方法,其特征在于,所述若所述接入设备的MAC地址和所述WIFI热点的MAC地址属于同一个地址段,则确定所述接入设备为AP设备,包括:
    若所述接入设备的MAC地址与所述WIFI热点的MAC地址之间的差值绝对值小于或等于预设阈值,则确定所述接入设备为AP设备。
  3. 根据权利要求1所述的设备识别的方法,其特征在于,所述若所述接入设备的MAC地址和所述WIFI热点的MAC地址属于同一个地址段,则确定所述接入设备为AP设备,包括:
    若所述接入设备的MAC地址的第一位数值至第N位数值与所述WIFI热点的MAC地址的第一位数值至第N位数值均相同,则确定所述接入设备为AP设备,其中,所述N为大于1的整数。
  4. 根据权利要求1至3任意一项所述的设备识别的方法,其特征在于,所述获取接入设备的MAC地址,以及所述获取WIFI热点的MAC地址之前,所述方法还包括:
    向网络接入设备发送地址获取请求,所述地址获取请求用于指示所述网络接入设备获取所述接入设备的MAC地址以及WIFI热点的MAC地址;
    所述获取接入设备的MAC地址,包括:
    获取所述网络接入设备发送的接入设备的MAC地址;
    所述获取WIFI热点的MAC地址,包括:
    获取所述网络接入设备发送的WIFI热点的MAC地址。
  5. 根据权利要求1至3任意一项所述的设备识别的方法,其特征在于,所述获取接入设备的MAC地址,包括:
    生成设备信息获取命令;
    根据所述设备信息获取命令,获取动态主机设置协议DHCP信息,其中,所述DHCP信息包括接入设备的MAC地址;
    所述获取WIFI热点的MAC地址,包括:
    生成热点信息获取命令;
    根据所述热点信息获取命令,获取目标区域内的WIFI热点信息,其中,所述WIFI热点信息包括所述WIFI热点的MAC地址。
  6. 根据权利要求5任意一项所述的设备识别的方法,其特征在于,在所述确定所述接入设备为AP设备之后,所述方法还包括:
    向服务器发送被确定为AP设备的所述接入设备的信息,所述接入设备的信息包括MAC地址或设备名称中的一种或多种。
  7. 根据权利要求5任意一项所述的设备识别的方法,其特征在于,所述方法还包括:
    接收服务器发送的设备识别请求;
    根据所述设备识别请求,向所述服务器发送被识别为AP设备的所述接入设备的信息,所述接入设备的信息包括MAC地址或设备名称中的一种或多种。
  8. 根据权利要求5所述的设备识别的方法,其特征在于,所述方法还包括:
    若所述接入设备的MAC地址和所述WIFI热点的MAC地址属于同一个地址段,则确定所述接入设备和开启所述WIFI热点的设备为同一个设备。
  9. 一种网络设备,其特征在于,包括至少一个处理器,所述至少一个处理器用于与存储器耦合,读取并执行所述存储器中的指令,以实现如权利要求1至8中任意一项所述的方法。
  10. 一种计算机可读存储介质,其特征在于,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行如权利要求1至8中任一项所述的方法。
  11. 一种计算机程序产品,其特征在于,当所述计算机程序产品在计算机上运行时,使得计算机执行如权利要求1至8中任一项所述的方法。
PCT/CN2020/103624 2019-07-31 2020-07-22 一种设备识别的方法及相关装置 WO2021017987A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2022506253A JP7476297B2 (ja) 2019-07-31 2020-07-22 デバイス識別方法および関連装置
EP20846775.3A EP3989641A4 (en) 2019-07-31 2020-07-22 IDENTIFICATION METHOD OF DEVICE AND ASSOCIATED APPARATUS
US17/585,188 US20220150216A1 (en) 2019-07-31 2022-01-26 Device identification method and related apparatus

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910714829.0 2019-07-31
CN201910714829.0A CN112312519B (zh) 2019-07-31 2019-07-31 一种设备识别的方法及相关装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/585,188 Continuation US20220150216A1 (en) 2019-07-31 2022-01-26 Device identification method and related apparatus

Publications (1)

Publication Number Publication Date
WO2021017987A1 true WO2021017987A1 (zh) 2021-02-04

Family

ID=74229328

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/103624 WO2021017987A1 (zh) 2019-07-31 2020-07-22 一种设备识别的方法及相关装置

Country Status (5)

Country Link
US (1) US20220150216A1 (zh)
EP (1) EP3989641A4 (zh)
JP (1) JP7476297B2 (zh)
CN (1) CN112312519B (zh)
WO (1) WO2021017987A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1294129A2 (en) * 2001-09-12 2003-03-19 Allied Telesis K. K. Method for preventing endless transfer of a packet in a wireless lan system
CN103795631A (zh) * 2012-10-30 2014-05-14 杭州华三通信技术有限公司 部署了以太网虚拟连接的网络中的流量转发方法及设备
CN106851779A (zh) * 2016-12-07 2017-06-13 广东欧珀移动通信有限公司 一种识别接入点和热点的方法及移动终端
CN107197456A (zh) * 2017-06-16 2017-09-22 中国海洋大学 一种基于客户端的识别伪ap的检测方法及检测装置

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8699370B2 (en) 2010-08-24 2014-04-15 Euclid, Inc. Method and apparatus for analysis of user traffic within a predefined area
US9198118B2 (en) 2012-12-07 2015-11-24 At&T Intellectual Property I, L.P. Rogue wireless access point detection
KR101360348B1 (ko) 2013-09-13 2014-02-10 지니네트웍스(주) 무선ap 탐지방법
US9578620B2 (en) * 2014-04-22 2017-02-21 Comcast Cable Communications, Llc Mapping and bridging wireless networks to provide better service
CN104639667B (zh) * 2014-12-31 2019-04-16 北京奇虎科技有限公司 一种基于mac地址的设备识别方法、装置和系统
CN104837179B (zh) * 2015-04-02 2019-02-01 Oppo广东移动通信有限公司 一种显示无线热点设备生产者信息的方法及装置
JP6540251B2 (ja) 2015-06-09 2019-07-10 株式会社バッファロー 無線機器及び無線通信システム
CN106413001A (zh) * 2016-10-28 2017-02-15 武汉斗鱼网络科技有限公司 一种无线网络连接的流量控制方法及装置
US10511620B2 (en) * 2016-10-31 2019-12-17 Armis Security Ltd. Detection of vulnerable devices in wireless networks
CN110268733B (zh) * 2016-12-30 2022-05-10 英国电讯有限公司 将设备自动配对到无线网络
CN109451518B (zh) * 2018-12-27 2022-07-15 青岛海信移动通信技术股份有限公司 一种区分终端接入wlan方式的方法及设备
CN109743745B (zh) * 2019-02-19 2021-01-22 北京三快在线科技有限公司 移动网络接入类型识别方法、装置、电子设备及存储介质

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1294129A2 (en) * 2001-09-12 2003-03-19 Allied Telesis K. K. Method for preventing endless transfer of a packet in a wireless lan system
CN103795631A (zh) * 2012-10-30 2014-05-14 杭州华三通信技术有限公司 部署了以太网虚拟连接的网络中的流量转发方法及设备
CN106851779A (zh) * 2016-12-07 2017-06-13 广东欧珀移动通信有限公司 一种识别接入点和热点的方法及移动终端
CN107197456A (zh) * 2017-06-16 2017-09-22 中国海洋大学 一种基于客户端的识别伪ap的检测方法及检测装置

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3989641A4

Also Published As

Publication number Publication date
US20220150216A1 (en) 2022-05-12
JP2022542410A (ja) 2022-10-03
CN112312519A (zh) 2021-02-02
EP3989641A4 (en) 2022-08-24
JP7476297B2 (ja) 2024-04-30
CN112312519B (zh) 2022-12-27
EP3989641A1 (en) 2022-04-27

Similar Documents

Publication Publication Date Title
US11395213B2 (en) Systems and methods for implementing multiple band service discovery
US9204390B2 (en) Energy-saving mobile node control method using wireless multi-interfaces
CN112291366B (zh) 数据传输方法、装置、存储介质及电子设备
US8644820B2 (en) Apparatus and method for acquiring service information in wireless network
CN103563451A (zh) 用于选择最优接入并在接入之间无缝转移的协作方案
WO2020001282A1 (zh) 接入方法、设备及系统
WO2019119424A1 (zh) 一种非授权载波的处理方法和装置以及系统
US20220346166A1 (en) Multi-link communication method, apparatus, and system
US20160183176A1 (en) Service discovery technique in wireless communication network for forming p2p group
CN104283743A (zh) 一种家庭网络设备及代理服务发现的方法
CN105474669A (zh) 对无线usb设备提供持久usb服务的方法和装置
KR20220116425A (ko) 듀얼 sim 폰을 통한 데이터 캐시 매커니즘
JP2015531195A (ja) サービス情報を発見する方法およびデバイス
CN109151955B (zh) 一种通信方法及设备
CN104320347B (zh) 一种主动更新lldp的方法及设备
CN114096007A (zh) 一种业务传输方法、装置、服务器及存储介质
US11277733B2 (en) Data transfer using a dual SIM phone
WO2014177019A1 (zh) 一种接入制式的配置方法、设备及系统
US11979819B2 (en) Communication method and apparatus
WO2021017987A1 (zh) 一种设备识别的方法及相关装置
CN114025009A (zh) 转发请求的方法、系统、代理服务器和装置
US20200162419A1 (en) Address assignment method and related device
CN105340238A (zh) 使用公共anqp组版本的anqp查询的系统和方法
CN114489708A (zh) 多服务网关的服务升级方法、装置及网关设备
US11716652B2 (en) Neighborhood aware load balancing

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20846775

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2022506253

Country of ref document: JP

Kind code of ref document: A

Ref document number: 2020846775

Country of ref document: EP

Effective date: 20220120

NENP Non-entry into the national phase

Ref country code: DE