A communication method and device
By using TCP proxy caching and selective replication of data packets at the access point, the transmission efficiency and latency issues caused by packet loss in Wi-Fi networks in TCP connections are resolved, achieving more efficient and reliable data transmission.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- HUAWEI TECH CO LTD
- Filing Date
- 2023-07-11
- Publication Date
- 2026-06-16
AI Technical Summary
In TCP connections, the differences in network quality between different transmission media can lead to packet loss in Wi-Fi networks, affecting the transmission efficiency of the entire TCP connection, increasing transmission latency and reducing throughput, especially in latency-sensitive services.
By leveraging the TCP proxy function of the access point, data packets are cached and selectively copied, ACK packet acknowledgments are simulated, lost data is retransmitted in a timely manner, and the caching strategy is dynamically adjusted to adapt to changes in network quality, thus avoiding impact on the resources and throughput of the entire TCP connection.
It improves the reliability and efficiency of TCP transmission, shortens the retransmission path, reduces the load and resource consumption of access points, reduces communication latency, and increases throughput.
Smart Images

Figure CN119316482B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a communication method and device. Background Technology
[0002] Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol widely used in current communication networks. To ensure network reliability, TCP provides packet loss detection and retransmission control capabilities. When packet loss occurs, TCP will reduce the frequency of packet transmission, decrease throughput, and increase transmission latency, which can impact latency-sensitive services.
[0003] In one scenario, a TCP connection may include at least two networks using different transmission media, such as Ethernet and Wireless-Fidelity (Wi-Fi) networks. However, since the quality of these two different transmission media generally differs, a low-quality network can affect the transmission efficiency of the entire TCP connection. For example, in a Wi-Fi network, Wi-Fi interference can lead to packet loss; furthermore, when the server sending the data packets detects a transmission timeout due to packet loss in a Wi-Fi network, it will trigger data retransmission. This results in longer detection times, longer retransmission paths, and also leads to a decrease in TCP connection throughput and an increase in transmission latency. Summary of the Invention
[0004] This application provides a communication method and apparatus. The method provides a way to avoid decreased throughput and increased transmission latency in TCP connections through a TCP virtual proxy; and it also provides a technical solution for evaluating the network quality, including the network itself, within the TCP connection. Therefore, this method can improve the reliability and efficiency of TCP-based transmission.
[0005] The first aspect provides a communication method. In this method, an access point receives L data packets sent by a server to a site, and caches M data packets from the L data packets, where L is a positive integer and M is a positive integer less than or equal to L; the access point sends the L data packets to the site; when the access point detects that the first data packet among the M data packets has been successfully sent, it deletes the first data packet from the cached M data packets; when the access point detects that the second data packet among the M data packets has failed to be sent, it sends the second data packet from the cached M data packets to the site.
[0006] This method utilizes the TCP proxy function of the access point to selectively copy and cache data packets sent from the server to the site. This allows the access point to retransmit lost data packets based on the cached packets when packet loss occurs at the site. Therefore, this method shortens the retransmission path and reduces the load and resource consumption requirements on the access point through selective copying. This approach improves the reliability and efficiency of TCP transmission.
[0007] In one possible implementation, caching M data packets out of the L data packets includes, but is not limited to, one or more of the following: the access point detects a drop event of a third data packet during data packet reception and caches the third data packet; or, the access point detects that the transmission time interval of a fourth data packet is greater than a preset interval value during data packet transmission and caches the fourth data packet; or, the access point detects a link layer packet loss event of a fifth data packet and caches the fifth data packet. It is understood that in this embodiment, a data packet can also be referred to as a data packet, data packet loss can also be referred to as packet loss, and the transmission time interval can also be referred to as the packet transmission interval.
[0008] In this implementation, by using a TCP proxy at the access point, one or more possible packet loss scenarios can be detected. Furthermore, by caching potentially lost data packets, the access point can retransmit the lost data packets based on the cached data packets when packet loss occurs at the site, thereby shortening the retransmission path. This method improves the reliability and efficiency of TCP transmission.
[0009] In one possible implementation, the access point detects that the first data packet among the M data packets has been successfully sent, including but not limited to the following: the access point receives a first ACK packet of the first data packet sent by the site; or, the access point receives a first SACK packet of the sixth data packet sent by the site, wherein the first SACK packet is used to instruct the site to request the sixth data packet, and the sequence number of the sixth data packet is greater than the sequence number of the first data packet.
[0010] In this implementation, by using the TCP proxy at the access point, data packets in the buffer can be processed in a timely manner based on TCP transmission, and successfully sent data packets can be deleted promptly. Therefore, the consumption of buffer resources can be reduced.
[0011] In one possible implementation, the access point detects that the second data packet in the M data packets has failed to be sent, including but not limited to the following: the access point does not receive a second ACK packet for the second data packet sent by the site within a preset time period; or, the access point receives a second SACK packet for the second data packet sent by the site, the second SACK packet being used to instruct the site to request the second data packet.
[0012] In this implementation, by using a TCP proxy at the access point, data packets in the buffer can be processed in a timely manner based on TCP transmission, and data retransmission can be implemented promptly when packet loss is detected at the site. Therefore, data packet transmission efficiency can be improved and the retransmission path can be shortened.
[0013] In one possible implementation, the method further includes: the access point receiving a third SACK message for a seventh data packet sent by the site, the third SACK message being used to instruct the site to request the seventh data packet, wherein the M data packets do not include the seventh data packet and the sequence number of the seventh data packet is less than the sequence number of the M data packets; and the access point sending the third SACK message to the server.
[0014] In this implementation, the TCP proxy at the access point can process data packets in the buffer in a timely manner based on TCP transmission. When it is detected that the buffer does not contain lost data packets, the server can be notified in a timely manner, thereby ensuring the reliability and efficiency of TCP transmission.
[0015] In one possible implementation, after caching M data packets out of the L data packets, the method further includes: the access point sending one or more third ACK packets to the server, the one or more third ACK packets indicating that the station has received the M data packets; and / or the access point receiving one or more fourth ACK packets sent by the station to the server, and sending the one or more fourth ACK packets to the server, the one or more fourth ACK packets indicating that the station has received N data packets, where N is a positive integer less than or equal to L. It can be understood that the one or more third ACK packets sent by the access point to the server are ACK packets sent by the station to the server after the access point has cached the M data packets; it can also be understood that the M data packets are the data packets acknowledged by the access point on behalf of the station. Similarly, the one or more fourth ACK packets are ACK packets sent by the station to the server after the station has received N data packets out of the L data packets; it can also be understood that the N data packets are the data packets actually received by the station.
[0016] In this implementation, after selectively copying and caching data packets, the access point can simulate a site replying with an ACK packet to the server. This allows the server to promptly determine that the site has received this portion of the data packet, avoiding excessively long detection times that could reduce throughput. It is understood that if a site does not receive this portion of the data packet, the access point can retransmit the data based on the data packets included in the buffer, thus ensuring the reliability of data packet transmission.
[0017] In one possible implementation, after sending the second data packet from the M cached data packets to the station, the method further includes: the access point receiving a fifth ACK packet sent by the station to the server, and sending the fifth ACK packet to the server, wherein the fifth ACK packet is used to indicate that the station has received the second data packet. It can be understood that after receiving the data packet sent by the access point based on the cache, the station can send an ACK packet to the server for the received data packet.
[0018] In this implementation, by retransmitting lost data packets through the access point, the site can also receive the data packets and send ACK packets to the server, so that the server can determine that the site has received the data packets.
[0019] In one possible implementation, the method of caching M data packets out of the L data packets further includes: when the remaining cache space of the cache queue is less than the space occupied by the eighth data packet, replacing the ninth data packet in the cache queue with the eighth data packet, wherein the transmission time interval of the ninth data packet is less than the transmission time interval of any data packet included in the cache queue, or the caching time of the ninth data packet is earlier or later than the caching time of any data packet included in the cache queue; wherein the M data packets include the eighth data packet but do not include the ninth data packet; or, when the remaining cache space of the cache queue is less than the space occupied by the eighth data packet, no longer caching the eighth data packet; wherein the M data packets do not include the eighth data packet.
[0020] In this implementation, when caching data packets, the priority of caching data packets can be determined based on factors such as packet loss probability and packet sending order. For example, data packets with a high probability of packet loss can be cached first, or data packets sent earliest or latest can be cached first. Therefore, the reliability and efficiency of TCP transmission can be improved.
[0021] In one possible implementation, the access point detects that the network quality assessment result of the first network meets a preset condition and updates the preset interval value. The first network is the network between the access point and the site. The first assessment result is better than the second assessment result, the preset interval value corresponding to the first assessment result is greater than the preset interval value corresponding to the second assessment result, the first assessment result is the network quality assessment result of the first network at a first time, and the second assessment result is the network quality assessment result of the first network at a second time.
[0022] In this embodiment, the data in the cached data packets can be adjusted by changing the preset interval value. Therefore, this implementation method can achieve dynamic adjustment based on network quality assessment results.
[0023] In one possible implementation, the access point updates the preset interval value when it detects that the network quality assessment result of the first network meets a preset condition. This includes: the access point decreasing the preset interval value when it detects that the transmission duration of the ACK packet sent by the station increases and the increase is greater than a first preset threshold; and the access point increasing the preset interval value when it detects that the transmission duration of the ACK packet sent by the station decreases and the decrease is greater than a second preset threshold. The transmission duration is determined based on the timestamp of the ACK packet sent by the station and the timestamp of the ACK packet received by the access point. The first preset threshold and the second preset threshold may be the same or different.
[0024] In this implementation, by evaluating network quality, the caching probability can be reduced when network quality is good, thereby reducing load and resource consumption; conversely, the caching probability can be increased when network quality is poor, thereby ensuring communication reliability. Therefore, this implementation can be dynamically adjusted based on network quality evaluation results.
[0025] Based on the above embodiments, the access point and the site establish a connection through a first network, and the access point and the server establish a connection through a second network, wherein the first network and the second network use different transmission media. In one possible implementation, the first network is, for example, a Wi-Fi network. In this embodiment, by using a TCP proxy at the access point, problems such as packet loss caused by Wi-Fi interference in TCP connections, including those over Wi-Fi networks, can be resolved, thereby improving the transmission efficiency and reliability of TCP connections.
[0026] A second aspect provides a communication system. The system includes an access point, a site, and a server as described in the first aspect and its embodiments, wherein the access point can be used to perform the methods described in the first aspect and its embodiments.
[0027] A third aspect provides an access point comprising multiple functional modules; these multiple functional modules interact to implement the methods performed by the access point in the first aspect and its various embodiments. The multiple functional modules can be implemented based on software, hardware, or a combination of both, and can be arbitrarily combined or divided based on specific implementations.
[0028] The fourth aspect also provides an access point, including at least one processor and at least one memory, wherein the at least one memory stores a program, and when the access point is run, the at least one processor executes the access point execution method described in the first aspect and its various embodiments.
[0029] The fifth aspect provides a readable storage medium storing instructions that, when executed at an access point, cause the access point to perform the methods described in the first aspect and its various possible embodiments.
[0030] A sixth aspect provides a program product that, when run on an access point, causes the access point to perform the methods described in the first aspect and its various possible implementations.
[0031] The seventh aspect also provides a chip for reading a program stored in a memory and executing the method of the first aspect and its various possible embodiments.
[0032] The eighth aspect also provides a chip system including a processor for supporting an access point in implementing the methods of the first aspect and its various possible embodiments described above. In one possible embodiment, the chip system further includes a memory for storing programs and data necessary for the device. The chip system may be composed of chips or may include chips and other discrete devices.
[0033] For details on the beneficial effects of any of the second to eighth aspects and their possible implementations, please refer to the beneficial effects of the various possible implementations in the first aspect above; they will not be repeated here. Attached Figure Description
[0034] Figure 1a This is a schematic diagram of an application scenario;
[0035] Figure 1b This is a schematic diagram of another application scenario;
[0036] Figure 2 A schematic diagram of the hardware architecture of a device provided in an embodiment of this application;
[0037] Figure 3A software system architecture block diagram of a device provided in an embodiment of this application;
[0038] Figure 4 This is a schematic diagram illustrating an application scenario of a communication method provided in an embodiment of this application;
[0039] Figure 5 This is a possible structural diagram of the AP provided in an embodiment of this application;
[0040] Figure 6 A schematic diagram of the interaction flow of a communication method provided in an embodiment of this application;
[0041] Figure 7 A schematic diagram of a cache area provided in an embodiment of this application;
[0042] Figure 8 This is another interactive flow diagram of a communication method provided in an embodiment of this application. Detailed Implementation
[0043] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0044] The method provided in this application can be applied to TCP connections involving at least two networks using different transmission media. These networks using different transmission media may include, but are not limited to, fiber optic networks, Ethernet, 5G networks, 4G networks, Wi-Fi networks, Bluetooth networks, and near field communication (NFC) networks. Because the network quality of the two different networks differs, a lower-quality network may affect the transmission efficiency of the entire TCP connection.
[0045] Taking the two networks included in a TCP connection, Ethernet and Wi-Fi, as an example, Figure 1a This is a schematic diagram of a possible application scenario. This scenario can include at least: a server, an access point (AP), and a station (STA). The server can be a device that provides services, such as a business server, cloud server, or base station; the AP can be a wireless router, Wi-Fi repeater, or similar device; and the STA can be a personal computer, mobile phone, tablet, or similar device connected to the AP. Figure 1a The communication network shown can achieve reliable communication based on TCP connections. For example, users can use this network to download files, browse web pages, and engage in social networking. Figure 1aAs shown, communication between the server and the access point (AP) can be achieved through fiber optic networks, Ethernet, 5G networks, 4G networks, etc. Communication between the AP and the STA (Station) is generally achieved through Wi-Fi networks.
[0046] In Wi-Fi networks, interference from numerous connected devices, physical obstacles, and network congestion can cause data packet loss in the communication link between the access point (AP) and the STA (Station). Furthermore, in TCP-based transmission networks, while packet loss detection and retransmission control are available, the server can trigger retransmission of data packets sent to the STA if it detects a timeout. However, the long detection time and retransmission path increase communication latency. Additionally, when packet loss occurs, the server, based on the TCP connection, controls the packet sending frequency, reducing throughput and increasing transmission latency. For example… Figure 1a The packet loss of the Wi-Fi network shown will be reduced. Figure 1a The packet transmission rate of the fiber optic network shown can significantly impact latency-sensitive services. For example, in a whole-house device control scenario, packet loss can lead to control failures or increased latency, resulting in a poor user experience.
[0047] One possible implementation is to improve retransmission efficiency by providing a TCP proxy in the middle of the TCP connection. For example, Figure 1b This is a diagram illustrating another application scenario. In the scenario where the server sends data packets to the STA, Figure 1b The TCP proxy provided in the code works as follows: the access point (AP) first receives TCP packets sent by the server and stores them; then, the AP forwards the TCP packets to the standby nodes (STAs). For example... Figure 1b As shown, the TCP proxy function in the AP can divide the communication link from the server to the STA into a TCP-1 link and a TCP-2 link. This way, even if packet loss occurs on the TCP-2 link, the AP can retransmit the TCP packets based on its TCP proxy function, thus shortening the retransmission path. However, Figure 1bThe AP TCP proxy method shown in the diagram has several drawbacks. When packet loss increases due to unstable TCP-1 or TCP-2 links, the TCP proxy may accumulate a large number of data packets that need to be retransmitted, leading to increased memory overhead. Furthermore, because the TCP proxy divides the original TCP connection into two segments, terminating the original TCP connection and taking over both the receiving and sending functions of the original TCP connection, it increases the central processing unit (CPU) overhead of the TCP proxy, especially at high throughput, impacting data transmission performance. Even in scenarios where the network quality of the links on both sides of the TCP proxy is good, [further issues may arise]. Figure 1b The TCP proxy method shown also affects transmission throughput and transmission latency. Therefore, Figure 1b The application scenarios of the embodiments shown are quite limited.
[0048] In view of this, embodiments of this application provide a communication method. In this method, a virtual proxy can be implemented through an AP. In a scenario where the server sends data packets to a STA, after the AP receives a data packet from the server (which can also be understood as the "sender"), it caches a portion of the data packet sent by the server. For this cached portion of the data packet, the AP can simulate the STA (which can also be understood as the "receiver") sending an acknowledgment character (ACK) message (hereinafter collectively referred to as an ACK message) to the server. Based on the received ACK message, the server considers that the STA has received this portion of the data packet sent by the server, thus not reducing throughput or the frequency of data packet transmission by the server, thereby avoiding transmission delay.
[0049] On the other hand, the AP can assess the network quality status of the Wi-Fi link between the AP and the STA, and selectively copy data packets from the server based on the network quality assessment results, caching the selectively copied data packets. Then, the AP can delete the data packet if it determines that the stored data packet includes the data packet corresponding to the ACK packet sent by the STA; or, if the AP detects that it has not received an ACK packet for the data packet from the STA after a preset time, it can determine that the data packet needs to be retransmitted, and send the data packet that needs to be retransmitted to the STA based on the cached data packet to achieve data retransmission.
[0050] Therefore, this method can achieve more accurate TCP proxy functionality through network quality assessment, avoiding caching of all TCP packets from the server. This reduces the memory resource overhead of network devices and lowers the load requirements due to TCP proxy functionality. Furthermore, when the network quality of the TCP connection is good, this method will not truncate the original TCP connection, thus requiring minimal resource overhead and not affecting the transmission throughput and latency of the TCP connection. In addition, the TCP proxy functionality provided in this embodiment can improve the accuracy of identifying potentially lost data packets based on network quality assessment, avoiding the need for TCP proxy for even non-lost data packets. This reduces the proxy load of TCP, increases throughput, and lowers communication latency.
[0051] For example, the AP receives data packets 1, 2, and 3 sent by the server to the STA. The AP assesses the network quality of the Wi-Fi link between the AP and the STA, and based on the assessment result, determines whether to copy and cache data packets 2 and 3. Optionally, the AP can simulate the STA sending ACK packets for data packets 2 and 3 to the server, so that the server can assume that the STA has received data packets 2 and 3. When the AP receives the STA's ACK packet for data packet 2, it deletes the cached data packet 2; if the AP does not receive the STA's ACK packet for data packet 3 after a preset time, it can send data packet 3 to the STA based on the cached data packet 3. Additionally, it is understood that if the AP sends data packet 3 to the STA more than a preset number of times (e.g., 3 times), it can delete the cached data packet 3 to release cache resources in a timely manner.
[0052] In one optional embodiment, the embodiments of this application can be applied to a TCP connection-based communication system, where the TCP connection may include at least two networks using different transmission media. In one possible scenario, the communication system includes Ethernet and Wi-Fi networks, wherein the Wi-Fi network may include one or more access points (APs) and one or more STAs (Stations). It is understood that the communication system in the embodiments of this application may also include a server, such as a base station.
[0053] The type of server involved in this application embodiment is not limited. For example, the server may be a device that provides services to services, such as a business server, cloud server, or base station.
[0054] Furthermore, the number and type of APs and STAs are not limited in the embodiments of this application. For example, the APs involved in the embodiments of this application can be wireless routers, Wi-Fi repeaters, and other devices. As another example, the STAs in the embodiments of this application can be devices such as mobile phones, PCs, tablets, wearable devices (e.g., watches, wristbands, etc.), in-vehicle devices, augmented reality (AR) / virtual reality (VR) devices, laptops, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (e.g., smart TVs, smart speakers, etc.). It is understood that the embodiments of this application do not impose any restrictions on the specific types of devices.
[0055] The devices to which this application can be applied, including exemplary embodiments, include but are not limited to those equipped with Or devices operating systems.
[0056] Figure 2 A schematic diagram of a possible device hardware structure is shown. The device 200 includes components such as: a radio frequency (RF) circuit 210, a power supply 220, a processor 230, a memory 240, an input unit 250, a display unit 260, an audio circuit 270, a communication interface 280, and a wireless-fidelity (Wi-Fi) module 290. Those skilled in the art will understand that... Figure 2 The hardware structure of the device 200 shown in the figure does not constitute a limitation on the device 200. The device 200 provided in the embodiments of this application may include more or fewer components than shown, may combine two or more components, or may have different component configurations. Figure 2 The various components shown can be implemented in hardware, software, or a combination of hardware and software, including one or more signal processing and / or application-specific integrated circuits.
[0057] The following is combined Figure 2 The various components of the device 200 are described in detail below:
[0058] The RF circuit 210 can be used for receiving and transmitting data during communication or a call. Specifically, after receiving downlink data from the base station, the RF circuit 210 sends it to the processor 230 for processing; additionally, it sends uplink data to be transmitted to the base station. Typically, the RF circuit 210 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low-noise amplifier (LNA), a duplexer, etc.
[0059] Furthermore, the RF circuit 210 can also communicate with other devices via a wireless communication network. The wireless communication can use any communication standard or protocol, including but not limited to Global System for Mobile Communications (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), 5G, email, and Short Messaging Service (SMS).
[0060] The device 200 can also perform communication services and interact with other devices or network devices. Therefore, the device 200 needs to have data transmission capabilities, meaning that the device 200 needs to include a communication module. Although Figure 2 The RF circuit 210, the Wi-Fi module 290, and the communication interface 280 are shown, but it is understood that the device 200 contains at least one of the above-mentioned components or other communication modules (such as a Bluetooth module) for data transmission.
[0061] For example, when the device 200 is a mobile phone, the device 200 may include the RF circuit 210, the Wi-Fi module 290, or a Bluetooth module. Figure 2 (Not shown in the image); when the device 200 is a computer, the device 200 may include the communication interface 280, and may also include the Wi-Fi module 290, or may include a Bluetooth module (not shown in the image); Figure 2 (Not shown in the image); when the device 200 is a tablet computer, the device 200 may include the Wi-Fi module, or may include a Bluetooth module (not shown in the image); Figure 2 (Not shown in the image).
[0062] Wi-Fi technology is a short-range wireless transmission technology. The device 200 can connect to an access point (AP) via the Wi-Fi module 290, thereby enabling access to the data network. The Wi-Fi module 290 can be used for data reception and transmission during communication. In this embodiment, the device 200 can act as a STA, receiving data packets from the AP via the Wi-Fi module 290, and also sending data packets to the AP that need to be sent to the server via the Wi-Fi module 290. Furthermore, based on the method provided in this embodiment, the data packets received by the STA from the AP via the Wi-Fi module 290 can include data packets from the server, and can also include data packets that the AP has copied and retransmitted from the server's data packets.
[0063] The device 200 can be physically connected to other devices through the communication interface 280. Optionally, the communication interface 280 can be connected to the communication interfaces of other devices via a cable to enable data transmission between the device 200 and other devices.
[0064] The memory 240 can be used to store software programs and modules. The processor 230 executes various functional applications and data processing of the device 200 by running the software programs and modules stored in the memory 240. Optionally, the memory 240 may mainly include a program storage area and a data storage area. The program storage area may store the operating system (mainly including the software programs or modules corresponding to the kernel layer, system layer, application framework layer, and application layer).
[0065] In addition, the memory 240 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0066] The input unit 250 can be used to receive editing operations on various types of data objects, such as numbers or characters, input by the user, and to generate key signal inputs related to user settings and function control of the device 200. Optionally, the input unit 250 may include a touch panel 251 and other input devices 252.
[0067] The touch panel 251, also known as a touch screen, can collect touch operations performed by the user on or near it (such as operations performed by the user using a finger, stylus, or any suitable object or accessory on or near the touch panel 251), and drive the corresponding connection device according to a pre-set program.
[0068] Optionally, the other input device 252 may include, but is not limited to, one or more of the following: physical keyboard, function keys (such as volume control buttons, power buttons, etc.), trackball, mouse, joystick, etc.
[0069] The display unit 260 can be used to display information input by the user or information provided to the user, as well as various menus of the device 200. The display unit 260 is the display system of the device 200, used to present the interface and realize human-computer interaction. The display unit 260 may include a display panel 261. Optionally, the display panel 261 may be configured as a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
[0070] The processor 230 is the control center of the device 200. It connects various components via various interfaces and lines, and executes software programs and / or modules stored in the memory 240, as well as calling data stored in the memory 240, to perform various functions and process data of the device 200, thereby realizing multiple services based on the device 200. In this embodiment, the processor 230 can be used to implement the communication method provided in this embodiment.
[0071] The device 200 also includes a power supply 220 (such as a battery) for supplying power to various components. Optionally, the power supply 220 can be logically connected to the processor 230 through a power management system, thereby enabling the power management system to manage functions such as charging, discharging, and power consumption.
[0072] like Figure 2 As shown, device 200 also includes audio circuitry 270, microphone 271, and speaker 272, providing an audio interface between the user and device 200. Audio circuitry 270 converts audio data into signals recognizable by speaker 272 and transmits these signals to speaker 272, where they are converted into sound signals for output. Microphone 271 collects external sound signals (such as human speech or other sounds) and converts these signals into signals recognizable by audio circuitry 270, sending them to audio circuitry 270. Audio circuitry 270 can also convert the signals transmitted by microphone 271 into audio data and output the audio data to RF circuitry 210 for transmission to, for example, another device, or output the audio data to memory 240 for further processing.
[0073] Although not shown, the device 200 may also include a camera, at least one sensor, etc., which will not be described in detail here. The at least one sensor may include, but is not limited to, a pressure sensor, a barometric pressure sensor, an accelerometer, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, etc.
[0074] The operating system (OS) involved in this application embodiment is the most basic system software running on device 200. The software system of device 200 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment takes an operating system adopting a layered architecture as an example to illustrate the software system architecture of device 200.
[0075] Figure 3 This is a software system architecture block diagram of a device provided in an embodiment of this application. For example... Figure 3 As shown, the device's software system architecture can be a layered architecture. For example, the software can be divided into several layers, each with a clear role and division of labor. Layers communicate with each other through software interfaces. In one embodiment, the operating system is divided into five layers, from top to bottom: the application layer, the application framework layer (framework, FWK), the runtime and system libraries, the kernel layer, and the hardware layer.
[0076] The application layer can include a series of application packages. For example... Figure 3 As shown, the application layer can include camera, settings, skin modules, user interface (UI), third-party applications, etc. Third-party applications can include wireless local area network (WLAN), music, call, Bluetooth, video, memos, messaging, and some instant messaging software, etc.
[0077] In one possible implementation, the application can be developed using Java, by calling the application programming interface (API) provided by the application framework layer. Developers can then interact with the underlying operating system layers (such as the hardware layer and kernel layer) to develop their own applications. This application framework layer primarily consists of a series of services and management systems within the operating system.
[0078] The application framework layer provides application programming interfaces and a programming framework for applications within the application layer. The application framework layer includes some predefined functions. For example... Figure 3As shown, the application framework layer may include an activity manager, window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
[0079] The Activity Manager manages the lifecycle of each application and provides commonly used navigation and back functions, offering an interactive interface for all program windows.
[0080] The window manager is used to manage windowed applications. It can obtain the screen size, determine if a status bar is present, lock the screen, and capture screenshots. The content provider stores and retrieves data, making this data accessible to applications. This data may include videos, images, audio, made and received phone calls, browsing history and bookmarks, phone books, etc.
[0081] A view system includes visual controls, such as controls for displaying text and controls for displaying images. View systems can be used to build applications. A display interface can consist of one or more views. For example, a display interface including a text notification icon could include views for displaying text and views for displaying images.
[0082] The phone manager is used to provide communication functions for the device, such as managing call status (including connection, hang-up, etc.).
[0083] The file explorer provides applications with various resources, such as localized strings, icons, images, layout files, video files, and more.
[0084] The notification manager allows applications to display notifications in the status bar. These notifications can be used to deliver informational messages and can disappear automatically after a short pause, requiring no user interaction. For example, the notification manager can be used to notify users of download completion or message alerts. The notification manager can also display notifications as icons or scrolling text in the top status bar, such as notifications from background applications, or as dialog boxes on the screen. Examples include displaying text messages in the status bar, emitting sounds, vibrating the device, and flashing indicator lights.
[0085] The runtime includes the core libraries and the virtual machine. The runtime is responsible for the scheduling and management of the operating system.
[0086] The core library consists of two parts: one part contains the functionalities that the Java language needs to call, and the other part contains the core libraries of the operating system. The application layer and application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.
[0087] A system library can include multiple functional modules. For example: a surface manager, a media framework, a 3D graphics processing library (e.g., OpenGL ES), a 2D graphics engine (e.g., SGL), etc.
[0088] The Surface Manager is used to manage the display subsystem and provides the blending of 2D and 3D layers for multiple applications.
[0089] The media framework supports playback and recording of various commonly used audio and video formats, as well as still image files. It supports multiple audio and video encoding formats, such as MPEG4, H.264, MP3, AAC, AMR, JPG, and PNG.
[0090] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0091] A 2D graphics engine is a drawing engine for 2D drawing.
[0092] In one embodiment, a 3D graphics processing library can be used to draw 3D motion trajectory images, and a 2D graphics engine can be used to draw 2D motion trajectory images.
[0093] The kernel layer is the layer between hardware and software. The kernel layer contains at least the display driver, camera driver, audio driver, and sensor driver.
[0094] The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, and touch sensors.
[0095] Typically, a device 200 can run multiple applications simultaneously. In a simpler scenario, one application corresponds to one process; in a more complex scenario, one application can correspond to multiple processes. Each process has a unique process ID.
[0096] It should be understood that in the embodiments of this application, "at least one of the following" or similar expressions refer to any combination of these items, including any combination of a single item or a plurality of items. For example, at least one of a, b, or c can represent: a, b, c, a and b, a and c, b and c, or a, b, and c, where a, b, and c can be single or multiple. "Multiple" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship.
[0097] In addition, it should be understood that in the description of this application, the words "first" and "second" are used only for the purpose of distinguishing descriptions and should not be construed as indicating or implying relative importance or order.
[0098] It should be understood that the hardware structure of the device can be as follows: Figure 2 As shown, the software system architecture can be as follows: Figure 3 As shown, the software programs and / or modules corresponding to the software system architecture in the device can be stored in the memory 240, and the processor 230 can run the software programs and applications stored in the memory 240 to execute the flow of a communication method provided in the embodiments of this application.
[0099] To facilitate understanding of the communication method provided in this application, the following is combined with... Figures 4 to 7 The content shown describes the implementation process of the method provided in this application.
[0100] See Figure 4 This is a schematic diagram illustrating an application scenario of a communication method provided in an embodiment of this application. This application scenario can be applied to interactions between at least two networks using different transmission media within a TCP connection. For example, Figure 4 The illustrated application scenario can include a TCP connection consisting of server 401, AP 402, and STA 403; wherein, server 401 and AP 402 can communicate via Ethernet, and AP 402 and STA 403 can communicate via Wi-Fi. It is understood that... Figure 4 The TCP connection shown in the figure passes through Ethernet and Wi-Fi networks. Since the network quality of Wi-Fi and Ethernet networks is different, a low-quality network may affect the transmission efficiency of the entire TCP connection.
[0101] Specifically, in a TCP connection, when server 401 needs to transmit data packets to STA 403, server 401 transmits data packets 1 to 7 to be transmitted to AP 402 via Ethernet. After receiving data packets 1 to 7, AP 402, based on the destination address of the data packets, sends data packets 1 to 7 to STA 403 via the Wi-Fi network. After receiving the data packets, STA 403 sends an ACK packet to server 401 through AP 402. Understandably, when STA 403 successfully receives data packets 1 through 7, server 401 can receive the ACK packets sent by STA 403 for data packets 1 through 7. However, if any data packets are lost, such as data packets 3 and 5, server 401 will only receive the ACK packets sent by STA 403 for data packets 1, 2, 4, 6, and 7, and will not receive the ACK packets for data packets 3 and 5. In a traditional TCP connection, server 401 would need to resend data packets 3 and 5 in this situation. Furthermore, due to the detected packet loss in the TCP connection, server 401 would reduce its packet sending frequency, resulting in longer transmission delays and reduced transmission efficiency in the TCP connection.
[0102] In the method provided in this application embodiment, a TCP proxy function can be introduced into AP 402. This TCP proxy function can achieve a balance between two network quality differences. In one possible embodiment, the TCP proxy can perform network quality assessment and data packet processing based on the original TCP connection without affecting the original TCP connection and its data transmission.
[0103] In one possible embodiment, the TCP proxy function of AP 402 can selectively copy data packets 1 to 7 based on the network quality assessment results of the Wi-Fi network between AP 402 and STA 403, and cache the selectively copied data packets. For example... Figure 4 As shown, AP 402 copies and caches data packets 2, 3 and 5 from data packets 1 to 7.
[0104] In an optional embodiment, AP 402 can also simulate STA 403 to generate ACK packets based on the network layer and / or transport layer packet sequence of data packets 2, 3, and 5, and send the generated ACK packets of data packets 2, 3, and 5 to server 401. Figure 4As shown, AP 402 simulates STA 403 sending ACK packets for data packets 2, 3, and 5 to server 401. It can be understood that after receiving the ACK packets for data packets 2, 3, and 5, server 401 can determine that STA 403 has received data packets 2, 3, and 5. Thus, by having AP 402 simulate STA 403 sending ACK packets, the detection time of server 401 can be reduced, ensuring the packet sending frequency of server 401. In another possible embodiment, AP 402 can also send an ACK packet for the lost data packets to server 401 after simulating server 401 retransmitting the lost data packets and receiving the ACK packet for the lost data packets from STA 403.
[0105] In one possible embodiment, taking the loss of data packets 3 and 5 in data packets 1 to 7 sent by AP 402 to STA 403 as an example, such as... Figure 4 As shown, STA 403 successfully received data packets 1, 2, 4, 6, and 7. STA 403 then sends ACK packets for data packets 1, 2, 4, 6, and 7. AP 402 then forwards the ACK packets sent by STA to server 401. Understandably, in the scenario where AP 402 simulates STA 403 sending ACK packets for data packets 2, 3, and 5 to server 401, based on the ACK packets for data packets 1, 2, 4, 6, and 7 sent by STA 403 and the ACK packets for data packets 2, 3, and 5 sent by AP 402, server 401 can receive ACK packets for data packets 1 to 7. Therefore, server 401 can determine that data packets 1 to 7 have been successfully transmitted. At this point, no packet loss will be detected, so the packet sending frequency will not be reduced, and thus the packet sending efficiency in the TCP connection will not be affected.
[0106] In addition to sending the ACK packets for data packets 1, 2, 4, 6, and 7 sent by STA 403 to server 401, AP 402 can also process data packets in the buffer based on the ACK packets. For example, if AP 402 determines that it has received the ACK packet for data packet 2 sent by STA 403, it will delete data packet 2 from the buffer. Understandably, data packets 3 and 5 are still buffered in the buffer at this time.
[0107] In one possible embodiment, when AP 402 sends data packets 1 to 7 to STA 403, and buffers the data packets in the buffer, a timer can be started for the data packets in the buffer, such as... Figure 4 As shown, this can be understood as starting a timer for data packets 2, 3, and 5. For example, if AP 402 determines that it has not received an ACK packet for data packets 3 and 5 from STA 403 within a preset time period, it can trigger a retransmission of data packets 3 and 5. This can also be understood as AP 402 sending data packets 3 and 5 to STA 403 based on the data packets 3 and 5 cached in its buffer. Furthermore, it can be understood that when AP 402 receives an ACK packet from STA 403 for a data packet in its buffer, it can stop timing for that data packet. For example, if AP 402 receives an ACK packet for data packet 2, it can stop timing for data packet 2. In one possible embodiment, AP 402 can implement data packet timing based on a retransmission timeout (RTO) mechanism.
[0108] In another possible embodiment, AP 402 can also trigger retransmission of data packets 3 and 5 by detecting that it has not received ACK packets for data packets 3 and 5 sent by STA 403 within a preset time period. It is understood that after AP 402 sends data packets 3 and 5 to STA 403, if STA 403 successfully receives data packets 3 and 5, it can also receive ACK packets for data packets 3 and 5 sent by STA 403. In this case, AP 402 transparently transmits the ACK packets for data packets 3 and 5 to server 401, and server 401 can then determine that STA 403 has received data packets 3 and 5. It is understandable that, based on the fact that the server 401 has already received ACK messages for data packets 1, 2, 4, 6 and 7 from STA 403, when it receives ACK messages for data packets 3 and 5, it can be determined that data packets 1 to 7 have been successfully transmitted.
[0109] In this way, by having AP 402 copy and cache potentially lost data packets and then retransmit them, the data packet retransmission path can be shortened. Moreover, compared to AP 402 copying all data packets from the sending end, this avoids putting significant pressure on the AP 402's load and memory. Thus, AP can provide a technical solution that can balance the differences in network quality between the two networks.
[0110] For ease of understanding of the following embodiments, Figure 5 This is a schematic diagram of a possible structure of AP 402 provided in an embodiment of this application. AP 402 may include at least functional units such as a receiving module, a transmitting module, a forwarding module, and a TCP proxy module. It can be understood that these functional units can be configured as follows: Figure 2 The processor 230 shown is an implementation where the division of functional units is only a logical division; in practice, it can be broken down into more or fewer modules, and this application does not impose any limitations on this.
[0111] (1) A receiving module, which can be used to receive data packets sent by server 401 in the scenario where server 401 sends data packets to STA 403.
[0112] (2) Sending module, which can be used to send data packets to STA403 in the scenario where server 401 sends data packets to STA403.
[0113] (3) TCP proxy module, which can be used to implement the communication method provided in the embodiments of this application.
[0114] (4) Forwarding module, which can be used for data forwarding by AP 402 based on TCP connection. For example, in the scenario where server 401 sends data packets to STA 403, it can forward the data packets sent by server 401 to STA 403. As another example, in the scenario where STA 403 sends data packets to server 401, it can forward the data packets sent by STA 403 to server 401.
[0115] Furthermore, in communication networks, based on the Open Systems Interconnection (OSI) reference model, data packet loss can occur at the Internet Protocol (IP) transport layer, network layer, or even the data link layer. The data link layer can be used to handle data forwarding between adjacent devices, such as in Wi-Fi networks.
[0116] based on Figure 4 Application scenarios and Figure 5 The structural diagram is introduced below. The specific implementation process of the method provided in this application will be described through embodiments. (See also...) Figure 6 This is a schematic diagram illustrating the interaction flow of a communication method provided in an embodiment of this application. For ease of understanding, the following embodiments use a data packet transmission scenario with server 401 as the sender and STA 403 as the receiver as an example. For a data packet transmission scenario with server 401 as the receiver and STA 403 as the sender, please refer to [reference needed]. Figure 6 The described process, the interactive process, may include the following steps:
[0117] Step 601: AP 402 receives L data packets sent by server 401. Where L is a positive integer. The L data packets can be, for example,... Figure 4 Data packets 1 through 7 are included. It can be understood that AP 402 receives L data packets sent by server 401 with the destination address of STA 403, and AP 402 can forward these L data packets based on the destination address indicated in the data packets.
[0118] Step 602: AP 402 performs a network quality assessment on the first network. Based on the assessment result, it caches M data packets out of the L data packets; where M is a positive integer less than or equal to L. The first network is the network through which data transmission is implemented between AP 402 and STA 403, such as a Wi-Fi network.
[0119] In one possible embodiment, AP 402 can also predict potentially lost data packets by detecting at least one of the following: network layer congestion between server 401 and STA 403, and Wi-Fi network quality between AP 402 and STA 403. Based on the detection results, it then copies the potentially lost data packets to a buffer. Network layer congestion between the server and STA is generally caused by factors such as poor transport layer signal quality and high interference; when congestion occurs, the probability of packet loss is high. Wi-Fi network quality between AP 402 and STA 403 can be measured by indicators such as signal quality and wireless interference; when Wi-Fi network quality is poor, the probability of packet loss is also high.
[0120] In one possible embodiment, the buffer in AP 402 can be implemented in the form of a cache queue or other possible data storage methods, which are not limited in this application.
[0121] For ease of understanding, Figure 7 This is a schematic diagram of a cache area provided in an embodiment of this application. (In conjunction with...) Figure 5 The structural diagram shown indicates that the data packets cached in the buffer can originate from one or more of the following: For example... Figure 5 The detection and processing of the receiving module shown are as follows: Figure 5 The detection of the sending module and the detection of packet loss at the link layer are shown below, combined with... Figure 7 Let me introduce:
[0122] Method A, for example Figure 5The detection of the receiving module is shown. The receiving module of AP 402 typically has a certain receiving capacity limit. When data packets from server 401 exceed the receiving capacity of AP 402, the receiving module may experience data packet overflow. However, according to current network layer queue management algorithms, overflowing data packets may be strategically discarded, leading to packet loss. In this embodiment, AP 402 is equipped with a buffer based on its TCP proxy function. When AP 402 detects overflowing data packets that need to be lost, it can save the data packets to the buffer. Thus, the method provided in this application can reduce packet loss caused by the capacity limit of the receiving module.
[0123] like Figure 7 As shown, when the data packet sent by server 401 also includes data packet 8, but the receiving module's receiving capacity can only handle data packets 1 through 7, AP 402, according to the current network layer queue management algorithm, needs to discard data packet 8. At this time, the TCP proxy module in AP 402 detects this discard event and saves data packet 8 to its buffer. AP 402 can implement traditional TCP transmission and TCP proxy through different processes or threads, so the execution of the TCP proxy module will not affect the traditional TCP connection transmission process.
[0124] Method B, for example Figure 5 The detection of the sending module is shown. AP 402 can count the packet transmission interval between two adjacent data packets in the sending module. The packet transmission interval can be obtained by counting the interval between the sending times of two adjacent data packets. For example, starting from the time after data packet 1 is sent, the packet transmission interval of data packet 2 relative to the time of data packet 1 is the packet transmission interval of data packet 2, which can be represented as tx2; similarly, the packet transmission interval of data packet 3 can be represented as tx3, etc. In one possible embodiment, when AP 402 detects that the packet transmission interval tx of a data packet is greater than a preset interval value T, it can assess that the data packet may be lost. In addition, the packet transmission interval of data packets in a Wi-Fi network generally depends on whether the data packet can preempt transmission resources in the transport layer. It is understandable that when the Wi-Fi network is congested, the packet transmission interval is generally longer, and packet loss is more likely to occur due to congestion in this scenario. Therefore, when the packet transmission interval of a data packet is large, the probability of packet loss may be higher, and the data packet can be buffered in this case.
[0125] like Figure 7As shown, AP 402 detects that tx2 > T in data packet 2, and copies data packet 2 to the buffer for caching. Similarly, it detects that tx5 > T in data packet 5, and copies data packet 5 to the buffer for caching. This is understandable. Figure 7 Except for data packets 2 and 5, the packet sending intervals of data packets 1, 3, 4, 6 and 7 are less than or equal to T.
[0126] It's understandable that a larger packet transmission interval indicates potentially poor network quality, thus increasing the probability of packet loss. Therefore, by selecting and caching a subset of data packets from the server's 401 packets based on the transmission interval, the load and buffering pressure on the access point (AP) can be reduced. Furthermore, in the event of packet loss, the AP can retransmit the data packets, thereby shortening the retransmission path.
[0127] Method C: Detection of packet loss at the link layer. When sending data packets, AP 402 transmits the data packets from the network layer to the link layer for processing. For example... Figure 7 As shown, taking data packet 3 as an example, the link layer can split data packet 3 into data packet 3-1, data packet 3-2, and data packet 3-3. When one or more of data packets 3-1, 3-2, and 3-3 are lost, the link layer can retransmit them based on Automatic Repeat Request (ARQ). However, if the link layer executes ARQ a certain number of times, it will also discard the data packets, resulting in packet loss. The loss of data packet 3-2 can be understood as the loss of data packet 3, requiring retransmission of data packet 3. For example, Figure 7 Packet 3-2 in the process was lost. The threshold for the number of times the ARQ is triggered is 3. When the ARQ count reaches three times, which is the threshold, packet dropping is required. At this time, the TCP proxy module detects the dropping event and can then process the packet as follows: Figure 7 The ring buffer shown performs buffering of data packet 3 to avoid packet loss; the ring buffer is a circular buffer used to send data packets.
[0128] In conjunction with the buffer described in the above embodiments, AP 402 can also adjust the buffering probability to reduce the occupation of AP memory resources. For example, a proportional-integration (PI) algorithm can be used to control the buffering probability. Another example is that AP 402 can also adjust the buffering probability based on the transmission duration of the ACK packet from STA 403. For instance, when the transmission duration of the ACK packet increases, the buffering probability is increased; when the transmission duration of the ACK packet decreases, the buffering probability is decreased. The transmission duration of the ACK packet can be determined by the timestamp of STA 403 sending the ACK packet and the timestamp of AP 402 receiving the ACK packet sent by STA 403. In one possible embodiment, AP 402 can adjust the preset interval value T in mode B based on the change in the transmission duration of the ACK message of STA403. For example, when the transmission duration becomes longer and the change value is greater than or equal to the first preset threshold, the buffering probability can be increased by decreasing T. Or, when the transmission duration becomes shorter and the change value is greater than or equal to the second preset threshold, the buffering probability can be decreased by increasing T. The first preset threshold and the second preset threshold can be the same or different.
[0129] Understandably, when the network quality of the first network is poor, the buffering ratio of data packets can be increased until all data packets sent by the server 401 are copied, at which point M can be equal to L; or, when the network quality of the first network is good, the buffering ratio of data packets can be decreased until data packets sent by the server 401 are not copied or only a small number of data packets are copied, for example, M can be equal to 0 or 1.
[0130] Additionally, the AP 402's buffer may have a limited capacity. When the buffer exceeds its capacity, it can replace the data packet with the one with the shortest packet transmission interval (tx), the oldest data packet, the most recent data packet, or a randomly selected data packet. In another possible implementation, when the buffer exceeds its capacity, it may also stop receiving new buffered data packets. This way, when there is significant packet loss in the network, the server (401) can detect the packet loss, thereby reducing the packet transmission frequency and preventing data packet overflow from the buffer.
[0131] Step 603: AP 402 sends L data packets sent by server 401 to STA 403.
[0132] In this embodiment of the application, step 603 can be executed after step 602, or step 603 can be executed simultaneously with step 602. For example, steps 602 and 603 can be executed synchronously through different processes or threads.
[0133] Step 604 is an optional step, and the execution order of step 604 and any of the steps 603 to 609 is not limited. For example, it can be executed simultaneously with any step, or before or after any step, or step 604 can be omitted.
[0134] Step 604: AP 402 simulates STA 403 to send ACK messages for the M data packets to server 401.
[0135] like Figure 4 As shown, AP 402 can simulate STA 403 sending ACK packets for data packets 2, 3, and 5 to server 401. Alternatively, as... Figure 7 As shown, AP 402 can simulate STA 403 sending ACK packets for data packets 2, 3, 5 and 8 to server 401.
[0136] Understandably, AP 402, based on TCP proxy functionality, can buffer M data packets out of L data packets. This allows AP 402 to simulate server 401 and resend the lost data packets to STA 403 in the event of packet loss among the M data packets. In this scenario, AP 402 can simulate STA 403 sending ACK packets for the M data packets to server 401, effectively acting as a virtual proxy for STA 403's receipt of the M data packets, and enabling server 401 to promptly acknowledge successful transmission of the M data packets. Essentially, in this situation, AP 402 simulates STA 403 for virtual reception of the M data packets.
[0137] Step 605: AP 402 starts timing for the M data packets. In one possible embodiment, AP 402 can start timing for each of the M data packets separately, starting timing for that data packet when it is buffered in the buffer area.
[0138] In one possible embodiment, an ACK message can be used to provide feedback on the data packet reception status. Based on the ACK message format, the following steps 606 to 608 may be included.
[0139] Step 606: AP 402 receives ACK packets for N data packets. Where N is a positive integer less than or equal to L. For example... Figure 4As shown, the N data packets can be data packet 1, data packet 2, data packet 4, data packet 6, and data packet 7.
[0140] Step 607: AP 402 sends ACK packets for the N data packets to server 401. It is understood that when executing step 604, the ACK packets for the N data packets may overlap with the data packets corresponding to the ACK packets in step 604, for example... Figure 4 As shown, server 401 receives two ACK packets for data packet 2. Since server 401 can determine that data packet 2 has been successfully transmitted when it receives the first ACK packet for data packet 2, server 401 can directly ignore the second ACK packet for data packet 2.
[0141] Optionally, AP 402 can also compare the ACK packets of M data packets with the ACK packets of N data packets. When an ACK packet of the same data packet is detected, the ACK packet of that data packet will not be sent in step 607. For example, it can combine... Figure 4 As shown, since AP 402 has already sent the ACK packet for data packet 2 in step 604, the ACK packet for data packet 2 from STA 503 can be discarded in step 607, thereby reducing the occupation of transmission bandwidth.
[0142] Step 608: AP 402 detects that the first data packet from the M data packets is included among the N data packets, and deletes the first data packet from the buffer. For example, if the ACK packet in step 606 includes an ACK packet for data packet 2, then AP 402 can determine that STA 403 has received data packet 2 and deletes data packet 2 from the buffer. It should be noted that the first data packet can be one or more, which can be determined based on the correspondence between the ACK packets received by AP 402 and the data packets in the buffer.
[0143] It should be noted that the execution order of steps 607 and 608 is not limited in the implementation of this application. For example, steps 607 and 608 can be executed simultaneously through different processes or threads, or step 607 can be executed before step 608, or step 607 can be executed after step 608.
[0144] Step 609: AP 402 detects that the timing of the second data packet among the M data packets has exceeded the timing threshold. It is understood that when the timing threshold is exceeded, the data packet has a high probability of being lost, and retransmission of the data packet can be triggered. In one possible embodiment, AP 402 can implement data packet timing based on a retransmission timeout (RTO) mechanism.
[0145] It should be noted that the execution order of steps 609 and 608 is not limited in the implementation of this application. For example, steps 609 and 608 can be executed simultaneously through different processes or threads, or step 609 can be executed before step 608, or step 609 can be executed after step 608.
[0146] Step 610: AP 402 sends the second data packet to STA 403 to retransmit the second data packet. It should be noted that the second data packet can also be one or more, determined by the timing of each data packet in AP 402's buffer and the reception of ACK packets. For example, AP 402 detects the following based on step 609: Figure 4 If the timing of data packets 3 and 5 exceeds the timing threshold, the server 401 can be simulated to send data packets 3 and 5 to STA 403 to achieve retransmission of data packets 3 and 5.
[0147] In one possible embodiment, when AP 402 retransmits a data packet more than a certain number of times (for example, the number of times threshold can be 3 times), it can also discard the data packet in the buffer, thereby avoiding the occupation of AP's memory resources.
[0148] In another possible embodiment, the STA can also implement the communication method provided in this application embodiment by sending a selective ACK (SACK) message (hereinafter collectively referred to as SACK message) to the AP, wherein the SACK message indicates the data packet requested by the STA. For example, the AP 402 can monitor the sequence number of the SACK message sent by the STA 403 in real time, and view the mapping table to process the data packets in the corresponding buffer; wherein, the SACK message is used to indicate the sequence number of the data packet requested by the STA 403, and the mapping table can be used to indicate the mapping relationship between the sequence number and the data packet, so that the sequence number of the acknowledged data packet can be determined based on the SACK message and the mapping table. The processing operations that the AP 402 can perform based on the SACK message sent by the STA 403 can be as follows:
[0149] (A) If the sequence number of a data packet stored in the buffer is less than the sequence number of the SACK packet, it can be determined that the STA has received a data packet with a sequence number less than the sequence number indicated by the SACK packet. Therefore, the data packet with a sequence number less than the sequence number of the SACK packet in the buffer can be deleted.
[0150] For example, if the SACK message feedback is sequence number 5, it means that data packets with sequence numbers 1 to 4 have been received, so data packets with sequence numbers 1 to 4 can be deleted from the buffer.
[0151] (B) When the sequence number of the data packet stored in the buffer is equal to the sequence number of the SACK packet, it can be determined that the STA requests to retransmit the data packet, and therefore the data packet can be retransmitted; among them, the data packet whose sequence number is equal to the sequence number of the SACK packet can be determined as a lost data packet.
[0152] For example, when the SACK message is 5, it means that the current STA 403 needs the 5th data packet, so the 5th data packet needs to be retransmitted.
[0153] (C) If the sequence number of the data packet stored in the buffer is greater than the sequence number of the SACK packet, it can be determined that the data packet requested by STA is not cached in the buffer. Therefore, the SACK packet can be forwarded to the server 401 so that the server 401 can retransmit the data packet.
[0154] For example, when a SACK message of number 5 is received, if all message numbers in the buffer are greater than 5, it means that the data packet required by the SACK message is not in the buffer. Therefore, it is passed to the server 401 so that the server 401 can retransmit the 5th data packet.
[0155] By using SACK messages, data packets in the buffer queue can be quickly retransmitted locally, thereby improving communication reliability and efficiency.
[0156] Step 611: AP 402 receives the ACK packet for the second data packet sent by STA 403 to server 401. It is understood that when STA 403 receives a retransmitted data packet, it can send an ACK packet for the received data packet.
[0157] Step 612: AP 402 sends an ACK packet for the second data packet sent by STA 403 to server 401. It is understood that when server 402 receives a duplicate ACK packet for the same data packet, it can discard the duplicate ACK packet.
[0158] The communication method provided in this application, through the TCP proxy function of intermediate network devices such as APs, can achieve packet loss prediction based on network quality assessment. This allows for selective caching of data packets sent by the sender based on the network quality assessment results; for example, data packets predicted to be lost can be cached. In this application embodiment, the network quality assessment result can be obtained through at least one of the following: network layer congestion between the server and STA, and Wi-Fi network quality between AP 402 and STA 403. It is understood that when the network quality assessment result improves, the intermediate network device can reduce the number of cached data packets; conversely, when the network quality assessment result deteriorates, the number of cached data packets can be increased until all data packets are copied and cached. Therefore, this method does not require caching all data packets from the sender, achieving a dynamic balance between the load capacity of the intermediate network device and network quality, thereby reducing costs and improving communication efficiency and reliability.
[0159] Furthermore, the TCP proxy function of the intermediate network device can simulate the ACK response of the receiving device, allowing the sending end to perceive successful data packet transmission. This ensures the sending end's packet transmission efficiency, preventing the sending device from reducing its packet transmission frequency in response to packet loss, thus guaranteeing continuous packet transmission and minimizing the impact on latency-sensitive services, thereby ensuring communication efficiency. Additionally, the TCP proxy function of the intermediate network device can simulate the sending end device's data packet retransmission, thereby shortening the retransmission path.
[0160] Furthermore, the method provided in this application embodiment can also avoid the impact on traditional TCP transmission, and can also improve the reliability and efficiency of TCP transmission through TCP proxy function.
[0161] Another possible implementation, Figure 8 Another interactive flowchart of a communication method provided in an embodiment of this application. The flowchart may include the following steps:
[0162] Step 801: The access point receives L data packets sent by the server to the site, and caches M data packets from the L data packets, where L is a positive integer and M is a positive integer less than or equal to L.
[0163] Step 802: The access point sends the L data packets to the station.
[0164] Step 803: When the access point detects that the first data packet in the M data packets has been successfully sent, delete the first data packet in the cached M data packets.
[0165] Step 804: When the access point detects that the second data packet in the M data packets has failed to be sent, it sends the cached second data packet in the M data packets to the station.
[0166] The specific implementation process of steps 801 to 804 can be found in the content of the aforementioned embodiments, and will not be repeated here.
[0167] Based on the above embodiments, this application also provides a device comprising multiple functional modules; the multiple functional modules interact to implement the functions performed by the device in the methods described in the embodiments of this application. The multiple functional modules can be implemented based on software, hardware, or a combination of software and hardware, and the multiple functional modules can be arbitrarily combined or divided based on specific implementations. For example, [the following is an example of implementation details]. Figure 6 In the illustrated embodiment, AP 402 performs steps 601 to 612; or, for example, performs... Figure 8 Steps 801 to 804 are performed by the access point in the illustrated embodiment.
[0168] Based on the above embodiments, this application also provides a device including at least one processor and at least one memory, wherein the at least one memory stores program instructions. When the device is running, the at least one processor executes the functions performed by the device in the various methods described in the embodiments of this application. For example, when executing... Figure 6 In the illustrated embodiment, AP 402 performs steps 601 to 612; or, for example, performs... Figure 8 Steps 801 to 804 are performed by the access point in the illustrated embodiment.
[0169] Based on the above embodiments, this application also provides a program product, which includes a program (also referred to as code or instructions) that, when run, causes the methods described in the embodiments of this application to be executed.
[0170] Based on the above embodiments, this application also provides a readable storage medium storing a program that, when executed by a computer, causes the computer to perform the methods described in the embodiments of this application.
[0171] Based on the above embodiments, this application also provides a chip for reading programs stored in a memory and implementing the methods described in the embodiments of this application.
[0172] Based on the above embodiments, this application provides a chip system including a processor for supporting a computer device in implementing the methods described in the embodiments of this application. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. This chip system may be composed of chips or may include chips and other discrete devices. Those skilled in the art will understand that the embodiments of this application can be provided as methods, systems, or program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0173] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by program instructions. These program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0174] These program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0175] These program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, such that the instructions, which execute on the computer or other programmable apparatus, provide steps for implementing the functions specified in one or more flowcharts and / or one or more block diagrams.
[0176] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.
Claims
1. A communication method, characterized in that, include: The access point receives L data packets sent by the server to the site, and caches M data packets from the L data packets, where L is a positive integer and M is a positive integer less than or equal to L; The M data packets are data packets that the access point predicts may be lost from among the L data packets based on the detection results. The detection results include at least one of the following: the network layer congestion between the server and the site, and the network quality between the access point and the site. The access point sends the L data packets to the station; When the access point detects that the first data packet in the M data packets has been successfully sent, it deletes the first data packet from the cached M data packets; When the access point detects that the second data packet in the M data packets has failed to be sent, it sends the second data packet in the cached M data packets to the station.
2. The method according to claim 1, characterized in that, The cached M data packets out of the L data packets include one or more of the following: The access point detects a third data packet being dropped during the reception of a data packet and caches the third data packet; or, The access point detects that the time interval between sending the fourth data packet during the data packet transmission process is greater than a preset interval value, and buffers the fourth data packet; or, The access point detects a link-layer packet loss event in the fifth data packet and caches the fifth data packet.
3. The method according to claim 1 or 2, characterized in that, The access point detects that the first data packet among the M data packets was successfully sent, including: The access point receives the first ACK packet of the first data packet sent by the site; or, The access point receives a first SACK message for the sixth data packet sent by the site. The first SACK message is used to instruct the site to request the sixth data packet, and the sequence number of the sixth data packet is greater than the sequence number of the first data packet.
4. The method according to claim 3, characterized in that, The access point detects that the second data packet in the M data packets failed to be sent, including: The access point does not receive a second ACK packet for the second data packet sent by the site within a preset time period; or, The access point receives a second SACK message from the site for the second data packet, the second SACK message being used to instruct the site to request the second data packet.
5. The method according to claim 4, characterized in that, The method further includes: The access point receives a third SACK message for the seventh data packet sent by the station. The third SACK message is used to instruct the station to request the seventh data packet. The M data packets do not include the seventh data packet, and the sequence number of the seventh data packet is less than the sequence number of the M data packets. The access point sends the third SACK message to the server.
6. The method according to claim 5, characterized in that, After caching M data packets out of the L data packets, the method further includes: The access point sends one or more third ACK messages to the server, the one or more third ACK messages indicating that the site has received the M data packets; and / or The access point receives one or more fourth ACK packets sent by the site to the server, and sends the one or more fourth ACK packets to the server. The one or more fourth ACK packets are used to indicate that the site has received N data packets, where N is a positive integer less than or equal to L.
7. The method according to claim 6, characterized in that, After sending the second data packet from the cached M data packets to the station, the method further includes: The access point receives the fifth ACK message sent by the site to the server, and sends the fifth ACK message to the server. The fifth ACK message is used to indicate that the site has received the second data packet.
8. The method according to claim 7, characterized in that, The method of caching M data packets out of the L data packets further includes: When the remaining buffer space in the buffer queue is less than the space occupied by the eighth data packet, the eighth data packet replaces the ninth data packet in the buffer queue. The transmission time interval of the ninth data packet is less than the transmission time interval of any data packet included in the buffer queue, or the buffering time of the ninth data packet is earlier or later than the buffering time of any data packet included in the buffer queue; wherein, the M data packets include the eighth data packet but do not include the ninth data packet; or, When the remaining cache space in the cache queue is less than the space occupied by the eighth data packet, the eighth data packet will no longer be cached; wherein, the M data packets do not include the eighth data packet.
9. The method according to claim 2, characterized in that, The method further includes: The access point detects that the network quality assessment result of the first network meets the preset conditions, and updates the preset interval value. The first network is the network between the access point and the site. Wherein, the first evaluation result is better than the second evaluation result, the preset interval value corresponding to the first evaluation result is greater than the preset interval value corresponding to the second evaluation result, the first evaluation result is the network quality evaluation result of the first network at the first time, and the second evaluation result is the network quality evaluation result of the first network at the second time.
10. The method according to claim 9, characterized in that, The access point detects that the network quality assessment result of the first network meets the preset conditions, and updates the preset interval value, including: If the access point detects that the transmission time of the ACK packet sent by the site has increased and the increase is greater than a first preset threshold, the access point will reduce the preset interval value. If the access point detects that the transmission time of the ACK message sent by the site has decreased and the decrease is greater than the second preset threshold, the preset interval value is increased. The transmission duration is determined based on the timestamp of the ACK message sent by the station and the timestamp of the ACK message received by the access point.
11. An access point, characterized in that, It includes at least one processor coupled to at least one memory, the at least one processor being configured to read a program stored in the at least one memory to cause the access point to perform the method as described in any one of claims 1 to 10.
12. A readable storage medium, characterized in that, The readable storage medium stores instructions that, when executed on the device, cause the device to perform the method as described in any one of claims 1 to 10.