CN115474257A - Method and device for accessing Mesh network - Google Patents

Method and device for accessing Mesh network Download PDF

Info

Publication number
CN115474257A
CN115474257A CN202211054994.6A CN202211054994A CN115474257A CN 115474257 A CN115474257 A CN 115474257A CN 202211054994 A CN202211054994 A CN 202211054994A CN 115474257 A CN115474257 A CN 115474257A
Authority
CN
China
Prior art keywords
mesh
bluetooth
unicast address
mesh network
mac address
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.)
Pending
Application number
CN202211054994.6A
Other languages
Chinese (zh)
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.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing 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 Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202211054994.6A priority Critical patent/CN115474257A/en
Publication of CN115474257A publication Critical patent/CN115474257A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W48/00Access restriction; Network selection; Access point selection
    • H04W48/08Access restriction or access information delivery, e.g. discovery data delivery
    • H04W48/10Access restriction or access information delivery, e.g. discovery data delivery using broadcasted information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/80Services using short range communication, e.g. near-field communication [NFC], radio-frequency identification [RFID] or low energy communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W8/00Network data management
    • H04W8/26Network addressing or numbering for mobility support
    • 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)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The invention belongs to the technical field of communication, particularly relates to a method and equipment for accessing a Mesh network, and relates to the technical field of communication. The method comprises the following steps: receiving a broadcast message sent by a Bluetooth Mesh device, wherein the broadcast message is used for indicating the Bluetooth Mesh device to be accessed into a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation; obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address; and sending the unicast address list and the preset Mesh network parameters to a Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcasting. The method reduces the distribution network steps of manual operation of the user, is simple and convenient, improves the distribution network speed, improves the user experience, has high distribution network stability, and realizes the automatic configuration function of multiple Mesh nodes.

Description

Method and device for accessing Mesh network
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a method and equipment for accessing a Mesh network.
Background
Bluetooth technology is one of the most popular wireless communication technologies used worldwide. Among them, bluetooth Low Energy (BLE) is now widely adopted and is disposed on smart phones, tablet computers, smart lamps and other smart devices (e.g., internet of things lamps), and a BLE Mesh network is a new Bluetooth standard based on BLE approved in 2017, and is a networking technology capable of realizing many-to-many (m: m) device communication.
The conventional BLE Mesh equipment, such as a spotlight for illumination, is generally characterized in that a switch is used for controlling a group of spotlights, when network access configuration is needed, the switches are repeatedly turned on and off to enable the spotlights to enter a configuration mode, and then each spotlight is sequentially configured in a networking manner.
In the networking configuration process, a connection needs to be established with each Mesh node to be networked through a configuration terminal such as a mobile phone and the like, and a Generic Attribute configuration bearer (PB-GATT) is sequentially set.
Disclosure of Invention
In order to solve the above problems in the prior art, that is, to solve the problems that the process of adding multiple Mesh nodes into the Mesh network is extremely tedious and time-consuming, the installation efficiency is seriously affected, and the user experience is reduced, the present invention provides a method for accessing a Mesh network, which comprises:
a method of accessing a Mesh network, comprising:
receiving a broadcast message sent by a Bluetooth Mesh device, wherein the broadcast message is used for indicating the Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC (media access control) address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relationship;
obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address;
and sending the unicast address list and the preset Mesh network parameters to a Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcasting.
In a possible design, the obtaining a unicast address list according to the MAC address, where a correspondence between the MAC address of the bluetooth Mesh device and the unicast address is stored in the unicast address list, includes:
configuring a unicast address according to each MAC address;
and obtaining a unicast address list according to the MAC address and the corresponding unicast address.
In one possible design, the configuring the unicast address according to each MAC address includes:
if the Mesh gateway is connected with a cloud server, acquiring a unicast address distributed by the cloud server from the cloud server;
and if the Mesh gateway is not connected with the cloud server, the Mesh gateway directly allocates a unicast address.
In a second aspect, the present application provides a method for accessing a Mesh network, including:
sending a broadcast message to a Mesh gateway, wherein the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
acquiring preset Mesh network parameters and a unicast address list sent by the Mesh gateway;
and adding the Bluetooth Mesh device into the Mesh network according to the preset Mesh network parameters and a unicast address list, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address.
In one possible design, before sending the broadcast message to the Mesh gateway, the method further includes:
if the configuration information sent by the starting configuration terminal is acquired within the preset duration range, accessing the Mesh network according to the configuration information sent by the starting configuration terminal;
and if the configuration information sent by the starting configuration terminal is not acquired within the preset time length range, sending a broadcast message to the Mesh gateway.
In a possible design, after joining the Mesh network according to the preset Mesh network parameter and the unicast address list, the method further includes: and broadcasting state information in the Mesh network, wherein the state information is used for indicating the Bluetooth Mesh equipment to successfully access the Mesh network.
In a third aspect, the present application provides a device accessing a Mesh network, where the device is a network device, and the device includes:
the device comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a broadcast message sent by a Bluetooth Mesh device, the broadcast message is used for indicating the Bluetooth Mesh device to be accessed into a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
the processing module is used for obtaining a unicast address list according to the MAC address, and the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address;
and the sending module is used for sending the unicast address list and the preset Mesh network parameters to the Bluetooth Mesh equipment to be accessed into the Mesh network through Bluetooth broadcasting.
In a fourth aspect, the present application provides a device accessing a Mesh network, where the device is a terminal device, and the device includes:
the device comprises a sending module, a sending module and a sending module, wherein the sending module is used for sending a broadcast message to a Mesh gateway, the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
the receiving module is used for receiving the preset Mesh network parameters and the unicast address list sent by the Mesh gateway;
and the processing module is used for adding the Bluetooth Mesh network according to the preset Mesh network parameters and a unicast address list, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh equipment and the unicast address.
In a fifth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement a method of accessing a Mesh network as illustrated by the first aspect and various possible designs of the first aspect above.
In a sixth aspect, the present application provides an electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement a method of accessing a Mesh network as shown in the second aspect and various possible designs of the second aspect above.
In a seventh aspect, the present application provides a computer-readable storage medium, in which computer-executable instructions are stored, and when the computer-executable instructions are executed by a processor, the method for accessing a Mesh network is implemented as shown in the first aspect and various possible designs of the first aspect.
In an eighth aspect, the present application provides a computer-readable storage medium having stored therein computer-executable instructions for implementing a method for accessing a Mesh network as shown in the second aspect and various possible designs of the second aspect.
The technical personnel in the field can understand that, according to the method and the device for accessing the Mesh network provided by the invention, the broadcast message sent by the bluetooth Mesh device is received, the broadcast message is used for indicating the bluetooth Mesh device to be accessed into the Mesh network, the broadcast message comprises the MAC address of the bluetooth Mesh device, and the MAC address and the bluetooth Mesh device have a corresponding relationship; obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address; the unicast address list and the preset Mesh network parameters are transmitted to the Bluetooth Mesh device to be connected into the Mesh network through Bluetooth broadcasting, so that the distribution network steps of manual operation of a user are reduced, simplicity and convenience are realized, the distribution network speed is improved, the user experience is improved, the distribution network stability is high, and the automatic configuration function of multiple Mesh nodes is realized.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
Fig. 1 is a schematic view of an application scenario of accessing a Mesh network according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a method for accessing a Mesh network according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a method for accessing a Mesh network according to a second embodiment of the present application;
fig. 4 is a schematic flowchart of a method for accessing a Mesh network according to a third embodiment of the present application;
fig. 5 is a schematic structural diagram of a network device accessing a Mesh network according to an embodiment of the present application;
fig. 6 is a schematic hardware structure diagram of a network electronic device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a terminal device accessing to a Mesh network according to an embodiment of the present application;
fig. 8 is a schematic diagram of a hardware structure of a terminal electronic device according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims, and not all embodiments. Other embodiments, which can be derived by one of ordinary skill in the art from the embodiments given herein without any creative effort, shall fall within the protection scope of the present invention.
First, terms related to the present application are explained:
mesh network: also known as a "multihop network," refers to a network in which data and control commands are transmitted between network nodes by dynamic routing. The network can keep the connection between each node complete, when a certain node in the network topology fails or cannot serve, the architecture allows a new route to be formed by using a 'jumping' mode and then the message is sent to a transmission destination, and each node in the Mesh network needs to be configured and then networked, so that the overall safety of the Mesh network is ensured.
MAC address: namely a Media Access Control Address (MAC Address), also called local area network Address (LAN Address), MAC Address, ethernet Address or Physical Address, which is an Address used to identify the location of the network device, one Address for each bluetooth Mesh device.
And (4) Mesh gateway: the Bluetooth Mesh terminal device has the Bluetooth communication capacity and the networking capacity, assists a network device networked by the Bluetooth Mesh terminal device, a command issued by the cloud server can be issued to the Bluetooth Mesh device through the Mesh gateway, and the state of the Bluetooth Mesh device can be reported to the cloud server through the Mesh gateway.
Bluetooth Mesh equipment: the terminal device capable of accessing the Mesh network has a bluetooth connection function, but does not have a configuration function, and needs other devices having the configuration function to start and configure the terminal device, such as a spotlight, a down lamp and other lighting devices.
Node (node): is a connection point, representing a redistribution point (redistribution point) or a communication end point (some end devices). The definition of the nodes depends on the mentioned network and protocol layers. A physical network node is an active electronic device connected to a network and capable of sending, receiving or forwarding information over a communication channel.
Unicast Address (Unicast Address): for identifying a single interface, datagrams sent to a unicast address are delivered to the interface identified by the address. Is a necessary parameter of the bluetooth Mesh network, and has a unique interface address in the Mesh network, which can identify an element in a node, and the node is allocated to obtain when accessing the network. A Mesh network may have 32767 unicast addresses.
Network identification (Network ID): the identifier is the identifier information of a machine in a network, for a specific machine, the IP address and the MAC address of the machine are identified in the network, different layers in the network have different identifiers, the identifier of a data link layer is the MAC address, the identifier of a network layer is the IP address, and the identifier of a transmission layer is the port number of UDP or TCP.
Initialization vector index (IV index): refers to a 32-bit value that is shared by all nodes in the network. The purpose of this is to provide entropy (randomness) in the computation of message random values.
Network Key (Network Key): refers to a key used in the network.
Application Key (application Key): i.e. the usual attribute key, which can be pressed to open a shortcut menu.
Broadcast packet (ADV): namely, broadcast packets, are data transmitted to each node in a broadcast manner in network communication. Broadcast messages can be extremely burdensome on the network because they require every host on the network to service them, so the ability to send broadcast packets is limited to those sockets that are explicitly labeled as being allowed to be broadcast, and since one datagram socket must be bundled before broadcast is used, all broadcast messages received carry the sender's address and port.
Response packet (Scan Response, scan _ RSP): i.e. a scan response after a bluetooth broadcast.
Universal Unique Identifier (UUID): is a standard for software construction, consisting of a set of 32-bit 16-ary digits. The aim is to make all elements in the distributed system have unique identification information without the need of specifying the identification information through a central control end.
PB-GATT: the generic attribute configuration bearer layer is generally used for a server device that does not support PB-ADV (devices that do not start configuration are added to a Mesh network and are mostly used for devices carrying a Mesh protocol stack in an ADV bearer manner), and connection configuration is implemented by exchanging Proxy configuration protocol data units (Proxy PDUs) between a Proxy server and a Proxy client.
Fig. 1 is a schematic view of an application scenario of a method for accessing a Mesh network according to an embodiment of the present application. As shown in fig. 1, a user newly purchases a batch of bluetooth Mesh devices 101 supporting Mesh networking, for example, spot lights, and after the spot lights are mounted on a wall, in order to facilitate subsequent remote intelligent control of each spot light, network configuration needs to be performed on each spot light, therefore, firstly, the spot lights need to be activated and configured, the activation configuration is a safe process, originally, the devices not activated and configured will have a series of encryption keys after being activated and configured, so as to ensure the security and control accuracy of an information transmission process, in the existing activation configuration process, usually, a plurality of switches are continuously switched to trigger the spot lights connected on the same line to enter a configuration mode at the same time, but after entering, each spot light needs to be identified by an activation configuration terminal 102, for example, a tablet computer or a smart phone, to select and activate each spot light, and configured specific Mesh network information is obtained from a cloud server 103 or a hardware server 104, which is tedious in step and configuration time is long.
The method for accessing the Mesh network provided by the application aims to solve the technical problems in the prior art.
The following describes the technical solutions of the present application and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 2 is a schematic flowchart of a method for accessing a Mesh network according to an embodiment of the present application. As shown in fig. 2, a method for accessing a Mesh network includes:
s201, receiving a broadcast message sent by a Bluetooth Mesh device, wherein the broadcast message is used for indicating the Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
specifically, the bluetooth Mesh device sends a broadcast message to the surrounding devices through bluetooth broadcast, which indicates that the bluetooth Mesh device is currently in a state to be networked, and simultaneously broadcasts identification information, namely an MAC address, required by the bluetooth Mesh device for networking, so that the configuration terminal is conveniently started to execute networking configuration operation while receiving the broadcast message.
S202, obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address;
specifically, after receiving a broadcast message, the Mesh gateway acquires an MAC address in the broadcast message according to a configuration state to be networked, then judges the networking state of the Mesh gateway, acquires a unicast address list prestored in the cloud server when the Mesh gateway is connected with the cloud server, wherein the unicast address list stores a corresponding relation between the MAC address and the unicast address, finds a corresponding single address according to the MAC address, and if the corresponding relation between the MAC address and the unicast address is not found in the cloud server, the cloud server allocates a unicast address according to the MAC address and records the allocated unicast address and the MAC address into the unicast address list; when the Mesh gateway is not connected with the cloud server, namely in a single machine mode, the Mesh gateway allocates a unicast address according to the MAC address, and then correspondingly records the allocated unicast address and the MAC address into a unicast address list.
S203, the unicast address list and the preset Mesh network parameters are sent to the Bluetooth Mesh equipment to be accessed into the Mesh network through Bluetooth broadcast.
Specifically, after a unicast address list is obtained, the preset Mesh network parameters and the unicast address list are packaged and then sent to all the bluetooth Mesh devices through a bluetooth broadcast group, after receiving the preset Mesh network parameters and the unicast address list, the bluetooth Mesh devices find unicast addresses corresponding to the MAC addresses of the bluetooth Mesh devices from the unicast address list, and then access to the Mesh network according to the unicast addresses and the preset Mesh network parameters.
In the method provided by this embodiment, a broadcast message sent by a bluetooth Mesh device is received, where the broadcast message is used to indicate that the bluetooth Mesh device is to be accessed to a Mesh network, and the broadcast message includes an MAC address of the bluetooth Mesh device, where the MAC address and the bluetooth Mesh device have a corresponding relationship; obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address; the unicast address list and the preset Mesh network parameters are transmitted to the Bluetooth Mesh device to be connected into the Mesh network through Bluetooth broadcasting, so that the distribution network steps of manual operation of a user are reduced, simplicity and convenience are realized, the distribution network speed is improved, the user experience is improved, the distribution network stability is high, and the automatic configuration function of multiple Mesh nodes is realized.
The method for accessing the Mesh network according to the present application is described in detail below with reference to a specific embodiment.
Fig. 3 is a schematic flowchart of a method for accessing a Mesh network according to a second embodiment of the present application. As shown in fig. 3, the method includes:
s301, receiving a broadcast message sent by a Bluetooth Mesh device, wherein the broadcast message is used for indicating the Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
the implementation manner of S301 is similar to that of S201 described above, and this embodiment is not described here again.
S302, configuring a unicast address according to each MAC address;
s303, if the Mesh gateway is connected with a cloud server, acquiring a unicast address distributed by the cloud server from the cloud server;
s304, if the Mesh gateway is not connected with the cloud server, the Mesh gateway directly allocates a unicast address;
s305, obtaining a unicast address list according to the MAC address and the corresponding unicast address;
in particular, there may be 32767 unicast addresses due to a Mesh network. The unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are assigned in advance, so that the phenomenon that the cloud server and the Mesh gateway are repeated when the unicast address are assigned is avoided. And when the cloud server is not connected, the unicast address is distributed to the node through the Mesh gateway, the unique distribution is carried out on the basis of the MAC address, and the corresponding relation between the unicast address and the MAC address is recorded. And integrating the corresponding relation between the unicast address and the MAC address, which are distributed or directly obtained and correspond to the Bluetooth Mesh equipment of the current network to be distributed, to obtain a unicast address list.
S306, the unicast address list and the preset Mesh network parameters are sent to the Bluetooth Mesh equipment to be accessed into the Mesh network through Bluetooth broadcast.
Specifically, the preset Mesh Network parameters include Mesh Network parameters such as a Mesh ID, an IV index, a Mesh Key, and an application Key, the Unicast Address list and the preset Mesh Network parameters jointly form Mesh configuration information, after acquiring the Mesh configuration information, the Mesh gateway needs to send a bluetooth broadcast at an appointed UUID and needs to broadcast the encrypted Mesh configuration information, the encryption method adopts an RC4 or AES-128 algorithm, the encryption Key is generated according to an MAC Address, the Mesh configuration information is respectively contained in a broadcast packet (Advertising Data) and a Response packet (Scan Response), when the length of the encrypted Mesh Network parameters such as the Mesh ID, the IV index, the Mesh Key, the application Key, the MAC, and the Unicast Address is too long, the lengths of the broadcast packet (Advertising Data) and the Response packet (Scan Response packet) are not enough, and the broadcast packet can be polled and sent in multiple broadcast packets, the header of each packet must contain a field length, and a subsequent sub-packet is convenient.
The format of the broadcast packet and the response packet is as follows:
Figure BDA0003825180140000101
in the table, service UUID: custom UUIDs, such as 0xFF01.
CID (Company Identifiers): company logo, e.g. 0x0123.
The Service Header is defined as follows:
Figure BDA0003825180140000111
in the table, message ID: due to the length of the configuration message, one configuration message can be sent in N packets, one round of complete configuration message is sent every time, and the message ID of each broadcast packet in one round is kept unique.
Data encryption indication: determining whether the sent Service Data is encrypted, 1: encrypting; 0: it is not encrypted.
Version information: a value between 0 and 7.
Service Header Byte 1: the frame number and the frame number are as follows:
Figure BDA0003825180140000112
frame number: if a configuration is split into multiple frames, the Service Data following an ADV or SCAN _ RSP is 1 frame.
Total number of unpacking frames: if one configuration information is broken into 4 frames, 2 different sets of ADV and SCAN _ RSP need to be broadcast.
Service Header Byte 2: total length of frame data. The length is 0 to 250.
Total length of frame data: i.e. the total length of the configuration message.
The format of the Mesh network configuration information carried in Service Data is as follows:
Figure BDA0003825180140000113
Figure BDA0003825180140000121
the structure of the network Key is as follows:
1 NETWORK_INDEX Short 2 Network Key Index
2 NETWORK_KEY Char 16 Network Key
the structure of the ApplicationKey is as follows:
1 APPLICATION_KEY_INDEX Short 2 Application Key Index
2 NETWORK_INDEX Short 2 Network Key Index
3 APPLICATION_KEY_KEY Char 16 Application Key
ElementAddress structure, all scanned devices are each assigned a Unicast address as follows:
Figure BDA0003825180140000122
in the method provided by this embodiment, a broadcast message sent by a bluetooth Mesh device is received, where the broadcast message is used to indicate that the bluetooth Mesh device is to access a Mesh network, and the broadcast message includes an MAC address of the bluetooth Mesh device, where the MAC address and the bluetooth Mesh device have a correspondence; configuring a unicast address according to each MAC address; if the Mesh gateway is connected with a cloud server, acquiring a unicast address distributed by the cloud server from the cloud server; if the Mesh gateway is not connected with the cloud server, the Mesh gateway directly allocates a unicast address; obtaining a unicast address list according to the MAC address and the corresponding unicast address; and the unicast address list and the preset Mesh network parameters are transmitted to the Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcasting, so that the process that the network device controls the Bluetooth Mesh device to be accessed into the Mesh network is realized, manual intervention is not needed in the process, the complicated operation of a user is avoided, and the user experience is improved.
Fig. 4 is a schematic flowchart of a method for accessing a Mesh network according to a third embodiment of the present application. As shown in fig. 4, the method includes:
s401, if the configuration information sent by the configuration starting terminal is not acquired within a preset time length range, sending a broadcast message to a Mesh gateway;
specifically, after the bluetooth Mesh device sends a broadcast message to be networked, it waits for the configuration terminal to be started to identify the distribution network within a preset broadcast configuration duration, for example, a PB-GATT configuration message of the mobile phone is obtained within 30 seconds of broadcasting, if the PB-GATT configuration message of the mobile phone is not obtained within 30 seconds, the bluetooth Mesh device enters a broadcast scanning stage, sends the broadcast message to the Mesh gateway, and waits for scanning the configuration information broadcast by the Mesh gateway.
S402, sending a broadcast message to a Mesh gateway, wherein the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
specifically, the bluetooth Mesh device sends a broadcast message to the Mesh gateway through bluetooth broadcast, and broadcasts identification information, namely an MAC address, required by the bluetooth Mesh device for networking together, so that the configuration terminal is conveniently started to execute networking configuration operation while receiving the broadcast message.
S403, acquiring a preset Mesh network parameter and a unicast address list sent by the Mesh gateway;
specifically, the unicast address list stores the corresponding relation between the MAC address and the unicast address, each unicast address is allocated by the Mesh gateway or acquired from the cloud server by the Mesh gateway, and the unicast address uniquely corresponds to the bluetooth Mesh device, thereby ensuring the realization of the networking transmission function.
S404, adding the Bluetooth Mesh network according to the preset Mesh network parameters and a unicast address list, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh equipment and the unicast address;
specifically, since the Mesh gateway is the Mesh configuration information sent in a broadcast manner, all devices can acquire the Mesh configuration information, and the Mesh gateway needs to send the information in an encrypted manner to ensure the security of the information, after the bluetooth Mesh device scans the broadcast, the bluetooth Mesh device receives the broadcast information and obtains all encrypted Mesh configuration information according to an agreed packet protocol packet. The Mesh Dev Key is generated by the device according to the MAC and the encryption algorithm, such as: the device MAC is the first 16 bytes of SHA256, after the Mesh configuration information is decrypted, the Bluetooth Mesh device firstly finds a unicast address corresponding to the device MAC address from a unicast address list, then combines the found unicast address with the preset Mesh network parameters to obtain the Mesh configuration information for networking, and joins the network according to the Mesh configuration information. If the Bluetooth Mesh equipment cannot scan the broadcast and does not acquire the PB-GATT configuration message of the mobile phone, the Bluetooth Mesh equipment exits the configuration mode after the preset scanning broadcast duration threshold value is exceeded. Furthermore, if the Bluetooth Mesh device is unsuccessfully decrypted or fails to access the network, the Bluetooth Mesh device returns to the initial scanning broadcast state to execute scanning operation again, the return times can be preset, the Bluetooth Mesh device exits the configuration mode after exceeding the return times, the common working state is executed, the historical return times are reset until the common working state reaches the preset working time threshold, the broadcast configuration can be restarted, and unauthorized devices are prevented from being added into the Mesh network.
S405, if the configuration information sent by the starting configuration terminal is acquired within the preset duration range, accessing the Mesh network according to the configuration information sent by the starting configuration terminal;
specifically, after the bluetooth Mesh device sends a broadcast message to be networked, the bluetooth Mesh device waits for starting a configuration terminal to identify a distribution Network within a preset broadcast configuration duration range, for example, a PB-GATT configuration message of a mobile phone is obtained within 30 seconds of broadcasting, the PB-GATT configuration message of the mobile phone may include Mesh configuration information such as Network ID, unicast Address, IV index, network Key, application Key, MAC, unicast Address and the like required for the bluetooth Mesh device to be networked, and the bluetooth Mesh device joins the Mesh Network according to the Mesh configuration information.
S406, broadcasting state information in the Mesh network, wherein the state information is used for indicating the Bluetooth Mesh equipment to successfully access the Mesh network.
Specifically, after the Bluetooth Mesh equipment successfully joins the Mesh network, the Bluetooth Mesh equipment exits the configuration mode, broadcasts the state information of the Bluetooth Mesh equipment which is successfully networked to all nodes in the Mesh network, and perfects the integrity and the stability of the Mesh network.
In the method provided by this embodiment, if the configuration information sent by the configuration starting terminal is not obtained within the preset duration range, a broadcast message is sent to the Mesh gateway; sending a broadcast message to a Mesh gateway, wherein the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation; acquiring a preset Mesh network parameter and a unicast address list sent by the Mesh gateway; adding the Bluetooth Mesh network according to the preset Mesh network parameters and a unicast address list, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address; if the configuration information sent by the configuration starting terminal is acquired within the preset time length range, accessing the Mesh network according to the configuration information sent by the configuration starting terminal; broadcasting state information in the Mesh network, wherein the state information is used for indicating the means that the Bluetooth Mesh device is successfully accessed into the Mesh network, realizing the process that the terminal device is automatically accessed into the Mesh network, setting data information transmission process encryption, avoiding unauthorized devices from being mistakenly accessed into the network, realizing batch configuration networking by broadcasting transmission, ensuring networking stability by Bluetooth transmission, and improving the convenience degree of a user distribution network and the speed of the distribution network.
In the embodiment of the present invention, the electronic device or the main control device may be divided into the functional modules according to the above method examples, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing unit. The integrated unit can be realized in a form of hardware or a form of a software functional module. It should be noted that, the division of the modules in the embodiment of the present invention is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Fig. 5 is a schematic structural diagram of a network device accessing a Mesh network according to the present application. As shown in fig. 5, the device is a network device 50, and the device includes:
a receiving module 501, configured to receive a broadcast message sent by a bluetooth Mesh device, where the broadcast message is used to indicate that the bluetooth Mesh device is to be accessed to a Mesh network, and the broadcast message includes an MAC address of the bluetooth Mesh device, where the MAC address and the bluetooth Mesh device have a corresponding relationship;
a processing module 502, configured to obtain a unicast address list according to the MAC address, where a correspondence between the MAC address of the bluetooth Mesh device and the unicast address is stored in the unicast address list;
specifically, the processing module 502 is specifically configured to: configuring a unicast address according to each MAC address;
if the Mesh gateway is connected with a cloud server, acquiring a unicast address distributed by the cloud server from the cloud server;
if the Mesh gateway is not connected with the cloud server, the Mesh gateway directly allocates a unicast address;
obtaining a unicast address list according to the MAC address and the corresponding unicast address;
a sending module 503, configured to send the unicast address list and the preset Mesh network parameter to a bluetooth Mesh device to be accessed to the Mesh network through bluetooth broadcast. The device accessing the Mesh network provided in this embodiment may execute the method accessing the Mesh network of the foregoing embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
In a specific implementation of the foregoing device for accessing a Mesh network, the modules may be implemented as a processor, and the processor may execute computer-executable instructions stored in a memory, so that the processor executes the method for accessing a Mesh network shown in the first aspect and various possible designs of the first aspect, and the second aspect and various possible designs of the second aspect.
Fig. 6 is a schematic structural diagram of a network electronic device provided in the present application. As shown in fig. 6, the electronic device 60 includes: at least one processor 601 and memory 602. The electronic device 60 further comprises a communication component 603. The processor 601, the memory 602, and the communication section 603 are connected by a bus 604.
In a specific implementation process, the at least one processor 601 executes the computer-executable instructions stored in the memory 602, so that the at least one processor 601 executes the method for accessing the Mesh network as executed on the network device side.
For a specific implementation process of the processor 601, reference may be made to the method embodiments shown in the first aspect and various possible designs of the first aspect, and implementation principles and technical effects thereof are similar, and details of the embodiment are not described herein again.
Fig. 7 is a schematic structural diagram of a terminal device accessing a Mesh network according to the present application. As shown in fig. 7, the device is a terminal device 70, and the device includes:
a sending module 701, configured to send a broadcast message to a Mesh gateway, where the broadcast message is used to indicate a bluetooth Mesh device to be accessed to a Mesh network, and the broadcast message includes an MAC address of the bluetooth Mesh device, where the MAC address and the bluetooth Mesh device have a corresponding relationship;
specifically, the sending module 701 is further specifically configured to: if the configuration information sent by the configuration starting terminal is acquired within the preset time length range, accessing the Mesh network according to the configuration information sent by the configuration starting terminal;
and if the configuration information sent by the starting configuration terminal is not acquired within the preset time length range, sending a broadcast message to the Mesh gateway.
A receiving module 702, configured to receive a preset Mesh network parameter and a unicast address list sent by the Mesh gateway;
the processing module 703 is configured to join the Mesh network according to the preset Mesh network parameter and a unicast address list, where a correspondence between an MAC address of the bluetooth Mesh device and a unicast address is stored in the unicast address list.
Specifically, the processing module 703 is further specifically configured to: and broadcasting state information in the Mesh network, wherein the state information is used for indicating the Bluetooth Mesh device to successfully access the Mesh network.
Fig. 8 is a schematic structural diagram of a terminal electronic device provided in the present application. As shown in fig. 8, the electronic apparatus 80 includes: at least one processor 801 and a memory 802. The electronic device 80 further comprises a communication component 803. The processor 801, the memory 802, and the communication unit 803 are connected by a bus 804.
In a specific implementation process, the at least one processor 801 executes computer-executable instructions stored in the memory 802, so that the at least one processor 801 executes the method for accessing a Mesh network, as performed by the terminal device.
For a specific implementation process of the processor 801, reference may be made to the method embodiments shown in the second aspect and various possible designs of the second aspect, which have similar implementation principles and technical effects, and this embodiment is not described herein again.
In the above embodiments, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of a method disclosed in connection with the present invention may be embodied directly in a hardware processor, or in a combination of the hardware and software modules within the processor.
The memory may comprise high speed RAM memory and may also include non-volatile storage NVM, such as at least one disk memory.
The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, the buses in the figures of the present application are not limited to only one bus or one type of bus.
The above-mentioned scheme provided by the embodiment of the present invention is introduced with respect to the functions implemented by the electronic device and the main control device. It is understood that the electronic device or the main control device includes a hardware structure and/or a software module for performing the above functions. The elements and algorithm steps of the various examples described in connection with the embodiments disclosed herein may be embodied in hardware or in a combination of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present teachings.
The present application further provides a computer-readable storage medium, in which computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the method for accessing a Mesh network is implemented as shown in the first aspect and various possible designs of the first aspect, and the second aspect and various possible designs of the second aspect.
The computer-readable storage medium may be implemented by any type of volatile or non-volatile storage device or combination thereof, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disk. Readable storage media can be any available media that can be accessed by a general purpose or special purpose computer.
An exemplary readable storage medium is coupled to the processor such the processor can read information from, and write information to, the readable storage medium. Of course, the readable storage medium may also be an integral part of the processor. The processor and the readable storage medium may reside in an Application Specific Integrated Circuits (ASIC). Of course, the processor and the readable storage medium may also reside as discrete components in an electronic device or a master device.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method for accessing a Mesh network, comprising:
receiving a broadcast message sent by a Bluetooth Mesh device, wherein the broadcast message is used for indicating the Bluetooth Mesh device to be accessed into a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address;
and sending the unicast address list and the preset Mesh network parameters to a Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcasting.
2. The method according to claim 1, wherein obtaining a unicast address list according to the MAC address, where a correspondence between a MAC address of a bluetooth Mesh device and a unicast address is stored in the unicast address list, comprises:
configuring a unicast address according to each MAC address;
and obtaining a unicast address list according to the MAC address and the corresponding unicast address.
3. The method of claim 2, wherein configuring the unicast address according to each MAC address comprises:
if the Mesh gateway is connected with a cloud server, acquiring a unicast address distributed by the cloud server from the cloud server;
and if the Mesh gateway is not connected with the cloud server, the Mesh gateway directly allocates a unicast address.
4. A method for accessing a Mesh network, comprising:
sending a broadcast message to a Mesh gateway, wherein the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
acquiring a preset Mesh network parameter and a unicast address list sent by the Mesh gateway;
and adding the Bluetooth Mesh network according to the preset Mesh network parameters and a unicast address list, wherein the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh equipment and the unicast address.
5. The method of claim 4, wherein before sending the broadcast message to the Mesh gateway, the method further comprises:
if the configuration information sent by the starting configuration terminal is acquired within the preset duration range, accessing the Mesh network according to the configuration information sent by the starting configuration terminal;
and if the configuration information sent by the starting configuration terminal is not acquired within the preset time length range, sending a broadcast message to the Mesh gateway.
6. The method according to claim 4, wherein after joining a Mesh network according to the preset Mesh network parameters and the unicast address list, the method further comprises: and broadcasting state information in the Mesh network, wherein the state information is used for indicating the Bluetooth Mesh equipment to successfully access the Mesh network.
7. An apparatus accessing a Mesh network, wherein the apparatus is a network apparatus, comprising:
the device comprises a receiving module, a sending module and a sending module, wherein the receiving module is used for receiving a broadcast message sent by a Bluetooth Mesh device, the broadcast message is used for indicating the Bluetooth Mesh device to be accessed into a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
the processing module is used for obtaining a unicast address list according to the MAC address, and the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh equipment and the unicast address;
and the sending module is used for sending the unicast address list and the preset Mesh network parameters to the Bluetooth Mesh equipment to be accessed into the Mesh network through Bluetooth broadcasting.
8. An apparatus for accessing a Mesh network, wherein the apparatus is a terminal apparatus, comprising:
the device comprises a sending module, a sending module and a sending module, wherein the sending module is used for sending a broadcast message to a Mesh gateway, the broadcast message is used for indicating a Bluetooth Mesh device to be accessed to a Mesh network, the broadcast message comprises an MAC address of the Bluetooth Mesh device, and the MAC address and the Bluetooth Mesh device have a corresponding relation;
the receiving module is used for receiving the preset Mesh network parameters and the unicast address list sent by the Mesh gateway;
and the processing module is used for joining the Mesh network according to the preset Mesh network parameters and a unicast address list, and the unicast address list stores the corresponding relation between the MAC address of the Bluetooth Mesh device and the unicast address.
9. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer execution instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 1 to 3.
10. An electronic device, comprising: a processor, and a memory communicatively coupled to the processor;
the memory stores computer-executable instructions;
the processor executes computer-executable instructions stored by the memory to implement the method of any of claims 4 to 6.
CN202211054994.6A 2022-08-30 2022-08-30 Method and device for accessing Mesh network Pending CN115474257A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211054994.6A CN115474257A (en) 2022-08-30 2022-08-30 Method and device for accessing Mesh network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211054994.6A CN115474257A (en) 2022-08-30 2022-08-30 Method and device for accessing Mesh network

