CN113873612A - Network access method and device, and storage medium - Google Patents

Network access method and device, and storage medium Download PDF

Info

Publication number
CN113873612A
CN113873612A CN202111234569.0A CN202111234569A CN113873612A CN 113873612 A CN113873612 A CN 113873612A CN 202111234569 A CN202111234569 A CN 202111234569A CN 113873612 A CN113873612 A CN 113873612A
Authority
CN
China
Prior art keywords
mesh
mesh device
network
determining
hop count
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.)
Granted
Application number
CN202111234569.0A
Other languages
Chinese (zh)
Other versions
CN113873612B (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN202111234569.0A priority Critical patent/CN113873612B/en
Publication of CN113873612A publication Critical patent/CN113873612A/en
Application granted granted Critical
Publication of CN113873612B publication Critical patent/CN113873612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/246Connectivity information discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W40/00Communication routing or communication path finding
    • H04W40/24Connectivity information management, e.g. connectivity discovery or connectivity update
    • H04W40/248Connectivity information update
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The disclosure provides a method and a device for accessing a network and a storage medium. Wherein, the method comprises the following steps: determining that a target Mesh device is detected through a wired interface of the first Mesh device, wherein the target Mesh device is a neighbor Mesh device which is in the same networking network as the first Mesh device and supports an optimal superior node as the first Mesh device; and determining that the access mode of the first Mesh device accessing the Mesh network is a wired access mode, and establishing wired connection with the target Mesh device through a wired interface of the first Mesh device. The Mesh network topology structure is optimized, and the usability is high.

Description

Network access method and device, and storage medium
Technical Field
The present disclosure relates to the field of communications, and in particular, to a method and an apparatus for accessing a network, and a storage medium.
Background
Wireless Mesh networking has developed rapidly in recent years and has become a very popular wireless function. On one hand, the configuration experience that a user needs to be matched with multiple devices for larger coverage is simplified, and on the other hand, better wireless roaming experience is provided for the user among the multiple routing devices.
Considering the wireless loss when the Mesh device is wirelessly accessed, if the Mesh device is connected with other Mesh devices in a wired access mode so as to be accessed into a Mesh network, the wireless delay and interference can be reduced, and if the Mesh device is connected with other Mesh devices in a wireless access mode so as to be accessed into the Mesh network, the Mesh device has advantages in the aspects of wiring and the like. In an actual use environment, the access mode of the Mesh device to the Mesh network is generally determined by a user.
Disclosure of Invention
In view of the above, the present application discloses a method and an apparatus for accessing a network, and a storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for accessing a network, where the method is applied to a first Mesh device, and the method includes:
determining that a target Mesh device is detected through a wired interface of the first Mesh device, wherein the target Mesh device is a neighbor Mesh device which is in the same networking network as the first Mesh device and supports an optimal superior node as the first Mesh device;
and determining that the access mode of the first Mesh device accessing the Mesh network is a wired access mode, and establishing wired connection with the target Mesh device through a wired interface of the first Mesh device.
Optionally, the method further comprises any one of:
in response to determining that the wired interface of the first Mesh device is in an unlinked state, determining that the access mode of the first Mesh device to the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device;
and in response to determining that the wired interface of the first Mesh device is in a link state but the target Mesh device is not detected, determining that the access mode of the first Mesh device accessing the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device.
Optionally, the determining that the target Mesh device is detected through a wired interface of the first Mesh device includes:
in response to determining that at least one second Mesh device is detected through the wired interface of the first Mesh device, sending a detection request message to the at least one second Mesh device through the wired interface of the first Mesh device; the second Mesh device is a neighbor Mesh device of the first Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
receiving a detection response message sent by a third Mesh device through a wired interface of the first Mesh device; the third Mesh device is a neighbor Mesh device in the second Mesh device, which is in the same networking network as the first Mesh device, and the detection response message is used for indicating that the first Mesh device and the third Mesh device are in the same networking network;
and in response to determining that a Mesh device supporting an optimal superior node as the first Mesh device exists in the third Mesh device, determining that the target Mesh device is detected through a wired interface of the first Mesh device.
Optionally, the probe request packet includes at least one of the following:
a first networking identifier of a Mesh network where the first Mesh device is located;
a first network hop count; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
Optionally, the probe response packet includes at least one of the following:
a second network hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network;
the device identifier of the third Mesh device.
Optionally, the determining that there is a Mesh device that supports an optimal superior node as the first Mesh device in the third Mesh device includes:
determining, in the third Mesh device, one Mesh device that supports a candidate upper node as the first Mesh device;
determining that the optimal superior node of the first Mesh device exists in the third Mesh devices in response to determining that the third Mesh device as the candidate superior node is the optimal superior node of the first Mesh device.
Optionally, the determining, in the third Mesh device, one Mesh device that supports a candidate upper node as the first Mesh device includes any one of:
determining that the third Mesh device supports the candidate superior node as the first Mesh device, when the number of the third Mesh device is one and the second network hop count is a valid hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network;
determining that one third Mesh device with the smallest second network hop count supports the candidate upper node as the first Mesh device when the number of the third Mesh devices is multiple and the second network hop counts are all valid hop counts; and under the condition that the number of the third Mesh devices with the minimum second network hop count is multiple, determining that one third Mesh device with a device identifier meeting a first specified condition supports the candidate upper node as the first Mesh device in the third Mesh devices with the minimum second network hop count.
Optionally, the device identifier includes a media access control MAC address, and the first specified condition includes: the MAC address is minimum, or the MAC address is maximum.
Optionally, the determining that the third Mesh device as the candidate upper node is an optimal upper node of the first Mesh device includes any one of:
in response to determining that the first Mesh device is not currently accessing the Mesh network, determining that the third Mesh device as the candidate superior node is an optimal superior node of the first Mesh device;
in response to determining that the access mode of the first Mesh device currently accessing the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is the optimal superior node of the first Mesh device under the condition that the first network hop count is greater than the second network hop count;
in response to determining that the access mode in which the first Mesh device currently accesses the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is an optimal superior node of the first Mesh device under the condition that the first network hop count is equal to the second network hop count and the device identifier of the first Mesh device and the device identifier of the candidate Mesh device meet a second specified condition;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device serving as the candidate Mesh device reaches the control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
Optionally, the device identifier includes a MAC address, and the second specified condition includes any one of:
the MAC address of the first Mesh device is smaller than the MAC addresses of the candidate Mesh devices;
the MAC address of the first Mesh device is larger than the MAC addresses of the candidate Mesh devices.
Optionally, the method further comprises:
and in response to determining that the access state of the first Mesh device accessing the Mesh network changes, determining that the access mode of the first Mesh device accessing the Mesh network is switched.
Optionally, the determining that the access state of the first Mesh device accessing the Mesh network is changed includes any one of:
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a wireless access state and detecting the target Mesh device through a wired interface of the first Mesh device, determining that the access state is changed from the wireless access state to a wired access state;
in response to the fact that the access state of the first Mesh device currently accessing the Mesh network is determined to be a wired access state and any neighbor Mesh device is not detected through a wired interface of the first Mesh device, determining that the access state is changed from the wired access state to an unaccessed state;
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is an unaccessed state and accessing the Mesh network through a wireless interface of the first Mesh device, determining that the access state is changed from the unaccessed state to a wireless access state;
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a wireless access state but the wireless connection between the first Mesh device and the Mesh network is disconnected, determining that the access state is changed from a wireless access state to a non-access state;
and in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a non-access state and detecting the target Mesh device through the wired interface of the first Mesh device, determining that the access state is changed from the non-access state to the wired access state.
Optionally, the method further comprises:
updating a first network hop count in response to determining that the access state is changed to a wired access state or that the access state is changed from an unaccessed state to a wireless access state; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
and closing the wireless interface of the first Mesh device.
Optionally, the updating the first network hop count includes:
determining the hop count of a target network; the target network hop count is used for indicating the number of Mesh devices which need to pass by when a neighbor Mesh device serving as a superior node of the first Mesh device reaches the control terminal device;
updating the first network hop count to the target network hop count plus one.
Optionally, the method further comprises:
updating a first network hop count to an invalid hop count in response to determining that the access status changes to an unaccessed status; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
Optionally, the method further comprises:
and in response to determining that the access state is changed from the wired access state to the non-access state, starting a wireless interface of the first Mesh device.
According to a second aspect of the embodiments of the present disclosure, there is provided a method for accessing a network, the method being applied to a second Mesh device, the method including:
receiving a detection request message sent by the first Mesh equipment through a wired interface of the second Mesh equipment; the first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
in response to determining that the first Mesh device and the second Mesh device are in the same networking network, sending a detection response message to the first Mesh network through a wired interface of the second Mesh device; the detection response message is used for indicating that the first Mesh device and the second Mesh device are in the same networking network.
Optionally, the probe request packet includes at least one of the following:
a first networking identifier of a Mesh network where the first Mesh device is located;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
Optionally, the determining that the first Mesh device and the second Mesh device are in the same networking network includes:
determining a second networking identifier of the Mesh network where the second Mesh device is located;
and in response to determining that the second networking identifier is the same as the first networking identifier, determining that the first Mesh device and the second Mesh device are in the same networking network.
Optionally, the probe response packet includes at least one of the following:
the second network hop count is used for indicating the number of Mesh devices which need to pass by when the second Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in the Mesh network;
the device identifier of the second Mesh device.
Optionally, after sending a probe response packet to the first Mesh network through the wired interface of the second Mesh device, the method further includes:
and establishing wired connection with the first Mesh device through a wired interface of the second Mesh device.
According to a third aspect of the embodiments of the present disclosure, there is provided an apparatus for accessing a network, where the apparatus is applied to a first Mesh device, and the apparatus includes:
a detection module, configured to determine that a target Mesh device is detected through a wired interface of the first Mesh device, where the target Mesh device is a neighbor Mesh device that is in the same networking network as the first Mesh device and supports an optimal upper node as the first Mesh device;
and the wired connection module is used for determining that the access mode of the first Mesh device accessing the Mesh network is a wired access mode and establishing wired connection with the target Mesh device through a wired interface of the first Mesh device.
According to a fourth aspect of the embodiments of the present disclosure, there is provided an apparatus for accessing a network, where the apparatus is applied to a second Mesh device, and the apparatus includes:
the receiving module is used for receiving a detection request message sent by the first Mesh device through a wired interface of the second Mesh device; the first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
a sending module, configured to send a detection response packet to the first Mesh network through a wired interface of the second Mesh device in response to determining that the first Mesh device and the second Mesh device are in the same networking network; the detection response message is used for indicating that the first Mesh device and the second Mesh device are in the same networking network.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method of accessing a network of any one of the above.
According to a sixth aspect of the embodiments of the present disclosure, there is provided an apparatus for accessing a network, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the executable instructions to implement the steps of the method of accessing a network of any of the above.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
in the disclosure, the first Mesh device may automatically determine that the access mode of accessing the Mesh network is the wired access mode and establish wired connection with the target Mesh device when detecting a neighbor Mesh device, that is, the target Mesh device, which is located in the same networking network and supports the optimal superior node of the first Mesh device, through its own wired interface, thereby achieving the purpose of automatically accessing the Mesh network through the wired access mode and optimizing the topology structure of the Mesh network.
In this disclosure, the first Mesh device may automatically determine that the access mode of the first Mesh device to the Mesh network is a wireless access mode when it is determined that the wired interface of the first Mesh device is in an unlinked state, or the wired interface of the first Mesh device is in a linked state but the target Mesh device is not detected, and access the first Mesh device to the Mesh network through the wireless interface of the first Mesh device. The Mesh network can be automatically accessed in a wireless access mode, and the topological structure of the Mesh network is optimized.
In the disclosure, the first Mesh device may determine that the access mode of the first Mesh device accessing the Mesh network is also switched when it is determined that the access state of the first Mesh device accessing the Mesh network is changed, wherein the first Mesh device may automatically switch between the wired access mode and the wireless access mode, so that the flexibility of the access mode is improved, the topology structure of the Mesh network is optimized, and the usability is high.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
Fig. 1 is a schematic view of a scenario in which a Mesh device accesses a Mesh network according to an exemplary embodiment of the present disclosure;
fig. 2 is a flow chart diagram illustrating a method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 3A is a flow chart diagram illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 3B is a flowchart illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 4 is a flowchart illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 5 is a flowchart illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 6 is a flowchart illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 7 is a schematic diagram illustrating an access state change of a Mesh device according to an exemplary embodiment of the present disclosure;
fig. 8 is a flowchart illustrating another method of accessing a network according to an exemplary embodiment of the present disclosure;
fig. 9 is a block diagram illustrating an apparatus of an access network according to an example embodiment of the present disclosure;
fig. 10 is a block diagram illustrating another apparatus of an access network according to an example embodiment of the present disclosure;
fig. 11 is a schematic structural diagram illustrating an apparatus for accessing a network according to an exemplary embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
At present, an access mode of a Mesh device when accessing a Mesh network is a connection mode between the Mesh device (generally, a Mesh device other than a control end device) and a higher-level neighbor node thereof. Referring to fig. 1, an AP #1 is a control end device in a Mesh network, and accesses an external network through a wired access manner, an upper-level neighbor node of an AP #2 is the AP #1, the AP #2 is accessed into the Mesh network through a wireless access manner, an upper-level neighbor node of an AP #3 is the AP #2, and the AP #3 is accessed into the Mesh network through a wired access manner.
In an actual use environment, the access mode shown in fig. 1 is generally determined by a user, and a better access mode cannot be determined by the Mesh device itself. In order to solve the above problem, the present disclosure provides a method for accessing a network, which may determine an access manner of accessing a Mesh network by a Mesh device itself.
The method for accessing the network provided by the present disclosure is first introduced from the first Mesh device side.
Referring to fig. 2, fig. 2 is a flowchart illustrating a method for accessing a network according to an exemplary embodiment of the present disclosure, which is described from a first Mesh device side, where the first Mesh device includes, but is not limited to, any router device except a control end device. As shown in fig. 2, the method for accessing the network includes the following steps:
in step 201, it is determined that a target Mesh device is detected through the wired interface of the first Mesh device.
The target Mesh device is a neighbor Mesh device which is in the same networking network as the first Mesh device and supports an optimal superior node as the first Mesh device.
In step 202, it is determined that the access mode of the first Mesh device accessing the Mesh network is a wired access mode, and a Mesh wired connection is established with the target Mesh device through a wired interface of the first Mesh device.
In the above embodiment, the first Mesh device may automatically determine that the access mode accessing the Mesh network is the wired access mode and establish wired connection with the target Mesh device when detecting, through its own wired interface, a neighbor Mesh device that is in the same networking network and supports an optimal superior node as the first Mesh device, that is, the target Mesh device, so as to achieve the purpose of automatically accessing the Mesh network through the wired access mode and optimize the topology structure of the Mesh network.
In some alternative embodiments, referring to fig. 3A, fig. 3A is a flow chart illustrating another method for accessing a network according to the embodiment shown in fig. 2, the method further comprising the steps of:
in step 203, in response to determining that the wired interface of the first Mesh device is in an unlinked state, determining that an access mode of the first Mesh device accessing the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device.
In the embodiment of the present disclosure, if the first Mesh device determines that no network cable accesses the wired interface of itself, it may be determined that the wired interface is in an unlinked state. Correspondingly, the first Mesh device may determine that an access mode of the first Mesh device to the Mesh network is a wireless access mode, and access the Mesh network through a wireless interface of the first Mesh device.
In the above embodiment, the first Mesh device may automatically determine that the access mode of the first Mesh device to the Mesh network is a wireless access mode when determining that the wired interface of the first Mesh device is in an unlinked state, and access the first Mesh device to the Mesh network through the wireless interface of the first Mesh device. The Mesh network can be automatically accessed in a wireless access mode, and the topological structure of the Mesh network is optimized.
In some alternative embodiments, referring to fig. 3B, fig. 3B is a flow chart illustrating another method for accessing a network according to the embodiment shown in fig. 2, the method further comprising the steps of:
in step 204, in response to determining that the wired interface of the first Mesh device is in the link state but the target Mesh device is not detected, determining that an access manner of the first Mesh device accessing the Mesh network is a wireless access manner, and accessing the Mesh network through the wireless interface of the first Mesh device.
In the embodiment of the present disclosure, if the first Mesh device determines that a network cable accesses any wired interface of itself, it may be determined that the wired interface is in a link state. Further, the first Mesh network determines that the target Mesh device is not detected through the wired interface, and then the first Mesh device may determine that an access mode of accessing the Mesh network is a wireless access mode, and access the Mesh network through the wireless interface of the first Mesh device. The target Mesh device is a neighbor Mesh device which is in the same networking network as the first Mesh device and supports the first Mesh device as an optimal superior node of the first Mesh device in the Mesh network.
In the above embodiment, the first Mesh device may automatically determine that the access mode of the first Mesh device to the Mesh network is a wireless access mode when it is determined that the wired interface of the first Mesh device is in the link state but the target Mesh device is not detected, and access the Mesh network through the wireless interface of the first Mesh device. The Mesh network can be automatically accessed in a wireless access mode, and the topological structure of the Mesh network is optimized.
In some alternative embodiments, referring to fig. 4, fig. 4 is a flowchart illustrating another method for accessing a network according to the embodiment shown in fig. 2, and step 201 may include the following steps:
in step 401, in response to determining that at least one second Mesh device is detected through the wired interface of the first Mesh device, a detection request message is sent to the at least one second Mesh device through the wired interface of the first Mesh device.
In this disclosure, the second Mesh device is a neighbor Mesh device of the first Mesh device, and the probe request packet may be used to request the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network.
In one possible implementation, the probe request message includes at least one of the following: a first networking identifier of a Mesh network where the first Mesh device is located; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network; the device identifier of the first Mesh device.
The method for determining the first networking identifier by the first Mesh device includes any one of the following:
in the first mode, the first networking identifier is determined based on information broadcast by the control end device.
The Mesh device as the control end device may automatically generate the first networking identifier if it is determined that the Mesh device is configured as the control end device, or determine the first networking identifier based on user configuration. The control end device broadcasts the first networking identifier, so that the first Mesh device determines the first networking identifier based on the information content broadcasted by the control end device.
In the second mode, the first networking identifier is determined by the superior node.
After determining the first networking identifier, the control end device may notify its own child device of the first networking identifier, and then notify its own child device of the control end device, that is, each child device determines the first networking identifier based on information sent by the upper node.
In this disclosure, the first network hop count may be used to indicate the number of Mesh devices that need to pass through from the first Mesh device to the control end device. The control terminal device is a Mesh device which communicates with an external network in a Mesh network. For example, in fig. 1, the first network hop count corresponding to AP #2 is 1, and the first network hop count corresponding to AP #3 is 2.
In the embodiment of the present disclosure, the device identification includes, but is not limited to, a MAC (Media Access Control) Address.
In step 402, a probe response message sent by a third Mesh device is received through a wired interface of the first Mesh device.
The third Mesh device is a neighbor Mesh device in the second Mesh device, which is in the same networking network as the first Mesh device, and the detection response message is used for indicating that the first Mesh device and the third Mesh device are in the same networking network. And if the first Mesh equipment does not receive any detection response message, directly determining that the target Mesh equipment is not detected.
In one possible implementation, the probe response packet includes at least one of the following: a second network hop count used for indicating the number of Mesh devices which need to pass by the third Mesh device to reach a control end device, wherein the control end device is a Mesh device which is communicated with an external network in the Mesh network; the device identifier of the third Mesh device.
In step 403, in response to determining that there is a Mesh device supporting the optimal superior node as the first Mesh device in the third Mesh device, determining that the target Mesh device is detected through the wired interface of the first Mesh device.
In the above embodiment, the first Mesh device may send the detection request packet through the wired interface, and when receiving the detection response packet sent by the third Mesh device through the wired interface, it is determined that the third Mesh device and the first Mesh device are in the same networking network.
In some optional embodiments, referring to fig. 5, fig. 5 is a flowchart of another method for accessing a network according to the embodiment shown in fig. 4, and the step 403 of determining that an optimal upper node of the first Mesh device exists in the third Mesh device may include the following steps:
in step 501, in the third Mesh device, it is determined that one Mesh device is supported as a candidate upper node of the first Mesh device.
In a possible implementation manner, if the number of the probe response packets received by the first Mesh device is one, it may be determined that the number of the third Mesh device is one, and meanwhile, the second network hop count in the received probe response packet is an effective hop count, so that the first Mesh device may determine that the third Mesh device supports the candidate upper node serving as the first Mesh device. The second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches the control end device, and the control end device is a Mesh device which communicates with an external network in the Mesh network.
In this disclosure, the second network hop count being an effective hop count may refer to that the second network hop count is an integer value greater than or equal to 0, where the second network hop count is equal to 0, which indicates that the third Mesh device is a control end device, and the second network hop count is greater than 0, which is used to indicate the number of Mesh devices through which the third Mesh device reaches the control end device. Or, the second network hop count being the valid hop count may indicate that the second network hop count does not belong to the invalid hop count, for example, it is predetermined that the invalid hop count is a negative value or a designated form, the designated form may be any form different from a non-negative integer value, and the designated form is assumed to be 0XFF, and if the second network hop count is not a negative value or 0XFF, it indicates that the second network hop count is the valid hop count.
In another possible implementation manner, the number of the probe response packets received by the first Mesh device is multiple, and the second network hops in the probe response packets are all valid hops, so that the first Mesh device may determine that one of the third Mesh devices with the smallest second network hop count supports the candidate upper node serving as the first Mesh device. In another possible implementation manner, the number of the probe response packets received by the first Mesh device is multiple, and the second network hops are both valid hops, and in addition, the number of the third Mesh devices with the smallest second network hops is also multiple, that is, the second network hops corresponding to two or more third Mesh devices are the same and the smallest, so that the first Mesh device may determine, in the third Mesh devices with the smallest second network hops, that one third Mesh device whose device identifier meets the first specified condition supports the candidate upper node as the first Mesh device. Optionally, the device identifier comprises a media access control, MAC, address, and the first specified condition comprises: the MAC address is minimum, or the MAC address is maximum.
In step 502, in response to determining that the third Mesh device as the candidate upper node is the optimal upper node of the first Mesh device, it is determined that the optimal upper node of the first Mesh device exists in the third Mesh device.
In a possible implementation manner, the first Mesh device does not currently access the Mesh network, and then the first Mesh device may directly determine that the third Mesh device serving as the candidate superior node is the optimal superior node of the first Mesh device.
In another possible implementation manner, the first Mesh device has currently accessed to the Mesh network, and the access manner is a wired access manner or a wireless access manner, so that the first Mesh device may determine that the third Mesh device serving as the candidate upper node is the optimal upper node of the first Mesh device when determining that the first network hop count is greater than the second network hop count.
The first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, the second network hop count is used for indicating the number of Mesh devices which are used as the candidate Mesh devices and are spaced between the third Mesh device and the control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network.
For example, if the first network hop count is 2 and the second network hop count is 1, the first Mesh device may determine that the candidate Mesh device is the optimal upper node of the first Mesh device.
In another possible implementation manner, a first Mesh device has currently accessed to the Mesh network, the access manner is a wired access manner or a wireless access manner, and the first network hop count is the same as the second network hop count, so that the first Mesh device may determine that the third Mesh device serving as the candidate superior node is the optimal superior node of the first Mesh device when the device identifier of the first Mesh device and the device identifier of the candidate Mesh device satisfy a second specified condition.
Wherein the device identification comprises a MAC address, and the second specified condition comprises any one of: the MAC address of the first Mesh device is smaller than the MAC addresses of the candidate Mesh devices; the MAC address of the first Mesh device is larger than the MAC addresses of the candidate Mesh devices.
For example, the first network hop count is 2, the second specified condition includes that the MAC address of the first Mesh device is smaller than the MAC address of the candidate Mesh device, and the first Mesh device may determine that the third Mesh device serving as the candidate upper node is the optimal upper node of the first Mesh device, assuming that the MAC address of the first Mesh device is smaller than the MAC address of the candidate Mesh device.
In the above embodiment, the first Mesh device may determine whether the third Mesh device serving as the candidate upper node is the optimal upper node of the first Mesh device according to the access mode currently accessing the Mesh network, the first network hop count, and the second network hop count, so as to determine the optimal access mode in the subsequent process, and the availability is high.
In some optional embodiments, referring to fig. 6, fig. 6 is a flowchart illustrating another method for accessing a network according to the embodiment shown in fig. 2, where the method may further include the following steps:
in step 205, in response to determining that the access state of the first Mesh device accessing the Mesh network changes, it is determined that the access mode of the first Mesh device accessing the Mesh network is switched.
Wherein the access state includes, but is not limited to, any of: an unaccessed state, a wired access state, and a wireless access state. In an embodiment of the present disclosure, a change procedure of the first Mesh device between different access states is provided, for example, as shown in fig. 7.
Further, the access status of the first Mesh device, the access status change condition, and the action correspondingly performed by the first Mesh device may be as shown in table 1.
TABLE 1
Figure BDA0003317254880000161
Figure BDA0003317254880000171
The first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
It should be noted that the invalid hop count may refer to a network hop count being a negative value or a designated form, and the designated form may be any form different from a non-negative integer value, assuming 0XFF, if the first network hop count is updated to the invalid hop count, the first Mesh device may update the first network hop count to any negative value, for example, -1, -0.99, etc., thereby indicating that the first network hop count is the invalid hop count. Alternatively, the first Mesh device may update the first network hop count to a specified form, such as 0XFF, indicating that the first network hop count is an invalid hop count.
And under the condition that the first Mesh device starts a wireless interface of the first Mesh device, the first Mesh device tries to access the Mesh network in a wireless access mode.
In this embodiment of the present disclosure, the updating the first network hop count may include: the target network hop count is first determined. The target network hop count is used for indicating the number of Mesh devices which need to pass by when the neighbor Mesh devices serving as the superior nodes of the first Mesh device reach the control terminal device. Further, the first network hop count is updated to the target network hop count plus one.
If the first Mesh device is in a wired connection mode with a neighbor Mesh device serving as a superior node of the first Mesh device, the neighbor Mesh device serving as the superior node of the first Mesh device is the target Mesh device, the target network hop count is the number of Mesh devices which the target Mesh device needs to pass through to reach the control end device, and the first Mesh device can determine the target network hop count through a detection response message sent by the target Mesh device.
If the first Mesh device is in a wireless connection mode with the neighbor Mesh device as the superior node, the first Mesh device can receive the target network hop count sent by the neighbor Mesh device as the superior node through a wireless interface.
In the above embodiment, it may be determined that the access mode of the first Mesh device is switched when the access state of the first Mesh device accessing the Mesh network is changed. And after the neighbor Mesh device of the superior node as the first Mesh device is changed, the first network hop count of the first Mesh device may be updated. According to the method and the device, the first Mesh equipment can be automatically switched between the wired access mode and the wireless access mode, the flexibility of the access mode is improved, meanwhile, the topological structure of the Mesh network is optimized, and the usability is high.
Next, the method for accessing the network provided by the present disclosure is described from the second Mesh device side.
Referring to fig. 8, fig. 8 is a flowchart illustrating another method for accessing a network according to an exemplary embodiment of the disclosure, which is described from the second Mesh device side, where the second Mesh device includes, but is not limited to, any router device except a control end device. As shown in fig. 8, the method for accessing the network includes the following steps:
in step 801, a probe request packet sent by the first Mesh device is received through the wired interface of the second Mesh device.
The first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request packet is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network. And after detecting the second Mesh equipment through the wired interface of the first Mesh equipment, the first Mesh equipment sends a detection request message to the second Mesh equipment. Wherein, the detection request message includes at least one of the following items: a first networking identifier of a Mesh network where the first Mesh device is located; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network; the device identifier of the first Mesh device.
In step 802, in response to determining that the first Mesh device and the second Mesh device are in the same networking network, sending a detection response message to the first Mesh network through a wired interface of the second Mesh device.
In this embodiment of the present disclosure, the second Mesh device may determine the second networking identifier of the Mesh network where the second Mesh device is located, and the determination manner is similar to the process of determining the first networking identifier by the first Mesh device, which is not described herein again.
If the second networking identifier is the same as the first networking identifier, the second Mesh device may determine that the first Mesh device and the second Mesh device are in the same networking network. If the second networking identifier is different from the first networking identifier, the second Mesh device may determine that the first Mesh device and the second Mesh device are in different networking networks.
Further, when determining that the first Mesh device and the second Mesh device are in the same networking network, the second Mesh device sends a detection response message to the first Mesh network through a wired interface of the second Mesh device, where the detection response message is used to indicate that the first Mesh device and the second Mesh device are in the same networking network. And if the first Mesh equipment and the second Mesh equipment are determined to be in different networking networks, determining not to send a detection response message to the first Mesh equipment.
In the above embodiment, the second Mesh device may determine whether the second Mesh device and the first Mesh device are in the same networking network after receiving the detection request message sent by the first Mesh device through its wired interface, and send the detection response message to the first Mesh network through the wired interface of the second Mesh device after determining that the first Mesh device and the second Mesh device are in the same networking network, so that the first Mesh device further determines the target Mesh device in the Mesh devices sending the detection response message subsequently, thereby optimizing the topology structure of the Mesh network and having high availability.
In some optional embodiments, the probe response message may include, but is not limited to, at least one of: the second network hop count is used for indicating the number of Mesh devices which need to pass by when the second Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in the Mesh network; the device identifier of the second Mesh device.
In some optional embodiments, after sending a probe response packet to the first Mesh network through the wired interface of the second Mesh device, if the first Mesh device determines that the second Mesh device is a neighbor Mesh device that supports the optimal upper node of the first Mesh device, that is, a target Mesh device, the second Mesh device may establish a wired connection with the first Mesh device through the wired interface of the second Mesh device.
In the above embodiment, the purpose of enabling the first Mesh device to automatically access the Mesh network in a wired access manner is achieved, and the topological structure of the Mesh network is optimized.
Corresponding to the embodiment of the application function implementation method, the disclosure further provides an embodiment of an application function implementation device.
Referring to fig. 9, fig. 9 is a block diagram illustrating an apparatus of an access network, the apparatus being applied to a first Mesh device, the apparatus including:
a detection module 901, configured to determine that a target Mesh device is detected through a wired interface of the first Mesh device, where the target Mesh device is a neighbor Mesh device that is in the same networking network as the first Mesh device and supports an optimal upper node as the first Mesh device;
a wired connection module 902, configured to determine that an access manner in which the first Mesh device accesses the Mesh network is a wired access manner, and establish a wired connection with the target Mesh device through a wired interface of the first Mesh device.
In some optional embodiments, the method further comprises any one of:
the first wireless connection module is used for responding to the fact that the wired interface of the first Mesh equipment is in an unlinked state, determining that the access mode of the first Mesh equipment accessing the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh equipment;
and the second wireless connection module is used for responding to the situation that the wired interface of the first Mesh device is in a link state but the target Mesh device is not detected, determining that the access mode of the first Mesh device accessing the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device.
In some optional embodiments, the detection module comprises:
the sending submodule is used for responding to the fact that at least one second Mesh device is detected through the wired interface of the first Mesh device, and sending a detection request message to the at least one second Mesh device through the wired interface of the first Mesh device; the second Mesh device is a neighbor Mesh device of the first Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
the receiving submodule is used for receiving a detection response message sent by a third Mesh device through a wired interface of the first Mesh device; the third Mesh device is a neighbor Mesh device in the second Mesh device, which is in the same networking network as the first Mesh device, and the detection response message is used for indicating that the first Mesh device and the third Mesh device are in the same networking network;
a first determining sub-module, configured to determine, in response to determining that a Mesh device supporting an optimal superior node as the first Mesh device exists in the third Mesh device, that the target Mesh device is detected through a wired interface of the first Mesh device.
In some optional embodiments, the probe request message includes at least one of:
a first networking identifier of a Mesh network where the first Mesh device is located;
a first network hop count; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
In some optional embodiments, the probe response message includes at least one of:
a second network hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network;
the device identifier of the third Mesh device.
In some optional embodiments, the first determining sub-module comprises:
a first determining unit, configured to determine, in the third Mesh device, one Mesh device that supports a candidate upper node as the first Mesh device;
a second determining unit, configured to determine that the optimal upper node of the first Mesh device exists in the third Mesh devices in response to determining that the third Mesh device serving as the candidate upper node is the optimal upper node of the first Mesh device.
In some optional embodiments, the first determining unit is further configured to:
determining that the third Mesh device supports the candidate superior node as the first Mesh device, when the number of the third Mesh device is one and the second network hop count is a valid hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network; or
Determining that one third Mesh device with the smallest second network hop count supports the candidate upper node as the first Mesh device when the number of the third Mesh devices is multiple and the second network hop counts are all valid hop counts; or
And under the condition that the number of the third Mesh devices with the minimum second network hop count is multiple, determining that one third Mesh device with a device identifier meeting a first specified condition supports the candidate upper node as the first Mesh device in the third Mesh devices with the minimum second network hop count.
In some optional embodiments, the device identification comprises a media access control, MAC, address, and the first specified condition comprises: the MAC address is minimum, or the MAC address is maximum.
In some optional embodiments, the second determining unit is further configured to:
in response to determining that the first Mesh device is not currently accessing the Mesh network, determining that the third Mesh device as the candidate superior node is an optimal superior node of the first Mesh device; or
In response to determining that the access mode of the first Mesh device currently accessing the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is the optimal superior node of the first Mesh device under the condition that the first network hop count is greater than the second network hop count; or
In response to determining that the access mode in which the first Mesh device currently accesses the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is an optimal superior node of the first Mesh device under the condition that the first network hop count is equal to the second network hop count and the device identifier of the first Mesh device and the device identifier of the candidate Mesh device meet a second specified condition;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device serving as the candidate Mesh device reaches the control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
In some optional embodiments, the device identification comprises a MAC address, and the second specified condition comprises any one of:
the MAC address of the first Mesh device is smaller than the MAC addresses of the candidate Mesh devices;
the MAC address of the first Mesh device is larger than the MAC addresses of the candidate Mesh devices.
In some optional embodiments, the apparatus further comprises:
and the determining module is used for determining that the access mode of the first Mesh device accessing the Mesh network is switched in response to determining that the access state of the first Mesh device accessing the Mesh network is changed.
In some optional embodiments, the determining module comprises any one of:
the second determining submodule is used for responding to the fact that the access state of the first Mesh device which is currently accessed to the Mesh network is determined to be a wireless access state, detecting the target Mesh device through a wired interface of the first Mesh device, and determining that the access state is changed from the wireless access state to a wired access state;
a third determining sub-module, configured to determine that an access state of the first Mesh device currently accessing the Mesh network is a wired access state, and the access state is changed from the wired access state to an unaccessed state in response to determining that the access state is the wired access state and any neighbor Mesh device is not detected through a wired interface of the first Mesh device;
a fourth determining submodule, configured to determine, in response to determining that an access state in which the first Mesh device currently accesses the Mesh network is an unaccessed state, and access the Mesh network through a wireless interface of the first Mesh device, that the access state is changed from the unaccessed state to a wireless access state;
a fifth determining sub-module, configured to determine, in response to determining that an access state in which the first Mesh device is currently accessed to the Mesh network is a wireless access state but a wireless connection between the first Mesh device and the Mesh network is disconnected, that the access state is changed from a wireless access state to an unaccessed state;
and the sixth determining submodule is used for responding to the situation that the access state of the first Mesh device which is currently accessed to the Mesh network is determined to be the non-access state, detecting the target Mesh device through the wired interface of the first Mesh device, and determining that the access state is changed from the non-access state to the wired access state.
In some optional embodiments, the apparatus further comprises:
a first updating module for updating a first network hop count in response to determining that the access status changes to a wired access status or that the access status changes from an unaccessed status to a wireless access status; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
and the first control module is used for closing the wireless interface of the first Mesh equipment.
In some optional embodiments, the first update module comprises:
a seventh determining submodule, configured to determine a target network hop count; the target network hop count is used for indicating the number of Mesh devices which need to pass by when a neighbor Mesh device serving as a superior node of the first Mesh device reaches the control terminal device;
and the updating submodule is used for updating the first network hop count into the target network hop count plus one.
In some optional embodiments, the apparatus further comprises:
a second updating module, configured to update the first network hop count to an invalid hop count in response to determining that the access status is changed to an unaccessed status; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
In some optional embodiments, the apparatus further comprises:
and the second control module is used for responding to the fact that the access state is changed from the wired access state to the non-access state, and starting a wireless interface of the first Mesh device.
Referring to fig. 10, fig. 10 is a block diagram illustrating an apparatus of an access network, the apparatus being applied to a second Mesh device, the apparatus including:
a receiving module 1001, configured to receive, through a wired interface of the second Mesh device, a probe request packet sent by the first Mesh device; the first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
a sending module 1002, configured to send a detection response packet to the first Mesh network through a wired interface of the second Mesh device in response to determining that the first Mesh device and the second Mesh device are in the same networking network; the detection response message is used for indicating that the first Mesh device and the second Mesh device are in the same networking network.
In some optional embodiments, the probe request message includes at least one of:
a first networking identifier of a Mesh network where the first Mesh device is located;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
In some optional embodiments, the sending module comprises:
an eighth determining submodule, configured to determine a second networking identifier of the Mesh network where the second Mesh device is located;
a ninth determining sub-module, configured to determine that the first Mesh device and the second Mesh device are in the same networking network in response to determining that the second networking identifier is the same as the first networking identifier.
In some optional embodiments, the probe response message includes at least one of:
the second network hop count is used for indicating the number of Mesh devices which need to pass by when the second Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in the Mesh network;
the device identifier of the second Mesh device.
In some optional embodiments, the apparatus further comprises:
and the connection module is used for establishing wired connection with the first Mesh device through the wired interface of the second Mesh device.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Accordingly, the present disclosure also provides a computer-readable storage medium for storing a computer program for implementing the steps of the method of accessing a network according to any of the above when executed by a processor.
Correspondingly, the present disclosure also provides an apparatus for accessing a network, including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the executable instructions to implement the steps of the method of accessing a network of any of the above.
As shown in fig. 11, fig. 11 is a schematic diagram illustrating a structure of an apparatus 1100 for accessing a network according to an exemplary embodiment. The apparatus 1100 may be provided as a Mesh device, and may specifically be the first Mesh device or the second Mesh device described above. Referring to fig. 11, the apparatus 1100 includes a processing component 1122, a wireless transmit/receive component 1124, an antenna component 1126, and a signal processing portion specific to the wireless interface, the processing component 1122 may further include one or more processors.
One of the processors in processing component 1122 may be configured to perform any of the methods described above for accessing a network.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. The terms "comprises," "comprising," or any other variation 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 may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (25)

1. A method for accessing a network, the method being applied to a first Mesh device, the method comprising:
determining that a target Mesh device is detected through a wired interface of the first Mesh device, wherein the target Mesh device is a neighbor Mesh device which is in the same networking network as the first Mesh device and supports an optimal superior node as the first Mesh device;
and determining that the access mode of the first Mesh device accessing the Mesh network is a wired access mode, and establishing wired connection with the target Mesh device through a wired interface of the first Mesh device.
2. The method of claim 1, further comprising any of:
in response to determining that the wired interface of the first Mesh device is in an unlinked state, determining that the access mode of the first Mesh device to the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device;
and in response to determining that the wired interface of the first Mesh device is in a link state but the target Mesh device is not detected, determining that the access mode of the first Mesh device accessing the Mesh network is a wireless access mode, and accessing the Mesh network through the wireless interface of the first Mesh device.
3. The method of claim 1, wherein determining that a target Mesh device is detected through a wired interface of the first Mesh device comprises:
in response to determining that at least one second Mesh device is detected through the wired interface of the first Mesh device, sending a detection request message to the at least one second Mesh device through the wired interface of the first Mesh device; the second Mesh device is a neighbor Mesh device of the first Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
receiving a detection response message sent by a third Mesh device through a wired interface of the first Mesh device; the third Mesh device is a neighbor Mesh device in the second Mesh device, which is in the same networking network as the first Mesh device, and the detection response message is used for indicating that the first Mesh device and the third Mesh device are in the same networking network;
and in response to determining that a Mesh device supporting an optimal superior node as the first Mesh device exists in the third Mesh device, determining that the target Mesh device is detected through a wired interface of the first Mesh device.
4. The method of claim 3, wherein the probe request message comprises at least one of:
a first networking identifier of a Mesh network where the first Mesh device is located;
a first network hop count; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
5. The method of claim 3, wherein the probe response message comprises at least one of:
a second network hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network;
the device identifier of the third Mesh device.
6. The method of claim 3, wherein the determining that the Mesh device supporting the optimal superior node as the first Mesh device exists in the third Mesh device comprises:
determining, in the third Mesh device, one Mesh device that supports a candidate upper node as the first Mesh device;
determining that the optimal superior node of the first Mesh device exists in the third Mesh devices in response to determining that the third Mesh device as the candidate superior node is the optimal superior node of the first Mesh device.
7. The method according to claim 6, wherein the determining, in the third Mesh device, one Mesh device that supports a candidate upper node as the first Mesh device includes any one of:
determining that the third Mesh device supports the candidate superior node as the first Mesh device, when the number of the third Mesh device is one and the second network hop count is a valid hop count; the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network;
determining that one third Mesh device with the smallest second network hop count supports the candidate upper node as the first Mesh device when the number of the third Mesh devices is multiple and the second network hop counts are all valid hop counts;
and under the condition that the number of the third Mesh devices with the minimum second network hop count is multiple, determining that one third Mesh device with a device identifier meeting a first specified condition supports the candidate upper node as the first Mesh device in the third Mesh devices with the minimum second network hop count.
8. The method of claim 7, wherein the device identification comprises a Media Access Control (MAC) address, and wherein the first specified condition comprises: the MAC address is minimum, or the MAC address is maximum.
9. The method according to claim 6, wherein the determining that the third Mesh device as the candidate superior node is an optimal superior node of the first Mesh device comprises any one of:
in response to determining that the first Mesh device is not currently accessing the Mesh network, determining that the third Mesh device as the candidate superior node is an optimal superior node of the first Mesh device;
in response to determining that the access mode of the first Mesh device currently accessing the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is the optimal superior node of the first Mesh device under the condition that the first network hop count is greater than the second network hop count;
in response to determining that the access mode in which the first Mesh device currently accesses the Mesh network is a wired access mode or a wireless access mode, determining that the third Mesh device serving as the candidate superior node is an optimal superior node of the first Mesh device under the condition that the first network hop count is equal to the second network hop count and the device identifier of the first Mesh device and the device identifier of the candidate Mesh device meet a second specified condition;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, the second network hop count is used for indicating the number of Mesh devices which need to pass by when the third Mesh device serving as the candidate Mesh device reaches the control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
10. The method according to claim 9, wherein the device identification comprises a MAC address, and wherein the second specified condition comprises any one of:
the MAC address of the first Mesh device is smaller than the MAC addresses of the candidate Mesh devices;
the MAC address of the first Mesh device is larger than the MAC addresses of the candidate Mesh devices.
11. The method according to any one of claims 1-10, further comprising:
and in response to determining that the access state of the first Mesh device accessing the Mesh network changes, determining that the access mode of the first Mesh device accessing the Mesh network is switched.
12. The method according to claim 11, wherein the determining that the access status of the first Mesh device to the Mesh network is changed comprises any one of:
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a wireless access state and detecting the target Mesh device through a wired interface of the first Mesh device, determining that the access state is changed from the wireless access state to a wired access state;
in response to the fact that the access state of the first Mesh device currently accessing the Mesh network is determined to be a wired access state and any neighbor Mesh device is not detected through a wired interface of the first Mesh device, determining that the access state is changed from the wired access state to an unaccessed state;
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is an unaccessed state and accessing the Mesh network through a wireless interface of the first Mesh device, determining that the access state is changed from the unaccessed state to a wireless access state;
in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a wireless access state but the wireless connection between the first Mesh device and the Mesh network is disconnected, determining that the access state is changed from a wireless access state to a non-access state;
and in response to determining that the access state of the first Mesh device currently accessing the Mesh network is a non-access state and detecting the target Mesh device through the wired interface of the first Mesh device, determining that the access state is changed from the non-access state to the wired access state.
13. The method of claim 12, further comprising:
updating a first network hop count in response to determining that the access state is changed to a wired access state or that the access state is changed from an unaccessed state to a wireless access state; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
and closing the wireless interface of the first Mesh device.
14. The method of claim 13, wherein updating the first network hop count comprises:
determining the hop count of a target network; the target network hop count is used for indicating the number of Mesh devices which need to pass by when a neighbor Mesh device serving as a superior node of the first Mesh device reaches the control terminal device;
updating the first network hop count to the target network hop count plus one.
15. The method of claim 12, further comprising:
updating a first network hop count to an invalid hop count in response to determining that the access status changes to an unaccessed status; the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which communicates with an external network in a Mesh network.
16. The method of claim 15, further comprising:
and in response to determining that the access state is changed from the wired access state to the non-access state, starting a wireless interface of the first Mesh device.
17. A method for accessing a network, wherein the method is applied to a second Mesh device, and the method comprises:
receiving a detection request message sent by the first Mesh equipment through a wired interface of the second Mesh equipment; the first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
in response to determining that the first Mesh device and the second Mesh device are in the same networking network, sending a detection response message to the first Mesh network through a wired interface of the second Mesh device; the detection response message is used for indicating that the first Mesh device and the second Mesh device are in the same networking network.
18. The method of claim 17, wherein the probe request message comprises at least one of:
a first networking identifier of a Mesh network where the first Mesh device is located;
the first network hop count is used for indicating the number of Mesh devices which need to pass by when the first Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in a Mesh network;
the device identifier of the first Mesh device.
19. The method of claim 18, wherein the determining that the first Mesh device and the second Mesh device are within a same networking network comprises:
determining a second networking identifier of the Mesh network where the second Mesh device is located;
and in response to determining that the second networking identifier is the same as the first networking identifier, determining that the first Mesh device and the second Mesh device are in the same networking network.
20. The method of claim 17, wherein the probe response message comprises at least one of:
the second network hop count is used for indicating the number of Mesh devices which need to pass by when the second Mesh device reaches a control end device, and the control end device is a Mesh device which is communicated with an external network in the Mesh network;
the device identifier of the second Mesh device.
21. The method of claim 17, wherein after sending a probe response message to the first Mesh network through the wired interface of the second Mesh device, the method further comprises:
and establishing wired connection with the first Mesh device through a wired interface of the second Mesh device.
22. An apparatus for accessing a network, the apparatus being applied to a first Mesh device, the apparatus comprising:
a detection module, configured to determine that a target Mesh device is detected through a wired interface of the first Mesh device, where the target Mesh device is a neighbor Mesh device that is in the same networking network as the first Mesh device and supports an optimal upper node as the first Mesh device;
and the wired connection module is used for determining that the access mode of the first Mesh device accessing the Mesh network is a wired access mode and establishing wired connection with the target Mesh device through a wired interface of the first Mesh device.
23. An apparatus for accessing a network, the apparatus being applied to a second Mesh device, the apparatus comprising:
the receiving module is used for receiving a detection request message sent by the first Mesh device through a wired interface of the second Mesh device; the first Mesh device is a neighbor Mesh device of the second Mesh device, and the detection request message is used for requesting the second Mesh device to determine whether the first Mesh device and the second Mesh device are in the same networking network;
a sending module, configured to send a detection response packet to the first Mesh network through a wired interface of the second Mesh device in response to determining that the first Mesh device and the second Mesh device are in the same networking network; the detection response message is used for indicating that the first Mesh device and the second Mesh device are in the same networking network.
24. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of accessing a network according to any one of claims 1 to 16 or 17 to 21.
25. An apparatus for accessing a network, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to execute the executable instructions to implement the steps of the method of accessing the network of any one of claims 1-16 or 17-21.
CN202111234569.0A 2021-10-22 2021-10-22 Method and device for accessing network and storage medium Active CN113873612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111234569.0A CN113873612B (en) 2021-10-22 2021-10-22 Method and device for accessing network and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111234569.0A CN113873612B (en) 2021-10-22 2021-10-22 Method and device for accessing network and storage medium

Publications (2)

Publication Number Publication Date
CN113873612A true CN113873612A (en) 2021-12-31
CN113873612B CN113873612B (en) 2024-03-01

Family

ID=78997262

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111234569.0A Active CN113873612B (en) 2021-10-22 2021-10-22 Method and device for accessing network and storage medium

Country Status (1)

Country Link
CN (1) CN113873612B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103220191A (en) * 2013-04-27 2013-07-24 四川长虹电器股份有限公司 Method for automatically switching multiple types of networks
WO2016201844A1 (en) * 2015-06-15 2016-12-22 中兴通讯股份有限公司 Method and apparatus for discovering network neighbouring device
US20170034072A1 (en) * 2015-07-31 2017-02-02 Xiaomi Inc. Methods, devices, and systems for accessing network
CN106686645A (en) * 2017-01-16 2017-05-17 湖南基石通信技术有限公司 Method for improving multi-hop transport link throughput and system thereof
CN107623604A (en) * 2017-10-24 2018-01-23 北京艾恩斯网络科技有限公司 mesh network backbone node equipment and data transmission method, mesh network system
CN109982298A (en) * 2019-02-19 2019-07-05 深圳市和盈互联科技有限公司 It is a kind of that network method is matched based on Internet of Things Wi-Fi module
CN113098797A (en) * 2021-03-24 2021-07-09 深圳市乙辰科技股份有限公司 Network connection method and device based on distributed networking system and computer equipment
CN113163467A (en) * 2021-04-29 2021-07-23 北京小米移动软件有限公司 Node hop count updating method, device, terminal and storage medium in Mesh network
CN113329474A (en) * 2021-05-10 2021-08-31 北京小米移动软件有限公司 Method for accessing node to Mesh network, information interaction device, terminal and storage medium
CN113395745A (en) * 2021-05-13 2021-09-14 北京小米移动软件有限公司 Method, device, terminal and storage medium for accessing Mesh network

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103220191A (en) * 2013-04-27 2013-07-24 四川长虹电器股份有限公司 Method for automatically switching multiple types of networks
WO2016201844A1 (en) * 2015-06-15 2016-12-22 中兴通讯股份有限公司 Method and apparatus for discovering network neighbouring device
US20170034072A1 (en) * 2015-07-31 2017-02-02 Xiaomi Inc. Methods, devices, and systems for accessing network
CN106686645A (en) * 2017-01-16 2017-05-17 湖南基石通信技术有限公司 Method for improving multi-hop transport link throughput and system thereof
CN107623604A (en) * 2017-10-24 2018-01-23 北京艾恩斯网络科技有限公司 mesh network backbone node equipment and data transmission method, mesh network system
CN109982298A (en) * 2019-02-19 2019-07-05 深圳市和盈互联科技有限公司 It is a kind of that network method is matched based on Internet of Things Wi-Fi module
CN113098797A (en) * 2021-03-24 2021-07-09 深圳市乙辰科技股份有限公司 Network connection method and device based on distributed networking system and computer equipment
CN113163467A (en) * 2021-04-29 2021-07-23 北京小米移动软件有限公司 Node hop count updating method, device, terminal and storage medium in Mesh network
CN113329474A (en) * 2021-05-10 2021-08-31 北京小米移动软件有限公司 Method for accessing node to Mesh network, information interaction device, terminal and storage medium
CN113395745A (en) * 2021-05-13 2021-09-14 北京小米移动软件有限公司 Method, device, terminal and storage medium for accessing Mesh network

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
孔繁利;赵建军;: "基于Mesh技术的列车无线网络", 中国铁路, no. 12 *
方原柏;: "无线网络中无线通信和有线通信的结合", 自动化仪表, no. 08 *
陈杰;: "WiFi Mesh大都市环境下的组网性能研究", 移动通信, no. 06 *

Also Published As

Publication number Publication date
CN113873612B (en) 2024-03-01

Similar Documents

Publication Publication Date Title
KR100709501B1 (en) Method and apparatus for discovering neighbors within a piconet communication system
US20060285510A1 (en) Method and apparatus for transferring frames in extended wireless LAN
US9495326B2 (en) Providing communication path information in a hybrid communication network
US10171986B2 (en) Radio relay device and system with waiting time optimization
CN110089089B (en) Network access method and equipment
KR20070081733A (en) Apparatus for setting multipath and method thereof
KR101665415B1 (en) Service information discovery method and device
JP6239636B2 (en) System, apparatus, and method for range expansion of wireless communication (RANGEEXTENSION)
CN106330723B (en) Discovery method and device of network neighbor equipment
CN112073920A (en) Networking method of wireless grid network node and network node equipment
WO2018192264A1 (en) Configuration method and device for relay communication
EP1953967B1 (en) Controlling channel change in an access point of a wireless local area network
CN113891429A (en) Equipment network access method, device, system and storage medium
CN111935763B (en) Method for improving data transmission reliability in wireless mesh network and network system
WO2018192265A1 (en) Configuration method and device for relay communication
JP2011146850A (en) Radio multi-hop communication device and transmission power control method of the same
CN108370610A (en) Interference mitigation in dense grid network
JP6264856B2 (en) Node device, control program, wireless communication system, and data communication method
KR101039097B1 (en) ADDRESS ASSIGNMENT METHOD AND TRANSMISSION METHOD OF MOBILE OF MOBILE NODES FOR HIERARCHICAL ROUTING IN LoWPANs
CN113873612A (en) Network access method and device, and storage medium
CN110913410A (en) Network access method, device, equipment and storage medium of network node
CN108174434A (en) A kind of method, terminal and smart machine for automatically switching communication mode
CN103327482A (en) Terminal and network switching control method
US7433330B2 (en) Method and apparatus for sending IP multicast packets in a wireless communication system
JP6698700B2 (en) Aggregating target and exploration queries

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