Equipment role configuration method and device, equipment, storage medium and program product

By using probe messages and MAC address judgment in home networks, the Controller and Agent roles are automatically selected, solving the problem of improper role selection in multi-access point networks and achieving stability and reliability of device role configuration.

CN121125474APending Publication Date: 2025-12-12CHINA MOBILEHANGZHOUINFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410756715.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

In a home network environment with multiple access points, existing technologies struggle to properly select Controller and Agent roles, leading to network instability and unreliability.

Method used

By using multicast probe messages from the target router device, it can determine whether it is directly connected to the gateway, and determine the device role based on the MAC address of the candidate router device, thus avoiding the abnormal result of multiple master routers or all decisions becoming sub-routers.

Benefits of technology

It achieves simplicity, efficiency, and uniqueness in device role configuration, fully maintains the stability and reliability of multi-access point networking environments, and reasonably realizes the stability and reliability of the network environment with device role configuration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121125474A_ABST
    Figure CN121125474A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment role configuration method and device, equipment, a storage medium and a program product, and relates to the technical field of communication. The method comprises the following steps: when a starting time node of a preset period is reached, performing multicast on a first detection message in a multi-access point (MAP) network by a target router device in N router devices; when a first response message corresponding to the first detection message is not received within the configured first detection window time, detecting whether the target router equipment is directly connected with the gateway; when the target router device is directly connected with the gateway, determining a device role required to be configured by the target router device based on the MAC address of each candidate router device in the M candidate router devices; the M candidate router devices are router devices directly connected with the gateway in the N router devices. According to the embodiment of the invention, the device role configuration of the router device can be reasonably realized, and the stability and reliability of the network environment under the condition of multi-access point networking can be fully maintained.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of communication, and particularly relates to a device role configuration method and device, equipment, storage medium and program product. BACKGROUND

[0002] At present, with the rapid development of home broadband access rate and home intelligence, higher network coverage rate and more abundant home intelligent devices are spread in every corner, which brings great challenges to the full-house coverage of home network. In recent years, the Mesh networking technology rising in the intelligent networking terminal industry is a key technology for effectively solving the home network coverage. Almost all head intelligent networking terminal manufacturers have launched Mesh products with their own characteristics, and deploying multiple networking terminals supporting Mesh function has become a new trend of home Wi-Fi (Wireless Fidelity) deployment.

[0003] When there are multiple networking terminal access points (APs) in the user environment, the networking terminals form a network through wireless connection by a Controller router and an Agent router in an EasyMesh manner, to provide complete wireless coverage, network topology, roaming, frequency band switching and other services. When multiple APs are networked, one of the APs should be selected as the Controller role (master router), and the other APs should be selected as the Agent role (sub-router). The Controller role is used to collect the connection status of the entire home network, should support management and coordination of other Agent devices, and make decisions on roaming, frequency band switching and other functions of all terminal devices in the network. The Agent role interacts with the Controller through EasyMesh to exchange control information, and is responsible for the access of the terminal under it, and completes EasyMesh networking, STA (Station) roaming, frequency band switching and other services. Therefore, how to reasonably realize the configuration and selection of the Controller role and the Agent role is of great significance to the stability of the home network environment. SUMMARY

[0004] The embodiments of the present application provide a device role configuration method, device, equipment, storage medium and program product, which can reasonably realize the device role configuration of the router equipment, thereby being beneficial to fully maintaining the stability and reliability of the network environment under the multi-access point networking condition.

[0005] In a first aspect, the embodiments of the present application provide a device role configuration method, which comprises:

[0006] In a case that a starting time node of a preset period is reached, multicasting, by a target router device among N router devices, a first probe message in a multi-access point (MAP) network; there is at least one router device directly connected with a gateway in the MAP network; the N router devices are router devices accessing the MAP network and to be configured with device roles, N being a positive integer;

[0007] In a case that a first response message corresponding to the first probe message is not received within a configured first probe window time, detecting whether the target router device is directly connected with the gateway;

[0008] In a case that the target router device is directly connected with the gateway, determining a device role to be configured for the target router device based on media access control (MAC) addresses of each candidate router device among M candidate router devices;

[0009] The M candidate router devices are router devices directly connected with the gateway among the N router devices, and M is a positive integer less than or equal to N.

[0010] In some possible implementation manners, after the target router device among the N router devices multicasts the first probe message in the MAP network, the device role configuration method further includes:

[0011] In a case that the first response message is not received within the first probe window time, detecting whether a second probe message multicasted by another router device among the N router devices is received within the first probe window time;

[0012] If the second probe message is not detected, configuring a device role of the target router device as a master router role;

[0013] In a case that the first response message corresponding to the first probe message is not received within the configured first probe window time, detecting whether the target router device is directly connected with the gateway, including:

[0014] In a case that the first response message is not received within the first probe window time and the second probe message is not detected, detecting whether the target router device is directly connected with the gateway.

[0015] In some possible implementation manners, in a case that the first response message corresponding to the first probe message is not received within the configured first probe window time, detecting whether the target router device is directly connected with the gateway, including:

[0016] In a case that the first response message corresponding to the first probe message is not received within the first probe window time, sending a ping command to the gateway;

[0017] If a reply message corresponding to the ping command sent by the gateway is received, it is determined that the target router device is directly connected with the gateway.

[0018] If the reply message sent by the gateway is not received, it is determined that the target router device is not directly connected with the gateway.

[0019] In some possible implementation manners, before determining the device role required to be configured for the target router device based on the media access control (MAC) address of each of the M candidate router devices, the device role configuration method further comprises:

[0020] In the case that the target router device is directly connected with the gateway, the target router device multicasts a third probe message in the MAP network, and detects whether a fourth probe message multicasted by other router devices of the M candidate router devices is received within a second probe window time;

[0021] If the fourth probe message is not detected, the device role of the target router device is configured as a master router role;

[0022] Determining the device role required to be configured for the target router device based on the media access control (MAC) address of each of the M candidate router devices comprises:

[0023] In the case that the fourth probe message is detected, determining the device role required to be configured for the target router device based on the MAC address of each of the M candidate router devices.

[0024] In some possible implementation manners, determining the device role required to be configured for the target router device based on the media access control (MAC) address of each of the M candidate router devices comprises:

[0025] Comparing the MAC address of the target router device with the MAC address carried in the fourth probe message to obtain a comparison result of the target router device;

[0026] In the case that the comparison result meets a preset comparison rule, the device role of the target router device is configured as a master router role;

[0027] In the case that the comparison result does not meet the preset comparison rule, the device role of the target router device is configured as a sub-router role.

[0028] In some possible implementation manners, after the target router device multicasts the first probe message in the multi-access point (MAP) network, the device role configuration method further comprises:

[0029] In the case that the first reply message is received within the first probe window time, the device role of the target router device is configured as a sub-router role.

[0030] Based on the same inventive concept, in a second aspect, embodiments of the present application provide a device role configuration apparatus, which comprises:

[0031] The first multicast module is configured to multicast, by a target router device of the N router devices, a first probe message in a multi-access point (MAP) network if a start time node of a preset period is reached; there is at least one router device directly connected to a gateway in the MAP network; the N router devices are router devices connected to the MAP network and to be configured with device roles; and N is a positive integer.

[0032] The first detection module is configured to detect whether the target router device is directly connected to the gateway if a first response message corresponding to the first probe message is not received within a configured first probe window time.

[0033] The first determination module is configured to determine a device role required to be configured for the target router device based on media access control (MAC) addresses of each candidate router device of M candidate router devices if the target router device is directly connected to the gateway.

[0034] The M candidate router devices are router devices directly connected to the gateway of the N router devices, and M is a positive integer less than or equal to N.

[0035] In a third aspect, embodiments of the present application provide a device role configuration device, which comprises:

[0036] A processor and a memory storing computer program instructions;

[0037] The processor implements the device role configuration method provided in any one of the embodiments of the present application when executing the computer program instructions.

[0038] In a fourth aspect, embodiments of the present application provide a computer readable storage medium, which stores computer program instructions. The computer program instructions are executed by a processor to implement the device role configuration method provided in any one of the embodiments of the present application.

[0039] In a fifth aspect, embodiments of the present application provide a computer program product. Instructions in the computer program product are executed by a processor of an electronic device to cause the electronic device to perform the device role configuration method provided in any one of the embodiments of the present application.

[0040] From the above description, the device role configuration method, device, storage medium and program product provided by the embodiments of the present application can determine whether a master route exists in a MAP network by multicasting a detection message by a target router device, and determine that the master route is not configured in the MAP network in the case where no response message is received. In this case, it is determined whether the target router device is directly connected to a gateway. If the target router device is directly connected to the gateway, the MAC addresses of the current target router device and other router devices configured with a device role and directly connected to the gateway are used to uniquely determine a master route, so that the device role of the target router can be determined as a master route or a sub-route.

[0041] The device role configuration method provided by the embodiments of the present application can filter out a router directly connected to a gateway by automatically performing the above steps, so that the device running a master route Controller can have a more stable network environment. The MAC address value of a candidate router device is used to determine the final result, the device role determination method is simple and efficient and the result is unique, which can effectively avoid the abnormal result that multiple master route Controllers exist in a MAP network or all devices are determined as sub-routes, and can reasonably configure the device role of a router device, thereby facilitating the maintenance of the stability and reliability of a network environment in a multi-access point networking scenario. BRIEF DESCRIPTION OF DRAWINGS

[0042] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed in the embodiments of the present application will be briefly introduced. Those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0043] Figure 1 is a flowchart of a device role configuration method provided by an embodiment of the present application;

[0044] Figure 2 is a scene flowchart of a device role configuration method provided by an embodiment of the present application;

[0045] Figure 3 is a structure diagram of a device role configuration device provided by an embodiment of the present application;

[0046] Figure 4 is a structure diagram of a device role configuration device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0047] The features and exemplary embodiments of the various aspects of the present application will be described in detail below with reference to the drawings. The following detailed description is merely intended to explain the present application, and is not intended to limit the present application. The present application can be implemented without some of the specific details, which are well known to those skilled in the art. The following description of the embodiments is merely provided to give a better understanding of the present application by showing examples of the present application.

[0048] It should be noted that the relational terms herein, such as first and second, and the like, are used solely to distinguish one from another entity or action, without necessarily requiring or implying any such actual relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises... " does not, without more limitations, preclude the existence of further identical elements in the process, method, article, or apparatus that comprises the recited element.

[0049] Controller role (main route): unique in the home network, responsible for collecting the connection status of the entire home network, should support management and coordination of other Agent devices, decision-making of roaming and frequency band switching of all terminal devices in the network. Agent interacts with Controller through EasyMesh for control information, and is responsible for the access of the terminal under it, completes EasyMesh networking, STA roaming, frequency band switching and other services.

[0050] Agent role (sub-route): multiple Agent terminals can exist in home networking, providing specific control information for Controller, executing Controller control flow; fast network access and Wi-Fi configuration of networking terminals; fast switching (roaming and frequency band guidance) of user STA terminals; cooperating with Controller to complete wireless channel intelligent optimization and other services.

[0051] As described in the background section, how to reasonably implement the configuration selection of the Controller role and the Agent role is of vital importance to the stability of the home network environment. However, the present inventors have found that there are mainly two ways to implement the device role configuration when the router devices are networked in the EasyMesh manner. One device role configuration way is to manually set the role of the current router device as Controller or Agent through a WEB interface. However, the meaning of the Controller and Agent roles is not clear to ordinary users, and once the configuration is incorrect, the network cannot be networked.

[0052] Another device role configuration way is to automatically select the role after the router device is powered on, and finally one of the devices is configured as the Controller role and the rest are configured as the Agent role. The router device automatically selects the role after being powered on. In the scenario of multiple APs simultaneously performing role self-election, although the multiple backoff processing measures are adopted, the probability of abnormal results such as multiple Controllers or all decisions as Agents is reduced to a very low level, but the instability of the network will still cause the abnormal situation to occur. At the same time, the existing method does not consider the topology of multiple APs, and the device selected to run the Controller is not necessarily suitable, such as the multiple AP cascade scenario. Both of the above methods have the problem of selecting the leaf node as the target device, and the device is farthest from the gateway, and the network environment is not necessarily optimal.

[0053] In view of the above, in order to solve the problems in the prior art, the embodiments of the present application provide a device role configuration method, device, apparatus, storage medium and program product. It should be noted that the embodiments provided by the present application are not intended to limit the scope of the present application.

[0054] The device role configuration method provided by the embodiments of the present application will be introduced first.

[0055] Figure 1 A flowchart of a device role configuration method provided by an embodiment of the present application is shown. The device role configuration method is applied to an electronic device, which can include, for example, a mobile phone, a tablet computer, a notebook computer, a palm computer or an Ultra-Mobile Personal Computer (UMPC), etc., and the present application does not make strict limitations. As shown in Figure 1 The device role configuration method includes the following steps:

[0056] S110, in a case of reaching a starting time node of a preset period, multicasting, by a target router device among N router devices, a first probe message in a multi-access point (MAP) network; there is at least one router device directly connected to a gateway in the MAP network; the N router devices are router devices accessing the MAP network and to be configured with device roles, N being a positive integer;

[0057] S120, in a case of not receiving a first response message corresponding to the first probe message within a configured first probe window time, detecting whether the target router device is directly connected to the gateway;

[0058] S130, in a case of the target router device being directly connected to the gateway, determining a device role to be configured for the target router device based on media access control (MAC) addresses of each candidate router device among M candidate router devices; the M candidate router devices are router devices directly connected to the gateway among the N router devices, M being a positive integer less than or equal to N.

[0059] It can be known from the above description that the device role configuration method provided by the embodiments of the present application determines whether a master router already exists in the MAP network by multicasting the probe message by the target router device, and determines that the master router is not configured in the MAP network in a case of not receiving the response message. In this case, it is judged whether the target router device is a device directly connected to the gateway. If the target router device is directly connected to the gateway, the MAC addresses of the current target router device and other router devices configured with device roles and also directly connected to the gateway are used to uniquely determine the master router, so that it can be determined that the device role of the target router is the master router or the sub-router.

[0060] The device role configuration method of the embodiments of the present application filters out the router directly connected to the gateway by automatically executing the above steps, so that the device running the master router Controller finally has a more stable network environment. Moreover, the MAC address value of the candidate router device is used to elect the final result in the embodiments of the present application. This device role election method is simple and efficient and the result is unique, which can effectively avoid the abnormal result that multiple master routers Controller or all decisions become sub-routers Agent in the MAP network, and can reasonably realize the device role configuration of the router device, thereby being beneficial to fully maintaining the stability and reliability of the network environment in the multi-access point networking situation.

[0061] The specific implementation of the above steps 110 to 130 is described in detail below.

[0062] In S110, when the start time node of the preset period is reached, the target router device multicasts the first probe message in the multi-access point (MAP) network, wherein there is at least one router device directly connected to the gateway in the MAP network, and the N router devices are router devices accessing the MAP network and to be configured, and N is a positive integer.

[0063] The preset period is, for example, 5 seconds. The target router device can be any one of the N router devices. In the MAP network, at least one router device is connected to the gateway, and the connection of the router devices in the MAP network is effective (tree-shaped non-circular connected network).

[0064] For example, the target router device periodically multicasts the first probe message in the MAP network. The first probe message can be implemented by an AP-autoconfiguration search message of the IEEE 1905 protocol, and the devices accessing the MAP network can normally receive the first probe message.

[0065] According to some embodiments of the present application, after the target router device multicasts the first probe message in the multi-access point (MAP) network, the device role configuration method can further include:

[0066] In the case where the first response message is received within the first probe window time, the device role of the target router device is configured as a sub-router role.

[0067] Specifically, if the target router multicasts the first probe message in the MAP network, only the router device with the master route Controller role has the right to respond to the first probe message, so if the target router can receive the first response message corresponding to the first probe message within the first probe window time in the MAP network, it means that there is a router device configured as a master route Controller role in the MAP network.

[0068] In this case, to fully avoid the abnormal situation of multiple master route Controller roles in the same MAP network, the device role of the target router can be configured as a sub-router Agent role.

[0069] In S120, when the first response message corresponding to the first probe message is not received within the configured first probe window time, it is detected whether the target router device is directly connected to the gateway.

[0070] The first probe window time can be configured when the first probe message is multicast, and the first probe window time can be, for example, 5 minutes.

[0071] In a case where the first response message corresponding to the first probe message is not received within the configured first probe window time, it can be verified whether the target router device is directly connected to the gateway by sending a data packet or the like to the gateway. Alternatively, the target router device can also identify the connection relationship (direct connection or indirect connection through other router devices) between the device and the gateway in the MAP network. In this way, only the identification corresponding to the target router device needs to be obtained to detect whether it is directly connected to the gateway.

[0072] According to some embodiments of the present application, optionally, in order to more efficiently, quickly and accurately detect whether the target router device is directly connected to the gateway, in a case where the first response message corresponding to the first probe message is not received within the configured first probe window time, detecting whether the target router device is directly connected to the gateway can include:

[0073] In a case where the first response message corresponding to the first probe message is not received within the first probe window time, sending a ping command to the gateway;

[0074] If the reply message corresponding to the ping command sent by the gateway is received, it is determined that the target router device is directly connected to the gateway;

[0075] If the reply message sent by the gateway is not received, it is determined that the target router device is not directly connected to the gateway.

[0076] In network communication, the ping command can be used to test whether the connection with another host device is normal. When the ping command is executed, the IP address or domain name of the gateway in the above MAP network can be specified to send the ping command to the gateway, and the ping command can be sent in the form of a ping data packet. Since the life cycle of the ping data packet only exists for one hop (single-hop characteristic), if the destination address (here, the gateway) of the received ping packet is not the device directly connected to the target router device, the ping packet will be discarded in the cascading transmission process.

[0077] Based on this, if the target router device can receive the reply message sent by the gateway after sending the ping command to the gateway, it can be determined that the target router device is directly connected to the gateway. Otherwise, it can be determined that the target router device is not directly connected to the gateway.

[0078] In the embodiment, the router device of the direct connection gateway is quickly and accurately filtered by using the single-hop characteristics of the ping packet, so that the connection between the router device running the Controller and the gateway is more closely, that is, the router device configured as the Controller can be in a more stable network environment, and the result of the device role selection is more appropriate.

[0079] According to some embodiments of the application, optionally, after the target router device in the N router devices multicasts the first probe message in the multi-access point (MAP) network, the device role configuration method can further include:

[0080] In the case that the first response message is not received within the first probe window time, detecting whether a second probe message multicasted by other router devices in the N router devices is received within the first probe window time;

[0081] If the second probe message is not detected, the device role of the target router device is configured as the master router role;

[0082] In the case that the first response message corresponding to the first probe message is not received within the configured first probe window time, detecting whether the target router device is directly connected to the gateway can include:

[0083] In the case that the first response message is not received within the first probe window time and the second probe message is not detected, detecting whether the target router device is directly connected to the gateway.

[0084] In the embodiment, if the target router device periodically multicasts the first probe message in the MAP network, and the first response message corresponding to the first probe message is still not received beyond the first probe window time, it can be further detected in the MAP network whether a second probe message multicasted by other router devices without configured device roles is received within the first probe window time.

[0085] If the second probe message multicasted by other router devices is not detected, it indicates that the router device without the router role is unique in the MAP network. It can be known from the fact that the first response message corresponding to the first probe message is still not received by the target router device beyond the first probe window time that the master router Controller role is not currently configured in the MAP network.

[0086] Therefore, under the premise that at least one router device is directly connected with the gateway in the aforementioned MAP network, the target router device can be directly analyzed as the only router device currently connected with the gateway without the configured device role. In this case, since the MAP network has not been configured with the master routing Controller role, the device role of the target router can be directly configured as the master routing Controller role, thereby reasonably implementing the device role configuration of the router device in the MAP network and fully improving the device role configuration efficiency of the router device.

[0087] In addition, the embodiment further limits that in the case that the first response message is not received in the first detection window time and the second detection message is not detected, whether the target router device is directly connected with the gateway is further detected. In this way, unnecessary logical resource consumption can be fully avoided, and the improvement of the device role configuration efficiency of the router device is also beneficial.

[0088] It should be further supplemented in the application that, in order to fully guarantee that the router device running the master routing Controller role has a more stable network environment, if it is detected that the target router device is not directly connected with the gateway, the device role of the target router device can be directly configured as the sub-routing Agent role, so that the device role selected and configured by the target router device is more in line with the network conditions of the router device.

[0089] In S130, when the target router device is directly connected with the gateway, the device role required to be configured by the target router device is determined based on the media access control (MAC) address of each candidate router device in M candidate router devices, wherein the M candidate router devices are the router devices directly connected with the gateway in the N router devices, and M is a positive integer less than or equal to N.

[0090] It should be further supplemented that the M candidate router devices can be determined and screened by the aforementioned ping command sent to the gateway, and the embodiment does not make strict limitations here.

[0091] When the target router device is directly connected with the gateway, only one router device is determined from the M candidate router devices including the target router device, and the router device is configured as the master routing Controller role, and the remaining router devices in the M candidate router devices are correspondingly configured as the sub-routing Agent role.

[0092] In the determination of the main route Controller role, since the MAC (Media Access Control) addresses of different router devices are unique, the MAC addresses of the M candidate router devices can be used to uniquely determine the candidate router device as the main route Controller role, so as to know whether the target router device needs to be configured as the main route Controller role or the sub-route Agent role.

[0093] In the determination of the device role of the target router device based on the MAC addresses of the M candidate router devices, the target router can be determined as the main route Controller role or the sub-route Agent role according to the corresponding filtering rules and the like. The embodiment does not strictly limit how the device role of the target router device is determined based on the MAC addresses of the M candidate router devices.

[0094] According to some embodiments of the present application, optionally, in order to more reasonably determine the device role of the target router device based on the MAC addresses of the M candidate router devices, the device role configuration method can further include the following steps before the above step:

[0095] In the case where the target router device is directly connected to the gateway, the target router device multicasts a third probe message in the MAP network and detects whether a fourth probe message multicasted by other router devices in the M candidate router devices is received within a second probe window time.

