CN113179507B - Bluetooth mesh-based self-distribution networking method and system without main equipment - Google Patents

Bluetooth mesh-based self-distribution networking method and system without main equipment Download PDF

Info

Publication number
CN113179507B
CN113179507B CN202110731260.6A CN202110731260A CN113179507B CN 113179507 B CN113179507 B CN 113179507B CN 202110731260 A CN202110731260 A CN 202110731260A CN 113179507 B CN113179507 B CN 113179507B
Authority
CN
China
Prior art keywords
networking
address
devices
addresses
new key
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110731260.6A
Other languages
Chinese (zh)
Other versions
CN113179507A (en
Inventor
王凯仡
宋海瑞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing Qinheng Microelectronics Co ltd
Original Assignee
Nanjing Qinheng Microelectronics 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 Nanjing Qinheng Microelectronics Co ltd filed Critical Nanjing Qinheng Microelectronics Co ltd
Priority to CN202110731260.6A priority Critical patent/CN113179507B/en
Publication of CN113179507A publication Critical patent/CN113179507A/en
Application granted granted Critical
Publication of CN113179507B publication Critical patent/CN113179507B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • H04W12/00Security arrangements; Authentication; Protecting privacy or anonymity
    • H04W12/009Security arrangements; Authentication; Protecting privacy or anonymity specially adapted for networks, e.g. wireless sensor networks, ad-hoc networks, RFID networks or cloud networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/06Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/18Self-organising networks, e.g. ad-hoc networks or sensor networks

Abstract

The invention discloses a self-distribution network networking method and a self-distribution network networking system based on Bluetooth mesh and without a main device, wherein a plurality of devices receive a networking command, enter a networking mode and use the same secret key to self-distribute a network; each device generates and broadcasts a networking address of the device, wherein the networking address comprises an MAC address of the device and a randomly generated element address; each device negotiates the networking address of the device, and stores a device list of all the devices and the corresponding networking address; each device generates a new key, broadcasts a networking address and a check value of the new key; and each device compares the new key check value with the same new key and uses the new key to carry out distribution. The invention can complete distribution and networking under the condition of no main equipment, and is convenient for controlling equipment in the network. By using the method, the equipment in the Bluetooth mesh network can be detached and replaced at will, and the hardware cost and the maintenance cost of the networking are greatly reduced.

Description

Bluetooth mesh-based self-distribution networking method and system without main equipment
Technical Field
The invention relates to the technical field of wireless networks, in particular to a Bluetooth mesh-based self-networking method and a Bluetooth mesh-based self-networking system without a main device.
Background
The wireless Mesh network can create a large-scale network based on a plurality of devices by means of multi-hop interconnection and Mesh topology characteristics and combining wide application of low-power-consumption Bluetooth, the network can comprise dozens of, hundreds of or even thousands of Bluetooth Mesh devices, information can be mutually transmitted among the devices, and ideal selection is provided for solving schemes of various wireless access networks such as building automation, commercial lighting, sensor networks, smart homes and the like. And the foundation for creating a large network is the networking function of the Bluetooth mesh.
The networking function of the conventional bluetooth mesh protocol requires an always-on master device, commonly referred to as a gateway. If a new device wants to join the existing network, a resident master device is needed to perform the distribution network process, distribute the information such as the network key and the element address. Fig. 1 is a schematic diagram illustrating connection between a master device and a slave device. When the outside wants to control the devices in the network, the outside needs to communicate with the master device first, and then the master device forwards the command to the corresponding slave device. Although the method has the functions of network expansion and joint control, the method has the following defects: the primary device is not replaceable and repeatable; if the main equipment is off-line, the network is in a closed state that the network cannot be added, and the outside cannot control the equipment in the network; at least two kinds of equipment are needed, and in the development and production processes, the two kinds of equipment need to be considered simultaneously, and two sets of different firmware are developed; because the demand of the master control equipment and the demand of the peripheral equipment are generally different, the number of the master control equipment is usually less, the number of the peripheral equipment is more, and the delivery difficulty is increased in the production flow.
Disclosure of Invention
The purpose of the invention is as follows: in order to solve the problems that new equipment cannot be added and equipment in the network cannot be controlled under the condition that the main equipment in the Bluetooth mesh network is offline in the prior art, the invention provides a self-configuration network networking method and a system based on Bluetooth mesh and without the main equipment.
The technical scheme is as follows: a self-distribution networking method based on Bluetooth mesh and without a main device comprises the following steps:
(1) the method comprises the following steps that a plurality of devices receive networking commands and enter a networking mode, the devices have the same secret key, and the devices use the same secret key to self-distribute a network;
(2) each device generates and broadcasts a networking address of the device, wherein the networking address comprises an MAC address of the device and a randomly generated element address;
(3) each device receives networking addresses of all other devices, compares the received networking addresses with the networking address of the device, modifies the element address of the device to compare again if the element address in the received networking address is the same as the element address in the networking address of the device, and stores a device list and a corresponding networking address of all the devices if the element address in the received networking address is different from the element address of the networking address of the device;
(4) each device generates a new key according to the stored device list and the corresponding networking address, broadcasts the networking address and the check value of the new key;
(5) and (3) each device receives the networking addresses of all other devices and the check value of the new key, compares the received check value of the new key with the check value of the new key of the device, deletes the stored device list of all the devices and the corresponding networking addresses if the received network addresses are different, and returns to execute the steps (3) to (5) until the received check value of the new key is the same as the check value of the new key of the device, and if the received network addresses are the same, the new key is used for distribution of the network.
Further, in step (1), all devices possess the same initial key.
Further, in the step (1), at least two devices are provided.
Further, in the step (1), when a new device needs to join in networking, all devices reenter the networking mode.
Further, in the step (1), when there is a device in the networking that needs to exit the networking, the other device reenters the networking mode.
Further, in step (5), all devices autonomously generate the same new key through broadcast interaction.
Further, in step (4), the check value of the new key is the 24-bit CRC check value of the new key.
A bluetooth mesh-based self-networking system without a master device, comprising a plurality of devices without a master device, wherein each device comprises a memory, a processor and a computer program stored in the memory and running on the processor, and the processor executes the computer program to realize:
(1) receiving a networking command, entering a networking mode, and using the same key to self-distribute a network with other equipment;
(2) generating and broadcasting a networking address of the device, wherein the networking address comprises an MAC address of the device and a randomly generated element address;
(3) receiving networking addresses of all other devices, comparing the received networking addresses with the networking addresses of the devices, modifying the element addresses of the devices to compare again if the element addresses in the received networking addresses are the same as the element addresses in the networking addresses of the devices, and storing a device list and corresponding networking addresses of all the devices by each device if the element addresses in the received networking addresses are different from the element addresses of the networking addresses of the devices;
(4) generating a new key according to the stored equipment list and the corresponding networking address, broadcasting the networking address and a check value of the new key;
(5) and (3) receiving networking addresses of all other devices and the check value of the new key, comparing the received check value of the new key with the check value of the new key of the device, deleting the stored device list of all the devices and the corresponding networking addresses if the received networking addresses are different, returning to execute the steps (3) to (5) until the received check value of the new key is the same as the check value of the new key of the device, and using the new key to distribute the network if the received networking addresses are the same as the check value of the new key of the device.
Further, there are at least two devices.
Has the advantages that: compared with the prior art, the invention can complete network distribution and networking under the condition of no main equipment, and is convenient for controlling equipment in the network. By using the method, the equipment in the Bluetooth mesh network can be detached and replaced at will, and the hardware cost and the maintenance cost of the networking are greatly reduced.
Drawings
Fig. 1 is a schematic structural diagram of a conventional bluetooth mesh network;
fig. 2 is a schematic structural diagram of a bluetooth mesh network of the present invention;
fig. 3 is a flowchart of a bluetooth mesh-based self-networking method without a master device according to the present invention.
Detailed Description
The invention is further described with reference to the following figures and specific examples.
The first embodiment is as follows:
the application scene of the embodiment is a set of intelligent lighting system, the intelligent lighting system adopts a self-networking method based on Bluetooth mesh and without a master device to perform networking, the intelligent lamps can automatically enter a networking mode if the intelligent lamps are powered on and are not networked, and in the actual installation process, all the lamps only need to be installed, and then the lamps can enter the networking mode by uniformly turning on the lamps.
As shown in fig. 2, the four lamps are all slave devices, and there is no master device, and the number of the slave devices may be other numbers, but at least two. Each device comprises a memory, a processor and a software program stored on the memory and executable on the processor, which when executed by the processor implements the steps performed by each device in the methods described below.
As shown in fig. 3, the bluetooth mesh-based self-networking method without a master device includes the following steps:
(1) the four devices receive the networking command and enter a networking mode, all the devices have the same initial key, and each device uses the same initial key to self-distribute the network. The key is thus uniformly solidified in the chip of the device when the device is produced.
(2) Each device reads its own MAC address and generates a random number. In order to ensure the effect of the random number, system time or an uncertain value such as a built-in temperature sensor can be used as a random number seed. The random number and the MAC address are operated and the remainder is obtained to obtain the own element address, and because the MAC address of each chip is unique, different element addresses can be generated. And then broadcasting the networking address of the device, wherein the networking address comprises the MAC address of the device and the generated element address.
(3) Each device receives networking addresses of all other devices, compares the received networking addresses with the networking address of the device, regenerates the element address according to the method in the step (1) if the element address in the received networking address is the same as the element address in the networking address of the device, modifies the networking address of the device and compares the networking address of the device again, stores a device list of all the devices and corresponding networking addresses if the element address in the received networking address is different from the element address in the networking address of the device, and negotiates the corresponding addresses of all the devices in the step, so that the networking addresses of all the devices in the mesh networking are not conflicted. This step may specify that no new networking address is received within a period of time, i.e., that networking addresses of all other devices are received and that the networking addresses of each device are different.
For example, in this embodiment, two lamps that enter the networking mode at present negotiate networking addresses with each other, and it is still necessary to wait for a period of time before all the other devices receive the networking addresses, and it is only necessary to make the third lamp enter the networking mode within the period of time, and the first two lamps receive the networking addresses sent by the third lamp, and refresh the waiting time of themselves, so that it can be ensured that all the lamps enter the next step at a substantially uniform time point, and so on, when the networking addresses are negotiated by the four lamps, each device stores the device lists of all the devices and the corresponding networking addresses, and this step is completed.
(4) Each device generates a new key according to the stored device list and the corresponding networking address, and the method for generating the new key can be set by itself, and various methods are available, for example, 8 bytes of data obtained by xoring all 8 bytes of networking addresses in the device list are combined with the number (2 bytes) of the networking addresses stored in the device list and 6 bytes filled with 0x00 to obtain a 16-byte new key. Or adding all the networking addresses with 8 bytes in the equipment list according to the bytes, multiplying the networking addresses by the number of the networking addresses stored in the equipment list to obtain data serving as the lower 8 bytes of the new key, and then negating the data serving as the upper 8 bytes of the new key.
The new key must be coupled to each device in the list to ensure that each network has a unique key. And (3) waiting for a period of time to ensure that all the devices stop broadcasting the networking addresses of the devices in the step (3), wherein the specific waiting time is the same as the waiting time in the step (3). And broadcasting the networking address and the check value of the new key, wherein the check value is a 24-bit CRC check value of the 16-byte new key. Or directly broadcasting the networking address and the new key, and then subsequently directly comparing the new key, wherein the specific use can be selected according to the communication data throughput of the final product.
(5) Each device receives the networking addresses of all other devices and the check value of the new key, compares the received check value of the new key with the check value of the new key of the device, if the received check value of the new key is different from the received check value of the new key, the device list and the corresponding networking addresses of all the devices are deleted, if the received check value of the new key is different from the received check value of the new key, the error occurs in the execution process of the step (3), and returning to execute the steps (3) to (5) until the received check value of the new key is the same as the check value of the new key of the user, if the device does not receive a broadcast different from its new key, but receives the broadcast sent in step (3), if the device in the network has found that an error occurs during the execution of step (3), the stored device list of all devices and the corresponding networking addresses should be deleted, and step (3) to step (5) are executed again. And after the check values of the new keys of the devices are the same, the new keys are used for distribution network.
Finally, all the devices autonomously generate the same new key through broadcast interaction, and the same new key is used for distribution network. At this time, all devices are in the new network, and all device lists and corresponding addresses in the current network are stored, and any one device has the capability of controlling all devices in the network. This step may specify that no different check value is received for a period of time, and that no broadcast packet is received in step (3), indicating that the check values of the new keys for each device are the same. The specific duration of the period of time can be determined by the number of devices in the actual use environment, and the longer the number of devices is, the longer the time is set.
Example two:
in the first embodiment, an ad hoc network is established under the condition that all devices are not networked. The second embodiment is that under the condition that the ad hoc network of a plurality of devices already exists at present, a new device joins the ad hoc network.
For example, a new intelligent lamp needs to be added to an existing network, a networking key function can be set, or other manual trigger functions can be set to enable the intelligent lamp to enter a networking mode. As long as each device receives a signal for entering the networking mode, all devices start to enter the networking mode again from step (1) of the first embodiment to perform a new round of self-networking. The following steps are the same as in example one.
Example three:
in the third embodiment, in the case of an ad hoc network in which a plurality of devices currently exist, where one device wants to exit the ad hoc network, as in the second embodiment, each device may receive a signal to enter the networking mode through a key or other manual triggers, and all devices except the device to be exited start to reenter the networking mode from step (1) of the first embodiment to perform a new round of ad hoc networking. The method can dismantle and replace the equipment at will, and greatly reduces the hardware cost and the maintenance cost of the networking.

Claims (9)

1. A self-distribution networking method based on Bluetooth mesh and without a main device is characterized by comprising the following steps:
(1) the method comprises the following steps that a plurality of devices receive networking commands and enter a networking mode, the devices have the same secret key, and the devices use the same secret key to self-distribute a network;
(2) each device generates and broadcasts a networking address of the device, wherein the networking address comprises an MAC address of the device and a randomly generated element address;
(3) each device receives networking addresses of all other devices, compares the received networking addresses with the networking address of the device, modifies the element address of the device to compare again if the element address in the received networking address is the same as the element address in the networking address of the device, and stores a device list and a corresponding networking address of all the devices if the element address in the received networking address is different from the element address of the networking address of the device;
(4) each device generates a new key according to the stored device list and the corresponding networking address, the new key has coupling with the networking address of each device in the device list, and the networking address and the check value of the new key are broadcasted;
(5) and (3) each device receives the networking addresses of all other devices and the check value of the new key, compares the received check value of the new key with the check value of the new key of the device, deletes the stored device list of all the devices and the corresponding networking addresses if the received network addresses are different, and returns to execute the steps (3) to (5) until the received check value of the new key is the same as the check value of the new key of the device, and if the received network addresses are the same, the new key is used for distribution of the network.
2. The bluetooth mesh-based self-networking method without a master device according to claim 1, wherein in step (1), all devices have the same initial key.
3. The bluetooth mesh-based self-networking method without a master device according to claim 1, wherein in the step (1), there are at least two devices.
4. The bluetooth mesh-based ad hoc networking method without a master device according to claim 1, wherein in step (1), when a new device needs to join in networking, all devices re-enter the networking mode.
5. The bluetooth mesh-based self-networking method without a master device according to claim 1, wherein in step (1), when there is a device in the networking that needs to exit the networking, the other devices re-enter the networking mode.
6. The bluetooth mesh-based self-networking method without a master device according to claim 1, wherein in step (5), all devices autonomously generate the same new key through broadcast interaction.
7. The bluetooth mesh-based self-networking method without a master device according to claim 1, wherein in step (4), the check value of the new key is a 24-bit CRC check value of the new key.
8. A Bluetooth mesh-based self-networking system without a master device is characterized by comprising a plurality of devices without a master device, wherein each device comprises a memory, a processor and a software program which is stored on the memory and can run on the processor, and the processor realizes the following steps when executing the software program:
(1) receiving a networking command, entering a networking mode, and using the same key to self-distribute a network with other equipment;
(2) generating and broadcasting a networking address of the device, wherein the networking address comprises an MAC address of the device and a randomly generated element address;
(3) receiving networking addresses of all other devices, comparing the received networking addresses with the networking addresses of the devices, modifying the element addresses of the devices to compare again if the element addresses in the received networking addresses are the same as the element addresses in the networking addresses of the devices, and storing a device list and corresponding networking addresses of all the devices by each device if the element addresses in the received networking addresses are different from the element addresses of the networking addresses of the devices;
(4) generating a new key according to the stored equipment list and the corresponding networking address, broadcasting the networking address and a check value of the new key;
(5) and (3) receiving networking addresses of all other devices and the check value of the new key, comparing the received check value of the new key with the check value of the new key of the device, deleting the stored device list of all the devices and the corresponding networking addresses if the received networking addresses are different, returning to execute the steps (3) to (5) until the received check value of the new key is the same as the check value of the new key of the device, and using the new key to distribute the network if the received networking addresses are the same as the check value of the new key of the device.
9. The bluetooth mesh-based self-networking system without a master device according to claim 8, wherein there are at least two devices.
CN202110731260.6A 2021-06-30 2021-06-30 Bluetooth mesh-based self-distribution networking method and system without main equipment Active CN113179507B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110731260.6A CN113179507B (en) 2021-06-30 2021-06-30 Bluetooth mesh-based self-distribution networking method and system without main equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110731260.6A CN113179507B (en) 2021-06-30 2021-06-30 Bluetooth mesh-based self-distribution networking method and system without main equipment

Publications (2)

Publication Number Publication Date
CN113179507A CN113179507A (en) 2021-07-27
CN113179507B true CN113179507B (en) 2021-09-28

Family

ID=76927927

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110731260.6A Active CN113179507B (en) 2021-06-30 2021-06-30 Bluetooth mesh-based self-distribution networking method and system without main equipment

Country Status (1)

Country Link
CN (1) CN113179507B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115802383B (en) * 2022-11-18 2023-06-27 广州芯德通信科技股份有限公司 Mesh router pairing production method and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108738005A (en) * 2018-05-22 2018-11-02 西安航天寰星电子科技有限公司 A kind of Mesh network-building methods and its system based on low-power consumption bluetooth
CN108810881A (en) * 2018-06-21 2018-11-13 苏州欧普照明有限公司 One kind matching network method, equipment and system
CN110460977A (en) * 2019-07-23 2019-11-15 厦门阳光恩耐照明有限公司 A kind of Intelligent illumination device based on bluetooth MESH matches network method
CN112671763A (en) * 2020-12-23 2021-04-16 深圳金信诺高新技术股份有限公司 Data synchronization method and device under networking environment and computer equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2017038693A1 (en) * 2015-08-28 2017-03-09 株式会社村田製作所 Wireless mesh network and method for controlling devices via wireless mesh network
US11128528B2 (en) * 2016-12-30 2021-09-21 Intel Corporation Decentralized data storage and processing for IoT devices
CN108882228B (en) * 2018-05-31 2021-06-25 北京橙鑫数据科技有限公司 Wireless grid network establishing method, device and system of electronic equipment system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108738005A (en) * 2018-05-22 2018-11-02 西安航天寰星电子科技有限公司 A kind of Mesh network-building methods and its system based on low-power consumption bluetooth
CN108810881A (en) * 2018-06-21 2018-11-13 苏州欧普照明有限公司 One kind matching network method, equipment and system
CN110460977A (en) * 2019-07-23 2019-11-15 厦门阳光恩耐照明有限公司 A kind of Intelligent illumination device based on bluetooth MESH matches network method
CN112671763A (en) * 2020-12-23 2021-04-16 深圳金信诺高新技术股份有限公司 Data synchronization method and device under networking environment and computer equipment

Also Published As

Publication number Publication date
CN113179507A (en) 2021-07-27

Similar Documents

Publication Publication Date Title
CN106873553B (en) Industrial internet operating system-based field device control management method and device
CN105807617B (en) The control method and device of smart home device
US6990379B2 (en) Method and apparatus for providing a dynamic resource role model for subscriber-requester based protocols in a home automation and control system
EP2519037B1 (en) Method and network for sharing sensor data among mobile terminals
CN105392181B (en) A kind of networking method of smart machine, apparatus and system
CN110366153B (en) Bluetooth ad hoc network method
CN111010324A (en) Household appliance ad hoc network method and system based on BLE MESH network protocol
CN103475703A (en) Intelligent home equipment control method based on ZigBee network
CN110233746B (en) Home networking method and home networking AP
KR20080102359A (en) Network device
WO2011156909A1 (en) Wireless communication network for smart appliances
US20090024727A1 (en) Network system management method
CN109168150B (en) Bluetooth rapid networking method
CN107409270B (en) Method and apparatus for establishing a connection between devices
CN106341468B (en) Remote awakening method, device and system of intelligent equipment
JP2014511627A (en) Method for operating and commissioning a device in a ZigBee network
CN112202877B (en) Gateway linkage method, gateway, cloud server and user terminal
CN103634657A (en) Television and mobile terminal synchronous WIFI connection setup method and device
CN105389278A (en) CAN bus based serial communication method for master and slave machines
CN113179507B (en) Bluetooth mesh-based self-distribution networking method and system without main equipment
CN109361585A (en) A kind of method that child node baud rate and address is arranged in host node automatically
CN113794996B (en) Device communication, device control method, device, electronic device, and storage medium
CN112152884B (en) Equipment control method and device and household appliance
CN111866856B (en) Mesh device control method and system, storage medium and electronic device
CN111555969B (en) Gateway based on Sub-G star network and mesh network

Legal Events

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