Data transmission method of multi-link data transmission terminal
By creating multiple sockets in multi-link data transmission and monitoring link status in real time, dynamically generating and updating routing tables to achieve link handover, problems such as link management, data integrity, security, bandwidth utilization and user experience in the prior art are solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202411743801.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-30
- Publication Date
- 2025-03-04
AI Technical Summary
The existing multi-link data transmission technology has many shortcomings in link management, data integrity, security, bandwidth utilization and user experience, resulting in insufficient performance and reliability, limiting its application scope.
By obtaining all networks selected by the mobile phone, creating multiple sockets one by one correspond to their corresponding network types, and monitoring link status in real time, dynamically generating and updating routing tables to achieve link handover, and optimizing data transmission strategies to improve bandwidth utilization and user experience.
It improves the reliability and continuity of data transmission, enhances the system's parallel transmission capabilities and network resource utilization efficiency, and improves the user experience and success rate of data transmission.
Smart Images

Figure CN119561996A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of data transmission, and in particular relates to a method for data transmission of a multi-link data transmission terminal. Background Art
[0002] With the rapid development of the Internet of Things, smart cities, and industrial automation, data transmission technology is becoming increasingly important in various application scenarios. As an emerging data transmission solution, multi-link data transmission terminals are designed to transmit data simultaneously through multiple links to improve the reliability and efficiency of data transmission. However, the current multi-link data transmission technology still has many defects in practical applications, which restricts its performance and application scope.
[0003] Existing multi-link transmission technologies generally face the problem of complex link management. When multiple links are working at the same time, how to effectively manage and coordinate these links becomes a major challenge. Many systems lack intelligent decision-making mechanisms when selecting and switching links, resulting in conflicts between links and waste of resources. For example, when a link fails, the system fails to switch to other normal links in time, resulting in interruption of data transmission. This lack of management makes the multi-link system less adaptable when facing network changes and cannot give full play to its potential advantages.
[0004] The problem of data packet reorganization and sorting is also a major drawback of the existing technology. During multi-link transmission, the order of data packets may change because the data packets may reach the receiving end through different paths. This situation has a negative impact on the integrity and consistency of the data and increases the complexity of data processing. Many existing systems rely on relatively simple algorithms when processing these out-of-order data packets and lack efficient reorganization mechanisms, which can easily lead to delays and data loss, affecting the overall transmission efficiency and user experience.
[0005] The current multi-link data transmission technology also has deficiencies in terms of security. As the amount of data increases, data faces more security risks during transmission, including data theft, tampering, and forgery. Many existing solutions fail to fully consider security protection measures during design, resulting in the inability to effectively guarantee the security of data during multi-link transmission. In addition, the diversity of the links themselves also makes security management more complicated. How to effectively deploy security policies between multiple links is an urgent problem to be solved.
[0006] The bandwidth utilization of existing multi-link data transmission systems is often not high. Although multiple links can transmit data in parallel in theory, the actual bandwidth utilization is often far lower than expected due to improper scheduling and management. Many systems lack intelligent strategies for link load balancing, resulting in some links being overloaded while other links are idle, resulting in a waste of resources. Therefore, improving bandwidth utilization efficiency is an urgent problem that current multi-link data transmission technology needs to solve.
[0007] User experience has not been given enough attention in existing multi-link transmission technologies. Many systems lack real-time monitoring and feedback mechanisms during data transmission, and users cannot immediately learn about the status and problems of data transmission. This information asymmetry leads to a decrease in user trust in the system and reduces user satisfaction. In addition, the system may experience long delays and instability during transmission, affecting normal user use.
[0008] The current multi-link data transmission terminal data transmission technology has many defects in link management, data integrity, security, bandwidth utilization and user experience. The existence of these problems not only affects the performance and reliability of multi-link transmission technology, but also limits its promotion and implementation in a wider range of application scenarios. Therefore, it is particularly important to develop a more intelligent, efficient and secure multi-link data transmission terminal data transmission method to meet the growing data transmission needs and application challenges. Summary of the invention
[0009] The present invention provides a method for data transmission of a multi-link data transmission terminal. The method solves the problems of link instability and efficient switching of the multi-link data transmission terminal during data transmission, thereby ensuring the reliability and continuity of data transmission.
[0010] The technical solution of the present invention is implemented as follows: a method for data transmission of a multi-link data transmission terminal, the method comprising the following steps, and the following steps are performed in sequence;
[0011] Step 1: Get all the networks selected by the mobile phone, get the type of each network, and create a socket based on the network type;
[0012] Step 2: Create the number of sockets according to the number of networks obtained in step 1. Each socket corresponds to a network one by one, and each socket is connected to its corresponding network. Divide the network into wired network and wireless network, and process the wired network and wireless network with different threads. For the wired network, obtain the IP and port of the wired network and create a socket and connect to the network according to the IP and port. For the wireless network, obtain the network IP and port according to the access point names of Wifi and 2G, 3G, and 4G cellular networks, and create a socket to connect to the network according to their respective IP and port.
[0013] Step 3: After each socket is created, a heartbeat packet is sent to the server at regular intervals to detect whether each network is unobstructed;
[0014] Step 4: Format the original data sent by the terminal and then send it out through each link; obtain the corresponding IP and port according to different link types, and obtain the available socket according to the IP and port; convert the formatted data into a byte array, and send the byte array to the server through the available socket obtained;
[0015] Step 5: Transmit data through each link, monitor the connectivity of each network in real time, and create a routing table based on the connectivity to switch links; monitor the connectivity of the corresponding links in real time according to each socket in step 3. When a link is blocked, create a corresponding route. The route name needs to be named after the network type corresponding to the link, obtain the socket ID of the socket corresponding to the link, and store the socket ID in the routing table; when a link is connected, delete the route name named after the network type corresponding to the link, so that the number of routes in the system is always equal to the number of available sockets;
[0016] Step 6: When a link is blocked, the corresponding socket is selected through the routing table to send data; when the routing table is not empty, the routing table is traversed, each route name is separated by a space, and the second parameter is intercepted as the routing link type; according to the obtained routing link type, the socket, IP and port are created, and the connectivity of each routing link is detected; according to the result of the route creation, whether there is an available routing link is determined, and if there is an available routing link, the corresponding routing link is selected to send data; when there is no available routing link, the data is cached in the memory and the routing table is continued to be monitored;
[0017] Step 7: The routing table is updated in a loop. Each time the loop is completed, the on / off status of each socket is monitored in real time. For each new path, the link of the corresponding route is deleted. For each offline socket, a route named after the link type parameter of the link corresponding to the socket is created, and the corresponding socketID is obtained and added to the routing table. In this way, the on / off status of each network can be monitored in real time, and the link can be automatically switched in real time.
[0018] Compared with the existing technology, the multi-link data transmission terminal data transmission method has shown significant innovation and superiority in many aspects. The traditional single-link transmission method often results in the inability to complete the entire data transmission task when a link fails, seriously affecting the real-time and reliability of the data. This method obtains all the networks selected by the mobile phone, creates multiple sockets corresponding to their corresponding network types, and processes them through independent threads regardless of whether they are wired or wireless networks, greatly enhancing the system's parallel transmission capabilities. This design enables the device to maintain efficient data interaction even in complex and changeable network environments.
[0019] Traditional network transmission is generally simple in terms of link status monitoring and failure recovery, and mostly relies on one-time connection establishment. Once a disconnection occurs, it cannot be quickly restored. This method monitors the connectivity of each socket in real time by sending heartbeat packets at regular intervals. When a link is found to be failed, a new route can be quickly generated and the available sockets can be dynamically maintained in the routing table. Each update can not only delete the failed route, but also ensure that the newly established connection is promptly identified and added to the routing table, which improves the flexibility and adaptability of network transmission.
[0020] This method also adds a detailed distinction between network types, and can perform more targeted policy processing based on different network characteristics. For example, different processing mechanisms for wired networks and wireless networks can bring higher efficiency and lower latency in actual use. In addition, through the data transmission method of different links, bandwidth usage is optimized, communication efficiency and data transmission success rate are improved.
[0021] At the same time, data formatting and byte array conversion are also fully considered in the existing technology to ensure that the sent data can be transmitted in the optimal format in a variety of network environments. The existing technology often only considers the connection itself, but lacks a full grasp of the effective data processing process. This method emphasizes that the original data will be formatted and sent through multiple links, thereby effectively preventing data loss caused by link failure.
[0022] As a preferred implementation, in step 2, the ip and socket of the wired network are obtained through the getConnectionInfo() in the object method of the wired network interface manager android.net.wifi.WifiManager. After obtaining the ip and port, the connect method in the socket is used to connect to the network.
[0023] As a preferred implementation, the specific steps of step 3 are as follows: determine whether it is a wireless network. If it is a wireless network, use a timed execution method to send heartbeat packets to the server at a time higher than the set frequency. If it is a wired network, use a thread to send heartbeat packets, and adjust the frequency of sending heartbeat packets according to the actual network conditions; send the heartbeat packets to the server according to the network protocol, and use a timer to detect the feedback of the heartbeat packets of each network; if there is feedback, the link is considered to be connected, otherwise it is disconnected.
[0024] After adopting the above technical solution, the beneficial effect of the present invention is that by managing multiple network links in parallel, the device can maintain fast and stable data transmission when the network status is good. This mechanism significantly improves the success rate and transmission speed of data transmission. Secondly, the real-time monitoring of the link status and the generation and update of the dynamic routing table enable the system to quickly adjust the data sending strategy when the link changes, thereby ensuring the continuity of transmission. This means that even after a link is disconnected, data can be seamlessly transmitted through other available links, reducing the impact caused by link failures. The real-time monitoring and update functions effectively reduce the delay of the terminal during data transmission, which helps to improve the user experience, especially in situations where real-time data interaction is required. Through the caching mechanism, when there is no available link, the data will be temporarily stored in the memory, which will not cause data loss and provide protection for subsequent transmission. At the same time, flexible socket management can be dynamically adjusted according to the network load, thereby optimizing the use of network resources and reducing bandwidth consumption, extending the survivability of the device in complex environments. Through the above design, this method not only improves the efficiency and reliability of data transmission, but also provides solid technical support for the stable operation of multi-link data transmission terminals in various practical applications, especially in mobile communications, Internet of Things and smart devices, thereby highlighting stronger competitiveness and adaptability in the growing market demand. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0026] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0028] Example:
[0029] like Figure 1 As shown, a method for data transmission of a multi-link data transmission terminal, the method comprises the following steps, and the following steps are performed in sequence;
[0030] Step 1: Get all the networks selected by the mobile phone, get the type of each network, and create a socket based on the network type;
[0031] Step 2: Create the number of sockets according to the number of networks obtained in step 1. Each socket corresponds to a network one by one, and each socket is connected to its corresponding network. Divide the network into wired network and wireless network, and process the wired network and wireless network with different threads. For the wired network, obtain the IP and port of the wired network and create a socket and connect to the network according to the IP and port. For the wireless network, obtain the network IP and port according to the access point names of Wifi and 2G, 3G, and 4G cellular networks, and create a socket to connect to the network according to their respective IP and port.
[0032] Step 3: After each socket is created, a heartbeat packet is sent to the server at regular intervals to detect whether each network is unobstructed;
[0033] Step 4: Format the original data sent by the terminal and then send it out through each link; obtain the corresponding IP and port according to different link types, and obtain the available socket according to the IP and port; convert the formatted data into a byte array, and send the byte array to the server through the available socket obtained;
[0034] Step 5: Transmit data through each link, monitor the connectivity of each network in real time, and create a routing table based on the connectivity to switch links; monitor the connectivity of the corresponding links in real time according to each socket in step 3. When a link is blocked, create a corresponding route. The route name needs to be named after the network type corresponding to the link, obtain the socket ID of the socket corresponding to the link, and store the socket ID in the routing table; when a link is connected, delete the route name named after the network type corresponding to the link, so that the number of routes in the system is always equal to the number of available sockets;
[0035] Step 6: When a link is blocked, the corresponding socket is selected through the routing table to send data; when the routing table is not empty, the routing table is traversed, each route name is separated by a space, and the second parameter is intercepted as the routing link type; according to the obtained routing link type, the socket, IP and port are created, and the connectivity of each routing link is detected; according to the result of the route creation, whether there is an available routing link is determined, and if there is an available routing link, the corresponding routing link is selected to send data; when there is no available routing link, the data is cached in the memory and the routing table is continued to be monitored;
[0036] Step 7: The routing table is updated in a loop. Each time the loop is completed, the on / off status of each socket is monitored in real time. For each new path, the link of the corresponding route is deleted. For each offline socket, a route named after the link type parameter of the link corresponding to the socket is created, and the corresponding socketID is obtained and added to the routing table. In this way, the on / off status of each network can be monitored in real time, and the link can be automatically switched in real time.
[0037] Compared with the existing technology, the multi-link data transmission terminal data transmission method has shown significant innovation and superiority in many aspects. The traditional single-link transmission method often results in the inability to complete the entire data transmission task when a link fails, seriously affecting the real-time and reliability of the data. This method obtains all the networks selected by the mobile phone, creates multiple sockets corresponding to their corresponding network types, and processes them through independent threads regardless of whether they are wired or wireless networks, greatly enhancing the system's parallel transmission capabilities. This design enables the device to maintain efficient data interaction even in complex and changeable network environments.
[0038] Traditional network transmission is generally simple in terms of link status monitoring and failure recovery, and mostly relies on one-time connection establishment. Once a disconnection occurs, it cannot be quickly restored. This method monitors the connectivity of each socket in real time by sending heartbeat packets at regular intervals. When a link is found to be failed, a new route can be quickly generated and the available sockets can be dynamically maintained in the routing table. Each update can not only delete the failed route, but also ensure that the newly established connection is promptly identified and added to the routing table, which improves the flexibility and adaptability of network transmission.
[0039] This method also adds a detailed distinction between network types, and can perform more targeted policy processing based on different network characteristics. For example, different processing mechanisms for wired networks and wireless networks can bring higher efficiency and lower latency in actual use. In addition, through the data transmission method of different links, bandwidth usage is optimized, communication efficiency and data transmission success rate are improved.
[0040] At the same time, data formatting and byte array conversion are also fully considered in the existing technology to ensure that the sent data can be transmitted in the optimal format in a variety of network environments. The existing technology often only considers the connection itself, but lacks a full grasp of the effective data processing process. This method emphasizes that the original data will be formatted and sent through multiple links, thereby effectively preventing data loss caused by link failure.
[0041] The system workflow starts from step 1, where the user selects an available network through the mobile phone. The system will obtain information about all selected networks and identify the type of each network (such as wired or wireless). During this process, the system will create corresponding sockets based on different network types. For wired networks, the system obtains the IP address and port information of the wired network by calling the getConnectionInfo() method in Android's network interface manager android.net.wifi.WifiManager. The system then uses this information to create a socket connection.
[0042] In step 2, the system creates a corresponding number of sockets based on the number of networks obtained, and each socket corresponds to its corresponding network. For wired networks, the system obtains the IP and port and creates a socket connection; for wireless networks, it obtains the network IP and port according to different access point names such as WiFi, 2G, 3G, 4G, and connects. It is worth noting that wired and wireless networks are processed by different threads. This design not only improves the system's parallel capabilities, but also manages network resources more effectively.
[0043] In step 3, the system sends heartbeat packets to each created socket at regular intervals to detect the connectivity of each network. For wireless networks, the system uses a timed execution method to send heartbeat packets to the server at a higher frequency than the set frequency; for wired networks, a dedicated thread is used to send heartbeat packets, and the frequency is adjusted according to the actual situation of the network. This heartbeat mechanism can monitor the status of each network in real time and provide timely feedback on the connectivity of the link to ensure the reliability of data transmission.
[0044] In step 4, the system formats the raw data sent by the terminal and then sends it out through each link. The formatted data is converted into a byte array and sent to the server using an available socket. The key to this process is that the system obtains the corresponding IP and port according to different link types, and then selects the appropriate socket for data transmission. This stage ensures that the data is kept in the best format during transmission, thereby improving the success rate of transmission.
[0045] Entering step 5, the system transmits data through each link and monitors the connectivity of the network in real time. At this time, the system will dynamically create a routing table based on the link status to facilitate rapid switching when a link fails. Specifically, when a link is not connected, the system will create a corresponding route and store the socketID of the socket corresponding to the link in the routing table; on the contrary, when a link is restored, the system will delete the route named after the network type corresponding to the link to ensure that the number of available sockets is always reflected in the routing table.
[0046] In step 6, when a link is blocked, the system will select a suitable socket to send data through the routing table. The system will traverse the routing table, obtain the name of each route, and determine the routing link type based on the second parameter in the name. Then, the system will create a new socket and its corresponding IP and port, and check the connectivity of each routing link. If an available routing link is found, the corresponding route will be selected to send data; if no routing link is available, the system will cache the data in memory and continue to monitor changes in the routing table.
[0047] In step 7, the routing table will be updated cyclically, and the system will monitor the connection and disconnection of each socket in real time. When a new path is found, the system will delete the corresponding invalid route; when a socket is found to be no longer online, a new route named after the link type corresponding to the socket will be created, and the socketID will be added to the routing table. This dynamic update mechanism ensures that the system can always respond to changes in the network environment in a timely manner, thereby realizing the ability to automatically switch links.
[0048] Through the above steps, the multi-link data transmission terminal data transmission method can achieve efficient and reliable data transmission in a complex and changeable network environment, and effectively prevent data loss or transmission delay caused by a single link failure. This method not only improves the real-time performance of data transmission, but also enhances the system's adaptability under different network conditions, and has important practical application value.
[0049] In step 2, the IP and socket of the wired network are obtained through the getConnectionInfo() method of the wired network interface manager android.net.wifi.WifiManager. After obtaining the IP and port, the connect method in the socket is used to connect to the network.
[0050] Traditional network connection methods often rely on one-time connection establishment and lack the ability to dynamically monitor and adapt to network status. In contrast, this technical solution uses the getConnectionInfo() method of the android.net.wifi.WifiManager interface to obtain the IP address and port information of the wired network, demonstrating a more efficient and intelligent network connection management capability. Traditional methods usually do not have a clear mechanism to handle connections of different types of networks, and often mix wired and wireless networks, resulting in low connection efficiency when the network environment is complex. This solution uses a dedicated interface manager to identify the network type and dynamically creates a socket based on the acquired IP and port information, ensuring that each network can be effectively utilized. This approach not only enhances the flexibility of the system, but also improves the connection stability and reliability in a variety of network environments.
[0051] In addition, traditional technologies often do not have the ability to monitor network status in real time after a connection is established, resulting in the system being unable to respond and adjust in time once a network problem occurs. However, this solution adopts a processing strategy for different network types in step 2, by creating an independent socket and calling the connect method to connect, ensuring effective switching between wired and wireless networks. This strategy can be adaptively adjusted according to the actual situation of the network, significantly improving the success rate and real-time performance of data transmission.
[0052] The specific steps of step 3 are as follows: determine whether it is a wireless network. If it is a wireless network, use the timed execution method to send heartbeat packets to the server at a time higher than the set frequency. If it is a wired network, use a thread to send heartbeat packets, and adjust the frequency of sending heartbeat packets according to the actual situation of the network; send the heartbeat packets to the server according to the network protocol, and use a timer to detect the feedback of the heartbeat packets of each network; if there is feedback, the link is considered to be connected, otherwise it is disconnected.
[0053] In step 3, the technical solution further demonstrates its difference from the prior art. Traditional network monitoring methods mostly rely on static methods and cannot effectively deal with network fluctuations and interruptions. In contrast, after determining the network type, this solution uses a timed execution method that is higher than the set frequency for wireless networks to regularly send heartbeat packets to the server to monitor network connectivity. This dynamic heartbeat mechanism enables the system to understand the status of each network in real time, and to promptly detect and handle connection problems. For wired networks, this solution uses a single thread to send heartbeat packets and adjusts the sending frequency according to network conditions. This flexibility is difficult to achieve in the prior art. Traditional technologies often perform static settings during the connection phase and lack the ability to automatically adjust according to real-time conditions.
[0054] The feedback mechanism of the heartbeat packet is also an important innovation of this solution. By sending the heartbeat packet to the server according to the network protocol and using the timer to detect the feedback, the system can accurately determine the connectivity status of the network. Compared with the existing technology, this significantly improves the reliability of the network connection and ensures that the system can respond quickly and take corresponding measures when a link fails. If a link is found to have no feedback, the system will mark it as disconnected. This timely feedback mechanism provides a guarantee for the stability of data transmission.
[0055] This technical solution demonstrates significant innovation and superiority over existing technologies by using a dedicated network interface manager, dynamically creating socket connections, implementing a flexible heartbeat packet sending strategy, and a real-time network status feedback mechanism. These improvements not only improve the efficiency and stability of data transmission, but also provide reliable support for rapid response and adjustment in complex network environments.
[0056] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for transmitting data at a multi-link data transmission terminal, characterized in that: The method comprises the following steps, and the following steps are performed sequentially; Step 1: Get all the networks selected by the mobile phone, get the type of each network, and create a socket based on the network type; Step 2: Create the number of sockets according to the number of networks obtained in step 1. Each socket corresponds to a network one by one, and each socket is connected to its corresponding network. Divide the network into wired network and wireless network, and process the wired network and wireless network with different threads. For the wired network, obtain the IP and port of the wired network and create a socket and connect to the network according to the IP and port. For the wireless network, obtain the network IP and port according to the access point names of Wifi and 2G, 3G, and 4G cellular networks, and create a socket to connect to the network according to their respective IP and port. Step 3: After each socket is created, a heartbeat packet is sent to the server at regular intervals to detect whether each network is unobstructed; Step 4: Format the original data sent by the terminal and then send it out through each link; obtain the corresponding IP and port according to different link types, and obtain the available socket according to the IP and port; Convert the formatted data into a byte array and send the byte array to the server through the available socket obtained; Step 5: Transmit data through each link, monitor the connectivity of each network in real time, and create a routing table based on the connectivity to switch links; monitor the connectivity of the corresponding links in real time according to each socket in step 3. When a link is blocked, create a corresponding route. The route name needs to be named after the network type corresponding to the link, obtain the socket ID of the socket corresponding to the link, and store the socket ID in the routing table; when a link is connected, delete the route name named after the network type corresponding to the link, so that the number of routes in the system is always equal to the number of available sockets; Step 6: When a link is blocked, the corresponding socket is selected through the routing table to send data; when the routing table is not empty, the routing table is traversed, each route name is separated by a space, and the second parameter is intercepted as the routing link type; according to the obtained routing link type, the socket, IP and port are created, and the connectivity of each routing link is detected; according to the result of the route creation, whether there is an available routing link is determined, and if there is an available routing link, the corresponding routing link is selected to send data; when there is no available routing link, the data is cached in the memory and the routing table is continued to be monitored; Step 7: The routing table is updated in a loop. Each time the loop is completed, the on / off status of each socket is monitored in real time. For each new path, the link of the corresponding route is deleted. For each offline socket, a route named after the link type parameter of the link corresponding to the socket is created, and the corresponding socketID is obtained and added to the routing table. In this way, the on / off status of each network can be monitored in real time, and the link can be automatically switched in real time.
2. A method for transmitting data via a multi-link data transmission terminal as claimed in claim 1, characterized in that: In step 2, the IP and socket of the wired network are obtained through the getConnectionInfo() method of the wired network interface manager android.net.wifi.WifiManager. After obtaining the IP and port, the connect method in the socket is used to connect to the network.
3. A method for transmitting data via a multi-link data transmission terminal as claimed in claim 1, characterized in that: The specific steps of step 3 are as follows: determine whether it is a wireless network. If it is a wireless network, use the timed execution method to send heartbeat packets to the server at a time higher than the set frequency. If it is a wired network, use a thread to send heartbeat packets, and adjust the frequency of sending heartbeat packets according to the actual situation of the network; send the heartbeat packets to the server according to the network protocol, and use a timer to detect the feedback of the heartbeat packets of each network; if there is feedback, the link is considered to be connected, otherwise it is disconnected.