CN111918365B - Network distribution method, device and system of Internet of things and storage medium - Google Patents
Network distribution method, device and system of Internet of things and storage medium Download PDFInfo
- Publication number
- CN111918365B CN111918365B CN202010736477.1A CN202010736477A CN111918365B CN 111918365 B CN111918365 B CN 111918365B CN 202010736477 A CN202010736477 A CN 202010736477A CN 111918365 B CN111918365 B CN 111918365B
- Authority
- CN
- China
- Prior art keywords
- port
- offset
- internet
- things
- broadcast packet
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W48/00—Access restriction; Network selection; Access point selection
- H04W48/18—Selecting a network or a communication service
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/06—Selective distribution of broadcast services, e.g. multimedia broadcast multicast service [MBMS]; Services to user groups; One-way selective calling services
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention provides a network distribution method, a device, a system and a storage medium of the Internet of things, which relate to the technical field of network distribution and comprise the following steps: the method comprises the steps that the Internet of things equipment enters a promiscuous mode to monitor broadcast packets received by a first port of the Internet of things equipment, wherein a terminal sends a plurality of broadcast packets to the first port of the Internet of things equipment through a router, and each broadcast packet contains different port offsets; the Internet of things equipment is connected to the router according to the broadcast packet received by the first port, and sends a distribution network success broadcast packet to the terminal through the router according to the port offset, wherein the terminal sets a plurality of offset ports according to the port offset, and when the distribution network success broadcast packet received by at least one offset port, the distribution network is successful. According to the invention, the plurality of ports are arranged through the offset to receive the successful packet of the distribution network, so that the phenomenon of distribution network failure caused by the occupation of a single port is prevented, and the high efficiency and the success rate of the distribution network are ensured.
Description
Technical Field
The invention relates to the technical field of distribution networks, in particular to a network distribution method, device and system of the Internet of things and a storage medium.
Background
SmartConfig (network distribution by one key) is a common network distribution method of Internet of things equipment, and the principle is as follows: the method comprises the steps that a network distribution mode is started by Internet of things equipment (such as an air conditioner, a television and the like), a network card monitors a broadcast packet received by a designated port, a terminal sends an ssid (service set identifier) and a password of a router in the current environment through router broadcasting, the equipment is connected with the router after monitoring data packets of the router ssid and the password, the Internet of things equipment sends a network distribution success broadcast packet to the designated port of the terminal, and when the terminal monitors the network distribution success broadcast packet, the whole network distribution process is completed.
However, the SmartConfig network distribution technology is prone to a phenomenon that the network distribution fails all the time, because the port of the terminal for receiving the successful broadcast packet of the network distribution is single and is dead, and the terminal cannot receive the successful broadcast packet of the network distribution when the terminal is occupied. For example, when the terminal is a mobile phone APP, a port of the terminal for receiving a distribution network successful broadcast packet is occupied by a system or other application software, and even if the internet of things device sends the distribution network successful broadcast packet to the mobile phone APP for many times, the mobile phone APP still cannot receive the distribution network, which leads to the failure of the distribution network. Therefore, the existing SmartConfig network distribution technology has the phenomenon that a port is occupied and the network distribution is unsuccessful, has high delay, low success rate and lack of high efficiency and timeliness, and brings inconvenience to users.
Disclosure of Invention
The invention solves the problems of how to prevent ports from being occupied in the process of distribution and how to improve the success rate of distribution.
In order to solve the problems, the invention provides a network distribution method of the internet of things, which is applied to internet of things equipment and comprises the following steps:
the method comprises the steps that the Internet of things equipment enters a promiscuous mode to monitor broadcast packets received by a first port of the Internet of things equipment, wherein a terminal sends a plurality of broadcast packets to the first port of the Internet of things equipment through a router, and each broadcast packet contains different port offsets;
the Internet of things equipment is connected to the router according to the broadcast packet received by the first port, and sends a distribution network success broadcast packet to the terminal through the router according to the port offset, wherein the terminal sets a plurality of offset ports according to the port offset, and when at least one offset port receives the distribution network success broadcast packet, the distribution network is successful.
Therefore, the invention utilizes the terminal to send a plurality of broadcast packets containing the port offset to the Internet of things equipment, establishes a plurality of random offset ports according to the port offset, and can send the distribution network success broadcast packet to the plurality of random offset ports of the terminal according to the port offset when the Internet of things equipment receives and analyzes the port offset in the broadcast packet. In conclusion, the invention establishes an effective random port mechanism by using the port offset, sets a plurality of random offset ports to receive the successful packet of the distribution network through the port offset, prevents the phenomenon of distribution network failure caused by the occupation of a single port, ensures the high efficiency and the success rate of the distribution network, and is convenient for users to use.
Further, in the step that the internet of things device is connected to the router according to the broadcast packet received by the first port, and sends a distribution network successful broadcast packet to the terminal through the router according to the port offset therein, the method includes:
when the Internet of things equipment monitors a plurality of broadcast packets received by the first port, the port offset corresponding to each broadcast packet is analyzed;
the Internet of things equipment determines the offset port corresponding to each broadcast packet according to the port offset corresponding to each broadcast packet;
and the Internet of things equipment sends the distribution network success broadcast packet to each offset port through the router.
Therefore, the internet of things equipment sends the distribution network success broadcast packet to the plurality of offset ports according to the analyzed port offset, so that the distribution network success probability is effectively increased.
Further, in the step of determining, by the internet of things device, the offset port corresponding to each broadcast packet according to the port offset, the method includes:
and the Internet of things equipment respectively adds the port number of a preset second port to the port offset corresponding to each broadcast packet so as to determine the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal.
Therefore, the second port is the appointed port locked by the terminal, so that a plurality of random offset ports can be effectively established according to the port number of the second port and the random port offset, the probability of receiving the successful packet of the distribution network is increased, and the success rate of the distribution network is effectively improved.
The invention also aims to provide a distribution network device of the internet of things, wherein a plurality of random ports are arranged according to the over-offset to receive a distribution network success packet, so that the phenomenon of distribution network failure caused by the occupation of a single port is prevented, and the high efficiency and the success rate of the distribution network are ensured.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the utility model provides a net device is joined in marriage to thing networking, is applied to thing networking equipment, includes:
a first receiving unit: the terminal is used for entering a promiscuous mode to monitor a broadcast packet received by a first port of the Internet of things equipment, wherein the terminal sends a plurality of broadcast packets to the first port through a router, and each broadcast packet contains mutually different port offsets;
a first transmission unit: the router is used for connecting the broadcast packet received by the first port to the router, and sending a distribution network successful broadcast packet to the terminal through the router according to the port offset, wherein the terminal sets a plurality of offset ports according to the port offset, and when at least one offset port receives the distribution network successful broadcast packet, the distribution network is successful.
Compared with the prior art, the network distribution device of the Internet of things and the network distribution method of the Internet of things have the same beneficial effects, and are not repeated herein.
The third purpose of the invention is to provide a network distribution method of the internet of things, which is applied to a terminal and comprises the following steps:
the terminal sends a plurality of broadcast packets to a first port of the Internet of things equipment through a router, wherein each broadcast packet comprises different port offsets, and the Internet of things equipment enters a promiscuous mode to monitor the broadcast packets received by the first port of the Internet of things equipment;
the terminal sets a plurality of offset ports according to the port offset, when at least one offset port receives a broadcast packet which is successfully distributed with the network, the network is successfully distributed, wherein the Internet of things equipment is connected to the router according to the broadcast packet received by the first port, and sends the broadcast packet which is successfully distributed with the network to the terminal through the router according to the port offset.
Therefore, the terminal is used for sending a plurality of broadcast packets containing the port offset to the Internet of things equipment, a plurality of random offset ports are established according to the port offset, and when the Internet of things equipment receives and analyzes the port offset in the broadcast packets, the distribution network success broadcast packets can be sent to the plurality of random offset ports of the terminal according to the port offset. In conclusion, the invention establishes an effective random port mechanism by using the port offset, sets a plurality of random offset ports to receive the successful distribution network packet by using the port offset, prevents the phenomenon of distribution network failure caused by the occupation of a single port, ensures the high efficiency and the success rate of the distribution network, and is convenient for users to use.
Further, the step of setting, by the terminal, a plurality of offset ports according to the port offset includes:
and the terminal respectively adds the port offset corresponding to each broadcast packet to the port number of a preset second port to set the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal.
Therefore, the second port is a designated port locked by the terminal, so that a plurality of random offset ports can be effectively established according to the port number of the second port and the random port offset, the probability of receiving distribution network successful packets is increased, and the distribution network success rate is effectively improved.
Further, the offset port is a temporary port used by the terminal to receive the distribution network successful broadcast packet, and the port number of the offset port is determined by adding the port number of the second port to the corresponding port offset.
Therefore, various different port numbers can be determined according to the port number of the second port and different random port offsets, so that a plurality of random offset ports are established for temporarily receiving the distribution network successful packet, the probability of receiving the distribution network successful packet is increased, and the distribution network success rate is effectively improved.
The fourth purpose of the invention is to provide a network distribution device of the internet of things, which is applied to a terminal, and is provided with a plurality of random ports according to the over-offset to receive a network distribution success packet, so that the phenomenon that the network distribution fails due to the occupation of a single port is prevented, and the high efficiency and the success rate of the network distribution are ensured.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the utility model provides a net device is joined in marriage to thing networking, is applied to the terminal, includes:
a second transmitting unit: the router is used for sending a plurality of broadcast packets to a first port of the Internet of things equipment, wherein each broadcast packet comprises different port offsets, and the Internet of things equipment enters a promiscuous mode to monitor the broadcast packets received by the first port of the Internet of things equipment;
a second receiving unit: the device comprises a plurality of offset ports according to the port offset, when at least one offset port receives a distribution network successful broadcast packet, the distribution network is successful, wherein the internet of things device is connected to the router according to the broadcast packet received by the first port, and the distribution network successful broadcast packet is sent to the terminal through the router according to the port offset.
Compared with the prior art, the network distribution device of the Internet of things and the network distribution method of the Internet of things have the same beneficial effects, and are not repeated herein.
The fifth purpose of the invention is to provide the internet of things equipment, wherein a plurality of random ports are arranged according to the over-offset to receive the successful packet of the distribution network, so that the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the high efficiency and the success rate of the distribution network are ensured.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
an internet of things device comprises a processor and a computer readable storage medium storing a computer program, wherein the computer program is read by the processor and executed to implement the internet of things network distribution method applied to the internet of things device.
Compared with the prior art, the network distribution method of the internet of things equipment and the internet of things applied to the internet of things equipment has the same beneficial effects, and the details are not repeated herein.
A sixth object of the present invention is to provide a terminal, wherein multiple random ports are set according to an over-offset to receive a distribution network success packet, so as to prevent a distribution network failure phenomenon caused by a single port being occupied, and ensure high efficiency and success rate of a distribution network.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a terminal comprising a processor and a computer readable storage medium storing a computer program, the computer program being read by the processor and executed to implement the network distribution method applied to the internet of things of the terminal as described above.
Compared with the prior art, the terminal and the network distribution method applied to the internet of things of the terminal have the same beneficial effects, and are not repeated herein.
The seventh purpose of the invention is to provide a distribution network system of the internet of things, wherein a plurality of random ports are arranged according to the over-offset to receive a distribution network success packet, so that the phenomenon of distribution network failure caused by the occupation of a single port is prevented, and the high efficiency and the success rate of the distribution network are ensured.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a network distribution system of the Internet of things comprises a router, the Internet of things equipment and the terminal.
Compared with the prior art, the network distribution system of the internet of things and the network distribution method of the internet of things have the same beneficial effects, and are not repeated herein.
An eighth objective of the present invention is to provide a computer-readable storage medium, wherein multiple random ports are set according to an over-offset to receive a distribution network success packet, so as to prevent a distribution network failure phenomenon caused by a single port being occupied, and ensure high efficiency and success rate of the distribution network.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
a computer-readable storage medium, storing a computer program which, when read and executed by a processor, implements the method for network distribution for the internet of things as described above, or implements the method for network distribution for the internet of things as described above, as applied to a device of the internet of things, or implements the method for network distribution for the internet of things as described above, as applied to a terminal.
The computer-readable storage medium has the same beneficial effects as the distribution network method of the internet of things in comparison with the prior art, and is not described herein again.
Drawings
Fig. 1 is a signaling diagram of a distribution network technology of the prior SmartConfig;
fig. 2 is a schematic flow chart illustrating a network distribution method applied to an internet of things device according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating a process of sending a distribution network success packet according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a network distribution device of the internet of things applied to the internet of things device according to the embodiment of the present invention;
fig. 5 is a schematic flow chart illustrating a network distribution method of the internet of things applied to a terminal according to the embodiment of the present invention;
fig. 6 is a signaling diagram of an overall distribution network according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a network distribution device of the internet of things applied to a terminal according to an embodiment of the present invention.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below.
SmartConfig is a common network distribution method for internet of things devices, fig. 1 shows a signaling schematic diagram of the existing network distribution technology for SmartConfig, and the principle is described with reference to fig. 1, in fig. 1, a terminal is a mobile phone APP, P1 is a fixed port of an internet of things device, and P2 is a fixed port of the mobile phone APP, including steps S1001 to S1008, where:
in step S1001, the internet of things device enters a promiscuous mode, and monitors a data packet received by the fixed port P1;
in step S1002, the mobile phone APP sends a data packet containing the ssid and password to the fixed port P1;
in step S1003, the router forwards the data packet sent by the mobile phone APP to the internet of things device;
in step S1004, a fixed port P1 of the internet of things device receives the data packet, and connects to the router according to the ssid and password in the data packet;
in step S1005, the mobile phone APP monitors a data packet received by the fixed port P2;
in step S1006, the internet of things device sends a distribution network success broadcast packet to the fixed port P2 of the mobile phone APP;
in step S1007, the router forwards a distribution network success broadcast packet sent by the internet of things device to the mobile phone APP;
in step S1008, when the fixed port P2 of the mobile phone APP receives the distribution network success broadcast packet, the distribution network succeeds.
However, the SmartConfig distribution network technology is prone to a phenomenon that the distribution network fails all the time, because a port (i.e., the fixed port P2 in fig. 1) through which the terminal receives the distribution network successful broadcast packet is single and is dead, and when the single receiving port is occupied, the terminal cannot receive the distribution network successful broadcast packet. For example, in fig. 1, when the terminal is a mobile APP, the fixed port P2 of the terminal that receives the distribution network successful broadcast packet is occupied by the system or another application, and once the fixed port P2 is occupied, even if the internet of things device sends the distribution network successful broadcast packet to the mobile APP for many times, the mobile APP still cannot receive the distribution network, which results in that the distribution network always fails. Therefore, the existing SmartConfig network distribution technology has the phenomenon that a port is occupied and the network distribution is unsuccessful, has high delay, low success rate and lack of high efficiency and timeliness, and brings inconvenience to users. In conclusion, how to prevent the ports from being occupied and improve the success rate of the distribution network in the process of the distribution network is a problem to be solved urgently.
Fig. 2 is a schematic flow chart of a network distribution method applied to an internet of things device according to an embodiment of the present invention, which includes steps S101 to S102, where:
in step S101, the internet of things device enters a promiscuous mode to monitor a broadcast packet received by the first port of the internet of things device, where the terminal sends a plurality of broadcast packets to the first port of the internet of things device via the router, and each broadcast packet includes different port offsets. Therefore, the Internet of things equipment is effectively networked by monitoring the broadcast packet received by the fixed first port.
In step S102, the internet of things device is connected to the router according to the broadcast packet received by the first port, and sends a distribution network success broadcast packet to the terminal through the router according to the port offset therein, where the terminal sets a plurality of offset ports according to the port offset, and when at least one offset port receives the distribution network success broadcast packet, the distribution network succeeds. Therefore, the terminal is provided with the plurality of random offset ports, the internet of things equipment sends the distribution network success broadcast packet to the plurality of offset ports, the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the terminal can timely and effectively receive the distribution network success packet.
The distribution network mode all adopts a UDP (User Datagram Protocol) broadcast Protocol. The UDP broadcast protocol needs to know port numbers of opposite parties, the first port is a port of an internet of things device, the second port is a port of a terminal, and the two ports are ports determined by an engineer in a development stage. The Internet of things equipment and the terminal monitor the first port and the second port respectively, and data packets transmitted by the opposite side and forwarded by the router can be obtained. Because the port of the Internet of things equipment is not occupied and the port of the terminal is very easy to be occupied, the invention establishes a plurality of random offset ports so as to receive the successful broadcast packet of the distribution network and prevent the phenomenon that the successful broadcast packet of the distribution network cannot be received because the fixed second port is occupied.
The broadcasting packet is a data packet comprising an ssid and a password, and when the internet of things equipment receives the broadcasting packet through the first port, the internet of things equipment is connected with the router according to the ssid and the password, so that effective distribution network connection is guaranteed.
According to the method, the terminal is used for sending a plurality of broadcast packets containing the port offset to the Internet of things equipment, a plurality of random offset ports are established according to the port offset, and when the Internet of things equipment receives and analyzes the port offset in the broadcast packets, the distribution network success broadcast packets can be sent to the plurality of random offset ports of the terminal according to the port offset. In conclusion, the invention establishes an effective random port mechanism by using the port offset, sets a plurality of random offset ports to receive the successful packet of the distribution network through the port offset, prevents the phenomenon of distribution network failure caused by the occupation of a single port, ensures the high efficiency and the success rate of the distribution network, and is convenient for users to use.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating a process of sending a distribution network success packet according to an embodiment of the present invention, where step S102 includes steps S1021 to S1023, where:
in step S1021, when the internet of things device monitors a plurality of broadcast packets received by the first port, a port offset corresponding to each broadcast packet is analyzed. Therefore, the Internet of things equipment effectively sends the distribution network success packet according to the port offset.
In the development process, a byte with a fixed position is added in a broadcast packet protocol, the byte is the port offset, and when the internet of things equipment receives a broadcast packet, the corresponding port offset can be directly obtained from a data stream according to the fixed position of the data stream.
In step S1022, the internet of things device determines, according to the port offset corresponding to each broadcast packet, an offset port corresponding to each broadcast packet. Therefore, the Internet of things equipment determines the corresponding offset port according to the port offset, and accordingly sends the distribution network success broadcast packet to the plurality of random offset ports.
In step S1023, the internet of things device sends a distribution network success broadcast packet to each offset port via the router. Therefore, the internet of things equipment sends distribution network success broadcast packets to the offset ports according to the analysis result, and the distribution network success probability is effectively increased.
Optionally, in the step of determining, by the internet of things device, an offset port corresponding to each broadcast packet according to the port offset, the method includes: and the Internet of things equipment respectively adds the port number of a preset second port to the port offset corresponding to each broadcast packet to determine the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal. Therefore, the second port is a designated port locked by the terminal, so that a plurality of random offset ports can be effectively established according to the second port and random port offset, the probability of receiving successful packets of the distribution network is increased, and the success rate of the distribution network is effectively improved.
Optionally, the second port is a port used by the terminal in the original SmartConfig technology to listen to a distribution network successfully broadcast packet, and the port offset is a self-increasing or random number. Different offset is added on the basis of the port number of the original second port, so that a plurality of temporary random ports are derived, the difference and the randomness of the offset ports established corresponding to each broadcast packet are ensured, and the success rate of the distribution network is effectively improved. For example, if the port number of the second port is 10101010 and the port offset of a broadcast packet is 1, the port number of the offset port of the broadcast packet is determined by adding the corresponding port offset to the port number of the second port, which is 10101011.
To illustrate with a specific numerical example, when a terminal sends three broadcast packets to a first port: the method comprises a first broadcast packet, a second broadcast packet and a third broadcast packet, wherein a first port offset contained in the first broadcast packet is portOffset _1, a second port offset contained in the second broadcast packet is portOffset _2, a third port offset contained in the third broadcast packet is portOffset _3, the port offsets are different from each other, a second port of a terminal is P2, and the determination process of the corresponding offset ports is as follows:
a first offset port corresponding to the first broadcast packet is P4, the first offset port P4 is a random port determined by adding the port number of the second port P2 to the offset portOffset _1 of the first port, and at this time, the port number of the first offset port P4 is (port number of P2 + portOffset _ 1);
the second offset port corresponding to the second broadcast packet is P5, the second offset port P5 is a random port determined by adding the port number of the second port P2 to the second port offset portOffset _2, and at this time, the port number of the second offset port P5 is (port number + portOffset _2 of P2);
the third offset port corresponding to the third broadcast packet is P6, and the third offset port P6 is a random port determined by adding the third port offset portOffset _3 to the port number of the second port P2, where the port number of the third offset port P6 is (port number of P2 + portOffset _ 3).
Wherein the first port offset portOffset _1 、 The second port offset portOffset _2 and the third port offset portOffset _3 are random quantities in the corresponding broadcast packet, and may be different numbers added by itself or different numbers randomly. Therefore, the first offset port P4 corresponding to the first broadcast packet, and the second broadcast packetThe corresponding second offset port P5 and the third offset port P6 corresponding to the third broadcast packet are different from each other, so that randomness and difference of port offset are effectively utilized, and a plurality of random offset ports are established. When the internet of things equipment sends a distribution network success broadcast packet to a plurality of random offset ports, as long as one random offset port of a first offset port P4 corresponding to a first broadcast packet, a second offset port P5 corresponding to a second broadcast packet and a third offset port P6 corresponding to a third broadcast packet is received, the distribution network can be considered to be successful, and the phenomenon that the distribution network fails due to the fact that a second port P2 is occupied is avoided.
According to the distribution network method applied to the Internet of things of the Internet of things equipment, the plurality of ports are arranged through the offset to receive the successful distribution network packet, the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the high efficiency and the success rate of the distribution network are guaranteed.
Fig. 4 is a schematic structural diagram of a distribution network apparatus 400 of the internet of things applied to an apparatus of the internet of things according to an embodiment of the present invention, and the distribution network apparatus includes a first receiving unit 401 and a first sending unit 402, where:
the first receiving unit 401: the terminal is used for entering a promiscuous mode to monitor a broadcast packet received by a first port of the Internet of things equipment, wherein the terminal sends a plurality of broadcast packets to the first port through the router, and each broadcast packet contains different port offsets;
first transmission unit 402: the distribution network successful broadcast packet sending method comprises the steps that a broadcast packet received by a first port is connected to a router, and a distribution network successful broadcast packet is sent to a terminal through the router according to port offset, wherein the terminal sets a plurality of offset ports according to the port offset, and when at least one offset port receives the distribution network successful broadcast packet, the distribution network is successful.
According to the distribution network device applied to the Internet of things equipment, the plurality of ports are arranged through the offset to receive the successful distribution network packet, the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the high efficiency and the success rate of the distribution network are guaranteed.
Fig. 5 is a schematic flow chart of a network distribution method applied to the internet of things of a terminal according to an embodiment of the present invention, which includes steps S201 to S202, where:
in step S201, the terminal sends a plurality of broadcast packets to the first port of the internet of things device via the router, where each broadcast packet includes a port offset that is different from each other, and the internet of things device enters a promiscuous mode to monitor the broadcast packet received by the first port of the internet of things device. Therefore, the terminal sends the broadcast packet, and the Internet of things equipment effectively performs networking by monitoring the broadcast packet received by the fixed first port.
In step S202, the terminal sets a plurality of offset ports according to the port offset, and when at least one offset port receives a distribution network success broadcast packet, the distribution network succeeds, wherein the internet of things device is connected to the router according to the broadcast packet received by the first port, and sends the distribution network success broadcast packet to the terminal via the router according to the port offset therein. Therefore, the terminal is provided with the plurality of random offset ports, the internet of things equipment sends the distribution network success broadcast packet to the plurality of offset ports, the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the terminal can timely and effectively receive the distribution network success packet.
The distribution network mode adopts a UDP broadcast protocol. The UDP broadcast protocol needs to know the port number of the other party, the first port is a port of the internet of things device, the second port is a port of the terminal, and the two ports are ports determined by an engineer in a development stage. The Internet of things equipment and the terminal monitor the first port and the second port respectively, and data packets transmitted by the opposite side and forwarded by the router can be obtained. In practical application, the first port of the internet of things device is not occupied basically, and the second port of the terminal is easy to be occupied by other applications. The invention establishes a plurality of random offset ports so as to receive the successful broadcast packet of the distribution network and prevent the phenomenon that the fixed second port is occupied and cannot receive the successful broadcast packet of the distribution network.
The broadcasting packet is a data packet comprising an ssid and a password, and when the internet of things equipment receives the broadcasting packet through the first port, the internet of things equipment is connected with the router according to the ssid and the password, so that effective distribution network connection is guaranteed.
According to the method, the terminal is used for sending a plurality of broadcast packets containing port offset to the Internet of things equipment, a plurality of random offset ports are established according to the port offset, and when the Internet of things equipment receives and analyzes the port offset in the broadcast packets, distribution network success broadcast packets can be sent to the plurality of random offset ports of the terminal according to the port offset. In conclusion, the invention establishes an effective random port mechanism by using the port offset, sets a plurality of random offset ports to receive the successful packet of the distribution network through the port offset, prevents the phenomenon of distribution network failure caused by the occupation of a single port, ensures the high efficiency and the success rate of the distribution network, and is convenient for users to use.
Optionally, in the step that the terminal sets a plurality of offset ports according to the port offset, the method specifically includes: and the terminal respectively adds the port number of a preset second port to the port offset corresponding to each broadcast packet to set the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal. Therefore, the second port is a designated port locked by the terminal, so that a plurality of random offset ports can be effectively established according to the second port and random port offset, the probability of receiving successful packets of the distribution network is increased, and the success rate of the distribution network is effectively improved. The second port is a port used by the terminal for monitoring the successful broadcast packet of the distribution network in the original SmartConfig technology, and the port offset is a self-increasing or random number. Therefore, the difference and the randomness of the offset ports correspondingly established by each broadcast packet are ensured, and the success rate of the distribution network is effectively improved. For example, reference is made to the above text for related numerical values, which are not described herein again.
Optionally, the offset port is a temporary port used by the terminal to receive the distribution network successful broadcast packet, and the port number of the offset port is determined by adding the port number of the second port to a corresponding port offset. Therefore, various different port numbers can be determined according to the port number of the second port and different random port offsets, so that a plurality of random offset ports are established for temporarily receiving the distribution network successful packet, the probability of receiving the distribution network successful packet is increased, and the distribution network success rate is effectively improved.
Optionally, the internet of things device is an air conditioner, a television and other smart homes, but not limited thereto, the corresponding communication connection function may be completed.
Optionally, the terminal is a mobile phone, a computer, or other device equipped with a specific APP, but is not limited thereto, and may be capable of completing the corresponding communication connection function.
In a specific embodiment of the present invention, with reference to fig. 6, fig. 6 is a schematic signaling diagram of an overall distribution network according to the embodiment of the present invention, where a terminal is a mobile phone installed with a specific APP, and an internet of things device is a network card configured for an air conditioner, where P1 is a fixed port of the air conditioner, and P2 is a fixed port of the APP of the mobile phone. By combining the network distribution method applied to the Internet of things equipment and the network distribution method applied to the terminal, the overall network distribution process is as follows:
in step S1, the network card enters a promiscuous mode to monitor a broadcast packet received by the first port P1;
in step S2, the mobile phone APP sends a plurality of broadcast packets to the first port P1. Wherein each broadcast packet comprises different port offsets, and each broadcast packet comprises an ssid and a password;
in step S3, the router forwards the broadcast packet sent by the mobile phone APP to the network card;
in step S4, when the network card receives the broadcast packet and is connected to the router, the port offset corresponding to each broadcast packet is analyzed. When receiving the broadcast packet, the network card is connected to the router according to the ssid and password contained in the broadcast packet, and the port offset corresponding to each broadcast packet is analyzed at the same time, so that the subsequent distribution network can successfully send the broadcast packet;
in step S5, the mobile phone APP monitors distribution network successful broadcast packets received by the multiple offset ports, wherein the mobile phone APP sets the offset port corresponding to each broadcast packet according to the sum of the port offset corresponding to each broadcast packet and the second port P2, so as to ensure that the multiple offset ports can receive the distribution network successful broadcast packets;
in step S6, the network card sends a distribution network success broadcast packet to the mobile phone APP according to the port offset therein, wherein the network card determines an offset port corresponding to each broadcast packet according to the port offset corresponding to each broadcast packet, and sends a distribution network success broadcast packet to each offset port;
in step S7, the router forwards the broadcast packet sent by the mobile phone APP to the network card;
in step S8, if at least one offset port of the mobile APP receives the distribution network success broadcast packet, the distribution network is considered to be successful. Therefore, the distribution network with high success rate is finally and effectively completed.
According to the network distribution method applied to the Internet of things of the terminal, the plurality of ports are arranged through the offset to receive the successful network distribution packet, the phenomenon that the network distribution fails due to the fact that a single port is occupied is prevented, and the high efficiency and the success rate of the network distribution are guaranteed.
Fig. 7 is a schematic structural diagram of a distribution network device 700 applied to the internet of things of a terminal according to an embodiment of the present invention, and the distribution network device includes a second sending unit 701 and a second receiving unit 702, where:
a second sending unit 701, configured to send, via the router, a plurality of broadcast packets to the first port of the internet of things device, where each broadcast packet includes port offsets that are different from each other, and the internet of things device enters a promiscuous mode to monitor the broadcast packet received by the first port of the internet of things device;
a second receiving unit 702, configured to set multiple offset ports according to port offset, and when at least one offset port receives a distribution network successful broadcast packet, the distribution network is successful, where the internet of things device connects to the router according to the broadcast packet received by the first port, and sends the distribution network successful broadcast packet to the terminal via the router according to the port offset therein.
The distribution network device of the Internet of things is applied to a terminal, and the plurality of ports are arranged through the offset to receive the successful distribution network packet, so that the phenomenon that the distribution network fails due to the fact that a single port is occupied is prevented, and the high efficiency and the success rate of the distribution network are guaranteed.
In another embodiment of the present invention, an internet of things device includes a processor and a computer-readable storage medium storing a computer program, and when the computer program is read by the processor and executed, the method for distributing network of the internet of things is implemented, and a plurality of ports are set through an offset to receive a distribution network success packet, so as to prevent a distribution network failure phenomenon caused by a single port being occupied, and ensure high efficiency and success rate of the distribution network.
In another embodiment of the present invention, a terminal includes a processor and a computer-readable storage medium storing a computer program, and when the computer program is read by the processor and executed, the method for distributing network of internet of things is implemented, and a plurality of ports are set through an offset to receive a distribution network success packet, so as to prevent a distribution network failure phenomenon caused by a single port being occupied, and ensure high efficiency and success rate of the distribution network.
In another embodiment of the present invention, a distribution network system of an internet of things device includes a router, the internet of things device as described above, and the terminal as described above, and sets a plurality of ports through an offset to receive a distribution network success packet, so as to prevent a distribution network failure phenomenon caused by a single port being occupied, and ensure high efficiency and success rate of the distribution network.
In another embodiment of the present invention, a computer-readable storage medium stores a computer program, and when the computer program is read and executed by a processor, the method for distributing network of the internet of things for the internet of things device as described above or the method for distributing network of the internet of things for the terminal as described above is implemented, and a plurality of ports are set by using an offset to receive a successful packet of the distribution network, so as to prevent a phenomenon that the distribution network fails due to occupation of a single port, and ensure high efficiency and success rate of the distribution network.
Although the present invention is disclosed above, the present invention is not limited thereto. Various changes and modifications may be effected therein by one skilled in the art without departing from the spirit and scope of the invention as defined in the appended claims.
Claims (12)
1. A network distribution method of the Internet of things is characterized by being applied to equipment of the Internet of things and comprising the following steps:
the method comprises the steps that the Internet of things equipment enters a promiscuous mode to monitor a plurality of broadcast packets received by a first port of the Internet of things equipment, wherein a terminal sends the plurality of broadcast packets to the first port of the Internet of things equipment through a router, and each broadcast packet contains different port offsets;
the Internet of things equipment is connected to the router according to the broadcast packets received by the first port, and sends distribution network success broadcast packets to corresponding offset ports in the terminal through the router according to the port offset, wherein the terminal sets the offset ports according to the port offset, and when at least one offset port receives the distribution network success broadcast packet, the distribution network is successful.
2. The network distribution method of the internet of things as claimed in claim 1, wherein in the step of connecting the internet of things device to the router according to the broadcast packets received by the first port and sending the successful distribution network broadcast packet to the corresponding offset port in the terminal via the router according to the port offset, the method comprises:
when the Internet of things equipment monitors a plurality of broadcast packets received by the first port, analyzing the port offset corresponding to each broadcast packet;
the Internet of things equipment determines the offset port corresponding to each broadcast packet according to the port offset corresponding to each broadcast packet;
and the Internet of things equipment sends the distribution network success broadcast packet to each offset port through the router.
3. The network distribution method of the internet of things as claimed in claim 2, wherein the step of determining the offset port corresponding to each broadcast packet by the internet of things device according to the port offset includes:
and the Internet of things equipment respectively adds the port number of a preset second port to the port offset corresponding to each broadcast packet so as to determine the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal.
4. The utility model provides a net device is joined in marriage to thing networking which characterized in that is applied to thing networking equipment, includes:
a first receiving unit: the terminal is used for entering a promiscuous mode to monitor a plurality of broadcast packets received by a first port of the Internet of things equipment, wherein the terminal sends the broadcast packets to the first port through a router, and each broadcast packet contains mutually different port offsets;
a first transmission unit: the distribution network successful broadcast packet sending module is configured to connect to the router according to the plurality of broadcast packets received by the first port, and send a distribution network successful broadcast packet to a corresponding offset port in the terminal through the router according to the port offset, where the terminal sets the plurality of offset ports according to the port offset, and when at least one of the offset ports receives the distribution network successful broadcast packet, the distribution network is successful.
5. A network distribution method of the Internet of things is characterized by being applied to a terminal and comprising the following steps:
the terminal sends a plurality of broadcast packets to a first port of the Internet of things equipment through a router, wherein each broadcast packet comprises different port offsets, and the Internet of things equipment enters a promiscuous mode to monitor the broadcast packets received by the first port of the Internet of things equipment;
the terminal sets a plurality of offset ports corresponding to the broadcast packets according to the port offset, when at least one offset port receives a distribution network successful broadcast packet, the distribution network is successful, wherein the Internet of things equipment is connected to the router according to the broadcast packet received by the first port, and sends the distribution network successful broadcast packet to the terminal through the router according to the port offset.
6. The network distribution method of the internet of things according to claim 5, wherein the step of setting, by the terminal, a plurality of offset ports corresponding to the broadcast packets according to the port offset includes:
and the terminal respectively adds the port offset corresponding to each broadcast packet to a preset port number of a second port to set the offset port corresponding to each broadcast packet, wherein the second port is a designated port locked by the terminal.
7. The network distribution method of the internet of things as claimed in claim 6, wherein the offset port is a temporary port used by the terminal to receive the successful broadcast packet of the distribution network, and the port number of the offset port is determined by adding the port number of the second port to the corresponding port offset.
8. The utility model provides a net device is joined in marriage to thing networking which characterized in that is applied to the terminal, includes:
a second transmission unit: the router is used for sending a plurality of broadcast packets to a first port of the Internet of things equipment, wherein each broadcast packet comprises different port offsets, and the Internet of things equipment enters a promiscuous mode to monitor the broadcast packets received by the first port of the Internet of things equipment;
a second receiving unit: the device is used for setting a plurality of offset ports corresponding to the broadcast packets according to the port offset, and when at least one offset port receives a distribution network successful broadcast packet, the distribution network is successful, wherein the internet of things device is connected to the router according to the broadcast packet received by the first port, and sends the distribution network successful broadcast packet to the terminal through the router according to the port offset.
9. An internet of things device, comprising a processor and a computer readable storage medium storing a computer program, which when read and executed by the processor, implements the network distribution method of the internet of things as claimed in any one of claims 1-3.
10. A terminal, characterized in that it comprises a processor and a computer readable storage medium storing a computer program, which when read and executed by the processor, implements the method for network distribution of the internet of things according to any of claims 5-7.
11. A network distribution system of the internet of things, comprising a router, the internet of things device of claim 9, and the terminal of claim 10.
12. A computer-readable storage medium, characterized in that it stores a computer program which, when read and executed by a processor, implements the method for network distribution of the internet of things as claimed in any one of claims 1 to 3, or implements the method for network distribution of the internet of things as claimed in any one of claims 5 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010736477.1A CN111918365B (en) | 2020-07-28 | 2020-07-28 | Network distribution method, device and system of Internet of things and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010736477.1A CN111918365B (en) | 2020-07-28 | 2020-07-28 | Network distribution method, device and system of Internet of things and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111918365A CN111918365A (en) | 2020-11-10 |
CN111918365B true CN111918365B (en) | 2023-04-07 |
Family
ID=73280908
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010736477.1A Active CN111918365B (en) | 2020-07-28 | 2020-07-28 | Network distribution method, device and system of Internet of things and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111918365B (en) |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW201130265A (en) * | 2010-02-26 | 2011-09-01 | Connection Technology Systems Inc | Method for forwarding data packets and network device using the same thereof under NAT mode |
CN109922516A (en) * | 2019-03-01 | 2019-06-21 | 奥克斯空调股份有限公司 | A kind of method of wifi equipment intelligent network distribution |
-
2020
- 2020-07-28 CN CN202010736477.1A patent/CN111918365B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN111918365A (en) | 2020-11-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109391500B (en) | Configuration management method, device and equipment | |
US20110255536A1 (en) | Method, system, and apparatus for extranet networking of multicast virtual private network | |
CN104836821A (en) | Method, device and equipment for network acceleration based on router | |
WO2021120374A1 (en) | Message processing method, processing unit, and a virtual private network server | |
CN105049495B (en) | Method for discovering equipment, apparatus and system | |
CN113596191A (en) | Data processing method, network element equipment and readable storage medium | |
CN105519028A (en) | Wireless system access control method and apparatus | |
CN111885733B (en) | Resource allocation method, device, storage medium and network equipment | |
CN109889521B (en) | Memory, communication channel multiplexing implementation method, device and equipment | |
CN113572864B (en) | Data processing method, network element equipment and readable storage medium | |
CN101631127A (en) | File transfer method and clients | |
CN103780483A (en) | Method, system and device for obtaining resource information of terminal device of Internet of Thingss | |
CN112437153A (en) | Equipment linkage processing method and device | |
CN108809549B (en) | Data transmission method and equipment | |
CN102970391A (en) | Domain name query processing method, server and system | |
CN111918365B (en) | Network distribution method, device and system of Internet of things and storage medium | |
CN115622833B (en) | Device management method, system, device and medium for cross-terminal communication based on bus | |
CN110730203A (en) | P2P communication method and device | |
CN110572476A (en) | Remote control method, device and equipment | |
CN114584262B (en) | Data transmission method and related equipment | |
CN105591866A (en) | Method and system for sharing WIFI, household gateway, and local area network gateway | |
CN112073960B (en) | Decoding method, decoding system, electronic device and storage medium | |
CN114489730A (en) | Remote upgrading method, terminal equipment and computer readable storage medium | |
CN103780503A (en) | Load balancing realization method and apparatus | |
CN107222299A (en) | A kind of data transmission method, system and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |