Network distribution method, system, device, equipment and storage medium
The first network device connected to the first wireless network receives, extracts and broadcasts distribution network information packets, and solves the problem of automatic distribution network distribution equipment in the multi-hop broadcast range, and improves the distribution network efficiency.
Patent Information
- Application Number
- CN202510147460.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-10
- Publication Date
- 2025-04-29
AI Technical Summary
The prior art is difficult to automatically distribute networks to undistributed network devices within the multi-hop broadcast range, resulting in inefficient distribution networks.
After receiving the distribution network information packets through the first network device connected to the first wireless network, the distribution network information is extracted and broadcasted to enable the second network device not connected to the first wireless network to be accessed. The method includes decrypting and extracting distribution network information when receiving distribution network information packets, and splitting and splicing distribution network information when necessary to adapt to the limitations of the Bluetooth broadcast format.
It realizes automatic distribution of network equipment to be distributed within the multi-hop broadcast range, improves distribution efficiency, and reduces the need for manual intervention and equipment movement.
Smart Images

Figure CN119907076A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a network distribution method, system, device, equipment and storage medium. Background Art
[0002] With the development of Internet of Things technology, more and more smart devices are applied to daily life, such as smart door locks, smart air conditioners, and so on.
[0003] For smart devices, they need to be configured with a network when they are used for the first time. The configuration method is crucial to the successful operation of smart devices. Summary of the invention
[0004] The purpose of the embodiments of the present application is to provide a network configuration method, system, device, equipment and storage medium to achieve automatic network configuration of unconfigured devices within the multi-hop broadcast range and improve network configuration efficiency. The specific technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a network configuration method, which is applied to a first network device that is currently connected to a first wireless network, and the method includes:
[0006] In response to receiving a network configuration information message broadcasted by other network devices that have connected to any wireless network, extracting the network configuration information carried in the received network configuration information message;
[0007] When the extracted network configuration information is the network configuration information of the first wireless network, the received network configuration information message is broadcasted so that a second network device that is not currently connected to the first wireless network can access the first wireless network using the network configuration information carried in the received network configuration information message.
[0008] Optionally, the method further comprises:
[0009] In the case where the extracted network configuration information is the network configuration information of the second wireless network, the second wireless network is accessed using the extracted network configuration information, and the received network configuration information message is broadcast and sent, so that network devices that are not currently connected to the second wireless network can access the second wireless network using the network configuration information carried in the received network configuration information message.
[0010] Optionally, the received network configuration information message is an encrypted message;
[0011] The extracting the network configuration information carried in the received network configuration information message includes:
[0012] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0013] Optionally, the method further comprises:
[0014] In the case where the first network device is not a network distributor node, in response to receiving a network distribution request message, broadcasting the received network distribution request message; wherein the network distribution request message is used to request network distribution information for accessing a wireless network;
[0015] In the case where the first network device is a network configuration device node, in response to receiving a network configuration request message, a network configuration device that currently needs to be configured is determined, and a network configuration information message carrying the network configuration information of the first wireless network is broadcast and sent.
[0016] Optionally, the network configuration request message received by the first network device is obtained by broadcast scanning according to a preset scanning period;
[0017] In the case where the first network device is not a network distributor node, in response to receiving a network distribution request message, broadcasting the received network distribution request message includes:
[0018] In the case that the first network device is not a network configuration node, if the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the device to be configured that generates the network configuration request message.
[0019] Optionally, in response to receiving the network configuration request message, determining the network configuration device that currently needs to be configured, and broadcasting a network configuration information message carrying the network configuration information of the first wireless network includes:
[0020] In response to receiving a network configuration request message, displaying a device identifier carried in the received network configuration request message in a preset interactive interface; wherein a device identifier carried in a network configuration request message represents a to-be-configured network device that generates the network configuration request message;
[0021] In response to a user's selection operation on a device identifier displayed in the preset interactive interface, determining a device represented by the device identifier indicated by the selection operation as a to-be-configured device that currently needs to be configured;
[0022] The network configuration information message carrying the network configuration information of the first wireless network is broadcasted at preset time intervals until it is determined that all the devices to be configured that currently need to be configured have received the complete network configuration information of the first wireless network.
[0023] Optionally, the determining that all devices to be networked that currently need to be networked have received complete network configuration information of the first wireless network includes:
[0024] When a notification message generated by all the devices to be networked that currently need to be networked is received, it is determined that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network; wherein the notification message is: the device to be networked that currently needs to be networked is broadcast and generated when the device to be networked obtains the complete network configuration information of the first wireless network.
[0025] Optionally, the method further comprises:
[0026] In the case that the first network device is not a network distributor node, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast and sent; wherein, the device identifier carried in a notification message represents the device to be configured that generates the notification message.
[0027] Optionally, any network configuration information message is a broadcast message based on a Bluetooth broadcast format;
[0028] The broadcasting and sending of a network configuration information message carrying the network configuration information of the first wireless network includes:
[0029] When the complete network configuration information of the first wireless network exceeds the maximum number of bytes supported by a single broadcast message in the Bluetooth broadcast format, split the complete network configuration information of the first wireless network according to the maximum number of bytes supported to obtain multiple copies of network configuration information for the first wireless network;
[0030] Broadcast and send multiple network configuration information messages for the first wireless network; wherein each network configuration information message carries a piece of split network configuration information.
[0031] Optionally, each network configuration information message also carries a serial number and a total number; the total number represents: the number of each piece of configuration information obtained by splitting the complete network configuration information of the first wireless network, and the serial number carried in each network configuration information message represents the position sequence of a piece of configuration information carried in the network configuration information message in the complete network configuration information, so that the second network device can obtain the complete network configuration information of the first wireless network according to the serial number and total number carried in the received network configuration information message.
[0032] Optionally, the broadcasting sending a plurality of network configuration information messages for the first wireless network includes:
[0033] According to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently;
[0034] Periodically broadcast and send the current configuration network information message that needs to be sent;
[0035] After starting to periodically broadcast and send the current configuration network information message that needs to be sent, when a predetermined switching interval is reached, determine, in accordance with the sequence, a configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent; wherein the duration of the switching interval is the duration that can send at least one broadcast message;
[0036] Until the last sequence number is carried in the currently sent network configuration information message, and after the periodic broadcasting of the currently required network configuration information message begins, when the switching interval is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the currently required network configuration information message to be sent in the order of the carried sequence numbers.
[0037] Optionally, the broadcasting sending a plurality of network configuration information messages for the first wireless network includes:
[0038] According to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently;
[0039] Periodically broadcast and send the current configuration network information message that needs to be sent;
[0040] After starting to periodically broadcast and send the network configuration information message that currently needs to be sent, when the number of times the network configuration information message that currently needs to be sent has reached a predetermined number, determine, in accordance with the sequence, a network configuration information message carrying the next sequence number as the network configuration information message that currently needs to be sent, and return to execute the step of periodically broadcasting and sending the network configuration information message that currently needs to be sent;
[0041] Until the last sequence number is carried in the currently sent network configuration information message, and after starting to periodically broadcast and send the currently required network configuration information message, when the predetermined number of times is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the currently required network configuration information message to be sent in the order of the carried sequence numbers.
[0042] Optionally, the broadcasting of the received network configuration information message includes:
[0043] If the current time is not in the forwarding window, a forwarding window of a preset duration is opened, and the received network configuration information message is periodically broadcast and sent in the opened forwarding window.
[0044] In a second aspect, an embodiment of the present application provides a network configuration method, which is applied to a second network device that is not currently connected to a first wireless network, and the method includes:
[0045] In response to receiving a network configuration information message broadcasted by a first network device that is currently connected to the first wireless network, extracting the network configuration information carried in the received network configuration information message; wherein the network configuration information message broadcasted by the first network device is: a network configuration information message received and sent by other network devices that are currently connected to the first wireless network and carries the network configuration information of the first wireless network;
[0046] The first wireless network is accessed using the extracted network configuration information.
[0047] Optionally, in response to receiving a network configuration information message broadcasted by a first network device that is currently connected to the first wireless network, before extracting the network configuration information carried in the received network configuration information message, the method further includes:
[0048] Broadcasting and sending a network configuration request message carrying its own device identification; wherein the network configuration request message is used to request network configuration information for accessing a wireless network;
[0049] The method further comprises:
[0050] In response to receiving the network configuration request message, the received network configuration request message is broadcasted, so that the network configuration device node determines the network configuration device that currently needs to be configured according to the received network configuration request message.
[0051] Optionally, the network configuration request message received by the second network device is obtained by broadcast scanning according to a preset scanning period;
[0052] In response to receiving the network configuration request message, broadcasting and sending the received network configuration request message includes:
[0053] If the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the network device to be configured that generates the network configuration request message.
[0054] Optionally, the received network configuration information message is an encrypted message;
[0055] The extracting the network configuration information carried in the received network configuration information message includes:
[0056] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0057] Optionally, the received network configuration information message is a broadcast message based on the Bluetooth broadcast format, and each network configuration information message also carries a serial number and a total number; the total number represents: when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format, the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network according to the maximum supportable number of bytes; the serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information;
[0058] Before accessing the first wireless network using the extracted network configuration information, the method further includes:
[0059] Extract the sequence number and total number carried in the received configuration network information message;
[0060] The accessing the first wireless network by using the extracted network configuration information includes:
[0061] According to the extracted sequence number and the total number, determining whether the total number of network configuration information messages carrying different sequence numbers are currently acquired;
[0062] If the total number of network configuration information messages carrying different sequence numbers has been obtained, the network configuration information carried in the network configuration information messages with different sequence numbers are spliced according to the sequence order of the sequence numbers carried in the obtained network configuration information messages to obtain the complete network configuration information of the first wireless network;
[0063] The first wireless network is accessed using the spliced complete network configuration information.
[0064] Optionally, the method further comprises:
[0065] In the case that the total number of network configuration information messages carrying different sequence numbers have been obtained, broadcasting and sending a notification message carrying its own device identification, indicating that the complete network configuration information of the first wireless network has been obtained;
[0066] In response to receiving the notification message, the received notification message is broadcasted, so that the network provisioner node determines whether all the devices to be provisioned that currently need to be provisioned have received the complete provisioning information of the first wireless network based on the received notification message.
[0067] Optionally, the received notification message is obtained by broadcast scanning according to a preset scanning period;
[0068] In response to receiving the notification message, broadcasting the received notification message includes:
[0069] In response to receiving a notification message, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast; wherein, the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0070] Optionally, the method further comprises:
[0071] After accessing the first wireless network using the extracted network configuration information, opening a forwarding window of a preset duration, and periodically broadcasting and sending received network configuration information messages within the opened forwarding window;
[0072] In response to receiving a network configuration information message broadcasted by any network device that has accessed the first wireless network, if the device is not currently in a forwarding window, a forwarding window of a preset duration is opened, and the received network configuration information message is periodically broadcasted in the opened forwarding window.
[0073] In a third aspect, an embodiment of the present application provides a network distribution system, the system comprising a first network device currently connected to a first wireless network and a second network device currently not connected to the first wireless network;
[0074] The first network device is used to execute the network configuration method provided in the first aspect above;
[0075] The second network device is used to execute the network configuration method provided by the second aspect above.
[0076] In a fourth aspect, an embodiment of the present application provides a network configuration device, which is applied to a first network device that is currently connected to a first wireless network, and the device includes:
[0077] A first extraction module, configured to extract the network configuration information carried in the received network configuration information message in response to receiving the network configuration information message broadcasted by other network devices that have connected to any wireless network;
[0078] The first broadcast module is used to broadcast the received network configuration information message when the extracted network configuration information is the network configuration information of the first wireless network, so that a second network device that is not currently connected to the first wireless network can access the first wireless network by using the network configuration information carried in the received network configuration information message.
[0079] Optionally, the device further comprises:
[0080] The first access module is used to access the second wireless network using the extracted network configuration information when the extracted network configuration information is the network configuration information of the second wireless network, and broadcast the received network configuration information message so that the network device that is not currently connected to the second wireless network can access the second wireless network using the network configuration information carried in the received network configuration information message.
[0081] Optionally, the received network configuration information message is an encrypted message;
[0082] The first extraction module is specifically used for:
[0083] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0084] Optionally, the device further comprises:
[0085] A first request forwarding module, configured to, in response to receiving a network configuration request message, broadcast and send the received network configuration request message when the first network device is not a network configuration device node; wherein the network configuration request message is used to request network configuration information for accessing a wireless network;
[0086] The device determination module is used to, when the first network device is a network configuration device node, determine the network configuration device that currently needs to be configured in response to receiving a network configuration request message, and broadcast a network configuration information message carrying the network configuration information of the first wireless network.
[0087] Optionally, the network configuration request message received by the first network device is obtained by broadcast scanning according to a preset scanning period;
[0088] The request forwarding module is specifically used for:
[0089] In the case that the first network device is not a network configuration node, if the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the device to be configured that generates the network configuration request message.
[0090] Optionally, the device determination module includes:
[0091] A display submodule, for displaying the device identifier carried in the received network configuration request message in a preset interactive interface in response to receiving the network configuration request message; wherein the device identifier carried in a network configuration request message represents the network configuration device to be generated for generating the network configuration request message;
[0092] A first determination submodule is used to, in response to a user's selection operation on a device identifier displayed in the preset interactive interface, determine a device represented by the device identifier indicated by the selection operation as a to-be-configured device that currently needs to be configured;
[0093] The sending submodule is used to broadcast the network configuration information message carrying the network configuration information of the first wireless network at a preset time interval until it is determined that all the devices to be configured that currently need to be configured have received the complete network configuration information of the first wireless network.
[0094] Optionally, the sending submodule is specifically used to:
[0095] When a notification message generated by all the devices to be networked that currently need to be networked is received, it is determined that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network; wherein the notification message is: the device to be networked that currently needs to be networked is broadcast and generated when the device to be networked obtains the complete network configuration information of the first wireless network.
[0096] Optionally, the device further comprises:
[0097] The first notification forwarding module is used to broadcast the received notification message if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, when the first network device is not a network distributor node; wherein the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0098] Optionally, any network configuration information message is a broadcast message based on a Bluetooth broadcast format;
[0099] The device determination module includes:
[0100] a splitting submodule, configured to split the complete network configuration information of the first wireless network according to the maximum supportable number of bytes to obtain multiple copies of network configuration information for the first wireless network when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format;
[0101] The broadcast submodule is used to broadcast and send multiple network configuration information messages for the first wireless network; wherein each network configuration information message carries a piece of split network configuration information.
[0102] Optionally, each network configuration information message also carries a serial number and a total number; the total number represents: the number of each piece of configuration information obtained by splitting the complete network configuration information of the first wireless network, and the serial number carried in each network configuration information message represents the position sequence of a piece of configuration information carried in the network configuration information message in the complete network configuration information, so that the second network device can obtain the complete network configuration information of the first wireless network according to the serial number and total number carried in the received network configuration information message.
[0103] Optionally, the broadcast submodule includes:
[0104] A first determining unit, configured to determine, according to the order of the carried sequence numbers, a configuration network information message carrying a first sequence number as the configuration network information message that currently needs to be sent;
[0105] A first sending unit, used for periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0106] A first switching unit is used to, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when a predetermined switching interval is reached, determine, in accordance with the sequence, the configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent; wherein the duration of the switching interval is the duration that can send at least one broadcast message;
[0107] The first return unit is used to carry the last sequence number in the currently sent network configuration information message, and after starting to periodically broadcast and send the network configuration information message that needs to be sent, when the switching interval is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently according to the order of the carried sequence numbers.
[0108] Optionally, the broadcast submodule includes:
[0109] A second determining unit is used to determine, according to the order of the carried sequence numbers, the configuration network information message carrying the first sequence number as the configuration network information message that needs to be sent currently;
[0110] A second sending unit, used for periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0111] A second switching unit is used to determine, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when the number of times the current configuration network information message that needs to be sent has reached a predetermined number of times, in accordance with the sequence, a configuration network information message carrying a next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0112] The second returning unit is used to carry the last sequence number in the currently sent network configuration information message, and after starting to periodically broadcast and send the network configuration information message that needs to be sent currently, when the predetermined number of times is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently in the order of the carried sequence numbers.
[0113] Optionally, the device further comprises:
[0114] The first forwarding module is used to open a forwarding window of a preset duration if the forwarding window is not currently in the forwarding window, and to periodically broadcast and send the received network configuration information message in the opened forwarding window.
[0115] In a fifth aspect, an embodiment of the present application provides a network configuration device, which is applied to a second network device that is not currently connected to a first wireless network, and the device includes:
[0116] A second extraction module is used to extract the network configuration information carried in the received network configuration information message in response to receiving a network configuration information message broadcasted and sent by the first network device that is currently connected to the first wireless network; wherein the network configuration information message broadcasted and sent by the first network device is: a network configuration information message received and sent by other network devices that have been connected to the first wireless network and carries the network configuration information of the first wireless network;
[0117] The second access module is used to access the first wireless network by using the extracted network configuration information.
[0118] Optionally, the device further comprises:
[0119] A request sending module, configured to broadcast a network configuration request message carrying its own device identifier before the second extraction unit executes the network configuration information message received in response to receiving the network configuration information message broadcasted by the first network device currently connected to the first wireless network, and extracts the network configuration information carried in the received network configuration information message; wherein the network configuration request message is used to request the network configuration information of accessing the wireless network;
[0120] The device also includes:
[0121] The second request forwarding module is used to broadcast the received network configuration request message in response to receiving the network configuration request message, so that the network configuration node determines the network configuration device that currently needs to be configured according to the received network configuration request message.
[0122] Optionally, the network configuration request message received by the second network device is obtained by broadcast scanning according to a preset scanning period;
[0123] The second request forwarding module is specifically used to:
[0124] If the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the network device to be configured that generates the network configuration request message.
[0125] Optionally, the received network configuration information message is an encrypted message;
[0126] The second extraction module is specifically used for:
[0127] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0128] Optionally, the received network configuration information message is a broadcast message based on the Bluetooth broadcast format, and each network configuration information message also carries a serial number and a total number; the total number represents: when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format, the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network according to the maximum supportable number of bytes; the serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information;
[0129] The device also includes:
[0130] A third extraction module, configured to extract a sequence number and a total number carried in the received network configuration information message before the second access module executes access to the first wireless network using the extracted network configuration information;
[0131] The second access module includes:
[0132] A second determination submodule is used to determine whether the total number of network configuration information messages carrying different sequence numbers are currently acquired according to the extracted sequence number and the total number;
[0133] a splicing submodule, for splicing the network configuration information carried in the network configuration information messages with different sequence numbers according to the sequence of the sequence numbers carried in the acquired network configuration information messages, if the total number of network configuration information messages carrying different sequence numbers has been currently acquired, to obtain the complete network configuration information of the first wireless network;
[0134] The access submodule is used to access the first wireless network by using the complete network configuration information obtained by splicing.
[0135] Optionally, the device further comprises:
[0136] a notification sending module, configured to broadcast and send a notification message carrying its own device identification indicating that the complete network configuration information of the first wireless network has been acquired, when the total number of network configuration information messages carrying different sequence numbers have been acquired;
[0137] The second notification forwarding module is used to broadcast the received notification message in response to receiving the notification message, so that the network configuration node determines whether all the devices to be configured that currently need to be configured have received the complete configuration information of the first wireless network based on the received notification message.
[0138] Optionally, the received notification message is obtained by broadcast scanning according to a preset scanning period;
[0139] The second notification forwarding module is specifically used to:
[0140] In response to receiving a notification message, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast; wherein, the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0141] Optionally, the device further comprises:
[0142] A second forwarding module is used to open a forwarding window of a preset duration after accessing the first wireless network using the extracted network configuration information, and periodically broadcast and send the received network configuration information message within the opened forwarding window;
[0143] The third forwarding module is used to respond to receiving a network configuration information message broadcasted by any network device that has connected to the first wireless network. If it is not currently in a forwarding window, it will open a forwarding window of a preset duration, and periodically broadcast the received network configuration information message within the opened forwarding window.
[0144] In a sixth aspect, an embodiment of the present application provides an electronic device, including:
[0145] Memory, used to store computer programs;
[0146] The processor is used to implement any of the above-mentioned network configuration methods when executing the program stored in the memory.
[0147] In a seventh aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the network configuration method described in any one of the above items is implemented.
[0148] In an eighth aspect, an embodiment of the present application provides a computer program product, which includes executable instructions. When the executable instructions are executed on a computer, the computer executes any one of the above-mentioned network configuration methods.
[0149] Beneficial effects of the embodiments of the present application:
[0150] The solution provided by the embodiment of the present application is that, since the first network device can broadcast the received network configuration information message when the received network configuration information message carries the network configuration information of the first wireless network, that is, any network device connected to the first wireless network can forward the received network configuration information message carrying the network configuration information of the first wireless network. In this way, after the configured network device that generates the network configuration information message broadcasts the network configuration information message, other configured network devices within the 1-hop broadcast range of the configured network device can pass the network configuration information message to the 2-hop broadcast range of the configured network device that generates the network configuration information message, and so on, the network configuration information message can be passed to the network devices to be configured outside the multi-hop broadcast range of the configured network device that generates the network configuration information message, so that the network devices outside the 1-hop broadcast range of the configured network device that generates the network configuration information message can achieve automatic network configuration. It can be seen that through this solution, the network configuration of the network devices to be configured within the multi-hop broadcast range can be automatically performed, thereby improving the network configuration efficiency.
[0151] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0152] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.
[0153] Figure 1 A flow chart of a network distribution method provided in an embodiment of the present application;
[0154] Figure 2 A schematic diagram of a broadcast message format provided in an embodiment of the present application;
[0155] Figure 3 A schematic diagram of the interaction between a BLE sending device and a BLE receiving device provided in an embodiment of the present application;
[0156] Figure 4 A timing diagram of broadcast message sending provided in an embodiment of the present application;
[0157] Figure 5 A flowchart of another network distribution method provided in an embodiment of the present application;
[0158] Figure 6 A schematic diagram of interaction between a configured network device and a to-be-configured network device in transmitting a configuration request through multi-hop broadcasting provided in an embodiment of the present application;
[0159] Figure 7 A schematic diagram of interaction between a configured network device and a to-be-configured network device in transmitting network configuration information through multi-hop broadcasting provided in an embodiment of the present application;
[0160] Figure 8 A flowchart of a specific example of a network distribution method provided in an embodiment of the present application;
[0161] Fig. 9 A schematic diagram of the structure of a distribution network system provided in an embodiment of the present application;
[0162] Fig.10 A schematic diagram of the structure of a distribution network device provided in an embodiment of the present application;
[0163] Fig.11 A schematic diagram of the structure of another network distribution device provided in an embodiment of the present application;
[0164] Fig.12 A block diagram of an electronic device providing a network configuration method for implementing an embodiment of the present application. DETAILED DESCRIPTION
[0165] 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 only 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 ordinary technicians in this field based on the present application belong to the scope of protection of the present application.
[0166] It is understandable that in actual network configuration scenarios, there are usually multiple network devices that need to be configured. The embodiments of the present application provide a network configuration method from the first network device side that is currently connected to the first wireless network, and provide a network configuration method from the second network device side that is currently not connected to the first wireless network.
[0167] It should be noted that the first network device and the second network device involved in the embodiment of the present application are only network devices that are distinguished by whether they are connected to the first wireless network. That is, in the network configuration scenario for multiple network devices, the network device that has been connected to the first wireless network is called the first network device, and the network device that has not been connected to the first wireless network is called the second network device. In actual applications, the first network device and the second network device can be smart devices of the same type or different types. Exemplarily, each network device can be a smart camera, a smart door lock, a smart air conditioner, a smart refrigerator, and so on.
[0168] In addition, the first wireless network can be a wireless network of any network type, and the embodiment of the present application does not limit the specific network type of the first wireless network. It can be understood that if there is a network device that has been connected to any wireless network in the current network configuration scenario, the network device can be referred to as the first network device, and the wireless network connected to the first network device is referred to as the first wireless network. The first wireless network and the second wireless network involved in the embodiment of the present application can be different wireless networks with the same network type, or different wireless networks with different network types. Each network type can include: Bluetooth network type, WIFI (Wireless Fidelity, wireless local area network) network type, ZigBee (a wireless network protocol for low-speed and short-distance transmission) network type, and so on.
[0169] like Figure 1 As shown, the network configuration method provided by the first network device currently connected to the first wireless network in the embodiment of the present application includes steps S101-S102:
[0170] S101, in response to receiving a network configuration information message broadcasted by other network devices that have connected to any wireless network, extracting network configuration information carried in the received network configuration information message;
[0171] S102, when the extracted network configuration information is the network configuration information of the first wireless network, broadcast the received network configuration information message, so that a second network device that is not currently connected to the first wireless network can access the first wireless network using the network configuration information carried in the received network configuration information message.
[0172] In this embodiment, any network device that has accessed a wireless network can broadcast the network configuration information of the wireless network it has accessed, that is, broadcast a network configuration information message carrying the network configuration information of the wireless network to which the network device has accessed. Then, the first network device can receive network configuration information messages sent by other network devices that have accessed any wireless network. Among them, the network configuration information carried in the network configuration information message includes at least the network identifier and password of the wireless network. For example, the network configuration information of a WiFi network may include the SSID (Service Set Identifier) and password of the WiFi, and the network configuration information of a ZigBee network may include the PANID (Personal Area Network ID) and password of the ZigBee network.
[0173] After receiving the network configuration information message, the first network device extracts the network configuration information carried in the received network configuration information message. Since each wireless network has a unique network identifier, it can be determined whether the extracted network configuration information is the network configuration information of the first wireless network based on the network identifier in the extracted network configuration information. In the case where the extracted network configuration information is the network configuration information of the first wireless network, the received network configuration information message is broadcasted, so that the second network device that is not currently connected to the first wireless network can use the network configuration information carried in the received network configuration information message to access the first wireless network.
[0174] For example, in actual applications, the network configuration information message has a predetermined format, that is, the network configuration information such as the network identifier and password carried in the network configuration information message has a fixed position in the message. After obtaining the network configuration information message, the first network device can parse the network configuration information message according to the predetermined format to extract the network configuration information. It should be noted that the embodiment of the present application does not limit the format of the network configuration information message.
[0175] It can be understood that the process of a network device using the network configuration information of any wireless network to access the wireless network is called network configuration. Network devices that access any wireless network can be called configured devices, and network devices that are not connected to any wireless network are called unconfigured devices. Any configured device broadcasts a network configuration information message carrying the network configuration information of the connected wireless network, which can only be received by network devices within the one-hop broadcast range of the configured device. Then, if there are multiple devices to be configured in the network configuration scenario, when the user manually configures one of the devices to be configured, in one implementation, after multiple devices to be configured are deployed at their respective deployment locations, if it is necessary to configure the devices to be configured outside the multi-hop broadcast range of the current configured device, it is necessary to continuously move the position of the configured device, resulting in low network configuration efficiency.
[0176] It can be understood that, since the first network device in this solution can broadcast the received network configuration information message when the received network configuration information message carries the network configuration information of the first wireless network, that is, the first network device can forward the received network configuration information message carrying the network configuration information of the first wireless network, so that any network device connected to the first wireless network can forward the received network configuration information message carrying the network configuration information of the first wireless network. In this way, the network configuration information can be transmitted to the network devices outside the 1-hop broadcast range of the configured network device, so that the network devices within the multi-hop broadcast range of the configured network device can realize automatic network configuration.
[0177] It is understandable that in an actual network configuration scenario, the network configuration node is usually the first device to access the first wireless network, and the user can manually configure the network configuration node so that the network configuration node can access the first wireless network. Exemplarily, the network configuration node can be a smart device such as a mobile phone or a tablet that can provide an interactive interface, and the user manually enters the network identifier and password of the first wireless network in the preset network configuration interface of the network configuration node, so that the network configuration node can access the first wireless network.
[0178] After the network configurator node accesses the first wireless network, the network configurator node can generate a network configuration information message carrying the network configuration information of the first wireless network, and broadcast it periodically. The network configuration device within the 1-hop broadcast range of the network configurator node can receive the network configuration information message, and access the first wireless network using the network configuration information carried in the received network configuration information message. After any network configuration device within the 1-hop broadcast range of the network configurator node accesses the first wireless network, it becomes a network configuration device and turns on the auxiliary network configuration function. At this time, the network configuration device forwards the received network configuration information message in a broadcast manner. Then, the network configuration device within the 2-hop broadcast range of the network configurator node and within the 1-hop broadcast range of the network configuration device can receive the network configuration information message forwarded by the network configuration device, so that the network configuration device within the 2-hop broadcast range of the network configurator node can use the network configuration information carried in the received network configuration information message to achieve automatic network configuration. By analogy, automatic network configuration of the network configuration device within the multi-hop broadcast range of the network configuration node can be achieved.
[0179] Optionally, in one implementation, when the extracted network configuration information is the network configuration information of the second wireless network, the second wireless network is accessed using the extracted network configuration information, and the received network configuration information message is broadcast and sent, so that network devices that are not currently connected to the second wireless network can access the second wireless network using the network configuration information carried in the received network configuration information message.
[0180] In this implementation, the second wireless network is a wireless network different from the first wireless network. If the extracted network configuration information is the network configuration information of the second wireless network, the first network device uses the extracted network configuration information to access the second wireless network, that is, the first network device is reconfigured.
[0181] It is understandable that, since each wireless network has a unique network identifier, after extracting the network configuration information, the network identifier in the network configuration information can be compared to see whether it is the same as the network identifier of the first wireless network currently connected. If they are the same, the extracted network configuration information is the network configuration information of the first wireless network; if they are different, the extracted network configuration information is the network configuration information of the second wireless network.
[0182] It can be understood that, through this method, when the wireless network in the network configuration scenario switches, the first network device can automatically switch the wireless network it is connected to, without the need to manually reconfigure the network, thereby improving the network configuration efficiency. In addition, after the first network device accesses the second wireless network, when a network configuration information message carrying the network configuration information of the second wireless network is received, the received network configuration information message can be forwarded in a broadcast manner, thereby assisting network devices that are not connected to any wireless network to access the second wireless network, and assisting other network devices that have been connected to the first wireless network to access the second wireless network, so as to achieve automatic network configuration of network devices that are not connected to any wireless network, and automatically complete the reconfiguration of each network device that has been connected to the first wireless network in the network configuration scenario.
[0183] Optionally, in an implementation manner, the broadcasting of the received network configuration information message may include:
[0184] If the current time is not in the forwarding window, a forwarding window of a preset duration is opened, and the received network configuration information message is periodically broadcast and sent in the opened forwarding window.
[0185] In this implementation, after receiving a network configuration information message carrying network configuration information of the first wireless network sent by other network devices, if the first network device is not currently in a forwarding window, it opens a forwarding window of a preset duration, and periodically broadcasts and sends the received network configuration information message within the opened forwarding window. Exemplarily, the preset duration may be 30s, 60s, and so on.
[0186] For example, in actual applications, after accessing the first wireless network, any network device may open a forwarding window of a preset duration, so as to periodically broadcast and send the network configuration information message carrying the network configuration information of the first wireless network received by the network device before accessing the first wireless network before the forwarding window is closed. Furthermore, after the forwarding window is closed, if a network configuration information message carrying the network configuration information of the first wireless network is received and broadcasted by other network devices, the forwarding window may be restarted, so as to periodically send the received network configuration information message within the restarted forwarding window.
[0187] Exemplarily, if the first network device uses the received network configuration information message A to access the first wireless network, and opens a 60s forwarding window after accessing the first wireless network, then within the forwarding window, the first network device periodically broadcasts and sends the network configuration information message A. After the forwarding window is closed, if a network configuration information message B carrying the network configuration information of the first wireless network is received from other network devices, the 60s forwarding window is restarted, and within the restarted forwarding window, the network configuration information message B is periodically broadcast and sent. It should be noted that the embodiment of the present application does not limit the periodic interval for periodically broadcasting and sending the network configuration information message.
[0188] It is understandable that, since the first network device can periodically broadcast and send the network configuration information message received before the forwarding window is opened within the forwarding window, the first network device does not need to forward the network configuration information message after receiving it from other network devices within the forwarding window. That is, the first network device can automatically send the network configuration information message carrying the network configuration information of the first wireless network within the forwarding window. In this way, the forwarding efficiency of the network configuration information message can be improved, and the forwarding window does not need to be opened all the time, thereby reducing wireless traffic.
[0189] Optionally, in one implementation, the received network configuration information message is an encrypted message;
[0190] Accordingly, in this implementation, the step S101 above extracts the network configuration information carried in the received network configuration information message, including:
[0191] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0192] In this implementation, the network configuration information message broadcasted by the network device connected to any wireless network is an encrypted message. Exemplarily, each legitimate network device in the network configuration scenario can agree in advance on the encryption password and decryption password for the network configuration information message, so that after the legitimate first network device receives the network configuration information message, it can use the pre-agreed decryption password to successfully decrypt the received network configuration information message, thereby extracting the network configuration information contained in the decryption result. It should be noted that the encryption method of the network configuration information message can be symmetric encryption or asymmetric encryption, which is reasonable.
[0193] For example, in actual applications, each legal network device can be a device produced by the same manufacturer, and each legal network device can be configured with an encryption password and a decryption password for network configuration information messages before leaving the factory; or, relevant technical personnel configure encryption passwords and decryption passwords for network configuration information messages for each legal network device before configuring the network, which is reasonable.
[0194] It can be understood that, through this method, it can be prevented that any network device can obtain the network configuration information at will, thereby protecting the network security.
[0195] The solution provided by the embodiment of the present application is that, since the first network device can broadcast the received network configuration information message when the received network configuration information message carries the network configuration information of the first wireless network, that is, any network device connected to the first wireless network can forward the received network configuration information message carrying the network configuration information of the first wireless network. In this way, after the configured network device that generates the network configuration information message broadcasts the network configuration information message, other configured network devices within the 1-hop broadcast range of the configured network device can pass the network configuration information message to the 2-hop broadcast range of the configured network device that generates the network configuration information message, and so on, the network configuration information message can be passed to the network devices to be configured outside the multi-hop broadcast range of the configured network device that generates the network configuration information message, so that the network devices outside the 1-hop broadcast range of the configured network device that generates the network configuration information message can achieve automatic network configuration. It can be seen that through this solution, the network configuration of the network devices to be configured within the multi-hop broadcast range can be automatically performed, thereby improving the network configuration efficiency.
[0196] Optionally, in another embodiment of the present application, Figure 1 Based on the embodiment shown, the above network distribution method further includes steps A1-A2:
[0197] A1, when the first network device is not a network provisioner node, in response to receiving a network provisioning request message, broadcasting the received network provisioning request message; wherein the network provisioning request message is used to request network provisioning information for accessing a wireless network;
[0198] A2, when the first network device is a network configuration node, in response to receiving a network configuration request message, determining a network configuration device that currently needs to be configured, and broadcasting a network configuration information message carrying the network configuration information of the first wireless network.
[0199] In this implementation, if the first network device is not a network distributor node, when the first network device receives a network distribution request message, it can also forward the received network distribution request message in a broadcasting manner. Thus, any network device that has accessed the first wireless network except the network distributor node can forward the received network distribution request message. In this way, the network distribution request message sent by the network device outside the multi-hop broadcast range of the network distributor node can be transmitted to the network distributor node, that is, the network distributor node can receive the network distribution request message sent by the network device outside its multi-hop broadcast range.
[0200] The network configuration node can determine the network configuration device that currently needs to be configured based on the received network configuration request message, and broadcast the network configuration information message carrying the network configuration information of the first wireless network. Exemplarily, in actual applications, the network configuration request message can carry the device identifier of the network device that generates the network configuration request message. After receiving each network configuration request message, the network configuration node can extract the device identifier carried in each received network configuration request message, and determine the network device represented by each extracted device identifier as the network configuration device to be configured, or select some device identifiers from each extracted device identifier, and determine the network device represented by the selected device identifier as the network configuration device to be configured, which is reasonable.
[0201] It is understandable that, in actual applications, the network configuration request message may carry a first predetermined identifier indicating that the message is a network configuration request message, so that after the first network device receives any broadcast message, if the broadcast message is parsed to obtain the first predetermined identifier, the broadcast message is determined to be a network configuration request message. Correspondingly, the network configuration information message may carry a second predetermined identifier indicating that the message is a network configuration information message, so that after the first network device receives any broadcast message, if the message is parsed to obtain the second predetermined identifier, the broadcast message is determined to be a network configuration information message. It should be noted that the embodiments of the present application do not limit the specific contents of the first predetermined identifier and the second predetermined identifier.
[0202] Optionally, in one implementation, the network configuration request message received by the first network device is obtained by broadcast scanning according to a preset scanning period;
[0203] In the above step A1, when the first network device is not a network distributor node, in response to receiving a network distribution request message, broadcasting the received network distribution request message includes:
[0204] In the case that the first network device is not a network configuration node, if the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the device to be configured that generates the network configuration request message.
[0205] In this implementation, the first network device may perform broadcast scanning according to a preset scanning period. For example, the preset scanning period may be 10ms, 20ms, etc. In practical applications, the scanning period may be set by relevant technicians based on experience, and the present application embodiment does not limit this.
[0206] It is understandable that, in actual applications, before the first network device accesses the wireless network, it will send a network configuration request message carrying its own device identification on each broadcast channel, and other network devices that have accessed the first wireless network within a one-hop range of the first network device will forward the network configuration request message after receiving it. Therefore, after the first network device accesses the first wireless network, there is a situation where the network configuration request message carrying its own device identification is received. In addition, since the network configuration request message carrying its own device identification sent by any network configuration device will be forwarded by each network device that has accessed the first wireless network and received the network configuration request message, then the first network device may receive multiple network configuration request messages carrying the same device identification within one scanning cycle.
[0207] It is understandable that, since the first network device has accessed the first wireless network, if the first network device receives a network configuration request message carrying its own device identification, it does not need to forward the network configuration request message. That is, after any network device accesses the wireless network, the network configuration request message sent by the network device before accessing the wireless network can be discarded as an invalid message. And if the first network device receives multiple network configuration request messages carrying the same device identification within a scanning cycle, if the multiple network configuration request messages carrying the same device identification are forwarded, it will cause other network devices to receive a large number of repeated network configuration request messages within a scanning cycle, resulting in excessive load on each network device.
[0208] Therefore, in order to prevent each network device from receiving a large number of repeated or invalid network configuration request messages and to reduce the load of each network device, in this implementation, after receiving the network configuration request message, the first network device can extract the device identifier carried in the network configuration request message, and if the device identifier represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcasted. Otherwise, the received network configuration request message can be discarded.
[0209] Optionally, in one implementation, in response to receiving the network configuration request message, determining the network configuration device that currently needs to be configured, and broadcasting a network configuration information message carrying the network configuration information of the first wireless network in step A2 may include steps A21-A23:
[0210] A21, in response to receiving a network configuration request message, displaying a device identifier carried in the received network configuration request message in a preset interactive interface; wherein a device identifier carried in a network configuration request message represents a to-be-configured network device that generates the network configuration request message;
[0211] A22, in response to a user's selection operation on a device identifier displayed in a preset interactive interface, determining a device represented by the device identifier indicated by the selection operation as a to-be-configured device that currently needs to be configured;
[0212] A23, broadcasting a network configuration information message carrying the network configuration information of the first wireless network at a preset time interval until it is determined that all devices to be configured currently requiring network configuration have received the complete network configuration information of the first wireless network.
[0213] In this implementation, when the network distributor node receives a network distribution request message, it can extract the device identifier from the received network distribution request message and display the device identifier carried in the received network distribution request message in a preset interactive interface. For example, the device identifiers carried in each network distribution request message are displayed in the form of a list in the preset interactive interface. It should be noted that the preset interactive interface of the network distributor node is an interface for displaying the device identifier carried in the received network distribution request message, and the embodiment of the present application does not limit the preset interactive interface and the display form of each device identifier in the preset interactive interface.
[0214] After displaying each device identification in the preset interactive interface, the user can perform a selection operation on each displayed device identification. The device represented by the device identification indicated by the selection operation performed by the user is the device to be configured that currently needs to be configured. For example, the user can click on the display area corresponding to each device identification to select the device identification, and the device identification corresponding to the display area clicked by the user is the device identification indicated by the selection operation performed by the user. It should be noted that the embodiment of the present application does not limit the specific method of the selection operation.
[0215] Exemplarily, if device identification 1, device identification 2, device identification 3 and device identification 4 are displayed in the preset interactive interface, and the user selects device identification 1 and device identification 3 displayed in the interface, the device represented by device identification 1 and the device represented by device identification 3 are determined as the devices to be configured that currently need to be configured.
[0216] Exemplarily, the device identification of any device may be a MAC (Media Access Control) address, a serial number, etc. of the device.
[0217] After determining the network configuration device that currently needs to be configured, the network configuration node can broadcast and send the network configuration information message carrying the network configuration information of the first wireless network at a preset time interval, and when the network configuration node determines that all the configured devices that currently need to be configured have received the complete network configuration information of the first wireless network, the network configuration node can stop sending the network configuration information message carrying the network configuration information of the first wireless network. Exemplarily, the preset time interval can be 20ms, 40ms, etc.
[0218] It can be understood that through this method, users can select the network configuration devices that need to be configured through the network configuration node, so that flexible network configuration can be achieved according to user needs, and the network configuration node can promptly stop sending network configuration information messages according to the network configuration status of the network configuration devices selected by the user, so as to prevent the network configuration information messages from being stolen by malicious devices.
[0219] Exemplarily, in a specific implementation, determining in step A23 that all devices to be networked that currently need to be networked have received complete network configuration information of the first wireless network may include:
[0220] When a notification message generated by all the devices to be networked that currently need to be networked is received, it is determined that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network; wherein the notification message is: the devices to be networked that currently need to be networked are broadcast and generated when they obtain the complete network configuration information of the first wireless network.
[0221] In this implementation, after receiving the complete network configuration information of the first wireless network, any network device to be configured can generate a notification message and broadcast it. After receiving the notification message, any network device forwards it by broadcast to pass the notification message to the network configuration node. The network configuration node receives the notification message by starting broadcast scanning. When the network configuration node receives the notification messages generated by all the network configuration devices to be configured, it can be determined that all the network configuration devices that currently need to be configured have received the complete network configuration information of the first wireless network.
[0222] Exemplarily, the notification message may carry a third predetermined identifier indicating that the message is a notification message, so that after any network device receives any broadcast message, if the broadcast message is parsed to obtain the third predetermined identifier, the broadcast message is determined to be a notification message. It should be noted that the embodiments of the present application do not limit the specific content of the third predetermined identifier.
[0223] It can be seen that through this method, the network configuration node can determine whether each device to be configured has obtained the network configuration information of the first wireless network, that is, it can monitor the network configuration status of each device to be configured, so that the network configuration node can determine whether to stop sending the network configuration information message according to the network configuration status of each device to be configured. In addition, by continuously switching between broadcasting and sending network configuration information messages and scanning notification messages, two-way communication between the configured device and the device to be configured can be achieved.
[0224] Optionally, in one implementation, the network configuration method further includes:
[0225] In the case that the first network device is not a network distributor node, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast and sent; wherein, the device identifier carried in a notification message represents the device to be configured that generates the notification message.
[0226] In this implementation, after any network device to be configured broadcasts a notification message, it may receive a network configuration request message carrying its own device identification. In addition, since the notification message carrying its own device identification sent by any network device to be configured may be forwarded by multiple network devices that receive the notification message, the first network device may receive multiple notification messages carrying the same device identification within one scanning cycle.
[0227] It is understandable that, since the first network device has broadcast and sent a notification message before accessing the first wireless network and when receiving the complete network configuration information of the first wireless network, if the first network device receives a notification message carrying its own device identification after accessing the first wireless network, there is no need to forward the notification message. In other words, after any network device accesses the wireless network, the notification message sent by the network device before accessing the wireless network can be discarded as an invalid message. And if the first network device receives multiple notification messages carrying the same device identification within a scanning cycle, if the multiple notification messages carrying the same device identification are forwarded, it will cause other network devices to receive a large number of duplicate notification messages within a scanning cycle, resulting in excessive load on each network device.
[0228] In this implementation, after receiving a notification message, the first network device will broadcast the received notification message only if the device identifier carried in the notification message represents other network devices and it is the first notification message carrying the device identifier scanned in the current scanning cycle, otherwise the received notification message can be discarded. It can be seen that through this solution, it is possible to prevent each network device from receiving a large number of repeated or invalid notification messages, thereby reducing the load of each network device.
[0229] Optionally, in another embodiment of the present application, any network configuration information message is a broadcast message based on a Bluetooth broadcast format;
[0230] In the above embodiment, the method of broadcasting and sending the network configuration information message carrying the network configuration information of the first wireless network may include steps B1-B2:
[0231] B1, when the complete network configuration information of the first wireless network exceeds the maximum number of bytes supported by a single broadcast message in the Bluetooth broadcast format, split the complete network configuration information of the first wireless network according to the maximum number of bytes supported to obtain multiple copies of network configuration information for the first wireless network;
[0232] B2. Broadcast and send multiple network configuration information messages for the first wireless network; wherein each network configuration information message carries a piece of split network configuration information.
[0233] In this embodiment, each network device in the network configuration scenario is a network device that supports the Bluetooth function, and the network configuration information message sent by any network device is a broadcast message based on the Bluetooth broadcast format.
[0234] Exemplarily, a network device supporting the Bluetooth function may be a BLE (Bluetooth Low Energy) device or a BT (Bluetooth, classic Bluetooth) device. For example, a network device supporting the Bluetooth function may be a mobile phone, a tablet computer, a wearable Bluetooth device, a Bluetooth headset, etc., and the embodiments of the present invention do not specifically limit this.
[0235] It is understandable that since a single broadcast message in the Bluetooth broadcast format has a maximum supported byte number limit, if the total number of bytes of the complete network configuration information of any wireless network exceeds the maximum supported byte number of a single broadcast message in the Bluetooth broadcast format, it is necessary to split the complete network configuration information of the wireless network so that the number of bytes of each piece of the split network configuration information does not exceed the maximum supported byte number, so that each piece of the split network configuration information can be sent via a broadcast message in the Bluetooth broadcast format.
[0236] For example, a single broadcast message in the Bluetooth broadcast format is as follows: Figure 2 As shown, the maximum supported byte number of the broadcast message is 31 bytes, and the broadcast message is divided into a valid data part and an invalid data part. It can be understood that since the length of a single broadcast message in the Bluetooth broadcast format must meet 31 bytes, if the valid data part is less than 31 bytes, the invalid data part is padded with 0.
[0237] The valid data part contains several AD Structures (broadcast data units), namely Figure 2 Structure 1, structure 2, ..., structure N. N is a positive integer. In practical applications, the valid data part can contain only one ADStructure. Each AD Structure consists of: the first byte is the length (length), indicating that the following length bytes are the data part. The first byte of the data part indicates the data type (AD Type), and the remaining length-1 bytes are the actual data (AD Data).
[0238] It is understandable that, since there are flags such as length and AD Type in the broadcast message, when splitting the complete network configuration information of the first wireless network according to the maximum supported number of bytes, the number of bytes occupied by the flags in the message needs to be considered. For example, if the broadcast message contains only one AD Structure, then after removing the flag, the broadcast message can still carry 29 bytes. At this time, the complete network configuration information of the first wireless network can be split in a way that each portion does not exceed 29 bytes, and multiple portions of network configuration information can be obtained.
[0239] It can be seen that, through this solution, the complete network configuration information of the first wireless network can be unpacked and sent, so as to solve the problem of the maximum length limitation of a single broadcast message in the Bluetooth broadcast format.
[0240] Optionally, in one implementation, each network configuration information message also carries a serial number and a total number; the total number represents: the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network, and the serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information, so that the second network device can obtain the complete network configuration information of the first wireless network according to the serial number and the total number carried in the received network configuration information message.
[0241] In this implementation method, after each piece of network configuration information is split, the serial number of each piece of network configuration information can be determined according to the order of the position of each piece of network configuration information in the complete network configuration information, and the serial number corresponding to each piece of network configuration information and the number of each piece of network configuration information obtained by splitting can be recorded in the network configuration information message carrying each piece of network configuration information.
[0242] Exemplarily, if the complete network configuration information for the first wireless network is split into network configuration information A, network configuration information B and network configuration information C, and the order of network configuration information A in the complete network configuration information is before network configuration information B, and the order of network configuration information B in the complete network configuration information is before network configuration information C, then the network configuration information message carrying network configuration information A also carries sequence number "1" and the number "3"; the network configuration information message carrying network configuration information B also carries sequence number "2" and the number "3"; the network configuration information message carrying network configuration information C also carries sequence number "3" and the number "3".
[0243] It can be understood that by carrying the sequence number and total number of each split network information in the network configuration information message, each network device can restore the each split network information through the sequence number and total number carried in the received network configuration information message to recover the original complete network configuration information.
[0244] For example, Figure 3As shown, the network configuration scenario includes a BLE sending device and a BLE receiving device. Among them, the BLE sending device is a network-configured device or a device that needs to send network configuration information. The BLE receiving device can be a device that supports WiF and BLE functions, or a device that supports ZigBee and BLE functions. The BLE receiving device monitors Bluetooth broadcast data at a predetermined time interval. The BLE sending device splits the complete network configuration information of the first wireless network according to the maximum number of bytes supported by a single broadcast message in the Bluetooth broadcast format to obtain 1-N (N is a positive integer) broadcast messages, namely message 1, message 2, ..., message N. And broadcast and send the 1-N broadcast messages respectively according to the preset broadcast interval. When all broadcast messages are sent, a round of data transmission is completed. At this time, if the BLE sending device does not receive the notification message sent by the BLE receiving device after scanning and listening for a period of time, it enters the next round of broadcast message sending, and so on and so forth until the BLE receiving device obtains all broadcast messages. The BLE receiving device continuously receives broadcast messages, and performs 1-N arrangement according to the received broadcast messages, restores the complete network configuration information, and completes the network configuration using the received complete network configuration information.
[0245] Specifically, the BLE receiving device caches each broadcast message after receiving it, that is, caches message 1 after receiving message 1, and caches message 2 after receiving message 2. After receiving message N and caching message N, the data is combined, that is, the network configuration information carried in the multiple broadcast messages is combined to obtain complete network configuration information. In addition, after the BLE receiving device receives the complete network configuration information, it no longer performs broadcast scanning. At this time, the BLE receiving device periodically sends a notification message to inform the BLE sending device that data reception has been completed. The BLE sending device will perform a broadcast scan after each round of broadcast message sending is completed. During the broadcast scan, the notification message sent by the BLE receiving device can be scanned. After receiving the notification message, the BLE sending device can display the device identification of the BLE receiving device that has completed the network configuration through the UI (User Interface).
[0246] Exemplarily, in a specific implementation, the broadcasting of multiple network configuration information messages for the first wireless network in the above step B2 may include B21-B24:
[0247] B21, according to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently;
[0248] B22, periodically broadcasts the current configuration network information message that needs to be sent;
[0249] B23, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when a predetermined switching interval is reached, determine, in order of precedence, the configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to the step of periodically broadcasting and sending the current configuration network information message that needs to be sent; wherein the duration of the switching interval is the duration that can send at least one broadcast message;
[0250] B24, until the last sequence number is carried in the currently sent network configuration information message, and after starting to periodically broadcast and send the currently required network configuration information message, when the switching interval is reached, return to the execution in the order of the carried sequence numbers, and determine the network configuration information message carrying the first sequence number as the step of the currently required network configuration information message.
[0251] In this implementation, the network configuration information message carrying the first sequence number can be determined as the network configuration information message that needs to be sent currently according to the order of the sequence numbers carried by each network configuration information message, and the network configuration information message that needs to be sent currently can be broadcast and sent periodically. Exemplarily, the period of broadcasting the network configuration information message can be 50ms, 100ms, and so on. After reaching the predetermined switching interval, switch to sending the network configuration information message carrying the next sequence number, and so on. After sending the network configuration information message with the last sequence number, if the switching interval is reached, repeat the above sending process starting from the network configuration information message carrying the first sequence number.
[0252] It is understandable that if a broadcast message carrying any sequence number is switched to send a broadcast message carrying the next sequence number after being sent once, then when a broadcast message carrying a certain sequence number is lost, the network device to be configured needs to wait until the next polling to scan the broadcast message carrying the sequence number. For example, if the complete network configuration information of the first wireless network is split into three broadcast messages for transmission, namely message 1, message 2 and message 3, and if the network device to be configured receives message 1 and message 3, it needs to wait until the next round of broadcasting to send the three broadcast messages before receiving message 2. Then, the network device to be configured needs a long time to obtain the complete network configuration information, resulting in low network configuration efficiency.
[0253] In order to solve the above problem, in one way, the duration of the switching interval can be set to the duration that can at least send two broadcast messages. In this way, a broadcast message carrying any sequence number can be sent at least twice before switching, which reduces the probability that when a broadcast message is lost, the network configuration device needs to wait for the next round of broadcast messages to obtain complete network configuration information, thereby improving network configuration efficiency. Exemplarily, in actual applications, the duration of the switching interval can be the duration of sending two broadcast messages, the duration of sending three broadcast messages, and so on.
[0254] For example, a timing diagram of broadcast message transmission is as follows: Figure 4 As shown, the horizontal axis is the time axis representing time, in ms. The broadcast interval is 50ms, and the switching interval is 180ms. At this time, after each broadcast message starts to be sent periodically, it switches to the next broadcast message when it reaches 180ms. That is, after message 1 is sent periodically 4 times according to the broadcast interval, it switches to message 2 when the switching interval is reached, and message 2 is sent periodically according to the broadcast interval and switches to message 3 when the switching interval is reached, until all messages are sent. Among them, message 1 is the first broadcast message obtained by splitting the complete network configuration information (that is, the sequence number is 1), message 2 is the second broadcast message obtained by splitting the complete network configuration information (that is, the sequence number is 2), and message 3 is the third broadcast message obtained by splitting the complete network configuration information (that is, the sequence number is 3).
[0255] In addition, it should be noted that, in actual applications, the broadcast interval and the switching interval can be set by relevant technical personnel according to performance requirements such as power consumption of the device, and the embodiments of the present application are not limited to this.
[0256] Exemplarily, in another specific implementation, the broadcasting of multiple network configuration information messages for the first wireless network in the above step B2 may include B25-B28:
[0257] B25, according to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently;
[0258] B26, periodically broadcasts the current configuration network information message that needs to be sent;
[0259] B27, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when the number of times the current configuration network information message that needs to be sent has reached a predetermined number, determine, in order of precedence, a configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to the step of periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0260] B28, until the last sequence number is carried in the currently sent network configuration information message, and after starting to periodically broadcast and send the currently required network configuration information message, when the predetermined number of times is reached, return to the execution in the order of the carried sequence numbers, and determine the network configuration information message carrying the first sequence number as the currently required network configuration information message to be sent.
[0261] In this implementation, the network configuration information message carrying the first sequence number can be determined as the network configuration information message that needs to be sent currently, and the network configuration information message that needs to be sent currently can be broadcast and sent periodically according to the sequence number carried by each network configuration information message. Exemplarily, the period of broadcasting the network configuration information message can be 50ms, 100ms, and so on. After the number of broadcast messages carrying any sequence number reaches a predetermined number, switch to sending the network configuration information message carrying the next sequence number, and so on. After sending the network configuration information message with the last sequence number, if the predetermined number is reached, the above-mentioned sending process is repeated starting from the network configuration information message carrying the first sequence number.
[0262] Exemplarily, in one method, the predetermined number of times is greater than 1, for example, it can be 2 times or 3 times, and so on. It is understandable that if a broadcast message carrying any sequence number is sent once and then switches to sending a broadcast message carrying the next sequence number of the sequence number, then when a broadcast message carrying a certain sequence number is lost, the network device to be configured needs to wait until the next polling to scan the broadcast message carrying the sequence number. Then, it takes a long time for the network device to be configured to obtain complete network configuration information, resulting in low network configuration efficiency. The broadcast message carrying any sequence number is sent at least twice before switching, which reduces the probability that the network device to be configured needs to wait for the next round of broadcast messages to obtain complete network configuration information when a certain broadcast message is lost, thereby further improving the network configuration efficiency.
[0263] Corresponding to the above-mentioned network configuration method provided from the first network device side that is currently connected to the first wireless network, the embodiment of the present application also provides a network configuration method provided from the second network device side that is currently not connected to the first wireless network, such as Figure 5 As shown, steps S501-S502 are included:
[0264] S501, in response to receiving a network configuration information message broadcasted by a first network device that is currently connected to a first wireless network, extracting network configuration information carried in the received network configuration information message; wherein the network configuration information message broadcasted by the first network device is: a network configuration information message received and sent by other network devices that are currently connected to the first wireless network and that carries network configuration information of the first wireless network;
[0265] S502: Access a first wireless network using the extracted network configuration information.
[0266] It should be noted that the relevant contents of steps S501-S502 are described in the above steps S101-S102 and will not be repeated here. It is understandable that any second network device becomes a first network device after accessing the first wireless network using the network configuration information. That is, in the actual network configuration scenario, the number of second network devices and first network devices is constantly changing. As more network devices are connected to the first wireless network, the number of second network devices gradually decreases and the number of first network devices gradually increases. When all network devices in the network configuration scenario are connected to the first wireless network, there is no second network device in the network configuration scenario.
[0267] Optionally, in one implementation, in response to receiving a network configuration information message broadcasted by a first network device that is currently connected to the first wireless network in step S501, before extracting the network configuration information carried in the received network configuration information message, the network configuration method further includes:
[0268] Broadcasting and sending a network configuration request message carrying its own device identification; wherein the network configuration request message is used to request network configuration information for accessing a wireless network;
[0269] In this implementation, a second network device that is not currently connected to the first wireless network can send a network configuration request message for requesting network configuration information. Exemplarily, in an actual network configuration scenario, a user can first turn on the power of each second network device and operate each second network device to enter the network configuration mode. After each second network device enters the network configuration mode, it can periodically send a network configuration request message carrying its own device identification on each broadcast channel. It should be noted that the operation method in which the user operates the second network device to cause the second network device to enter the network configuration mode is related to the device type of the second network device, and the embodiment of the present application does not limit the operation method. For example, in one embodiment, the second network device is a smart camera, and the smart camera enters the network configuration mode when the indicator light changes to a blue flashing state after the power switch is turned on. Then, the user can turn on the power switch of the smart camera and wait for the indicator light to change to a blue flashing state to cause the smart camera to enter the network configuration mode.
[0270] Accordingly, in this implementation, the above network configuration method may further include:
[0271] In response to receiving the network configuration request message, the received network configuration request message is broadcasted, so that the network configuration device node determines the network configuration device that currently needs to be configured according to the received network configuration request message.
[0272] In this implementation, after receiving the network configuration request message, the second network device that is not connected to the first wireless network forwards the received network configuration request message, so that the network configuration request message sent by the network configuration device outside the multi-hop range of the network configuration device node can be forwarded by each network device and transmitted to the network configuration device node.
[0273] It should be noted that the manner in which the network distributor node determines the network configuration device that currently needs to be configured according to the received network configuration request message can refer to the relevant content of the above step A2, which will not be repeated here.
[0274] Optionally, in one implementation, the network configuration request message received by the second network device is obtained by broadcast scanning according to a preset scanning period;
[0275] In response to receiving the network configuration request message, broadcasting the received network configuration request message includes:
[0276] If the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the network device to be configured that generates the network configuration request message.
[0277] This implementation method can refer to the relevant content of step A1 above, which will not be repeated here.
[0278] Optionally, in one implementation, the received network configuration information message is an encrypted message;
[0279] Accordingly, in this implementation, extracting the network configuration information carried in the received network configuration information message in the above step S502 may include:
[0280] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0281] It should be noted that this implementation method can refer to the relevant content of the above-mentioned step S101, which will not be repeated here.
[0282] Optionally, in one implementation, the received network configuration information message is a broadcast message based on the Bluetooth broadcast format, and each network configuration information message also carries a serial number and a total number; the total number represents: when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format, the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network according to the maximum supportable number of bytes; the serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information;
[0283] Accordingly, in this implementation, before accessing the first wireless network using the extracted network configuration information in step S502, the method further includes:
[0284] Extract the sequence number and total number carried in the received configuration network information message;
[0285] It is understandable that, in practical applications, the network configuration information message has a predetermined format, that is, the network configuration information, sequence number and total number carried in the network configuration information message have a fixed position in the message. After obtaining the network configuration information message, the second network device can parse the network configuration information message according to the predetermined format, thereby extracting the sequence number and total number carried in the network configuration information message. It should be noted that the embodiment of the present application does not limit the format of the network configuration information message.
[0286] Accessing the first wireless network using the extracted network configuration information in the above step S502 may include steps C1-C3:
[0287] C1, according to the extracted sequence number and the total number, determine whether the total number of network configuration information messages carrying different sequence numbers are currently obtained;
[0288] C2: if a total number of network configuration information messages carrying different sequence numbers have been obtained, the network configuration information carried in the network configuration information messages with different sequence numbers are spliced according to the sequence order of the sequence numbers carried in the obtained network configuration information messages to obtain the complete network configuration information of the first wireless network;
[0289] C3, access the first wireless network using the complete network configuration information obtained by splicing.
[0290] It should be noted that this implementation method can refer to the relevant description of steps B1-B2 above, which will not be repeated here.
[0291] Optionally, in one implementation, the above network configuration method may further include steps D1-D2:
[0292] D1, when a total number of network configuration information messages carrying different sequence numbers have been obtained, broadcast a notification message carrying its own device identification indicating that the complete network configuration information of the first wireless network has been obtained;
[0293] D2, in response to receiving the notification message, broadcasting the received notification message, so that the network provisioner node determines whether all the devices to be provisioned that currently need to be provisioned have received the complete provisioning information of the first wireless network according to the received notification message.
[0294] Optionally, in one implementation, the received notification message is obtained by broadcast scanning according to a preset scanning period;
[0295] In response to receiving the notification message in the above step D2, broadcasting the received notification message may include:
[0296] In response to receiving a notification message, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast; wherein, the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0297] In this implementation, if the second network device has currently obtained a total number of network configuration information messages carrying different sequence numbers, it means that the second network device has obtained the complete network configuration information of the first wireless network. At this time, the second network device can generate and send a notification message carrying its own device identification. It should be noted that the relevant contents of steps D1-D2 are described in the relevant contents of the above step A23 and will not be repeated here.
[0298] Optionally, in one implementation, the above network configuration method further includes steps E1-E2:
[0299] E1, after accessing the first wireless network using the extracted network configuration information, opening a forwarding window of a preset duration, and periodically broadcasting and sending the received network configuration information message within the opened forwarding window;
[0300] E2, in response to receiving a network configuration information message broadcasted by any network device that has connected to the first wireless network, if it is not currently in a forwarding window, open a forwarding window of a preset duration, and periodically broadcast the received network configuration information message within the opened forwarding window.
[0301] It should be noted that the relevant contents of steps E1-E2 have been described in the relevant contents of the forwarding window in the above embodiment, and will not be repeated here.
[0302] It can be seen that through this solution, the second network device can access the first wireless network by using the network configuration information message broadcasted by the first network device. The network configuration information message broadcasted by the first network device is: the network configuration information message received and sent by other network devices that have accessed the first wireless network and carries the network configuration information of the first wireless network. That is, any network device that accesses the first wireless network can forward the received network configuration information message carrying the network configuration information of the first wireless network. In this way, after the configured network device that generates the network configuration information message broadcasts the network configuration information message, other configured network devices within the 1-hop broadcast range of the configured network device can transmit the network configuration information message to the 2-hop broadcast range of the configured network device that generates the network configuration information message, and so on, the network configuration information message can be transmitted to the network device to be configured outside the multi-hop broadcast range of the configured network device that generates the network configuration information message, so that the network device to be configured outside the 1-hop broadcast range of the configured network device that generates the network configuration information message can achieve automatic network configuration. It can be seen that through this solution, the devices to be configured within the multi-hop broadcast range can be automatically configured.
[0303] In order to better understand the network configuration method provided in the embodiment of the present application, Figure 6-Figure 8 A specific example of an embodiment of the present application is described.
[0304] Figure 6 The flowchart of transmitting the network configuration request through multi-hop broadcast is shown. Figure 6 As shown, in the current network configuration scenario, there is a configured device, as well as device 1 to be configured within the 1-hop broadcast range of the configured device, device 2 to be configured within the 2-hop broadcast range of the configured device, and device 3 to be configured within the 3-hop broadcast range of the configured device. By default, each device to be configured periodically sends a network configuration broadcast (corresponding to the network configuration request message mentioned above) carrying its own device identification through BLE broadcast, and periodically scans the broadcast messages sent by other devices to be configured.
[0305] Each device on the network to be configured forwards the scanned network broadcast, but it needs to follow the following principles:
[0306] (1) The broadcast of the network to be configured is not forwarded;
[0307] (2) The broadcast of the same device to be configured is only forwarded once in one scanning cycle.
[0308] The network-provisioned devices perform regular broadcast scanning, and display the device identifiers carried in the network-to-be-provisioned broadcasts received on the network-to-be-provisioned or save them in advance.
[0309] like Figure 6As shown, the configured network device can directly receive the network broadcast 1 to be configured sent by the network device 1 to be configured. For the network broadcast 2 to be configured sent by the network device 2 to be configured within the hop range of the configured network device 2, it is necessary to transmit the network broadcast 2 to the configured network device through 2-hop broadcasting. Specifically, after the network device 2 to be configured sends the network broadcast 2 to be configured, the network device 1 to be configured scans and finds the network broadcast 2 to be configured and forwards the network broadcast 2 to be configured, so that the configured network device can receive the network broadcast 2 to be configured. Similarly, for the network broadcast 3 to be configured sent by the network device 3 to be configured within the hop range of the configured network device 3, it is necessary to transmit the network broadcast 3 to the configured network device through 3-hop broadcasting. Specifically, after the network device 3 to be configured sends the network broadcast 3 to be configured, the network device 2 to be configured scans and finds the network broadcast 3 to be configured and forwards the network broadcast 3 to be configured, so that the network device 1 to be configured can scan and find the network broadcast 3 to be configured. After the network device 1 to be configured scans and finds the network broadcast 3 to be configured, it forwards the network broadcast 3 to be configured, so that the configured network device can receive the network broadcast 3 to be configured.
[0310] It can be seen that in addition to reporting its own broadcast of the network to be configured, the device to be configured will also start broadcast scanning for a certain period of time and forward the scanned broadcast of the network to be configured.
[0311] Figure 7 The flowchart of transmitting the configuration information through multi-hop broadcast is shown. Figure 7 As shown, in the current network configuration scenario, there is a configured device, as well as a to-be-configured device 1 within a 1-hop broadcast range of the configured device, a to-be-configured device 2 within a 2-hop broadcast range of the configured device, and a to-be-configured device 3 within a 3-hop broadcast range of the configured device.
[0312] The network-configured device can be configured manually by the user. That is, during the initial network configuration, the user can first select one or more network devices in the network configuration scene for manual network configuration. After the network-configured device is connected to the wireless network, the network configuration information is encrypted and the network configuration information message carrying the network configuration information is sent through BLE broadcast. Figure 7 As shown, the network-configured device splits the complete network configuration information of the wireless network into three broadcast messages for transmission, namely, network configuration information message 1, network configuration information message 2 and network configuration information message 3.
[0313] The device 1 to be configured within the 1-hop broadcast range of the configured device can directly receive the broadcast message sent by the configured device. That is, the device 1 to be configured within the 1-hop broadcast range performs a broadcast scan, and after scanning and finding the network configuration information message, decrypts the message and performs network configuration, thereby realizing 1-hop network configuration. Specifically, after the device 1 to be configured receives the network configuration information message 1, the network configuration information message 2, and the network configuration information message 3, it splices and decrypts each network configuration information message to extract the complete network configuration information, and uses the complete network configuration information to access the wireless network.
[0314] After the network configuration of the network device 1 is completed, it stops sending the network configuration broadcast and enters the auxiliary network configuration stage. At this time, the network device 1 opens an auxiliary network configuration forwarding window for a period of time (for example, 60s) to forward the network configuration information message. That is, the network device 1 forwards the received network configuration information message 1, network configuration information message 2 and network configuration information message 3, and the network device 2 can receive the network configuration information message 1, network configuration information message 2 and network configuration information message 3 forwarded by the network device 1. After the network device 2 scans and finds the network configuration information message, it decrypts the message and performs network configuration, thereby realizing 2-hop network configuration.
[0315] Similarly, after the network configuration of the network device 2 is completed, it stops sending the network configuration broadcast and enters the auxiliary network configuration stage. At this time, the network device 2 opens the auxiliary network configuration forwarding window for a period of time to forward the network configuration information message. That is, the network device 2 to be configured forwards the received network configuration information message 1, network configuration information message 2 and network configuration information message 3, and the network device 3 to be configured can receive the network configuration information message 1, network configuration information message 2 and network configuration information message 3 forwarded by the network device 2 to be configured. After the network device 3 to be configured scans and finds the network configuration information message, it decrypts the message and performs network configuration, thereby realizing 3-hop network configuration.
[0316] It can be seen that by repeating the forwarding process of the above-mentioned network configuration information message, the network configuration information can be forwarded by 1-hop broadcast to complete 2-hop broadcast networking, and then the network configuration information can be forwarded by 2-hop broadcast to complete 3-hop broadcast networking, and so on, and finally the network configuration of all devices to be configured is completed. In addition, the network-configured device finally confirms whether the network configuration of all devices to be configured selected by the user is completed according to the network access status of each device. After the auxiliary network configuration forwarding window ends, the device that has completed the network configuration scans whether the network configuration broadcast (i.e., the broadcast of sending the network configuration information message) of the network-configured device is still continuing. If there is still a network configuration broadcast, the forwarding window can be restarted to forward the network configuration information message.
[0317] It should be noted that during the opening time of the forwarding window, any network-configured device does not need to forward after receiving the network configuration broadcast from the previous level, that is, it does not need to forward after receiving the network configuration information message sent by other network-configured devices. At this time, the network-configured device can automatically send the network configuration information message locally. When the forwarding window ends, if the network configuration broadcast from the previous level is received, the forwarding window can be restarted. In this way, the forwarding efficiency of the network configuration broadcast can be improved and the wireless traffic can be reduced.
[0318] It is understandable that, in actual applications, the sending process of the above-mentioned network broadcast to be configured and the network configuration broadcast can be carried out simultaneously. That is, in the network configuration process, the network device to be configured broadcasts its own network broadcast to be configured, and performs broadcast scanning at regular intervals. The scanned broadcasts include the network broadcast to be configured and the network configuration broadcast of other devices. The network device to be configured scans the network broadcast to be configured. If it is not its own broadcast and it is scanned for the first time in this scanning cycle, then the broadcast is forwarded directly. The network device to be configured scans the network configuration broadcast, receives the network configuration broadcast and saves it until all network configuration broadcasts are received. After the network configuration broadcast is received, it is decrypted to obtain the network configuration information, and then the network configuration information is used to perform network configuration operations until the network configuration is completed.
[0319] After the network configuration is completed, the device to be configured becomes a configured device and the auxiliary network configuration is enabled for a period of time. At this time, the network configuration broadcast is automatically forwarded and the network configuration information is no longer decrypted. At the same time, the broadcast scan is performed at regular intervals, and the scanned broadcasts include the network to be configured broadcast and the network configuration broadcast. When the configured device scans the network to be configured broadcast, if it is not its own broadcast and it is the first time to scan it in this scanning cycle, it will directly forward the broadcast. When the configured device scans the network configuration broadcast, it determines whether it is still the network configuration broadcast of this network configuration. If not, it will re-configure the network; if it is still the network configuration broadcast of this network configuration, it determines whether the forwarding window of the auxiliary network configuration has ended. If it has ended, it will reopen the forwarding window to automatically forward the network configuration broadcast.
[0320] Combine the following Figure 8 The network configuration process of the network configuration device to be configured is introduced, including steps S801-S812:
[0321] S801, start broadcasting of the network to be configured;
[0322] After the device to be configured is powered on, it enters the configuration mode and periodically sends the configuration broadcast.
[0323] S802, start broadcast scanning;
[0324] The device to be networked performs broadcast scanning at a preset scanning period, and the scanned broadcasts may include the network to be configured broadcasts and the configuration network broadcasts sent by other devices.
[0325] S803, scanning to find broadcast;
[0326] S804, identifying whether the scanned broadcast is a broadcast of a network to be configured; if not, executing step S805; if so, executing step S811;
[0327] When the device to be configured scans the network broadcast to be configured, if it is not the network broadcast to be configured sent by itself and it is the first time to be scanned in the current scanning cycle, the device will directly forward the network broadcast to be configured.
[0328] S805, identifying whether the scanned broadcast is a distribution network broadcast; if so, executing step S806, if not, executing step S812;
[0329] S806, identifying whether the scanned broadcast is a new distribution network broadcast; if so, executing step S807, if not, executing step S809;
[0330] According to the network identifier in the network configuration information carried by the network configuration broadcast, determine whether the network identifier carried in the scanned network configuration broadcast is the network identifier of the wireless network for this network configuration. If so, forward the network configuration broadcast. Otherwise, the scanned network configuration broadcast is a new network configuration broadcast. At this time, it is necessary to use the new network configuration broadcast to re-configure the network.
[0331] S807, identifying whether the distribution network broadcast is received; if so, executing step S808, if not, returning to step S803;
[0332] The device to be configured scans a new network configuration broadcast, receives the network configuration broadcast and saves it until all network configuration broadcasts are received. For example, if the complete network configuration information of the wireless network is split into three parts for broadcasting, the device to be configured receives the network configuration broadcast carrying the three parts of network configuration information, determines that the network configuration broadcast is received, decrypts it, and then uses the network configuration information for network configuration.
[0333] S808, decryption and network configuration completion;
[0334] S809, forwarding distribution network broadcast;
[0335] S810, whether the forwarding window duration is reached; if so, end; if not, return to step S809;
[0336] After the network configuration device completes the network configuration, a forwarding window is opened for a period of time to forward the network configuration broadcast. If the set forwarding window duration is reached, the network configuration process is terminated, otherwise, the process returns to the step of forwarding the network configuration broadcast.
[0337] S811, if it is sent by other devices and is scanned for the first time in the current scanning cycle, forward the broadcast of the network to be configured;
[0338] S812: discard the broadcast.
[0339] It can be seen that through this solution, in the process of receiving the network broadcast to be configured, since all the devices to be configured will forward the network broadcast to be configured, the network configurator node can display the information of all the devices to be configured. In addition, for the device information displayed on the network configurator node, the user can choose to configure some or all of the devices to be configured, and the network configurator node can update the configuration results in real time during the configuration process. In addition, the devices to be configured can also forward the configuration message, so the configuration process can be completed by 1-hop broadcast configuration, and then enter 2-hop broadcast configuration, thereby recursively completing the configuration of all devices to be configured. After each round of broadcast is sent, the broadcast sender will actively scan the broadcast to obtain the device that has obtained the network configuration information, so as to achieve the effect of two-way communication. In addition, business data is also sent through multi-hop broadcast to achieve the status synchronization of each network device.
[0340] Corresponding to the above method embodiment, the present application embodiment also provides a distribution network system, such as Fig. 9 As shown, it includes a first network device 910 that is currently connected to the first wireless network and a second network device 920 that is currently not connected to the first wireless network;
[0341] The first network device 910 is used to execute the network configuration method provided by the first network device side currently connected to the first wireless network;
[0342] The second network device 920 is used to execute the above-mentioned network configuration method provided from the second network device side that is not currently connected to the first wireless network.
[0343] The specific functional implementation of the first network device and the second network device involved in this system can refer to the relevant description of the above method embodiment, which will not be repeated here.
[0344] Corresponding to the above-mentioned network configuration method provided from the first network device side that has currently accessed the first wireless network, the embodiment of the present application also provides a network configuration device, which is applied to the first network device that has currently accessed the first wireless network, such as Fig.10 As shown, the device comprises:
[0345] A first extraction module 1010 is configured to extract the network configuration information carried in the received network configuration information message in response to receiving the network configuration information message broadcasted by other network devices that have connected to any wireless network;
[0346] The first broadcast module 1020 is used to broadcast the received network configuration information message when the extracted network configuration information is the network configuration information of the first wireless network, so that a second network device that is not currently connected to the first wireless network can access the first wireless network by using the network configuration information carried in the received network configuration information message.
[0347] Optionally, the device further comprises:
[0348] The first access module is used to access the second wireless network using the extracted network configuration information when the extracted network configuration information is the network configuration information of the second wireless network, and broadcast the received network configuration information message so that the network device that is not currently connected to the second wireless network can access the second wireless network using the network configuration information carried in the received network configuration information message.
[0349] Optionally, the received network configuration information message is an encrypted message;
[0350] The first extraction module 1010 is specifically used for:
[0351] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0352] Optionally, the device further comprises:
[0353] A first request forwarding module, configured to, in response to receiving a network configuration request message, broadcast and send the received network configuration request message when the first network device is not a network configuration device node; wherein the network configuration request message is used to request network configuration information for accessing a wireless network;
[0354] The device determination module is used to, when the first network device is a network configuration device node, determine the network configuration device that currently needs to be configured in response to receiving a network configuration request message, and broadcast a network configuration information message carrying the network configuration information of the first wireless network.
[0355] Optionally, the network configuration request message received by the first network device is obtained by broadcast scanning according to a preset scanning period;
[0356] The request forwarding module is specifically used for:
[0357] In the case that the first network device is not a network configuration node, if the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the device to be configured that generates the network configuration request message.
[0358] Optionally, the device determination module includes:
[0359] A display submodule, for displaying the device identifier carried in the received network configuration request message in a preset interactive interface in response to receiving the network configuration request message; wherein the device identifier carried in a network configuration request message represents the network configuration device to be generated for generating the network configuration request message;
[0360] A first determination submodule is used to, in response to a user's selection operation on a device identifier displayed in the preset interactive interface, determine a device represented by the device identifier indicated by the selection operation as a to-be-configured device that currently needs to be configured;
[0361] The sending submodule is used to broadcast the network configuration information message carrying the network configuration information of the first wireless network at a preset time interval until it is determined that all the devices to be configured that currently need to be configured have received the complete network configuration information of the first wireless network.
[0362] Optionally, the sending submodule is specifically used to:
[0363] When a notification message generated by all the devices to be networked that currently need to be networked is received, it is determined that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network; wherein the notification message is: the device to be networked that currently needs to be networked is broadcast and generated when the device to be networked obtains the complete network configuration information of the first wireless network.
[0364] Optionally, the device further comprises:
[0365] The first notification forwarding module is used to broadcast the received notification message if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, when the first network device is not a network distributor node; wherein the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0366] Optionally, any network configuration information message is a broadcast message based on a Bluetooth broadcast format;
[0367] The device determination module includes:
[0368] a splitting submodule, configured to split the complete network configuration information of the first wireless network according to the maximum supportable number of bytes to obtain multiple copies of network configuration information for the first wireless network when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format;
[0369] The broadcast submodule is used to broadcast and send multiple network configuration information messages for the first wireless network; wherein each network configuration information message carries a piece of split network configuration information.
[0370] Optionally, each network configuration information message also carries a serial number and a total number; the total number represents: the number of each piece of configuration information obtained by splitting the complete network configuration information of the first wireless network, and the serial number carried in each network configuration information message represents the position sequence of a piece of configuration information carried in the network configuration information message in the complete network configuration information, so that the second network device can obtain the complete network configuration information of the first wireless network according to the serial number and total number carried in the received network configuration information message.
[0371] Optionally, the broadcast submodule includes:
[0372] A first determining unit, configured to determine, according to the order of the carried sequence numbers, a configuration network information message carrying a first sequence number as the configuration network information message that currently needs to be sent;
[0373] A first sending unit, used for periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0374] A first switching unit is used to, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when a predetermined switching interval is reached, determine, in accordance with the sequence, the configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent; wherein the duration of the switching interval is the duration that can send at least one broadcast message;
[0375] The first return unit is used to carry the last sequence number in the currently sent network configuration information message, and after starting to periodically broadcast and send the network configuration information message that needs to be sent, when the switching interval is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently according to the order of the carried sequence numbers.
[0376] Optionally, the broadcast submodule includes:
[0377] A second determining unit is used to determine, according to the order of the carried sequence numbers, the configuration network information message carrying the first sequence number as the configuration network information message that needs to be sent currently;
[0378] A second sending unit, used for periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0379] A second switching unit is used to determine, after starting to periodically broadcast and send the current configuration network information message that needs to be sent, when the number of times the current configuration network information message that needs to be sent has reached a predetermined number of times, in accordance with the sequence, a configuration network information message carrying a next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent;
[0380] The second returning unit is used to carry the last sequence number in the currently sent network configuration information message, and after starting to periodically broadcast and send the network configuration information message that needs to be sent currently, when the predetermined number of times is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently in the order of the carried sequence numbers.
[0381] Optionally, the device further comprises:
[0382] The first forwarding module is used to open a forwarding window of a preset duration if the forwarding window is not currently in the forwarding window, and to periodically broadcast and send the received network configuration information message in the opened forwarding window.
[0383] Corresponding to the above-mentioned network configuration method provided from the second network device side that is not currently connected to the first wireless network, the embodiment of the present application also provides a network configuration device, which is applied to the second network device that is not currently connected to the first wireless network, such as Fig.11 As shown, the device comprises:
[0384] The second extraction module 1110 is used to extract the network configuration information carried in the received network configuration information message in response to receiving the network configuration information message broadcasted by the first network device that is currently connected to the first wireless network; wherein the network configuration information message broadcasted by the first network device is: the received network configuration information message sent by other network devices that are currently connected to the first wireless network and carries the network configuration information of the first wireless network;
[0385] The second access module 1120 is configured to access the first wireless network by using the extracted network configuration information.
[0386] Optionally, the device further comprises:
[0387] A request sending module, configured to broadcast a network configuration request message carrying its own device identifier before the second extraction unit executes the network configuration information message received in response to receiving the network configuration information message broadcasted by the first network device currently connected to the first wireless network, and extracts the network configuration information carried in the received network configuration information message; wherein the network configuration request message is used to request the network configuration information of accessing the wireless network;
[0388] The device also includes:
[0389] The second request forwarding module is used to broadcast the received network configuration request message in response to receiving the network configuration request message, so that the network configuration node determines the network configuration device that currently needs to be configured according to the received network configuration request message.
[0390] Optionally, the network configuration request message received by the second network device is obtained by broadcast scanning according to a preset scanning period;
[0391] The second request forwarding module is specifically used to:
[0392] If the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the network device to be configured that generates the network configuration request message.
[0393] Optionally, the received network configuration information message is an encrypted message;
[0394] The second extraction module 1110 is specifically used for:
[0395] The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
[0396] Optionally, the received network configuration information message is a broadcast message based on the Bluetooth broadcast format, and each network configuration information message also carries a serial number and a total number; the total number represents: when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format, the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network according to the maximum supportable number of bytes; the serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information;
[0397] The device also includes:
[0398] A third extraction module, configured to extract a sequence number and a total number carried in the received network configuration information message before the second access module 1120 executes access to the first wireless network using the extracted network configuration information;
[0399] The second access module 1120 includes:
[0400] A second determination submodule is used to determine whether the total number of network configuration information messages carrying different sequence numbers are currently acquired according to the extracted sequence number and the total number;
[0401] a splicing submodule, for splicing the network configuration information carried in the network configuration information messages with different sequence numbers according to the sequence of the sequence numbers carried in the acquired network configuration information messages, if the total number of network configuration information messages carrying different sequence numbers has been currently acquired, to obtain the complete network configuration information of the first wireless network;
[0402] The access submodule is used to access the first wireless network by using the complete network configuration information obtained by splicing.
[0403] Optionally, the device further comprises:
[0404] a notification sending module, configured to broadcast and send a notification message carrying its own device identification indicating that the complete network configuration information of the first wireless network has been acquired, when the total number of network configuration information messages carrying different sequence numbers have been acquired;
[0405] The second notification forwarding module is used to broadcast the received notification message in response to receiving the notification message, so that the network configuration node determines whether all the devices to be configured that currently need to be configured have received the complete configuration information of the first wireless network based on the received notification message.
[0406] Optionally, the received notification message is obtained by broadcast scanning according to a preset scanning period;
[0407] The second notification forwarding module is specifically used to:
[0408] In response to receiving a notification message, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast; wherein, the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
[0409] Optionally, the device further comprises:
[0410] A second forwarding module is used to open a forwarding window of a preset duration after accessing the first wireless network using the extracted network configuration information, and periodically broadcast and send the received network configuration information message within the opened forwarding window;
[0411] The third forwarding module is used to respond to receiving a network configuration information message broadcasted by any network device that has connected to the first wireless network. If it is not currently in a forwarding window, it will open a forwarding window of a preset duration, and periodically broadcast the received network configuration information message within the opened forwarding window.
[0412] In the technical solution of the present application, the operations involved in acquiring, storing, using, processing, transmitting, providing and disclosing the network distribution information and equipment identification are all carried out with the user's authorization.
[0413] The present application also provides an electronic device, such as Fig.12 As shown, including:
[0414] Memory 1201, used for storing computer programs;
[0415] The processor 1202 is configured to implement any of the steps of the above-mentioned network configuration method when executing the program stored in the memory 1201;
[0416] Furthermore, the electronic device may further include a communication bus and / or a communication interface, and the processor 1202, the communication interface, and the memory 1201 communicate with each other via the communication bus.
[0417] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0418] The communication interface is used for communication between the above electronic device and other devices.
[0419] The memory may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0420] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0421] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned network configuration methods are implemented.
[0422] In another embodiment provided by the present application, a computer program product including instructions is also provided, and when the computer is run on the computer, the computer executes any one of the network configuration methods in the above embodiments.
[0423] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a solid-state hard disk (SSD), etc.
[0424] 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 sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0425] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, system, electronic device, and computer-readable storage medium embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.
[0426] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
Claims
1. A network distribution method, characterized in that: Applied to a first network device currently connected to a first wireless network, the method includes: In response to receiving a network configuration information message broadcasted by other network devices that have connected to any wireless network, extracting the network configuration information carried in the received network configuration information message; When the extracted network configuration information is the network configuration information of the first wireless network, the received network configuration information message is broadcasted so that a second network device that is not currently connected to the first wireless network can access the first wireless network using the network configuration information carried in the received network configuration information message.
2. The method according to claim 1, characterized in that: The method further comprises: In the case where the extracted network configuration information is the network configuration information of the second wireless network, the second wireless network is accessed using the extracted network configuration information, and the received network configuration information message is broadcast and sent, so that network devices that are not currently connected to the second wireless network can access the second wireless network using the network configuration information carried in the received network configuration information message.
3. The method according to claim 2, characterized in that The received network configuration information message is an encrypted message; The extracting the network configuration information carried in the received network configuration information message includes: The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
4. The method according to claim 1, characterized in that The method further comprises: In the case where the first network device is not a network configuration node, in response to receiving a network configuration request message, broadcasting the received network configuration request message; wherein the network configuration request message is used to request network configuration information for accessing a wireless network; In the case where the first network device is a network configuration device node, in response to receiving a network configuration request message, a network configuration device that currently needs to be configured is determined, and a network configuration information message carrying the network configuration information of the first wireless network is broadcast and sent.
5. The method according to claim 4, characterized in that The network configuration request message received by the first network device is obtained by broadcast scanning according to a preset scanning period; In the case where the first network device is not a network distributor node, in response to receiving a network distribution request message, broadcasting the received network distribution request message includes: In the case that the first network device is not a network configuration node, if the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the device to be configured that generates the network configuration request message.
6. The method according to claim 4, characterized in that The step of determining, in response to receiving the network configuration request message, a network configuration device that currently needs to be configured, and broadcasting a network configuration information message carrying the network configuration information of the first wireless network includes: In response to receiving a network configuration request message, displaying a device identifier carried in the received network configuration request message in a preset interactive interface; wherein a device identifier carried in a network configuration request message represents a to-be-configured network device that generates the network configuration request message; In response to a user's selection operation on a device identifier displayed in the preset interactive interface, determining a device represented by the device identifier indicated by the selection operation as a to-be-configured device that currently needs to be configured; The network configuration information message carrying the network configuration information of the first wireless network is broadcasted at preset time intervals until it is determined that all the devices to be configured that currently need to be configured have received the complete network configuration information of the first wireless network.
7. The method according to claim 6, characterized in that The determining that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network includes: When a notification message generated by all the devices to be networked that currently need to be networked is received, it is determined that all the devices to be networked that currently need to be networked have received the complete network configuration information of the first wireless network; wherein the notification message is: the device to be networked that currently needs to be networked is broadcast and generated when the device to be networked obtains the complete network configuration information of the first wireless network.
8. The method according to claim 7, characterized in that The method further comprises: In the case that the first network device is not a network distributor node, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast and sent; wherein, the device identifier carried in a notification message represents the device to be configured that generates the notification message.
9. The method according to any one of claims 4 to 8, characterized in that: Any network configuration information message is a broadcast message based on the Bluetooth broadcast format; The broadcasting and sending of a network configuration information message carrying the network configuration information of the first wireless network includes: When the complete network configuration information of the first wireless network exceeds the maximum number of bytes supported by a single broadcast message in the Bluetooth broadcast format, split the complete network configuration information of the first wireless network according to the maximum number of bytes supported to obtain multiple copies of network configuration information for the first wireless network; A plurality of network configuration information messages for the first wireless network are broadcast and sent; wherein each network configuration information message carries a portion of the split network configuration information.
10. The method according to claim 9, characterized in that Each network configuration information message also carries a serial number and a total number; the total number represents: the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network. The serial number carried in each network configuration information message represents the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information, so that the second network device can obtain the complete network configuration information of the first wireless network according to the serial number and total number carried in the received network configuration information message.
11. The method according to claim 10, characterized in that The broadcasting sends a plurality of network configuration information messages for the first wireless network, including: According to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently; Periodically broadcast and send the current configuration network information message that needs to be sent; After starting to periodically broadcast and send the current configuration network information message that needs to be sent, when a predetermined switching interval is reached, determine, in accordance with the sequence, a configuration network information message carrying the next sequence number as the current configuration network information message that needs to be sent, and return to execute the step of periodically broadcasting and sending the current configuration network information message that needs to be sent; wherein the duration of the switching interval is the duration that can send at least one broadcast message; Until the last sequence number is carried in the currently sent network configuration information message, and after the periodic broadcasting of the currently required network configuration information message begins, when the switching interval is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the currently required network configuration information message to be sent in the order of the carried sequence numbers.
12. The method according to claim 10, characterized in that The broadcasting sends a plurality of network configuration information messages for the first wireless network, including: According to the order of the carried sequence numbers, determine the network configuration information message carrying the first sequence number as the network configuration information message that needs to be sent currently; Periodically broadcast and send the current configuration network information message that needs to be sent; After starting to periodically broadcast and send the network configuration information message that currently needs to be sent, when the number of times the network configuration information message that currently needs to be sent has reached a predetermined number, determine, in accordance with the sequence, a network configuration information message carrying the next sequence number as the network configuration information message that currently needs to be sent, and return to execute the step of periodically broadcasting and sending the network configuration information message that currently needs to be sent; Until the last sequence number is carried in the currently sent network configuration information message, and after starting to periodically broadcast and send the currently required network configuration information message, when the predetermined number of times is reached, return to execute the step of determining the network configuration information message carrying the first sequence number as the currently required network configuration information message to be sent in the order of the carried sequence numbers.
13. The method according to claim 1 or 2, characterized in that: The broadcasting of the received network configuration information message includes: If the current time is not in the forwarding window, a forwarding window of a preset duration is opened, and the received network configuration information message is periodically broadcast and sent in the opened forwarding window.
14. A network distribution method, characterized in that: Applied to a second network device that is not currently connected to the first wireless network, the method includes: In response to receiving a network configuration information message broadcasted by a first network device that is currently connected to the first wireless network, extracting the network configuration information carried in the received network configuration information message; wherein the network configuration information message broadcasted by the first network device is: a network configuration information message received and sent by other network devices that are currently connected to the first wireless network and carries the network configuration information of the first wireless network; The first wireless network is accessed using the extracted network configuration information.
15. The method according to claim 14, characterized in that In response to receiving a network configuration information message broadcasted by a first network device currently connected to the first wireless network, before extracting the network configuration information carried in the received network configuration information message, the method further includes: Broadcasting and sending a network configuration request message carrying its own device identification; wherein the network configuration request message is used to request network configuration information for accessing a wireless network; The method further comprises: In response to receiving the network configuration request message, the received network configuration request message is broadcasted, so that the network configuration device node determines the network configuration device that currently needs to be configured according to the received network configuration request message.
16. The method according to claim 15, characterized in that The network configuration request message received by the second network device is obtained by broadcast scanning according to a preset scanning period; In response to receiving the network configuration request message, broadcasting and sending the received network configuration request message includes: If the device identifier carried in the received network configuration request message represents other network devices and is the first network configuration request message carrying the device identifier scanned in the current scanning cycle, the received network configuration request message is broadcast and sent; wherein, the device identifier carried in a network configuration request message represents the network device to be configured that generates the network configuration request message.
17. The method according to claim 14, characterized in that The received network configuration information message is an encrypted message; The extracting the network configuration information carried in the received network configuration information message includes: The received network configuration information message is decrypted, and the network configuration information contained in the decryption result is extracted.
18. The method according to any one of claims 14 to 17, characterized in that: The received network configuration information message is a broadcast message based on the Bluetooth broadcast format, and each network configuration information message also carries a sequence number and a total number; the total number represents: when the complete network configuration information of the first wireless network exceeds the maximum supportable number of bytes of a single broadcast message in the Bluetooth broadcast format, the number of each piece of network configuration information obtained by splitting the complete network configuration information of the first wireless network according to the maximum supportable number of bytes; The sequence number carried in each network configuration information message indicates the position sequence of a piece of network configuration information carried in the network configuration information message in the complete network configuration information; Before accessing the first wireless network using the extracted network configuration information, the method further includes: Extract the sequence number and total number carried in the received configuration network information message; The accessing the first wireless network by using the extracted network configuration information includes: According to the extracted sequence number and the total number, determining whether the total number of network configuration information messages carrying different sequence numbers are currently acquired; If the total number of network configuration information messages carrying different sequence numbers has been obtained, the network configuration information carried in the network configuration information messages with different sequence numbers are spliced according to the sequence order of the sequence numbers carried in the obtained network configuration information messages to obtain the complete network configuration information of the first wireless network; The first wireless network is accessed using the spliced complete network configuration information.
19. The method according to claim 18, characterized in that The method further comprises: In the case that the total number of network configuration information messages carrying different sequence numbers have been obtained, broadcasting and sending a notification message carrying its own device identification, indicating that the complete network configuration information of the first wireless network has been obtained; In response to receiving the notification message, the received notification message is broadcasted, so that the network provisioner node determines whether all the devices to be provisioned that currently need to be provisioned have received the complete provisioning information of the first wireless network based on the received notification message.
20. The method according to claim 19, characterized in that The received notification message is obtained by broadcast scanning according to a preset scanning period; In response to receiving the notification message, broadcasting the received notification message includes: In response to receiving a notification message, if the device identifier carried in the received notification message represents other network devices and is the first notification message carrying the device identifier scanned in the current scanning cycle, the received notification message is broadcast; wherein, the device identifier carried in a notification message represents the network device to be configured that generates the notification message.
21. The method according to claim 14, characterized in that The method further comprises: After accessing the first wireless network using the extracted network configuration information, opening a forwarding window of a preset duration, and periodically broadcasting and sending received network configuration information messages within the opened forwarding window; In response to receiving a network configuration information message broadcasted by any network device that has accessed the first wireless network, if the device is not currently in a forwarding window, a forwarding window of a preset duration is opened, and the received network configuration information message is periodically broadcasted in the opened forwarding window.
22. A distribution network system, characterized in that: The system includes a first network device currently connected to a first wireless network and a second network device currently not connected to the first wireless network; The first network device is used to execute the method according to any one of claims 1 to 13; The second network device is used to execute the method described in any one of claims 14-21.
23. A network distribution device, characterized in that: Applied to a first network device currently connected to a first wireless network, the apparatus comprises: A first extraction module, configured to extract the network configuration information carried in the received network configuration information message in response to receiving the network configuration information message broadcasted by other network devices that have connected to any wireless network; The first broadcast module is used to broadcast the received network configuration information message when the extracted network configuration information is the network configuration information of the first wireless network, so that a second network device that is not currently connected to the first wireless network can access the first wireless network by using the network configuration information carried in the received network configuration information message.
24. A network distribution device, characterized in that: Applied to a second network device that is not currently connected to a first wireless network, the apparatus comprises: A second extraction module is used to extract the network configuration information carried in the received network configuration information message in response to receiving a network configuration information message broadcasted and sent by the first network device that is currently connected to the first wireless network; wherein the network configuration information message broadcasted and sent by the first network device is: a network configuration information message received and sent by other network devices that have been connected to the first wireless network and carries the network configuration information of the first wireless network; The second access module is used to access the first wireless network by using the extracted network configuration information.
25. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, for implementing any of the methods described in claims 1-21 when executing a program stored in a memory.
26. 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 21 is implemented.