Publications (1)

Publication Number Publication Date
CN115474257A true CN115474257A (en) 2022-12-13

Family

ID=84368545

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211054994.6A Pending CN115474257A (en) 2022-08-30 2022-08-30 Method and device for accessing Mesh network

Country Status (1)

Country Link
CN (1) CN115474257A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116017412A (en) * 2022-12-27 2023-04-25 苏州融硅新能源科技有限公司 Gateway equipment, method and system for acquiring equipment information

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116017412A (en) * 2022-12-27 2023-04-25 苏州融硅新能源科技有限公司 Gateway equipment, method and system for acquiring equipment information
CN116017412B (en) * 2022-12-27 2024-04-16 苏州融硅新能源科技有限公司 Gateway equipment, method and system for acquiring equipment information

Similar Documents

Publication Publication Date Title
US10880817B2 (en) Wi-fi configuration method, Wi-Fi mobile terminal, and Wi-Fi device
US8103784B2 (en) Communication device and communication control method using efficient echonet address determination scheme
CN111182659B (en) Mode switching method and mode switching device of Mesh equipment and Mesh equipment
CN111885680A (en) Method, system and core equipment for establishing network connection
CN112654049B (en) Method, system, node and medium for configuring a wireless communication coverage extension system
WO2007052913A1 (en) Method of generating and managing connection identifiers for supporting multicast for each group in ipv6-based wireless network and network interface using the method
CN111163469A (en) Network distribution method of intelligent household appliance, wireless module and intelligent household appliance
CN113068181B (en) Multi-type intelligent terminal safety network access method
US9118588B2 (en) Virtual console-port management
WO2023005410A1 (en) Information synchronization method and system, storage medium, and electronic device
CN115474257A (en) Method and device for accessing Mesh network
CN114980273A (en) Wireless network configuration method and device, readable storage medium and terminal equipment
WO2017041534A1 (en) Power line network communication method and device, and computer storage media
CN108989173B (en) Message transmission method and device
CN107786441B (en) Communication method, OpenFlow switch and communication system
CN112995038B (en) Access method of PROFINET protocol in industrial SDN
EP3503484A1 (en) Message transmission method, device and network system
CN113132966A (en) Intelligent terminal fast network access method
CN111669309A (en) VxLAN establishing method, wireless controller and switch
CN113259928A (en) OTA (over the air) upgrading method and device, electronic equipment, storage medium and program product
CN112994932A (en) Automatic configuration method and device for network parameters of equipment in local area network and equipment
CN114205189A (en) Method for batch burning of equipment information based on secondary gateway
CN108259292B (en) Method and device for establishing tunnel
CN113055191A (en) Forwarding method and device, and forwarding plane of broadband remote access server
CN115296989B (en) Subscription address configuration method, related equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination