Network connection method of Internet of Things module and Internet of Things module
By determining the target wireless network based on frequency band and signal strength after the IoT module disconnects from the network, and calculating the network degradation coefficient by combining latency rate and anomaly rate, the problem of suboptimal network selection for IoT modules is solved, and a more stable network connection is achieved.
Patent Information
- Application Number
- CN202410687506.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2025-12-02
AI Technical Summary
In existing technologies, IoT modules may select a non-optimal network during network selection, leading to a decrease in network connection stability.
After the IoT module is disconnected from the connected network, the target wireless network is determined based on the frequency band and signal strength of each wireless network. The network degradation coefficient is calculated by combining the average latency and network anomaly rate of the wireless network and Ethernet, and the optimal network is selected for connection.
Improved network connection stability of IoT modules and selected a better network connection method.
Smart Images

Figure CN121056828A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of communication technology, and in particular to a network connection method for an Internet of Things (IoT) module and an IoT module. Background Technology
[0002] IoT modules are widely used in vehicle monitoring, remote control, telemetry, small wireless networks, wireless meter reading, access control systems, community paging, industrial data acquisition systems, wireless tags, identification, contactless RF (Radio Frequency) smart cards, small wireless data terminals, security and fire protection systems, wireless remote control systems, biosignal acquisition, hydrological and meteorological monitoring, robot control, wireless data communication, and digital audio and digital image transmission. Therefore, the stability of the network to which the IoT module is connected is crucial.
[0003] IoT modules are divided into single-mode and multi-mode. Single-mode modules support only one network type, such as 2.4G WiFi. Multi-mode modules support multiple network types, such as WiFi and Ethernet. This gives users more choices and makes multi-mode modules more adaptable.
[0004] Currently, multi-mode modules select networks by prioritizing wired networks, and if no wired network is available, then prioritizing wireless networks with high signal strength. However, each network may have its own issues. For example, wired networks may be overloaded with users, and while 2.4G WiFi has a strong signal, it suffers from significant interference. These factors can affect the stability of the IoT module's network connection. Therefore, the network selection method in existing technologies may not be the optimal network, thus reducing network connection stability. Summary of the Invention
[0005] This application provides a network connection method for an IoT module and an IoT module, which is used to select a higher quality and more stable network to connect to the network module, thereby improving the stability of the network connection.
[0006] In a first aspect, embodiments of this application provide a network connection method for an Internet of Things (IoT) module, the method comprising:
[0007] When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks corresponding to the IoT module based on the frequency band and signal strength of each wireless network.
[0008] The network degradation coefficient of the target wireless network is obtained by using the average latency rate and the network anomaly rate of the target wireless network; and the network degradation coefficient of the Ethernet is obtained by using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module; wherein, the average latency rate of either the target wireless network or the Ethernet is obtained based on the network latency duration of either network, and the network anomaly rate of either network is obtained by the number of times that either network disconnects from the IoT module;
[0009] Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, the network to be connected is determined, and a connection is made with the network to be connected.
[0010] A second aspect of this application provides an Internet of Things (IoT) module, including a processor and a memory, wherein the processor and the memory are connected via a bus;
[0011] The memory stores a computer program, and the processor is configured to perform the following operations based on the computer program:
[0012] When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks corresponding to the IoT module based on the frequency band and signal strength of each wireless network.
[0013] The network degradation coefficient of the target wireless network is obtained by using the average latency rate and the network anomaly rate of the target wireless network; and the network degradation coefficient of the Ethernet is obtained by using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module; wherein, the average latency rate of either the target wireless network or the Ethernet is obtained based on the network latency duration of either network, and the network anomaly rate of either network is obtained by the number of times that either network disconnects from the IoT module;
[0014] Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, the network to be connected is determined, and a connection is made with the network to be connected.
[0015] According to a third aspect of the present invention, a computer storage medium is provided, the computer storage medium storing a computer program for performing the method as described in the first aspect.
[0016] In the above embodiments of this application, when the IoT module is disconnected from the connected network, a target wireless network is determined from among the wireless networks corresponding to the IoT module based on the frequency band and signal strength of each wireless network. Then, the network degradation coefficient of the target wireless network is obtained using its average latency and network anomaly rate. Similarly, the network degradation coefficient of the Ethernet network corresponding to the IoT module is obtained using its average latency and network anomaly rate. Finally, based on the network degradation coefficients of the target wireless network and the Ethernet network degradation coefficient, the network to be connected is determined, and a connection is established with this network. Therefore, this embodiment of the application combines multi-dimensional reference coefficients of each network to select the final connected network, resulting in a higher quality and more stable network for the IoT module, thus improving network connection stability. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 An exemplary diagram illustrating an application scenario provided in an embodiment of this application is shown;
[0019] Figure 2 One of the schematic flowcharts of the network connection method for an IoT module provided in this application is illustrated by way of example;
[0020] Figure 3 An exemplary illustration shows a flowchart of determining each wireless network corresponding to an IoT module, provided in an embodiment of this application.
[0021] Figure 4 An exemplary illustration shows a flowchart for determining other wireless networks provided in an embodiment of this application;
[0022] Figure 5 An exemplary schematic diagram of the structure of a MAC address provided in an embodiment of this application is shown;
[0023] Figure 6 An exemplary schematic diagram of the process for determining a target wireless network provided in an embodiment of this application is shown;
[0024] Figure 7 An exemplary schematic diagram of the signal range provided in an embodiment of this application is shown;
[0025] Figure 8An exemplary illustration shows a flowchart for determining the average latency of a network, provided in an embodiment of this application.
[0026] Figure 9 The second schematic flowchart of the network connection method of the Internet of Things module provided in the embodiment of this application is illustrated by example;
[0027] Figure 10 An exemplary diagram illustrates a network connection device for an IoT module provided in an embodiment of this application;
[0028] Figure 11 An exemplary hardware structure diagram of an IoT module provided in an embodiment of this application is shown. Detailed Implementation
[0029] To make the objectives, implementation methods and advantages of this application clearer, the exemplary implementation methods of this application will be clearly and completely described below with reference to the accompanying drawings of the exemplary embodiments of this application. Obviously, the described exemplary embodiments are only some embodiments of this application, and not all embodiments.
[0030] Based on the exemplary embodiments described in this application, all other embodiments obtained by those skilled in the art without inventive effort are within the scope of protection of the appended claims. Furthermore, although the disclosures in this application are presented by way of one or more exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete implementation on its own.
[0031] It should be noted that the brief descriptions of terms in this application are only for the convenience of understanding the embodiments described below, and are not intended to limit the embodiments of this application. Unless otherwise stated, these terms should be understood in their ordinary and common meaning.
[0032] The terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to be omnipresent but not exclusive; for example, a product or device comprising a series of components is not necessarily limited to those explicitly listed, but may include other components not explicitly listed or inherent to such product or device.
[0033] As used in this application, the term "module" refers to any known or subsequently developed hardware, software, firmware, artificial intelligence, fuzzy logic, or combination of hardware and / or software code capable of performing the functions associated with that element.
[0034] The following is an overview of the ideas behind the embodiments of this application.
[0035] Currently, multi-mode modules select networks by prioritizing wired networks, and if no wired network is available, then prioritizing wireless networks with high signal strength. However, each network may have its own issues. For example, wired networks may be overloaded with users, and while 2.4G WiFi has a strong signal, it suffers from significant interference. These factors can affect the stability of the IoT module's network connection. Therefore, the network selection method in existing technologies may not be the optimal network, thus reducing network connection stability.
[0036] Existing technologies may select networks that are not optimal, leading to reduced network connection stability. This application provides a network connection method for an IoT module. When the IoT module is disconnected from its current network, a target wireless network is identified based on the frequency band and signal strength of the wireless networks corresponding to the IoT module. Then, a network degradation coefficient for the target wireless network is obtained using its average latency and network anomaly rate. Similarly, a network degradation coefficient for the Ethernet network corresponding to the IoT module is obtained using its average latency and network anomaly rate. Finally, based on the network degradation coefficients of the target and Ethernet networks, a network to be connected is determined and connected. Therefore, this application combines multi-dimensional reference coefficients for each network to select the final connected network, resulting in a higher quality and more stable network connection for the IoT module, thus improving network connection stability.
[0037] like Figure 1 As shown, an application scenario of a network connection method for an Internet of Things (IoT) module is presented, which includes an IoT module 101 and a server 102.
[0038] In one possible application scenario, when the network connection between the IoT module 101 and the server 102 is lost, a target wireless network is determined from among the wireless networks corresponding to the IoT module based on their frequency bands and signal strengths. Then, the IoT module 101 uses the average latency rate and network anomaly rate of the target wireless network to obtain a network degradation coefficient for the target wireless network; and uses the average latency rate and network anomaly rate of the Ethernet network corresponding to the IoT module to obtain a network degradation coefficient for the Ethernet network. The average latency rate of either the target wireless network or the Ethernet network is obtained based on the network latency duration of that network, and the network anomaly rate is obtained based on the number of times that network disconnects from the IoT module. Finally, the IoT module 101 determines the network to be connected to based on the network degradation coefficients of the target wireless network and the Ethernet network, and connects to the server 102 through the network to be connected.
[0039] in, Figure 1 The IoT module 101 and the server 102 can interact through a communication network. The communication network can be either wireless or wired.
[0040] For example, the Internet of Things module 101 can access the network and communicate with the server 102 through cellular mobile communication technology, wherein the cellular mobile communication technology includes, for example, 5th Generation Mobile Networks (5G) technology.
[0041] Optionally, the IoT module 101 can access the network and communicate with the server 102 via short-range wireless communication, wherein the short-range wireless communication method includes, for example, Wireless Fidelity (Wi-Fi) technology.
[0042] The description in this application focuses only on a single VR device 410 and a single server 420. However, those skilled in the art should understand that the illustrated IoT module 101 and single server 102 are intended to illustrate the operation of the IoT module 101 and server 102 involved in the technical solution of this application, and do not imply any limitation on the number, type, or location of the IoT module 101 and server 102. It should be noted that adding additional modules to or removing individual modules from the illustrated environment will not change the underlying concept of the exemplary embodiments of this application.
[0043] It should be noted that the network connection method for the IoT module proposed in this application is not only applicable to... Figure 1 The application scenarios shown are also applicable to any network-connected device with an IoT module.
[0044] The following describes the network connection method of the IoT module in an exemplary embodiment of this application, in conjunction with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the methods and principles of this application, and the implementation of this application is not limited in any way in this respect.
[0045] like Figure 2 The diagram shown illustrates a network connection method for an IoT module, which may include the following steps:
[0046] Step 201: When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks based on the frequency band and signal strength of each wireless network corresponding to the IoT module.
[0047] In this embodiment of the application, when the IoT module disconnects from the connected network, the disconnection count of the network is incremented by 1.
[0048] Below, we will first describe the method for determining each wireless network corresponding to the IoT module in the embodiments of this application, such as... Figure 3 The diagram shown illustrates the process of determining the wireless networks corresponding to the IoT module, which may include the following steps:
[0049] Step 301: In response to the network configuration command sent by the user, configure the IoT module with the initial wireless network, wherein the initial wireless network is obtained based on the network configuration command;
[0050] In this embodiment, the network configuration command includes the network name and network password of the initial wireless network. In this embodiment, the IoT module is configured to connect to the initial wireless network using the network name and network password.
[0051] Step 302: After successful network configuration, based on the MAC address and network password of the initial wireless network, determine other wireless networks among the multiple wireless networks currently searched by the IoT module that belong to the same router as the initial wireless network.
[0052] like Figure 4 As shown, to identify other wireless networks belonging to the same router as the initial wireless network, the following steps may be included:
[0053] Step 401: Based on the first identifier in the MAC address of the initial wireless network, search among the plurality of wireless networks for intermediate wireless networks whose first identifier is the same as the first identifier of the initial wireless network;
[0054] like Figure 5 The diagram shows the structure of a MAC address. As can be seen from the diagram, a MAC address consists of two parts: a manufacturer identifier and a custom encoding. In this embodiment, the first identifier is the manufacturer identifier, which corresponds to the first three bytes of the MAC address, and the second identifier is the custom encoding, which corresponds to the last three bytes of the MAC address.
[0055] It should be noted that the MAC address in this embodiment is BSSID (Basic Service Set Identifier), but this embodiment does not limit the MAC address.
[0056] Step 402: Using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network, filter the intermediate wireless networks to obtain the filtered intermediate wireless networks.
[0057] In one embodiment, step 402 may be specifically implemented as follows: converting the second identifier of the initial wireless network into a target value in a specified base, and converting the second identifiers of each intermediate wireless network into target values in a specified base respectively; and deleting intermediate wireless networks in which the difference between the target value of each intermediate wireless network and the target value of the initial wireless network is greater than a specified threshold, thereby obtaining the filtered intermediate wireless networks.
[0058] In this embodiment, the bytes in the second identifier are arranged in sequential order to obtain the hexadecimal value corresponding to the second identifier. Then, the hexadecimal value corresponding to the second identifier is converted into a decimal target value. For example, if the BSSID of the wireless network is 1B:23:55:01:C3:00, then the corresponding second identifier is determined to be 01:C3:00, the hexadecimal value is 01C300, and the decimal target value is 115456.
[0059] It should be noted that: the specified base in this application embodiment is decimal, but this application embodiment does not limit the specified base, and it can be set according to the actual situation. Furthermore, the conversion between different bases is not limited in the prior art. Also, the specified threshold in this application embodiment is 10, but this application embodiment does not limit the specified threshold, and the specified threshold in this application embodiment can be set according to the actual situation.
[0060] Step 403: For any one of the filtered intermediate wireless networks, connect the wireless network module to the filtered intermediate wireless network using the network password of the initial wireless network;
[0061] Step 404: If the connection is successful, then any one of the filtered intermediate wireless networks will be identified as the other wireless networks.
[0062] In this embodiment, the network password of the initial wireless network is determined to be any of the filtered intermediate wireless networks, and a network connection is established between the wireless network module and the network. The filtered intermediate wireless networks that can be successfully connected to are then designated as other wireless networks.
[0063] Step 303: Determine the initial wireless network and the other wireless networks as the wireless networks corresponding to the IoT module.
[0064] In this embodiment, each wireless network corresponding to the IoT module will be identified and stored for direct use later. If a new wireless network is added, the user can directly input the wireless network or re-execute the process for each wireless network corresponding to the IoT module to update the wireless networks corresponding to the IoT module.
[0065] After introducing the methods for each wireless network corresponding to the IoT module in this application, the method for determining the target wireless network in the embodiments of this application will be described, such as... Figure 6 The diagram illustrates the process of determining a target wireless network, which may include the following steps:
[0066] Step 601: Based on the frequency bands corresponding to each wireless network, group the wireless networks to obtain at least one set of wireless networks, wherein the frequency bands of each wireless network in the same set of wireless networks are the same, and the frequency bands of each wireless network in different sets of wireless networks are different.
[0067] In this embodiment, wireless networks with the same frequency band are grouped into the same group.
[0068] Step 602: For any set of wireless networks, based on the signal strength of each wireless network in the set of wireless networks, obtain the preferred wireless network in the set of wireless networks;
[0069] In this embodiment of the application, the wireless network with the highest signal strength in any set of wireless networks is determined as the preferred wireless network in the set of wireless networks.
[0070] Step 603: Sort the preferred wireless networks corresponding to each wireless network set, and traverse the sorted preferred wireless networks.
[0071] In this embodiment, the wireless network sets can be sorted according to frequency bands. The order of frequency bands can be preset, and each wireless network set can be sorted according to its corresponding frequency band. This embodiment does not limit the sorting method.
[0072] Step 604: For any preferred wireless network that is traversed, determine whether the frequency band of the preferred wireless network that is traversed is the same as the frequency band of the preferred wireless network located at the next position after the preferred wireless network. If yes, proceed to step 605; otherwise, proceed to one of steps 606 to 608.
[0073] In this embodiment of the application, three signal intervals are pre-set, namely the first signal interval, the second signal interval, and the third signal interval.
[0074] like Figure 7 As shown, in this embodiment, the first signal interval is a strong signal interval, which is set to [-50dBm, +∞]. The second signal interval is a medium signal interval, set to (-74dBm, -50dBm). The third signal interval is a weak signal interval, set to [-∞, -74dBm]. However, this embodiment does not limit the specific range of these three intervals; the specific range can be set according to the actual situation.
[0075] Furthermore, in this embodiment of the application, the designated signal interval where the network signal of the preferred wireless network is located is referred to as the first signal interval, and the designated signal interval where the network signal of the preferred wireless network located at the next position after the preferred wireless network is referred to as the second signal interval.
[0076] Step 605: After deleting the preferred wireless network with the weaker signal strength from the two preferred wireless networks, return to step 603;
[0077] Step 606: If the network signals of the two preferred wireless networks are both in the preset first signal range, then according to the preset priority of each frequency band, delete the preferred wireless network with the lower priority of the frequency band among the two preferred wireless networks, and return to step 603.
[0078] In this embodiment, the frequency band priorities of all wireless networks are pre-set. For example, the priorities of each frequency band are: frequency band 1 > frequency band 2 > frequency band 3 > frequency band 4 > frequency band 5. If the frequency bands of two preferred wireless networks are frequency band 2 and frequency band 4 respectively, then the preferred wireless network corresponding to frequency band 4 is determined to be deleted.
[0079] Step 607: If the network signals of the two preferred wireless networks are both within the preset second signal range, then delete the preferred wireless network with the weaker signal strength and return to step 603.
[0080] Wherein, any signal value in the first signal interval is greater than any signal value in the second signal interval.
[0081] Step 608: If the network signals of the two preferred wireless networks are both in the preset third signal interval, then the preferred wireless network to be deleted is determined based on the priority of each frequency band and the signal strength of the two preferred wireless networks. After deleting the preferred wireless network to be deleted, the process returns to step 603.
[0082] Wherein, any signal value in the second signal interval is greater than any signal value in the third signal interval.
[0083] In one embodiment, step 608 may be specifically implemented as follows: based on the priority of each frequency band, determine the target preferred wireless network with the lower priority of the frequency band among the two preferred wireless networks; increase the signal strength of the target preferred wireless network by a specified value to obtain the compensated signal strength of the target preferred wireless network; and obtain the wireless network to be deleted based on the compensated signal strength of the target preferred wireless network and the signal strength of the other preferred wireless network.
[0084] In this embodiment of the application, the target preferred wireless network and the wireless network with the weaker signal strength in another preferred wireless network are identified as wireless networks to be deleted.
[0085] It should be noted that the specified value in this application embodiment is 8dBm, but the specified value in this application embodiment can be set according to the actual situation, but it is not limited to the specified value in this application embodiment.
[0086] Step 202: Obtain the network degradation coefficient of the target wireless network using the average latency rate and the network anomaly rate of the target wireless network; and obtain the network degradation coefficient of the Ethernet using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module; wherein, the average latency rate of either the target wireless network or the Ethernet is obtained based on the network latency duration of either network, and the network anomaly rate of either network is obtained by the number of times that network disconnects from the IoT module;
[0087] In one implementation example, the network degradation coefficient of the target wireless network and any network in the Ethernet is determined by adding the average latency rate of the network and the abnormal disconnection rate of the network to obtain the network degradation coefficient of the network.
[0088] The following describes the methods for determining the average latency and network anomaly rate of the network in the embodiments of this application.
[0089] like Figure 8 The method for determining the average latency of a target wireless network and any network in the Ethernet network is described below, and may specifically include the following steps:
[0090] Step 801: For any network in the target wireless network and the Ethernet, after successfully connecting to any network, send an ICMP request packet to the server;
[0091] In this embodiment, the network connection in step 801 is only for determining the average latency of the network. After the average latency of the network is determined, the connection with the network will be disconnected.
[0092] Step 802: When the response corresponding to the ICMP request packet sent by the server is received, the network delay duration is obtained based on the sending time and the receiving time, wherein the sending time is the time when the ICMP request packet is sent to the server, and the receiving time is the time when the response corresponding to the ICMP request packet sent by the server is received.
[0093] In one embodiment, step 802 may be specifically implemented as: determining the difference between the receiving time point and the sending time point as the network delay duration.
[0094] Step 803: Determine the average network latency of the specified number of ICM P request packets as the average latency of any network;
[0095] The specified number of times in this embodiment is 10 times, but this is not a limitation on the specified number of times in this embodiment. The specific value of the specified number of times in this embodiment can be set according to the actual situation.
[0096] Step 804: Obtain the average latency rate of any network based on the average latency duration of any network.
[0097] In one embodiment, the average latency of any network is obtained by dividing the average latency of any network by the total average latency. The total average latency is the sum of the average latency of the target wireless network and the average latency of the Ethernet.
[0098] If the average latency of the target wireless network is determined, the average latency of the target wireless network is obtained by dividing the average latency of the target wireless network by the total average latency. The average latency of the target wireless network can be obtained using formula (1):
[0099]
[0100] in, w represents the average latency of the target wireless network. d e represents the average latency of the target wireless network. d This represents the average latency of Ethernet.
[0101] To determine the average latency of Ethernet, divide the average latency of Ethernet by the total average latency to obtain the average latency of Ethernet. The average latency of Ethernet can be obtained using formula (2):
[0102]
[0103] in, The average latency of the Ethernet is denoted as .
[0104] In one embodiment, the network anomaly rate of the target wireless network and any one of the Ethernet networks is obtained in the following manner:
[0105] For any network in the target wireless network and the Ethernet, the network anomaly rate of the network is obtained based on the number of times the network disconnects from the IoT module and the total number of disconnections. The total number of disconnections is the sum of the number of times the target wireless network disconnects from the IoT module and the number of times the Ethernet disconnects from the IoT module.
[0106] In this embodiment, the network anomaly rate of any network is obtained by dividing the number of times the network disconnects from the IoT module by the total number of disconnections.
[0107] Step 203: Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, determine the network to be connected and connect to the network to be connected.
[0108] In one embodiment, the network to be connected is obtained through the following three cases:
[0109] Case 1: If the network degradation coefficient of the target wireless network is greater than that of the Ethernet network, then the Ethernet is determined as the network to be connected.
[0110] Case 2: If the network degradation coefficient of the target wireless network is less than that of the Ethernet network degradation coefficient, then the target wireless network is determined as the network to be connected.
[0111] Case 3: If the network degradation coefficient of the target wireless network is equal to the network degradation coefficient of the Ethernet, then the target wireless network or the Ethernet is determined as the network to be connected.
[0112] In this embodiment of the application, if the network degradation coefficients of the two networks are the same, a network can be randomly selected as the network to be connected, or a network can be pre-designated as the network to be connected.
[0113] To further understand the methods in this application, such as Figure 9 The diagram shown is a flowchart illustrating the network connection method for the IoT module in this application, which may include the following steps:
[0114] Step 901: In response to the network configuration command sent by the user, configure the IoT module with the initial wireless network, wherein the initial wireless network is obtained based on the network configuration command;
[0115] Step 902: After successful network configuration, based on the first identifier in the MAC address of the initial wireless network, search for intermediate wireless networks among the multiple wireless networks whose first identifier is the same as the first identifier of the initial wireless network;
[0116] Step 903: Using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network, filter the intermediate wireless networks to obtain the filtered intermediate wireless networks.
[0117] Step 904: For any one of the filtered intermediate wireless networks, connect the wireless network module to the one of the filtered intermediate wireless networks using the network password of the initial wireless network;
[0118] Step 905: If the connection is successful, then any one of the filtered intermediate wireless networks will be identified as the other wireless networks;
[0119] Step 906: Determine the initial wireless network and the other wireless networks as the wireless networks corresponding to the IoT module;
[0120] Step 907: When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks based on the frequency band and signal strength of each wireless network corresponding to the IoT module.
[0121] Step 908: Obtain the network degradation coefficient of the target wireless network using the average latency rate and the network anomaly rate of the target wireless network; and obtain the network degradation coefficient of the Ethernet using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module.
[0122] The average latency rate of either the target wireless network or the Ethernet network is obtained based on the network latency duration of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the network of the IoT module.
[0123] Step 909: Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, determine the network to be connected and connect to the network to be connected.
[0124] Based on the same inventive concept, the network connection method for an IoT module as described above can also be implemented by a network connection device for an IoT module. The effect of this network connection device is similar to that of the aforementioned method, and will not be repeated here.
[0125] Figure 10 This is a schematic diagram of the structure of a network connection device for an Internet of Things (IoT) module according to an embodiment of the present disclosure.
[0126] like Figure 10 As shown, the network connection device 1000 of the Internet of Things module disclosed herein may include a first wireless network determination module 1010, a network coefficient determination module 1020, and a network to be connected determination module 1030.
[0127] The first wireless network determination module 1010 is used to determine the target wireless network from the wireless networks according to the frequency band and signal strength of each wireless network corresponding to the IoT module when the IoT module is disconnected from the connected network.
[0128] The network coefficient determination module 1020 is used to obtain the network degradation coefficient of the target wireless network using the average latency rate and the network anomaly rate of the target wireless network; and to obtain the network degradation coefficient of the Ethernet using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module; wherein the average latency rate of either the target wireless network or the Ethernet is obtained based on the network latency duration of either network, and the network anomaly rate of either network is obtained by the number of times that either network disconnects from the IoT module;
[0129] The network to be connected determination module 1030 is used to determine the network to be connected based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, and to connect to the network to be connected.
[0130] In one embodiment, the apparatus further includes:
[0131] The second wireless network determination module 1040 is used to determine each wireless network corresponding to the IoT module in the following manner:
[0132] In response to a network configuration command sent by a user, the IoT module is configured with an initial wireless network, wherein the initial wireless network is obtained based on the network configuration command;
[0133] Once the network configuration is successful, based on the MAC address and network password of the initial wireless network, the IoT module determines other wireless networks that belong to the same router as the initial wireless network among the multiple wireless networks currently searched.
[0134] The initial wireless network and the other wireless networks are identified as wireless networks corresponding to the IoT module.
[0135] In one embodiment, the second wireless network determination module 1040 performs the process of determining other wireless networks belonging to the same router as the initial wireless network among the multiple wireless networks currently searched by the IoT module, based on the MAC address and network password of the initial wireless network. Specifically, this is used for:
[0136] Based on the first identifier in the MAC address of the initial wireless network, search among the plurality of wireless networks for intermediate wireless networks whose first identifier is the same as the first identifier of the initial wireless network;
[0137] Using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network, the intermediate wireless networks are filtered to obtain the filtered intermediate wireless networks.
[0138] For any selected intermediate wireless network, the wireless network module is connected to the selected intermediate wireless network using the network password of the initial wireless network; and,
[0139] If the connection is successful, then any one of the filtered intermediate wireless networks will be identified as one of the other wireless networks.
[0140] In one embodiment, the second wireless network determining module 1040 performs the step of filtering the intermediate wireless networks using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network to obtain the filtered intermediate wireless networks, specifically for:
[0141] The second identifier of the initial wireless network is converted into a target value in a specified base, and the second identifiers of each intermediate wireless network are converted into target values in a specified base respectively;
[0142] Intermediate wireless networks whose target value differs from the target value of the initial wireless network by a specified threshold are deleted to obtain the filtered intermediate wireless networks.
[0143] In one embodiment, the first wireless network determining module 1010 is specifically used for:
[0144] Based on the frequency bands corresponding to each wireless network, the wireless networks are grouped to obtain at least one set of wireless networks, wherein the frequency bands of the wireless networks in the same set are the same, and the frequency bands of the wireless networks in different sets are different.
[0145] For any set of wireless networks, the preferred wireless network in the set of wireless networks is obtained based on the signal strength of each wireless network in the set of wireless networks;
[0146] Sort the preferred wireless networks corresponding to each set of wireless networks, and then traverse the sorted preferred wireless networks.
[0147] For any of the preferred wireless networks encountered during the traversal, perform the following steps:
[0148] If the frequency band of the preferred wireless network traversed is the same as the frequency band of the preferred wireless network located one position after the preferred wireless network, then the preferred wireless network with the lower signal strength of the network signal in the two preferred wireless networks is deleted, and the step of traversing each of the sorted preferred wireless networks is returned. The two preferred wireless networks are the preferred wireless network traversed and the preferred wireless network located one position after the preferred wireless network.
[0149] If the two preferred wireless networks operate on different frequency bands, and their network signals are both within a preset first signal range, then according to the pre-set priorities of each frequency band, the preferred wireless network with the lower frequency band priority is deleted, and the process returns to the step of traversing the sorted preferred wireless networks; or,
[0150] If the two preferred wireless networks operate on different frequency bands, and their network signals are both within a preset second signal interval, then the preferred wireless network with the weaker signal strength is deleted, and the process returns to the step of traversing the sorted preferred wireless networks; wherein any signal value in the first signal interval is greater than any signal value in the second signal interval; or,
[0151] If the frequency bands of the two preferred wireless networks are different, and the network signals of the two preferred wireless networks are both in a preset third signal interval, then the preferred wireless network to be deleted is determined based on the priority of each frequency band and the signal strength of the two preferred wireless networks. After deleting the preferred wireless network to be deleted, the process returns to the step of traversing each of the sorted preferred wireless networks, wherein any signal value in the second signal interval is greater than any signal value in the third signal interval.
[0152] In one embodiment, the first wireless network determination module 1010 performs the process of determining the preferred wireless network to be deleted from the two preferred wireless networks based on the priority of each frequency band and the signal strength of the two preferred wireless networks, specifically for:
[0153] Based on the priority of each frequency band, the target preferred wireless network with the lower frequency band priority among the two preferred wireless networks is determined;
[0154] The signal strength of the target preferred wireless network is increased by a specified value to obtain the compensated signal strength of the target preferred wireless network;
[0155] The wireless network to be deleted is obtained based on the compensated signal strength of the target preferred wireless network and the signal strength of another preferred wireless network.
[0156] In one embodiment, the network to be connected determination module 1030 is specifically used for:
[0157] If the network degradation coefficient of the target wireless network is greater than that of the Ethernet network, then the Ethernet is identified as the network to be connected; or,
[0158] If the network degradation coefficient of the target wireless network is less than that of the Ethernet network degradation coefficient, then the target wireless network is identified as the network to be connected, or...
[0159] If the network degradation coefficient of the target wireless network is equal to the network degradation coefficient of the Ethernet, then the target wireless network or the Ethernet is determined as the network to be connected.
[0160] In one embodiment, the network coefficient determination module 1020 is specifically used for:
[0161] The network degradation coefficient of the target wireless network and any network in the Ethernet network is determined by the following method:
[0162] The network degradation coefficient of any given network is obtained by adding the average latency rate of any given network and the abnormal disconnection rate of any given network.
[0163] In one embodiment, the apparatus further includes:
[0164] The average latency determination module 1050 obtains the average latency of the target wireless network and any one of the Ethernet networks in the following manner:
[0165] For any one of the target wireless network and the Ethernet, after successfully connecting to any one of the networks, an ICMP request packet is sent to the server;
[0166] When a response corresponding to the ICMP request packet is received from the server, the network delay duration is obtained based on the sending time and the receiving time, wherein the sending time is the time when the ICMP request packet is sent to the server, and the receiving time is the time when the response corresponding to the ICMP request packet is received from the server.
[0167] The average network latency corresponding to sending a specified number of ICM P request packets is determined as the average latency of any given network.
[0168] The average latency rate of any given network is obtained based on the average latency duration of that network.
[0169] The network anomaly rate determination module 1060 is used to obtain the network anomaly rate of the target wireless network and any one of the networks in the Ethernet network through the following methods:
[0170] For any network in the target wireless network and the Ethernet, the network anomaly rate of the network is obtained based on the number of times the network disconnects from the IoT module and the total number of disconnections. The total number of disconnections is the sum of the number of times the target wireless network disconnects from the IoT module and the number of times the Ethernet disconnects from the IoT module.
[0171] After introducing a network connection method and apparatus for an IoT module according to an exemplary embodiment of the present invention, the following describes an IoT module according to another exemplary embodiment of the present invention.
[0172] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: a completely hardware implementation, a completely software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, collectively referred to herein as "circuit", "module", or "system".
[0173] In some possible implementations, the IoT module according to the present invention may include at least one processor and at least one computer storage medium. The computer storage medium stores program code that, when executed by the processor, causes the processor to perform the steps in the network connection method of the IoT module according to various exemplary embodiments of the present invention described above. For example, the processor may perform actions such as... Figure 2 Steps 201-203 are shown in the diagram.
[0174] The following reference Figure 11 To describe an Internet of Things module 1100 according to this embodiment of the present invention. Figure 11 The IoT module 1100 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0175] like Figure 11 As shown, the IoT module 1100 is presented in the form of a general AR device. The components of the IoT module 1100 may include, but are not limited to: at least one processor 1101, at least one computer storage medium 1102, and a bus 1103 connecting different system components (including the computer storage medium 1102 and the processor 1101).
[0176] Bus 1103 represents one or more of several bus structures, including a computer storage media bus or computer storage media controller, peripheral bus, processor, or local bus using any of the various bus structures.
[0177] Computer storage medium 1102 may include readable media in the form of volatile computer storage media, such as random access computer storage medium (RAM) 1121 and / or cache storage medium 1122, and may further include read-only computer storage medium (ROM) 1123.
[0178] The computer storage medium 1102 may also include a program / utility 1125 having a set (at least one) of program modules 1124, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include an implementation of a network environment.
[0179] The IoT module 1100 can also communicate with one or more external devices 1104 (e.g., keyboards, pointing devices, etc.), one or more devices that enable users to interact with the IoT module 1100, and / or any device that enables the IoT module 1100 to communicate with one or more other AR devices (e.g., routers, modems, etc.). This communication can be performed via input / output (I / O) interface 1105. Furthermore, the IoT module 1100 can also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via network adapter 1106. As shown, network adapter 1106 communicates with other modules used with the IoT module 1100 via bus 1103. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with the IoT module 1100, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0180] In some possible implementations, various aspects of the network connection method for an IoT module provided by the present invention can also be implemented in the form of a program product, which includes program code. When the program product is run on a computer device, the program code is used to cause the computer device to perform the steps in the network connection method for an IoT module according to various exemplary embodiments of the present invention described above.
[0181] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.
Claims
1. A network connection method for an Internet of Things (IoT) module, characterized in that, The method includes: When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks corresponding to the IoT module based on the frequency band and signal strength of each wireless network. The network degradation coefficient of the target wireless network is obtained by using the average latency rate and the network anomaly rate of the target wireless network; and the network degradation coefficient of the Ethernet is obtained by using the average latency rate and the network anomaly rate of the Ethernet corresponding to the IoT module; wherein, the average latency rate of either the target wireless network or the Ethernet is obtained based on the network latency duration of either network, and the network anomaly rate of either network is obtained by the number of times that either network disconnects from the IoT module; Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, the network to be connected is determined, and a connection is made with the network to be connected.
2. The method according to claim 1, characterized in that, The wireless networks corresponding to the IoT module are determined in the following way: In response to a network configuration command sent by a user, the IoT module is configured with an initial wireless network, wherein the initial wireless network is obtained based on the network configuration command; Once the network configuration is successful, based on the MAC address and network password of the initial wireless network, other wireless networks belonging to the same router as the initial wireless network among the multiple wireless networks currently searched by the IoT module are identified. The initial wireless network and the other wireless networks are identified as wireless networks corresponding to the IoT module.
3. The method according to claim 2, characterized in that, The step of determining other wireless networks belonging to the same router as the initial wireless network among the multiple wireless networks currently searched by the IoT module, based on the MAC address and network password of the initial wireless network, includes: Based on the first identifier in the MAC address of the initial wireless network, search among the plurality of wireless networks for intermediate wireless networks whose first identifier is the same as the first identifier of the initial wireless network; Using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network, the intermediate wireless networks are filtered to obtain the filtered intermediate wireless networks. For any selected intermediate wireless network, the wireless network module is connected to the selected intermediate wireless network using the network password of the initial wireless network; and, If the connection is successful, then any one of the filtered intermediate wireless networks will be identified as one of the other wireless networks.
4. The method according to claim 3, characterized in that, The step of filtering the intermediate wireless networks using the second identifier in the MAC address of the initial wireless network and the second identifier in the MAC address of each intermediate wireless network to obtain the filtered intermediate wireless networks includes: The second identifier of the initial wireless network is converted into a target value in a specified base, and the second identifiers of each intermediate wireless network are converted into target values in a specified base respectively; Intermediate wireless networks whose target value differs from the target value of the initial wireless network by a specified threshold are deleted to obtain the filtered intermediate wireless networks.
5. The method according to claim 1, characterized in that, The step of determining the target wireless network from among the wireless networks based on the frequency band and signal strength of each wireless network corresponding to the IoT module includes: Based on the frequency bands corresponding to each wireless network, the wireless networks are grouped to obtain at least one set of wireless networks, wherein the frequency bands of the wireless networks in the same set are the same, and the frequency bands of the wireless networks in different sets are different. For any set of wireless networks, the preferred wireless network in the set of wireless networks is obtained based on the signal strength of each wireless network in the set of wireless networks; Sort the preferred wireless networks corresponding to each set of wireless networks, and then traverse the sorted preferred wireless networks. For any of the preferred wireless networks encountered during the traversal, perform the following steps: If the frequency band of the preferred wireless network traversed is the same as the frequency band of the preferred wireless network located one position after the preferred wireless network, then the preferred wireless network with the lower signal strength of the network signal in the two preferred wireless networks is deleted, and the step of traversing each of the sorted preferred wireless networks is returned. The two preferred wireless networks are the preferred wireless network traversed and the preferred wireless network located one position after the preferred wireless network. If the two preferred wireless networks operate on different frequency bands, and their network signals are both within a preset first signal range, then according to the pre-set priorities of each frequency band, the preferred wireless network with the lower frequency band priority is deleted, and the process returns to the step of traversing the sorted preferred wireless networks; or, If the two preferred wireless networks operate on different frequency bands, and their network signals are both within a preset second signal interval, then the preferred wireless network with the weaker signal strength is deleted, and the process returns to the step of traversing the sorted preferred wireless networks; wherein any signal value in the first signal interval is greater than any signal value in the second signal interval; or, If the frequency bands of the two preferred wireless networks are different, and the network signals of the two preferred wireless networks are both in a preset third signal interval, then the preferred wireless network to be deleted is determined based on the priority of each frequency band and the signal strength of the two preferred wireless networks. After deleting the preferred wireless network to be deleted, the process returns to the step of traversing each of the sorted preferred wireless networks, wherein any signal value in the second signal interval is greater than any signal value in the third signal interval.
6. The method according to claim 5, characterized in that, The step of determining the preferred wireless network to be deleted from the two preferred wireless networks based on the priority of each frequency band and the signal strength of the two preferred wireless networks includes: Based on the priority of each frequency band, the target preferred wireless network with the lower frequency band priority among the two preferred wireless networks is determined; The signal strength of the target preferred wireless network is increased by a specified value to obtain the compensated signal strength of the target preferred wireless network; The wireless network to be deleted is obtained based on the compensated signal strength of the target preferred wireless network and the signal strength of another preferred wireless network.
7. The method according to claim 1, characterized in that, The process of determining the network to be connected based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet includes: If the network degradation coefficient of the target wireless network is greater than that of the Ethernet network, then the Ethernet is identified as the network to be connected; or, If the network degradation coefficient of the target wireless network is less than that of the Ethernet network degradation coefficient, then the target wireless network is identified as the network to be connected, or... If the network degradation coefficient of the target wireless network is equal to the network degradation coefficient of the Ethernet, then the target wireless network or the Ethernet is determined as the network to be connected.
8. The method according to claim 1, characterized in that, The network degradation coefficient of the target wireless network and any network in the Ethernet network is determined by the following method: The network degradation coefficient of any given network is obtained by adding the average latency rate of any given network and the abnormal disconnection rate of any given network.
9. The method according to claim 1 or 8, characterized in that, The average latency of the target wireless network and any network in the Ethernet network is obtained in the following way: For any one of the target wireless network and the Ethernet, after successfully connecting to any one of the networks, an ICMP request packet is sent to the server; When a response corresponding to the ICMP request packet is received from the server, the network delay duration is obtained based on the sending time and the receiving time, wherein the sending time is the time when the ICMP request packet is sent to the server, and the receiving time is the time when the response corresponding to the ICMP request packet is received from the server. The average network latency corresponding to sending a specified number of ICM P request packets is determined as the average latency of any network. The average latency rate of any given network is obtained based on the average latency duration of that network. The network anomaly rate of the target wireless network and any network in the Ethernet network is obtained in the following way: For any network in the target wireless network and the Ethernet, the network anomaly rate of the network is obtained based on the number of times the network disconnects from the IoT module and the total number of disconnections. The total number of disconnections is the sum of the number of times the target wireless network disconnects from the IoT module and the number of times the Ethernet disconnects from the IoT module.
10. An Internet of Things (IoT) module, characterized in that, It includes a processor and a memory, which are connected via a bus; The memory stores a computer program, and the processor is configured to perform the following operations based on the computer program: When the IoT module is disconnected from the connected network, the target wireless network is determined from the wireless networks corresponding to the IoT module based on the frequency band and signal strength of each wireless network. The network degradation coefficient of the target wireless network is obtained by using the average latency rate and the network anomaly rate of the target wireless network. Furthermore, the network degradation coefficient of the Ethernet is obtained by using the average latency rate of the Ethernet corresponding to the IoT module and the network anomaly rate of the Ethernet; wherein, the average latency rate of the target wireless network and any network in the Ethernet is obtained based on the network latency duration of any network, and the network anomaly rate of any network is obtained by the number of times the any network disconnects from the IoT module; Based on the network degradation coefficient of the target wireless network and the network degradation coefficient of the Ethernet, the network to be connected is determined, and a connection is made with the network to be connected.