[0096] If the fourth probe message is not detected, the device role of the target router device is configured as the main route role.

[0097] Based on the MAC addresses of the M candidate router devices, the device role of the target router device to be configured can include the following steps:

[0098] In the case where the fourth probe message is detected, the device role of the target router device to be configured is determined based on the MAC addresses of the M candidate router devices.

[0099] In the embodiment, if it is detected that the target router device is directly connected to the gateway, the target router device can continue to multicast the third probe message in the MAP network. At the same time, since the router devices not directly connected to the gateway are filtered in the foregoing step, the router devices multicasting the probe message in the MAP network at this stage are the router devices directly connected to the gateway.

[0100] Based on this, it is detected whether the fourth probe message multicast by other router devices of the M candidate router devices is received by the target router device within the second probe window time. If the fourth probe message multicast by other candidate router devices is not detected, it indicates that the candidate router device which is currently connected to the MAP network, has not configured a role, and is directly connected to the gateway, and only the target router device. In this case, the device role of the target router device is directly configured as the main route Controller role.

[0101] If the fourth probe message (one or more) multicast by other candidate router devices is detected, it indicates that there are multiple candidate router devices which are currently connected to the MAP network, have not configured a role, and are directly connected to the gateway. In this case, in order to determine a unique candidate router device as the main route Controller role from the multiple candidate router devices, the MAC address of each candidate router device of the M candidate router devices is further used to uniquely screen the main route Controller role, and the other candidate router devices are configured as the sub-route Agent role.

[0102] According to some embodiments of the present application, optionally, in order to more reasonably determine the device role configured by the target router device according to the MAC addresses of the M candidate router devices, while fully avoiding the abnormal results of multiple Controllers or all decisions as Agents, the media access control (MAC) address of each candidate router device of the M candidate router devices determines the device role required to be configured by the target router device, which can include:

[0103] Comparing the MAC address of the target router device with the MAC address carried in the fourth probe message to obtain a comparison result of the target router device;

[0104] In the case that the comparison result meets the preset comparison rule, the device role of the target router device is configured as the main route role;

[0105] In the case that the comparison result does not meet the preset comparison rule, the device role of the target router device is configured as the sub-route role.

[0106] In the present embodiment, the fourth probe message multicast by the remaining candidate router devices and received by the target router device can be one or more, and each fourth probe message carries the MAC address of the corresponding candidate router device, and the MAC addresses of different candidate router devices are unique.

[0107] The preset comparison rule is, for example, if the MAC address of the target router device is the longest in length or the largest in value among the M MAC addresses corresponding to the M candidate router devices.

[0108] The following explanation uses the aforementioned preset comparison rule as an example: the target router's MAC address has the largest address value among the M MAC addresses corresponding to the M candidate routers. This can be achieved by comparing the target router's own MAC address, from most significant byte to least significant byte, with the MAC addresses of the other candidate routers to determine if the target router's MAC address has the largest address value.

[0109] If the comparison result indicates that the target router device's MAC address has the largest address value among the M MAC addresses corresponding to the M candidate router devices, then the target router device is configured as a main router controller; otherwise, the target router device is configured as a sub-router agent.

[0110] It should be noted that the above-mentioned preset comparison rules can also be, for example, if the MAC address of the target router device is the shortest or has the smallest address value among the M MAC addresses corresponding to the M candidate router devices, this embodiment does not impose strict restrictions on this.

[0111] To facilitate understanding of the device role configuration method provided in the above embodiments, the following describes the method using a specific scenario embodiment. Figure 2 This is a schematic flowchart of a scenario embodiment of the device role configuration method provided in this application.

[0112] like Figure 2 As shown, in the MAP network, it is ensured beforehand that at least one router device is directly connected to the gateway, and the router device connections are valid (a tree-like, non-looping connected network). The specific steps for automatic role decision configuration when each router device to be added to the MAP network starts up are as follows:

[0113] 1. Configure a specified Controller probe time window (e.g., 5 minutes). Within the probe time window, send an AP-autoconfiguration search message of the IEEE 1905 protocol (equivalent to the aforementioned first probe message, which is a multicast message that can be received by all devices in the MAP network) at regular intervals (e.g., 5 seconds) to detect the existence of the Controller.

[0114] 2. If the response message of the first probe message, i.e. the AP-autoconfiguration search response message of IEEE 1905 protocol (which belongs to a unicast message and only the Controller can actively respond) is received within the probe time window, it indicates that the Controller already exists in the MAP network, then the probing is stopped and the device is configured as the Agent, and the automatic role selection is ended. Alternatively, if the AP-autoconfiguration search response message is not received within the probe time window, and the AP-autoconfiguration search response message based on IEEE 1905 protocol sent by other router devices in the MAP network, i.e. the second probe message, is not received, it indicates that there is no Controller and no other unconfigured router device in the MAP network in this case. Under the premise that at least one router device directly connected to the gateway is ensured in the MAP network, the router device is directly connected to the gateway, and the router device is configured as the Controller, the probing is stopped, and the automatic role selection is ended.

[0115] 3. If the AP-autoconfiguration search response message is not received within the probe time window, but the AP-autoconfiguration search message of IEEE 1905 protocol sent by other devices in the MAP network is received within the probe time window, it indicates that multiple devices simultaneously perform the automatic role decision configuration at this time, and a relatively suitable device needs to be finally selected as the Controller. The following is also a key step of the embodiment of the application.

