[go: up one dir, main page]

CN117714279B - Device management method, router and readable storage medium - Google Patents

Device management method, router and readable storage medium Download PDF

Info

Publication number
CN117714279B
CN117714279B CN202310950608.XA CN202310950608A CN117714279B CN 117714279 B CN117714279 B CN 117714279B CN 202310950608 A CN202310950608 A CN 202310950608A CN 117714279 B CN117714279 B CN 117714279B
Authority
CN
China
Prior art keywords
mac address
address information
electronic device
message
router
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310950608.XA
Other languages
Chinese (zh)
Other versions
CN117714279A (en
Inventor
邵磊
施磊
李瑾
方宇卓
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Honor Device Co Ltd
Original Assignee
Honor Device Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Honor Device Co Ltd filed Critical Honor Device Co Ltd
Priority to CN202310950608.XA priority Critical patent/CN117714279B/en
Publication of CN117714279A publication Critical patent/CN117714279A/en
Application granted granted Critical
Publication of CN117714279B publication Critical patent/CN117714279B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/0813Configuration setting characterised by the conditions triggering a change of settings
    • H04L41/0816Configuration setting characterised by the conditions triggering a change of settings the condition being an adaptation, e.g. in response to network events
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/085Retrieval of network configuration; Tracking network configuration history
    • H04L41/0859Retrieval of network configuration; Tracking network configuration history by keeping history of different configuration generations or by rolling back to previous configuration versions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本申请公开了一种设备管理的方法、路由器及可读存储介质,属于终端技术领域。该方法包括:在接收第一电子设备的业务请求的情况下,根据业务权限配置信息响应业务请求,业务权限配置信息用于指示第一电子设备的业务权限和当前使用的第一媒体访问控制MAC地址信息之间的映射关系。在第一电子设备使用第二MAC地址信息重新接入路由器的情况下,根据第一映射关系,将业务权限配置信息中的第一MAC地址信息修改为第二MAC地址信息,第一映射关系用于记录第一电子设备的设备指纹特征与MAC地址信息之间的映射关系。如此,使得业务权限配置信息始终有效,从而保证能够对第一电子设备的业务权限进行有效控制。

The present application discloses a method for device management, a router, and a readable storage medium, and belongs to the field of terminal technology. The method includes: in the case of receiving a service request from a first electronic device, responding to the service request according to service authority configuration information, the service authority configuration information is used to indicate the mapping relationship between the service authority of the first electronic device and the first media access control MAC address information currently in use. In the case where the first electronic device re-accesses the router using the second MAC address information, the first MAC address information in the service authority configuration information is modified to the second MAC address information according to the first mapping relationship, and the first mapping relationship is used to record the mapping relationship between the device fingerprint feature of the first electronic device and the MAC address information. In this way, the service authority configuration information is always valid, thereby ensuring that the service authority of the first electronic device can be effectively controlled.

Description

设备管理的方法、路由器及可读存储介质Device management method, router and readable storage medium

技术领域Technical Field

本申请涉及终端技术领域,特别涉及一种设备管理的方法、路由器及可读存储介质。The present application relates to the field of terminal technology, and in particular to a device management method, a router, and a readable storage medium.

背景技术Background Art

随着终端技术的快速发展,电子设备得到广泛的应用。在一些应用场景中,用户可以对接入路由器的某电子设备的业务权限进行配置,以限制电子设备的上网权限,譬如儿童上网保护等。With the rapid development of terminal technology, electronic devices are widely used. In some application scenarios, users can configure the service permissions of an electronic device connected to a router to limit the Internet access permissions of the electronic device, such as protecting children from Internet access.

在相关技术中,通常在路由器中基于电子设备的媒体访问控制(Medium AccessControl,MAC)地址信息,对电子设备的业务权限进行配置。In the related art, the service rights of the electronic device are usually configured in a router based on the media access control (MAC) address information of the electronic device.

然而,在一些场景中,电子设备可能使用随机MAC地址信息接入路由器,也即不再使用原有的MAC地址信息接入,如此,将导致路由器中的业务权限配置失效。However, in some scenarios, electronic devices may use random MAC address information to access the router, that is, no longer use the original MAC address information to access, which will cause the service authority configuration in the router to become invalid.

发明内容Summary of the invention

本申请提供了一种设备管理的方法、路由器及可读存储介质,可以解决相关技术中在电子设备使用随机MAC地址信息接入时导致路由器中的业务权限配置失效的问题。所述技术方案如下:The present application provides a device management method, a router and a readable storage medium, which can solve the problem in the related art that when an electronic device uses random MAC address information to access, the service authority configuration in the router becomes invalid. The technical solution is as follows:

第一方面,提供了一种设备管理的方法,应用于路由器,所述方法包括:In a first aspect, a device management method is provided, which is applied to a router, and the method includes:

在接收第一电子设备的业务请求的情况下,根据业务权限配置信息响应所述业务请求,所述第一电子设备是接入所述路由器的任意一个电子设备,所述业务权限配置信息用于指示所述第一电子设备的业务权限和当前使用的第一媒体访问控制MAC地址信息之间的映射关系;In the case of receiving a service request from a first electronic device, responding to the service request according to the service authority configuration information, wherein the first electronic device is any electronic device connected to the router, and the service authority configuration information is used to indicate a mapping relationship between the service authority of the first electronic device and the first media access control MAC address information currently in use;

在所述第一电子设备使用第二MAC地址信息重新接入所述路由器的情况下,根据第一映射关系,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息,所述第一映射关系用于记录所述第一电子设备的设备指纹特征与MAC地址信息之间的映射关系,所述设备指纹特征是在所述第一电子设备接入所述路由器后基于所述第一电子设备与所述路由器之间交互的报文确定。In the case where the first electronic device uses the second MAC address information to re-access the router, the first MAC address information in the service authority configuration information is modified to the second MAC address information according to a first mapping relationship, wherein the first mapping relationship is used to record a mapping relationship between a device fingerprint feature of the first electronic device and the MAC address information, and the device fingerprint feature is determined based on messages exchanged between the first electronic device and the router after the first electronic device accesses the router.

如此,使得业务权限配置信息中的MAC地址信息与第一电子设备接入路由器时使用的MAC地址信息匹配,也即使得业务权限配置信息始终有效,从而保证能够对第一电子设备的业务权限进行有效控制。In this way, the MAC address information in the service authority configuration information matches the MAC address information used when the first electronic device accesses the router, which means that the service authority configuration information is always valid, thereby ensuring that the service authority of the first electronic device can be effectively controlled.

作为本申请的一个示例,所述在所述第一电子设备使用第二MAC地址信息重新接入所述路由器的情况下,根据第一映射关系,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息,包括:As an example of the present application, when the first electronic device re-accesses the router using the second MAC address information, modifying the first MAC address information in the service authority configuration information to the second MAC address information according to the first mapping relationship includes:

在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征;When the first electronic device re-accesses the router using the second MAC address information, acquiring the device fingerprint feature according to the message exchanged between the first electronic device and the router;

根据所述设备指纹特征从所述第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息;Querying corresponding MAC address information from the first mapping relationship according to the device fingerprint feature to obtain the first MAC address information;

在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息。When the first MAC address information is different from the second MAC address information, the first MAC address information in the service authority configuration information is modified to the second MAC address information.

如此,通过监控第一电子设备与路由器之间交互的报文,建立第一电子设备的设备指纹特征与第一MAC地址信息之间的第一映射关系,从而基于第一映射关系对第一电子设备的MAC地址信息进行管理,便于在第一电子设备的MAC地址信息变更后,能够及时修改业务权限配置信息,进而使得第一电子设备在使用随机的MAC地址信息接入后,所配置的业务权限配置信息仍不失效。In this way, by monitoring the messages exchanged between the first electronic device and the router, a first mapping relationship between the device fingerprint feature of the first electronic device and the first MAC address information is established, so that the MAC address information of the first electronic device is managed based on the first mapping relationship, so that after the MAC address information of the first electronic device is changed, the business authority configuration information can be modified in time, so that after the first electronic device is accessed using random MAC address information, the configured business authority configuration information will not be invalid.

作为本申请的一个示例,所述方法还包括:As an example of the present application, the method further includes:

将所述第一映射关系中的所述第一MAC地址信息修改为所述第二MAC地址信息。The first MAC address information in the first mapping relationship is modified to the second MAC address information.

如此,通过对第一映射关系进行修改,使得后续第一电子设备再次使用随机的MAC地址信息接入时,路由器仍可以根据修改后的第一映射关系进行MAC地址信息管理。In this way, by modifying the first mapping relationship, when the first electronic device subsequently accesses again using the random MAC address information, the router can still manage the MAC address information according to the modified first mapping relationship.

作为本申请的一个示例,所述在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征,包括:As an example of the present application, when the first electronic device re-accesses the router using the second MAC address information, acquiring the device fingerprint feature according to the message exchanged between the first electronic device and the router includes:

在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,监听目标类型的报文,所述目标类型的报文包括多播域名系统MDNS报文、数据报传输层安全性协议DTLS报文和BROWSER报文;When the first electronic device re-accesses the router using the second MAC address information, monitoring messages of a target type, wherein the messages of the target type include multicast domain name system MDNS messages, datagram transport layer security protocol DTLS messages, and BROWSER messages;

在监听到所述目标类型的报文的情况下,从所监听到的报文中获取所述设备指纹特征。When a message of the target type is monitored, the device fingerprint feature is obtained from the monitored message.

如此,通过同时监听不同类型的报文,以使得路由器能够获取到第一电子设备的设备指纹特征,提高了获取设备指纹特征的成功率。In this way, by monitoring different types of messages at the same time, the router can obtain the device fingerprint feature of the first electronic device, thereby improving the success rate of obtaining the device fingerprint feature.

作为本申请的一个示例,所述在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,监听目标类型的报文,包括:As an example of the present application, when the first electronic device re-accesses the router using the second MAC address information, monitoring a target type of message includes:

在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,分别通过第一钩子和第二钩子监听所述目标类型的报文,其中,所述第一钩子用于监听所述MDNS报文,所述第二钩子用于监听所述DTLS报文和所述BROWSER报文。When the first electronic device uses the second MAC address information to re-access the router, the target type of message is monitored through the first hook and the second hook respectively, wherein the first hook is used to monitor the MDNS message, and the second hook is used to monitor the DTLS message and the BROWSER message.

如此,分别通过不同的钩子监听不同类型的报文,以便于第一电子设备在上报任意一种类型的报文的情况下,均能够监控到该报文,从而保证能够有效获取到第一电子设备的设备指纹特征。In this way, different types of messages are monitored through different hooks, so that when the first electronic device reports any type of message, the message can be monitored, thereby ensuring that the device fingerprint feature of the first electronic device can be effectively obtained.

作为本申请的一个示例,所述在监听到所述目标类型的报文的情况下,从监听到的报文中获取所述设备指纹特征,包括:As an example of the present application, in the case where the message of the target type is monitored, obtaining the device fingerprint feature from the monitored message includes:

在监听到所述MDNS报文的情况下,解析所述MDNS报文中的第一关键字段对应的字符串,得到所述设备指纹特征;When the MDNS message is intercepted, the character string corresponding to the first key field in the MDNS message is parsed to obtain the device fingerprint feature;

在监听到所述DTLS报文的情况下,解析所述DTLS报文中的第二关键字段对应的字符串,得到所述设备指纹特征;When the DTLS message is intercepted, the character string corresponding to the second key field in the DTLS message is parsed to obtain the device fingerprint feature;

在监听到所述BROWSER报文的情况下,解析所述BROWSER报文中的第三关键字段对应的字符串,得到所述设备指纹特征。When the BROWSER message is monitored, the character string corresponding to the third key field in the BROWSER message is parsed to obtain the device fingerprint feature.

如此,针对不同报文,根据各个报文的特征进行解析,以使得能够成功获取到第一电子设备的设备指纹特征。In this way, different messages are parsed according to the characteristics of each message, so that the device fingerprint characteristics of the first electronic device can be successfully acquired.

作为本申请的一个示例,所述第一关键字段为name字段,所述第二关键字段为UDID字段,所述第三关键字段是command为Request Announcement(0x02)的报文的response computer name字段或者是command为Host Announcement(0x01)的报文的HostName字段。As an example of the present application, the first key field is the name field, the second key field is the UDID field, and the third key field is the response computer name field of the message whose command is Request Announcement (0x02) or the HostName field of the message whose command is Host Announcement (0x01).

作为本申请的一个示例,所述第一钩子为NF_BR_LOCAL_IN HOOK,所述第二钩子为NF_INET_LOCAL_IN HOOK。As an example of the present application, the first hook is NF_BR_LOCAL_IN HOOK, and the second hook is NF_INET_LOCAL_IN HOOK.

如此,在路由器已有的钩子中添加监控功能,可以在减少开发成本的同时,达到监控目标类型的报文的目的。In this way, adding monitoring functions to the existing hooks of the router can achieve the purpose of monitoring the target type of messages while reducing development costs.

作为本申请的一个示例,所述方法还包括:As an example of the present application, the method further includes:

响应于所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器,向所述第一电子设备发送NetBIOS探测报文;In response to the first electronic device re-accessing the router using the second MAC address information, sending a NetBIOS detection message to the first electronic device;

监听所述第一电子设备发送的NetBIOS响应报文。The NetBIOS response message sent by the first electronic device is monitored.

如此,如此,通过发送NetBIOS探测报文,使得路由器反馈NetBIOS响应报文,从而可以从NetBIOS响应报文中获得设备指纹特征。In this way, by sending a NetBIOS detection message, the router feeds back a NetBIOS response message, so that the device fingerprint feature can be obtained from the NetBIOS response message.

作为本申请的一个示例,所述在监听到所述目标类型的报文的情况下,从所监听到的报文中获取所述设备指纹特征,包括:As an example of the present application, in the case where the message of the target type is monitored, obtaining the device fingerprint feature from the monitored message includes:

在监听到所述NetBIOS响应报文的情况下,解析所述NetBIOS响应报文中的name字段对应的字符串,得到所述设备指纹特征。When the NetBIOS response message is monitored, the character string corresponding to the name field in the NetBIOS response message is parsed to obtain the device fingerprint feature.

如此,根据NetBIOS响应报文的特征,解析出NetBIOS响应报文中的name字段对应的字符串,从而可以得到设备指纹特征。In this way, according to the characteristics of the NetBIOS response message, the character string corresponding to the name field in the NetBIOS response message is parsed, so that the device fingerprint characteristics can be obtained.

作为本申请的一个示例,所述路由器包括数据采集模块、数据控制管理模块和业务配置模块:所述在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征,包括:As an example of the present application, the router includes a data acquisition module, a data control management module, and a service configuration module: when the first electronic device re-accesses the router using the second MAC address information, the device fingerprint feature is obtained according to the message exchanged between the first electronic device and the router, including:

在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,所述数据采集模块根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征;When the first electronic device re-accesses the router using the second MAC address information, the data acquisition module obtains the device fingerprint feature according to the message exchanged between the first electronic device and the router;

所述数据采集模块向所述数据控制管理模块发送所述设备指纹特征和所述第二MAC地址信息;The data acquisition module sends the device fingerprint feature and the second MAC address information to the data control management module;

根据所述设备指纹特征从所述第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息,包括:Querying corresponding MAC address information from the first mapping relationship according to the device fingerprint feature to obtain the first MAC address information includes:

所述数据控制管理模块根据所述设备指纹特征从所述第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息;The data control management module queries the corresponding MAC address information from the first mapping relationship according to the device fingerprint feature to obtain the first MAC address information;

在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息,包括:When the first MAC address information is different from the second MAC address information, modifying the first MAC address information in the service authority configuration information to the second MAC address information includes:

在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,所述数据控制管理模块向所述业务配置模块发送目标消息,所述目标消息中携带所述第一MAC地址信息和所述第二MAC地址信息;In a case where the first MAC address information is different from the second MAC address information, the data control management module sends a target message to the service configuration module, where the target message carries the first MAC address information and the second MAC address information;

所述业务配置模块根据所述第一MAC地址信息,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息。The service configuration module modifies the first MAC address information in the service authority configuration information into the second MAC address information according to the first MAC address information.

如此,通过多个模块的交互实现对业务权限配置信息中的第一MAC地址信息的修改,从而保证业务权限配置信息不失效。In this way, the first MAC address information in the service authority configuration information is modified through the interaction of multiple modules, thereby ensuring that the service authority configuration information is not invalid.

第二方面,提供了一种电子设备,包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述的设备管理的方法。In a second aspect, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the device management method described in the first aspect when executing the computer program.

第三方面,提供了一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行上述第一方面所述的设备管理的方法。In a third aspect, a computer-readable storage medium is provided, wherein instructions are stored in the computer-readable storage medium, and when the computer-readable storage medium is executed on a computer, the computer executes the device management method described in the first aspect.

第四方面,提供了一种包含指令的计算机程序产品,当其在计算机上运行时,使得计算机执行上述第一方面所述的设备管理的方法。In a fourth aspect, a computer program product comprising instructions is provided, which, when executed on a computer, enables the computer to execute the device management method described in the first aspect.

上述第二方面、第三方面和第四方面所获得的技术效果与上述第一方面中对应的技术手段获得的技术效果近似,在这里不再赘述。The technical effects obtained by the above-mentioned second aspect, third aspect and fourth aspect are similar to the technical effects obtained by the corresponding technical means in the above-mentioned first aspect, and will not be repeated here.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

图1是根据一示例性实施例示出的一种应用场景的示意图;FIG1 is a schematic diagram showing an application scenario according to an exemplary embodiment;

图2是根据另一示例性实施例示出的一种应用场景的示意图;FIG2 is a schematic diagram showing an application scenario according to another exemplary embodiment;

图3是根据一示例性实施例示出的一种路由器的结构示意图;FIG3 is a schematic diagram showing the structure of a router according to an exemplary embodiment;

图4是根据一示例性实施例示出的一种路由器的框架示意图;FIG4 is a schematic diagram showing a framework of a router according to an exemplary embodiment;

图5是根据一示例性实施例示出的一种第一映射关系的建立流程的示意图;FIG5 is a schematic diagram showing a process of establishing a first mapping relationship according to an exemplary embodiment;

图6是根据另一示例性实施例示出的一种路由器的框架示意图;FIG6 is a schematic diagram showing a framework of a router according to another exemplary embodiment;

图7是根据一示例性实施例示出的一种设备管理的方法流程示意图;FIG7 is a schematic flow chart of a method for device management according to an exemplary embodiment;

图8是根据一示例性实施例示出的一种电子设备的结构示意图;FIG8 is a schematic diagram showing the structure of an electronic device according to an exemplary embodiment;

图9是根据一示例性实施例示出的一种电子设备的软件系统的示意图。Fig. 9 is a schematic diagram showing a software system of an electronic device according to an exemplary embodiment.

具体实施方式DETAILED DESCRIPTION

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请的实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below in conjunction with the accompanying drawings.

应当理解的是,本申请提及的“多个”是指两个或两个以上。在本申请的描述中,除非另有说明,“/”表示或的意思,比如,A/B可以表示A或B;本文中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,比如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,为了便于清楚描述本申请的技术方案,采用了“第一”、“第二”等字样对功能和作用基本相同的相同项或相似项进行区分。本领域技术人员可以理解“第一”、“第二”等字样并不对数量和执行次序进行限定,并且“第一”、“第二”等字样也并不限定一定不同。It should be understood that the "multiple" mentioned in this application refers to two or more. In the description of this application, unless otherwise specified, "/" means or, for example, A/B can mean A or B; "and/or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and/or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in order to facilitate the clear description of the technical solution of this application, the words "first" and "second" are used to distinguish between the same or similar items with basically the same functions and effects. Those skilled in the art can understand that the words "first" and "second" do not limit the quantity and execution order, and the words "first" and "second" do not limit them to be different.

在本申请说明书中描述的参考“一个实施例”或“一些实施例”等意味着在本申请的一个或多个实施例中包括结合该实施例描述的特定特征、结构或特点。由此,在本说明书中的不同之处出现的语句“在一个实施例中”、“在一些实施例中”、“在其他一些实施例中”、“在另外一些实施例中”等不是必然都参考相同的实施例,而是意味着“一个或多个但不是所有的实施例”,除非是以其他方式另外特别强调。术语“包括”、“包含”、“具有”及它们的变形都意味着“包括但不限于”,除非是以其他方式另外特别强调。References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

路由器在家庭、商场、办公室等场景得到广泛应用,电子设备通过接入路由器可以实现各种上网业务。然而在一些场景中,用户通常需要对接入路由器的某个或某些电子设备的业务权限进行配置,以对这些电子设备的上网业务进行控制,如儿童上网保护、WiFi黑名单等业务。在业务权限配置的过程中,一般会在路由器中记录所要控制的电子设备的业务权限配置信息,业务权限配置信息用于指示该电子设备的MAC地址信息和业务权限之间的映射关系,譬如针对接入路由器的任意一个电子设备,若用户在路由器中配置了该电子设备的业务权限,则路由器记录该电子设备的MAC地址信息与所配置的业务权限之间的映射关系,所记录的该MAC地址信息通常是电子设备原有的MAC地址信息,或者说是电子设备出厂固化的MAC地址信息。如此,当电子设备向路由器进行业务请求时会携带自身的MAC地址信息,路由器根据该映射关系和业务请求中携带的MAC地址信息确定针对电子设备存在配置的业务权限后,根据所配置的业务权限来响应电子设备的业务请求,从而达到对电子设备的上网业务进行控制的目的。Routers are widely used in homes, shopping malls, offices and other scenes. Electronic devices can realize various Internet services by accessing routers. However, in some scenes, users usually need to configure the service permissions of one or some electronic devices connected to the router to control the Internet services of these electronic devices, such as children's Internet protection, WiFi blacklist and other services. In the process of configuring the service permissions, the service permission configuration information of the electronic device to be controlled is generally recorded in the router. The service permission configuration information is used to indicate the mapping relationship between the MAC address information of the electronic device and the service permissions. For example, for any electronic device connected to the router, if the user configures the service permissions of the electronic device in the router, the router records the mapping relationship between the MAC address information of the electronic device and the configured service permissions. The recorded MAC address information is usually the original MAC address information of the electronic device, or the MAC address information of the electronic device that is solidified at the factory. In this way, when the electronic device makes a service request to the router, it will carry its own MAC address information. After the router determines that there is a configured service permission for the electronic device based on the mapping relationship and the MAC address information carried in the service request, it responds to the service request of the electronic device according to the configured service permissions, thereby achieving the purpose of controlling the Internet service of the electronic device.

随着电子设备的广泛应用,设备厂商对用户隐私以及用户数据的安全性防护不断地加强,为此引入了随机MAC机制,使得电子设备在接WiFi网络时,使用随机产生的MAC地址信息接入路由器,而不是使用原有的MAC地址信息。如此,给用户带来了安全的同时,影响了路由器的上网控制业务,使得电子设备能够绕过上网控制业务,从而导致上网控制业务失效。With the widespread use of electronic devices, device manufacturers have continuously strengthened the protection of user privacy and user data security, and introduced a random MAC mechanism to enable electronic devices to use randomly generated MAC address information to access the router when connecting to the WiFi network, instead of using the original MAC address information. This not only brings security to users, but also affects the Internet access control service of the router, allowing electronic devices to bypass the Internet access control service, thus causing the Internet access control service to fail.

为此,本申请实施例提供了一种设备管理的方法,该方法可以在电子设备使用随机的MAC地址信息接入路由器后,将业务权限配置信息中的MAC地址信息修改后随机的MAC地址信息,以保证业务权限配置信息仍有效,从而解决因随机MAC导致上网控制业务失效的问题。To this end, an embodiment of the present application provides a device management method, which can modify the MAC address information in the service authority configuration information to the random MAC address information after the electronic device uses random MAC address information to access the router, so as to ensure that the service authority configuration information is still valid, thereby solving the problem of Internet access control service failure due to random MAC.

为了便于理解,接下来以接入路由器的电子设备是手机和平板电脑为例,对本申请实施例涉及的示例性的应用场景进行简单介绍。For ease of understanding, the following briefly introduces an exemplary application scenario involved in the embodiments of the present application by taking a mobile phone and a tablet computer as an example in which the electronic devices connected to the router are mobile phones and tablet computers.

平板电脑A和手机B均接入路由器L,其中平板电脑A使用MAC1接入路由器。当用户需要针对平板电脑A设置儿童上网保护时,可以在手机B中打开APP1,并在APP1中登录与路由器L绑定的账号,其中APP1是能够用于管理路由器L的应用程序,示例性地,APP1为智慧空间应用程序。如图1中的(a)图所示,在手机B通过APP1登录路由器L的账号后,显示路由器登录页面S1,路由器登录页面S1中包括路由器标识,用户可以点击路由器标识。如图1中的(b)图所示,响应于用户对路由器标识的点击操作,手机显示路由器管理页面S2,路由器管理页面S2中包括“儿童上网”选项,用户可以点击“儿童上网”选项。如图1中的(c)图所示,响应于用户对“儿童上网”选项的触发操作,手机显示儿童上网保护页面S3,儿童上网保护页面S3中包括“开启儿童保护”控件。当用户触发“开启儿童保护”控件时,如图1中的(d)图所示,响应于用户的该触发操作,手机B显示设备选择页面S4,设备选择页面S4中显示有路由器L中接入的两个手机,也即显示平板电脑A(Honor MagicPad13)和手机B(Honor Pro5),如此用户可以选择平板电脑A进行业务权限配置。响应于用户对平板电脑A的选择操作,如图1中的(e)图所示,手机B显示业务权限配置页面S5,如此,用户即可在业务权限配置页面S5中设置业务权限。譬如用户关闭“游戏”项对应的开关,相应地,手机B将该业务权限配置通知给路由器L,路由器L记录平板电脑A的MAC1和游戏禁止业务权限之间的映射关系,如此,当用户使用平板电脑A下载游戏应用包时,路由器L将禁止该业务请求,也即平板电脑A无法下载游戏应用包。Tablet A and mobile phone B are both connected to router L, where tablet A uses MAC1 to connect to the router. When the user needs to set up child Internet protection for tablet A, he can open APP1 in mobile phone B and log in to the account bound to router L in APP1, where APP1 is an application that can be used to manage router L. Exemplarily, APP1 is a smart space application. As shown in Figure (a) of Figure 1, after mobile phone B logs in to the account of router L through APP1, the router login page S1 is displayed. The router login page S1 includes a router logo, and the user can click the router logo. As shown in Figure (b) of Figure 1, in response to the user's click operation on the router logo, the mobile phone displays the router management page S2, and the router management page S2 includes a "child Internet access" option, and the user can click the "child Internet access" option. As shown in Figure (c) of Figure 1, in response to the user's triggering operation on the "child Internet access" option, the mobile phone displays the child Internet protection page S3, and the child Internet protection page S3 includes a "turn on child protection" control. When the user triggers the "Turn on child protection" control, as shown in Figure 1 (d), in response to the user's triggering operation, mobile phone B displays a device selection page S4, which displays two mobile phones connected to router L, that is, tablet computer A (Honor MagicPad13) and mobile phone B (Honor Pro5), so that the user can select tablet computer A for business permission configuration. In response to the user's selection operation on tablet computer A, as shown in Figure 1 (e), mobile phone B displays a business permission configuration page S5, so that the user can set business permissions in the business permission configuration page S5. For example, if the user turns off the switch corresponding to the "game" item, mobile phone B will notify router L of the business permission configuration accordingly, and router L will record the mapping relationship between tablet computer A's MAC1 and the game prohibition business permission. In this way, when the user uses tablet computer A to download the game application package, router L will prohibit the business request, that is, tablet computer A cannot download the game application package.

需要说明的是,上述是以在业务权限配置页面S5中设置禁止下载游戏应用包为例进行说明。在另一个示例中,用户还可以基于业务权限配置页面S5进行其他业务权限配置,譬如还可以进行黑名单设置,以设置不允许平板电脑A访问的网址,再如,用户还可以基于业务权限配置页面S5设置平板电脑A的可上网时间段,以及可上网时长等,本申请实施例对此不作详细介绍。It should be noted that the above is explained by setting the prohibition of downloading game application packages in the business permission configuration page S5 as an example. In another example, the user can also perform other business permission configurations based on the business permission configuration page S5, such as setting a blacklist to set websites that are not allowed to be accessed by the tablet computer A. For another example, the user can also set the time period and duration of the Internet access of the tablet computer A based on the business permission configuration page S5, which will not be described in detail in the embodiment of the present application.

请参见图2,在平板电脑A使用MAC1接入路由器L且用户进行业务权限配置后,路由器L记录MAC1与业务权限之间的映射关系。用户可以在平板电脑A中触发“忘记网络”,此时路由器L中仍记录MAC1与业务权限之间的映射关系。之后,用户可以触发平板电脑A重新接入路由器L,此时平板电脑A随机产生MAC2,然后使用MAC2接入路由器L,MAC2与MAC1不相同。该种情况下,本申请实施例提供的方法可以使得路由器L将业务权限配置信息中的MAC1修改为MAC2,也即路由器L记录MAC2与业务权限之间的映射关系。之后,当用户使用平板电脑A下载游戏应用包时,路由器L拒绝该业务请求,也即平板电脑A仍无法下载游戏应用包。Please refer to Figure 2. After tablet computer A uses MAC1 to access router L and the user configures the service permissions, router L records the mapping relationship between MAC1 and the service permissions. The user can trigger "Forget Network" in tablet computer A. At this time, router L still records the mapping relationship between MAC1 and the service permissions. Afterwards, the user can trigger tablet computer A to re-access router L. At this time, tablet computer A randomly generates MAC2, and then uses MAC2 to access router L. MAC2 is different from MAC1. In this case, the method provided in the embodiment of the present application can enable router L to modify MAC1 in the service permission configuration information to MAC2, that is, router L records the mapping relationship between MAC2 and the service permissions. Afterwards, when the user uses tablet computer A to download the game application package, router L rejects the service request, that is, tablet computer A still cannot download the game application package.

需要说明的是,图2中所述的随机MAC应用场景仅是示例性的,在另一个示例中,用户还可能通过其他方式使得平板电脑A在重新接入路由器L的情况下使用随机产生的MAC地址信息接入,本申请实施例对此不作限定。It should be noted that the random MAC application scenario described in Figure 2 is only exemplary. In another example, the user may also use other methods to enable the tablet computer A to use randomly generated MAC address information to access the router L when reconnecting to the router. The embodiment of the present application is not limited to this.

另外需要说明的是,上述应用场景仅是示例性地,不对本申请实施例提供的方法的应用构成限定。在另一个示例中,该方法还可以应用于其他基于MAC地址信息进行业务权限控制的场景,本申请实施例对此不作限定。It should also be noted that the above application scenarios are only exemplary and do not limit the application of the method provided in the embodiment of the present application. In another example, the method can also be applied to other scenarios of service authority control based on MAC address information, which is not limited in the embodiment of the present application.

还需要说明的是,上述是以接入路由器的电子设备是手机为例,在另一个示例中,接入路由器的电子设备还可能包括平板电脑、数码相机、桌面型、膝上型、手持计算机、笔记本电脑、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本、个人数字助理(personal digital assistant,PDA)、增强现实(augmented reality,AR)\虚拟现实(virtual reality,VR)设备等,本申请实施例对此不作限定。It should also be noted that the above is based on the example that the electronic device accessing the router is a mobile phone. In another example, the electronic device accessing the router may also include a tablet computer, a digital camera, a desktop, a laptop, a handheld computer, a notebook computer, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook, a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, etc., and the embodiments of the present application are not limited to this.

在介绍完本申请实施例涉及的应用场景后,接下来对本申请实施例涉及的路由器的结构进行介绍,请参见图3,图3是本申请实施例提供的一种路由器的结构示意图,路由器包括至少一个处理器301、通信总线302、存储器303以及至少一个通信接口304。After introducing the application scenarios involved in the embodiments of the present application, the structure of the router involved in the embodiments of the present application will be introduced next. Please refer to Figure 3, which is a structural diagram of a router provided in the embodiments of the present application. The router includes at least one processor 301, a communication bus 302, a memory 303 and at least one communication interface 304.

处理器301可以是微处理器(包括中央处理器(central processing unit,CPU)等)、特定应用集成电路(application-specific integrated circuit,ASIC),或者可以是一个或多个用于控制本申请方案程序执行的集成电路。The processor 301 may be a microprocessor (including a central processing unit (CPU) etc.), an application-specific integrated circuit (ASIC), or may be one or more integrated circuits for controlling the execution of the program of the present application.

通信总线302可包括一通路,用于在上述组件之间传送信息。The communication bus 302 may include a pathway for transmitting information between the above-mentioned components.

存储器303可以是只读存储器(read-only memory,ROM)、随机存取存储器(randomaccess memory,RAM)、电可擦可编程只读存储器(electrically erasable programmableread-Only memory,EEPROM)或者其它磁存储设备,或者是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由路由器存取的任何其它介质,但不限于此。存储器303可以是独立存在,并通过通信总线302与处理器301相连接。存储器303也可以和处理器301集成在一起。The memory 303 may be a read-only memory (ROM), a random access memory (RAM), an electrically erasable programmable read-only memory (EEPROM) or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by the router, but is not limited thereto. The memory 303 may exist independently and be connected to the processor 301 via the communication bus 302. The memory 303 may also be integrated with the processor 301.

通信接口304使用任何收发器一类的装置,用于与其它设备或通信网络通信。The communication interface 304 uses any device such as a transceiver for communicating with other devices or communication networks.

在具体实现中,作为一种实施例,处理器301可以包括一个或多个CPU,如图3中所示的CPU0和CPU1。In a specific implementation, as an embodiment, the processor 301 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 3 .

在具体实现中,作为一种实施例,路由器可以包括多个处理器,如图3中所示的处理器301和处理器305。这些处理器中的每一个可以是一个单核处理器,也可以是一个多核处理器。这里的处理器可以指一个或多个设备、电路、和/或用于处理数据(如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the router may include multiple processors, such as processor 301 and processor 305 shown in FIG3. Each of these processors may be a single-core processor or a multi-core processor. The processor here may refer to one or more devices, circuits, and/or processing cores for processing data (such as computer program instructions).

作为一种实施例,路由器还可以包括输出设备306和输入设备307。输出设备306和处理器301通信,可以以多种方式来显示信息。例如,输出设备306可以是液晶显示器(liquid crystal display,LCD)、发光二级管(light emitting diode,LED)显示设备等。输入设备307和处理器301通信,可以以多种方式接收用户的输入。例如,输入设备307可以是鼠标、键盘、触摸屏设备或传感设备等。As an embodiment, the router may further include an output device 306 and an input device 307. The output device 306 communicates with the processor 301 and may display information in a variety of ways. For example, the output device 306 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, etc. The input device 307 communicates with the processor 301 and may receive user input in a variety of ways. For example, the input device 307 may be a mouse, a keyboard, a touch screen device, or a sensor device, etc.

其中,存储器303用于存储执行本申请方案的程序代码310,处理器301用于执行存储器303中存储的程序代码310。该路由器可以通过处理器301以及存储器303中的程序代码310,来实现下文各个实施例提供的方法。The memory 303 is used to store the program code 310 for executing the solution of the present application, and the processor 301 is used to execute the program code 310 stored in the memory 303. The router can implement the methods provided in the following embodiments through the processor 301 and the program code 310 in the memory 303.

请参见图4,图4是根据一示例性实施例示出的一种路由器的框架示意图,路由器包括数据采集模块、数据控制管理模块和业务配置模块。Please refer to Fig. 4, which is a schematic diagram of a framework of a router according to an exemplary embodiment. The router includes a data acquisition module, a data control management module and a service configuration module.

作为本申请的一个示例,数据采集模块用于监控携带有设备指纹特征的报文,并解析出设备指纹特征和第一电子设备的MAC地址信息,然后上报给数据控制管理模块,其中,第一电子设备的设备指纹特征用于唯一地标识第一电子设备,示例性地,设备指纹特征包括设备标识信息、设备型号和设备指纹特征,设备标识信息可以包括设备名称和/或设备ID。作为示例而非限定,如图4所示,数据采集模块包括第一模块和第二模块,数据采集模块分别通过第一模块和第二模块针对不同类型的报文进行监控。As an example of the present application, the data acquisition module is used to monitor messages carrying device fingerprint features, and parse the device fingerprint features and the MAC address information of the first electronic device, and then report them to the data control management module, wherein the device fingerprint features of the first electronic device are used to uniquely identify the first electronic device, and exemplarily, the device fingerprint features include device identification information, device model and device fingerprint features, and the device identification information may include the device name and/or device ID. As an example and not a limitation, as shown in FIG4 , the data acquisition module includes a first module and a second module, and the data acquisition module monitors different types of messages through the first module and the second module respectively.

数据控制管理模块用于建立第一电子设备的设备指纹特征与MAC地址信息之间的第一映射关系,并对该第一映射关系进行管理,另外当确定第一电子设备的MAC地址信息发生变化时通知业务配置模块。作为示例而非限定,数据控制管理模块包括数据收集模块和地址管理模块,数据收集模块用于建立并管理第一映射关系,地址管理模块用于在第一电子设备的MAC地址信息发生变化时通知业务配置模块。The data control management module is used to establish a first mapping relationship between the device fingerprint feature of the first electronic device and the MAC address information, and manage the first mapping relationship, and notify the service configuration module when it is determined that the MAC address information of the first electronic device has changed. As an example but not a limitation, the data control management module includes a data collection module and an address management module, the data collection module is used to establish and manage the first mapping relationship, and the address management module is used to notify the service configuration module when the MAC address information of the first electronic device has changed.

业务配置模块用于配置的第一电子设备的业务权限,并根据所配置的业务权限处理第一电子设备的业务请求。The service configuration module is used to configure the service authority of the first electronic device and process the service request of the first electronic device according to the configured service authority.

进一步地,请参见图4,路由器还包括设备接入管理模块,设备接入管理模块用于为第一电子设备分配IP地址信息,另外,还用于在第一电子设备接入路由器后广播接入消息,接入消息中包括与第一电子设备相关的接入信息,譬如包括第一电子设备的IP地址信息和当前接入路由器所使用的MAC地址信息等。Further, referring to FIG. 4 , the router also includes a device access management module, which is used to allocate IP address information to the first electronic device. In addition, the device access management module is also used to broadcast an access message after the first electronic device accesses the router, and the access message includes access information related to the first electronic device, such as the IP address information of the first electronic device and the MAC address information currently used to access the router.

作为本申请的一个示例,数据采集模块、以及数据控制管理模块中的第一模块运行于内核空间中;数据控制管理模块中的第二模块、以及设备接入管理模块运行于用户空间中。内核空间是内核的运行空间,可以执行任意命令,调用系统的一切资源;用户空间是一些常规进程的运行空间,只能执行简单的运算,不能直接调用系统资源,需要通过系统接口向内核发出指令。由于内核空间和用户空间是相互独立的,所以即使常规进程崩溃了,内核也不会受到影响,也即在本申请实施例中,解析设备指纹特征和电子设备的MAC地址信息,与建立第一映射关系和管理第一映射关系之间几乎互不影响。As an example of the present application, the data acquisition module and the first module in the data control management module run in the kernel space; the second module in the data control management module and the device access management module run in the user space. The kernel space is the operating space of the kernel, which can execute any command and call all resources of the system; the user space is the operating space of some conventional processes, which can only perform simple operations, cannot directly call system resources, and needs to issue instructions to the kernel through the system interface. Since the kernel space and the user space are independent of each other, even if the conventional process crashes, the kernel will not be affected, that is, in the embodiment of the present application, parsing the device fingerprint features and the MAC address information of the electronic device has almost no influence on establishing the first mapping relationship and managing the first mapping relationship.

在上述实施例中的基础上,接下来对本申请实施例提供的方法进行介绍。本申请实施例提供的管理设备的方法是基于第一映射关系对第一电子设备的MAC地址信息进行管理,从而使得业务权限配置信息中的MAC地址信息与第一电子设备当前接入路由器使用的MAC地址信息匹配,从而保证所设置业务权限配置信息不失效。其中第一映射关系为第一电子设备的设备指纹特征与当前使用的MAC地址信息之间的映射,为了便于理解,接下来结合图5对第一映射关系的建立过程进行介绍:On the basis of the above embodiments, the method provided by the embodiment of the present application is introduced below. The method for managing devices provided by the embodiment of the present application is to manage the MAC address information of the first electronic device based on the first mapping relationship, so that the MAC address information in the service authority configuration information matches the MAC address information currently used by the first electronic device to access the router, thereby ensuring that the set service authority configuration information is not invalid. The first mapping relationship is the mapping between the device fingerprint feature of the first electronic device and the currently used MAC address information. For ease of understanding, the process of establishing the first mapping relationship is introduced below in conjunction with Figure 5:

请参考图5,图5是根据一示例性实施例示出的一种第一映射关系的建立方法的流程示意图。本申请实施例以路由器与第一电子设备交互实现该方法为例进行说明,进一步地,路由器通过上述多个模块与第一电子设备交互实现。示例性地,该方法可以包括如下部分或者全部内容:Please refer to Figure 5, which is a flow chart of a method for establishing a first mapping relationship according to an exemplary embodiment. The embodiment of the present application takes the method implemented by the interaction between the router and the first electronic device as an example. Further, the router interacts with the first electronic device through the above-mentioned multiple modules. Exemplarily, the method may include some or all of the following contents:

步骤501:第一电子设备使用第一MAC地址信息接入路由器。Step 501: A first electronic device accesses a router using first MAC address information.

第一MAC地址信息是第一电子设备本次接入路由器使用的MAC地址信息。在一种可能的情况下,第一MAC地址信息是第一电子设备原有的MAC地址信息,也即是第一电子设备出厂固定设置的MAC地址信息,譬如在第一电子设备首次接入路由器的情况下,使用自身原有的MAC地址信息进行接入。在另一种可能的情况下,第一MAC地址信息是第一电子设备本次接入路由器时随机产生的MAC地址信息。本申请实施例以第一MAC地址信息是第一电子设备原有的MAC地址信息为例进行说明。The first MAC address information is the MAC address information used by the first electronic device to access the router this time. In one possible case, the first MAC address information is the original MAC address information of the first electronic device, that is, the MAC address information fixedly set by the first electronic device when it leaves the factory. For example, when the first electronic device accesses the router for the first time, it uses its original MAC address information to access. In another possible case, the first MAC address information is the MAC address information randomly generated when the first electronic device accesses the router this time. The embodiment of the present application is described by taking the example that the first MAC address information is the original MAC address information of the first electronic device.

在第一电子设备使用第一MAC地址信息请求接入路由器时,路由器搭建与第一电子设备之间的链路,之后,通过设备接入管理模块为第一电子设备分配IP地址信息,使得第一电子设备成功接入路由器。When the first electronic device uses the first MAC address information to request access to the router, the router establishes a link with the first electronic device, and then allocates IP address information to the first electronic device through the device access management module, so that the first electronic device successfully accesses the router.

需要说明的是,本申请实施例中所述的第一电子设备接入路由器是指第一电子设备已连接路由器的WiFi网络,或者说,路由器已为第一电子设备分配网络协议(InternetProtocol,IP)地址信息,第一电子设备能够通过路由器进行上网。It should be noted that the first electronic device accessing the router described in the embodiment of the present application means that the first electronic device has been connected to the WiFi network of the router, or in other words, the router has allocated Internet Protocol (IP) address information to the first electronic device, and the first electronic device can access the Internet through the router.

步骤502:设备接入管理模块向数据控制管理模块发送接入消息,接入消息中携带第一电子设备的接入信息。Step 502: The device access management module sends an access message to the data control management module. The access message carries access information of the first electronic device.

在一个示例中,第一电子设备的接入信息包括第一MAC地址信息和IP地址信息。In one example, the access information of the first electronic device includes first MAC address information and IP address information.

也即在确定第一电子设备成功接入路由器后,设备接入管理模块可以向数据控制管理模块发送接入消息,以通知设备控制管理模块有第一电子设备接入,并将第一电子设备的接入信息通知给设备控制管理模块。That is, after determining that the first electronic device has successfully accessed the router, the device access management module can send an access message to the data control management module to notify the device control management module that the first electronic device has accessed, and notify the device control management module of the access information of the first electronic device.

在一个示例中,第一MAC地址信息可以由内核空间通过netlink上报给设备接入管理模块。其中netlink是一种进程间通信(Inter Process Commumicate,IPC)机制,它是一种用于内核空间与用户空间通信的机制。In one example, the first MAC address information may be reported by the kernel space to the device access management module through netlink, wherein netlink is an inter-process communication (IPC) mechanism, which is a mechanism for communication between the kernel space and the user space.

步骤503:数据控制管理模块拉起第二模块,并向第二模块发送接入信息。Step 503: The data control management module pulls up the second module and sends access information to the second module.

在一个示例中,第二模块为netbiosc进程。In one example, the second module is a netbiosc process.

也即数据控制管理模块在接收到接入消息后,拉起第二模块,并将当前接入的第一电子设备的接入信息发送给第二模块。作为一种示例,数据控制管理模块可以将第一电子设备的接入信息按照预置的规则拼接成命令参数,然后将拼接后的命令参数发送给第二模块。That is, after receiving the access message, the data control management module pulls up the second module and sends the access information of the currently connected first electronic device to the second module. As an example, the data control management module can splice the access information of the first electronic device into command parameters according to preset rules, and then send the spliced command parameters to the second module.

步骤504:第二模块基于接入信息,向第一电子设备发送NetBIOS探测报文。Step 504: The second module sends a NetBIOS detection message to the first electronic device based on the access information.

作为本申请的一个示例,第二模块基于IP地址信息和第一MAC地址信息,向第一电子设备发送NetBIOS探测报文,以请求获取第一电子设备的设备指纹特征等信息。As an example of the present application, the second module sends a NetBIOS detection message to the first electronic device based on the IP address information and the first MAC address information to request information such as device fingerprint features of the first electronic device.

示例性地,NetBIOS探测报文的部分内容如下:For example, part of the content of the NetBIOS detection message is as follows:

>Intrnet Protocol Version 4,Src:192.168.6.111,Dst:192.168.6.47>Intrnet Protocol Version 4,Src:192.168.6.111,Dst:192.168.6.47

>User Datagram Protocol,Src Port:137,Dst Port:137>User Datagram Protocol,Src Port:137,Dst Port:137

∨NetBIOS Name Service∨NetBIOS Name Service

Transaction ID:0xfelaTransaction ID:0xfela

>Flags:0x000,Opcode:Name query>Flags:0x000,Opcode:Name query

步骤505:第一电子设备接收NetBIOS探测报文后,基于自身的设备指纹特征和第一MAC地址信息,生成NetBIOS响应报文。Step 505: After receiving the NetBIOS detection message, the first electronic device generates a NetBIOS response message based on its own device fingerprint feature and the first MAC address information.

在一个示例中,第一电子设备通过netbios services进程接收NetBIOS探测报文。In one example, the first electronic device receives a NetBIOS detection message through a netbios services process.

步骤506:第一电子设备向第二模块发送NetBIOS响应报文。Step 506: The first electronic device sends a NetBIOS response message to the second module.

也即第一电子设备在接收NetBIOS探测报文后,将自身的设备指纹特征和第一MAC地址信息通过NetBIOS响应报文向路由器进行响应回复。作为一个示例,第一电子设备通过netbios services进程,向第二模块发送NetBIOS响应报文。That is, after receiving the NetBIOS detection message, the first electronic device responds to the router with its own device fingerprint and the first MAC address information via a NetBIOS response message. As an example, the first electronic device sends a NetBIOS response message to the second module via a netbios services process.

步骤507:第二模块解析NetBIOS响应报文中的name字段对应的字符串,得到设备指纹特征。Step 507: The second module parses the character string corresponding to the name field in the NetBIOS response message to obtain the device fingerprint feature.

第二模块监听到NetBIOS响应报文后,解析NetBIOS响应报文中的name字段,从而可以获取到设备指纹特征。示例性地,NetBIOS响应报文中包括name字段的报文内容如下:After the second module monitors the NetBIOS response message, it parses the name field in the NetBIOS response message, thereby obtaining the device fingerprint feature. For example, the message content including the name field in the NetBIOS response message is as follows:

>Intrnet Protocol Version 4,Src:192.168.6.47,Dst:192.168.6.111>Intrnet Protocol Version 4,Src:192.168.6.47,Dst:192.168.6.111

>User Datagram Protocol,Src Port:137,Dst Port:137>User Datagram Protocol,Src Port:137,Dst Port:137

∨NetBIOS Name Service∨NetBIOS Name Service

Transaction ID:0xfelaTransaction ID: 0xfela

>Flags:0x8400,Response,Opcode:Name query,Authoritative,Reply code:Noerror>Flags:0x8400,Response,Opcode:Name query,Authoritative,Reply code:Noerror

......

∨Answers∨Answers

∨...∨...

∨Name flags:0x8400,Name type,ONT:B-node,Name is active∨Name flags:0x8400,Name type,ONT:B-node,Name is active

Name:LAPTOP-NF89D0NP<00>(workstation/Redirector)Name:LAPTOP-NF89D0NP<00>(workstation/Redirector)

该种情况下,第二模块通过对NetBIOS响应报文中的name字段进行解析后,可以得到字符串LAPTOP-NF89D0NP,该字符串即为第一电子设备的设备指纹特征。In this case, the second module can obtain the character string LAPTOP-NF89D0NP after parsing the name field in the NetBIOS response message, and the character string is the device fingerprint feature of the first electronic device.

另外,由于在报文传输过程中,第一电子设备会在报文的外层封装MAC地址信息等信息,如上述报文中的Intrnet Protocol Version 4,Src:192.168.6.47,Dst:192.168.6.111即为封装的MAC地址信息,从而将报文打包成数据帧,所以,通过对监控到的NetBIOS响应报文(也即数据帧)进行解析后,可以获得第一电子设备的第一MAC地址信息,譬如第一MAC地址信息为192.168.6.47。In addition, during the message transmission process, the first electronic device will encapsulate MAC address information and other information in the outer layer of the message, such as Intrnet Protocol Version 4, Src:192.168.6.47, Dst:192.168.6.111 in the above message, which is the encapsulated MAC address information, thereby packaging the message into a data frame. Therefore, by parsing the monitored NetBIOS response message (that is, the data frame), the first MAC address information of the first electronic device can be obtained, for example, the first MAC address information is 192.168.6.47.

步骤508:第二模块向数据控制管理模块发送设备指纹特征和第一MAC地址信息。Step 508: The second module sends the device fingerprint feature and the first MAC address information to the data control management module.

第二模块解析出第一电子设备的设备指纹特征后,将第一电子设备的设备指纹特征和第一MAC地址信息上报给数据控制管理模块,其中第一MAC地址信息可以是从NetBIOS响应报文中解析得到。After parsing the device fingerprint feature of the first electronic device, the second module reports the device fingerprint feature and the first MAC address information of the first electronic device to the data control management module, wherein the first MAC address information can be parsed from the NetBIOS response message.

步骤509:数据控制管理模块基于设备指纹特征和第一MAC地址信息建立第一映射关系。Step 509: The data control management module establishes a first mapping relationship based on the device fingerprint feature and the first MAC address information.

也即数据控制管理模块将设备指纹特征与第一MAC地址信息进行关联。That is, the data control management module associates the device fingerprint feature with the first MAC address information.

步骤510:数据控制管理模块将第一映射关系存储至数据库中。Step 510: The data control management module stores the first mapping relationship in the database.

需要说明的是,步骤502至步骤510是一个可选实施例,在另一个示例中,第一电子设备在接入路由器后,路由器与第一电子设备之间也可能不进行NetBIOS报文交互。It should be noted that step 502 to step 510 is an optional embodiment. In another example, after the first electronic device is connected to the router, the router and the first electronic device may not perform NetBIOS message interaction.

步骤511:在第一电子设备接入路由器的情况下,第一模块监控属于目标类型的报文。Step 511: When the first electronic device is connected to the router, the first module monitors messages belonging to the target type.

目标类型的报文是包括设备指纹特征的报文,作为本申请的一个示例,目标类型的报文包括多播(multicast Domain Name System,MDNS)报文、数据报传输层安全性(Datagram Transport Layer Security,DTLS)报文和BROWSER报文。The target type of message is a message including a device fingerprint feature. As an example of the present application, the target type of message includes a multicast Domain Name System (MDNS) message, a datagram transport layer security (DTLS) message, and a BROWSER message.

通常情况下,第一电子设备接入路由器后会根据业务需求与路由器进行一些报文交互,且在第一电子设备的种类和品牌不同的情况下,发送的报文也不同。在一个示例中,在第一电子设备是电脑(window)类或者手机类的电子设备的情况下,某些厂商的第一电子设备接入路由器后,可能会向路由器发送MDNS报文,以通过MDNS报文将第一电子设备自身的通信信息通知给接入同一局域网内的其他电子设备,譬如通信信息包括第一电子设备的IP地址信息和设备名称等,从而便于其他电子设备基于该通信信息能够发现第一电子设备,进而在需要的情况下能够与第一电子设备进行通信。在另一个示例中,在第一电子设备是手机类或者电脑类的电子设备的情况下,一些厂商的第一电子设备接入路由器后,还可能会向路由器发送DTLS报文,以通过DTLS报文实现与其他电子设备相互发现,从而使得第一电子设备在局域网内与其他电子设备建立通信。此外,在第一电子设备是电脑类的电子设备的情况下,某些厂商的第一电子设备接入路由器后,还可能会向路由器发送BROWSER报文,以通过BROWSER报文与其他电子设备交互信息,譬如该信息包括接入信息、操作系统版本、域名、机器名等。Normally, after the first electronic device is connected to the router, it will interact with the router through some messages according to business needs, and the messages sent are different when the type and brand of the first electronic device are different. In one example, when the first electronic device is a computer (window) or mobile phone type electronic device, after the first electronic device of some manufacturers is connected to the router, it may send an MDNS message to the router to notify the communication information of the first electronic device itself to other electronic devices connected to the same local area network through the MDNS message, such as the communication information includes the IP address information and device name of the first electronic device, so that other electronic devices can find the first electronic device based on the communication information, and then communicate with the first electronic device when necessary. In another example, when the first electronic device is a mobile phone or computer type electronic device, after the first electronic device of some manufacturers is connected to the router, it may also send a DTLS message to the router to achieve mutual discovery with other electronic devices through the DTLS message, so that the first electronic device can establish communication with other electronic devices in the local area network. In addition, when the first electronic device is a computer-type electronic device, after the first electronic device of certain manufacturers is connected to the router, it may also send a BROWSER message to the router to exchange information with other electronic devices through the BROWSER message, for example, the information includes access information, operating system version, domain name, machine name, etc.

由此可见,在第一电子设备是不同类型、不同厂商的电子设备的情况下,第一电子设备接入路由器后发送的报文不相同。基于此,由于第一电子设备接入路由器发送哪种报文是不确定的,也即路由器无法确定第一电子设备接入后会发送目标类型中哪种类型的报文,所以在第一电子设备接入路由器后,路由器通过第一模块同时监听目标类型中的所有类型的报文,也即同时监听MDNS报文、DTLS报文和BROWSER报文,以便于第一电子设备无论发送该三种类型中哪种类型的报文,第一模块均能够监控到。It can be seen that when the first electronic device is an electronic device of a different type and a different manufacturer, the message sent by the first electronic device after accessing the router is different. Based on this, since it is uncertain what kind of message the first electronic device sends after accessing the router, that is, the router cannot determine which type of message of the target type the first electronic device will send after accessing, after the first electronic device accesses the router, the router simultaneously monitors all types of messages of the target type through the first module, that is, it simultaneously monitors MDNS messages, DTLS messages, and BROWSER messages, so that no matter which type of message of the three types is sent by the first electronic device, the first module can monitor it.

作为本申请的一个示例,第一模块监控属于目标类型的报文的具体实现包括:第一模块分别通过第一钩子和第二钩子监听目标类型的报文,其中第一钩子用于监听MDNS报文,第二钩子用于监听DTLS报文和BROWSER报文。As an example of the present application, the specific implementation of the first module monitoring the messages belonging to the target type includes: the first module monitors the messages of the target type through the first hook and the second hook respectively, where the first hook is used to monitor the MDNS messages, and the second hook is used to monitor the DTLS messages and the BROWSER messages.

在一个示例中,第一钩子和第二钩子是路由器的网桥中的两个钩子,譬如如图6所示,第一钩子为NF_BR_LOCAL_IN HOOK,第二钩子为NF_INET_LOCAL_IN HOOK。也即可以分别在NF_BR_LOCAL_IN HOOK和NF_INET_LOCAL_IN HOOK中增加对目标类型的报文的监控功能。如此,在减少开发的同时,达到了报文监控的目的。In one example, the first hook and the second hook are two hooks in the bridge of the router. For example, as shown in FIG6 , the first hook is NF_BR_LOCAL_IN HOOK and the second hook is NF_INET_LOCAL_IN HOOK. That is, the monitoring function of the target type of message can be added to NF_BR_LOCAL_IN HOOK and NF_INET_LOCAL_IN HOOK respectively. In this way, the purpose of message monitoring is achieved while reducing development.

请参考图6,NF_BR_LOCAL_IN HOOK处于内核的链路层(link layer),NF_INET_LOCAL_IN HOOK处于内核的网络层(network layer)。Please refer to Figure 6, NF_BR_LOCAL_IN HOOK is in the link layer of the kernel, and NF_INET_LOCAL_IN HOOK is in the network layer of the kernel.

需要说明的是,步骤511与步骤502至步骤510之间没有严格的先后执行顺序。It should be noted that there is no strict execution order between step 511 and steps 502 to 510 .

步骤512:第一模块在监控到属于目标类型的报文的情况下,解析监控到的报文,以获得设备指纹特征。Step 512: When the first module monitors a message belonging to the target type, it analyzes the monitored message to obtain a device fingerprint feature.

如前文所述,第一电子设备向路由器发送报文之前,会将报文打包成数据帧,并在数据帧中携带第一MAC地址信息、端口号、协议类型等信息,然后将数据帧发送给路由器。相应地,路由器通过第一模块接收到数据帧后,可以从数据帧中解析出第一MAC地址信息。并且,第一模块可以从数据帧中解析出端口号和协议类型,从而可以根据端口号和协议类型确定报文的类型。As described above, before the first electronic device sends a message to the router, it packages the message into a data frame, carries the first MAC address information, port number, protocol type and other information in the data frame, and then sends the data frame to the router. Accordingly, after the router receives the data frame through the first module, the first MAC address information can be parsed from the data frame. In addition, the first module can parse the port number and protocol type from the data frame, so that the type of the message can be determined based on the port number and protocol type.

作为本申请的一个示例,第一模块在监听到报文,根据端口号和协议信息确定报文的类型属于目标类型的情况下,按照当前所接收的报文的类型对应的解析规则解析该报文,以获取第一电子设备的设备指纹特征。As an example of the present application, when the first module monitors a message and determines that the type of the message belongs to the target type based on the port number and protocol information, the first module parses the message according to the parsing rules corresponding to the type of the currently received message to obtain the device fingerprint characteristics of the first electronic device.

其中,不同类型的报文对应的解析规则一般不相同,目标类型中的各种类型的报文对应的解析规则可以根据需求进行设置,具体地,可以包括如下几种可能的情况:Among them, the parsing rules corresponding to different types of messages are generally different. The parsing rules corresponding to various types of messages in the target type can be set according to needs. Specifically, the following possible situations can be included:

在一种可能的情况下,第一电子设备在接入路由器后向路由器发送MDNS报文,该种情况下,第一模块会通过NF_BR_LOCAL_IN HOOK监听到MDNS报文,之后,第一模块通过NF_BR_LOCAL_IN HOOK解析监听到的MDNS报文中的Queries区域的第一关键字段对应的字符串,以确定第一电子设备的设备指纹特征。In one possible case, the first electronic device sends an MDNS message to the router after accessing the router. In this case, the first module will monitor the MDNS message through NF_BR_LOCAL_IN HOOK. After that, the first module will parse the string corresponding to the first key field in the Queries area of the monitored MDNS message through NF_BR_LOCAL_IN HOOK to determine the device fingerprint feature of the first electronic device.

其中,第一关键字段对应的字符串包括设备指纹特征。在一个示例中,第一关键字段为name字段。示例性地,监听到的来自第一电子设备的MDNS报文中的部分内容如下:The character string corresponding to the first key field includes the device fingerprint feature. In one example, the first key field is the name field. Exemplarily, part of the content of the MDNS message monitored from the first electronic device is as follows:

∨Multicast Domain Name System(query)∨Multicast Domain Name System(query)

∨Queries∨Queries

∨s00013130.local:type ANY,class IN,“QM”question∨s00013130.local:type ANY,class IN,"QM"question

Name:s00013130.localName:s00013130.local

该种情况下,第一模块可以通过NF_BR_LOCAL_IN HOOK遍历MDNS报文中的Queries区域,以查找Queries区域的name字段,然后解析出name字段对应的字符串,譬如解析出的字符串为s00013130.local,将解析出的字符串确定为第一电子设备的设备指纹特征,也即可以确定第一电子设备的设备指纹特征为“s00013130.local”。In this case, the first module can traverse the Queries area in the MDNS message through the NF_BR_LOCAL_IN HOOK to find the name field in the Queries area, and then parse the string corresponding to the name field. For example, the parsed string is s00013130.local, and the parsed string is determined as the device fingerprint feature of the first electronic device, that is, the device fingerprint feature of the first electronic device can be determined as "s00013130.local".

在另一种可能的情况下,第一电子设备接入路由器后向路由器发送DTLS报文,该种情况下,第一模块会通过NF_INET_LOCAL_IN HOOK监听到DTLS报文。之后,第一模块通过NF_INET_LOCAL_IN HOOK解析DTLS报文中的第二关键字段对应的字符串,得到第一电子设备的设备指纹特征。其中第二关键字段是与设备指纹特征关联的字段。在一个示例中,第二关键字段为UDID字段。In another possible case, after the first electronic device accesses the router, it sends a DTLS message to the router. In this case, the first module will monitor the DTLS message through NF_INET_LOCAL_IN HOOK. After that, the first module parses the string corresponding to the second key field in the DTLS message through NF_INET_LOCAL_IN HOOK to obtain the device fingerprint feature of the first electronic device. The second key field is a field associated with the device fingerprint feature. In one example, the second key field is a UDID field.

示例性地,监听到的来自第一电子设备的DTLS报文中的部分内容如下:Exemplarily, part of the monitored DTLS message from the first electronic device is as follows:

P...=.192.168.6.255..device_discover.{“deviceID”:”{\”UDID\”:\”F02C4E4236FA24888\”}”,”devicename”:”HONOR 50Pro”,”type”:14,”hicomversion”:”3.2.0.0”,”mode”:1,”deviceHash”:”0”,”serviceData”:”EID:0,gId:B7,...}”P...=.192.168.6.255..device_discover.{"deviceID":"{\"UDID\":\"F02C4E4236FA24888\"}","devicename":"HONOR 50Pro","type":14," hicomversion":"3.2.0.0","mode":1,"deviceHash":"0","serviceData":"EID:0,gId:B7,...}"

该种情况下,第一模块通过NF_INET_LOCAL_IN HOOK解析DTLS报文中的UDID字段对应的字符串,也即解析出”UDID”字段对应的”F02C4E4236FA24888”字符串,之后,可以将该字符串确定为第一电子设备的设备指纹特征,也即可以确定第一电子设备的设备指纹特征为“F02C4E4236FA24888”。In this case, the first module parses the string corresponding to the UDID field in the DTLS message through NF_INET_LOCAL_IN HOOK, that is, parses the "F02C4E4236FA24888" string corresponding to the "UDID" field, and then determines the string as the device fingerprint feature of the first electronic device, that is, determines the device fingerprint feature of the first electronic device as "F02C4E4236FA24888".

在又一种可能的情况下,第一电子设备在接入路由器后向路由器发送BROWSER报文,该种情况下,第一模块会通过NF_INET_LOCAL_IN HOOK监听到BROWSER报文。之后,第一模块通过NF_INET_LOCAL_IN HOOK解析BROWSER报文中的第三关键字段对应的字符串,得到确定第一电子设备的设备指纹特征。其中第三关键字段是与设备指纹特征关联的字段。In another possible case, the first electronic device sends a BROWSER message to the router after accessing the router. In this case, the first module will monitor the BROWSER message through the NF_INET_LOCAL_IN HOOK. After that, the first module parses the string corresponding to the third key field in the BROWSER message through the NF_INET_LOCAL_IN HOOK to obtain the device fingerprint feature of the first electronic device. The third key field is a field associated with the device fingerprint feature.

在一个示例中,第三关键字段是command为Request Announcement(0x02)的报文的response computer name字段,或者,第三关键字段是command为Host Announcement(0x01)的报文的Host Name字段。In an example, the third key field is the response computer name field of a message whose command is Request Announcement (0x02), or the third key field is the Host Name field of a message whose command is Host Announcement (0x01).

示例性地,监听到的来自第一电子设备的BROWSER报文中的部分内容如下:For example, part of the monitored BROWSER message from the first electronic device is as follows:

>Ethernet II,Src:0e:89:c1:15:fc:25(0e:89:c1:15:fc:25),Dst:Broadcast(ff:ff:ff:ff:ff:ff)>Ethernet II,Src:0e:89:c1:15:fc:25(0e:89:c1:15:fc:25),Dst:Broadcast(ff:ff:ff:ff:ff:ff)

>Internet Protocol Version 4,Src:192.168.3.13,Dst:192.168.3.255>Internet Protocol Version 4,Src:192.168.3.13,Dst:192.168.3.255

>User Datagram Protocol,Src Port:138,Dst Port:138>User Datagram Protocol,Src Port:138,Dst Port:138

>NetBIOSDatagram Service>NetBIOSDatagram Service

∨Microsoft Windows Browser Protoclo∨Microsoft Windows Browser Protoclo

Command:Requst Announcement(0x02)Command:Requst Announcement(0x02)

Unused flags:0x00Unused flags:0x00

Response Computer Name:LAPTOP-NF89D0NPResponse Computer Name:LAPTOP-NF89D0NP

该种情况下,第一模块通过NF_INET_LOCAL_IN HOOK解析command为RequestAnnouncement(0x02)的报文的response computer name字段对应的字符串,得到字符串LAPTOP-NF89D0NP,第一模块将得到的字符串确定为第一电子设备的设备指纹特征,也即确定第一电子设备的设备指纹特征为LAPTOP-NF89D0NP。In this case, the first module parses the string corresponding to the response computer name field of the message whose command is RequestAnnouncement (0x02) through NF_INET_LOCAL_IN HOOK to obtain the string LAPTOP-NF89D0NP. The first module determines the obtained string as the device fingerprint feature of the first electronic device, that is, determines that the device fingerprint feature of the first electronic device is LAPTOP-NF89D0NP.

再如,监听到的来自第一电子设备的BROWSER报文中的部分内容如下:For another example, part of the content of the BROWSER message monitored from the first electronic device is as follows:

>Ethernet II,Src:0e:89:c1:15:fc:25(0e:89:c1:15:fc:25),Dst:Broadcast(ff:ff:ff:ff:ff:ff)>Ethernet II,Src:0e:89:c1:15:fc:25(0e:89:c1:15:fc:25),Dst:Broadcast(ff:ff:ff:ff:ff:ff)

>Internet Protocol Version 4,Src:192.168.3.13,Dst:192.168.3.255>Internet Protocol Version 4,Src:192.168.3.13,Dst:192.168.3.255

>User Datagram Protocol,Src Port:138,Dst Port:138>User Datagram Protocol,Src Port:138,Dst Port:138

>NetBIOS Datagram Service>NetBIOS Datagram Service

∨Microsoft Windows Browser Protoclo∨Microsoft Windows Browser Protoclo

Command:Host Announcement(0x01)Command:Host Announcement(0x01)

Update Count:0Update Count:0

Update Periodicity:12 minutesUpdate Periodicity: 12 minutes

Host Name:LAPTOP-NF89D0NPHost Name:LAPTOP-NF89D0NP

该种情况下,第一模块通过NF_INET_LOCAL_IN HOOK解析Host Announcement(0x01)的报文的Host Name字段对应的字符串,得到的字符串为LAPTOP-NF89D0NP,第一模块将得到的字符串确定为第一电子设备的设备指纹特征,也即确定第一电子设备的设备指纹特征为LAPTOP-NF89D0NP。In this case, the first module parses the string corresponding to the Host Name field of the Host Announcement (0x01) message through NF_INET_LOCAL_IN HOOK, and the obtained string is LAPTOP-NF89D0NP. The first module determines the obtained string as the device fingerprint feature of the first electronic device, that is, determines that the device fingerprint feature of the first electronic device is LAPTOP-NF89D0NP.

在另一种可能的情况下,第一模块还可能监听到两种或者两种以上类型的报文,该种情况下,第一模块可以按照上述几种可能的实现方式分别解析监听到的两种或者两种以上类型的报文中的各个报文,以获取各个报文中携带的设备指纹特征。示例性地,第一模块可能监听到MDNS报文和BROWSER报文,该种情况下,第一模块通过NF_BR_LOCAL_IN HOOK按照上述第一种可能的实现方式解析出MDNS报文中的设备指纹特征,以及第一模块通过NF_INET_PRE_FORWARD HOOK按照上述第三种可能的实现方式解析出BROWSER报文中的设备指纹特征。In another possible case, the first module may also monitor two or more types of messages. In this case, the first module may parse each of the two or more types of messages monitored according to the above-mentioned possible implementation methods to obtain the device fingerprint features carried in each message. For example, the first module may monitor MDNS messages and BROWSER messages. In this case, the first module parses the device fingerprint features in the MDNS message through NF_BR_LOCAL_IN HOOK according to the above-mentioned first possible implementation method, and the first module parses the device fingerprint features in the BROWSER message through NF_INET_PRE_FORWARD HOOK according to the above-mentioned third possible implementation method.

需要说明的是,上述是以通过NF_INET_LOCAL_IN HOOK监听DTLS报文和BROWSER报文为例进行说明。在另一个示例中,还可以通过link layer中的其他钩子监听DTLS报文和BROWSER报文,本申请实施例对此不作限定。It should be noted that the above is explained by taking the example of monitoring DTLS messages and BROWSER messages through NF_INET_LOCAL_IN HOOK. In another example, DTLS messages and BROWSER messages can also be monitored through other hooks in the link layer, which is not limited in the embodiment of the present application.

步骤513:第一模块向数据控制管理模块上报设备指纹特征和第一MAC地址信息。Step 513: The first module reports the device fingerprint feature and the first MAC address information to the data control management module.

在一个示例中,第一模块通过netlink向数据控制管理模块上报第一电子设备的设备指纹特征和第一MAC地址信息。In one example, the first module reports the device fingerprint feature and the first MAC address information of the first electronic device to the data control management module through netlink.

步骤514:数据控制管理模块基于设备指纹特征和第一MAC地址信息建立第一映射关系,并存入数据库。Step 514: The data control management module establishes a first mapping relationship based on the device fingerprint feature and the first MAC address information, and stores it in the database.

在一种可能的情况下,数据控制管理模块未建立过第一映射关系,该种情况下,数据控制管理模块在接收第一模块上报的设备指纹特征和第一MAC地址信息后,建立设备指纹特征与第一MAC地址信息之间的第一映射关系。In one possible case, the data control management module has not established the first mapping relationship. In this case, after receiving the device fingerprint feature and the first MAC address information reported by the first module, the data control management module establishes the first mapping relationship between the device fingerprint feature and the first MAC address information.

作为本申请的一个示例,在监听到多个属于目标类型且类型不同的报文的情况下,从多个报文中的每个报文中获取第一电子设备的设备指纹特征,得到第一电子设备的多个设备指纹特征。此时,建立设备指纹特征与第一MAC地址信息之间的第一映射关系的具体实现可以包括:对第一电子设备的多个设备指纹特征进行容错处理,对容错处理后的第一电子设备的至少一个设备指纹特征进行去重处理。基于去重处理后的第一电子设备的设备指纹特征与第一MAC地址信息,建立第一映射关系。As an example of the present application, when multiple messages belonging to the target type and different types are monitored, the device fingerprint feature of the first electronic device is obtained from each of the multiple messages to obtain multiple device fingerprint features of the first electronic device. At this time, the specific implementation of establishing a first mapping relationship between the device fingerprint feature and the first MAC address information may include: performing fault-tolerant processing on the multiple device fingerprint features of the first electronic device, and performing deduplication processing on at least one device fingerprint feature of the first electronic device after the fault-tolerant processing. A first mapping relationship is established based on the device fingerprint feature of the first electronic device after the deduplication processing and the first MAC address information.

根据前文记载可知,第一模块可能监听到不同类型的报文,经过解析后,第一模块会得到第一电子设备的多个设备指纹特征,第一模块向数据控制管理模块上报第一电子设备的多个设备指纹特征。该种情况下,数据控制管理模块可以对该多个设备指纹特征进行去重处理,也即从多个设备指纹特征中删除相同的设备指纹特征,得到去重后的设备指纹特征。之后,可以对去重后的设备指纹特征进行容错处理,譬如去掉异常数据。其中,异常数据是非字符和非数字,或者是不显示信息的数据,或者是长度与报文中指示的长度不匹配的字符。经过容错处理后,数据控制管理模块建立最终得到的设备指纹特征与第一MAC地址信息之间的第一映射关系。According to the previous records, the first module may monitor different types of messages. After parsing, the first module will obtain multiple device fingerprint features of the first electronic device, and the first module will report the multiple device fingerprint features of the first electronic device to the data control management module. In this case, the data control management module can perform deduplication processing on the multiple device fingerprint features, that is, delete the same device fingerprint features from the multiple device fingerprint features to obtain the deduplicated device fingerprint features. Afterwards, the deduplicated device fingerprint features can be fault-tolerantly processed, such as removing abnormal data. Among them, abnormal data is non-character and non-digital, or data that does not display information, or characters whose length does not match the length indicated in the message. After fault-tolerant processing, the data control management module establishes a first mapping relationship between the final device fingerprint feature and the first MAC address information.

在建立第一映射关系后,数据控制管理模块将第一映射关系存储至数据库中。After establishing the first mapping relationship, the data control management module stores the first mapping relationship in the database.

在另一种可能的情况下,数据控制管理模块已经建立了第一映射关系,譬如如前文所述,在第一电子设备接入路由器后,路由器通过NetBIOS响应报文获取到第一电子设备的第一MAC地址信息和设备指纹特征,并建立第一映射关系。该种情况下,数据控制管理模块能够根据从数据库中查询到第一MAC地址信息和设备指纹特征,之后,数据控制管理模块可以不再重复建立第一映射关系。In another possible case, the data control management module has already established the first mapping relationship. For example, as described above, after the first electronic device is connected to the router, the router obtains the first MAC address information and device fingerprint characteristics of the first electronic device through the NetBIOS response message, and establishes the first mapping relationship. In this case, the data control management module can query the first MAC address information and device fingerprint characteristics from the database, and then the data control management module may no longer repeatedly establish the first mapping relationship.

需要说明的是,本申请实施例是以路由器中仅接入有第一电子设备为例进行说明。在一种可能的情况下,除了第一电子设备之外,路由器中可能还接入有其他电子设备,作为一种示例,对于路由器来说,只要接入有电子设备,路由器就可以通过第一模块监控属于目标类型的报文,然后解析出监控到的报文中的设备指纹特征和MAC地址信息,之后上报给数据控制管理模块。数据控制管理模块可以建立第一模块上报的每组设备指纹特征和MAC地址信息之间的映射关系,并存储至数据库中进行管理,从而对接入路由器的每个电子设备的MAC地址信息和设备指纹特征进行管理。It should be noted that the embodiment of the present application is described by taking the case where only the first electronic device is connected to the router as an example. In one possible case, in addition to the first electronic device, other electronic devices may be connected to the router. As an example, for the router, as long as there is an electronic device connected, the router can monitor the message belonging to the target type through the first module, and then parse the device fingerprint features and MAC address information in the monitored message, and then report it to the data control management module. The data control management module can establish a mapping relationship between each group of device fingerprint features and MAC address information reported by the first module, and store it in the database for management, so as to manage the MAC address information and device fingerprint features of each electronic device connected to the router.

在上述实施例的基础上,接下来结合业务权限配置场景,对本申请实施例提供的设备管理的方法进行详细介绍。请参考图7,图7是根据一示例性实施例示出的一种设备管理的方法的流程示意图,可以应用于上述图4所示的路由器中,路由器通过多个模块与第一电子设备交互,该方法可以包括如下部分或者全部内容:Based on the above embodiment, the device management method provided by the embodiment of the present application is described in detail in combination with the business authority configuration scenario. Please refer to Figure 7, which is a flow chart of a device management method according to an exemplary embodiment, which can be applied to the router shown in Figure 4 above. The router interacts with the first electronic device through multiple modules. The method may include some or all of the following contents:

步骤701:业务配置模块启动后,向数据控制管理模块订阅目标消息,目标消息用于发布MAC更新信息。Step 701: After the service configuration module is started, it subscribes to a target message from the data control management module. The target message is used to publish MAC update information.

作为本申请的一个示例,请参见图6,在路由器运行后业务配置模块启动。之后,业务配置模块可以向数据控制管理模块订阅目标消息,以便于数据控制管理模块在确定接入路由器的任意一个电子设备的MAC地址信息发生变更时通过目标消息通知业务配置模块。As an example of the present application, see FIG6 , the service configuration module is started after the router is running. Afterwards, the service configuration module can subscribe to the target message from the data control management module, so that the data control management module can notify the service configuration module through the target message when it determines that the MAC address information of any electronic device connected to the router has changed.

在一个示例中,目标消息为ATP_MSG_RANDOMMAC_DEV_ONLINE消息。In one example, the target message is an ATP_MSG_RANDOMMAC_DEV_ONLINE message.

在一个示例中,业务配置模块向数据控制管理模块中的地址管理模块订阅目标消息。In one example, the service configuration module subscribes to the target message from the address management module in the data control management module.

步骤702:第一电子设备向业务配置模块发送业务权限配置信息。Step 702: The first electronic device sends service authority configuration information to the service configuration module.

第一电子设备使用第一MAC地址信息接入路由器后,用户可以针对第一电子设备的某个或某些业务进行权限配置,示例性地,对儿童上网保护业务进行权限配置,配置过程可以参见图1所示的应用场景。该种情况下,第一电子设备可以向业务配置模块发送业务权限配置信息,业务权限配置信息包括第一MAC地址信息和第一电子设备的业务权限,使得路由器在本地存储该业务权限配置信息,从而便于后续根据业务权限配置信息响应第一电子设备的业务请求。After the first electronic device uses the first MAC address information to access the router, the user can configure permissions for one or some services of the first electronic device. For example, the user can configure permissions for the child online protection service. The configuration process can refer to the application scenario shown in Figure 1. In this case, the first electronic device can send service permission configuration information to the service configuration module. The service permission configuration information includes the first MAC address information and the service permission of the first electronic device, so that the router stores the service permission configuration information locally, thereby facilitating the subsequent response to the service request of the first electronic device according to the service permission configuration information.

本申请实施例是以通过第一电子设备配置自身的权限为例进行说明,在另一个示例中,还可以通过第二电子设备登录路由器,然后配置第一电子设备的业务权限,本申请实施例对此不作限定。The embodiment of the present application is described by taking the configuration of the permissions of the first electronic device as an example. In another example, the router can be logged in through the second electronic device, and then the service permissions of the first electronic device can be configured. The embodiment of the present application is not limited to this.

步骤703:业务配置模块存储业务权限配置信息。Step 703: The business configuration module stores business authority configuration information.

步骤704:业务配置模块接收来自第一电子设备的业务请求,业务请求中携带第一电子设备的第一MAC地址信息。Step 704: The service configuration module receives a service request from the first electronic device, where the service request carries the first MAC address information of the first electronic device.

也即在第一电子设备接入路由器的情况下,用户通过第一电子设备进行上网业务时,第一电子设备向路由器发送业务请求,业务请求中包括第一MAC地址信息。此外,业务请求中还可能包括第一电子设备所要请求的业务的相关描述信息,以使得路由器根据该相关描述信息能够确定第一电子设备当前所要请求的是何种业务。That is, when the first electronic device is connected to the router, when the user uses the first electronic device to access the Internet, the first electronic device sends a service request to the router, and the service request includes the first MAC address information. In addition, the service request may also include relevant description information of the service requested by the first electronic device, so that the router can determine what kind of service the first electronic device is currently requesting based on the relevant description information.

步骤705:业务配置模块根据业务权限配置信息响应该业务请求。Step 705: The service configuration module responds to the service request according to the service authority configuration information.

由于业务权限配置信息中记录了第一MAC地址信息与所配置的业务权限之间的映射关系,所以,当接收到来自第一电子设备的业务请求时,路由器根据业务权限配置信息,确定第一电子设备当前请求的业务是否设置了权限。如果根据业务权限配置信息确定第一电子设备当前请求的业务设置了权限,则按照设置的权限响应该业务请求,譬如如果该业务请求是请求下载游戏应用包,且业务权限配置信息中指示禁止下载游戏应用包,则业务配置模块不执行下载操作,并向第一电子设备反馈下载失败通知。否则,如果根据业务权限配置信息确定第一电子设备当前请求的业务未设置权限,则执行对应的上网操作,譬如如果该业务是请求下载学习类的某应用包,且业务权限配置信息中未指示禁止下载学习类的应用包,则可以转发该业务请求至对应的服务器,以从服务器中下载第一电子设备请求下载的应用包。Since the mapping relationship between the first MAC address information and the configured service authority is recorded in the service authority configuration information, when receiving a service request from the first electronic device, the router determines whether the service currently requested by the first electronic device has been set with authority according to the service authority configuration information. If it is determined according to the service authority configuration information that the service currently requested by the first electronic device has been set with authority, the service request is responded to according to the set authority. For example, if the service request is a request to download a game application package, and the service authority configuration information indicates that the download of the game application package is prohibited, the service configuration module does not perform the download operation, and feeds back a download failure notification to the first electronic device. Otherwise, if it is determined according to the service authority configuration information that the service currently requested by the first electronic device has not been set with authority, the corresponding Internet access operation is performed. For example, if the service is a request to download a certain application package of the learning class, and the service authority configuration information does not indicate that the download of the application package of the learning class is prohibited, the service request can be forwarded to the corresponding server to download the application package requested by the first electronic device from the server.

上述介绍了第一电子设备接入路由器后,在针对第一电子设备的某业务配置了权限的情况下,当第一电子设备进行上网业务时,路由器如何对第一电子设备的上网业务进行控制的实现过程。在此基础上,若用户触发第一电子设备忘记网络并重新接入路由器,则第一电子设备可能会使用随机产生的第二MAC地址信息接入路由器,第二MAC地址信息与第一MAC地址信息不相同。该种情况下,路由器与第一电子设备执行如下操作:The above describes how the router controls the Internet access of the first electronic device after the first electronic device is connected to the router and permissions are configured for a certain service of the first electronic device. On this basis, if the user triggers the first electronic device to forget the network and reconnect to the router, the first electronic device may use the randomly generated second MAC address information to access the router, and the second MAC address information is different from the first MAC address information. In this case, the router and the first electronic device perform the following operations:

步骤706:第一电子设备使用第二MAC地址信息重新接入路由器。Step 706: The first electronic device re-accesses the router using the second MAC address information.

第二MAC地址信息是随机产生的。The second MAC address information is randomly generated.

在一种可能的情况下,如图2所示,在第一电子设备使用第一MAC地址信息接入路由器的情况下,用户可以在第一电子设备中触发第一电子设备忘记网络,然后触发第一电子设备重新接入路由器。相应地,第一电子设备可以产生随机的MAC地址信息(也即第二MAC地址信息),然后,第一电子设备使用第二MAC地址信息请求接入路由器。路由器建立与第一电子设备之间的链路,并通过设备接入管理模块分配IP地址信息,使得第一电子设备重新接入路由器,从而使得第一电子设备连接WiFi网络,如此,第一电子设备即可通过路由器继续上网。In one possible case, as shown in FIG. 2 , when the first electronic device uses the first MAC address information to access the router, the user can trigger the first electronic device to forget the network in the first electronic device, and then trigger the first electronic device to re-access the router. Accordingly, the first electronic device can generate random MAC address information (i.e., the second MAC address information), and then the first electronic device uses the second MAC address information to request access to the router. The router establishes a link with the first electronic device, and allocates IP address information through the device access management module, so that the first electronic device re-accesses the router, thereby connecting the first electronic device to the WiFi network, and the first electronic device can continue to access the Internet through the router.

步骤707:在第一电子设备使用第二MAC地址信息接入路由器后,设备接入管理模块向数据控制管理模块发送接入消息,接入消息中携带第一电子设备重新接入时的接入信息。Step 707: After the first electronic device uses the second MAC address information to access the router, the device access management module sends an access message to the data control management module. The access message carries access information when the first electronic device re-accesses.

重新接入时的接入信息包括第二MAC地址信息和重新分配的IP地址信息。The access information during re-access includes the second MAC address information and the reallocated IP address information.

步骤708:数据控制管理模块向第二模块发送接入信息。Step 708: The data control management module sends access information to the second module.

其具体实现可以参见图5所示实施例中的步骤503。For its specific implementation, please refer to step 503 in the embodiment shown in FIG. 5 .

步骤709:第二模块基于接入信息,获取第一电子设备的设备指纹特征和第二MAC地址信息。Step 709: The second module obtains the device fingerprint feature and the second MAC address information of the first electronic device based on the access information.

其具体实现可以参见图5所示实施例中的步骤504至507。For its specific implementation, please refer to steps 504 to 507 in the embodiment shown in FIG. 5 .

步骤710:第二模块向数据控制管理模块发送设备指纹特征和第二MAC地址信息。Step 710: The second module sends the device fingerprint feature and the second MAC address information to the data control management module.

其具体实现可以参见上述图5所示实施例中的步骤508。For its specific implementation, please refer to step 508 in the embodiment shown in FIG. 5 .

数据控制管理模块接收第二模块上报的设备指纹特征和第二MAC地址信息后,进入如下步骤713的操作。After the data control management module receives the device fingerprint feature and the second MAC address information reported by the second module, the operation proceeds to the following step 713 .

需要说明的是,步骤707至步骤710是可选操作。It should be noted that steps 707 to 710 are optional operations.

步骤711:在第一模块监听到目标类型的报文的情况下,从监听到的报文中解析出第一电子设备的设备指纹特征。Step 711: when the first module monitors a message of the target type, a device fingerprint feature of the first electronic device is parsed from the monitored message.

如前文所述,在路由器中存在电子设备接入的情况下,第一模块就开始监听目标类型的报文,所以,当第一电子设备向路由器发送目标类型的报文时,第一模块即可监听到该报文。之后,可以从监听到报文中解析出第一电子设备的设备指纹特征。另外,还可以解析出第二MAC地址信息。As mentioned above, when an electronic device is connected to the router, the first module starts to monitor the target type of message, so when the first electronic device sends a target type of message to the router, the first module can monitor the message. After that, the device fingerprint feature of the first electronic device can be parsed from the monitored message. In addition, the second MAC address information can also be parsed.

第一模块监听属于目标类型的报文以及针对不同类型的报文的解析过程可以参见图5所示实施例中的步骤511至步骤512。The process of the first module monitoring messages of the target type and parsing messages of different types can be seen from steps 511 to 512 in the embodiment shown in FIG. 5 .

步骤712:第一模块向数据控制管理模块发送设备指纹特征和第二MAC地址信息。Step 712: The first module sends the device fingerprint feature and the second MAC address information to the data control management module.

步骤713:数据控制管理模块基于设备指纹特征,从第一映射关系中查询第一MAC地址信息。Step 713: The data control management module queries the first MAC address information from the first mapping relationship based on the device fingerprint feature.

由于第一映射关系记录了第一MAC地址信息和第一电子设备的设备指纹特征,所以,数据控制管理模块根据第一模块上报的设备指纹特征,可以从第一映射关系中查询对应的第一MAC地址信息。Since the first mapping relationship records the first MAC address information and the device fingerprint feature of the first electronic device, the data control management module can query the corresponding first MAC address information from the first mapping relationship according to the device fingerprint feature reported by the first module.

步骤714:在确定第一MAC地址信息与第二MAC地址信息不相同的情况下,数据控制管理模块向业务配置模块发送目标消息。Step 714: When it is determined that the first MAC address information is different from the second MAC address information, the data control management module sends a target message to the service configuration module.

由于业务配置模块订阅了目标消息,所以,在确定第一MAC地址信息与第二MAC地址信息不相同的情况下,数据控制管理模块向业务配置模块发送目标消息,在一个示例中,目标消息中携带第一MAC地址信息和第二MAC地址信息,用于指示业务配置管理模块第一MAC地址信息已变更为第二MAC地址信息。Since the service configuration module has subscribed to the target message, when it is determined that the first MAC address information is different from the second MAC address information, the data control management module sends the target message to the service configuration module. In one example, the target message carries the first MAC address information and the second MAC address information, which is used to indicate to the service configuration management module that the first MAC address information has been changed to the second MAC address information.

在一个示例中,数据控制管理模块通过地址管理模块向业务配置模块发送目标消息。In one example, the data control management module sends a target message to the service configuration module through the address management module.

另外,数据控制管理模块将第一映射关系中的第一MAC地址信息修改为第二MAC地址信息,以便于后续第一电子设备使用第三MAC地址信息接入路由器时,路由器仍可以根据第一映射关系,修改第二MAC地址信息为第三MAC地址信息。In addition, the data control management module modifies the first MAC address information in the first mapping relationship into the second MAC address information, so that when the first electronic device subsequently uses the third MAC address information to access the router, the router can still modify the second MAC address information into the third MAC address information according to the first mapping relationship.

步骤715:业务配置模块将业务权限配置信息中的第一MAC地址信息修改为第二MAC地址信息。Step 715: The service configuration module modifies the first MAC address information in the service authority configuration information into the second MAC address information.

由于业务权限配置信息中的第二MAC地址信息与第一电子设备当前接入路由器所使用的MAC地址信息匹配,所以所配置的业务权限配置信息仍有效,从而使得在后续第二电子设备使用第二MAC地址信息进行业务请求时,路由器能够正确响应该业务请求,进而保证了上网业务控制的有效性。Since the second MAC address information in the service authority configuration information matches the MAC address information currently used by the first electronic device to access the router, the configured service authority configuration information is still valid, so that when the second electronic device subsequently uses the second MAC address information to make a service request, the router can correctly respond to the service request, thereby ensuring the effectiveness of Internet access service control.

在本申请实施例中,在接收第一电子设备的业务请求的情况下,根据业务权限配置信息响应业务请求,业务权限配置信息用于指示第一电子设备的业务权限和当前使用的第一媒体访问控制MAC地址信息之间的映射关系。在第一电子设备使用第二MAC地址信息重新接入路由器的情况下,根据第一映射关系,将业务权限配置信息中的第一MAC地址信息修改为第二MAC地址信息,第一映射关系用于记录第一电子设备的设备指纹特征与MAC地址信息之间的映射关系。如此,使得业务权限配置信息中的MAC地址信息与第一电子设备接入路由器时使用的MAC地址信息匹配,也即使得业务权限配置信息始终有效,从而保证能够对第一电子设备的业务权限进行有效控制。In an embodiment of the present application, in the case of receiving a service request from a first electronic device, the service request is responded to according to the service authority configuration information, and the service authority configuration information is used to indicate the mapping relationship between the service authority of the first electronic device and the first media access control MAC address information currently in use. In the case where the first electronic device re-accesses the router using the second MAC address information, the first MAC address information in the service authority configuration information is modified to the second MAC address information according to the first mapping relationship, and the first mapping relationship is used to record the mapping relationship between the device fingerprint feature of the first electronic device and the MAC address information. In this way, the MAC address information in the service authority configuration information matches the MAC address information used when the first electronic device accesses the router, that is, the service authority configuration information is always valid, thereby ensuring that the service authority of the first electronic device can be effectively controlled.

接下来对本申请实施例涉及的电子设备进行简单介绍。请参见图8,图8是根据一示例性实施例示出的一种电子设备的结构示意图。电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(universal serial bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(subscriberidentification module,SIM)卡接口195等。其中,传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。Next, the electronic device involved in the embodiment of the present application is briefly introduced. Please refer to Figure 8, which is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

可以理解的是,本申请实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It is to be understood that the structure illustrated in the embodiment of the present application does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

处理器110可以包括一个或多个处理单元,比如:处理器110可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processingunit,GPU),图像信号处理器(image signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The processor 110 may include one or more processing units, for example, the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and/or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从该存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

在一些实施例中,处理器110可以包括一个或多个接口,如可以包括集成电路(inter-integrated circuit,I2C)接口,集成电路内置音频(inter-integrated circuitsound,I2S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purposeinput/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 110 may include one or more interfaces, such as an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver/transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input/output (GPIO) interface, a subscriber identity module (SIM) interface, and/or a universal serial bus (USB) interface, etc.

可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对电子设备100的结构限定。在本申请另一些实施例中,电子设备100也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It is understandable that the interface connection relationship between the modules illustrated in the embodiment of the present application is only a schematic illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

充电管理模块140用于从充电器接收充电输入。其中,充电器可以是无线充电器,也可以是有线充电器。在一些有线充电的实施例中,充电管理模块140可以通过USB接口130接收有线充电器的充电输入。在一些无线充电的实施例中,充电管理模块140可以通过电子设备100的无线充电线圈接收无线充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。The charging management module 140 is used to receive charging input from a charger. The charger may be a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 may receive charging input from a wired charger through the USB interface 130. In some wireless charging embodiments, the charging management module 140 may receive wireless charging input through a wireless charging coil of the electronic device 100. While the charging management module 140 is charging the battery 142, it may also power the electronic device 100 through the power management module 141.

电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193和无线通信模块160等供电。电源管理模块141还可以用于监测电池容量,电池循环次数,电池健康状态(漏电,阻抗)等参数。在其他一些实施例中,电源管理模块141也可以设置于处理器110中。在另一些实施例中,电源管理模块141和充电管理模块140也可以设置于同一个器件中。The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and/or the charging management module 140, and supplies power to the processor 110, the internal memory 121, the external memory, the display screen 194, the camera 193 and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle number, battery health status (leakage, impedance), etc. In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.

电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.

天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。比如:可以将天线1复用为无线局域网的分集天线。在另外一些实施例中,天线可以和调谐开关结合使用。Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve the utilization of the antennas. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

无线通信模块160可以提供应用在电子设备100上的包括无线局域网(wirelesslocal area networks,WLAN)(如无线保真(wireless fidelity,Wi-Fi)网络),蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。The wireless communication module 160 can provide wireless communication solutions for application in the electronic device 100, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication technology (NFC), infrared technology (IR), etc.

电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements the display function through a GPU, a display screen 194, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(liquid crystal display,LCD),有机发光二极管(organic light-emittingdiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(active-matrixorganic light emitting diode,AMOLED),柔性发光二极管(flex light-emittingdiode,FLED),Miniled,MicroLed,Micro-oLed,量子点发光二极管(quantum dot lightemitting diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的整数。The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light emitting diode or an active-matrix organic light emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include 1 or N display screens 194, where N is an integer greater than 1.

电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现拍摄功能。The electronic device 100 can realize the shooting function through ISP, camera 193, video codec, GPU, display screen 194 and application processor.

外部存储器接口120可以用于连接外部存储卡,比如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。比如将音乐,视频等文件保存在外部存储卡中。The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function, such as storing music, video and other files in the external memory card.

内部存储器121可以用于存储计算机可执行程序代码,计算机可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,来执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像播放功能等)等。存储数据区可存储电子设备100在使用过程中所创建的数据(比如音频数据,电话本等)等。此外,内部存储器121可以包括高速随机存取存储器,还可以包括非易失性存储器,比如至少一个磁盘存储器件,闪存器件,通用闪存存储器(universal flash storage,UFS)等。The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created by the electronic device 100 during use (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D以及应用处理器等实现音频功能,比如音乐播放,录音等。The electronic device 100 can implement audio functions, such as music playback, recording, etc., through the audio module 170, the speaker 170A, the receiver 170B, the microphone 170C, the headphone interface 170D and the application processor.

按键190包括开机键,音量键等。按键190可以是机械按键,也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The key 190 includes a power key, a volume key, etc. The key 190 may be a mechanical key or a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.

马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。Motor 191 can generate vibration prompts. Motor 191 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. Indicator 192 can be an indicator light, which can be used to indicate charging status, power changes, messages, missed calls, notifications, etc.

电子设备100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本申请实施例以分层架构的安卓(Android)系统为例,对电子设备100的软件系统进行示例性说明。The software system of the electronic device 100 may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software system of the electronic device 100.

图9是本申请实施例提供的一种电子设备100的软件系统的框图。参见图9,分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统层,以及内核层。FIG9 is a block diagram of a software system of an electronic device 100 provided in an embodiment of the present application. Referring to FIG9 , the layered architecture divides the software into several layers, each layer having a clear role and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, from top to bottom, the application layer, the application framework layer, the Android runtime (Android runtime) and the system layer, and the kernel layer.

应用程序层可以包括一系列应用程序包。如图9所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。The application layer may include a series of application packages. As shown in FIG9 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, short message, etc.

应用程序框架层为应用程序层的应用程序提供应用编程接口(applicationprogramming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。如图9所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问,这些数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。视图系统包括可视控件,比如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序的显示界面,显示界面可以由一个或多个视图组成,比如,包括显示短信通知图标的视图,包括显示文字的视图,以及包括显示图片的视图。电话管理器用于提供电子设备100的通信功能,比如通话状态的管理(包括接通,挂断等)。资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等。通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如,通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或滚动条文本形式出现在系统顶部状态栏的通知,比如后台运行的应用程序的通知。通知管理器还可以是以对话窗口形式出现在屏幕上的通知,比如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The application framework layer provides an application programming interface (API) and a programming framework for the application of the application layer. The application framework layer includes some predefined functions. As shown in FIG9 , the application framework layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, etc. The window manager is used to manage window programs. The window manager can obtain the size of the display screen, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make these data accessible to applications. These data may include videos, images, audio, dialed and received calls, browsing history and bookmarks, phone books, etc. The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, etc. The view system can be used to construct the display interface of the application. The display interface can be composed of one or more views, for example, including a view for displaying a text message notification icon, a view for displaying text, and a view for displaying pictures. The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including connected, hung up, etc.). The resource manager provides various resources for the application, such as localized strings, icons, pictures, layout files, video files, etc. The notification manager enables applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify the completion of downloads, message reminders, etc. The notification manager can also be a notification that appears in the system's top status bar in the form of an icon or scroll bar text, such as notifications from applications running in the background. The notification manager can also be a notification that appears on the screen in the form of a dialog window, such as a text message prompt in the status bar, a beep, an electronic device vibrating, an indicator light flashing, etc.

Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system. The core library consists of two parts: one is the function that the Java language needs to call, and the other is the Android core library. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

系统库可以包括多个功能模块,比如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(比如:OpenGL ES),2D图形引擎(比如:SGL)等。表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,比如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。三维图形处理库用于实现三维图形绘图,图像渲染,合成,和图层处理等。2D图形引擎是2D绘图的绘图引擎。The system library can include multiple functional modules, such as: surface manager, media library, 3D graphics processing library (such as: OpenGL ES), 2D graphics engine (such as: SGL), etc. The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications. The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc. The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc. The 2D graphics engine is a drawing engine for 2D drawing.

内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

下面结合捕获拍照场景,示例性说明电子设备100软件以及硬件的工作流程。The following is an illustrative description of the workflow of the software and hardware of the electronic device 100 in conjunction with capturing a photo scene.

当触摸传感器180K接收到触摸操作,相应的硬件中断被发给内核层。内核层将触摸操作加工成原始输入事件(包括触摸坐标,触摸操作的时间戳等信息)。原始输入事件被存储在内核层。应用程序框架层从内核层获取原始输入事件,识别原始输入事件所对应的控件。以该触摸操作是单击操作,该单击操作所对应的控件为相机应用图标的控件为例,相机应用调用应用程序框架层的接口,启动相机应用,再调用内核层启动摄像头驱动,通过摄像头193捕获静态图像或视频。When the touch sensor 180K receives a touch operation, the corresponding hardware interrupt is sent to the kernel layer. The kernel layer processes the touch operation into an original input event (including touch coordinates, timestamp of the touch operation, and other information). The original input event is stored in the kernel layer. The application framework layer obtains the original input event from the kernel layer and identifies the control corresponding to the original input event. For example, if the touch operation is a single-click operation and the control corresponding to the single-click operation is the control of the camera application icon, the camera application calls the interface of the application framework layer, starts the camera application, and then calls the kernel layer to start the camera driver to capture static images or videos through the camera 193.

在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意结合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令。在路由器上加载和执行所述计算机指令时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,比如,所述计算机指令可以从一个网站站点、路由器、服务器或数据中心通过有线(比如:同轴电缆、光纤、数据用户线(Digital Subscriber Line,DSL))或无线(比如:红外、无线、微波等)方式向另一个网站站点、路由器、服务器或数据中心进行传输。所述计算机可读存储介质可以是路由器能够存取的任何可用介质,或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(比如:软盘、硬盘、磁带)、光介质(比如:数字通用光盘(Digital Versatile Disc,DVD))或半导体介质(比如:固态硬盘(SolidState Disk,SSD))。In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer instructions are loaded and executed on the router, the process or function described in the embodiment of the present application is generated in whole or in part. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transmitted from a website site, router, server or data center by wired (such as: coaxial cable, optical fiber, data subscriber line (Digital Subscriber Line, DSL)) or wireless (such as: infrared, wireless, microwave, etc.) mode to another website site, router, server or data center. The computer-readable storage medium can be any available medium that the router can access, or a data storage device such as a server, data center, etc. that includes one or more available media integrated. The available medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a digital versatile disc (DVD)), or a semiconductor medium (eg, a solid state drive (SSD)).

以上所述为本申请提供的可选实施例,并不用以限制本申请,凡在本申请的揭露的技术范围之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。The above are optional embodiments provided for the present application and are not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the technical scope disclosed in the present application shall be included in the protection scope of the present application.

Claims (11)

1.一种设备管理的方法,其特征在于,应用于路由器中,所述方法包括:1. A device management method, characterized in that it is applied to a router, and the method comprises: 在接收第一电子设备的业务请求的情况下,根据业务权限配置信息响应所述业务请求,所述第一电子设备是接入所述路由器的任意一个电子设备,所述业务权限配置信息用于指示所述第一电子设备的业务权限和当前使用的第一媒体访问控制MAC地址信息之间的映射关系;In the case of receiving a service request from a first electronic device, responding to the service request according to the service authority configuration information, wherein the first electronic device is any electronic device connected to the router, and the service authority configuration information is used to indicate a mapping relationship between the service authority of the first electronic device and the first media access control MAC address information currently in use; 在所述第一电子设备使用第二MAC地址信息重新接入所述路由器的情况下,监听目标类型的报文,所述目标类型的报文包括多播域名系统MDNS报文、数据报传输层安全性协议DTLS报文和BROWSER报文;When the first electronic device re-accesses the router using the second MAC address information, monitoring messages of a target type, wherein the messages of the target type include multicast domain name system MDNS messages, datagram transport layer security protocol DTLS messages, and BROWSER messages; 在监听到所述目标类型的报文的情况下,从所监听到的报文中获取设备指纹特征;When a message of the target type is monitored, a device fingerprint feature is obtained from the monitored message; 根据所述设备指纹特征从第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息,所述第一映射关系用于记录所述第一电子设备的设备指纹特征与MAC地址信息之间的映射关系;According to the device fingerprint feature, query the corresponding MAC address information from the first mapping relationship to obtain the first MAC address information, wherein the first mapping relationship is used to record the mapping relationship between the device fingerprint feature of the first electronic device and the MAC address information; 在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息。When the first MAC address information is different from the second MAC address information, the first MAC address information in the service authority configuration information is modified to the second MAC address information. 2.如权利要求1所述的方法,其特征在于,所述方法还包括:2. The method according to claim 1, characterized in that the method further comprises: 将所述第一映射关系中的所述第一MAC地址信息修改为所述第二MAC地址信息。The first MAC address information in the first mapping relationship is modified to the second MAC address information. 3.如权利要求1所述的方法,其特征在于,所述在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,监听目标类型的报文,包括:3. The method according to claim 1, wherein when the first electronic device re-accesses the router using the second MAC address information, monitoring a target type of message comprises: 在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,分别通过第一钩子和第二钩子监听所述目标类型的报文,其中,所述第一钩子用于监听所述MDNS报文,所述第二钩子用于监听所述DTLS报文和所述BROWSER报文。When the first electronic device uses the second MAC address information to re-access the router, the target type of message is monitored through the first hook and the second hook respectively, wherein the first hook is used to monitor the MDNS message, and the second hook is used to monitor the DTLS message and the BROWSER message. 4.如权利要求3所述的方法,其特征在于,所述在监听到所述目标类型的报文的情况下,从所监听到的报文中获取所述设备指纹特征,包括:4. The method according to claim 3, wherein when a message of the target type is monitored, obtaining the device fingerprint feature from the monitored message comprises: 在监听到所述MDNS报文的情况下,解析所述MDNS报文中的第一关键字段对应的字符串,得到所述设备指纹特征;When the MDNS message is intercepted, the character string corresponding to the first key field in the MDNS message is parsed to obtain the device fingerprint feature; 在监听到所述DTLS报文的情况下,解析所述DTLS报文中的第二关键字段对应的字符串,得到所述设备指纹特征;When the DTLS message is intercepted, the character string corresponding to the second key field in the DTLS message is parsed to obtain the device fingerprint feature; 在监听到所述BROWSER报文的情况下,解析所述BROWSER报文中的第三关键字段对应的字符串,得到所述设备指纹特征。When the BROWSER message is monitored, the character string corresponding to the third key field in the BROWSER message is parsed to obtain the device fingerprint feature. 5.如权利要求4所述的方法,其特征在于,所述第一关键字段为name字段,所述第二关键字段为UDID字段,所述第三关键字段是command为Request Announcement(0x02)的报文的response computer name字段或者是command为Host Announcement(0x01)的报文的Host Name字段。5. The method according to claim 4, wherein the first key field is a name field, the second key field is a UDID field, and the third key field is a response computer name field of a message whose command is Request Announcement (0x02) or a Host Name field of a message whose command is Host Announcement (0x01). 6.如权利要求3-5中任一项所述的方法,其特征在于,所述第一钩子为NF_BR_LOCAL_INHOOK,所述第二钩子为NF_INET_LOCAL_IN HOOK。6. The method according to any one of claims 3 to 5, characterized in that the first hook is NF_BR_LOCAL_INHOOK, and the second hook is NF_INET_LOCAL_IN HOOK. 7.如权利要求3-5中任一项所述的方法,其特征在于,所述方法还包括:7. The method according to any one of claims 3 to 5, characterized in that the method further comprises: 响应于所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器,向所述第一电子设备发送NetBIOS探测报文;In response to the first electronic device re-accessing the router using the second MAC address information, sending a NetBIOS detection message to the first electronic device; 监听所述第一电子设备发送的NetBIOS响应报文。The NetBIOS response message sent by the first electronic device is monitored. 8.如权利要求7所述的方法,其特征在于,所述在监听到所述目标类型的报文的情况下,从所监听到的报文中获取所述设备指纹特征,包括:8. The method according to claim 7, wherein when a message of the target type is monitored, obtaining the device fingerprint feature from the monitored message comprises: 在监听到所述NetBIOS响应报文的情况下,解析所述NetBIOS响应报文中的name字段对应的字符串,得到所述设备指纹特征。When the NetBIOS response message is monitored, the character string corresponding to the name field in the NetBIOS response message is parsed to obtain the device fingerprint feature. 9.如权利要求1-5中任一项所述的方法,其特征在于,所述路由器包括数据采集模块、数据控制管理模块和业务配置模块:9. The method according to any one of claims 1 to 5, characterized in that the router comprises a data acquisition module, a data control management module and a service configuration module: 所述在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征,包括:The acquiring the device fingerprint feature according to the message exchanged between the first electronic device and the router when the first electronic device re-accesses the router using the second MAC address information includes: 在所述第一电子设备使用所述第二MAC地址信息重新接入所述路由器的情况下,所述数据采集模块根据所述第一电子设备与所述路由器之间交互的报文,获取所述设备指纹特征;When the first electronic device re-accesses the router using the second MAC address information, the data acquisition module obtains the device fingerprint feature according to the message exchanged between the first electronic device and the router; 所述数据采集模块向所述数据控制管理模块发送所述设备指纹特征和所述第二MAC地址信息;The data acquisition module sends the device fingerprint feature and the second MAC address information to the data control management module; 根据所述设备指纹特征从所述第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息,包括:Querying corresponding MAC address information from the first mapping relationship according to the device fingerprint feature to obtain the first MAC address information includes: 所述数据控制管理模块根据所述设备指纹特征从所述第一映射关系中查询对应的MAC地址信息,得到所述第一MAC地址信息;The data control management module queries the corresponding MAC address information from the first mapping relationship according to the device fingerprint feature to obtain the first MAC address information; 在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息,包括:When the first MAC address information is different from the second MAC address information, modifying the first MAC address information in the service authority configuration information to the second MAC address information includes: 在所述第一MAC地址信息与所述第二MAC地址信息不相同的情况下,所述数据控制管理模块向所述业务配置模块发送目标消息,所述目标消息中携带所述第一MAC地址信息和所述第二MAC地址信息;In a case where the first MAC address information is different from the second MAC address information, the data control management module sends a target message to the service configuration module, where the target message carries the first MAC address information and the second MAC address information; 所述业务配置模块根据所述第一MAC地址信息,将所述业务权限配置信息中的所述第一MAC地址信息修改为所述第二MAC地址信息。The service configuration module modifies the first MAC address information in the service authority configuration information into the second MAC address information according to the first MAC address information. 10.一种路由器,其特征在于,所述路由器包括存储器、处理器以及存储在所述存储器中并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现如权利要求1-9中任意一项所述的方法。10. A router, characterized in that the router comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method according to any one of claims 1 to 9 when executing the computer program. 11.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质中存储有指令,当其在计算机上运行时,使得计算机执行如权利要求1-9中任意一项所述的方法。11. A computer-readable storage medium, characterized in that the computer-readable storage medium stores instructions, which, when executed on a computer, enable the computer to execute the method according to any one of claims 1 to 9.
CN202310950608.XA 2023-07-28 2023-07-28 Device management method, router and readable storage medium Active CN117714279B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310950608.XA CN117714279B (en) 2023-07-28 2023-07-28 Device management method, router and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310950608.XA CN117714279B (en) 2023-07-28 2023-07-28 Device management method, router and readable storage medium

Publications (2)

Publication Number Publication Date
CN117714279A CN117714279A (en) 2024-03-15
CN117714279B true CN117714279B (en) 2024-10-08

Family

ID=90148625

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310950608.XA Active CN117714279B (en) 2023-07-28 2023-07-28 Device management method, router and readable storage medium

Country Status (1)

Country Link
CN (1) CN117714279B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361695A (en) * 2018-11-28 2019-02-19 深圳市万网博通科技有限公司 To the authorization method of network insertion, device, computer equipment and storage medium
CN114745324A (en) * 2021-01-07 2022-07-12 深圳市奇虎智能科技有限公司 Device identification method, device, storage medium and routing device
CN116471130A (en) * 2023-06-20 2023-07-21 荣耀终端有限公司 Network asset detection method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665299A (en) * 2016-07-28 2018-02-06 中兴通讯股份有限公司 A kind of Terminal fingerprints generation method and device
CN111756756B (en) * 2020-06-28 2022-08-05 深圳市信锐网科技术有限公司 Terminal network control method and device, electronic equipment and storage medium
CN112269959B (en) * 2020-11-19 2024-05-24 北京有竹居网络技术有限公司 Control method and device for display content, readable medium and electronic equipment
CN114257664B (en) * 2021-12-13 2024-06-07 北京易霖博信息技术有限公司 Network equipment fingerprint extraction method, device, server and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109361695A (en) * 2018-11-28 2019-02-19 深圳市万网博通科技有限公司 To the authorization method of network insertion, device, computer equipment and storage medium
CN114745324A (en) * 2021-01-07 2022-07-12 深圳市奇虎智能科技有限公司 Device identification method, device, storage medium and routing device
CN116471130A (en) * 2023-06-20 2023-07-21 荣耀终端有限公司 Network asset detection method and device

Also Published As

Publication number Publication date
CN117714279A (en) 2024-03-15

Similar Documents

Publication Publication Date Title
CN109408136B (en) Information processing method, information processing apparatus, storage medium, and electronic device
CN113347242B (en) Cross-device resource access method and device, storage medium and electronic device
WO2019227450A1 (en) Application function implementation method and electronic device
JP2019522282A (en) Secure configuration of cloud computing nodes
US11882154B2 (en) Template representation of security resources
WO2019057155A1 (en) Method and device for dynamically managing kernel node
CN114461240A (en) Software upgrading method, software upgrading system and electronic equipment
WO2022143155A1 (en) Resource access method and terminal device
US20230216732A1 (en) Network Configuration Method and Device
CN110083457A (en) A kind of data capture method, device and data analysing method, device
US20180210770A1 (en) Enabling wpd devices to be managed at the capability level
CN106126232A (en) A kind of interface starts method and device
CN117714279B (en) Device management method, router and readable storage medium
CN118400742A (en) Data sharing method and terminal equipment
WO2024140122A1 (en) Connection management method, apparatus, and system for electronic device
CN101888396A (en) Method for calling equipment capability, micro-technical equipment and server
WO2024212776A1 (en) Resource reloading method and apparatus, electronic device, and storage medium
CN116708062B (en) Device management method and electronic device
CN116567133B (en) Resource playing method and device, computer equipment, storage medium and program product
CN106850928A (en) Incoming call and SMS processing method, device and mobile terminal
CN117714413B (en) Method for determining device brand information, router and readable storage medium
CN114625368A (en) Data synchronization method, device, electronic device and storage medium
CN115550391B (en) Equipment control method and electronic equipment
CN112818372A (en) Authority display information processing method, device, electronic device and storage medium
CN118332174B (en) Data crawling method, system and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP03 Change of name, title or address

Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040

Patentee after: Honor Terminal Co.,Ltd.

Country or region after: China

Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong

Patentee before: Honor Device Co.,Ltd.

Country or region before: China

CP03 Change of name, title or address