CN-116321358-B - Network distribution method, device, equipment and medium
Abstract
The network distribution method, device, equipment and medium provided by the embodiment of the application comprise the steps of receiving a first data packet broadcast by second electronic equipment, wherein the first data packet carries equipment information of the second electronic equipment, the equipment information comprises equipment identification information, determining target equipment in the second electronic equipment, acquiring login information of a target network, broadcasting a second data packet to the target equipment according to the equipment information of the target equipment and the login information of the target network, and the second data packet comprises the equipment information of the target equipment and the login information of the target network. Because the broadcasted second data packet carries the identification information of the target device, the target device can accurately acquire the second data packet, and further, the login information of the target network can be acquired in the second data packet, so that the network distribution efficiency of the target device is improved.
Inventors
- YANG ZONGXIN
- ZHAO JING
- PENG JIBING
- KONG JUNJIE
- HOU TAO
- MENG LINA
Assignees
- 珠海奔图电子有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20221208
Claims (20)
- 1. A method for distributing a network, applied to a first electronic device, the method comprising: receiving a first data packet broadcast by a second electronic device, wherein the first data packet carries device information of the second electronic device; Determining a target device based on device information of the second electronic device; acquiring login information of a target network, and broadcasting a second data packet to the target device according to the device information of the target device and the login information of the target network, wherein the second data packet comprises the device information of the target device and the login information of the target network; before broadcasting the second data packet to the target device according to the device information of the target device and the login information of the target network, the method further comprises: and establishing connection with the target equipment according to the equipment identification information of the target equipment, and sending a start scanning instruction to the target equipment through the connection, wherein the start scanning instruction is used for indicating the target equipment to enter a scanning state.
- 2. The method as recited in claim 1, further comprising: and acquiring network distribution result information of the target equipment.
- 3. The method of claim 1, wherein broadcasting the second data packet to the target device according to the device information of the target device and the login information of the target network comprises: Splitting the login information of the target network into a preset number of second data packets according to a preset packetizing rule, wherein each second data packet carries the equipment information of the target equipment; Broadcasting the preset number of second data packets to the target device.
- 4. The method of claim 3, wherein each second data packet further carries at least one of a preset number of information, index information, and random number information generated by the first electronic device.
- 5. The method of claim 3, wherein broadcasting the preset number of second data packets to the target device comprises: encrypting the second data packets with the preset number according to a preset encryption key; broadcasting the preset number of encrypted second data packets to the target device.
- 6. The method of claim 3, wherein broadcasting the preset number of second data packets to the target device comprises: And broadcasting the second data packets with the preset number to the target equipment according to the preset time interval, wherein the broadcasting order of the second data packets with the preset number is preset or randomly determined, and the broadcasting order of each second data packet is the same as or different from the index information of the second data packet.
- 7. The method of claim 5, wherein the predetermined encryption key is device information or other encryption key obtained from the target device.
- 8. The method of claim 2, wherein the obtaining the network configuration result information of the target device comprises: Receiving a third data packet broadcast by the target device, acquiring the network configuration result information based on the third data packet, The third data packet comprises distribution network state information of the target equipment, wherein the distribution network state information is used for representing the access state of the target equipment to the target network, or The third data packet comprises a random number of the first electronic device and a distribution network state identification bit, wherein the distribution network state identification bit is used for marking the access state of the target device to the target network, or The third data packet comprises an Internet Protocol (IP) address used for representing a distribution network state, wherein the IP address is an IP address of the target device when the target device is in a distribution network success state, the IP address is a first reserved IP address when the target device is in a non-distribution network state or a distribution network failure state, the IP address is a second reserved IP address when the target device is in a distribution network in-process state, and the first reserved IP address and the second reserved IP address are different from the IP address of the target device.
- 9. The method according to claim 1 or 8, wherein the first, second and third data packets comprise at least one BLE broadcast packet.
- 10. The method according to claim 8 or 9, further comprising: If the network distribution result information sent by the target equipment is not received within a first preset time, acquiring equipment identification information of the target equipment, and searching the target equipment in the target network according to the equipment identification information of the target equipment; if the target equipment is searched in the second preset time, the successful distribution network is determined, otherwise, the failure of the distribution network is determined.
- 11. The method of claim 2, wherein the obtaining the network configuration result information of the target device comprises: Broadcasting the IP address and the port number of the first electronic equipment to target equipment; if a Transmission Control Protocol (TCP) connection establishment request message sent by the target equipment is received, establishing TCP connection with the target equipment; And receiving network distribution result information through the TCP connection.
- 12. The method of claim 2, wherein the obtaining the network configuration result information of the target device comprises: Establishing wireless connection with the target device; And acquiring the network distribution result information of the target equipment through the wireless connection.
- 13. The method of claim 2, wherein the obtaining the network configuration result information of the target device comprises: acquiring equipment identification information of the target equipment, and searching the target equipment in the target network according to the equipment identification information of the target equipment; If the target equipment is searched in the third preset time, the network allocation is successful, otherwise, the network allocation fails.
- 14. The method as recited in claim 1, further comprising: And displaying indication information of the distribution network result to the user.
- 15. The method of claim 14, wherein displaying the indication of the network configuration result to the user comprises: Displaying information indicating the display state of the network signal lamp of the user observation target equipment to the user or And when the target equipment is successfully allocated to the network, displaying equipment information of the target equipment to the user.
- 16. The method of claim 1, further comprising, prior to broadcasting the second data packet to the target device based on the device identification information of the target device and the login information of the target network: and sending prompt information to the user, wherein the prompt information is used for prompting the user to trigger the target equipment to enter a scanning state.
- 17. The method of claim 1, wherein the determining a target device based on device information of the second electronic device comprises: And determining a target device based on the device information of the second electronic device in response to a selection operation of the user.
- 18. The method of claim 1, wherein the obtaining login information for the target network comprises: When the first electronic equipment accesses to the network, determining the network accessed by the first electronic equipment as a target network, and acquiring login information of the target network, or When the first electronic equipment is not connected to the network, the login information of the target network is acquired in response to the input operation of the login information of the user.
- 19. A method of distribution of network, characterized by being applied to a target device, the method comprising: Broadcasting a first data packet to first electronic equipment, wherein the first data packet carries equipment information of the target equipment; Acquiring a second data packet broadcast by the first electronic equipment, wherein the second data packet comprises equipment information and login information of a target network; When the equipment information in the second data packet is the equipment information of the target equipment, acquiring login information of a target network contained in the second data packet, and accessing the target network based on the login information of the target network; before the second data packet broadcasted by the first electronic device is acquired, the method further comprises: And establishing connection with the first electronic equipment, receiving a start scanning instruction sent by the first electronic equipment through the connection, responding to the start scanning instruction, and entering a scanning state.
- 20. The method as recited in claim 19, further comprising: And sending distribution network result information to the first electronic equipment.
Description
Network distribution method, device, equipment and medium Technical Field The present application relates to the field of communications technologies, and in particular, to a network allocation method, device, equipment, and medium. Background With the popularization of internet of things and internet technology, more and more devices have access capability to wireless networks. Most of the devices have the characteristics of miniaturization and low power consumption, input devices such as a touch screen, a keyboard and the like are not configured in the devices, the devices cannot be directly connected with each other, and the intelligent terminals such as mobile phones are required to send network login information to the devices. In the prior art, when equipment needs to be distributed, two distribution modes are generally adopted for realizing the distribution. The first network distribution mode is that connection is established between the intelligent terminal and the equipment, and login information of the target network is sent to the equipment through the established connection so that the equipment can access the target network according to the received login information. The second mode is that the network allocation information is transmitted by adopting a broadcasting protocol, namely, the intelligent terminal broadcasts the login information in a broadcasting mode so that the equipment can receive the login information to access the target network. However, for the above two network configuration implementation manners, in the first manner, when there are multiple devices that need to transmit the login information of the network, connection between the intelligent terminal and the devices is required to be established first when the network is configured each time, and the connection can be disconnected after the login information is transmitted, so that the login information cannot be transmitted to the multiple devices in a short time, which may result in low network configuration efficiency. In a complex network environment, the equipment cannot easily capture correct login information, so that the network distribution efficiency is not high. Disclosure of Invention In view of this, the present application provides a network distribution method, device, apparatus and medium, so as to solve the problem of low network distribution efficiency in the prior art. In a first aspect, an embodiment of the present application provides a network allocation method, which is applied to a first electronic device, where the method includes: receiving a first data packet broadcast by a second electronic device, wherein the first data packet carries device information of the second electronic device; Determining a target device based on device information of the second electronic device; Acquiring login information of a target network, broadcasting a second data packet to the target device according to the device information of the target device and the login information of the target network, wherein the second data packet comprises the device information of the target device and the login information of the target network. With reference to the first aspect, in a possible implementation manner, the method further includes: and acquiring network distribution result information of the target equipment. With reference to the first aspect, in a possible implementation manner, the determining, in the second electronic device, the target device includes: And responding to the selection operation of the user, and determining the target equipment in the second electronic equipment. With reference to the first aspect, in a possible implementation manner, the obtaining login information of the target network includes: When the first electronic equipment accesses to the network, determining the network accessed by the first electronic equipment as a target network, and acquiring login information of the target network, or When the first electronic equipment is not connected to the network, the login information of the target network is acquired in response to the input operation of the login information of the user. With reference to the first aspect, in a possible implementation manner, the broadcasting, to the target device, the second data packet according to the device information of the target device and the login information of the target network includes: Splitting the login information of the target network into a preset number of second data packets according to a preset packetizing rule, wherein each second data packet carries the equipment information of the target equipment; Broadcasting the preset number of second data packets to the target device. With reference to the first aspect, in a possible implementation manner, each second data packet further carries at least one of preset number information, index information and random number information generated by the first electronic device. With referen