WO2017148158A1 - 一种家庭网关利用云平台识别接入设备类型的系统 - Google Patents

一种家庭网关利用云平台识别接入设备类型的系统 Download PDF

Info

Publication number
WO2017148158A1
WO2017148158A1 PCT/CN2016/102820 CN2016102820W WO2017148158A1 WO 2017148158 A1 WO2017148158 A1 WO 2017148158A1 CN 2016102820 W CN2016102820 W CN 2016102820W WO 2017148158 A1 WO2017148158 A1 WO 2017148158A1
Authority
WO
WIPO (PCT)
Prior art keywords
identification module
source mac
queried
signal
mac
Prior art date
Application number
PCT/CN2016/102820
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 烽火通信科技股份有限公司
Publication of WO2017148158A1 publication Critical patent/WO2017148158A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/2803Home automation networks
    • H04L12/2807Exchanging configuration information on appliance services in a home automation network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Definitions

  • the present invention relates to the field of home gateway identification, and in particular, to a system in which a home gateway uses a cloud platform to identify an access device type.
  • home gateways carry more and more different kinds of access devices.
  • the WEB or APP management tool it is necessary to know the type of the access device.
  • the home gateway is the data forwarding center of the access device and is not responsible for interacting with the upper layer of the access device, that is, it is difficult to efficiently and accurately identify the type of the access device.
  • the home gateway needs a way to automatically identify the type of access device.
  • the technical problem solved by the present invention is to provide a system for a home gateway to accurately identify an access device type by using a cloud platform, which can not only be better managed by WEB or APP management tools.
  • the device connected to the home gateway enriches the related interactive application scenarios and ensures the forwarding performance of the home gateway.
  • the home gateway of the present invention uses a cloud platform to identify a system of an access device type, including a home gateway and a recognition platform.
  • the user space of the home gateway includes a gateway identification module and a cache file, and the kernel space of the home gateway includes data.
  • the capture module includes a platform identification module and a recognition database, and the data capture module and the platform identification module both communicate with the gateway identification module;
  • the cache file is used to: store the source MAC and the corresponding type information of the access device that is accessing the home gateway;
  • the identification database is configured to: store source MAC addresses and corresponding type information of all access devices identified by the home gateway;
  • the gateway identification module is used to:
  • the source MAC address of the access device in the ARP table in the home gateway is periodically detected in the cache file. If the source MAC address of the access device in the ARP table is not detected in the cache file, it is determined that a new connection is detected.
  • the device enters the device, and the current access device is used as the device to be queried, and sends an inquiry signal to the platform identification module, where the parameters in the query signal include the source MAC of the device to be queried;
  • the platform identification module is used to:
  • the gateway identification module After receiving the inquiry signal sent by the gateway identification module, it searches whether the source MAC in the inquiry signal is stored in the identification database, and if so, returns to the gateway identification module to check The query success signal, the parameters in the query success signal include the source MAC in the query signal, and the type information corresponding to the source MAC in the identification database; otherwise, the query failure signal is returned to the gateway identification module, and the parameters in the query failure signal include the query signal.
  • Source MAC in ;
  • parsing the feature value data field in the parsing signal After receiving the parsing signal sent by the gateway identification module, parsing the feature value data field in the parsing signal to determine whether the type information is parsed, and if so, increasing the parsed type information and the source MAC of the device to be queried to Identifying the database, returning the parsing success signal to the gateway identification module, and parsing the parameters in the success signal includes parsing the source MAC in the signal and parsing the type information; otherwise, returning the parsing failure signal to the gateway identification module, and parsing the parameters in the failure signal including parsing Source MAC in the signal;
  • the data capture module is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data
  • the data capture module is specifically configured to: after receiving the data capture signal sent by the gateway identification module, the communication hook function adds the source MAC of the device to be queried to the MAC monitoring linked list; when the device to be queried forwards the data packet through the home gateway, the hook is captured. After the function captures a data packet containing the eigenvalue data field of the MAC monitoring linked list, the source MAC address of the device to be queried is deleted from the MAC monitoring linked list, and the captured eigenvalue data field is returned to the gateway identification module.
  • S402 determining whether the feature value data field of the current data packet can be identified, if yes, go to S403, otherwise go to S406;
  • S403 Lock the MAC monitoring linked list, determine whether there is a node in the MAC monitoring linked list that is consistent with the source MAC address of the current data packet, and if yes, go to S404, otherwise, unlock the MAC monitoring linked list and then go to S406;
  • S405 Return the source MAC and feature value data fields of the current data packet to the gateway identification module, and go to S406;
  • S406 Forward the current data packet normally, and continue to execute S401.
  • the data packet forwarded by the device to be queried through the home gateway is an HTTP data packet, and the feature value data field is a User-Agent field; at this time, the process of S402 is: determining whether the current data packet is The TCP protocol and the destination port are 80. If yes, go to S403, otherwise go to S406; the characteristic value data field of S404 is the data between "User-Agent:" and the first " ⁇ r ⁇ n".
  • the TCP protocol in S402 is determined according to the protocol number.
  • the gateway identification module analyzes the feature in the signal.
  • the value data field is parsed:
  • the feature value data field contains an iphone string that is not case-sensitive, the type of the device to be queried is an iPhone;
  • the feature value data field contains an ipad string that is not case-sensitive, the type of the device to be queried is an iPad;
  • the eigenvalue data field contains an android string that is not case-sensitive, the type of the device to be queried is an Android device;
  • the type of the device to be queried is a MAC OS computer
  • the type of the device to be queried is a Windows OS phone.
  • the method can capture the feature value recognized by the platform identification module in the data packet through the data capture module when the access device forwards the data packet through the home gateway.
  • the data field, the platform identification module parses the feature value data field to obtain an unidentified type of access device. Therefore, the present invention can accurately identify an unknown type of access device, and can better manage the connected device of the home gateway through the WEB or APP management tool, and enrich the related interactive application scenarios.
  • the data capture module of the present invention only captures one data packet containing the feature value data field once, and if the data packet cannot be parsed, it again grabs one data packet containing the feature value data field.
  • the impact of such operations on the forwarding performance of the home gateway is negligible because Therefore, the present invention can ensure that the forwarding performance of the home gateway is not affected.
  • the identification database of the present invention dynamically grows during the working process.
  • the size of the home gateway application of the present invention is increased, the source MAC and type information identification database of all the identified access devices are stored, which will be other applications. Provides rich big data when further data mining.
  • FIG. 1 is a structural block diagram of a system for a home gateway to identify an access device type by using a cloud platform according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a working process of a gateway identification module according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a work of a platform identification module according to an embodiment of the present invention.
  • FIG. 4 is a flowchart of a communication hook function in a data capture module according to an embodiment of the present invention.
  • FIG. 5 is a flowchart of a work of grabbing a hook function in a data capture module according to an embodiment of the present invention.
  • the home gateway in the embodiment of the present invention uses a cloud platform to identify a system of an access device type, including a home gateway and a recognition platform.
  • the user space of the home gateway includes a gateway identification module and a cache file, and a kernel of the home gateway.
  • the space includes a data capture module;
  • the identification platform includes a platform identification module and an identification database, and the data capture module and the platform identification module both communicate with the gateway identification module.
  • the cache file is used to store the source MAC (Media Access Control) and corresponding type information of the access device that is accessing the home gateway.
  • the identification database is used to: store the source of all access devices identified by the home gateway MAC and corresponding type information, and can be dynamically expanded and updated later.
  • the gateway identification module is used to:
  • S101 Receive a listening event for distribution. If the monitoring event is that a new access device is detected in an ARP (Address Resolution Protocol) table in the home gateway, go to S102; if the listening event is a platform query response, Go to S104; if the interception event is a platform parsing response, go to S107; if the snooping event is the grab data reporting, go to S110.
  • ARP Address Resolution Protocol
  • S102 Determine whether there is a source MAC address and type information of the new access device in the cache file (that is, whether the cache file is mapped), and if yes, continue to execute S101; otherwise, go to S103.
  • S103 The current access device is used as the device to be queried, and the query signal is sent to the platform identification module.
  • the parameter in the query signal includes the source MAC address of the device to be queried, and the process continues to S101.
  • S104 determining whether the platform query response is successful. If the query success signal returned by the platform identification module is received, the platform query response is successful, and the process proceeds to S105; if the query failure signal returned by the identification module is received, the platform query response fails, and the process proceeds to S106.
  • S105 Update the source MAC and the corresponding type information in the query success signal to the cache file, and associate with the device to be queried (that is, the type information of the device to be queried is the type information in the query success signal), and continue to execute S101.
  • S106 Send a data capture signal to the data capture module.
  • the parameters in the data capture signal include the source MAC address of the device to be queried, and continue to execute S101.
  • S107 determining whether the platform parsing response is successful. If the parsing success signal returned by the platform identification module is received, the platform parsing response is successful, and the process proceeds to S108. If the parsing failure signal returned by the identifying module is received, the platform parsing response fails. Go to S109.
  • S108 Update the source MAC and the corresponding type information in the parsing success signal to the cache file, and associate with the device to be queried, and continue to execute S101.
  • S109 Send a data capture signal to the data capture module, and the parameter in the data capture signal The number includes the source MAC of the device to be queried, and the process proceeds to S101.
  • S110 After receiving the feature value data field and the source MAC returned by the data capture module, send a parsing signal to the platform identification module, where the parameters in the parsing signal include the source MAC and the feature value data field of the device to be queried, and continue to execute S101.
  • the platform identification module is used to:
  • S201 Receive a gateway identification module message for distribution. If the gateway identification module message is an inquiry signal, go to S202; if the gateway identification module message is an analysis signal, go to S205.
  • S202 retrieve in the identification database whether the source MAC in the query signal is stored (ie, whether the database exists in the identification database), and if yes, go to S203, otherwise go to S204.
  • S203 return a query success signal to the gateway identification module, the parameters in the query success signal include the source MAC in the query signal, and the type information corresponding to the source MAC in the identification database, and continue to execute S201;
  • S205 Parse the feature value data field in the parsing signal, determine whether the type information is parsed, and if yes, go to S206, otherwise go to S208.
  • the S205 When the S205 performs the parsing, when the data packet forwarded by the device to be queried through the home gateway is an HTTP (HyperText Transfer Protocol) data packet, and the feature value data field is a User-Agent field, If the intercepted data includes an iphone string (not case-sensitive, the same below), the device may be considered as an iPhone; if the intercepted data includes an ipad string, the device may be considered as an iPad; if the intercepted data is The android string is included; the device can be considered as an Android device; if the intercepted data includes a mac string, the device can be considered as a MAC OS computer; if the intercepted data includes a windows string, the device can be considered For Windows OS computers. (The eigenvalue is not limited in the specific implementation In the User-Agent field of the HTTP message)
  • S207 Return an analysis success signal to the gateway identification module, and the parameter in the parsing success signal includes parsing the source MAC in the signal and the parsed type information, and continuing to execute S201.
  • the data capture module is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data packet containing the feature value data field, and returns the data packet to the gateway identification module.
  • the fetched feature value data field is configured to: after receiving the data capture signal sent by the gateway identification module, when the device to be queried forwards the data packet through the home gateway, it captures a data
  • the data capture module is specifically configured to: after receiving the data capture signal sent by the gateway identification module, the communication hook function adds the source MAC of the device to be queried to the MAC monitoring linked list; when the device to be queried forwards the data packet through the home gateway, the hook is captured. After the function captures a data packet containing the eigenvalue data field of the MAC monitoring linked list, the source MAC address of the device to be queried is deleted from the MAC monitoring linked list, and the captured eigenvalue data field is returned to the gateway identification module.
  • the workflow of the communication hook function in the embodiment of the present invention is:
  • S302 After the MAC monitoring linked list is locked, the MAC monitoring list is iterated, and the waiting list is determined. Query whether the source MAC of the device exists in the MAC monitoring linked list. If yes, go to S304, otherwise go to S303.
  • S303 Allocate the memory of the current MAC address node in the MAC monitoring linked list, insert the current MAC address node into the MAC monitoring linked list, and go to S304.
  • S402 Determine whether the feature value data field of the current data packet can be identified, and if yes, go to S403, otherwise go to S406.
  • S403 Lock the MAC monitoring linked list, determine whether there is a node in the MAC monitoring linked list that is consistent with the source MAC address of the current data packet, and if yes, go to S404, otherwise, unlock the MAC monitoring linked list and then go to S406.
  • S404 Delete the node that is consistent with the source MAC address of the current data packet in the MAC monitoring linked list, and after the MAC monitoring linked list is unlocked, intercept the feature value data field from the current data packet, and go to S405.
  • S405 Return the source MAC and feature value data fields of the current data packet to the gateway identification module, and go to S406.
  • S406 Forward the current data packet normally, and continue to execute S401.
  • the data packet forwarded by the device to be queried through the home gateway is an HTTP data packet, and the eigenvalue data field is a User-Agent field.
  • the process of S402 is: determining whether the current data packet is a TCP protocol (TCP protocol based The protocol number is determined, and the destination port is 80. If yes, go to S403, otherwise go to S406; the characteristic value data field of S404 is "User-Agent:" and the data between the first " ⁇ r ⁇ n” .
  • the present invention is not limited to the above embodiments, and is a person of ordinary skill in the art.
  • a number of improvements and refinements can be made, and it is not limited to only grabbing and analyzing the User-Agent field of the HTTP data packet sent by the port of the device to be identified, or The environment captures relevant fields of other protocols and analyzes them; it is not limited to analyzing the operating system types of access terminals based only on the above data; these improvements and refinements are also considered to be within the scope of the present invention.
  • the contents not described in detail in the present specification belong to the prior art well known to those skilled in the art.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种家庭网关利用云平台识别接入设备类型的系统,涉及家庭网关识别领域。该系统当家庭网关无法识别源MAC对应的设备类型信息时,向识别平台查询;若识别平台无对应信息,则家庭网关抓取一个该源MAC设备发出的特征值数据包供识别平台分析;若识别平台无法分析出该源MAC对应的设备类型,则家庭网关再次抓取一个该源MAC设备发出的特征值数据字段,直至识别平台可以分析接入设备的类型为止。该特征值数据字段在具体实施时可以是但不局限于HTTP数据包中的User-Agent字段。本发明能够准确识别接入设备的类型,不仅能够更好地管理家庭网关的下挂设备,丰富相关的交互应用场景,而且能够保证家庭网关的转发性能。

Description

一种家庭网关利用云平台识别接入设备类型的系统 技术领域
本发明涉及家庭网关识别领域,具体涉及一种家庭网关利用云平台识别接入设备类型的系统。
背景技术
随着宽带技术的发展,家庭网关承载着越来越多不同种类的接入设备。为更好地通过WEB或APP管理工具管理家庭网关的接入设备,需要知道接入设备的类型。
但家,庭网关作为接入设备的数据转发中心,不负责与接入设备的上层交互,即难以高效准确的识别接入设备的类型。
鉴于以上情况,家庭网关需要一种能自动识别接入设备类型的方法。
发明内容
针对现有技术中存在的缺陷,本发明解决的技术问题为:提供一种家庭网关利用云平台准确识别接入设备类型的系统,该系统工作时不仅能够更好地通过WEB或APP管理工具管理家庭网关的下挂设备,丰富相关的交互应用场景,而且能够保证家庭网关的转发性能。
为达到以上目的,本发明公开的家庭网关利用云平台识别接入设备类型的系统,包括家庭网关和识别平台,家庭网关的用户空间中包括网关识别模块和缓存文件,家庭网关的内核空间包括数据抓取模块;识别平台包括平台识别模块和识别数据库,数据抓取模块和平台识别模块均与网关识别模块通信;
缓存文件用于:存放正在接入家庭网关的接入设备的源MAC和对应的类型信息;
识别数据库用于:存放家庭网关已识别的所有接入设备的源MAC和对应的类型信息;
网关识别模块用于:
(1)在缓存文件中定期检测家庭网关中的ARP表中的接入设备的源MAC,若在缓存文件中未检测到ARP表中的接入设备的源MAC,则确定检测到新的接入设备,将当前接入设备作为待查询设备,向平台识别模块发送查询信号,查询信号中的参数包括待查询设备的源MAC;
(2)收到平台识别模块返回的查询成功信号后,将查询成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联;
(3)收到平台识别模块返回的解析成功信号后,将解析成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联;
(4)收到识别模块返回的查询失败信号或解析失败信号后,向数据抓取模块发送数据抓取信号,数据抓取信号中的参数包括待查询设备的源MAC;
(5)收到数据抓取模块返回的特征值数据字段和源MAC后,向平台识别模块发送解析信号,解析信号中的参数包括待查询设备的源MAC和特征值数据字段;
平台识别模块用于:
(1)收到网关识别模块发送的查询信号后,在识别数据库中检索是否存放有查询信号中的源MAC,若是,向网关识别模块返回查 询成功信号,查询成功信号中的参数包括查询信号中的源MAC、以及识别数据库中与该源MAC对应的类型信息;否则向网关识别模块返回查询失败信号,查询失败信号中的参数包括查询信号中的源MAC;
(2)收到网关识别模块发送的解析信号后,对解析信号中的特征值数据字段进行解析,判断是否解析得到类型信息,若是,将解析得到的类型信息和待查询设备的源MAC增加至识别数据库,向网关识别模块返回解析成功信号,解析成功信号中的参数包括解析信号中的源MAC和解析得到的类型信息;否则向网关识别模块返回解析失败信号,解析失败信号中的参数包括解析信号中的源MAC;
数据抓取模块用于:收到网关识别模块发送的数据抓取信号后,在待查询设备通过家庭网关转发数据包时,抓取1个包含特征值数据字段的数据包,向网关识别模块返回抓取的特征值数据字段。
在上述技术方案的基础上,所述数据抓取模块运行时,创建有通信钩子函数和抓取钩子函数;
数据抓取模块具体用于:通信钩子函数收到网关识别模块发送的数据抓取信号后,将待查询设备的源MAC加入MAC监控链表;待查询设备通过家庭网关转发数据包时,抓取钩子函数抓取1个包含有符合MAC监控链表的特征值数据字段的数据包后,将待查询设备的源MAC从MAC监控链表中删除,向网关识别模块返回抓取的特征值数据字段。
在上述技术方案的基础上,所述通信钩子函数的工作流程为:
S301:收到网关识别模块发送的数据抓取信号后,解析得到待查询设备的源MAC,转到S302;
S302:将MAC监控链表上锁后,判断待查询设备的源MAC是 否存在于MAC监控链表中,若是,转到S304,否则转到S303;
S303:将当前MAC地址节点插入MAC监控链表,转到S304;
S304:将MAC监控链表解锁,继续执行S301。
在上述技术方案的基础上,S303中所述当前MAC地址节点插入MAC监控链表之前,还包括以下流程:在MAC监控链表中分配当前MAC地址节点的内存。
在上述技术方案的基础上,所述抓取钩子函数的工作流程为:
S401:抓取待查询设备通过家庭网关转发数据包后,解析得到当前数据包的源MAC、协议号和目地端口号,转到S402;
S402:判断当前数据包的特征值数据字段是否能够识别,若是,转到S403,否则转到S406;
S403:将MAC监控链表上锁,判断MAC监控链表中是否存在与当前数据包的源MAC一致的节点,若是,转到S404,否则将MAC监控链表解锁后转到S406;
S404:在MAC监控链表中删除与当前数据包的源MAC一致的节点,将MAC监控链表解锁后,从当前数据包中截取特征值数据字段,转到S405;
S405:将当前数据包的源MAC和特征值数据字段返回至网关识别模块,转到S406;
S406:正常转发当前数据包,继续执行S401。
在上述技术方案的基础上,所示待查询设备通过家庭网关转发的数据包为HTTP数据包,所述特征值数据字段为User-Agent字段;此时S402的流程为:判断当前数据包是否为TCP协议、且目地端口为80,若是,转到S403,否则转到S406;S404所述特征值数据字段为“User-Agent:”与其后第一个“\r\n”间的数据。
在上述技术方案的基础上,S402中所述TCP协议根据协议号确定。
在上述技术方案的基础上,当所述待查询设备通过家庭网关转发的数据包为HTTP数据包,所述特征值数据字段为User-Agent字段时,所述网关识别模块对解析信号中的特征值数据字段进行解析时:
(1)若特征值数据字段包含不分大小写的iphone字符串,则待查询设备的类型为iPhone手机;
(2)若特征值数据字段包含不分大小写的ipad字符串,则待查询设备的类型为iPad;
(3)若特征值数据字段包含不分大小写的android字符串,则待查询设备的类型为Android设备;
(4)若特征值数据字段包含不分大小写的mac字符串,则待查询设备的类型为MAC OS电脑;
(5)若特征值数据字段包含不分大小写的windows字符串,则待查询设备的类型为Windows OS手机。
与现有技术相比,本发明的优点在于:
(1)本发明当家庭网关接入未识别的接入设备时,能够在接入设备通过家庭网关转发数据包时,通过数据抓取模块在数据包中抓取供平台识别模块识别的特征值数据字段,平台识别模块对特征值数据字段进行解析得到未识别的接入设备的类型。因此,本发明能够准确的识别未知的接入设备类型,进而能够更好地通过WEB或APP管理工具管理家庭网关的下挂设备,丰富相关的交互应用场景。
(2)本发明的数据抓取模块1次仅抓取1个包含特征值数据字段的数据包,若对该数据包无法解析则再次抓取1个包含特征值数据字段的数据包。此种操作对家庭网关的转发性能影响可忽略不计,因 此,本发明能够保证不影响家庭网关的转发性能。
(3)本发明的识别数据库中在工作过程中会动态增长,采用本发明的家庭网关应用规模增长时,存放有所有已经识别的接入设备的源MAC和类型信息识别数据库,会为其他应用进一步进行数据挖掘时提供丰富的大数据。
附图说明
图1为本发明实施例中的家庭网关利用云平台识别接入设备类型的系统的结构框图;
图2为本发明实施例中网关识别模块的工作流程图;
图3为本发明实施例中平台识别模块的工作流程图;
图4为本发明实施例数据抓取模块中通信钩子函数的工作流程图;
图5为本发明实施例数据抓取模块中抓取钩子函数的工作流程图。
具体实施方式
以下结合附图及实施例对本发明作进一步详细说明。
参见图1所示,本发明实施例中的家庭网关利用云平台识别接入设备类型的系统,包括家庭网关和识别平台,家庭网关的用户空间中包括网关识别模块和缓存文件,家庭网关的内核空间包括数据抓取模块;识别平台包括平台识别模块和识别数据库,数据抓取模块和平台识别模块均与网关识别模块通信。
缓存文件用于:存放正在接入家庭网关的接入设备的源MAC(Media Access Control,物理地址)和对应的类型信息。
识别数据库用于:存放家庭网关已识别的所有接入设备的源 MAC和对应的类型信息,并在后期可以动态扩充及更新。
参见图2所示,网关识别模块用于:
S101:接收监听事件进行分发,若监听事件为在家庭网关中的ARP(Address Resolution Protocol,地址解析协议)表中检测到新的接入设备,转到S102;若监听事件为平台查询应答,转到S104;若监听事件为平台解析应答,转到S107;若监听事件为抓取数据上报,转到S110。
S102:判断缓存文件中是否存在新的接入设备的源MAC和类型信息(即缓存文件是否映射),若是,继续执行S101,否则转到S103。S103:将当前接入设备作为待查询设备,向平台识别模块发送查询信号,查询信号中的参数包括待查询设备的源MAC,继续执行S101。
S104:判断平台查询应答是否成功,若收到平台识别模块返回的查询成功信号,则平台查询应答成功,转到S105;若收到识别模块返回的查询失败信号,则平台查询应答失败,转到S106。
S105:将查询成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联(即待查询设备的类型信息为查询成功信号中的类型信息),继续执行S101。
S106:向数据抓取模块发送数据抓取信号,数据抓取信号中的参数包括待查询设备的源MAC,继续执行S101。
S107:判断平台解析应答是否成功,若收到平台识别模块返回的解析成功信号后,则平台解析应答成功,转到S108,若收到识别模块返回的解析失败信号,则平台解析应答失败,转到S109。
S108:将解析成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联,继续执行S101。
S109:向数据抓取模块发送数据抓取信号,数据抓取信号中的参 数包括待查询设备的源MAC,继续执行S101。
S110:收到数据抓取模块返回的特征值数据字段和源MAC后,向平台识别模块发送解析信号,解析信号中的参数包括待查询设备的源MAC和特征值数据字段,继续执行S101。
参见图3所示,平台识别模块用于:
S201:收到网关识别模块消息进行分发,若网关识别模块消息为查询信号,转到S202;若网关识别模块消息为解析信号,转到S205。
S202:在识别数据库中检索是否存放有查询信号中的源MAC(即识别数据库是否存在记录),若是,转到S203,否则转到S204。
S203:向网关识别模块返回查询成功信号,查询成功信号中的参数包括查询信号中的源MAC、以及识别数据库中与该源MAC对应的类型信息,继续执行S201;
S204:向网关识别模块返回查询失败信号,查询失败信号中的参数包括查询信号中的源MAC,继续执行S201。
S205:对解析信号中的特征值数据字段进行解析,判断是否解析得到类型信息,若是,转到S206,否则转到S208。
S205进行解析时,当所述待查询设备通过家庭网关转发的数据包为HTTP(HyperText Transfer Protocol,超文本传输协议)数据包,所述特征值数据字段为User-Agent(用户代理)字段时,若上述截取数据中包含iphone字符串(不分大小写,下同),则可以认为该设备为iPhone手机;若上述截取数据中包含ipad字符串,则可以认为该设备为iPad;若上述截取数据中包含android字符串;则可以认为该设备为Android设备;若上述截取数据中包含mac字符串,这可以认为该设备为MAC OS电脑;若上述截取数据中包含windows字符串,则可以认为该设备为Windows OS电脑。(具体实施时特征值不局限 于HTTP报文的User-Agent字段)
S206:将解析得到的类型信息和待查询设备的源MAC增加至识别数据库,转到S207。
S207:向网关识别模块返回解析成功信号,解析成功信号中的参数包括解析信号中的源MAC和解析得到的类型信息,继续执行S201。
S208:向网关识别模块返回解析失败信号,解析失败信号中的参数包括解析信号中的源MAC,继续执行S201。
数据抓取模块用于:收到网关识别模块发送的数据抓取信号后,在待查询设备通过家庭网关转发数据包时,抓取1个包含特征值数据字段的数据包,向网关识别模块返回抓取的特征值数据字段。
位于内核空间的数据抓取模块运行时,首先创建有Netlink(实现用户进程与内核进程通信的一种特殊的进程间通信)通信接口,注册通信钩子函数;然后在Linux内核Netfliter框架的NF_BR_PRE_ROUTING节点挂上抓取钩子函数。
数据抓取模块具体用于:通信钩子函数收到网关识别模块发送的数据抓取信号后,将待查询设备的源MAC加入MAC监控链表;待查询设备通过家庭网关转发数据包时,抓取钩子函数抓取1个包含有符合MAC监控链表的特征值数据字段的数据包后,将待查询设备的源MAC从MAC监控链表中删除,向网关识别模块返回抓取的特征值数据字段。
参见图4所示,本发明实施例中的通信钩子函数的工作流程为:
S301:收到网关识别模块发送的数据抓取信号后,解析得到待查询设备的源MAC,转到S302。
S302:将MAC监控链表上锁后,迭代MAC监控链表,判断待 查询设备的源MAC是否存在于MAC监控链表中,若是,转到S304,否则转到S303。
S303:在MAC监控链表中分配当前MAC地址节点的内存,将当前MAC地址节点插入MAC监控链表,转到S304。
S304:将MAC监控链表解锁,继续执行S301。
参见图5所示,抓取钩子函数的工作流程为:
S401:抓取待查询设备通过家庭网关转发数据包后,解析得到当前数据包的源MAC、协议号和目地端口号,转到S402。
S402:判断当前数据包的特征值数据字段是否能够识别,若是,转到S403,否则转到S406。
S403:将MAC监控链表上锁,判断MAC监控链表中是否存在与当前数据包的源MAC一致的节点,若是,转到S404,否则将MAC监控链表解锁后转到S406。
S404:在MAC监控链表中删除与当前数据包的源MAC一致的节点,将MAC监控链表解锁后,从当前数据包中截取特征值数据字段,转到S405。
S405:将当前数据包的源MAC和特征值数据字段返回至网关识别模块,转到S406。
S406:正常转发当前数据包,继续执行S401。
参见图5所示,待查询设备通过家庭网关转发的数据包为HTTP数据包,特征值数据字段为User-Agent字段;此时S402的流程为:判断当前数据包是否为TCP协议(TCP协议根据协议号确定)、且目地端口为80,若是,转到S403,否则转到S406;S404所述特征值数据字段为“User-Agent:”与其后第一个“\r\n”间的数据。
本发明不局限于上述实施方式,对于本技术领域的普通技术人员 来说,在不脱离本发明原理的前提下,还可以做出若干改进和润饰,不局限于仅抓取及分析待识别设备80端口发出的HTTP数据包的User-Agent字段,也可以根据具体环境抓取其他协议的相关字段并分析;不局限于仅根据上述数据分析出接入终端的操作系统种类;这些改进和润饰也视为本发明的保护范围之内。本说明书中未作详细描述的内容属于本领域专业技术人员公知的现有技术。

Claims (8)

  1. 一种家庭网关利用云平台识别接入设备类型的系统,包括家庭网关和识别平台,其特征在于:家庭网关的用户空间中包括网关识别模块和缓存文件,家庭网关的内核空间包括数据抓取模块;识别平台包括平台识别模块和识别数据库,数据抓取模块和平台识别模块均与网关识别模块通信;
    缓存文件用于:存放正在接入家庭网关的接入设备的源MAC和对应的类型信息;
    识别数据库用于:存放家庭网关已识别的所有接入设备的源MAC和对应的类型信息;
    网关识别模块用于:
    (1)在缓存文件中定期检测家庭网关中的ARP表中的接入设备的源MAC,若在缓存文件中未检测到ARP表中的接入设备的源MAC,则确定检测到新的接入设备,将当前接入设备作为待查询设备,向平台识别模块发送查询信号,查询信号中的参数包括待查询设备的源MAC;
    (2)收到平台识别模块返回的查询成功信号后,将查询成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联;
    (3)收到平台识别模块返回的解析成功信号后,将解析成功信号中的源MAC和对应的类型信息更新至缓存文件、并与待查询设备关联;
    (4)收到识别模块返回的查询失败信号或解析失败信号后,向数据抓取模块发送数据抓取信号,数据抓取信号中的参数包括待查询设备的源MAC;
    (5)收到数据抓取模块返回的特征值数据字段和源MAC后,向平台识别模块发送解析信号,解析信号中的参数包括待查询设备的源MAC和特征值数据字段;
    平台识别模块用于:
    (1)收到网关识别模块发送的查询信号后,在识别数据库中检索是否存放有查询信号中的源MAC,若是,向网关识别模块返回查询成功信号,查询成功信号中的参数包括查询信号中的源MAC、以及识别数据库中与该源MAC对应的类型信息;否则向网关识别模块返回查询失败信号,查询失败信号中的参数包括查询信号中的源MAC;
    (2)收到网关识别模块发送的解析信号后,对解析信号中的特征值数据字段进行解析,判断是否解析得到类型信息,若是,将解析得到的类型信息和待查询设备的源MAC增加至识别数据库,向网关识别模块返回解析成功信号,解析成功信号中的参数包括解析信号中的源MAC和解析得到的类型信息;否则向网关识别模块返回解析失败信号,解析失败信号中的参数包括解析信号中的源MAC;
    数据抓取模块用于:收到网关识别模块发送的数据抓取信号后,在待查询设备通过家庭网关转发数据包时,抓取1个包含特征值数据字段的数据包,向网关识别模块返回抓取的特征值数据字段。
  2. 如权利要求1所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:所述数据抓取模块运行时,创建有通信钩子函数和抓取钩子函数;
    数据抓取模块具体用于:通信钩子函数收到网关识别模块发送的数据抓取信号后,将待查询设备的源MAC加入MAC监控链表;待查询设备通过家庭网关转发数据包时,抓取钩子函数抓取1个包含有 符合MAC监控链表的特征值数据字段的数据包后,将待查询设备的源MAC从MAC监控链表中删除,向网关识别模块返回抓取的特征值数据字段。
  3. 如权利要求2所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:所述通信钩子函数的工作流程为:
    S301:收到网关识别模块发送的数据抓取信号后,解析得到待查询设备的源MAC,转到S302;
    S302:将MAC监控链表上锁后,判断待查询设备的源MAC是否存在于MAC监控链表中,若是,转到S304,否则转到S303;
    S303:将当前MAC地址节点插入MAC监控链表,转到S304;
    S304:将MAC监控链表解锁,继续执行S301。
  4. 如权利要求3所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:S303中所述当前MAC地址节点插入MAC监控链表之前,还包括以下流程:在MAC监控链表中分配当前MAC地址节点的内存。
  5. 如权利要求3所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:所述抓取钩子函数的工作流程为:
    S401:抓取待查询设备通过家庭网关转发数据包后,解析得到当前数据包的源MAC、协议号和目地端口号,转到S402;
    S402:判断当前数据包的特征值数据字段是否能够识别,若是,转到S403,否则转到S406;
    S403:将MAC监控链表上锁,判断MAC监控链表中是否存在与当前数据包的源MAC一致的节点,若是,转到S404,否则将MAC监控链表解锁后转到S406;
    S404:在MAC监控链表中删除与当前数据包的源MAC一致的 节点,将MAC监控链表解锁后,从当前数据包中截取特征值数据字段,转到S405;
    S405:将当前数据包的源MAC和特征值数据字段返回至网关识别模块,转到S406;
    S406:正常转发当前数据包,继续执行S401。
  6. 如权利要求5所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:所示待查询设备通过家庭网关转发的数据包为HTTP数据包,所述特征值数据字段为User-Agent字段;此时S402的流程为:判断当前数据包是否为TCP协议、且目地端口为80,若是,转到S403,否则转到S406;S404所述特征值数据字段为“User-Agent:”与其后第一个“\r\n”间的数据。
  7. 如权利要求6所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:S402中所述TCP协议根据协议号确定。
  8. 如权利要求1至7任一项所述的家庭网关利用云平台识别接入设备类型的系统,其特征在于:当所述待查询设备通过家庭网关转发的数据包为HTTP数据包,所述特征值数据字段为User-Agent字段时,所述网关识别模块对解析信号中的特征值数据字段进行解析时:
    (1)若特征值数据字段包含不分大小写的iphone字符串,则待查询设备的类型为iPhone手机;
    (2)若特征值数据字段包含不分大小写的ipad字符串,则待查询设备的类型为iPad;
    (3)若特征值数据字段包含不分大小写的android字符串,则待查询设备的类型为Android设备;
    (4)若特征值数据字段包含不分大小写的mac字符串,则待查询设备的类型为MAC OS电脑;
    (5)若特征值数据字段包含不分大小写的windows字符串,则待查询设备的类型为Windows OS手机。
PCT/CN2016/102820 2016-03-03 2016-10-21 一种家庭网关利用云平台识别接入设备类型的系统 WO2017148158A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610121236.XA CN105577496B (zh) 2016-03-03 2016-03-03 一种家庭网关利用云平台识别接入设备类型的系统
CN201610121236.X 2016-03-03

Publications (1)

Publication Number Publication Date
WO2017148158A1 true WO2017148158A1 (zh) 2017-09-08

Family

ID=55887189

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/102820 WO2017148158A1 (zh) 2016-03-03 2016-10-21 一种家庭网关利用云平台识别接入设备类型的系统

Country Status (2)

Country Link
CN (1) CN105577496B (zh)
WO (1) WO2017148158A1 (zh)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884864A (zh) * 2020-08-04 2020-11-03 北京立通智联科技有限公司 对物联网设备的管理方法及其装置
CN113612627A (zh) * 2021-07-09 2021-11-05 中电海康集团有限公司 一种应用于智慧灯杆的协议适配处理方法及系统
CN113794629A (zh) * 2021-09-03 2021-12-14 浙江容大电力工程有限公司 一种基于环保监测的边缘计算网关及应用方法
CN114860693A (zh) * 2022-05-30 2022-08-05 北京方胜有成科技股份有限公司 一种智能终端结构化数据管理方法

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577496B (zh) * 2016-03-03 2018-06-15 烽火通信科技股份有限公司 一种家庭网关利用云平台识别接入设备类型的系统
CN106658586B (zh) * 2016-12-05 2019-12-06 任子行网络技术股份有限公司 一种采集iOS设备的MAC地址的方法
CN109995570A (zh) * 2018-01-02 2019-07-09 中国移动通信有限公司研究院 扩展未知类型终端的方法及装置、设备、存储介质
CN108712428A (zh) * 2018-05-23 2018-10-26 北京奇安信科技有限公司 一种对终端进行设备类型识别的方法及装置
CN116032762A (zh) 2019-11-11 2023-04-28 华为技术有限公司 网络业务的处理方法、系统和网关设备
CN111445654B (zh) * 2019-12-09 2021-12-14 珠海派诺科技股份有限公司 火灾监控系统快速接入方法、火灾监控系统及存储介质
CN111988218A (zh) * 2020-08-13 2020-11-24 支付宝(杭州)信息技术有限公司 一种数据处理方法、装置、设备及介质
CN112468608B (zh) * 2020-11-16 2021-10-08 成都渊数科技有限责任公司 一种基于mac地址识别设备型号的方法及系统
CN114039849A (zh) * 2021-10-25 2022-02-11 深圳毅芯半导体有限公司 设备参数修改方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130205015A1 (en) * 2010-05-20 2013-08-08 Thales Method and Device for Analyzing Data Intercepted on an IP Network in order to Monitor the Activity of Users on a Website
CN104410724A (zh) * 2014-12-23 2015-03-11 上海市共进通信技术有限公司 基于http协议在智能网关中实现设备类型识别的方法
CN105376114A (zh) * 2015-11-30 2016-03-02 上海斐讯数据通信技术有限公司 路由器网桥模式下无线终端类型的识别系统及方法
CN105553792A (zh) * 2015-12-14 2016-05-04 烽火通信科技股份有限公司 一种家庭网关识别接入设备类型的系统及方法
CN105577496A (zh) * 2016-03-03 2016-05-11 烽火通信科技股份有限公司 一种家庭网关利用云平台识别接入设备类型的系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR101016529B1 (ko) * 2001-08-28 2011-02-24 소니 주식회사 정보 처리 장치 및 방법
US20120184258A1 (en) * 2010-07-15 2012-07-19 Movik Networks Hierarchical Device type Recognition, Caching Control & Enhanced CDN communication in a Wireless Mobile Network
CN102984015B (zh) * 2012-12-21 2015-08-26 太仓市同维电子有限公司 一种网关设备自动识别接入设备类型以及优化服务的方法

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130205015A1 (en) * 2010-05-20 2013-08-08 Thales Method and Device for Analyzing Data Intercepted on an IP Network in order to Monitor the Activity of Users on a Website
CN104410724A (zh) * 2014-12-23 2015-03-11 上海市共进通信技术有限公司 基于http协议在智能网关中实现设备类型识别的方法
CN105376114A (zh) * 2015-11-30 2016-03-02 上海斐讯数据通信技术有限公司 路由器网桥模式下无线终端类型的识别系统及方法
CN105553792A (zh) * 2015-12-14 2016-05-04 烽火通信科技股份有限公司 一种家庭网关识别接入设备类型的系统及方法
CN105577496A (zh) * 2016-03-03 2016-05-11 烽火通信科技股份有限公司 一种家庭网关利用云平台识别接入设备类型的系统

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111884864A (zh) * 2020-08-04 2020-11-03 北京立通智联科技有限公司 对物联网设备的管理方法及其装置
CN111884864B (zh) * 2020-08-04 2023-04-18 北京立通智联科技有限公司 对物联网设备的管理方法及其装置
CN113612627A (zh) * 2021-07-09 2021-11-05 中电海康集团有限公司 一种应用于智慧灯杆的协议适配处理方法及系统
CN113612627B (zh) * 2021-07-09 2024-05-28 中电海康集团有限公司 一种应用于智慧灯杆的协议适配处理方法及系统
CN113794629A (zh) * 2021-09-03 2021-12-14 浙江容大电力工程有限公司 一种基于环保监测的边缘计算网关及应用方法
CN114860693A (zh) * 2022-05-30 2022-08-05 北京方胜有成科技股份有限公司 一种智能终端结构化数据管理方法
CN114860693B (zh) * 2022-05-30 2024-04-19 北京方胜有成科技股份有限公司 一种智能终端结构化数据管理方法

Also Published As

Publication number Publication date
CN105577496A (zh) 2016-05-11
CN105577496B (zh) 2018-06-15

Similar Documents

Publication Publication Date Title
WO2017148158A1 (zh) 一种家庭网关利用云平台识别接入设备类型的系统
US10097466B2 (en) Data distribution method and splitter
WO2020135575A1 (zh) 一种获取网络拓扑的系统、方法和服务器
US8073936B2 (en) Providing support for responding to location protocol queries within a network node
WO2017092502A1 (zh) 路由器网桥模式下无线终端类型的识别系统及方法
WO2018028606A1 (zh) 转发策略配置
US10194001B1 (en) Automatic discovery of API information
US11696110B2 (en) Distributed, crowdsourced internet of things (IoT) discovery and identification using Block Chain
US10666672B2 (en) Collecting domain name system traffic
JP2008054096A (ja) ネットワーク中継装置、および、ネットワーク中継装置の制御方法
JP2020017809A (ja) 通信装置及び通信システム
CN107566549B (zh) 一种网络地址转换映射表的处理方法、装置及设备
KR101416523B1 (ko) 보안 시스템 및 그것의 동작 방법
CN109413001B (zh) 对云计算系统内的交互数据进行安全保护的方法及装置
WO2014206152A1 (zh) 一种网络安全监控方法和系统
CN114401319B (zh) 一种请求处理方法、装置、服务器及存储介质
WO2017044024A1 (en) Optimized complex event processing in a software-defined network
CN101741745A (zh) 识别对等网络应用流量的方法及其系统
TWI735633B (zh) 資料傳輸的方法、設備、裝置及系統
US10419386B2 (en) Endpoint identifiers registration
JP5797597B2 (ja) 中継装置
US20140366084A1 (en) Management system, management method, and non-transitory storage medium
CN112688884B (zh) 加密流量自定义应用识别方法、系统、装置及存储介质
JP6470640B2 (ja) 通信装置及びその制御方法、コンピュータプログラム
WO2016188222A1 (zh) 一种业务报文转发方法、装置及通信系统

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

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

Ref document number: 16892339

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 16892339

Country of ref document: EP

Kind code of ref document: A1