Network distribution method and device, nonvolatile storage medium, and electronic device
By sending acquisition and configuration commands to the Bluetooth mesh network, assigning network addresses and encrypting key pairs, simultaneous network configuration of multiple devices is achieved, solving the problem of slow one-by-one network configuration and improving network configuration efficiency.
Patent Information
- Application Number
- CN202310804348.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-30
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2043-06-30
AI Technical Summary
In existing technologies, when multiple devices are paired in a Bluetooth mesh network, they can only be paired one by one, resulting in slow pairing speeds and long pairing times.
By sending an acquisition command to a broadcast address within the wireless signal coverage area, information on multiple devices to be networked is obtained, and network addresses are assigned to them. Then, a network configuration command is sent simultaneously, and encryption and decryption are performed using a key pair to achieve batch network configuration for multiple devices.
It enables simultaneous network configuration for multiple devices, improving network configuration speed and solving the problem of slow speed caused by configuring networks one by one.
Smart Images

Figure CN116582870B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of networking, in particular to a network configuration method and device, a nonvolatile storage medium and an electronic device. BACKGROUND
[0002] Meanwhile, the premise of communication among multiple devices within the coverage range of a Bluetooth wireless mesh network is that the multiple devices are nodes in the Bluetooth mesh. The process of changing multiple non-network configuration devices within the Bluetooth mesh network range into nodes in the Bluetooth mesh is called network configuration. In the related art, only one device can be configured for network configuration at a time, and the network configuration speed is slow.
[0003] In view of the above problems, no effective solution has been proposed so far. SUMMARY
[0004] The embodiments of the present application provide a network configuration method and device, a nonvolatile storage medium and an electronic device to at least solve the technical problem of slow network configuration and long time caused by the fact that the related art can only configure multiple devices for network configuration one by one.
[0005] According to an aspect of an embodiment of the present application, a network configuration method is provided, comprising: sending an acquisition command to a broadcast address within a wireless signal coverage range, wherein the acquisition command is used to acquire information of multiple devices to be configured for network within the wireless signal coverage range, and the information comprises: local area network addresses of the multiple devices to be configured for network, and the number of sub-devices to be configured for network in each device to be configured for network; receiving multiple first response information of the acquisition command, assigning network configuration addresses to each device to be configured for network in turn which sends the multiple first response information, and sending the network configuration addresses corresponding to each device to be configured for network to the local area network addresses of the devices; and simultaneously sending a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration of the devices to be configured for network which have been assigned network configuration addresses.
[0006] Optionally, the network configuration command comprises: multiple identical second key pairs, wherein each second key pair comprises: one network key and one application key.
[0007] Optionally, the network configuration of the devices to be configured for network which have been assigned network configuration addresses comprises: encrypting the multiple second key pairs by using the first key pair; and sending the encrypted multiple second key pairs to a relay device in the broadcast address, wherein each second key pair corresponds to one device to be configured for network, and the relay device is a device or a device to be configured for network which stores the first key pair.
[0008] Optionally, before the network address is allocated to each of the plurality of first response information sending devices in sequence, the network configuration method comprises: determining the number of the network configuration devices; comparing the number of the network configuration devices with a preset value to obtain a comparison result; and performing a network configuration operation corresponding to the comparison result.
[0009] Optionally, the number of the network configuration devices is determined by: determining whether the first response information is received within a preset time period; if the first response information is determined to be received within the preset time period, restarting the timing until the first response information cannot be received within the preset time period, and stopping the timing; determining the number of times of restarting the timing, and determining the number of the first response information received within the preset time period each time; and determining the product of the number of the first response information and the number of times as the number of the network configuration devices.
[0010] Optionally, the network configuration operation corresponding to the comparison result is performed by: if the comparison result indicates that the number of the network configuration devices is the same as the preset value, directly sending a network configuration command to the broadcast address; and if the comparison result indicates that the number of the network configuration devices is different from the preset value, updating the preset value to a value corresponding to the number of the network configuration devices, and then sending the network configuration command to the broadcast address.
[0011] Optionally, the network configuration method further comprises: receiving second response information of the network configuration command, and determining the network configuration device sending the second response information as the network configuration device having been allocated the network address.
[0012] According to another aspect of the embodiments of the present application, a network configuration method is also provided, comprising: receiving an acquisition command from a broadcast address; in response to the acquisition command, sending network configuration device information to a gateway, wherein the network configuration device information comprises: a local area network address of a network configuration device and a number of sub-devices of the network configuration device to be configured; receiving network configuration information from a relay device in the broadcast address, decrypting the network configuration information by using a first key pair to obtain a network key and an application key, and saving the network key and the application key as a second key pair; at the same time, receiving a network address sent by the gateway, and searching for the second key pair after receiving the network address; if the second key pair is found, sending a confirmation message to the gateway to confirm that the network configuration is successful, wherein the confirmation message comprises: the local area network address and the network address.
[0013] According to another aspect of the embodiments of the present application, a device for network configuration is also provided, comprising: a sending module configured to send an obtaining command to a broadcast address within a wireless signal coverage range, wherein the obtaining command is used to obtain information of a plurality of devices to be configured in a network within the wireless signal coverage range, and the information comprises local area network addresses of the plurality of devices to be configured in a network and a number of sub-devices to be configured in a network in each of the devices to be configured in a network; a receiving module configured to receive a plurality of response information of the obtaining command, and sequentially assign network configuration addresses to each of the devices to be configured in a network sending the plurality of response information, and send the network configuration address corresponding to each of the devices to be configured in a network to the local area network address of each of the devices to be configured in a network; and a network configuration module configured to send a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration of the devices to be configured in a network to which the network configuration addresses have been assigned.
[0014] According to another aspect of the embodiments of the present application, a non-volatile storage medium is also provided, wherein the non-volatile storage medium stores a computer program, and a device in which the non-volatile storage medium is located executes the network configuration method described above by running the computer program.
[0015] According to another aspect of the embodiments of the present application, an electronic device is also provided, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the network configuration method described above by running the computer program.
[0016] In the embodiments of the present application, the obtaining command is sent to the broadcast address within the wireless signal coverage range, wherein the obtaining command is used to obtain information of a plurality of devices to be configured in a network within the wireless signal coverage range, and the information comprises local area network addresses of the plurality of devices to be configured in a network and a number of sub-devices to be configured in a network in each of the devices to be configured in a network; a plurality of first response information of the obtaining command is received, and network configuration addresses are sequentially assigned to each of the devices to be configured in a network sending the plurality of first response information, and the network configuration address corresponding to each of the devices to be configured in a network is sent to the local area network address of each of the devices to be configured in a network; meanwhile, the network configuration command is sent to the broadcast address, wherein the network configuration command is used to trigger network configuration of the devices to be configured in a network to which the network configuration addresses have been assigned. By sending the network configuration information to the broadcast address, the purpose of simultaneously and in batches configuring the devices is achieved. Meanwhile, two keys are used, one of which is used for communication and the other is used for network configuration. Thus, the technical effect that the devices to be configured can simultaneously be configured and forward the network configuration message is achieved, and the network configuration speed is improved. Furthermore, the technical problem of slow network configuration and long time caused by the related art which can only configure the plurality of devices one by one is solved. BRIEF DESCRIPTION OF DRAWINGS
[0017] The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and serve to explain the principles of the application. In the drawings:
[0018] Figure 1 is a flow chart of a method of commissioning according to an embodiment of the application;
[0019] Figure 2 is a schematic diagram of a commissioning process according to an embodiment of the application;
[0020] Figure 3 is a flow chart of another method of commissioning provided according to an embodiment of the application;
[0021] Figure 4 is a structural diagram of a device for commissioning according to an embodiment of the application;
[0022] Figure 5 is a working flow chart of a device for commissioning according to an embodiment of the application. DETAILED DESCRIPTION
[0023] In order to make the personnel in the technical field better understand the scheme of the present application, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor should be within the scope of protection of the present application.
[0024] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily have to describe a specific order or sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product or device that includes a series of steps or units does not have to be limited to those steps or units clearly listed, but can include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] In the related art, when commissioning, five processes of sending a beacon signal, inviting a device, exchanging a public key, device authentication and distributing configuration data are required, and only one device can be commissioned at a time; therefore, there are problems of complex commissioning process, long commissioning time and slow commissioning speed. In order to solve this problem, the related solutions are provided in the embodiments of the present application, which are described in detail below.
[0026] According to the embodiment of the present application, a method for network configuration is provided. It should be noted that the steps shown in the flowchart can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0027] Figure 1 A flowchart of a method for network configuration is provided according to the embodiment of the present application, as shown in Figure 1 The method comprises the following steps:
[0028] In step S102, a get command is sent to the broadcast address within the wireless signal coverage range, wherein the get command is used to obtain the information of a plurality of devices to be networked within the wireless signal coverage range, and the information comprises the local area network address of the plurality of devices to be networked and the number of devices to be networked in each device to be networked.
[0029] The method provided by the embodiment of the present application is used for network configuration of devices in a Bluetooth mesh network. In step S102, the gateway obtains the information of all devices to be networked in the signal range, wherein at least the mac address (i.e. the local area network address) of each device to be networked in the Bluetooth mesh network and the number of devices to be networked in each device to be networked are obtained. Preferably, in addition to obtaining the above information, the network configuration state, the running state, the type of the device and other information of each device to be networked can also be obtained.
[0030] In step S104, a plurality of first response information of the get command is received, a network address is allocated to each device to be networked in turn which sends the plurality of first response information, and the network address corresponding to each device to be networked is sent to the local area network address of each device to be networked.
[0031] In step S104, the gateway receives the (first) response information sent by each device to be networked in response to the get command sent in step S102; identifies the device to be networked which sends the (first) response information, and determines it as a device which needs to join the Bluetooth mesh network; allocates a network address (mesh address) to each device to be networked which sends the (first) response information; and sends the mesh address allocated to the device to be networked which sends the (first) response information to the mac address of the device to be networked, wherein the mac address of the device to be networked is obtained from the (first) response information sent by the device to be networked.
[0032] Meanwhile, in step S106, a network configuration command is sent to the broadcast address, wherein the network configuration command is used to trigger network configuration of the device to be networked which has been allocated a network address.
[0033] In step S106, while sending the mesh address to the to-be-networked device that sends the (first) response information, a network configuration command is sent to the to-be-networked device that sends the (first) response information to configure the device to be added to the Bluetooth mesh network.
[0034] Through the above steps, the network configuration of multiple unconfigured devices in the Bluetooth mesh network can be implemented at the same time, and the technical effect of quickly adding multiple devices to the Bluetooth mesh network is achieved. The network configuration speed is improved.
[0035] According to an optional embodiment of the present application, the network configuration command comprises: a plurality of identical second key pairs, wherein each second key pair comprises: a network key and an application key.
[0036] The to-be-networked command sent to the to-be-networked device in step S106 comprises a key pair (i.e. a second key pair) for network configuration; wherein each key pair (i.e. a second key pair) for network configuration comprises a network key (netkey) and an application key (appkey); wherein the netkey is a 128-bit encryption key. The netkey can be set manually or generated by a random number; the netkey can prevent external attackers from obtaining sensitive information or tampering with data packets, thus ensuring the security of communication between nodes in the Bluetooth mesh network. The appkey is used for authentication and encryption in Bluetooth communication, and is a random number generated according to the pairing process between the communication devices. Each device independently saves the appkey, and verifies and confirms the validity of each other through the appkey when connecting. Since the multiple devices within the Bluetooth mesh network in the embodiment of the present application are configured with the same gateway, the multiple key pairs (i.e. second key pairs) for network configuration sent by the gateway are the same.
[0037] According to another optional embodiment of the present application, the network configuration of the to-be-networked device that has been allocated a network address comprises: encrypting a plurality of second key pairs using a first key pair; sending the encrypted plurality of second key pairs to the relay device in the broadcast address, wherein each second key pair corresponds to a to-be-networked device, and the relay device is a device or to-be-networked device that saves the first key pair.
[0038] Figure 2 is a schematic diagram of the network configuration process, such as Figure 2As shown, after determining the plurality of devices that need to join the Bluetooth mesh network in the Bluetooth mesh network, the plurality of devices are commissioned. Among them, the gateway simultaneously stores a key pair (i.e., the first key pair) for communication and a key pair (i.e., the second key pair) for commissioning. The gateway encrypts the key pair (i.e., the second key pair) for commissioning using the key pair (i.e., the first key pair) for communication. The encrypted commissioning key pair (i.e., the second key pair) is sent to the broadcast address, and the broadcast address broadcasts the commissioning key pair (i.e., the second key pair) in the Bluetooth mesh network. The communication key pair (i.e., the first key pair) is saved in the to-be-networked device. After the to-be-networked device receives the encrypted commissioning key pair (i.e., the second key pair), the to-be-networked device decrypts the encrypted commissioning key pair (i.e., the second key pair) using the communication key pair (i.e., the first key pair) to obtain the netkey and the appkey and saves them as the commissioning key pair (i.e., the second key pair) of the to-be-networked device to realize commissioning. Moreover, since the communication key pair (i.e., the first key pair) is saved in the to-be-networked device, even if the to-be-networked device successfully commissions and updates the network parameters, the to-be-networked device can still forward the commissioning key pair (i.e., the second key pair) through the communication key pair (i.e., the first key pair), avoiding the situation that the to-be-networked device far from the gateway cannot be commissioned due to the fact that the device close to the gateway updates the network parameters and cannot forward the commissioning key pair (i.e., the second key pair). In addition, the device that saves the communication key pair (i.e., the first key pair) in the Bluetooth mesh network can also be used as a relay device to forward the commissioning key pair (i.e., the second key pair) to the to-be-networked device far from the gateway.
[0039] According to some optional embodiments of the present application, before the network addresses are sequentially allocated to the to-be-networked devices that send the plurality of first response information, the commissioning method comprises: determining the number of to-be-networked devices; comparing the number of to-be-networked devices with a preset value to obtain a comparison result; and performing a commissioning operation corresponding to the comparison result.
[0040] In some optional embodiments, the gateway internally saves the maximum number (i.e., the preset value) of devices that can be commissioned before commissioning with the to-be-networked devices. Therefore, when the gateway commissions for the first time, the gateway defaults to commission with the maximum number of devices. For example, the gateway can commission with a maximum of 50 devices, and the gateway defaults to start commissioning after receiving 50 response information. Therefore, before the network addresses are sequentially allocated to the to-be-networked devices that send the plurality of first response information, the number of to-be-networked devices that need to join the Bluetooth mesh network is determined, and the next commissioning operation is determined according to the actual number of to-be-networked devices.
[0041] According to an optional embodiment of the present application, the number of devices to be networked is determined by: determining whether the first response information is received within the preset time length; if the first response information is determined to be received within the preset time length, restarting the timing until the first response information cannot be received within the preset time length, and stopping the timing; determining the number of times of restarting the timing, and determining the number of the first response information received each time within the preset time length; and determining the product of the number of the first response information and the number of times as the number of devices to be networked.
[0042] In the present embodiment, after the gateway sends the acquisition command for acquiring the information of the devices to be networked to the broadcast address, the timing is started. If the receiving time length (i.e., the preset time length) set by the gateway is 2 seconds, the timing is 2 seconds each time. If the (first) response information is received within 2 seconds, the timing of the present time is stopped and restarted. It is determined again whether the (first) response information is received within the timing time length of the present time. If the (first) response information is not received until the timing of the present time ends, the total number of the (first) response information received by the multiple times of timing is determined, and the information (such as the MAC address) of the device to be networked in the response information is saved. For example, 4 times of timing are experienced, and 3 response information are received each time. The received response information is 3*4=12, which indicates that there are 12 devices to be networked in the Bluetooth mesh network.
[0043] According to another optional embodiment of the present application, the network configuration operation corresponding to the comparison result is performed, including: if the comparison result indicates that the number of devices to be networked is the same as the preset value, directly sending the network configuration command to the broadcast address; and if the comparison result indicates that the number of devices to be networked is different from the preset value, updating the preset value to the value corresponding to the number of devices to be networked, and then sending the network configuration command to the broadcast address.
[0044] In the present embodiment, if the total number of the above-mentioned received (first) response information is equal to the default number of the gateway, the network configuration command is directly sent to the broadcast address. If the total number of the above-mentioned received (first) response information is less than the default number of the gateway but greater than zero, the default number (i.e., the preset value) in the gateway is updated, and the network configuration command is sent to the broadcast address. If the total number of the above-mentioned received (first) response information is less than zero, the process is ended. However, since a start command: count=1 is set in order to trigger the timing process at the beginning of the network configuration, as long as count=1 is true, the timing action is performed. Therefore, after the total number of the above-mentioned received response information is less than zero, it is determined whether to continue to perform the timing action (i.e., count=0 is performed). If count=0, the process is ended. Otherwise, the operation of subtracting 1 (i.e., count--) is performed until the process is ended. The number of the response information received before the timing is stopped is the actual number of the devices to be networked. The number of the response information is the product of the number of times of timing and the number of the response information received each time of timing.
[0045] According to some other optional embodiments of the present application, the method for network distribution further comprises: receiving second response information of the network distribution command, determining the network device sending the second response information; and determining the network device sending the second response information as the network device having been allocated the network distribution address.
[0046] After sending the network distribution address to the mac address of each network device and sending the network distribution command to the broadcast address, it is determined whether the network device is successfully networked by judging whether the (second) response information of the network distribution command is received. If the (second) response information of the network distribution command is received, it is confirmed that the network device sending the (second) response information has received the network distribution address, that is, the network device has completed the network distribution. Otherwise, if the (second) response information of the network distribution command is not received, it is considered that the network device has not received the network distribution address, and the network device has not successfully completed the network distribution.
[0047] Figure 3 is a flow chart of another method for network distribution according to an embodiment of the present application, as shown in Figure 3 The method comprises the following steps:
[0048] In step S302, the device in the Bluetooth mesh network receives the acquisition command for acquiring device information sent by the gateway.
[0049] In step S302, the device in the Bluetooth mesh network receives the acquisition command for acquiring device information sent by the gateway.
[0050] In step S304, the network device information is sent to the gateway in response to the acquisition command, wherein the network device information comprises: the local area network address of the network device and the number of sub-devices to be networked in the network device.
[0051] In step S304, if the device is an un-networked device and needs to join the Bluetooth mesh network, after receiving the acquisition command sent by the gateway, the mac address (local area network address) of the device and the number of sub-devices (elements) to be networked are replied to the gateway.
[0052] In step S306, the network distribution information is received from the relay device in the broadcast address, the network distribution information is decrypted using the first key pair to obtain a network key and an application key, and the network key and the application key are saved as a second key pair.
[0053] In step S306, the network distribution information forwarded by the relay device is received, the network distribution key pair (i.e. the second key pair) in the network distribution information is decrypted using the stored communication key pair (i.e. the first key pair), and the decrypted network key (netkey) and application key (appkey) are saved in the form of a (second) key pair.
[0054] Simultaneously, in step S308, the network address sent by the gateway is received, and the second key pair is searched after receiving the network address.
[0055] In step S308, after the networking device receives the mesh address, it determines whether it has successfully received the network key pair (i.e., the second key pair).
[0056] Step S310: If the second key pair is found, send a confirmation message to the gateway to confirm successful network configuration. The confirmation message includes the local area network address and the network topology address.
[0057] In step S310, if the device confirms that it has successfully received the network configuration key pair (i.e., the second key pair), it replies with the gateway's own MAC address (i.e., the local area network address) and the received mesh address (network address) to notify the gateway that the network configuration has been successful.
[0058] Figure 4 This is a structural diagram of a power distribution network device according to an embodiment of this application, such as... Figure 4 As shown, the device includes: a transmitting module 40, used to send an acquisition command to a broadcast address within the coverage area of a wireless signal, wherein the acquisition command is used to acquire information about multiple devices to be networked within the coverage area of the wireless signal, including: the local area network addresses of the multiple devices to be networked, and the number of sub-devices to be networked in each device to be networked; a receiving module 42, used to receive multiple response messages of the acquisition command, sequentially assign network addresses to each device to be networked that sent the multiple response messages, and send the network addresses corresponding to each device to be networked to the local area network address of each device to be networked; and a network configuration module 44, used to send a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration for the devices to be networked that have been assigned network addresses.
[0059] Figure 5 This is a flowchart of the operation of the distribution network equipment, such as... Figure 5As shown, the device starts to work, performs the operation of initializing the default key, the gateway and the device read out the communication key pair (i.e. the first key pair) stored in the cache, and set the parameter count to 1, and then continue to execute the process, send the get command to the broadcast address (0xffff) through the sending module 40 to obtain the mac address (i.e. the mesh address) and other information of the device to be networked; and start timing after sending the get command, and preset the timing duration (for example, 2 seconds) each time; if the receiving module 42 receives the (first) response information of the get command within 2 seconds, it is confirmed that there is no timeout, and after saving the device information in the (first) response information, the preset timing duration is restarted, until the (first) response information cannot be received within the preset timing duration, it is judged whether the number of (first) response information received by the receiving module 42 is a preset number (for example, m), if yes, after saving the device information in the (first) response information, the network configuration command is sent to the broadcast address; if not, it is judged whether the (first) response information received is greater than zero, if yes, the network configuration command is sent to the broadcast address; if not, it is judged whether the parameter is greater than 0 (cout>?0), if yes, the process ends, if not, the process of parameter minus 1 (count--) is executed, and then the get command is sent to the broadcast address again, and timing is performed again, if any (first) response information is still not received within 2 seconds, the number of (first) response information is less than zero, at this time, since the count-- is executed once, cout is zero, and the process ends. When the number of (first) response information received is greater than zero, the receiving module 42 sends the network configuration command to the broadcast address, and at the same time, the mesh address (mesh address) is sent to the mac address of each device to be networked through the network configuration module 44, and the network configuration of the device to be networked is performed. As shown in Figure 5 As shown, after the network configuration module 44 sends the mesh address, it is judged whether the network configuration is completed by whether the (second) response information sent by the device is received, if not, the mesh address is continuously sent until the network configuration is completed.
[0060] It should be noted that, Figure 4 The preferred embodiments of the embodiments shown can be referred to Figure 1 The related description of the embodiments shown will not be repeated here.
[0061] The embodiments of the present application also provide a non-volatile storage medium, and the non-volatile storage medium stores a computer program, wherein the device where the non-volatile storage medium is located executes the above network configuration method by running the computer program.
[0062] The nonvolatile storage medium is configured to store a program for performing the following functions: sending an acquisition command to a broadcast address within a wireless signal coverage range, wherein the acquisition command is used to acquire information of a plurality of devices to be networked within the wireless signal coverage range, and the information includes local area network addresses of the plurality of devices to be networked and a number of sub-devices to be networked in each device to be networked; receiving a plurality of first response information of the acquisition command, assigning network addresses to each device to be networked in turn that sends the plurality of first response information, and sending the network address corresponding to each device to be networked to the local area network address of each device to be networked; and simultaneously sending a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration of the device to be networked to which the network address has been assigned.
[0063] The embodiment of the present application further provides an electronic device, including a memory and a processor, the memory has a computer program stored therein, and the processor is configured to execute the network configuration method.
[0064] The processor in the electronic device is configured to run a program for performing the following functions: sending an acquisition command to a broadcast address within a wireless signal coverage range, wherein the acquisition command is used to acquire information of a plurality of devices to be networked within the wireless signal coverage range, and the information includes local area network addresses of the plurality of devices to be networked and a number of sub-devices to be networked in each device to be networked; receiving a plurality of first response information of the acquisition command, assigning network addresses to each device to be networked in turn that sends the plurality of first response information, and sending the network address corresponding to each device to be networked to the local area network address of each device to be networked; and simultaneously sending a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration of the device to be networked to which the network address has been assigned.
[0065] It should be noted that each module in the network configuration device can be a program module (for example, a program instruction set for implementing a certain specific function) or a hardware module, and for the latter, it can be in the following form, but is not limited thereto: each module is in the form of a processor, or the functions of each module are implemented by a processor.
[0066] The above sequence numbers of the embodiments of the present application are only for description, and do not represent the advantages and disadvantages of the embodiments.
[0067] In the above embodiments of the present application, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.
[0068] In several embodiments provided in the present application, it should be understood that the disclosed technology can be implemented by other ways. Among them, the above-mentioned device embodiments are only schematic, for example, the division of the units can be a logical function division, and actual implementation can have another division mode, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed units can be indirect coupling or communication connection through some interfaces, units or modules, which can be electrical or other forms.
[0069] The units described as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, that is, they can be located in one place, or they can be distributed to multiple units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0070] In addition, the functional units in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software functional unit.
[0071] The integrated unit, if realized in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on this understanding, the technical solutions of the present application essentially or the part that contributes to the related art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, including a plurality of instructions for causing a computer device (which can be a personal computer, a server or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and various program codes that can be stored in the medium.
[0072] The above is only the preferred embodiment of the present application, and it should be pointed out that for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, which should be considered as the protection scope of the present application.
Claims
1. A method of commissioning a network, the method comprising: The method comprises: sending an acquisition command to a broadcast address within a wireless signal coverage range, wherein the acquisition command is used to acquire information of a plurality of devices to be networked within the wireless signal coverage range, and the information comprises local area network addresses of the plurality of devices to be networked and a number of sub-devices to be networked in each of the devices to be networked; receiving a plurality of first response information of the acquisition command, sequentially assigning a network address to each of the devices to be networked sending the plurality of first response information, and sending the network address corresponding to each of the devices to be networked to the local area network address of each of the devices to be networked; and sending a network configuration command to the broadcast address, wherein the network configuration command is used to trigger network configuration of the devices to be networked that have been assigned the network address, and the network configuration command comprises a plurality of identical second key pairs, wherein each second key pair comprises a network key and an application key, the application key is used for authentication and encryption in Bluetooth communication, and in the case that each of the devices to be networked successfully receives the second key pair, it is determined that the device to be networked is successfully configured. The network configuration of the devices to be networked that have been assigned the network address comprises: encrypting a plurality of the second key pairs by using a first key pair, wherein the first key pair is used for communication, and the second key pair is used for network configuration; and sending the encrypted plurality of the second key pairs to a relay device in the broadcast address, wherein each of the second key pairs corresponds to a device to be networked, and the relay device is a device that stores the first key pair or the device to be networked, and after receiving the second key pair, the device to be networked decrypts the second key pair encrypted by using the first key pair to obtain the network key and the application key, stores the network key and the application key as the second key pair, and realizes network configuration.
2. The method of claim 1, wherein, Before sequentially assigning the network address to each of the devices to be networked sending the plurality of first response information, the method comprises: determining the number of the devices to be networked; comparing the number of the devices to be networked with a preset value to obtain a comparison result; performing a network configuration operation corresponding to the comparison result.
3. The method of claim 2, wherein, Determining the number of the devices to be networked comprises: determining whether the first response information is received within a preset time period; if it is determined that the first response information is received within the preset time period, restarting timing until the first response information cannot be received within the preset time period, and stopping timing; determining the number of times of restarting timing and the number of the first response information received within the preset time period each time; determining the product of the number of the first response information and the number of times as the number of the devices to be networked.
4. The method of claim 2, wherein, Performing the network configuration operation corresponding to the comparison result comprises: if the comparison result indicates that the number of the devices to be networked is the same as the preset value, directly sending the network configuration command to the broadcast address; if the comparison result indicates that the number of the devices to be networked is different from the preset value, updating the preset value to a value corresponding to the number of the devices to be networked, and then sending the network configuration command to the broadcast address.
5. The method of claim 1, wherein, The method further comprises: receiving second response information of the commissioning command, determining a device to be commissioned sending the second response information; determining the device to be commissioned sending the second response information as the device to be commissioned having been allocated a commissioning address.
Citation Information
Patent Citations
Bluetooth multi-hop network access method, device and equipment
CN116017629A
Operation method of Bluetooth Mesh network and Bluetooth device
CN116095653A