Method and apparatus for accessing a mesh network

By receiving broadcast messages from Bluetooth Mesh devices, a unicast address list and network parameters are generated, and BLE Mesh devices are automatically configured to join the network. This solves the problem of cumbersome network configuration in existing technologies, improving efficiency and user experience.

CN115474257BActive Publication Date: 2026-02-27HAIER YOUJIA INTELLIGENT TECH (BEIJING) CO LTD +2
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202211054994.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-30
Publication Date
2026-02-27
Estimated Expiration
2042-08-30

AI Technical Summary

Technical Problem

The existing BLE Mesh device's multi-node network configuration process is cumbersome and time-consuming, affecting installation efficiency and user experience.

Method used

By receiving broadcast messages from Bluetooth Mesh devices, obtaining their MAC addresses, generating a list of unicast addresses and preset network parameters, and automatically configuring devices to join the network using Bluetooth broadcast, the user's manual operation is reduced.

Benefits of technology

It enables automatic configuration of multiple Mesh nodes, improving network configuration speed and stability, and enhancing the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115474257B_ABST
    Figure CN115474257B_ABST
Patent Text Reader

Abstract

The application belongs to the technical field of communication, and particularly relates to a method and device 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 that the Bluetooth Mesh device is to be accessed into a Mesh network, the broadcast message contains a MAC address of the Bluetooth Mesh device, the MAC address has a corresponding relationship with the Bluetooth Mesh device; obtaining a unicast address list according to the MAC address, wherein the unicast address list stores the corresponding relationship between the MAC address of the Bluetooth Mesh device and a unicast address; and sending the unicast address list and preset Mesh network parameters to the Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcast. The method of the application reduces the network configuration step of manual operation of a user, is simple and convenient, improves the network configuration speed, improves the user experience, has high network configuration stability, and realizes the automatic configuration function of multiple Mesh nodes.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the technical field of communication, and particularly relates to a method and device for accessing a Mesh network. BACKGROUND

[0002] Bluetooth technology is one of the most widely used wireless communication technologies in the world. Among them, Bluetooth Low Energy (BLE) has been widely adopted and arranged on smart phones, tablets, smart lights and other smart devices (such as Internet of Things lamps), and BLE Mesh network is a new Bluetooth standard based on BLE approved in 2017, which is a networking technology capable of realizing m:m device communication.

[0003] The existing BLE Mesh device, such as a spotlight for lighting, is usually controlled by a switch for a group of spotlights. When in-network configuration is needed, the spotlight is put into configuration mode by repeatedly turning on and off the switch, and then each spotlight is configured one by one.

[0004] In the above networking configuration process, a configuration terminal such as a mobile phone needs to be connected with each Mesh node to be networked, and PB-GATT is set in turn. This process of adding multiple Mesh nodes to the Mesh network is extremely cumbersome, time-consuming, seriously affects the installation efficiency, and reduces the user experience. SUMMARY

[0005] In order to solve the above problems in the prior art, that is, to solve the problem that the process of adding multiple Mesh nodes to the Mesh network is extremely cumbersome, time-consuming, seriously affects the installation efficiency, and reduces the user experience, the present application provides a method for accessing a Mesh network, comprising:

[0006] A method for accessing a Mesh network, comprising:

[0007] Receiving a broadcast message sent by a Bluetooth Mesh device, the broadcast message being used to indicate that the Bluetooth Mesh device is to be accessed to a Mesh network, the broadcast message containing a MAC address of the Bluetooth Mesh device, and the MAC address having a corresponding relationship with the Bluetooth Mesh device;

[0008] Obtaining a unicast address list according to the MAC address, the unicast address list storing the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address;

[0009] The unicast address list and preset Mesh network parameters are sent to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast.

[0010] In a possible design, the obtaining of the unicast address list according to the MAC address, the unicast address list storing the correspondence between the MAC address of the Bluetooth Mesh device and the unicast address, comprises:

[0011] The unicast address is configured according to each MAC address.

[0012] The unicast address list is obtained according to the MAC address and the corresponding unicast address.

[0013] In a possible design, the configuring of the unicast address according to each MAC address comprises:

[0014] If the Mesh gateway has connected the cloud server, the unicast address allocated by the cloud server is obtained from the cloud server.

[0015] If the Mesh gateway has not connected the cloud server, the unicast address is directly allocated by the Mesh gateway.

[0016] In a second aspect, the application provides a method for accessing a Mesh network, comprising:

[0017] The broadcast message is sent to the Mesh gateway, the broadcast message being used to indicate that the Bluetooth Mesh device is to be accessed to the Mesh network, the MAC address of the Bluetooth Mesh device being contained in the broadcast message, the MAC address having a correspondence with the Bluetooth Mesh device.

[0018] The preset Mesh network parameters and the unicast address list sent by the Mesh gateway are obtained.

[0019] The Mesh network is accessed according to the preset Mesh network parameters and the unicast address list, the unicast address list storing the correspondence between the MAC address of the Bluetooth Mesh device and the unicast address.

[0020] In a possible design, before the sending of the broadcast message to the Mesh gateway, the method further comprises:

[0021] If the configuration information sent by the start configuration terminal is obtained within a preset time range, the Mesh network is accessed according to the configuration information sent by the start configuration terminal.

