Data transmission method and apparatus, electronic device, and computer program product
Patent Information
- Application Number
- PCT/CN2026/085573
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-03-25
- Filing Date
- 2026-03-24
- Publication Date
- 2026-10-01
Smart Images

Figure CN2026085573_01102026_PF_FP_ABST
Abstract
Description
Data transmission methods, apparatus, electronic devices and computer program products
[0001] This application claims priority to Chinese Patent Application No. 2025103659235, filed on March 25, 2025, entitled “Data Transmission Method, Apparatus, Electronic Device and Computer Program Product”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of communication technology, specifically to a data transmission method, apparatus, electronic device, and computer program product. Background Technology
[0003] To improve end-to-end data transmission efficiency and stability, multiple data transmission paths can be established between endpoints (such as application clients and servers), and data can be transmitted through one or more of these paths. Currently, when switching data transmission paths, communication between endpoints is interrupted, causing data transmission disruptions and resulting in application lag and other issues that severely impact user experience. Summary of the Invention
[0004] This application discloses a data transmission method, apparatus, electronic device, and computer program product. The IP address used remains unchanged and will not change with link switching, ensuring that data transmission is not interrupted. It can realize seamless link switching of services, avoid service lag and other situations, and improve user experience.
[0005] This application discloses a data transmission method applied to a terminal device, wherein the terminal device establishes a first wireless communication link and a second wireless communication link with the same network device or with different network devices, and the method includes:
[0006] Based on the Internet Protocol (IP) address corresponding to the first wireless communication link, the data to be transmitted is encapsulated to obtain the IP data packet to be transmitted.
[0007] If the first link switching condition is met, the IP data packet is sent through the second wireless communication link. The first link switching condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0008] This application discloses a data transmission method applied to a target wireless access point, wherein the target wireless access point and a terminal device respectively establish a first wireless communication link and a second wireless communication link, the method comprising:
[0009] The terminal device receives a handover request, which is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, under the condition that the first link handover condition is met; the first link handover condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0010] In response to the handover request, data is sent to the terminal device via the second wireless communication link.
[0011] This application discloses a data transmission apparatus applied to a terminal device, wherein the terminal device establishes a first wireless communication link and a second wireless communication link with the same network device or with different network devices, and the apparatus includes:
[0012] The encapsulation module is used to encapsulate the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted.
[0013] The transmission module is configured to send the IP data packet through the second wireless communication link when a first link switching condition is met, wherein the first link switching condition is a condition for switching from the first wireless communication link to the second wireless communication link.
[0014] This application discloses a data transmission apparatus applied to a target wireless access point, wherein the target wireless access point and a terminal device establish a first wireless communication link and a second wireless communication link, respectively. The apparatus includes:
[0015] The request receiving module is used to receive a handover request sent by the terminal device. The handover request is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, under the condition that the first link handover condition is met. The first link handover condition is the condition for handover from the first wireless communication link to the second wireless communication link.
[0016] The data transmission module is used to send data to the terminal device via the second wireless communication link in response to the handover request.
[0017] This application discloses an electronic device, including a memory, a processor, and a transceiver unit. The memory stores a computer program, and when the computer program is executed by the processor, the electronic device performs the method described in any of the above embodiments.
[0018] This application discloses a computer-readable storage medium storing a computer program thereon, which, when executed by a processor in an electronic device, causes the electronic device to perform the method described in any of the above embodiments.
[0019] This application discloses a computer program product, including a computer program, which, when executed by a processor in an electronic device, causes the electronic device to perform the method described in any of the above embodiments.
[0020] Details of one or more embodiments of this application are set forth in the following drawings and description. Other features and advantages of this application will be apparent from the specification, drawings, and claims. Attached Figure Description
[0021] To more clearly illustrate the technical solutions in the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0022] Figure 1A is a schematic diagram of the MP-TCP technology architecture in related technologies;
[0023] Figure 1B is a schematic diagram of the data transmission process of dual Wi-Fi technology in related technologies;
[0024] Figure 1C is a schematic diagram of the Bonding technology in related technologies;
[0025] Figure 2A is an application scenario diagram of the data transmission method in one embodiment;
[0026] Figure 2B is an application scenario diagram of the data transmission method in another embodiment;
[0027] Figure 2C is a schematic diagram of a seven-layer network protocol architecture in one embodiment;
[0028] Figure 3 is a flowchart of a data transmission method in one embodiment;
[0029] Figure 4 is a schematic diagram of communication link switching in one embodiment;
[0030] Figure 5 is a flowchart of a data transmission method in another embodiment;
[0031] Figure 6 is a flowchart of evaluating the quality of a first link corresponding to a first wireless communication link in one embodiment;
[0032] Figure 7 is a schematic diagram of evaluating the link quality corresponding to a wireless communication link in one embodiment;
[0033] Figure 8 is a flowchart of switching the communication link used in one embodiment when the source IP address remains unchanged.
[0034] Figure 9 is a schematic diagram of switching communication links in one embodiment while keeping the source IP address unchanged;
[0035] Figure 10 is a flowchart of switching the communication link used in another embodiment, while keeping the source IP address unchanged.
[0036] Figure 11 is a flowchart of switching the communication link used in another embodiment when the source IP address remains unchanged;
[0037] Figure 12 is a schematic diagram of switching communication links in another embodiment while keeping the source IP address unchanged;
[0038] Figure 13 is a timing diagram of the switching of the downlink communication link in one embodiment;
[0039] Figure 14A is a schematic diagram of communication link switching in another embodiment;
[0040] Figure 14B is a schematic diagram of communication link switching in another embodiment;
[0041] Figure 15 is a flowchart of a data transmission method in another embodiment;
[0042] Figure 16 is a block diagram of a data transmission device in one embodiment;
[0043] Figure 17 is a block diagram of a data transmission device in another embodiment;
[0044] Figure 18 is a structural block diagram of an electronic device in one embodiment. Detailed Implementation
[0045] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0046] It should be noted that the terms "comprising" and "having," and any variations thereof, in the embodiments and accompanying drawings of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or device that includes a series of steps or units is not limited to the steps or units listed, but may optionally include steps or units not listed, or may optionally include other steps or units inherent to these processes, methods, products, or devices.
[0047] It is understood that the terms "first," "second," etc., used in this application may be used to describe various elements herein, but these elements are not limited by these terms. These terms are only used to distinguish one element from another. For example, without departing from the scope of this application, a first wireless communication link may be referred to as a second wireless communication link, and similarly, a second wireless communication link may be referred to as a first wireless communication link. Both the first wireless communication link and the second wireless communication link are wireless communication links, but they are not the same wireless communication link. The term "multiple" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the schemes, or any combination of multiple schemes.
[0048] The following is an introduction to some of the terms used in this case:
[0049] TCP / IP (Transmission Control Protocol / Internet Protocol) refers to a suite of protocols that enable information transmission between multiple different networks. It includes not only TCP and IP protocols, but also other protocols such as FTP (File Transfer Protocol), SMTP (Simple Mail Transfer Protocol), and UDP (User Datagram Protocol).
[0050] TCP protocol: It is a connection-oriented, reliable, byte-stream-based transport layer communication protocol with a robust reliability mechanism.
[0051] UDP protocol: It is a connectionless, message-oriented transport layer communication protocol. UDP protocol only makes a best-effort delivery, but does not guarantee reliable delivery.
[0052] L3: L3 refers to the third layer in the seven-layer network protocol, namely the network layer.
[0053] L2: L2 refers to the second layer in the seven-layer network protocol, namely the data link layer.
[0054] IPv4 (Internet Protocol version 4): Specifies that the IP address length is 32 bits.
[0055] IPv6 (Internet Protocol version 6): Specifies that the IP address length is 128 bits, which solves the problem of insufficient network address resources that existed in IPv4.
[0056] IP address: A unified address format provided by the IP protocol, which assigns a communication address to every device on the Internet. Different network interfaces on a device are assigned different IP addresses. The IP addresses involved in the embodiments of this application can be IPv4 IP addresses, IPv6 IP addresses, or IP addresses provided by other versions of the IP protocol.
[0057] A socket is an abstraction of an endpoint for bidirectional communication between processes of different electronic devices on a network. A socket is one end of the communication between processes on the network, providing a mechanism for application layer processes to exchange data using network protocols.
[0058] Wi-Fi is a wireless local area network communication technology based on the IEEE 802.11 standard.
[0059] Wireless AP (Access Point): The core device of a wireless local area network (WLAN) provides network access services for wireless devices (such as mobile phones, tablets, and laptops), enabling them to access wired networks or the Internet.
[0060] STA (Station): refers to terminal devices or client devices in a wireless local area network, such as mobile phones and computers. These devices typically operate in STA mode and can access the network by connecting to a wireless access point (AP).
[0061] NAT (Network Address Translation) table: Used for network address translation, it can convert internal private IP addresses into legal public network IP addresses by modifying the source IP address or destination IP address of data packets.
[0062] Hardware acceleration table: A technique used to optimize packet processing and forwarding efficiency, which can be used to store packet forwarding rules and related information.
[0063] In related technologies, the communication protocols or technologies commonly used for data transmission between ends can include the following:
[0064] 1. MP-TCP (Multipath TCP, Multipath Transmission Control Protocol)
[0065] MP-TCP is an extension of the traditional TCP protocol that allows data transmission using multiple network paths simultaneously within a single TCP connection. Both the application client and application server need to deploy MP-TCP software, and the application client and application server can establish multi-path transmission through processes such as network discovery and negotiation.
[0066] The data sender can evaluate the quality of each network path using algorithms and select the optimal one or more network paths to send data based on a scheduling strategy. Furthermore, the data sender segments the data into multiple fragments and transmits them through different network paths. The data receiver can reassemble the received fragments according to their sequence numbers to ensure data integrity and order. For example, the MP-TCP technology architecture can be shown in Figure 1A.
[0067] MP-TCP can improve data throughput and transmission reliability for data transmission. However, MP-TCP only supports TCP-based applications and cannot be used for applications using transport layer protocols such as UDP. Furthermore, it only works if both the application client and the application server support MP-TCP, thus limiting its application scope.
[0068] 2. Dual Wi-Fi technology
[0069] Terminal devices can connect to two Wi-Fi networks simultaneously (e.g., to the same router or to different routers) and obtain two IP addresses, allowing them to select the appropriate Wi-Fi network for data transmission.
[0070] Dual Wi-Fi technology can include two usage modes:
[0071] In the autonomous mode, the application binds to two network cards for data transmission and reception. The application can intelligently select one of the Wi-Fi networks or use two Wi-Fi networks simultaneously to send data, and then the data receiving end aggregates the received data.
[0072] For the application-autonomous mode, corresponding code development is required for each application to adapt to the need for data transmission and reception with dual network cards, which is highly complex and costly.
[0073] System scheduling mode: The terminal device has a kernel scheduling module in its kernel, which can identify the link quality of the two Wi-Fi networks respectively, and specify the Wi-Fi communication link to send data using socket streams as the scheduling unit. For example, this data transmission process can be shown in Figure 1B. The system scheduling mode can adopt two scheduling schemes:
[0074] Option 1: Determine the working Wi-Fi communication link when the socket stream is established, and do not switch the working Wi-Fi communication link subsequently based on the link quality.
[0075] Option 2: Dynamically switch the working Wi-Fi communication link corresponding to the socket stream based on the real-time link quality of the two Wi-Fi communication links.
[0076] Regarding the first scheme for system scheduling mode, when the quality of the Wi-Fi communication link changes, it may lead to unstable data transmission, packet loss, and other issues, resulting in application lag and low data efficiency.
[0077] For the second scheme of system scheduling mode, after switching the Wi-Fi communication link corresponding to the socket stream, the source IP address of the socket stream will change. Therefore, it is necessary to re-establish the socket connection with the destination device (such as the server), which will cause data transmission interruption and cause the application to lag.
[0078] 3. Linux Ethernet Bonding Driver Technology (hereinafter referred to as Bonding Technology)
[0079] Bonding technology is a technique used to bind multiple physical network interface cards (NICs) into a single logical NIC. This allows multiple NICs to be bound to the same IP address to provide services. Through different operating modes (such as round-robin load balancing, primary / backup redundancy, and broadcast), network redundancy, reliability, and bandwidth utilization can be improved. For example, Bonding technology can be illustrated in Figure 1C.
[0080] Bonding technology typically operates based on a stable wired network card speed configuration, making it unsuitable for scenarios with dynamically fluctuating link quality, such as Wi-Fi.
[0081] This application provides a data transmission method, apparatus, electronic device, and computer program product that can dynamically switch the data transmission link of a terminal device based on the link quality of the wireless communication link. This solves the problems of unstable data transmission and low transmission efficiency caused by changes in the link quality of the wireless communication link. Furthermore, the IP address used remains unchanged and will not change with the link switching, ensuring that data transmission is not interrupted. This enables seamless link switching for services, avoids service lag, and improves user experience.
[0082] Figure 2A illustrates an application scenario of the data transmission method in one embodiment. As shown in Figure 2A, the terminal device 210 can establish a first wireless communication link and a second wireless communication link with the same network device 220, respectively.
[0083] Figure 2B illustrates an application scenario of the data transmission method in another embodiment. As shown in Figure 2B, the terminal device 210 can establish a first wireless communication link and a second wireless communication link with different network devices 220, respectively.
[0084] Terminal device 210 may include, but is not limited to, mobile phones, wearable devices (such as smartwatches, smart glasses, etc.), vehicle terminals, tablet computers, laptop computers, and PC (Personal Computer) devices.
[0085] Network equipment 220 may include, but is not limited to, routers, other terminal devices that provide wireless access points (such as mobile phones, wearable devices, tablets, laptops, etc.), base stations, access network equipment, etc.
[0086] The aforementioned first and second wireless communication links may include, but are not limited to, Wi-Fi communication links established based on Wi-Fi technology and / or cellular communication links established based on cellular networks.
[0087] For example, when the terminal device 210 can establish a first wireless communication link and a second wireless communication link with the same network device 220 respectively, the network device 220 can be a router or other device, and the terminal device 210 can establish a first Wi-Fi communication link and a second Wi-Fi communication link with the router respectively. Optionally, the first Wi-Fi communication link can be a 2.4G frequency band Wi-Fi communication link, and the second Wi-Fi communication link can be a 5G frequency band Wi-Fi communication link, etc.
[0088] For example, when the terminal device 210 establishes a first wireless communication link and a second wireless communication link with different network devices 220 respectively, the different network devices 220 may be two different wireless access points (such as routers or other terminals). The terminal device may establish a first Wi-Fi communication link with one of the wireless access points and establish a second Wi-Fi communication link with the other wireless access point.
[0089] For example, when the terminal device 210 establishes a first wireless communication link and a second wireless communication link with different network devices 220 respectively, the different network devices 220 can be wireless access points and base stations. The terminal device can establish a Wi-Fi communication link with the wireless access point and a cellular communication link with the base station.
[0090] For example, when the terminal device 210 establishes a first wireless communication link and a second wireless communication link with different network devices 220 respectively, the different network devices 220 may be two different base stations. The terminal device can support access to two different cellular networks. Then the terminal device can establish a first cellular communication link with one of the base stations and establish a second cellular communication link with the other base station.
[0091] When terminal device 210 can establish a first wireless communication link and a second wireless communication link with the same network device 220 or with different network devices 220 respectively, the network device 220 or a DHCP (Dynamic Host Configuration Protocol) server assigns a corresponding IP address to terminal device 210. The IP address corresponding to the first wireless communication link is usually different from the IP address corresponding to the second wireless communication link. In related technologies, if terminal device 210 switches data transmission links, such as switching from the first wireless communication link to the second wireless communication link, or from the second wireless communication link to the first wireless communication link for data transmission, the IP address used by the upper-layer application will change accordingly. For the destination device of the data transmission (such as the application server), the new IP address will be recognized as a new source device (such as a new user device). The previously established socket connection needs to be disconnected and re-established, thus causing data transmission interruption, resulting in application service lag and other issues, severely impacting user experience.
[0092] In this embodiment, the terminal device 210 encapsulates the data to be transmitted based on the IP address corresponding to the first wireless communication link to obtain an IP data packet to be transmitted. When the first link switching condition is met, the IP data packet is sent through the second wireless communication link. The first link switching condition is the condition for switching from the first wireless communication link to the second wireless communication link. Even when the data transmission link of the terminal device 210 switches from the first wireless communication link to the second wireless communication link, the IP address corresponding to the first wireless communication link is still used to encapsulate the data to be transmitted. The IP address remains unchanged and does not change with the link switch. Therefore, it is not necessary to re-establish a communication channel with the destination device for data transmission, ensuring that data transmission is not interrupted. This enables seamless link switching, avoids service lag, and improves user experience.
[0093] Figure 2C is a schematic diagram of a seven-layer network protocol architecture in one embodiment. As shown in Figure 2C, the seven-layer network protocol architecture, from bottom to top, consists of: physical layer, data link layer, network layer, transport layer, session layer, presentation layer, and application layer.
[0094] The physical layer negative layer transmits the raw bit stream through physical infrastructure (such as cables, optical fibers, etc.).
[0095] The data link layer can be used to establish, maintain, or disconnect link connections, encapsulate the bit streams from the physical layer into frames, and perform error detection and correction to ensure the correct transmission of data frames.
[0096] The network layer can create logical links for data transmission between nodes and select appropriate paths for packet forwarding through routing algorithms and other methods.
[0097] The transport layer primarily supports end-to-end communication, ensuring reliable data transmission, and can shield the upper layers from the details of lower-layer data communication.
[0098] The session layer is responsible for establishing, managing, and terminating sessions between applications.
[0099] The presentation layer is responsible for data processing, such as data encoding and decoding, format conversion, encryption, decryption, compression, and decompression.
[0100] The application layer provides the interface between the user and the network, allowing direct interaction with the user and enabling network access functions for various applications, such as file transfer, sending and receiving emails, and web browsing.
[0101] In this embodiment, when the data transmission link of the terminal device 210 is switched, such as from the first wireless communication link to the second wireless communication link, the network layer still uses the IP address corresponding to the first wireless communication link to encapsulate the data to be transmitted (such as data sent by the transport layer) to obtain IP data packets. The IP address used by the network layer will not change with the link switch, but the link switch only occurs at the data link layer or the physical layer. The IP address used by the application remains unchanged. Therefore, it is not necessary to re-establish a socket connection with the destination device, and a seamless link switch can be achieved.
[0102] It should be noted that the data transmission method provided in this application is not only applicable to the seven-layer network protocol architecture described above, but can also be applied to other network protocol architectures, such as the four-layer network protocol architecture and five-layer network protocol architecture defined in the TCP / IP protocol. This application does not limit this.
[0103] As shown in Figure 3, in one embodiment, a data transmission method is provided, which can be applied to the aforementioned terminal device. The method may include the following steps:
[0104] Step 310: Encapsulate the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted.
[0105] A terminal device can establish a first wireless communication link and a second wireless communication link with the same network device or with different network devices. An application running on the terminal device can use the first wireless communication link and / or the second wireless communication link to transmit data with a destination device. The destination device can refer to a device that receives data sent by the application on the terminal device, and / or a device that sends data to the application on the terminal device. For example, the destination device can be the application's server or another terminal device.
[0106] In some embodiments, the terminal device may encapsulate the data to be transmitted in the network layer according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted. The data to be transmitted may be data sent from the transport layer to the network layer, such as TCP packets, UDP packets, etc. Further, the data to be transmitted may be sent by the application application in the application layer and processed and encapsulated by the presentation layer, session layer and transport layer.
[0107] The network layer can add an IP header to the data to be transmitted, resulting in an IP data packet. This IP header may include, but is not limited to, the source IP address, destination IP address, and payload length. The source IP address can refer to the IP address of the terminal device; further, it can be the IP address used by the application sending the data. The destination IP address can refer to the IP address of the destination device, i.e., the IP address of the device receiving the data. The payload length refers to the length of the payload (i.e., the data portion) carried in the IP data packet.
[0108] In one implementation, the source IP address carried by the IP data packet can be the IP address corresponding to the first wireless communication link. The network layer can add an IP header to the data to be transmitted based on the IP address corresponding to the first wireless communication link, and the source IP address of the IP header can be the IP address corresponding to the first wireless communication link.
[0109] Optionally, the IP address corresponding to the first wireless communication link can be the IP address used when the terminal device and the destination device establish a communication channel. Before transmitting data with the destination device, the application running on the terminal device can establish a communication channel, for example, a socket channel. Data transmission between the application running on the terminal device and a process or application on the destination device can be achieved through the socket channel. When establishing the communication channel, the terminal device can send information such as the IP address and port number used by the application back to the destination device. This information identifies the socket object corresponding to the application, and the destination device can accurately receive the data sent by the application running on the terminal device based on this IP address, port number, and other information.
[0110] When establishing a communication channel, the IP address returned by the terminal device to the destination device can be the IP address corresponding to the first wireless communication link. Then, the application running on the terminal device can use this IP address to communicate with the process or application of the destination device. The terminal device encapsulates the data to be transmitted corresponding to the running application according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted. The source IP address in the IP data packet is the IP address corresponding to the first wireless communication link, thereby ensuring that the destination device can accurately receive the data sent by the application running on the terminal device.
[0111] Regardless of whether the data link layer uses the first or second wireless communication link for data transmission, the network layer can encapsulate the data to be transmitted based on the IP address corresponding to the first wireless communication link to obtain IP data packets. In other words, regardless of whether the data link layer uses the first or second wireless communication link for data transmission, the application running on the terminal device uses the IP address corresponding to the first wireless communication link to communicate with the destination device. When a link switch occurs, the application running on the terminal device and the destination device do not need to re-establish a socket channel, thus ensuring that the application's services are not affected by the communication link switch.
[0112] In some embodiments, the first wireless communication link can be the primary communication link, and the second wireless communication link can be the backup communication link. When the terminal device establishes a first wireless communication link with the same network device or with different network devices, and a second wireless communication link is established, the first wireless communication link can be selected as the primary communication link, and the second wireless communication link can be used as the backup communication link. In normal data transmission scenarios, the terminal device preferentially uses the first wireless communication link for data transmission. Only when the link quality of the first wireless communication link is too poor, or when the first wireless communication link fails, is damaged, or is disconnected, will it switch to the second wireless communication link for data transmission.
[0113] For example, if the first wireless communication link is a Wi-Fi communication link and the second wireless communication link is a cellular communication link, the Wi-Fi communication link can be used as the primary communication link, and data transmission should be prioritized using the Wi-Fi communication link. Only when the quality of the Wi-Fi communication link is too poor or the Wi-Fi communication link fails, is damaged, or is disconnected will the data transmission be switched to the cellular communication link.
[0114] In some embodiments, the first and second wireless communication links are not distinguished by primary or secondary importance; they have equal status. The terminal device can dynamically select one of the two communication links for data transmission based on its link quality. When an application running on the terminal device establishes a communication channel with the target device, it can evaluate the link quality of the first and second wireless communication links respectively, and select the wireless communication link with better quality (such as the first wireless communication link) as the data transmission link. It then sends information such as the IP address of the wireless communication link with better quality (such as the first wireless communication link) back to the target device. After successfully establishing a communication channel with the target device, the IP address used by the application running on the terminal device is determined and will not be changed subsequently.
[0115] For example, the first wireless communication link is a first Wi-Fi communication link, and the second wireless communication link is a second Wi-Fi communication link. When the terminal device's application establishes a socket channel with the application server, it can choose the IP address of the Wi-Fi communication link with better link quality to establish a socket connection with the application server.
[0116] Step 320: If the first link switching condition is met, the IP data packet is sent through the second wireless communication link. The first link switching condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0117] A first link switching condition can be preset. This first link switching condition can be a condition related to the link quality of the first wireless communication link and / or the second wireless communication link. The link quality can be used to reflect the communication performance of the wireless communication link in transmitting data, such as transmission rate, transmission stability and reliability. If the transmission rate of the wireless communication link is higher and the transmission is more stable, it indicates that the link quality of the wireless communication link is better.
[0118] When a terminal device has a first wireless communication link and a second wireless communication link, the terminal device can evaluate the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link, and determine whether the first link switching condition is met based on the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link.
[0119] For example, the link quality of a wireless communication link can be evaluated based on one or more parameters, such as RSSI (Received Signal Strength Indication), SNR (Signal to Noise Ratio), packet loss rate, and transmission rate. RSSI characterizes the received signal strength; a higher RSSI indicates better link quality. SNR is the ratio of signal power to noise power; a higher SNR indicates a stronger signal relative to noise, higher transmission reliability, and better link quality. Packet loss rate represents the proportion of data packets lost during data transmission; a lower packet loss rate indicates higher transmission reliability and better link quality. Transmission rate refers to the amount of data transmitted through the wireless communication link per unit time; a higher transmission rate indicates better link quality.
[0120] In some embodiments, the first link switching condition may include at least one of the following:
[0121] (1) The quality of the first link corresponding to the first wireless communication link is lower than the first quality threshold.
[0122] The terminal device can compare the quality of the first link corresponding to the first wireless communication link with a first quality threshold to determine whether the quality of the first link corresponding to the first wireless communication link is lower than the first quality threshold. If the quality of the first link corresponding to the first wireless communication link is lower than the first quality threshold, it indicates that the link quality of the first wireless communication link is low, and the transmission stability and reliability of the first wireless communication link are low, which may cause data transmission failure or transmission lag in the application. In this case, the currently used communication link can be switched from the first wireless communication link to the second wireless communication link, thereby improving network performance and ensuring the stability and reliability of data transmission.
[0123] It should be noted that the first quality threshold can be set according to actual needs. This first quality threshold can be a pre-set fixed value or a value that changes dynamically according to the actual scenario. For example, different first quality thresholds can be set for different types of wireless communication links; or, different first quality thresholds can be set for different network scenarios (such as outdoor scenarios, indoor scenarios, elevator scenarios, basement scenarios, etc.). Dynamically adjusting the first quality threshold according to the actual scenario can improve the accuracy of switching wireless communication links and further improve the stability of data transmission.
[0124] (2) The quality of the second link corresponding to the second wireless communication link is higher than the quality of the first link corresponding to the first wireless communication link.
[0125] The terminal device can compare the quality of the first link corresponding to the first wireless communication link with the quality of the second link corresponding to the second wireless communication link, and determine whether the quality of the first link is lower than that of the second link. If the quality of the second link corresponding to the second wireless communication link is higher than that of the first link corresponding to the first wireless communication link, it means that the quality of the second wireless communication link is better. Then, the currently used communication link can be switched from the first wireless communication link to the second wireless communication link, thereby improving network performance and ensuring the stability and reliability of data transmission.
[0126] Optionally, if the quality of the second link corresponding to the second wireless communication link is higher than that of the first link corresponding to the first wireless communication link, it can be further determined whether the difference between the quality of the second link and the quality of the first link is greater than a first difference threshold. If the difference between the quality of the second link and the quality of the first link is greater than the first difference threshold, it indicates that the quality of the second wireless communication link is better and has a greater improvement in quality than that of the first wireless communication link. In this case, the currently used communication link can be switched from the first wireless communication link to the second wireless communication link, thereby improving network performance and enhancing the stability and reliability of data transmission.
[0127] If the difference between the quality of the second link and the quality of the first link is not greater than the first difference threshold, it means that although the quality of the second wireless communication link is better, the difference between the two is not significant. Therefore, the data transmission link does not need to be switched, which can reduce the number of communication link switching, reduce energy consumption loss, and avoid communication instability caused by too frequent switching of communication links.
[0128] In this embodiment, the first link switching condition can be determined based on the first link quality corresponding to the first wireless communication link and / or the second link quality corresponding to the second wireless communication link. This allows for dynamic switching of the communication link used based on the link quality of the two wireless communications, reducing congestion and interference in data transmission and improving the stability and reliability of data transmission.
[0129] When the first link switching condition is met, the terminal device switches the communication link it uses from the first wireless communication link to the second wireless communication link. It can send the IP data packets to be transmitted from the network layer through the second wireless communication link. Since the source IP address carried by the IP data packet is still the IP address of the first wireless communication link, and furthermore, the communication 5-tuple (including source IP address, destination IP address, source port number, destination port number, and transport layer protocol type) corresponding to the socket object has not changed, the destination device can accurately receive and identify the IP data packet. The two parties do not need to re-establish a communication channel (such as a socket channel), the data flow transmission of the service will not be interrupted, and the user experience is improved.
[0130] For example, Figure 4 is a schematic diagram of communication link switching in one embodiment. As shown in Figure 4, before communication link switching, the user application uses the IP address of wireless communication link A. The network layer encapsulates the data to be transmitted corresponding to the user application according to the IP address of wireless communication link A to obtain the IP data packet to be transmitted. Then, the data link layer sends the IP data packet through wireless communication link A. As a specific implementation, the data link layer can frame the IP data packet, add information such as the MAC (Media Access Control) address of the local end of wireless communication link A to obtain a data frame, and then send the data frame through wireless communication link A.
[0131] After switching the data transmission link from wireless communication link A to wireless communication link B, the user application continues to use the IP address of wireless communication link A. The network layer encapsulates the data to be transmitted corresponding to the user application based on the IP address of wireless communication link A to obtain the IP data packet to be transmitted. Then, the data link layer or physical layer switches to wireless communication link B to send the IP data packet. As one specific implementation, the data link layer can frame the IP data packet, add information such as the MAC address of the local end of wireless communication link B, obtain a data frame, and then send the data frame through wireless communication link B.
[0132] In some embodiments, after switching the used communication link from the first wireless communication link to the second wireless communication link, the terminal device may determine whether a second link switching condition is met. This second link switching condition may be a condition for switching back from the second wireless communication link to the first wireless communication link. If the second link switching condition is met, the used communication link may be switched back from the second wireless communication link to the first wireless communication link.
[0133] For example, the second link switching condition may include, but is not limited to, at least one of the following:
[0134] (1) The quality of the first link corresponding to the first wireless communication link is higher than the second quality threshold, which may be greater than or equal to the first quality threshold mentioned above.
[0135] If the quality of the first wireless communication link is higher than the second quality threshold, it indicates that the link quality of the first wireless communication link is high, and the transmission stability and reliability of the first wireless communication link are high. In this case, the connection can be switched back to the first wireless communication link. This ensures network performance while maintaining consistency between the IP address used by the upper-layer application and the actual communication link used, thereby improving data transmission efficiency and accuracy.
[0136] (2) The quality of the first link corresponding to the first wireless communication link is higher than the quality of the second link corresponding to the second wireless communication link.
[0137] If the quality of the first link corresponding to the first wireless communication link is higher than that of the second link corresponding to the second wireless communication link, it means that the quality of the first wireless communication link is better. In this case, the currently used communication link can be switched back from the second wireless communication link to the first wireless communication link, thereby improving network performance, ensuring the stability and reliability of data transmission, and ensuring the consistency between the IP address used by the upper layer application and the actual communication link used, thereby improving data transmission efficiency and accuracy.
[0138] Optionally, if the quality of the first link corresponding to the first wireless communication link is higher than the quality of the second link corresponding to the second wireless communication link, it can be further determined whether the difference between the quality of the first link and the quality of the second link is greater than a second difference threshold. If the difference between the quality of the first link and the quality of the second link is greater than the second difference threshold, it indicates that the quality of the first wireless communication link is better and has a significant improvement over the second wireless communication link. In this case, the currently used communication link can be switched from the second wireless communication link to the first wireless communication link. Only when the quality of the first link corresponding to the first wireless communication link is higher than the quality of the second link corresponding to the second wireless communication link, and the difference between the two link qualities is significant, should the connection be switched back to the first wireless communication link. This can avoid communication instability caused by switching communication links too frequently and can reduce power consumption.
[0139] It should be noted that different applications running on the terminal device may use the same or different IP addresses. For example, all applications may use the IP address of the first wireless communication link, or some applications may use the IP address of the first wireless communication link while others use the IP address of the second wireless communication link. This is not limited here. For applications using the IP address of the second wireless communication link, the network layer can encapsulate the data to be transmitted for that application based on the IP address of the second wireless communication link. Regardless of which communication link the physical link layer uses, the IP address of the application using the second wireless communication link remains unchanged, thus ensuring that the application's services are not affected by communication link switching. Since its working principle is similar to that of applications using the IP address of the first wireless communication link for data transmission, it will not be described again.
[0140] For example, in a scenario where a terminal device establishes a first wireless communication link and a second wireless communication link with different network devices, the IP address corresponding to the first wireless communication link and the IP address corresponding to the second wireless communication link can belong to the same IP pool. This ensures that the network device corresponding to the first wireless communication link can receive data packets carrying the IP address of the second wireless communication link, and the network device corresponding to the second wireless communication link can receive data packets carrying the IP address of the first wireless communication link, thus ensuring that data can be transmitted normally after the communication link is switched.
[0141] In this embodiment, when the data transmission link of the terminal device switches from the first wireless communication link to the second wireless communication link, the IP address corresponding to the first wireless communication link is still used to encapsulate the data to be transmitted. The IP address used remains unchanged and will not change with the link switch. Therefore, it is not necessary to re-establish a communication channel with the destination device for data transmission, ensuring that data transmission will not be interrupted. This enables seamless link switching for services, avoids service lag and other issues, and improves user experience.
[0142] As shown in Figure 5, in another embodiment, a data transmission method is provided, which can be applied to the aforementioned terminal device. The method may include the following steps:
[0143] Step 502: Encapsulate the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted.
[0144] The description of step 502 can be found in the description of step 310 in the above embodiments, and will not be repeated here.
[0145] Step 504: Evaluate the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link.
[0146] When a terminal device establishes a first wireless communication link and a second wireless communication link with the same network device or with different network devices, the terminal device can evaluate the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link. When an application running on the terminal device uses the first wireless communication link for data transmission, the terminal device can determine whether the first link switching conditions are met based on the evaluated quality of the first link and / or the second link, thereby determining whether it is necessary to switch the communication link being used.
[0147] In some embodiments, the terminal device may obtain first communication quality information corresponding to the first wireless communication link and determine the first link quality corresponding to the first wireless communication link based on the first communication quality information.
[0148] The first communication quality information may include at least one of the following: device link performance parameters, network environment status parameters, and real-time communication performance parameters corresponding to the first wireless communication link.
[0149] The device link performance parameters corresponding to the first wireless communication link can refer to the connection performance of the terminal device itself at the wireless link layer (such as the physical layer / data link layer) with the first wireless communication link. The device link performance parameters are parameters affected by the device performance.
[0150] For example, the device link performance parameters corresponding to the first wireless communication link may include, but are not limited to, at least one of the following: RSSI, transmission rate, and reception rate of the first wireless communication link. The transmission rate of the first wireless communication link refers to the amount of data that the terminal device can transmit per unit time through the first wireless communication link; the reception rate of the first wireless communication link refers to the amount of data that the terminal device can receive per unit time through the first wireless communication link.
[0151] The network environment state parameters corresponding to the first wireless communication link can be used to describe the overall state of the network channel and the environmental impact of the first wireless communication link. The network environment state parameters can be used to describe the channel quality of the network channel, which is affected by environmental factors, multipath effects, etc.
[0152] For example, the network environment status parameters corresponding to the first wireless communication link may include, but are not limited to, at least one of the following: air interface channel utilization, retransmission rate, packet loss rate, and network device feedback factor. Specifically, the air interface channel utilization refers to the ratio of the time the wireless channel corresponding to the first wireless communication link is occupied to the total available time. A higher air interface channel utilization indicates a busier wireless channel, making it more prone to network congestion, delays, and packet loss. The retransmission rate refers to the proportion of data packets that need to be retransmitted among the data packets sent by the terminal device through the first wireless communication link. The packet loss rate refers to the proportion of lost data packets among the data packets sent by the terminal device through the first wireless communication link. The network device feedback factor refers to one or more metrics used to describe the performance of the wireless channel, such as CSI (Channel State Information), but not limited to these, fed back from the network device connected to the first wireless communication link to the terminal device or from the terminal device to the network device connected to the first wireless communication link.
[0153] The real-time communication performance parameters corresponding to the first wireless communication link can be used to reflect the real-time transmission efficiency of data transmission through the first wireless communication link.
[0154] For example, the real-time communication performance parameters corresponding to the first wireless communication link may include, but are not limited to, at least one of the following: communication latency and communication throughput. The communication latency of the first wireless communication link can be represented by RTT (Round-Trip Time), which refers to the total time required for a data packet to travel from the sender to the receiver and then back to the sender with an acknowledgment signal, such as an ACK (Acknowledgment) signal. A higher RTT indicates lower transmission efficiency. The communication throughput of the first wireless communication link can refer to the amount of data successfully transmitted by the first wireless communication link per unit time; a higher communication throughput indicates higher transmission efficiency.
[0155] The terminal device can calculate the first link quality corresponding to the first wireless communication link based on one or more parameters obtained above. The first link quality corresponding to the first wireless communication link can be represented by a quality score. For example, the higher the quality score, the better the link quality of the first wireless communication link; or, the lower the quality score, the better the link quality of the first wireless communication link. This is not limited here.
[0156] In one implementation, the terminal device can determine the first link quality corresponding to the first wireless communication link based on the device link performance parameters, network environment status parameters, and real-time communication performance parameters corresponding to the first wireless communication link. As shown in Figure 6, the step of determining the first link quality corresponding to the first wireless communication link based on the first communication quality information may include steps 602 to 610.
[0157] Step 602: Determine the first quality score based on the device link performance parameters.
[0158] Optionally, the terminal device can calculate a first quality score based on the RSSI, transmission rate, and reception rate corresponding to the first wireless communication link. Since the device link performance parameters reflect the device's own communication performance, this first quality score can objectively assess the clean communication capability of the terminal device's first wireless communication link without considering external influencing factors.
[0159] For example, the quality scores corresponding to the RSSI, transmission rate and reception rate of the first wireless communication link can be calculated respectively, and the three quality scores can be weighted and averaged to obtain the first quality score.
[0160] As an example, three quality scores can be calculated based on the RSSI, transmission rate, and reception rate corresponding to the first wireless communication link, respectively, and the minimum value among the three quality scores is taken as the first quality score. By using the minimum value among the three quality scores as the first quality score, the communication capability of the terminal device with the first wireless communication link can be evaluated more accurately, thereby improving the accuracy of link quality assessment.
[0161] Step 604: Determine the second quality score based on the network environment status parameters.
[0162] Optionally, the terminal device may calculate a second quality score based on one or more of the following: air interface channel utilization, transmission retransmission rate, transmission packet loss rate, and network device feedback factor corresponding to the first wireless communication link. Since network environment state parameters can be used to describe the channel quality of the network channel, the second quality score can assess the network performance under external influences.
[0163] For example, the differences between 1 and air interface channel utilization, 1 and transmission retransmission rate, and 1 and transmission packet loss rate can be calculated. These three differences are then multiplied, and the product is converted into a score in the corresponding fractional system (such as a 100-point system) to obtain the second quality score. This approach can comprehensively consider the impact of multiple network environment state parameters on link quality, thereby improving the accuracy of link quality assessment.
[0164] Step 606: Determine the third quality score based on the real-time communication performance parameters.
[0165] Optionally, the terminal device can calculate a third quality score based on the communication latency and communication throughput corresponding to the first wireless communication link. Since real-time communication performance parameters can objectively reflect the transmission efficiency of data transmission through the first wireless communication link, the third quality score can objectively evaluate the real-time communication quality of the first wireless communication link.
[0166] Step 608: Perform a weighted calculation on the first mass fraction and the second mass fraction to obtain the first calculation result.
[0167] A first weight corresponding to a first quality score and a second weight corresponding to a second quality score can be preset. A weighted sum is then calculated based on the first quality score, the first weight, the second quality score, and the second weight to obtain a first calculation result. This first calculation result can be used to subjectively assess the actual communication capabilities that the terminal device can achieve under the influence of external factors.
[0168] Step 610: The first calculation result and the third quality score are weighted and calculated to obtain the first link quality corresponding to the first wireless communication link.
[0169] A third weight corresponding to the first calculation result and a fourth weight corresponding to the third quality score can be preset. The first link quality corresponding to the first wireless communication link is obtained by weighted summation based on the first calculation result, the third weight, the third quality score, and the fourth weight. The first calculation result is adjusted using the third quality score, thereby accurately and promptly obtaining the first link quality corresponding to the first wireless communication link.
[0170] It should be noted that the first, second, third, and fourth weights mentioned above can be set according to actual needs. The two sets of weight values (the first and second weights as one set, and the third and fourth weights as another set) can be the same or different, and no restrictions are imposed here.
[0171] For example, Figure 7 is a schematic diagram of evaluating the link quality corresponding to a wireless communication link in one embodiment. As shown in Figure 7, a first quality score L1 can be calculated based on device link performance parameters, such as mapping RSSI, transmission rate, and reception rate to quality scores respectively, and taking the minimum value as the first quality score L1. A second quality score L2 can be calculated based on network environment status parameters (such as air interface channel utilization, transmission retransmission rate, transmission packet loss rate, and network device feedback factor, etc.). The first quality score L1 and the second quality score L2 are weighted to obtain a first calculation result L4. A third quality score L3 can be calculated based on real-time communication performance parameters (such as RTT and communication throughput). The first calculation result L4 and the third quality score L3 are weighted to obtain the first link quality L5 corresponding to the first wireless communication link.
[0172] In some embodiments, the terminal device may obtain second communication quality information corresponding to the second wireless communication link, and determine the second link quality corresponding to the second wireless communication link based on the second communication quality information.
[0173] It should be noted that the method for evaluating the quality of the second link corresponding to the second wireless communication link is similar to the method for evaluating the quality of the first link corresponding to the first wireless communication link described in the above embodiments, and will not be repeated here.
[0174] In this embodiment, a three-stage progressive fitting algorithm is adopted, which combines the terminal device's own communication capabilities, subjectively observed network status, and objectively fed-back transmission efficiency to accurately and timely obtain the first link quality corresponding to the first wireless communication link. This enables real-time and dynamic switching to a communication link with better link quality, thereby improving the stability and reliability of data transmission.
[0175] In some embodiments, the terminal device may evaluate the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link according to an evaluation period. By periodically evaluating the link quality of the communication links, not only can the switching of communication links be accurately realized, but power consumption can also be reduced and the performance of the terminal device improved.
[0176] Step 506: Determine whether the first link switching condition is met based on the quality of the first link and / or the quality of the second link. If yes, proceed to step 508; otherwise, proceed to step 510.
[0177] Step 508: Send the IP data packet via the second wireless communication link.
[0178] Step 510: Send the IP data packet through the first wireless communication link.
[0179] The descriptions of steps 506 to 510 can be found in the relevant descriptions in the above embodiments, and will not be repeated here.
[0180] It should be noted that the terminal device's evaluation of the quality of the first link and / or the second link, and its determination of whether the first link switching conditions are met, can be performed before the step of encapsulating the data to be transmitted based on the IP address corresponding to the first wireless communication link, or after the step of encapsulating the data to be transmitted based on the IP address corresponding to the first wireless communication link, or both can be performed simultaneously. This application embodiment does not strictly limit the execution order between steps 502 and 506; the process shown in Figure 5 is merely an example.
[0181] In this embodiment, the terminal device can evaluate the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link, and flexibly switch the communication link to be used based on the quality of the first link corresponding to the first wireless communication link and / or the quality of the second link corresponding to the second wireless communication link, thereby ensuring the link quality of the communication link to be used, improving the stability and reliability of data transmission, and improving the user experience.
[0182] In some embodiments, the communication link can be switched while maintaining the same source IP address by modifying the link driver function. As shown in Figure 8, the above method may further include the following steps:
[0183] Step 802: If the first link switching condition is met, a first switching instruction is sent to the first link driver corresponding to the first wireless communication link. The first switching instruction is used to instruct the first link driver to forward the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained.
[0184] When a terminal device establishes a first wireless communication link with the same network device or with different network devices, and a second wireless communication link, the terminal device may have a first link driver corresponding to the first wireless communication link and a second link driver corresponding to the second wireless communication link.
[0185] The first link driver refers to a driver program used to manage the first wireless communication link. This driver is responsible for encapsulating data packets to be transmitted and sending them out through the first wireless communication link. It is also responsible for receiving data frames from the first wireless communication link, decapsulating them to obtain data packets, and then passing them to the operating system. Similarly, the second link driver is also a driver program used to manage the first wireless communication link. This driver is responsible for encapsulating data packets to be transmitted and sending them out through the second wireless communication link. It is also responsible for receiving data frames from the second wireless communication link, decapsulating them to obtain data packets, and then passing them to the operating system.
[0186] If the first link switching condition is met, a first switching instruction can be sent to the first link driver corresponding to the first wireless communication link. Based on the first switching instruction, the first link driver can determine to forward the received data to the second link driver corresponding to the second wireless communication link, and the second wireless communication link will then transmit the data.
[0187] For example, the first switching instruction may carry the link identifier of the currently used communication link, such as the link identifier of the second wireless communication link, etc. The link identifier can be used to identify the communication link, and the link identifier may consist of one or more of numbers, letters and symbols.
[0188] In one specific implementation, the network layer encapsulates the data to be transmitted based on the IP address corresponding to the first wireless communication link to obtain an IP data packet. The network layer can then send the IP data packet to the data link layer, which can frame the IP data packet using the first link driver. Upon receiving a first handover instruction, the first link driver can, according to the instruction, not frame the IP data packet but instead forward it to the second link driver of the second wireless communication link.
[0189] Step 804: Obtain the IP data packets forwarded by the first link driver through the second link driver, and send the IP data packets using the second wireless communication link.
[0190] After the second link driver corresponding to the second wireless communication link obtains the IP data packet forwarded by the first link driver, it can encapsulate the IP data packet. For example, it can add information such as the MAC address of the local end corresponding to the second wireless communication link to obtain a data frame, and then send the data frame through the second wireless communication link.
[0191] Optionally, the first link driver may first encapsulate the IP data packet, add information such as the MAC address of the local end of the first wireless communication link to obtain a data frame, and then forward the data frame to the second link driver of the second wireless communication link. The second link driver may modify the source MAC address and other information of the data frame, changing the source MAC address from the MAC address of the local end of the first wireless communication link to the MAC address of the local end of the second wireless communication link.
[0192] For example, Figure 9 is a schematic diagram of switching communication links in one embodiment while ensuring that the source IP address remains unchanged. As shown in Figure 9, the framework layer of the operating system may include a link management module. This link management module can evaluate the link quality corresponding to wireless communication link A and wireless communication link B respectively, and when it is determined that the first link switching condition is met, it sends a first switching instruction to the link driver of wireless communication link A through the kernel layer. When the application needs to send data, the data to be sent is encapsulated through the transport layer and network layer to obtain the IP data packet to be transmitted, and then transmitted to the physical link layer, and further, it can be transmitted to the link driver of wireless communication link A. When the link driver of wireless communication link A receives the first switching instruction, according to the data to be sent by wireless communication link B specified by the first switching instruction, it forwards the IP data packet to the second link driver corresponding to the second wireless communication link. The second link driver sends the IP data packet through the second wireless communication link, thereby realizing the communication link switching at the physical layer.
[0193] Optionally, if the link management module detects that the second link switching condition is met, it can send a third switching instruction to the link driver of wireless communication link A through the kernel layer. Upon receiving the third switching instruction, the link driver of wireless communication link A directly sends IP data packets through the first wireless communication link A according to the data specified by the third switching instruction, without needing to forward them to the second link driver corresponding to the second wireless communication link.
[0194] In this embodiment, by modifying the link driver function, communication link switching can be implemented at the driver layer while ensuring that the source IP address used by the application remains unchanged. This enables seamless link switching for services, avoiding service interruptions and improving user experience. Furthermore, no modifications to the network and transport layer protocol stacks are required, thus supporting various network and transport layer protocols and broadening its application scope.
[0195] In some embodiments, by modifying the kernel layer functionality, the communication link used can be switched while maintaining the same source IP address. As shown in Figure 10, the above method may further include the following steps:
[0196] Step 1002: If the first link switching condition is met, a second switching instruction is sent to the kernel layer. The second switching instruction is used to instruct the kernel layer to send the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained.
[0197] Step 1004: The IP data packet is sent using the second wireless communication link via the second link driver.
[0198] The kernel layer of an operating system is the core of the operating system. In network communication, the kernel layer plays the role of implementer and manager of the protocol stack, and it can implement the functions of the network protocol stack.
[0199] If the first link switching condition is met, a second switching instruction can be sent to the kernel layer. The kernel layer can determine to use the second wireless communication link for data transmission based on the second switching instruction. If the kernel layer obtains the IP data packet, it can send the IP data packet to the second link driver corresponding to the second wireless communication link. The second link driver can encapsulate the IP data packet according to the local MAC address corresponding to the second wireless communication link to obtain a data frame, and send the data frame through the second wireless communication link.
[0200] For example, the second switching instruction may carry the link identifier of the currently used communication link, such as the link identifier of the second wireless communication link.
[0201] In one implementation, the kernel layer can obtain the second handover instruction issued by the framework layer. The network layer encapsulates the data to be transmitted according to the IP address corresponding to the first wireless communication link. After obtaining the IP data packet to be transmitted, the kernel layer can send the IP data packet to the second link driver corresponding to the second wireless communication link according to the link identifier of the second wireless communication link carried by the second handover instruction. The second link driver then sends it out through the second wireless communication link.
[0202] In this embodiment, by modifying the kernel layer functionality, communication link switching can be implemented at the kernel layer while ensuring that the source IP address used by the application remains unchanged. This enables seamless link switching for services, avoiding service interruptions and improving user experience. Furthermore, no modifications to the network and transport layer protocol stacks are required, thus supporting various network and transport layer protocols and broadening its application scope.
[0203] Since switching communication links while keeping the source IP address unchanged requires modifying the link driver or kernel layer code to achieve this solution, the development cost is high and may affect the normal operation of the operating system. Therefore, configuring routing rules can also be used to switch the communication link while keeping the source IP address unchanged. In some embodiments, as shown in Figure 11, the above method may further include the following steps:
[0204] Step 1102: If the first link switching condition is met, configure the target routing rule. The target routing rule is used to define the IP data packets transmitted using the first wireless communication link to be switched to the second wireless communication link for transmission.
[0205] Step 1104: Based on the target routing rules, allocate IP packets to the second wireless communication link and send IP packets through the second wireless communication link.
[0206] In some embodiments, the link management module in the framework layer of the operating system can add a target routing table. This new target routing table can be used to store the corresponding routing rules when a communication link needs to be switched. Through these routing rules, the function of switching the communication link used by the application can be realized without changing the source IP address used by the application.
[0207] If the first link switching condition is met, the terminal device can configure a target routing rule. This target routing rule can be used to define the switching of IP packets transmitted using the first wireless communication link to the second wireless communication link. This target routing rule can be updated and stored in the target routing table. At the network layer, the data to be transmitted is encapsulated according to the IP address corresponding to the first wireless communication link to obtain IP packets. These IP packets can then be allocated to the second wireless communication link for transmission using this target routing rule.
[0208] In some embodiments, the target routing rule can be used to describe the characteristics of IP packets that need to be switched to a second wireless communication link for transmission. The characteristics of the IP packets may include, but are not limited to, application information of the application to which they belong and the message characteristics corresponding to the IP packets.
[0209] As one implementation method, when the first link switching condition is detected, the terminal device can obtain the application information and message characteristics corresponding to the target application, and configure the target routing rules according to the application information and message characteristics.
[0210] The target application can be an application that uses the first wireless communication link for data transmission. For example, the target application can be an application that is using the first wireless communication link for data transmission when the first link switching condition is detected. The application information of the target application may include, but is not limited to, one or more of the following: application identifier (application ID), application name, and application version number.
[0211] Message characteristics refer to the characteristics of the data that the target application needs to transmit. These message characteristics may include, but are not limited to, source IP address (such as the IP address of the first wireless communication link), destination IP address (the IP address of the destination device), source port number, and destination port number.
[0212] The data to be transmitted is encapsulated based on the IP address corresponding to the first wireless communication link to obtain IP data packets. These IP data packets are then matched against the target routing rules to determine if they conform to those rules. Further, the application information and message characteristics corresponding to the IP data packets can be obtained and matched against the target routing rules. If these match, it indicates that the IP data packet is the one the target application originally needed to transmit via the first wireless communication link. In this case, it can be allocated to the second wireless communication link and sent via that link.
[0213] In the above implementation, when the first link switching condition is detected, the target routing rule can be configured according to the application information and message characteristics corresponding to the target application. The target routing rule can be used to accurately identify the IP data packets that need to be transmitted using the first wireless communication link and realize the communication link switching. The communication link switching is realized while ensuring that the source IP address used by the application remains unchanged.
[0214] In some embodiments, the terminal device may determine that the IP packet matches the target routing rule based on the target routing rule, add a target tag to the IP packet, and then allocate the IP packet with the target tag to the second wireless communication link.
[0215] If an IP packet matches a destination routing rule, a destination tag can be added to the IP packet. The destination tag can be a character or string consisting of one or more of numbers, letters, or symbols. Adding a destination tag to an IP packet indicates that the IP packet needs to be switched from the first wireless communication link to the second wireless communication link for transmission.
[0216] As one implementation, a two-level IP routing can be set up, which may include a first-level IP routing and a second-level IP routing. The first-level IP routing and the second-level IP routing can maintain different routing tables. For example, the first-level IP routing maintains a first routing table, and the second-level IP routing maintains a second routing table.
[0217] The first-level IP routing determines the wireless communication link (such as the network interface card information at the exit point) and the next-hop IP address (such as the IP address of the network device) based on the source IP address and destination IP address of the IP packet. The wireless communication link is the one that matches the source IP address of the IP packet. For example, if the source IP address carried by the IP packet corresponds to the IP address of the first wireless communication link, the first-level IP routing determines that the IP packet will be sent via the first wireless communication link; if the source IP address carried by the IP packet corresponds to the IP address of the second wireless communication link, the first-level IP routing determines that the IP packet will be sent via the second wireless communication link.
[0218] Second-level IP routing can be used to reroute IP packets. It can switch IP packets to another wireless communication link for transmission, and it can also determine the transmitting wireless communication link (such as the network interface card information at the exit point) and the next-hop IP address (such as the IP address of the network device). For example, if the source IP address carried by the IP packet is the IP address corresponding to the first wireless communication link, the second-level IP routing determines that the IP packet will be sent by the second wireless communication link; if the source IP address carried by the IP packet is the IP address corresponding to the second wireless communication link, the second-level IP routing determines that the IP packet will be sent by the first wireless communication link.
[0219] After encapsulating the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain an IP data packet, the IP data packet can first pass through the first-level IP route. When the IP data packet passes through the first-level IP route, it can be matched with the target routing rules. This first-level IP route can be used to define how the IP data packet should be sent through the first wireless communication link.
[0220] Since the first-level IP route can determine the wireless communication link corresponding to the source IP address of the IP packet, the first-level IP route can search for the matching first route entry in the first routing table using the source IP address (i.e., the IP address of the first wireless communication link) and destination IP address carried in the IP packet. The matching first route entry defines the network card information corresponding to the first wireless communication link, the IP address of the next-hop network device (the network device connected to the first wireless communication link), etc.
[0221] Once an IP packet has passed through the first level of IP routing, its source IP address is determined. The IP packet can then be matched against the target routing rules in the target routing table. If the IP packet matches the target routing rule, a target tag can be added to the IP packet.
[0222] It should be noted that the matching of IP packets with target routing rules in the target routing table can be performed either when the IP packet is in the first-level IP routing stage, or after the IP packet has completed the first-level IP routing. This application does not limit the matching process.
[0223] After completing the first-level IP routing, IP packets enter the second-level IP routing. The second-level IP routing can reroute IP packets with added destination tags to allocate them to the second wireless communication link. This second-level IP routing is used to define how IP packets are sent through the second wireless communication link.
[0224] Since the IP packet matches the destination routing rule, it indicates that the IP packet is one that requires a communication link switch. When the IP packet passes through the second-level IP route, the IP packet with the destination tag can be rerouted through the second-level IP route. The second-level IP route can search for a matching second routing entry in the second routing table based on the source IP address (i.e., the IP address of the first wireless communication link) and destination IP address carried in the IP packet. This matching second routing entry defines the network card information corresponding to the second wireless communication link, the IP address of the next-hop network device (the network device connected to the second wireless communication link), etc. Then, based on the second routing entry, the IP packet is passed to the second link driver corresponding to the second wireless communication link. The second link driver then sends it out through the second wireless communication link, thereby achieving the switching of the communication link without changing the source IP address used by the application.
[0225] Optionally, if the first link switching conditions are not met, i.e., if switching the communication link is not required, no target routing rule is configured, and the target routing table does not store the target routing rule. Therefore, when IP packets pass through the first-level IP route, no target tag is added. Since the IP packets do not have a target tag, no rerouting occurs when passing through the second-level IP route. The IP packets can be directly passed to the first link driver corresponding to the first wireless communication link based on the matching first route entry found in the first-level IP route, and then sent out through the first wireless communication link by the first link driver.
[0226] In the above implementation, when the IP data packet to be transmitted matches the target routing rule, a target tag is added to the IP data packet to distinguish the IP data packets that need to be rerouted, thereby realizing the switching of communication links and improving the accuracy of IP data packet routing.
[0227] For example, Figure 12 is a schematic diagram of switching communication links in another embodiment while ensuring that the source IP address remains unchanged. As shown in Figure 12, the framework layer of the operating system may include a link management module. This link management module can evaluate the link quality corresponding to wireless communication link A and wireless communication link B, respectively, and, if it is determined that the first link switching condition is met, configure the target routing rule and send the target routing rule to the Netfilter framework, storing it in the target routing table in the Netfilter framework. When the application needs to send data, the data to be sent is encapsulated by the transport layer and network layer to obtain IP packets. The IP packets pass through the first-level routing (i.e., IP routing) to find the matching first routing entry, and the source IP address of the IP packets (such as the IP address corresponding to wireless communication link A) is determined. The Netfilter framework can match the IP packets with the target routing rule. If the match is successful, a target tag is added to the IP packets. When the IP packet is passed to the second-level route (i.e., IP reroute), since the IP packet carries a destination tag, the second-level route will reroute the IP packet, find a matching second route entry, and pass the IP packet to the link driver of wireless communication link B based on the second route entry. The link driver of wireless communication link B will then send it out through wireless communication link B.
[0228] By using two-level routing and destination routing rules, IP packets can be assigned to a second wireless communication link for transmission without changing the source IP address of the IP packets. This enables the transmission of the communication link, allowing service flows to be dynamically switched to a communication link with better link quality. Moreover, the service is unaware of the switching of the communication link and will not be interrupted, thus improving the stability and reliability of data transmission.
[0229] In this embodiment of the application, when communication link switching is required, the communication link can be switched without changing the source IP address used by the application by configuring the target routing rules. This method does not require modification or maintenance of the driver layer or kernel layer code, has low development cost, and can be applied to various chip platforms, making it more applicable and more sophisticated in its implementation.
[0230] The above embodiments describe the switching of the uplink communication link (the communication link through which the terminal device sends data to the network device) to avoid uplink congestion and interference, thus ensuring the stability and reliability of uplink data transmission. Furthermore, the switching of the downlink communication link (the communication link through which the terminal device receives data from the network device) can also be implemented, ensuring that the downlink communication link coordinates with the uplink communication link to guarantee the stability and reliability of downlink data transmission.
[0231] In some embodiments, the terminal device may establish two wireless communication links with the same wireless access point. For example, the terminal device may establish a first wireless communication link and a second wireless communication link with the target wireless access point. The first wireless communication link and the second wireless communication link may correspond to different frequency bands. For example, the first wireless communication link may be a 2.4 GHz Wi-Fi communication link, and the second wireless communication link may be a 5 GHz Wi-Fi communication link. The method described above may further include: when the first link switching condition is met, the terminal device may send a switching request to the target wireless access point. This switching request may be used to instruct the target wireless access point to send data to the terminal device through the second wireless communication link.
[0232] After receiving a handover request from the terminal device, the target wireless access point can switch the communication link with the terminal device to the second wireless communication link. If the target wireless access point obtains the data that needs to be sent to the terminal device, it can send the data to the terminal device through the second wireless communication link.
[0233] As one implementation method, when the first link switching condition is met, the terminal device can send a handover request to the target wireless access point through both the first and second wireless communication links. By redundantly sending handover requests on both wireless communication links, the target wireless access point can be further protected from receiving the handover request, thereby improving the stability of the coordination between the downlink and uplink communication links.
[0234] In some embodiments, the handover request is further used to trigger the target wireless access point to keep its NAT table unchanged and update the target forwarding rule to the hardware acceleration table, the target forwarding rule being used to define the transmission of data to the terminal device via the second wireless communication link.
[0235] After the target wireless access point receives a handover request from the terminal device, it can keep the NAT table unchanged and update the target forwarding rule to the hardware acceleration table according to the handover request. The target forwarding rule can be used to define how to send data to the terminal device through the second wireless communication link.
[0236] Since the source IP address used by the application running on the terminal device remains unchanged, and the IP address used by the application running on the terminal device to communicate with the destination device remains unchanged, the target wireless access point can keep its NAT table unchanged.
[0237] The source IP address used by the application running on the terminal device remains unchanged, but the communication link switches from the first wireless communication link to the second wireless communication link. In order to ensure that the downlink communication link coordinates with the uplink communication link, the communication link that sends data from the target wireless access point to the terminal device also needs to switch to the second wireless communication link. Therefore, the forwarding rules for data packets sent to the terminal device need to be changed.
[0238] In one implementation, the switching request may include the source IP address used by the application running on the terminal device (such as the IP address corresponding to the first wireless communication link) and the link identifier of the wireless communication link to which it needs to switch (such as the link identifier of the second wireless communication link). After receiving the switching request, the terminal device may delete the forwarding rule in the hardware acceleration table that matches the IP address corresponding to the first wireless communication link, configure the target forwarding rule according to the IP address corresponding to the first wireless communication link, the network card information corresponding to the second wireless communication link, etc., and write the configured target forwarding rule into the hardware acceleration table.
[0239] If the target wireless access point receives a data packet carrying a destination IP address corresponding to the IP address of the first wireless communication link, it will send the data packet through the second wireless communication link according to the target forwarding rules, thereby realizing the switching of the downlink communication link.
[0240] For example, Figure 13 is a timing diagram of downlink communication link switching in one embodiment. As shown in Figure 13, the STA device (i.e., the terminal device mentioned above) can establish a 2.4G Wi-Fi communication link and a 5G Wi-Fi communication link with the wireless router, respectively. The STA device can evaluate the link quality of the 2.4G Wi-Fi communication link and the 5G Wi-Fi communication link and select the Wi-Fi communication link with better quality. If the STA device originally used the 2.4G Wi-Fi communication link, and it detects that the 5G Wi-Fi communication link has better quality, it can switch the communication link from the 2.4G Wi-Fi communication link to the 5G Wi-Fi communication link. The STA device can redundantly send a switching request to the wireless router through the 2.4G Wi-Fi communication link and the 5G Wi-Fi communication link, respectively. For example, it can send an Action frame through the 2.4G Wi-Fi communication link and the 5G Wi-Fi communication link, respectively, which indicates that a communication link switching should be performed. Upon receiving a handover request, the wireless router clears the original forwarding rules of the STA device in the hardware acceleration table and switches the STA device's downlink communication link to the 5G Wi-Fi communication link. The wireless router maintains its NAT table and writes the new forwarding rules into the hardware acceleration table. The STA device sends data to the wireless router via the higher-quality 5G Wi-Fi communication link, and the wireless router also sends data to the STA device via the same link, achieving coordination between the uplink and downlink communication links. Furthermore, the wireless router's hardware acceleration function remains operational, ensuring efficient packet forwarding.
[0241] For example, Figure 14A is a schematic diagram of communication link switching in another embodiment. As shown in Figure 14A, the terminal device establishes two Wi-Fi communication links with the wireless access point. The terminal device can evaluate the link quality of the two Wi-Fi communication links and select the Wi-Fi communication link with better link quality for data transmission and reception. For example, at time A, Wi-Fi communication link 1 is selected for data transmission and reception, and at time B, Wi-Fi communication link 2 is selected for data transmission and reception. The communication link for data transmission and reception can be dynamically switched according to the link quality of the two Wi-Fi communication links to ensure the stability and reliability of data transmission and improve the user experience.
[0242] For example, Figure 14B is a schematic diagram of communication link switching in another embodiment. As shown in Figure 14B, before the downlink communication link switching is performed, the terminal device receives data sent by the network device through wireless communication link A. After the downlink communication link switching is performed, the terminal device receives data sent by the network device through wireless communication link B, ensuring the coordination of the uplink and downlink communication links, both of which can be switched to the communication link with better link quality, thereby improving the stability and reliability of data transmission.
[0243] It should be noted that the data transmission methods described in the above embodiments are not only applicable to scenarios where the terminal device connects to a single wireless access point, but also to scenarios where the terminal device connects to multiple wireless access points. This can achieve a seamless Wi-Fi switching experience, eliminating the need to disconnect and reconnect during Wi-Fi roaming, ensuring uninterrupted service transmission, and guaranteeing the stability and smoothness of data transmission.
[0244] As shown in Figure 15, in one embodiment, another data transmission method is provided, which can be applied to the target wireless access point described above. This method may include the following steps:
[0245] Step 1502: Receive a handover request sent by the terminal device. The handover request is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, provided that the first link handover condition is met. The first link handover condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0246] Step 1504: In response to the handover request, data is sent to the terminal device via the second wireless communication link.
[0247] In some embodiments, after receiving the handover request sent by the terminal device in the step, the method further includes: keeping the NAT table unchanged according to the handover request, and updating the target forwarding rule to the hardware acceleration table, wherein the target forwarding rule is used to define sending data to the terminal device through the second wireless communication link.
[0248] It should be noted that the description of the data transmission method applied to the target wireless access point provided in the embodiments of this application can be referred to the relevant description of the data transmission method applied to the terminal device provided in the above embodiments, and will not be repeated here.
[0249] In this embodiment, the uplink and downlink communication links of the terminal device are coordinated, allowing both to switch to the communication link with better link quality, thus improving the stability and reliability of data transmission. Furthermore, by redundantly sending handover requests on both wireless communication links, the target wireless access point is further protected from receiving handover requests, thereby improving the stability of the coordination between the downlink and uplink communication links.
[0250] As shown in FIG16, in one embodiment, a data transmission device 1600 is provided, which can be applied to the terminal device described above. The data transmission device 1600 may include an encapsulation module 1610 and a transmission module 1620.
[0251] The encapsulation module 1610 is used to encapsulate the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted.
[0252] The transmission module 1620 is used to send IP data packets through the second wireless communication link when the first link switching condition is met. The first link switching condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0253] In one embodiment, the source IP address carried by the IP data packet is the IP address corresponding to the first wireless communication link; the IP address corresponding to the first wireless communication link is the IP address used when the terminal device and the destination device establish a communication channel.
[0254] In one embodiment, the data transmission device 1600 further includes a first switching module.
[0255] The first switching module is used to send a first switching instruction to the first link driver corresponding to the first wireless communication link when the first link switching condition is detected. The first switching instruction is used to instruct the first link driver to forward the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained.
[0256] The transmission module 1620 is also used to acquire IP data packets forwarded by the first link driver through the second link driver, and to send IP data packets using the second wireless communication link.
[0257] In one embodiment, the data transmission device 1600 further includes a second switching module.
[0258] The second switching module is used to send a second switching instruction to the kernel layer when the first link switching condition is detected. The second switching instruction is used to instruct the kernel layer to send the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained.
[0259] The transmission module 1620 is also used to send IP data packets using a second wireless communication link via a second link drive.
[0260] In one embodiment, the data transmission device 1600 further includes a rule configuration module.
[0261] The rule configuration module is used to configure target routing rules when the first link switching condition is detected. The target routing rules are used to define the IP data packets transmitted using the first wireless communication link to be switched to the second wireless communication link.
[0262] The transmission module 1620 is also used to allocate IP packets to the second wireless communication link based on the target routing rules, and to send IP packets through the second wireless communication link.
[0263] In one embodiment, the rule configuration module is further configured to, upon detecting that the first link switching condition is met, obtain application information and message characteristics corresponding to the target application, wherein the target application is an application that uses the first wireless communication link for data transmission; and configure target routing rules based on the application information and message characteristics.
[0264] In one embodiment, the transmission module 1620 includes a marking unit and an allocation unit.
[0265] The tagging unit is used to determine whether an IP packet matches a target routing rule based on the target routing rule, and to add a target tag to the IP packet.
[0266] The allocation unit is used to allocate IP packets with added target tags to the second wireless communication link and transmit the IP packets through the second wireless communication link.
[0267] In one embodiment, the marking unit is further configured to match the IP packet with a target routing rule when the IP packet passes through a first-level IP route; the first-level IP route is configured to define the transmission of the IP packet through a first wireless communication link; and to add a target mark to the IP packet if the IP packet matches the target routing rule.
[0268] In one embodiment, the allocation unit is further configured to reroute the IP packets with added target tags via a second-level IP routing to allocate the IP packets with added target tags to a second wireless communication link and send the IP packets via the second wireless communication link; the second-level IP routing is used to define the IP packets to be sent via the second wireless communication link.
[0269] In one embodiment, the first link switching condition includes at least one of the following:
[0270] The quality of the first link corresponding to the first wireless communication link is lower than the first quality threshold.
[0271] The quality of the second wireless communication link is higher than that of the first wireless communication link.
[0272] In one embodiment, the data transmission device 1600 further includes a link quality assessment module.
[0273] The link quality assessment module is used to obtain the first communication quality information corresponding to the first wireless communication link, and determine the first link quality corresponding to the first wireless communication link based on the first communication quality information.
[0274] The first communication quality information includes at least one of the following: device link performance parameters, network environment status parameters, and real-time communication performance parameters corresponding to the first wireless communication link.
[0275] The device link performance parameters include at least one of RSSI, transmission rate, and reception rate corresponding to the first wireless communication link; the network environment status parameters include at least one of air interface channel utilization, transmission retransmission rate, transmission packet loss rate, and network device feedback factor corresponding to the first wireless communication link; the real-time communication performance parameters include at least one of communication latency and communication throughput corresponding to the first wireless communication link.
[0276] In one embodiment, the link quality assessment module is further configured to: determine a first quality score based on device link performance parameters; determine a second quality score based on network environment status parameters; determine a third quality score based on real-time communication performance parameters; perform a weighted calculation on the first quality score and the second quality score to obtain a first calculation result; and perform a weighted calculation on the first calculation result and the third quality score to obtain a first link quality corresponding to the first wireless communication link.
[0277] In one embodiment, the data transmission device 1600 further includes a request sending module.
[0278] The request sending module is used to send a handover request to the target wireless access point through the first wireless communication link and the second wireless communication link respectively when the first link handover condition is met. The handover request is used to instruct the target wireless access point to send data to the terminal device through the second wireless communication link.
[0279] In one embodiment, the handover request is also used to trigger the target wireless access point to keep the Network Address Translation (NAT) table unchanged and update the target forwarding rules to the hardware acceleration table. The target forwarding rules are used to define how data is sent to the terminal device through the second wireless communication link.
[0280] In this embodiment, when the data transmission link of the terminal device switches from the first wireless communication link to the second wireless communication link, the IP address corresponding to the first wireless communication link is still used to encapsulate the data to be transmitted. The IP address used remains unchanged and will not change with the link switch. Therefore, it is not necessary to re-establish a communication channel with the destination device for data transmission, ensuring that data transmission will not be interrupted. This enables seamless link switching for services, avoids service lag and other issues, and improves user experience.
[0281] As shown in FIG17, in one embodiment, a data transmission device 1700 is provided, which can be applied to the target wireless access point mentioned above. The data transmission device 1700 may include a request receiving module 1710 and a data sending module 1720.
[0282] The request receiving module 1710 is used to receive a handover request sent by the terminal device. The handover request is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, under the condition that the first link handover condition is met. The first link handover condition is the condition for switching from the first wireless communication link to the second wireless communication link.
[0283] The data transmission module 1720 is used to transmit data to the terminal device via a second wireless communication link in response to a handover request.
[0284] In one embodiment, the data transmission device 1700 further includes an update module.
[0285] The update module is used to keep the NAT table unchanged and update the target forwarding rules to the hardware acceleration table according to the handover request. The target forwarding rules are used to define how data is sent to the terminal device through the second wireless communication link.
[0286] In this embodiment, the uplink and downlink communication links of the terminal device are coordinated, allowing both to switch to the communication link with better link quality, thus improving the stability and reliability of data transmission. Furthermore, by redundantly sending handover requests on both wireless communication links, the target wireless access point is further protected from receiving handover requests, thereby improving the stability of the coordination between the downlink and uplink communication links.
[0287] Figure 18 is a structural block diagram of an electronic device in one embodiment. As shown in Figure 18, the electronic device 1800 may include one or more of the following components: a processor 1810, a memory 1820 coupled to the processor 1810, and a transceiver unit 1830, wherein the memory 1820 may store one or more computer programs, and the one or more computer programs may be configured to, when executed by one or more processors 1810, enable the electronic device 1800 to implement the data transmission method applied to a terminal device as described in the above embodiments.
[0288] Processor 1810 may include one or more processing cores. Processor 1810 connects to various parts within the electronic device 1800 using various interfaces and lines, and performs various functions and processes data of the electronic device 1800 by running or executing instructions, programs, code sets, or instruction sets stored in memory 1820, and by calling data stored in memory 1820. Optionally, processor 1810 may be implemented using at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), or Programmable Logic Array (PLA). Processor 1810 may integrate one or a combination of several of the following: Central Processing Unit (CPU), Graphics Processing Unit (GPU), and modem. The CPU primarily handles the operating system, user interface, and applications; the GPU is responsible for rendering and drawing the displayed content; and the modem handles wireless communication. It is understood that the modem may also not be integrated into processor 1810 and may be implemented separately through a communication chip.
[0289] The memory 1820 may include random access memory (RAM) or read-only memory (ROM). The memory 1820 can be used to store instructions, programs, code, code sets, or instruction sets. The memory 1820 may include a program storage area and a data storage area. The program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as touch functionality, sound playback functionality, image playback functionality, etc.), and instructions for implementing the various method embodiments described above. The data storage area may also store data created by the electronic device 1800 during use.
[0290] The transceiver unit 1830 may include, but is not limited to, cellular radio frequency modules, Wi-Fi modules, etc., and can be used to provide communication functions.
[0291] This application discloses an electronic device including a memory, a processor, and a transceiver unit. The memory stores a computer program, which, when executed by the processor, causes the electronic device to implement the data transmission method applied to a target wireless access point as described in the above embodiments.
[0292] This application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor in an electronic device, the electronic device implements the data transmission method applied to a terminal device as described in the above embodiments.
[0293] This application discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor in an electronic device, the electronic device implements the data transmission method applied to a target wireless access point as described in the above embodiments.
[0294] This application discloses a computer program product, which includes a computer program. When the computer program is executed by a processor in an electronic device, it enables the electronic device to implement the data transmission method applied to a terminal device as described in the above embodiments.
[0295] This application discloses a computer program product, which includes a computer program. When the computer program is executed by a processor in an electronic device, it enables the electronic device to implement the data transmission method applied to a target wireless access point as described in the above embodiments.
[0296] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, ROM, etc.
[0297] Any references to memory, storage, databases, or other media used herein may include non-volatile and / or volatile memory. Suitable non-volatile memory may include ROM, Programmable ROM (PROM), Erasable PROM (EPROM), Electrically Erasable PROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM), which is used as an external cache memory. By way of illustration and not limitation, RAM may take many forms, such as Static RAM (SRAM), Dynamic Random Access Memory (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDR SDRAM), Enhanced Synchronous DRAM (ESDRAM), Synchlink DRAM (SLDRAM), Rambus DRAM (RDRAM), and Direct Rambus DRAM (DRDRAM).
[0298] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Those skilled in the art should also recognize that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily essential to this application. It should be noted that "multiple" in this application includes "two or more".
[0299] In the various embodiments of this application, it should be understood that the sequence number of each process does not necessarily imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.
[0300] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they can be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0301] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0302] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0303] The foregoing has provided a detailed description of a data transmission method, apparatus, electronic device, and computer program product disclosed in the embodiments of this application. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the embodiments above are merely for the purpose of helping to understand the method and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A data transmission method, characterized by, Applied to a terminal device, wherein the terminal device establishes a first wireless communication link and a second wireless communication link with the same network device or with different network devices respectively, the method includes: Based on the Internet Protocol (IP) address corresponding to the first wireless communication link, the data to be transmitted is encapsulated to obtain the IP data packet to be transmitted. If the first link switching condition is met, the IP data packet is sent through the second wireless communication link. The first link switching condition is the condition for switching from the first wireless communication link to the second wireless communication link.
2. The method of claim 1, wherein, The source IP address carried by the IP data packet is the IP address corresponding to the first wireless communication link; the IP address corresponding to the first wireless communication link is the IP address used when the terminal device and the destination device establish a communication channel.
3. The method of claim 1, wherein, Before transmitting the IP data packet via the second wireless communication link, the method further includes: If the first link switching condition is met, a first switching instruction is sent to the first link driver corresponding to the first wireless communication link. The first switching instruction is used to instruct the first link driver to forward the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained. The step of sending the IP data packet through the second wireless communication link includes: The second link driver obtains the IP data packets forwarded by the first link driver and sends the IP data packets using the second wireless communication link.
4. The method of claim 1, wherein, Before transmitting the IP data packet via the second wireless communication link, the method further includes: If the first link switching condition is met, a second switching instruction is sent to the kernel layer. The second switching instruction is used to instruct the kernel layer to send the IP data packet to the second link driver corresponding to the second wireless communication link when the IP data packet is obtained. The step of sending the IP data packet through the second wireless communication link includes: The IP data packets are sent using the second wireless communication link via the second link driver.
5. The method of claim 1, wherein, Before transmitting the IP data packet via the second wireless communication link, the method further includes: If the first link switching condition is detected, a target routing rule is configured. The target routing rule is used to define the IP data packets transmitted using the first wireless communication link to be switched to the second wireless communication link for transmission. The step of sending the IP data packet through the second wireless communication link includes: Based on the target routing rules, the IP data packet is allocated to the second wireless communication link and transmitted through the second wireless communication link.
6. The method of claim 5, wherein, The step of configuring target routing rules when the first link switching condition is detected includes: If the first link switching condition is met, the application information and message characteristics of the target application are obtained, wherein the target application is an application that uses the first wireless communication link for data transmission. Configure target routing rules based on the application information and message characteristics.
7. The method according to claim 5 or 6, characterized in that, The step of allocating the IP data packet to the second wireless communication link based on the target routing rule includes: Based on the target routing rule, it is determined that the IP packet matches the target routing rule, and a target tag is added to the IP packet; The IP packets with the target tag added are assigned to the second wireless communication link.
8. The method of claim 7, wherein, The step of determining that the IP packet matches the target routing rule based on the target routing rule, and adding a target tag to the IP packet, includes: When the IP data packet passes through the first-level IP route, the IP data packet is matched with the target routing rule; the first-level IP route is used to define that the IP data packet is sent through the first wireless communication link; If the IP packet matches the target routing rule, then a target tag is added to the IP packet; The step of allocating the IP data packet with the target tag added to the second wireless communication link includes: The IP packets with the target tag are rerouted through a second-level IP route to allocate them to the second wireless communication link. The second-level IP route defines how the IP packets are sent through the second wireless communication link.
9. The method according to any one of claims 1 to 6, characterized in that, The first link switching condition includes at least one of the following: The quality of the first link corresponding to the first wireless communication link is lower than the first quality threshold. The quality of the second link corresponding to the second wireless communication link is higher than the quality of the first link corresponding to the first wireless communication link.
10. The method of claim 9, wherein, The method further includes: Obtain the first communication quality information corresponding to the first wireless communication link, and determine the first link quality corresponding to the first wireless communication link based on the first communication quality information.
11. The method of claim 10, wherein, The first communication quality information includes at least one of the device link performance parameters, network environment status parameters, and real-time communication performance parameters corresponding to the first wireless communication link; The device link performance parameters include at least one of the received signal strength index (RSSI), transmission rate, and reception rate corresponding to the first wireless communication link; the network environment status parameters include at least one of the air interface channel utilization, transmission retransmission rate, transmission packet loss rate, and network device feedback factor corresponding to the first wireless communication link; the real-time communication performance parameters include at least one of the communication latency and communication throughput corresponding to the first wireless communication link.
12. The method of claim 11, wherein, Determining the first link quality corresponding to the first wireless communication link based on the first communication quality information includes: A first quality score is determined based on the device link performance parameters; The second quality score is determined based on the network environment status parameters. The third quality score is determined based on the real-time communication performance parameters. The first mass fraction and the second mass fraction are weighted and calculated to obtain the first calculation result; The first calculation result is weighted and calculated with the third quality score to obtain the first link quality corresponding to the first wireless communication link.
13. The method according to any one of claims 1 to 6, 10 to 12, characterized in that, The network device includes a wireless access point, and the terminal device establishes a first wireless communication link and a second wireless communication link with the target wireless access point, respectively. The method further includes: If the first link switching condition is met, a switching request is sent to the target wireless access point through the first wireless communication link and the second wireless communication link respectively. The switching request is used to instruct the target wireless access point to send data to the terminal device through the second wireless communication link.
14. The method of claim 13, wherein, The handover request is also used to trigger the target wireless access point to keep its Network Address Translation (NAT) table unchanged and update the target forwarding rule to the hardware acceleration table. The target forwarding rule is used to define how to send data to the terminal device through the second wireless communication link.
15. A data transmission method, characterized by, The method, applied to a target wireless access point, wherein the target wireless access point and a terminal device respectively establish a first wireless communication link and a second wireless communication link, includes: The terminal device receives a handover request, which is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, under the condition that the first link handover condition is met; the first link handover condition is the condition for switching from the first wireless communication link to the second wireless communication link. In response to the handover request, data is sent to the terminal device via the second wireless communication link.
16. The method of claim 15, wherein, After receiving the handover request sent by the terminal device, the method further includes: According to the switching request, the NAT table remains unchanged, and the target forwarding rule is updated to the hardware acceleration table. The target forwarding rule is used to define how to send data to the terminal device through the second wireless communication link.
17. A data transmission apparatus, characterized by comprising: Applied to a terminal device, wherein the terminal device establishes a first wireless communication link and a second wireless communication link with the same network device or with different network devices respectively, the device includes: The encapsulation module is used to encapsulate the data to be transmitted according to the IP address corresponding to the first wireless communication link to obtain the IP data packet to be transmitted. The transmission module is configured to send the IP data packet through the second wireless communication link when a first link switching condition is met, wherein the first link switching condition is a condition for switching from the first wireless communication link to the second wireless communication link.
18. A data transmission apparatus, characterized by comprising: An apparatus for use with a target wireless access point, wherein the target wireless access point and a terminal device establish a first wireless communication link and a second wireless communication link, the apparatus comprising: The request receiving module is used to receive a handover request sent by the terminal device. The handover request is sent by the terminal device through the first wireless communication link and the second wireless communication link respectively, under the condition that the first link handover condition is met. The first link handover condition is the condition for handover from the first wireless communication link to the second wireless communication link. The data transmission module is used to send data to the terminal device via the second wireless communication link in response to the handover request.
19. An electronic device, comprising: An electronic device comprising a memory and a processor, a transceiving unit, the memory storing a computer program, the computer program being executed by the processor to cause the electronic device to implement the method of any one of claims 1-14, or the method of any one of claims 15-16.
20. A computer program product, characterised in that, A computer program, the computer program being executed by a processor in an electronic device to cause the electronic device to implement the method of any one of claims 1-14, or the method of any one of claims 15-16.