A networking method and system for short-range wireless communication
By adopting a short-distance wireless communication networking method in smart home devices and utilizing the networking broadcast and request mechanism of Bluetooth devices, low-latency and low-overhead communication control is achieved, and the problems of communication delay and power consumption in long-term connections are solved. , which improves the flexibility and stability of the system.
Patent Information
- Application Number
- CN202311669760.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-07
- Publication Date
- 2024-08-27
- Estimated Expiration
- 2043-12-07
AI Technical Summary
In existing smart home communication systems, long connection methods lead to communication delays, interruptions and high power consumption, especially in short-distance wireless communication scenarios, affecting user experience.
A short-distance wireless communication networking method is adopted. By configuring the Bluetooth device to the networking state, it periodically sends unconnectable networking broadcasts. The second Bluetooth device scans and receives the networking identification, and sends the networking request broadcast after matching. , realize device pairing connection, and enter the broadcast monitoring state after disconnection, scan and forward or parse the broadcast, and avoid unnecessary communication overhead and delay.
It realizes low-latency and low-overhead communication control of smart home devices. The system is flexible and stable, reducing communication interference and delay, and improving user experience.
Smart Images

Figure CN117528469B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart home technology, and in particular to a networking method and system for short-range wireless communication. Background Art
[0002] With the continuous advancement of science and technology, smart home has become an important part of modern life. The communication control system is the basis for the interconnection between smart home devices and their control devices. By establishing a stable and reliable communication network in the home, various smart devices in the home environment, such as smart lamps, smart door locks and smart appliances, are connected. ZigBee (purple bee) technology and Bluetooth mesh (wireless mesh network) technology are the most widely used communication control technologies in smart homes. Among them, ZigBee has the advantages of low power consumption, low deployment cost, long communication distance and stable and reliable network. Although the equipment cost of Bluetooth mesh is higher, it has stronger compatibility and supports many-to-many communication. There is no need to set up a central device, so it has more advantages in reliability, flexibility and scalability. However, whether it is ZigBee technology or Bluetooth mesh technology, it is a communication system for long connections. That is, in the smart home application scenario, it requires nodes to maintain a long connection state, and constantly exchange information through breathing packets to maintain the connection state, so that the entire network environment always has radio frequency signals. It will interfere with the smart home system itself and other communication systems in the same physical space, resulting in communication delays, interruptions, etc. In the smart home application scenario, the communication frequency between devices is low and the amount of communication data is small. The use of long connections will undoubtedly only generate a large amount of unnecessary communication overhead and power consumption. In order to save power consumption, the use of sleep wake-up reconnection will cause large communication delays and reduce the user experience. Summary of the invention
[0003] Based on the above problems, the present invention proposes a networking method and system for short-range wireless communication, which can realize low-latency and low-overhead communication control of smart home devices, and the system is flexible and stable.
[0004] In view of this, a first aspect of the present invention proposes a networking method for short-range wireless communication, comprising:
[0005] The first Bluetooth device is configured to be in a networking state, and in the networking state, the first Bluetooth device periodically sends a networking broadcast, wherein the networking broadcast includes a networking identifier of a network group where the first Bluetooth device is located, and the networking broadcast is a non-connectable broadcast;
[0006] The second Bluetooth device scans and receives the networking broadcast;
[0007] The second Bluetooth device parses and obtains the networking identifier from the networking broadcast;
[0008] When the networking identifier matches the networking identifier pre-configured in the second Bluetooth device, the second Bluetooth device sends a networking request broadcast, where the networking request broadcast is a connectable broadcast;
[0009] The first Bluetooth device scans and receives the networking request broadcast;
[0010] The first Bluetooth device parses the networking request broadcast to obtain the connection information of the second Bluetooth device to pair with the second Bluetooth device;
[0011] The first Bluetooth device exchanges networking information with the second Bluetooth device to determine the second Bluetooth device as a networking node of the network group where the first Bluetooth device is located;
[0012] The first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter a broadcast monitoring state respectively. In the broadcast monitoring state, the networking node scans the broadcast of the network group to which it belongs according to a pre-configured broadcast scanning period.
[0013] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0014] When any networking node scans a broadcast of the network group to which it belongs, it determines whether the broadcast is a directed broadcast or a non-directed broadcast, and the networking node is the first Bluetooth device or the second Bluetooth device;
[0015] When the broadcast is a non-directional broadcast, the networking node forwards the broadcast;
[0016] Otherwise, the networking node resolves the destination address in the broadcast, and the destination address is the address of the broadcast object of the directional broadcast;
[0017] When the destination address matches the device address of the networking node, the networking node generates and sends a response broadcast corresponding to the broadcast;
[0018] When the destination address does not match the device address of the networking node, the networking node forwards the broadcast.
[0019] Preferably, the step of the networking node forwarding the broadcast specifically includes:
[0020] Receiving the broadcasted data packet;
[0021] Get the preset maximum forwarding delay time t max ;
[0022] 0 and the maximum forwarding delay time t max A value is randomly generated within the interval as the delay time t random ;
[0023] Wait for the delay time t random Then, the broadcast data packet is sent on the broadcast channel.
[0024] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0025] When a control broadcast event is triggered at any group of network nodes, a broadcast data packet of a non-connectable broadcast is generated, wherein the broadcast data packet includes the network identifier;
[0026] The networking node sends the broadcast data packet to a broadcast channel;
[0027] When the broadcast data packet is a directional broadcast data packet, the networking node scans and receives a response broadcast sent by the broadcast object.
[0028] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0029] When a communication broadcast event is triggered on any group of network nodes, the size of the data to be transmitted is obtained;
[0030] Determine whether the size of the data to be transmitted is greater than a preset threshold;
[0031] When the size of the data to be transmitted is greater than a preset threshold, constructing a transmission path between the data sending node and the data receiving node, the transmission path including the data sending node, the data receiving node, and a networking node of the same network group located between the data sending node and the data receiving node;
[0032] Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path;
[0033] The broadcast data packet is sent to a broadcast channel.
[0034] Preferably, after the step of determining whether the size of the data to be transmitted is greater than a preset threshold, the method further includes:
[0035] When the size of the data to be transmitted is less than or equal to a preset threshold, generating a broadcast data packet of a non-connectable broadcast containing the data to be transmitted;
[0036] The broadcast data packet is sent to a broadcast channel.
[0037] Preferably, after the step of sending the broadcast data packet to the broadcast channel, the method further comprises:
[0038] When any group of network nodes receives the broadcast data packet of the connectable broadcast, it establishes a Bluetooth connection with the previous node of the transmission path according to the source address in the broadcast data packet;
[0039] receiving the data to be transmitted via the Bluetooth connection;
[0040] Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path;
[0041] The broadcast data packet is sent to a broadcast channel.
[0042] Preferably, the step of configuring the first Bluetooth device to be in a networking state specifically includes:
[0043] Determine whether the first Bluetooth device is a networked device;
[0044] When the first Bluetooth device is not a networked device, generating a new network group based on a pre-built network group model;
[0045] The first Bluetooth device is determined as a networking node of the network group.
[0046] Preferably, the steps of constructing a new network group specifically include:
[0047] Generate network group instances based on pre-built network group models;
[0048] Generate basic attribute data of the network group instance, wherein the basic attribute data includes a network identifier and an encryption key of the network group;
[0049] The step of determining the first Bluetooth device as a networking node of the network group specifically includes:
[0050] Acquire device information of the first Bluetooth device, where the device information includes a MAC address and a device key of the first Bluetooth device;
[0051] A device address of the first Bluetooth device is generated based on the network identifier, the MAC address of the first Bluetooth device, and a device key.
[0052] The second aspect of the present invention proposes a networking system for short-range wireless communication, comprising a plurality of smart home devices and a plurality of smart home control devices, wherein the smart home devices and the smart home control devices include a Bluetooth module, and the smart home devices and the smart home control devices have a Bluetooth module configured to implement the networking method described in any one of the second aspect of the present invention.
[0053] The present invention proposes a networking method and system for short-range wireless communication, which configures a first Bluetooth device to a networking state, a second Bluetooth device scans and receives a networking broadcast, and a networking identifier is parsed from the networking broadcast. When the networking identifier matches a networking identifier pre-configured in the second Bluetooth device, a networking request broadcast is sent, the first Bluetooth device scans and receives a networking request broadcast, and connection information of the second Bluetooth device is parsed from the networking request broadcast to pair and connect with the second Bluetooth device. The first Bluetooth device exchanges networking information with the second Bluetooth device, and the first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter a broadcast listening state respectively. In the broadcast listening state, the networking node scans the broadcast of the network group to which it belongs according to a pre-configured broadcast scanning period, so as to realize low-latency and low-overhead communication control of smart home devices, and the system is flexible and has strong stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 It is a flowchart of a networking method applied to short-range wireless communication provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0055] In order to more clearly understand the above-mentioned purpose, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.
[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited to the specific embodiments disclosed below.
[0057] In the description of the present invention, the term "multiple" refers to two or more. Unless otherwise clearly defined, the orientation or positional relationship indicated by the terms "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it cannot be understood as a limitation of the present invention. The terms "connection", "installation", "fixation", etc. should be understood in a broad sense. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be directly connected or indirectly connected through an intermediate medium. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances. In addition, the terms "first", "second", etc. are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first", "second", etc. can explicitly or implicitly include one or more of the features. In the description of the present invention, unless otherwise specified, the meaning of "multiple" is two or more.
[0058] In the description of this specification, the description of the terms "one embodiment", "some implementations", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0059] A networking method and system for short-range wireless communication provided according to some embodiments of the present invention will be described below with reference to the accompanying drawings.
[0060] like Figure 1 As shown, the first aspect of the present invention proposes a networking method for short-range wireless communication, comprising:
[0061] The first Bluetooth device is configured to be in a networking state, and in the networking state, the first Bluetooth device periodically sends a networking broadcast, wherein the networking broadcast includes a networking identifier of a network group where the first Bluetooth device is located, and the networking broadcast is a non-connectable broadcast;
[0062] The second Bluetooth device scans and receives the networking broadcast;
[0063] The second Bluetooth device parses and obtains the networking identifier from the networking broadcast;
[0064] When the networking identifier matches the networking identifier pre-configured in the second Bluetooth device, the second Bluetooth device sends a networking request broadcast, where the networking request broadcast is a connectable broadcast;
[0065] The first Bluetooth device scans and receives the networking request broadcast;
[0066] The first Bluetooth device parses the networking request broadcast to obtain the connection information of the second Bluetooth device to pair with the second Bluetooth device;
[0067] The first Bluetooth device exchanges networking information with the second Bluetooth device to determine the second Bluetooth device as a networking node of the network group where the first Bluetooth device is located;
[0068] The first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter a broadcast monitoring state respectively. In the broadcast monitoring state, the networking node scans the broadcast of the network group to which it belongs according to a pre-configured broadcast scanning period.
[0069] In the technical solution of the above implementation, the first Bluetooth device can be a Bluetooth device in a networked state or a Bluetooth device in a non-networked state. When the first Bluetooth device is a Bluetooth device in a non-networked state, before periodically sending a networking broadcast, the first Bluetooth device first performs the self-configuration step.
[0070] The non-connectable broadcast is a broadcast that does not include a source address. The connectable broadcast is a broadcast that includes a source address, and the source address is the connectable address of the broadcast sender. In the technical solution of the above-mentioned implementation mode, the networking broadcast does not include the connectable address information of the first Bluetooth device, that is, after any device receives the networking broadcast, it is unable to obtain the connectable address information of the first Bluetooth device to pair and connect with the first Bluetooth device. Similarly, the networking request broadcast includes the connectable address information of the second Bluetooth device. After the first Bluetooth device scans the networking request broadcast, it can pair and connect with the second Bluetooth device according to the connectable address information.
[0071] Furthermore, after the step of the first Bluetooth device scanning and receiving the networking request broadcast, the first Bluetooth device stops sending the networking broadcast. Before the step of the first Bluetooth device parsing the connection information of the second Bluetooth device from the networking request broadcast to pair and connect with the second Bluetooth device, the first Bluetooth device verifies the legitimacy of the networking request broadcast, including but not limited to verifying the validity of the authentication data of the second Bluetooth device. In the step of the first Bluetooth device exchanging networking information with the second Bluetooth device, the networking information includes but is not limited to the device address information of the second Bluetooth device provided by the second Bluetooth device to the first Bluetooth device, the device address is generated by the second Bluetooth device using its own device key, and the group identifier, encryption key and other information of the network group provided by the first Bluetooth device to the second Bluetooth device. In the step of the first Bluetooth device and the second Bluetooth device disconnecting the Bluetooth connection and entering the broadcast listening state respectively, the size of the broadcast scanning cycle can be configured accordingly according to the user's demand for the response speed of the Bluetooth device.
[0072] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0073] When any networking node scans a broadcast of the network group to which it belongs, it determines whether the broadcast is a directed broadcast or a non-directed broadcast, and the networking node is the first Bluetooth device or the second Bluetooth device;
[0074] When the broadcast is a non-directional broadcast, the networking node forwards the broadcast;
[0075] Otherwise, the networking node resolves the destination address in the broadcast, and the destination address is the address of the broadcast object of the directional broadcast;
[0076] When the destination address matches the device address of the networking node, the networking node generates and sends a response broadcast corresponding to the broadcast;
[0077] When the destination address does not match the device address of the networking node, the networking node forwards the broadcast.
[0078] Specifically, when each Bluetooth device sends a broadcast on a broadcast channel, the broadcast data packet it sends will carry the network identifier of the network group to which it belongs. The networking node, i.e., the Bluetooth device, identifies whether the broadcast data packet is a broadcast of the network group to which it belongs based on the network identifier in the broadcast data packet. The directional broadcast is a broadcast sent to a specific network node, i.e., a broadcast object, in the network group. The broadcast data packet of the directional broadcast contains a destination address, which is the address of the broadcast object, which can be the IP (Internet Protocol) address or MAC address (Media Access Control Address) of the broadcast object. Since the coverage range of the Bluetooth radio frequency signal of the Bluetooth device is limited, the broadcast object may not be within the Bluetooth signal coverage range of the networking node that sends the broadcast. In the technical solution of the present invention, the networking node of the same network group as the networking node that sends the broadcast forwards the broadcast after receiving the broadcast, so that the broadcast can be transmitted to the signal coverage range of all network nodes in the network group. Since the device control and communication frequency in the smart home system is very low, and the amount of control instructions and communication data is small, directly transmitting control instructions and communication data through the broadcast channel will not burden the broadcast channel. At the same time, it avoids the cumbersome process of Bluetooth connection and the huge communication overhead, and greatly reduces communication delay and communication interference.
[0079] Preferably, the step of the networking node forwarding the broadcast specifically includes:
[0080] Receiving the broadcasted data packet;
[0081] Get the preset maximum forwarding delay time t max ;
[0082] 0 and the maximum forwarding delay time t max A value is randomly generated within the interval as the delay time t random ;
[0083] Wait for the delay time t random Then, the broadcast data packet is sent on the broadcast channel.
[0084] In the technical solution of the present invention, when any networking node scans a broadcast of its network group, when the broadcast object of the broadcast is not the current networking node, the current networking node will forward the broadcast to expand the transmission range of the broadcast. However, if each networking node forwards the broadcast immediately after receiving it, when there are a large number of networking nodes in the same area, broadcast collisions, losses, and interference may occur, reducing the reliability and effectiveness of the broadcast. On the other hand, if a large number of networking nodes send broadcasts at the same time, it will also cause congestion in the broadcast channel and may even interfere with other surrounding communication systems. Therefore, in the technical solution of the above-mentioned implementation method, each networking node generates a random delay time to forward the broadcast of a non-self-broadcast object to solve the above-mentioned problem. By configuring the maximum forwarding delay time t max The size of the system can effectively control the overall communication delay of the system.
[0085] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0086] When a control broadcast event is triggered at any group of network nodes, a broadcast data packet of a non-connectable broadcast is generated, wherein the broadcast data packet includes the network identifier;
[0087] The networking node sends the broadcast data packet to a broadcast channel;
[0088] When the broadcast data packet is a directional broadcast data packet, the networking node scans and receives a response broadcast sent by the broadcast object.
[0089] Specifically, the control broadcast event is a broadcast event for sending smart home device control instructions, and the smart home device control instructions include instructions for controlling smart home devices to turn on and off, including adjusting smart home device parameters such as setting temperature values, brightness values, etc. The broadcast event can be a passively triggered broadcast event, for example, a mobile phone or a switch panel is a networking node in a smart home network group, and a user operates on the mobile phone or the switch panel to trigger a broadcast event, such as turning on or off the light. The broadcast event can also be an actively triggered broadcast event, for example, a timing program is configured in the network node, and when the timing program meets the time condition of a countdown or a specific time point, a broadcast event is triggered. Specifically, in the actual application scenario, the mobile phone or the switch panel is a networking node in a smart home network group, and it is configured with a timed light-on or light-off program. When the set time condition is met, a broadcast data packet is generated with the corresponding smart lamp as the broadcast object, so that the broadcast object belonging to the same smart home network group, that is, the smart lamp, executes the light-on or light-off instruction in the data packet after receiving the broadcast data packet. Preferably, the networking node encrypts the broadcast data in the broadcast data packet using an encryption key of the network group to which it belongs.
[0090] Preferably, after the step of disconnecting the Bluetooth connection between the first Bluetooth device and the second Bluetooth device and entering the broadcast monitoring state respectively, the method further includes:
[0091] When a communication broadcast event is triggered on any group of network nodes, the size of the data to be transmitted is obtained;
[0092] Determine whether the size of the data to be transmitted is greater than a preset threshold;
[0093] When the size of the data to be transmitted is greater than a preset threshold, constructing a transmission path between the data sending node and the data receiving node, the transmission path including the data sending node, the data receiving node, and a networking node of the same network group located between the data sending node and the data receiving node;
[0094] Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path;
[0095] The broadcast data packet is sent to a broadcast channel.
[0096] Specifically, the communication broadcast event is a broadcast event for sending communication data other than control instructions, such as transmitting a firmware upgrade package for upgrading a smart home device system. The maximum length of a Bluetooth broadcast is 37 bytes, and the MAC address of the broadcasting device occupies 6 bytes. Therefore, a Bluetooth broadcast data packet can carry a maximum of 31 bytes of data, which is sufficient for transmitting control instructions for smart home devices, but it is very difficult to transmit other communication data, and transmitting communication data through a large number of broadcast data packets will occupy the broadcast channel. Therefore, in the technical solution of the above-mentioned implementation method, for data to be transmitted that is greater than 31 bytes, the data to be transmitted is sent by constructing multiple networking nodes in the same network group as the transmission path. The data sending node is the networking node in the network group that needs to send the data to be transmitted, and the data receiving node is the target networking node in the network group that receives the data to be transmitted.
[0097] Preferably, after the step of determining whether the size of the data to be transmitted is greater than a preset threshold, the method further includes:
[0098] When the size of the data to be transmitted is less than or equal to a preset threshold, generating a broadcast data packet of a non-connectable broadcast containing the data to be transmitted;
[0099] The broadcast data packet is sent to a broadcast channel.
[0100] In the technical solution of this implementation, when the data to be transmitted is less than or equal to 31 bytes, it is directly transmitted in the broadcast channel through a non-connectable broadcast, without constructing a transmission path to establish a Bluetooth connection between each networking node for transmission.
[0101] Preferably, after the step of sending the broadcast data packet to the broadcast channel, the method further comprises:
[0102] When any group of network nodes receives the broadcast data packet of the connectable broadcast, it establishes a Bluetooth connection with the previous node of the transmission path according to the source address in the broadcast data packet;
[0103] receiving the data to be transmitted via the Bluetooth connection;
[0104] Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path;
[0105] The broadcast data packet is sent to a broadcast channel.
[0106] In the technical solution of the above implementation, when the networking node receiving the data to be transmitted is the end node in the transmission path, that is, the data receiving node, after receiving the data to be transmitted, a connectable broadcast for establishing a data transmission link is no longer generated.
[0107] Preferably, the step of configuring the first Bluetooth device to be in a networking state specifically includes:
[0108] Determine whether the first Bluetooth device is a networked device;
[0109] When the first Bluetooth device is not a networked device, generating a new network group based on a pre-built network group model;
[0110] The first Bluetooth device is determined as a networking node of the network group.
[0111] Specifically, the networked device refers to a Bluetooth device that has joined a certain network group and become one of the network nodes. Before the step of configuring the first Bluetooth device to be in a networked state, the second Bluetooth device is not a networked device, that is, the second Bluetooth device is in a state of not joining any network group. In the technical solutions of other embodiments of the present invention, before the step of configuring the first Bluetooth device to be in a networked state, if the second Bluetooth device is a networked device, an operation of resetting the second Bluetooth device or making the second Bluetooth device exit the network group it has joined is performed.
[0112] Preferably, the steps of constructing a new network group specifically include:
[0113] Generate network group instances based on pre-built network group models;
[0114] Generate basic attribute data of the network group instance, wherein the basic attribute data includes a network identifier and an encryption key of the network group;
[0115] The step of determining the first Bluetooth device as a networking node of the network group specifically includes:
[0116] Acquire device information of the first Bluetooth device, where the device information includes a MAC address and a device key of the first Bluetooth device;
[0117] A device address of the first Bluetooth device is generated based on the network identifier, the MAC address of the first Bluetooth device, and a device key.
[0118] Specifically, the network identifier is a unique identifier randomly generated by the first Bluetooth device for identifying the network group, and the encryption key is a key randomly generated by the first Bluetooth device for encrypting broadcast communication data communicated in the network group. Each Bluetooth device has a unique device key, which is preset by the device manufacturer at the factory, or generated by a hardware random number generator in the Bluetooth device when the Bluetooth device is first started.
[0119] The second aspect of the present invention proposes a networking system for short-range wireless communication, comprising a plurality of smart home devices and a plurality of smart home control devices, wherein the smart home devices and the smart home control devices include a Bluetooth module, and the smart home devices and the smart home control devices have a Bluetooth module configured to implement the networking method described in any one of the second aspect of the present invention.
[0120] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the statement "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0121] According to the embodiments of the present invention as described above, these embodiments do not describe all the details in detail, nor do they limit the invention to the specific embodiments described. Obviously, many modifications and changes can be made based on the above description. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the present invention, so that those skilled in the art can make good use of the present invention and the modified use based on the present invention. The present invention is limited only by the claims and their full scope and equivalents.
Claims
1. A networking method for short-range wireless communication, characterized in that: include: The first Bluetooth device is configured to be in a networking state, wherein the first Bluetooth device periodically sends a networking broadcast in the networking state, wherein the networking broadcast includes a networking identifier of a network group where the first Bluetooth device is located, and the networking broadcast is an unconnectable broadcast, wherein the unconnectable broadcast is a broadcast that does not include a source address, and the networking broadcast does not include the connectable address information of the first Bluetooth device, and after receiving the networking broadcast, any device cannot obtain the connectable address information of the first Bluetooth device to pair and connect with the first Bluetooth device; The second Bluetooth device scans and receives the networking broadcast; The second Bluetooth device parses and obtains the networking identifier from the networking broadcast; When the networking identifier matches the networking identifier pre-configured in the second Bluetooth device, the second Bluetooth device sends a networking request broadcast, the networking request broadcast is a connectable broadcast, the connectable broadcast is a broadcast including a source address, the networking request broadcast includes connectable address information of the second Bluetooth device, and after the first Bluetooth device scans the networking request broadcast, it can pair and connect with the second Bluetooth device according to the connectable address information; The first Bluetooth device scans and receives the networking request broadcast; The first Bluetooth device parses the networking request broadcast to obtain the connection information of the second Bluetooth device to pair with the second Bluetooth device; The first Bluetooth device exchanges networking information with the second Bluetooth device to determine the second Bluetooth device as a networking node of the network group where the first Bluetooth device is located; The first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter a broadcast monitoring state respectively. In the broadcast monitoring state, the networking node scans the broadcast of the network group to which it belongs according to a pre-configured broadcast scanning period; After the first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter the broadcast monitoring state respectively, the method further includes: When any networking node scans a broadcast of the network group to which it belongs, it determines whether the broadcast is a directed broadcast or a non-directed broadcast, and the networking node is the first Bluetooth device or the second Bluetooth device; When the broadcast is a non-directional broadcast, the networking node forwards the broadcast; Otherwise, the networking node resolves the destination address in the broadcast, and the destination address is the address of the broadcast object of the directional broadcast; When the destination address matches the device address of the networking node, the networking node generates and sends a response broadcast corresponding to the broadcast; When the destination address does not match the device address of the networking node, the networking node forwards the broadcast; After the first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter the broadcast monitoring state respectively, the method further includes: When a control broadcast event is triggered at any networking node, a broadcast data packet of a non-connectable broadcast is generated, and the broadcast data packet includes the networking identifier; The networking node sends the broadcast data packet to a broadcast channel; When the broadcast data packet is a directional broadcast data packet, the networking node scans and receives a response broadcast sent by the broadcast object; After the first Bluetooth device and the second Bluetooth device disconnect the Bluetooth connection and enter the broadcast monitoring state respectively, the method further includes: When a communication broadcast event is triggered on any group of network nodes, the size of the data to be transmitted is obtained; Determine whether the size of the data to be transmitted is greater than a preset threshold; When the size of the data to be transmitted is greater than a preset threshold, constructing a transmission path between the data sending node and the data receiving node, the transmission path including the data sending node, the data receiving node, and a networking node of the same network group located between the data sending node and the data receiving node; Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path; The broadcast data packet is sent to a broadcast channel.
2. The networking method according to claim 1, characterized in that: The step of forwarding the broadcast by the networking node specifically includes: Receiving the broadcasted data packet; Get the preset maximum forwarding delay time t max ; 0 and the maximum forwarding delay time t max A value is randomly generated within the interval as the delay time t random ; Wait for the delay time t random Then, the broadcast data packet is sent on the broadcast channel.
3. Networking identification The networking method according to claim 1, characterized in that: After the step of determining whether the size of the data to be transmitted is greater than a preset threshold, the method further includes: When the size of the data to be transmitted is less than or equal to a preset threshold, generating a broadcast data packet of a non-connectable broadcast containing the data to be transmitted; The broadcast data packet is sent to a broadcast channel.
4. The networking method according to claim 1, characterized in that: After the step of sending the broadcast data packet to the broadcast channel, the method further comprises: When any group of network nodes receives the broadcast data packet of the connectable broadcast, it establishes a Bluetooth connection with the previous node of the transmission path according to the source address in the broadcast data packet; receiving the data to be transmitted via the Bluetooth connection; Generate a broadcast data packet for establishing a data transmission link with a connectable broadcast, taking the next node in the transmission path as a broadcast object, wherein the broadcast data packet includes the transmission path; The broadcast data packet is sent to a broadcast channel.
5. The networking method according to claim 1, characterized in that: The step of configuring the first Bluetooth device to be in a networking state specifically includes: Determine whether the first Bluetooth device is a networked device; When the first Bluetooth device is not a networked device, generating a new network group based on a pre-built network group model; The first Bluetooth device is determined as a networking node of the network group.
6. The networking method according to claim 5, characterized in that: The steps of generating a new network group based on a pre-built network group model specifically include: Generate network group instances based on pre-built network group models; Generate basic attribute data of the network group instance, wherein the basic attribute data includes a networking identifier and an encryption key of the network group; The step of determining the first Bluetooth device as a networking node of the network group specifically includes: Acquire device information of the first Bluetooth device, where the device information includes a MAC address and a device key of the first Bluetooth device; A device address of the first Bluetooth device is generated based on the networking identifier, the MAC address of the first Bluetooth device, and a device key.