[0022] If the configuration information sent by the start configuration terminal is not obtained within a preset time range, the broadcast message is sent to the Mesh gateway.

[0023] In one possible design, after joining the Mesh network according to the preset Mesh network parameters and the unicast address list, the method further includes: broadcasting status information in the Mesh network, the status information being used to indicate that the Bluetooth Mesh device has successfully joined the Mesh network.

[0024] Thirdly, this application provides a device for accessing a Mesh network, the device being a network device, comprising:

[0025] The receiving module is used to receive broadcast messages sent by Bluetooth Mesh devices. The broadcast messages are used to indicate that the Bluetooth Mesh devices are about to access the Mesh network. The broadcast messages contain the MAC address of the Bluetooth Mesh devices, and the MAC address corresponds to the Bluetooth Mesh devices.

[0026] The processing module is used to obtain a unicast address list based on the MAC address, wherein the unicast address list stores the correspondence between the MAC address of the Bluetooth Mesh device and the unicast address.

[0027] The sending module is used to send the unicast address list and preset Mesh network parameters to the Bluetooth Mesh device to be connected to the Mesh network via Bluetooth broadcast.

[0028] Fourthly, this application provides a device for accessing a Mesh network, the device being a terminal device, comprising:

[0029] The sending module is used to send a broadcast message to the Mesh gateway. The broadcast message is used to indicate that the Bluetooth Mesh device is about to access the Mesh network. The broadcast message contains the MAC address of the Bluetooth Mesh device, and the MAC address has a corresponding relationship with the Bluetooth Mesh device.

[0030] The receiving module is used to receive the preset Mesh network parameters and unicast address list sent by the Mesh gateway;

[0031] The processing module is used to join the Mesh network according to the preset Mesh network parameters and the unicast address list, wherein the unicast address list stores the correspondence between the MAC address of the Bluetooth Mesh device and the unicast address.

[0032] Fifthly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;

[0033] The memory stores computer-executed instructions;

[0034] The processor executes computer-executed instructions stored in the memory to implement the method for accessing the Mesh network as shown in the first aspect and various possible designs of the first aspect.

[0035] In a sixth aspect, the present application provides an electronic device, comprising: a processor, and a memory connected with the processor in communication;

[0036] The memory stores computer-executed instructions.

[0037] The processor executes computer-executed instructions stored in the memory to implement the method for accessing the Mesh network as shown in the second aspect and various possible designs of the second aspect.

[0038] In a seventh aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executed instructions, and the computer-executed instructions are executed by a processor to implement the method for accessing the Mesh network as shown in the first aspect and various possible designs of the first aspect.

[0039] In an eighth aspect, the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executed instructions, and the computer-executed instructions are executed by a processor to implement the method for accessing the Mesh network as shown in the second aspect and various possible designs of the second aspect.

[0040] Those skilled in the art can understand that the method and device for accessing the Mesh network provided by the present application, by receiving the broadcast message sent by the Bluetooth Mesh device, the broadcast message is used to indicate that the Bluetooth Mesh device is to be accessed to the Mesh network, the MAC address of the Bluetooth Mesh device is contained in the broadcast message, and the MAC address has a corresponding relationship with the Bluetooth Mesh device; the unicast address list is obtained according to the MAC address, the unicast address list stores the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address; and the unicast address list and the preset Mesh network parameter are sent to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast, which reduces the network configuration step of manual operation of the user, is simple and convenient, improves the network configuration speed, improves the user experience, has high network configuration stability, and realizes the automatic configuration function of multiple Mesh nodes. BRIEF DESCRIPTION OF DRAWINGS

[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are some embodiments of the present application, and those skilled in the art can obtain other drawings according to these drawings without creative labor.

[0042] Figure 1 A schematic diagram of an application scenario of accessing a Mesh network provided by an embodiment of the present application;

[0043] Figure 2 A schematic diagram of a flow of a method of accessing a Mesh network provided by an embodiment one of the present application;

[0044] Figure 3 A schematic diagram of a flow of a method of accessing a Mesh network provided by an embodiment two of the present application;

[0045] Figure 4 A schematic diagram of a flow of a method of accessing a Mesh network provided by an embodiment three of the present application;

[0046] Figure 5 A schematic diagram of a structure of a network device of accessing a Mesh network provided by an embodiment of the present application;

[0047] Figure 6 A schematic diagram of a hardware structure of a network electronic device provided by an embodiment of the present application;

[0048] Figure 7 A schematic diagram of a structure of a terminal device of accessing a Mesh network provided by an embodiment of the present application;

[0049] Figure 8 A schematic diagram of a hardware structure of a terminal electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0050] The exemplary embodiments will be described in detail herein below with reference to the drawings. When the following description refers to the drawings, identical numbers on different drawings represent the same or similar elements unless otherwise indicated. The following exemplary embodiments described in the exemplary embodiments are not representative of embodiments consistent with the present application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of the present application as detailed in the appended claims and not all embodiments. Other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present application without creative work are within the scope of protection of the present application.

[0051] First, the terms involved in the present application are explained:

[0052] Mesh network: also known as "multi-hop network", refers to a way of transmitting data and control instructions between network nodes through dynamic routing. This network can keep the connection between each node complete, when a node in the network topology fails or cannot serve, this architecture allows the use of "hopping" to form a new route to deliver messages to the transmission destination. Each node in the Mesh network must be configured after networking to ensure the security of the entire Mesh network.

[0053] MAC address: also known as LAN address, MAC address, Ethernet address or physical address, it is an address used to identify the location of network equipment. Each Bluetooth Mesh device corresponds to an address.

[0054] Mesh gateway: a network device with both Bluetooth communication capability and networking capability, which assists Bluetooth Mesh terminal devices in networking. The instructions issued by the cloud server will be issued to Bluetooth Mesh devices through the Mesh gateway, and the status of Bluetooth Mesh devices can also be reported to the cloud server through the Mesh gateway.

[0055] Bluetooth Mesh device: a terminal device that can access the Mesh network, has Bluetooth connection function, but does not have configuration function itself, and needs other devices with configuration function to start configuration, such as spotlight, downlight and other lighting devices.

[0056] Node: a connection point, representing a redistribution point or a communication endpoint (some terminal devices). The definition of node depends on the network and protocol layer mentioned. A physical network node is an active electronic device connected to the network, which can send, receive or forward information through communication channels.

[0057] Unicast address: used to identify a single interface, datagrams sent to a unicast address are delivered to the interface identified by the address. It is a necessary parameter of Bluetooth Mesh network, and has a unique interface address in Mesh network, which can identify an element in the node. The node is assigned when it accesses the network. A Mesh network can have 32767 unicast addresses.

[0058] Network ID: refers to the sign information of a machine in a network. For a specific machine, the IP address and MAC address of the machine are the signs in the network. Different layers have different signs in the network. The sign of the data link layer is the MAC address, the sign of the network layer is the IP address, and the sign of the transport layer is the port number of UDP or TCP.

[0059] IV index: refers to a 32-bit value shared by all nodes in the network. The purpose is to provide entropy (randomness) in the calculation of message random values.

[0060] Network Key: refers to the key used in the network.

[0061] application Key: that is, the attribute key commonly used, which can open a shortcut menu by pressing it.

[0062] Advertising Data (ADV): that is, the advertising data packet, which is the data transmitted to each node in the network communication by broadcasting. Broadcast information will cause a heavy burden to the network, because they require every host on the network to serve them, so the ability to send broadcast data packets is limited to those sockets explicitly marked as allowing broadcast. Since a datagram socket must be bound before broadcast can be used, all received broadcast messages have the sender's address and port.

[0063] Scan Response (SCAN_RSP): that is, the scan response after Bluetooth broadcast.

[0064] Universal Unique Identifier (UUID): a software construction standard composed of a group of 32-bit hexadecimal numbers. The purpose is to let all elements in the distributed system have unique identification information without the need for a central control terminal to specify the identification information.

[0065] PB-GATT: general attribute configuration bearer layer, usually used for server devices that do not support PB-ADV (devices that do not start configuration are added to the Mesh network through ADV, usually used for devices carrying the Mesh protocol stack), which uses proxy server and proxy client to exchange proxy PDU (Proxy PDU) to realize connection configuration.

[0066] Figure 1 The application scenario diagram of the method for accessing the Mesh network provided by the embodiments of the present application is shown in FIG. 1. Figure 1As shown, the user newly purchases a batch of Bluetooth Mesh devices 101 supporting Mesh networking, for example, spotlights. After the spotlights are installed on the wall, in order to facilitate subsequent remote intelligent control of each spotlight, it is necessary to configure the networking of the spotlights. Therefore, the first step is to configure the start of the spotlight. The start configuration is a secure process. After the start configuration, the device that has not been started will have a series of encryption keys, which can ensure the security and control accuracy of the information transmission process. The existing start configuration process usually triggers the spotlight on the same line to enter the configuration mode at the same time through continuous multiple on-off, but after entering, it still needs to be identified by the start configuration terminal 102, such as a tablet computer or a smart phone, to select and start the configuration of each spotlight. The specific Mesh network information is obtained from the cloud server 103 or the hardware server 104. The steps are complicated and the configuration time is long.

[0067] The method for accessing a Mesh network provided in the present application aims to solve the above technical problems of the prior art.

[0068] The technical solutions of the present application and how the technical solutions of the present application solve the above technical problems will be described in detail below with specific examples. The following specific examples can be combined with each other, and the same or similar concepts or processes can not be described again in some examples. The embodiments of the present application will be described below with reference to the drawings.

[0069] Figure 2 The method for accessing a Mesh network provided in the present application aims to solve the above technical problems of the prior art. Figure 2 As shown, a method for accessing a Mesh network comprises the following steps.

[0070] S201, receiving a broadcast message sent by a Bluetooth Mesh device, the broadcast message being used to indicate that the Bluetooth Mesh device is to be accessed to a Mesh network, and the broadcast message containing a MAC address of the Bluetooth Mesh device, the MAC address having a corresponding relationship with the Bluetooth Mesh device;

[0071] Specifically, the Bluetooth Mesh device sends a broadcast message to the surrounding devices through Bluetooth broadcast, indicating that the Bluetooth Mesh device is currently in a networking state, and at the same time, the identification information required for networking of the Bluetooth Mesh device, i.e. the MAC address, is broadcasted, so as to facilitate the start configuration terminal to perform networking configuration operation at the same time of receiving the broadcast message.

[0072] S202, obtaining a unicast address list according to the MAC address, the unicast address list storing the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address;

[0073] Specifically, after receiving the broadcast message, the Mesh gateway acquires the MAC address in the broadcast message according to the configuration state to be networked, and then judges the networking state of the Mesh gateway. When the Mesh gateway is connected with the cloud server, the unicast address list pre-stored in the cloud server is acquired, the unicast address list stores the correspondence between the MAC address and the unicast address, the corresponding unicast address is found according to the MAC address, if the corresponding relationship 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 in the unicast address list. When the Mesh gateway is not connected with the cloud server, that is, in the single-machine mode, the Mesh gateway allocates a unicast address according to the MAC address, and then records the allocated unicast address and the MAC address in the unicast address list.

[0074] S203, the unicast address list and the preset Mesh network parameter are sent to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast.

[0075] Specifically, after the unicast address list is acquired, the preset Mesh network parameter and the unicast address list are packaged, and then broadcasted to all Bluetooth Mesh devices through Bluetooth broadcast. After the Bluetooth Mesh device receives the preset Mesh network parameter and the unicast address list, the unicast address corresponding to the MAC address of the Bluetooth Mesh device is found from the unicast address list, and then the Bluetooth Mesh device accesses the Mesh network according to the unicast address and the preset Mesh network parameter.

[0076] The method provided in the embodiment receives the broadcast message sent by the Bluetooth Mesh device, the broadcast message is used to indicate that the Bluetooth Mesh device is to be accessed to the Mesh network, the broadcast message contains the MAC address of the Bluetooth Mesh device, the MAC address has a corresponding relationship with the Bluetooth Mesh device, the unicast address list is obtained according to the MAC address, the unicast address list stores the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address, and the unicast address list and the preset Mesh network parameter are sent to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast. The method reduces the network configuration step of manual operation of the user, is simple and convenient, improves the network configuration speed, improves the user experience, has high network configuration stability, and realizes the automatic configuration function of multiple Mesh nodes.

[0077] The method for accessing the Mesh network according to the present application will be described in detail in combination with a specific embodiment.

[0078] Figure 3 The method for accessing the Mesh network provided in Embodiment Two of the present application is shown in a flowchart. As shown in the figure, the method comprises the following steps. Figure 3 ​

[0079] S301, receiving a broadcast message sent by a Bluetooth Mesh device, the broadcast message being used to indicate that the Bluetooth Mesh device is to be accessed into a Mesh network, the broadcast message containing a MAC address of the Bluetooth Mesh device, the MAC address being in a corresponding relationship with the Bluetooth Mesh device;

[0080] The implementation manner of S301 is similar to the implementation manner of S201, and details are not described herein.

[0081] S302, configuring a unicast address according to each MAC address;

[0082] S303, if the Mesh gateway has connected a cloud server, obtaining a unicast address allocated by the cloud server from the cloud server;

[0083] S304, if the Mesh gateway has not connected the cloud server, the Mesh gateway directly allocates a unicast address;

[0084] S305, obtaining a unicast address list according to the MAC address and the corresponding unicast address;

[0085] Specifically, since one Mesh network can have 32767 unicast addresses, the unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are pre-allocated, so as to avoid the repetition phenomenon of the two when the unicast addresses are specified. Since the cloud server can carry more configuration devices and can share network information, in the case of connecting the cloud server, the unicast address corresponding to the cloud server is preferentially selected, and the unicast address matched with the MAC address is first obtained from the correspondence table of the MAC address and the unicast address pre-stored in the cloud server. If the MAC address does not correspond to the allocated unicast address, the cloud server allocates a new unicast address according to the MAC address, and stores the correspondence between the unicast address and the MAC address in the correspondence table. When there is no connection to the cloud server, the Mesh gateway allocates a unicast address for the node, which is also uniquely allocated based on the MAC address, and records the correspondence between the unicast address and the MAC address. The correspondence between the unicast address and the MAC address of the Bluetooth Mesh device to be configured in the network obtained by allocation or direct acquisition is integrated to obtain a unicast address list.

[0086] S306, sending the unicast address list and preset Mesh network parameters to the Bluetooth Mesh device to be accessed into the Mesh network through Bluetooth broadcast.

[0087] Specifically, the preset Mesh network parameters include Network ID, IV index, Network Key, application Key and other Mesh network parameters, the unicast address list and the preset Mesh network parameters jointly constitute Mesh configuration information, after the Mesh gateway acquires the Mesh configuration information, needs to send a Bluetooth broadcast at an agreed UUID, and needs to broadcast the encrypted Mesh configuration information, the encryption method adopts RC4 or AES-128 algorithm, the encryption Key is generated according to the MAC address, the Mesh configuration information is respectively contained in the broadcast packet (Advertising Data) and the response packet (Scan Response), when the length of the encrypted Network ID, IV index, Network Key, application Key, MAC, Unicast Address and other Mesh network parameters is too long, the Data length of the broadcast packet (Advertising Data) and the response packet (Scan Response) is not enough, the multiple broadcast packets can be sent in turn, then the packet header must contain the field length, the packet number, to facilitate subsequent packet grouping.

[0088] The format of the broadcast packet and the response packet is as follows:

[0089]

[0090] In the table, Service UUID: custom UUID, for example 0xFF01.

[0091] CID (Company Identifiers): company identifier, for example 0x0123.

[0092] The Service Header is defined as follows:

[0093]

[0094] In the table, message ID: configuration message length, one configuration information can be sent in N packets, each time a complete configuration information is sent as a round, the message ID of each broadcast packet in a round remains unique.

[0095] Data encryption indication: determines whether the sent Service Data is encrypted, 1: encrypted; 0: not encrypted.

[0096] Version information: a value between 0-7.

[0097] Service Header Byte 1: frame number and frame sequence number, as follows:

[0098]

[0099] Frame Number: If one configuration information is split into multiple frames, the Service Data following one ADV or SCAN_RSP is one frame.

[0100] Total unpacked frame number: If one configuration information is split into 4 frames, 2 groups of different ADV and SCAN_RSP need to be broadcasted.

[0101] Service Header Byte 2: Total length of frame data. Length is 0-250.

[0102] Total length of frame data: that is, the total length of configuration message.

[0103] The format of Mesh network configuration information carried in Service Data is as follows:

[0104]

[0105]

[0106] The structure of NetworkKey is as follows:

[0107] 1 NETWORK_INDEX Short 2 Network Key Index 2 NETWORK_KEY Char 16 Network Key

[0108] The structure of ApplicationKey is as follows:

[0109] 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

[0110] ElementAddress structure, each scanned device is allocated a Unicast address, as follows:

[0111]

[0112] The method provided by the embodiment receives a broadcast message sent by a Bluetooth Mesh device, the broadcast message is used to indicate that the Bluetooth Mesh device is to be accessed to a Mesh network, the broadcast message contains a MAC address of the Bluetooth Mesh device, the MAC address has a corresponding relationship with the Bluetooth Mesh device, a unicast address is configured according to each MAC address, if a Mesh gateway has connected a cloud server, a unicast address allocated by the cloud server is obtained from the cloud server, if the Mesh gateway has not connected the cloud server, the Mesh gateway directly allocates a unicast address, a unicast address list is obtained according to the MAC address and the corresponding unicast address, and the unicast address list and preset Mesh network parameters are sent to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast, so that the process that the network device controls the Bluetooth Mesh device to access to the Mesh network is realized, manual intervention is not needed during the process, tedious operation of a user is avoided, and user experience is improved.

[0113] Figure 4 The method flowchart for accessing to a Mesh network provided by the third embodiment of the application is shown in FIG. 3. Figure 4 The method includes the following steps.

[0114] S401, if no configuration information sent by a start configuration terminal is obtained within a preset time range, a broadcast message is sent to a Mesh gateway;

[0115] Specifically, after the Bluetooth Mesh device sends the broadcast message to be connected to a network, the Bluetooth Mesh device waits for a start configuration terminal to identify the network configuration within a preset broadcast configuration time range, for example, the PB-GATT configuration message of a mobile phone is obtained within 30 seconds of broadcast, 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 a broadcast message to a Mesh gateway, and waits for scanning configuration information broadcast by the Mesh gateway.

[0116] S402, a broadcast message is sent to a Mesh gateway, the broadcast message is used to indicate that a Bluetooth Mesh device is to be accessed to a Mesh network, the broadcast message contains a MAC address of the Bluetooth Mesh device, and the MAC address has a corresponding relationship with the Bluetooth Mesh device;

[0117] Specifically, the Bluetooth Mesh device sends a broadcast message to a Mesh gateway through Bluetooth broadcast, broadcasts the identification information required for the Bluetooth Mesh device to be connected to a network, that is, a MAC address, so that a start configuration terminal can execute a network connection configuration operation at the same time when the broadcast message is received.

[0118] S403, preset Mesh network parameters and a unicast address list sent by the Mesh gateway are obtained;

[0119] Specifically, the correspondence between the MAC address and the unicast address is stored in the unicast address list, each unicast address is allocated by the Mesh gateway or obtained from the cloud server by the Mesh gateway, and the unicast address corresponds to the Bluetooth Mesh device uniquely, thereby ensuring the implementation of the networking transmission function.

[0120] S404, according to the preset Mesh network parameter and the unicast address list, join the Mesh network, the unicast address list stores the correspondence between the MAC address of the Bluetooth Mesh device and the unicast address;

[0121] Specifically, since the Mesh gateway sends the Mesh configuration information in a broadcast manner, all devices can obtain it, and the Mesh gateway needs to send it in an encrypted manner to ensure the security of the information, therefore, after the Bluetooth Mesh device scans the broadcast, it is found that the UUID configuration broadcast format is agreed, the broadcast information is received, the agreed packet protocol is packaged, and all encrypted Mesh configuration information is obtained. The Mesh Dev Key is generated according to the device itself MAC according to the encryption algorithm, such as: the first 16 bytes of SHA256 of the device MAC, after the Mesh configuration information is decrypted, the Bluetooth Mesh device first finds the unicast address corresponding to the device itself MAC address in the unicast address list, then combines the found unicast address and the preset Mesh network parameter to obtain the Mesh configuration information for networking, and joins the network according to the Mesh configuration information. If the Bluetooth Mesh device cannot scan the broadcast and also cannot obtain the PB-GATT configuration message of the mobile phone, after exceeding the preset scanning broadcast time threshold, the Bluetooth Mesh device exits the configuration mode. Further, if the Bluetooth Mesh device fails to decrypt successfully or fails to access the network, it returns to the initial scanning broadcast state to perform the scanning operation again, the number of returns can be preset, and after exceeding the number of returns, the configuration mode is exited, the normal working state is executed, and after the normal working state reaches the preset working time threshold, the historical return number is cleared, and the broadcast configuration can be started again, thereby avoiding the unauthorized device from joining the Mesh network.

[0122] S405, if the configuration information sent by the start configuration terminal is obtained within a preset time range, then access the Mesh network according to the configuration information sent by the start configuration terminal;

[0123] Specifically, after the Bluetooth Mesh device sends the broadcast message to be networked, it waits for the start configuration terminal to identify the network configuration within the preset broadcast configuration time range, for example, acquires the PB-GATT configuration message of the mobile phone within 30 seconds of broadcasting, and the PB-GATT configuration message of the mobile phone contains the Mesh configuration information required by the Bluetooth Mesh device for networking, such as Network ID, Unicast Address, IVindex, Network Key, application Key, MAC, Unicast Address, etc., and the Bluetooth Mesh device joins the Mesh network according to the Mesh configuration information.

[0124] S406, broadcast state information in the Mesh network, the state information being used to indicate that the Bluetooth Mesh device successfully accesses the Mesh network.

[0125] Specifically, after the Bluetooth Mesh device successfully joins the Mesh network, it exits the configuration mode and broadcasts the state information that it has successfully networked in the Mesh network to all nodes, thereby improving the integrity and stability of the Mesh network.

[0126] The method provided in the embodiment, if no configuration information sent by the start configuration terminal is acquired within the preset time range, a broadcast message is sent to the Mesh gateway; the broadcast message is used to indicate that the Bluetooth Mesh device is to access the Mesh network, and the broadcast message contains the MAC address of the Bluetooth Mesh device, the MAC address and the Bluetooth Mesh device have a corresponding relationship; preset Mesh network parameters and a unicast address list sent by the Mesh gateway are acquired; the Bluetooth Mesh device joins the Mesh network according to the preset Mesh network parameters and the unicast address list, the unicast address list stores the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address; if the configuration information sent by the start configuration terminal is acquired within the preset time range, the Bluetooth Mesh device accesses the Mesh network according to the configuration information sent by the start configuration terminal; state information is broadcast in the Mesh network, the state information is used to indicate that the Bluetooth Mesh device successfully accesses the Mesh network, the process of automatically accessing the Mesh network by the terminal device is realized, the data information transmission process is encrypted, unauthorized devices are prevented from mistakenly entering the network, batch configuration networking is realized by broadcasting, Bluetooth transmission ensures the stability of networking, and the convenience and speed of network configuration are improved.

[0127] The embodiments of the present application can divide the function modules of the electronic device or the master device according to the above method examples, for example, each function module can be divided according to each function, or two or more functions can be integrated in one processing unit. The integrated unit can be realized in the form of hardware or in the form of a software function module. It should be noted that the division of the modules in the embodiments of the present application is illustrative, and is only a logical function division, and another division mode can be used in actual implementation.

[0128] Figure 5 The structure schematic diagram of the network device accessing the Mesh network is provided in the present application. As shown in the figure, the device is a network device 50, which comprises: Figure 5

[0129] The receiving module 501 is configured to receive a broadcast message sent by a Bluetooth Mesh device, the broadcast message being used to indicate that the Bluetooth Mesh device is to access a Mesh network, and the broadcast message containing a MAC address of the Bluetooth Mesh device, the MAC address being in a corresponding relationship with the Bluetooth Mesh device.

[0130] The processing module 502 is configured to obtain a unicast address list according to the MAC address, the unicast address list storing the corresponding relationship between the MAC address of the Bluetooth Mesh device and the unicast address.

[0131] Specifically, the processing module 502 is specifically configured to configure a unicast address according to each MAC address.

[0132] If the Mesh gateway has connected a cloud server, the unicast address allocated by the cloud server is obtained from the cloud server.

[0133] If the Mesh gateway has not connected the cloud server, the Mesh gateway directly allocates a unicast address.

[0134] The unicast address list is obtained according to the MAC address and the corresponding unicast address.

[0135] The sending module 503 is configured to send the unicast address list and preset Mesh network parameters to the Bluetooth Mesh device to be accessed to the Mesh network through Bluetooth broadcast. The device accessing the Mesh network provided in the embodiment can execute the method of accessing the Mesh network in the above embodiments, and the implementation principle and technical effects are similar, which will not be described here again.

[0136] ​In the specific implementation of the device accessing the Mesh network, each module can be implemented as a processor, and the processor can execute computer-executed instructions stored in the memory, so that the processor executes the method of accessing the Mesh network as described in the first aspect and the various possible designs of the first aspect, the second aspect and the various possible designs of the second aspect.

[0137] Figure 6 A structural diagram of a network electronic device is provided for the present application. As shown in the figure, the electronic device 60 includes at least one processor 601 and a memory 602. The electronic device 60 further includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected through a bus 604. Figure 6

[0138] In the specific implementation, the at least one processor 601 executes computer-executed instructions stored in the memory 602, so that the at least one processor 601 executes the method of accessing the Mesh network as executed by the network device side.

[0139] The specific implementation process of the processor 601 can refer to the method embodiments of the first aspect and the various possible designs of the first aspect, which have similar implementation principles and technical effects, and will not be described here again.

