Network distribution method and system of equipment
The information of the device to be distributed is obtained through the terminal device. The gateway uses the distribution network key to encrypt the broadcast data packet. After the distribution network device is decrypted, it joins the network, solving the problem of the complex distribution process of the existing Zigbee equipment and achieving an efficient and secure equipment distribution network.
Patent Information
- Application Number
- CN202411530016.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-30
- Publication Date
- 2025-03-07
AI Technical Summary
The existing Zigbee equipment distribution process is complex and requires multiple device interactions. It is difficult to achieve a simple distribution network without operating button devices. The distribution time is long and the probability of failure is high, so it is impossible to distribute multiple devices at one time.
The MAC address and distribution key of the device to be distributed is obtained through the terminal device. The gateway uses the distribution key to encrypt the broadcast data packet. After the distribution device is decrypted, the network device to be distributed is added to the network, and a notification has been sent to the gateway that it has been joined.
It simplifies the distribution network process, improves the security and efficiency of distribution network, is suitable for equipment without operating buttons, and supports multiple devices at one time.
Smart Images

Figure CN119584246A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of Internet of Things, and in particular to a network distribution method and system for a device. Background Art
[0002] At present, according to the specification document of CSA (Connectivity Standards Alliance), the general process of Zigbee device network configuration is as follows:
[0003] 1. The coordinator (gateway device) opens the network distribution channel;
[0004] 2. The sub-device enters the network configuration state and sends Beacon requests on channels 11 to 26, staying on each channel for a short time waiting for Beacon responses;
[0005] 3. After receiving the Beacon request, the coordinator / other routing device (on a certain channel) sends a Beacon (including an indicator of whether the network configuration is turned on);
[0006] 4. After receiving the Beacon, the sub-device checks whether it carries the identification of opening the network configuration. If it does, it sends an Association request;
[0007] 5. After receiving the association request, the coordinator / router returns the Association response;
[0008] 6. The gateway transmits the network key of the Zigbee network to the sub-device. The transmission of the network key here is divided into two ways:
[0009] Method 1: The network key is encrypted using the public connection key, and the sub-device uses the same public connection key for decryption;
[0010] Method 2: The gateway obtains the unique installcode of the sub-device by scanning the code and generates a connection key to encrypt the network key. The sub-device uses the installcode to generate the same connection key for decryption.
[0011] It can be seen that in the above process, the networked sub-device to be configured needs to enter the network configuration state, find a suitable coordinator and obtain the network key of the coordinator, so as to join the local Zigbee network created by the coordinator, that is, the networked sub-device to be configured needs to find a gateway.
[0012] This is a common method for Zigbee device network configuration in the prior art. However, this network configuration process has several disadvantages, which will cause inconvenience in actual use:
[0013] 1. The process steps are complicated, and the sub-device and the gateway need to interact multiple times. Any error in any step will lead to failure;
[0014] 2. Both the coordinator and the device to be networked need to enter the network configuration state, especially if the networked device wants to be re-networked, local operation is required to enter the network configuration state. For some buttonless devices (such as lamps), it is difficult to design a simple operation method to make them enter the network configuration state, which increases the difficulty of product design and user use;
[0015] 3. The device to be configured does not know the channel of the coordinator (gateway) and can only try each channel one by one, which increases the configuration time and failure probability;
[0016] 4. If a public key is used in step 6, in addition to the inability to ensure security (the key is well known), any coordinator that has enabled network configuration will respond to the Beacon request of the device to be configured, resulting in the inability of the sub-device to be assigned to a specific coordinator, which is very inconvenient in practical applications;
[0017] 5. In step 6, if the installcode information of the sub-device is obtained by scanning the code, the device to be networked can only be added to the coordinator with this installcode. However, if multiple coordinators start network configuration at the same time, the sub-device needs to try steps 2 to 6 one by one until it encounters a coordinator with the correct installcode to successfully configure the network, which increases the number of network configuration attempts and time. Moreover, this method cannot configure multiple sub-devices at one time. Summary of the invention
[0018] In view of the many shortcomings of the above-mentioned prior art, the present application provides a new device network configuration method, which is simple to operate, highly secure, has fewer steps, and is fast in network configuration, and can also configure multiple sub-devices at one time.
[0019] According to a first aspect of the present application, a network configuration method for a device is provided, which is applied to a gateway and is characterized by comprising:
[0020] Receiving information related to the device to be networked from a terminal device, wherein the information related to the device to be networked includes a MAC address and a network configuration key of the device to be networked;
[0021] Encrypting the content to be broadcast by using the network configuration key to form a broadcast data packet, wherein the content to be broadcast includes the MAC address and network information of the device to be configured; and
[0022] The broadcast data packet is broadcasted.
[0023] According to a second aspect of the present application, a network configuration method for a device is provided, which is applied to a device to be configured, and is characterized by comprising:
[0024] Receive broadcast packets from the gateway;
[0025] Decrypting the broadcast data packet using the network configuration key of the device to be configured, and obtaining the MAC address and network information in the broadcast data packet; and
[0026] In the case where the MAC address is the same as the MAC address of the device to be networked, the network is joined according to the network information, and a notification of joining the network is sent to the gateway.
[0027] According to a third aspect of the present application, a network distribution system for a device is provided, characterized in that it includes:
[0028] A terminal device, used to obtain and send information related to the device to be configured, wherein the information related to the device to be configured includes a MAC address and a configuration key of the device to be configured;
[0029] A gateway, configured to receive information related to the device to be networked from the terminal device, encrypt the content to be broadcasted by using the networked key to form a broadcast data packet, and broadcast the broadcast data packet, wherein the content to be broadcasted includes the MAC address and network information of the device to be networked; and
[0030] The device to be configured is used to receive the broadcast data packet from the gateway, decrypt the broadcast data packet through the network configuration key of the device to be configured, obtain the MAC address and network information in the broadcast data packet, and join the network according to the network information when the MAC address is the same as the MAC address of the device to be configured, and send a notification of joining the network to the gateway.
[0031] According to a fourth aspect of the present application, there is provided an electronic device, including:
[0032] Processor; and
[0033] A memory stores computer instructions, and when the computer instructions are executed by the processor, the processor executes the methods described in the first aspect and the second aspect.
[0034] According to a fifth aspect of the present application, a non-transitory computer storage medium is provided, storing a computer program, which, when executed by multiple processors, enables the processors to execute the methods described in the first and second aspects.
[0035] According to the network configuration method and system of the device provided by the present application, after obtaining the information related to the network configuration device through the terminal device, the network configuration process of the gateway finding the network configuration device to be configured can be realized without operating the network configuration device to enter the network configuration state. The network configuration process is simple and more convenient for devices without operation buttons. In addition, the content broadcast by the gateway device is encrypted by the network configuration key of the network configuration device to be configured, which can ensure security and realize the network configuration of multiple devices at one time. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without exceeding the scope of protection required by the present application.
[0037] Figure 1 It is a flow chart of a network distribution system of a device according to an embodiment of the present application.
[0038] Figure 2 It is a schematic diagram of a broadcast data packet according to an embodiment of the present application.
[0039] Figure 3 It is a schematic diagram of a response data packet according to an embodiment of the present application.
[0040] Figure 4 is a schematic diagram of a broadcast data packet according to another embodiment of the present application.
[0041] Figure 5 It is a flow chart of a network configuration method for a device implemented by a gateway according to an embodiment of the present application.
[0042] Figure 6 It is a flow chart of a network configuration method for a device implemented by a device to be configured according to an embodiment of the present application.
[0043] Figure 7 It is a structural diagram of an electronic device provided by this application. DETAILED DESCRIPTION
[0044] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0045] Figure 1 1 is a flow chart of a network distribution system for a device according to an embodiment of the present application. Figure 1As shown, the system includes a terminal device, a gateway and a device to be configured, wherein the terminal device may include a mobile phone, a tablet computer or other portable device, the gateway may include a coordinator or a routing device, and the device to be configured may include various devices to be added to the network, including Internet of Things devices, such as a Zigbee device or a Zigbee sub-device to be added to the Zigbee network.
[0046] exist Figure 1 In the embodiment shown, the terminal device first obtains information related to the device to be configured, including the MAC address and configuration key of the device to be configured. The specific acquisition method can be that the user inputs the information into the terminal device, or the device to be configured sets a QR code, which includes the MAC address and configuration key of the device to be configured. The terminal device obtains information by scanning the device to be configured through the APP. After obtaining the information of the device to be configured, the terminal device sends the information to the gateway.
[0047] After obtaining the information of the device to be configured, the gateway uses the configuration key to encrypt the content to be broadcast, obtains the broadcast data packet, and broadcasts the broadcast data packet. Among them, the content to be broadcast includes the information of the device to be configured and the network information, wherein the information of the configuration device includes the MAC address of the device to be configured, etc., and the network information includes the network key of the gateway and the gateway channel and other information. According to a specific embodiment, the network joined by the device is a Zigbee network, and the gateway broadcasts through the full channel cross-PAN (Personal Area Network, personal area network) broadcast method, the broadcast data packet includes a PAN broadcast data packet, and the network information is Zigbee network information, including the Zigbee network key of the gateway, PAN ID and gateway channel. The PAN broadcast method complies with the IEEE 802.15.4 specification (Zigbee protocol is based on 802.15.4), and any device in the receiving state (RX), regardless of whether the configuration network is turned on, can receive the broadcast information from the gateway. The broadcast information is encrypted by the configuration key of the sub-device, and only the device with this configuration key can decrypt it, thereby ensuring the security of the information.
[0048] Figure 2 FIG. 1 is a schematic diagram of a broadcast data packet according to an embodiment of the present application. Figure 2 As shown, the content to be broadcasted of the broadcast data packet includes CMD ID (command ID), network key, gateway channel, PAN ID, MAC1 of the network device to be configured and gateway MAC, and the content to be broadcasted is AES encrypted by the network configuration key KEY1 of the network device to be configured.
[0049] After the device to be configured broadcasts the data packet to the gateway, it is decrypted by its own network configuration key to obtain the MAC address of the device to be configured. The device to be configured confirms whether the decrypted MAC address matches its own MAC address. If they match, it means that the network configuration key and MAC address are consistent. The device extracts the network information to join the network and sends a notification to the gateway that it has joined the network. Figure 3 FIG. 1 is a schematic diagram of a response data packet according to an embodiment of the present application. Figure 3 As shown, the data packet includes CMD ID, MAC of the device to be configured and gateway MAC. In order to improve security, the configuration key KEY1 of the device to be configured can be used to perform AES encryption on the broadcast content.
[0050] When the gateway receives a notification from the device to be networked that it has joined the network, it sends an indication of successful network configuration to the terminal device. The terminal device displays the information of the device to be networked in the network list.
[0051] According to some embodiments, the present application can also realize the simultaneous network configuration of multiple devices. Specifically, multiple devices correspond to multiple MAC addresses and network configuration keys, and the MAC addresses and network information of the corresponding devices to be configured are encrypted respectively by the network configuration keys corresponding to the multiple devices to be configured, forming multiple broadcast data segments, that is, the corresponding device MAC address and network configuration key in each broadcast data segment are different, and each broadcast data segment is encrypted by the corresponding device network configuration key, and the gateway broadcast data packet is spliced by multiple broadcast data segments. Figure 4 FIG. 1 is a schematic diagram of a broadcast data packet according to another embodiment of the present application. Figure 4 As shown, the broadcast data packet includes multiple broadcast data segments, each of which includes CMD ID, network key, gateway channel, PAN ID, MAC of the device to be configured (such as MAC1 and MAC2) and gateway MAC, and the broadcast content is AES encrypted using the configuration key KEY (such as KEY1 and KEY2) of the device to be configured.
[0052] It can be understood by those skilled in the art that Figure 2 and Figure 4 The broadcast data packet shown is only an example, and the content in the broadcast data packet can be increased, reduced or changed according to actual needs.
[0053] After receiving the gateway broadcast data packet, the network device to be configured attempts to decrypt and verify the MAC address starting from the first broadcast data segment. If one segment is decrypted successfully and the MAC address is verified successfully, the network information is extracted to join the network, and a notification of joining the network is sent to the gateway.
[0054] In this way, the present application can configure multiple devices at one time, greatly improving the efficiency of network configuration.
[0055] In addition, in order to further increase security (such as preventing replay attacks), according to some embodiments, the interaction between the network device to be configured and the gateway can be increased, for example, the encrypted content to be broadcast in the gateway broadcast data packet contains information such as a serial number or a timestamp. When the network device to be configured receives the same broadcast data packet or the same serial number or timestamp, the broadcast data packets after the first broadcast data packet are not processed repeatedly.
[0056] Based on the above network distribution system, according to one aspect of the present application, a network distribution method for a device is provided. Figure 5 1 is a flow chart of a network configuration method for a device implemented by a gateway according to an embodiment of the present application. Figure 5 As shown, the method comprises the following steps:
[0057] Step S501, receiving information related to the device to be networked from a terminal device, wherein the information related to the device to be networked includes a MAC address and a network configuration key of the device to be networked;
[0058] Step S502, encrypting the content to be broadcast by using the network configuration key to form a broadcast data packet, wherein the content to be broadcast includes the MAC address and network information of the device to be configured; and
[0059] Step S503: broadcast the broadcast data packet.
[0060] According to an optional embodiment, when there are multiple devices to be networked, the information related to the devices to be networked includes MAC addresses and network configuration keys corresponding to the multiple devices to be networked, and step S502 includes:
[0061] Encrypting the MAC address and network information of the corresponding network devices to be configured by using the network configuration keys corresponding to the multiple network devices to be configured, to form multiple broadcast data segments; and
[0062] The multiple broadcast data segments are combined to form a broadcast data packet.
[0063] Based on the above network distribution system, according to another aspect of the present application, a network distribution method for a device is provided. Figure 6 1 is a flow chart of a network configuration method for a device implemented by a device to be configured according to an embodiment of the present application. Figure 6 As shown, the method comprises the following steps:
[0064] Step S601, receiving a broadcast data packet from a gateway;
[0065] Step S602, decrypting the broadcast data packet using the network configuration key of the device to be network configured, and obtaining the MAC address and network information in the broadcast data packet; and
[0066] Step S603, when the MAC address is the same as the MAC address of the device to be networked, join the network according to the network information, and send a notification of joining the network to the gateway.
[0067] According to an optional embodiment, the broadcast data packet includes multiple broadcast data segments corresponding to multiple network devices to be configured, and the multiple broadcast data segments are encrypted by the configuration keys corresponding to the multiple network devices to be configured; wherein step S602 includes:
[0068] Decrypting the multiple broadcast data segments in sequence using the network configuration key of the to-be-configured network device; and
[0069] If the decryption is successful, the MAC address and network information in the broadcast data packet are obtained from the corresponding broadcast data segment.
[0070] According to the network configuration method and system of the device provided by the present application, after obtaining the information related to the network configuration device through the terminal device, the network configuration process of the gateway finding the network configuration device to be configured can be realized without operating the network configuration device to enter the network configuration state. The network configuration process is simple and more convenient for devices without operation buttons. In addition, the content broadcast by the gateway device is encrypted by the network configuration key of the network configuration device to be configured, which can ensure security and realize the network configuration of multiple devices at one time.
[0071] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0072] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0073] In the several embodiments provided in the present application, it should be understood that the disclosed device can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of the units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, and the indirect coupling or communication connection of the device or unit can be electrical connection or other forms.
[0074] See also Figure 7 , Figure 7 An electronic device is provided, comprising a processor and a memory. The memory stores computer instructions, and when the computer instructions are executed by the processor, the processor executes the computer instructions to achieve the following Figure 5 and Figure 6 The method and refinement scheme shown.
[0075] It should be understood that the above device embodiments are only illustrative, and the device disclosed in the present invention can also be implemented in other ways. For example, the division of units / modules described in the above embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0076] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present invention may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0077] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not otherwise specified, the processor or chip may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not otherwise specified, the on-chip cache, the off-chip memory, and the memory may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0078] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer electronic device (which can be a personal computer, a server or a network electronic device, etc.) to perform all or part of the steps of the method described in each embodiment of the present disclosure. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk, etc. Various media that can store program codes.
[0079] The present application also provides a non-transitory computer storage medium storing a computer program. When the computer program is executed by a plurality of processors, the processors execute the following Figure 5 and Figure 6 The method and refinement scheme shown.
[0080] The embodiments of the present application are described in detail above. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application. At the same time, changes or deformations made by those skilled in the art based on the ideas of the present application, the specific implementation methods and the scope of application of the present application, all belong to the scope of protection of the present application. In summary, the content of this specification should not be construed as a limitation on the present application.
Claims
1. A network configuration method for a device, applied to a gateway, characterized in that: include: Receiving information related to the device to be networked from a terminal device, wherein the information related to the device to be networked includes a MAC address and a network configuration key of the device to be networked; Encrypting the content to be broadcast by using the network configuration key to form a broadcast data packet, wherein the content to be broadcast includes the MAC address and network information of the device to be configured; and The broadcast data packet is broadcasted.
2. The method according to claim 1, characterized in that Also includes: When receiving a notification from the device to be networked that the device has joined the network, an indication of successful network configuration is sent to the terminal device.
3. The method according to claim 1, characterized in that In the case where there are multiple devices to be networked, the information related to the devices to be networked includes MAC addresses and network configuration keys corresponding to the multiple devices to be networked, and encrypting the broadcast content by using the network configuration key to form a broadcast data packet includes: Encrypting the MAC address and network information of the corresponding network devices to be configured by using the network configuration keys corresponding to the multiple network devices to be configured, to form multiple broadcast data segments; and The multiple broadcast data segments are combined to form a broadcast data packet.
4. The method according to any one of claims 1 to 3, characterized in that The broadcast data packet includes a PAN broadcast data packet, and the network information includes a gateway channel and a network key.
5. A network configuration method for equipment, applied to equipment to be configured, characterized in that: include: Receive broadcast packets from the gateway; Decrypt the broadcast data packet using the network configuration key of the device to be configured, and obtain the MAC address and network information in the broadcast data packet; as well as In the case where the MAC address is the same as the MAC address of the device to be networked, the network is joined according to the network information, and a notification of joining the network is sent to the gateway.
6. The method according to claim 5, characterized in that The broadcast data packet includes a plurality of broadcast data segments corresponding to the plurality of network devices to be configured, respectively, and the plurality of broadcast data segments are encrypted by using the network configuration keys corresponding to the plurality of network devices to be configured; The method of decrypting the broadcast data packet by using the network configuration key of the device to be configured to obtain the MAC address and network information in the broadcast data packet includes: Decrypting the multiple broadcast data segments in sequence using the network configuration key of the to-be-configured network device; and If the decryption is successful, the MAC address and network information in the broadcast data packet are obtained from the corresponding broadcast data segment.
7. A network distribution system for equipment, characterized in that: include: A terminal device, used to obtain and send information related to the device to be configured, wherein the information related to the device to be configured includes a MAC address and a configuration key of the device to be configured; A gateway, configured to receive information related to the device to be networked from the terminal device, encrypt the content to be broadcasted by using the networked key to form a broadcast data packet, and broadcast the broadcast data packet, wherein the content to be broadcasted includes the MAC address and network information of the device to be networked; and The device to be configured is used to receive the broadcast data packet from the gateway, decrypt the broadcast data packet through the network configuration key of the device to be configured, obtain the MAC address and network information in the broadcast data packet, and join the network according to the network information when the MAC address is the same as the MAC address of the device to be configured, and send a notification of joining the network to the gateway.
8. The system according to claim 7, characterized in that In the case where there are multiple devices to be networked, the information related to the devices to be networked includes MAC addresses and network configuration keys corresponding to the multiple devices to be networked; The gateway is used to encrypt the MAC address and network information of the corresponding network device to be configured by using the network configuration keys corresponding to the multiple network devices to be configured, to form multiple broadcast data segments, and to combine the multiple broadcast data segments to form a broadcast data packet; The network device to be configured is used to decrypt the multiple broadcast data segments in sequence using the network configuration key of the network device to be configured, and if the decryption is successful, obtain the MAC address and network information in the broadcast data packet from the corresponding broadcast data segment.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the method according to any one of claims 1 to 6 when executing the computer program in the memory.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Cited By
Equipment networking method and device based on mesh network and electronic equipment
CN122534554A