[0116] 4. When multiple devices simultaneously perform the automatic role decision configuration in the MAP network, a suitable candidate router device needs to be selected. When the candidate router device is selected, the current router device is pinged to the gateway by using the ping packet single-hop mode, so as to determine whether the link between the current router and the gateway is directly connected (the life cycle of the ping packet only exists in one hop, and if the current device is not directly connected to the gateway, the ping packet is discarded). If the gateway is not pinged, it indicates that the current device is not directly connected to the gateway device, and does not have a stable network environment, and therefore is not suitable for being the Controller role. In this case, the probing is stopped, the device is configured as the Agent role, and the automatic role selection is ended. If the current router pings the gateway, the router directly connected to the gateway can be selected as the candidate router device for the role selection after all the router devices in the MAP network ping the gateway.

[0117] 5. Continue to set the probe time window and periodically multicast the AP-autoconfiguration search message (the third probe message described above) of IEEE 1905 protocol; if no AP-autoconfiguration search message (the fourth probe message described above) of IEEE 1905 protocol of other router devices is received within the probe window, it is indicated that the candidate router device is unique, and the candidate router device is configured as a Controller role, stops the probe, and ends the automatic role selection.

[0118] 6. When the AP-autoconfiguration search message of IEEE 1905 protocol of other router devices is received within the probe time window, MAC address comparison is performed; if multiple AP-autoconfiguration search messages of devices are received, the MAC addresses of the devices need to be compared one by one.

[0119] Specifically, the AP-autoconfiguration search message carries the MAC address of the opposite end device, and in the scenario embodiment, the MAC address values of two devices can be compared from high bits to low bits, and according to a set comparison mode (for example, greater than or less than comparison mode, and in the embodiment, greater than is taken as an example), if the MAC address value of the device is the largest among the MAC address values of multiple candidate router devices, the device stops the probe and is configured as a Controller role, and the automatic role selection ends; if not, the device is configured as an Agent role, and the candidate router device with the largest MAC address value is uniquely selected from multiple candidate router devices, and the candidate router device is configured as a Controller role, and the remaining candidate router devices are configured as Agent roles.

[0120] At this point, the automatic role decision configuration process of the MAP network is completed.

[0121] In the scenario embodiment, the router of the direct connection gateway is filtered out by automatically executing the above function modules, so that the device running the main route Controller has a more stable network environment, and the MAC address value of the candidate router device is used to elect the final result, the device role election method is simple and efficient and the result is unique, which can effectively avoid the abnormal result that multiple Controllers or all decisions are Agents in the MAP network, thereby facilitating the stability and reliability of the network environment in the multi-access point networking scenario.

[0122] Based on the device role configuration method provided in the above embodiments, for the same inventive concept, the present application also provides a device role configuration apparatus corresponding to the above device role configuration method. The following describes the device role configuration apparatus provided in an embodiment of the present application in detail. Figure 3 The device role configuration apparatus is described in detail.

[0123] Figure 3 A structure diagram of the device role configuration apparatus provided in an embodiment of the present application is shown.

[0124] Figure 3 The device role configuration apparatus 300 shown includes:

[0125] The first multicast module 310 is configured to multicast, by a target router device of N router devices, a first probe message in a multi-access point (MAP) network when a start time node of a preset period is reached; there is at least one router device directly connected to a gateway in the MAP network; the N router devices are router devices accessing the MAP network and to be configured with a device role; and N is a positive integer.

[0126] The first detection module 320 is configured to detect whether the target router device is directly connected to the gateway when no first response message corresponding to the first probe message is received within a configured first probe window time.

[0127] The first determination module 330 is configured to determine a device role to be configured for the target router device based on media access control (MAC) addresses of each candidate router device of M candidate router devices when the target router device is directly connected to the gateway.

[0128] The M candidate router devices are router devices directly connected to the gateway of the N router devices, and M is a positive integer less than or equal to N.

[0129] As described above, the device role configuration apparatus provided in an embodiment of the present application determines whether a master router already exists in a MAP network by a target router device multicasting a probe message. When no response message is received, it is determined that no master router is configured in the MAP network. In this case, it is determined whether the target router device is a device directly connected to a gateway. If the target router device is directly connected to the gateway, a master router is uniquely determined based on MAC addresses of the current target router device and other router devices configured with a device role and also directly connected to the gateway, so that it can be determined that the device role of the target router is a master router or a sub-router.

[0130] The device role configuration apparatus of the embodiment of the present application filters out the router of the direct connection gateway by automatically executing the above-mentioned function modules, so that the device running the final main route Controller has a more stable network environment, and the MAC address value of the candidate router device is used to elect the final result, the device role election method is simple and efficient and the result is unique, which can effectively avoid the abnormal result that multiple main route Controllers appear in the MAP network or all decisions become sub-route Agents. In summary, the embodiment of the present application can reasonably realize the device role configuration of the router device, thereby facilitating the full maintenance of the stability and reliability of the network environment in the multi-access point networking situation.

[0131] According to some embodiments of the present application, optionally, after the target router device in the N router devices multicasts the first probe message in the multi-access point MAP network, the device role configuration apparatus can further include:

[0132] The second detection module can be used to detect whether the second probe message multicasted by the other router devices in the N router devices is received within the first probe window time if the first response message is not received within the first probe window time.

[0133] The first configuration module can be used to configure the device role of the target router device as a main route role if the second probe message is not detected.

[0134] The first detection module 320 can detect whether the target router device is directly connected with the gateway in the case that the first response message corresponding to the first probe message is not received within the configured first probe window time.

[0135] In the case that the first response message is not received within the first probe window time and the second probe message is not detected, whether the target router device is directly connected with the gateway is detected.

[0136] According to some embodiments of the present application, optionally, the first detection module 320 can detect whether the target router device is directly connected with the gateway in the case that the first response message corresponding to the first probe message is not received within the configured first probe window time.

[0137] The first sending sub-module can be used to send a ping command to the gateway in the case that the first response message corresponding to the first probe message is not received within the first probe window time.

[0138] The first determination sub-module can be used to determine that the target router device is directly connected with the gateway if the reply message corresponding to the ping command sent by the gateway is received.

[0139] The second determining submodule can be used to determine that the target router device is not directly connected with the gateway if the reply message sent by the gateway is not received.

[0140] According to some embodiments of the present application, before determining the device role required to be configured for the target router device based on the media access control (MAC) addresses of the M candidate router devices, the device role configuration apparatus can optionally further include:

[0141] The second multicasting module can be used to multicast, by the target router device, a third probe message in the MAP network and detect whether a fourth probe message multicasted by other router devices of the M candidate router devices is received within a second probe window time, in the case that the target router device is directly connected with the gateway.

[0142] The second configuration module can be used to configure the device role of the target router device as a master router role if the fourth probe message is not detected.

[0143] The first determining module 330, which determines the device role required to be configured for the target router device based on the media access control (MAC) addresses of the M candidate router devices, can include:

[0144] In the case that the fourth probe message is detected, the device role required to be configured for the target router device is determined based on the MAC addresses of the M candidate router devices.

[0145] According to some embodiments of the present application, the first determining module 330, which determines the device role required to be configured for the target router device based on the media access control (MAC) addresses of the M candidate router devices, can optionally include:

[0146] The first comparing submodule can be used to compare the MAC address of the target router device with the MAC address carried in the fourth probe message to obtain a comparison result of the target router device.

[0147] The first configuration submodule can be used to configure the device role of the target router device as a master router role in the case that the comparison result satisfies a preset comparison rule.

[0148] The second configuration submodule can be used to configure the device role of the target router device as a sub-router role in the case that the comparison result does not satisfy the preset comparison rule.

[0149] According to some embodiments of the present application, after the first probe message is multicast by the target router device in the multi-access point (MAP) network, the device role configuration apparatus can further include:

[0150] The third configuration module can be configured to configure the device role of the target router device as a sub-router role in a case where the first response message is received within the first probe window time.

[0151] Based on the device role configuration method provided in the above embodiments, the same inventive concept is used to provide a device role configuration device corresponding to the device role configuration method, which will be described below in detail. Figure 4 The device role configuration device will be described in detail.

[0152] Please refer to the following description Figure 4 , Figure 4 is a structural schematic diagram of the device role configuration device provided in an embodiment of the present application.

[0153] The device role configuration device can include a processor 401 and a memory 402 storing computer program instructions.

[0154] Specifically, the processor 401 can include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.

[0155] The memory 402 can include a mass storage for data or instructions. By way of example and not limitation, the memory 402 can include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. Where appropriate, the memory 402 can include removable or non-removable (or fixed) media. Where appropriate, the memory 402 can be internal or external to the integrated gateway disaster recovery device. In a particular embodiment, the memory 402 is non-volatile solid-state memory.

[0156] The memory can include read-only memory (ROM), random access memory (RAM), a disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical, or other physical / tangible memory storage device. Thus, generally, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., memory devices) encoded with software that, when executed (e.g., by one or more processors), is operable to perform operations described with reference to the methods according to an aspect of the present disclosure.

[0157] The processor 401 implements the device role configuration method in any of the above embodiments by reading and executing computer program instructions stored in the memory 402.

[0158] In one example, the data device role configuration device can further include a communication interface 403 and a bus 410. As shown, the processor 401, the memory 402, and the communication interface 403 are connected through the bus 410 and complete communication with each other. Figure 4

[0159] The communication interface 403 is mainly used to realize the communication between the modules, devices, units and / or devices in the embodiments of the present application.

[0160] The bus 410 includes hardware, software or both to couple the device role configuration device components to each other. By way of example, and not limitation, the bus can include an accelerated graphics port (AGP) or other graphics bus, an enhanced industry standard architecture (EISA) bus, a front-side bus (FSB), a HyperTransport (HT) interconnect, an industry standard architecture (ISA) bus, an InfiniBand (IB) interconnect, a low pin count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a peripheral component interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a serial advanced technology attachment (SATA) bus, a video electronics standards association local (VLB) bus, or another suitable bus or combination of two or more of these. Where appropriate, the bus 410 can include one or more buses. Although the present application describes and illustrates a particular bus, the present application contemplates any suitable bus or interconnect.

[0161] The device role configuration device executes the device role configuration method in the embodiments of the present application, thereby realizing the device role configuration method described in the embodiments of the present application.

[0162] In addition, in combination with the device role configuration method in the above embodiments, the embodiments of the present application can provide a computer storage medium to realize. The computer storage medium has computer program instructions stored thereon; the computer program instructions are executed by the processor to realize any of the device role configuration methods in the above embodiments.

[0163] Based on the device role configuration method in the above embodiments, the embodiments of the present application provide a computer program product, and the instructions in the computer program product are executed by the processor of the electronic device to make the electronic device execute the device role configuration method provided in any of the above embodiments of the present application.

[0164] ​It is to be understood that the application is not limited to particular configurations and processes described herein and shown in the drawings. The detailed description is not to be taken as limiting the application. In the above embodiments, several specific steps are described and illustrated in order to provide a thorough understanding of the application. However, the application can be practiced with fewer or additional steps, and in a different order. The application is not limited to the described and illustrated embodiments.

[0165] The functions indicated in the block diagrams of the above described structures can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, they can be, for example, electronic circuits, application specific integrated circuits (ASICs), appropriate firmware, plug-ins, functional cards, etc. When implemented in software, the elements of the application are program or code segments used to perform the required tasks. The program or code segments can be stored in a machine readable medium or transmitted through a data signal carried in a carrier wave over a transmission medium or communication link. The "machine readable medium" can include any medium that can store or transfer information. Examples of machine readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, fiber optic media, radio frequency (RF) links, etc. The code segments can be downloaded via a computer network such as the Internet, an intranet, etc.

[0166] It is also to be understood that the example embodiments described in this application are based on a series of steps or apparatuses to describe some methods or systems. However, the application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiments, or in an order different from the embodiments, or several steps can be performed simultaneously.

[0167] The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing devices to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks. The computer program instructions can also be loaded onto a computer, other programmable data processing apparatus, or other processing devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other processing devices to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide processes for implementing the functions / acts specified in the flowchart and / or block diagram block or blocks. These computer program instructions can also be stored in a computer readable medium that can direct a computer, other programmable data processing apparatus, or other processing devices to operate in a particular manner, such that the instructions stored in the computer readable medium produce an article of manufacture including instructions which implement the function / act specified in the flowchart and / or block diagram block or blocks.

[0168] The above merely describes a specific implementation of the present application. Those skilled in the art can clearly understand the specific working processes of the system, modules and units described above for the convenience and brevity of description, and the corresponding processes in the foregoing method embodiments can be referred to, which will not be described herein again. It should be understood that the protection scope of the present application is not limited in this way, and any person skilled in the art can easily think of various equivalent modifications or replacements within the technical range disclosed in the present application, and these modifications or replacements should be covered in the protection scope of the present application.

Claims

1. A method for configuring device roles, characterized in that, The method includes: Upon reaching the start time of a preset period, the target router device among the N router devices multicasts a first probe message in the multi-access point (MAP) network; at least one router device in the MAP network is directly connected to the gateway; the N router devices are router devices that have accessed the MAP network and are awaiting device role configuration, where N is a positive integer; If no first response message corresponding to the first probe message is received within the configured first probe window time, it is detected whether the target router device is directly connected to the gateway. When the target router device is directly connected to the gateway, the device role that the target router device needs to be configured is determined based on the Media Access Control (MAC) addresses of each of the M candidate router devices. Wherein, the M candidate router devices are the router devices directly connected to the gateway among the N router devices, and M is a positive integer less than or equal to N.

2. The method according to claim 1, characterized in that, After the target router device among the N router devices multicasts the first probe message in the multi-access point MAP network, the method further includes: If the first response message is not received within the first detection window time, it is detected whether a second detection message multicast by other router devices among the N router devices is received within the first detection window time; If the second probe message is not detected, configure the target router device as a master router. If no first response message corresponding to the first probe message is received within the configured first probe window time, detecting whether the target router device is directly connected to the gateway includes: If the first response message is not received and the second probe message is not detected within the first probe window time, it is detected whether the target router device is directly connected to the gateway.

3. The method according to claim 1, characterized in that, If no first response message corresponding to the first probe message is received within the configured first probe window time, detecting whether the target router device is directly connected to the gateway includes: If no first response message corresponding to the first probe message is received within the first probe window time, a ping command is sent to the gateway; If a reply message corresponding to the ping command sent by the gateway is received, it is determined that the target router device is directly connected to the gateway; If the response message sent by the gateway is not received, it is determined that the target router device is not directly connected to the gateway.

4. The method according to claim 1, characterized in that, Before determining the device role to be configured for the target router device based on the Media Access Control (MAC) addresses of each of the M candidate router devices, the method further includes: When the target router device is directly connected to the gateway, the target router device multicasts a third probe message in the MAP network and detects whether it receives a fourth probe message multicast by other router devices among the M candidate router devices within the second probe window time. If the fourth probe message is not detected, configure the target router device as a master router. The process of determining the required device role for the target router device based on the Media Access Control (MAC) addresses of each of the M candidate router devices includes: Upon detecting the fourth probe message, the device role required to be configured for the target router device is determined based on the MAC addresses of each of the M candidate router devices.

5. The method according to claim 4, characterized in that, The process of determining the required device role for the target router device based on the Media Access Control (MAC) addresses of each of the M candidate router devices includes: The MAC address of the target router device is compared with the MAC address carried in the fourth probe message to obtain the comparison result of the target router device; If the comparison result satisfies the preset comparison rules, the device role of the target router device will be configured as the main router role; If the comparison result does not meet the preset comparison rule, the device role of the target router will be configured as a sub-router role.

6. The method according to claim 1, characterized in that, After the target router device multicasts the first probe message in the multi-access point (MAP) network, the method further includes: If the first response message is received within the first detection window, the device role of the target router device is configured as a sub-router role.

7. A device for configuring device roles, characterized in that, The device includes: The first multicast module is used to multicast a first probe message in a multi-access point (MAP) network by a target router device among N router devices when the start time node of a preset period is reached; at least one router device in the MAP network is directly connected to the gateway; the N router devices are router devices that are connected to the MAP network and whose device role configuration is to be completed, and N is a positive integer; The first detection module is used to detect whether the target router device is directly connected to the gateway if no first response message corresponding to the first detection message is received within the configured first detection window time. The first determining module is used to determine the device role that the target router device needs to be configured based on the media access control MAC address of each of the M candidate router devices when the target router device is directly connected to the gateway. Wherein, the M candidate router devices are the router devices directly connected to the gateway among the N router devices, and M is a positive integer less than or equal to N.

8. A device role configuration device, characterized in that, The device includes: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, it implements the device role configuration method as described in any one of claims 1-6.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the device role configuration method as described in any one of claims 1-6.

10. A computer program product, characterized in that, When the instructions in the computer program product are executed by the processor of the electronic device, the electronic device performs the device role configuration method as described in any one of claims 1-6.