[0140] Figure 7 A structural diagram of a terminal device accessing a Mesh network is provided for the present application. As shown in the figure, the device is a terminal device 70, which includes: Figure 7

[0141] The sending module 701 is configured to send a broadcast message to a Mesh gateway, the broadcast message being used to indicate that a Bluetooth Mesh device is to access a Mesh network, and the broadcast message containing a MAC address of the Bluetooth Mesh device, the MAC address having a corresponding relationship with the Bluetooth Mesh device.

[0142] Specifically, the sending module 701 is further configured to, if configuration information sent by a startup configuration terminal is acquired within a preset time range, access the Mesh network according to the configuration information sent by the startup configuration terminal.

[0143] If the configuration information sent by the startup configuration terminal is not acquired within the preset time range, the broadcast message is sent to the Mesh gateway.

[0144] The receiving module 702 is configured to receive preset Mesh network parameters and a unicast address list sent by the Mesh gateway.

[0145] ​​The processing module 703 is configured to join the Mesh network according to the preset Mesh network parameter and the unicast address list in which the correspondence between the MAC address and the unicast address of the Bluetooth Mesh device is stored.

[0146] Specifically, the processing module 703 is further configured to broadcast state information in the Mesh network, and the state information is used to indicate that the Bluetooth Mesh device successfully accesses the Mesh network.

[0147] Figure 8 A structural schematic diagram of a terminal electronic device is provided in the present application. As shown in the figure, the electronic device 80 includes at least one processor 801 and a memory 802. The electronic device 80 further includes a communication component 803. The processor 801, the memory 802 and the communication component 803 are connected through a bus 804. Figure 8

[0148] In the implementation process, the at least one processor 801 executes the computer execution instructions stored in the memory 802, so that the at least one processor 801 executes the method of accessing the Mesh network as executed by the terminal device side.

[0149] The specific implementation process of the processor 801 can refer to the method embodiments shown in the above-mentioned second aspect and various possible designs of the second aspect, which have similar implementation principles and technical effects. Therefore, the implementation process of the processor 801 will not be described here.

[0150] In the above embodiment, it should be understood that the processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC) and the like. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor. The steps of the method disclosed in the application can be directly embodied as the execution of the hardware processor, or the execution of the combination of hardware and software modules in the processor.

[0151] The memory can include a high-speed RAM memory, and can also include a non-volatile storage NVM, such as at least one disk memory.

[0152] ​The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application does not limit to only one bus or one type of bus.

[0153] The functions implemented by the electronic device and the master device described above are introduced for the scheme provided by the embodiments of the present application. It can be understood that the electronic device or the master device includes the hardware structure and / or software module corresponding to the execution of each function in order to implement the above functions. The units and algorithm steps of each example described in combination with the embodiments disclosed in the embodiments of the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or in the form of computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the technical solution of the embodiments of the present application.

[0154] The present application also provides a computer readable storage medium, the computer readable storage medium stores computer execution instructions, when the processor executes the computer execution instructions, the method for accessing the Mesh network as shown in the first aspect and various possible designs of the first aspect, the second aspect and various possible designs of the second aspect is realized.

[0155] The computer readable storage medium described above, the readable storage medium can be implemented by any type of volatile or non-volatile storage device or their combination, 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 disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special purpose computer.

[0156] An example readable storage medium is coupled to the processor such that the processor can read information from, and can write information to, the readable storage medium. Of course, the readable storage medium can be a part of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the readable storage medium can exist as discrete components in the electronic device or as part of a control unit.

[0157] Those skilled in the art can understand that all or part of the steps of the above-mentioned method embodiments can be completed by program instruction related hardware. The foregoing program can be stored in a computer readable storage medium. The program executes the steps of the above-mentioned method embodiments when executed; and the foregoing storage medium includes ROM, RAM, magnetic disc or optical disc and various storage medium that can store program codes.

[0158] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, and not to limit them; although the present application has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or make equivalent replacement for part or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for accessing a Mesh network, characterized in that, Applied to Mesh gateways, including: Receive a broadcast message sent by a Bluetooth Mesh device. The broadcast message indicates that the Bluetooth Mesh device is about to access the Mesh network. The broadcast message contains the MAC address of the Bluetooth Mesh device, and the MAC address corresponds to the Bluetooth Mesh device. If the Mesh gateway is connected to the cloud server, it obtains the unicast address assigned by the cloud server; if the Mesh gateway is not connected to the cloud server, it directly assigns a unicast address; a unicast address list is obtained based on the MAC address and the corresponding unicast address; the unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are pre-allocated to avoid duplicate unicast addresses. The unicast address list and preset Mesh network parameters are broadcast via Bluetooth to all Bluetooth Mesh devices that want to access the Mesh network. After receiving the preset Mesh network parameters and the unicast address list sent by the Mesh gateway, the Bluetooth Mesh device finds the unicast address corresponding to the MAC address of the Bluetooth Mesh device from the unicast address list, and then accesses the Mesh network according to the unicast address and the preset Mesh network parameters. Prior to receiving the broadcast message sent by the Bluetooth Mesh device, the method further includes: After sending a broadcast message indicating that it is ready to connect to the network, the Bluetooth Mesh device waits for the configuration terminal to identify and configure the network within a preset time range. If the Bluetooth Mesh device obtains the configuration information sent by the configuration terminal within the preset time range, it connects to the Mesh network according to the configuration information sent by the configuration terminal. If the Bluetooth Mesh device does not obtain the configuration information sent by the configuration terminal within the preset time range, it sends a broadcast message to the Mesh gateway.

2. A method for accessing a Mesh network, characterized in that, Applied to Bluetooth Mesh devices, including: A broadcast message is sent to the Mesh gateway. The broadcast message is used to indicate that the Bluetooth Mesh device is about to access the Mesh network. The broadcast message contains the MAC address of the Bluetooth Mesh device, and the MAC address has a corresponding relationship with the Bluetooth Mesh device. The system obtains preset Mesh network parameters and a unicast address list sent by the Mesh gateway. The unicast address list is determined based on the following: if the Mesh gateway is connected to the cloud server, it obtains a unicast address assigned by the cloud server; if the Mesh gateway is not connected to the cloud server, it directly assigns a unicast address. The Mesh gateway obtains the unicast address list based on the MAC address and its corresponding unicast address. The unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are pre-allocated to avoid duplicate unicast addresses. Find the unicast address corresponding to the MAC address of the Bluetooth Mesh device from the unicast address list, and then join the Mesh network according to the preset Mesh network parameters and the unicast address; Before sending the broadcast message to the Mesh gateway, the method further includes: If configuration information sent by the startup configuration terminal is obtained within a preset time range, then the Mesh network is accessed according to the configuration information sent by the startup configuration terminal. If no configuration information is received from the startup configuration terminal within the preset time range, a broadcast message is sent to the Mesh gateway.

3. The method according to claim 2, characterized in that, After joining the Mesh network according to the preset Mesh network parameters and the unicast address list, the method further includes: broadcasting status information in the Mesh network, the status information being used to indicate that the Bluetooth Mesh device has successfully joined the Mesh network.

4. A device for accessing a Mesh network, characterized in that, The device is a Mesh gateway, including: The receiving module is used to receive broadcast messages sent by Bluetooth Mesh devices. The broadcast messages are used to indicate that the Bluetooth Mesh devices are about to access the Mesh network. The broadcast messages contain the MAC address of the Bluetooth Mesh devices, and the MAC address corresponds to the Bluetooth Mesh devices. The processing module is configured to: if the Mesh gateway is connected to the cloud server, obtain the unicast address assigned by the cloud server; if the Mesh gateway is not connected to the cloud server, directly assign a unicast address to the Mesh gateway; and obtain a unicast address list based on the MAC address and the corresponding unicast address. The unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are pre-allocated to avoid duplicate unicast addresses. The sending module is used to send the unicast address list and preset Mesh network parameters to all Bluetooth Mesh devices that want to access the Mesh network via Bluetooth broadcast, so that after receiving the preset Mesh network parameters and the unicast address list, the Bluetooth Mesh device finds the unicast address corresponding to the MAC address of the Bluetooth Mesh device from the unicast address list, and then accesses the Mesh network according to the unicast address and the preset Mesh network parameters. Before receiving the broadcast message sent by the Bluetooth Mesh device, the process further includes: after the Bluetooth Mesh device sends a broadcast message indicating it is ready to connect to the network, it waits within a preset time period for the startup configuration terminal to identify and configure the network. If the Bluetooth Mesh device obtains the configuration information sent by the startup configuration terminal within the preset time period, it accesses the Mesh network according to the configuration information sent by the startup configuration terminal. If the Bluetooth Mesh device does not obtain the configuration information sent by the startup configuration terminal within the preset time period, it sends a broadcast message to the Mesh gateway.

5. A device for accessing a Mesh network, characterized in that, The device is a Bluetooth Mesh device, including: The sending module is used to send a broadcast message to the Mesh gateway. The broadcast message is used to indicate that the Bluetooth Mesh device is about to access the Mesh network. The broadcast message contains the MAC address of the Bluetooth Mesh device, and the MAC address has a corresponding relationship with the Bluetooth Mesh device. The receiving module is used to receive preset Mesh network parameters and a unicast address list sent by the Mesh gateway. The unicast address list is based on the following: if the Mesh gateway is connected to the cloud server, it obtains a unicast address from the cloud server; if the Mesh gateway is not connected to the cloud server, it directly assigns a unicast address. The Mesh gateway obtains the unicast address list based on the MAC address and the corresponding unicast address. The unicast address range corresponding to the cloud server and the unicast address range corresponding to the Mesh gateway are pre-allocated to avoid duplicate unicast addresses. The processing module is used to find the unicast address corresponding to the MAC address of the Bluetooth Mesh device from the unicast address list, and then join the Mesh network according to the preset Mesh network parameters and the unicast address; The sending module is further configured to, before sending a broadcast message to the Mesh gateway, if it obtains configuration information sent by the startup configuration terminal within a preset time range, then access the Mesh network according to the configuration information sent by the startup configuration terminal; if it does not obtain configuration information sent by the startup configuration terminal within the preset time range, then send a broadcast message to the Mesh gateway.

6. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in claim 1.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 2 to 3.

Citation Information

Patent Citations

  • Bluetooth Mesh network and network distribution method and device thereof, and storage medium

    CN110493758A

  • Bluetooth network and communication method and device thereof, and storage medium

    CN112584364A

  • Networking control method and device for data communication

    CN114423066A

  • Smart home system

    US20220166247A1