Communication method and device

Caches and selectively copy data packets in TCP connections through TCP virtual proxy, solving the packet loss problem caused by different network quality, improving the reliability and efficiency of TCP transmission, shortening the retransmission path and reducing resource usage.

CN119316482AActive Publication Date: 2025-01-14HUAWEI TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310852018.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-11
Publication Date
2025-01-14
Estimated Expiration
2043-07-11

Smart Images

  • Figure CN119316482A_ABST
    Figure CN119316482A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a communication method and equipment. The reliability and the transmission efficiency based on TCP connection can be improved. In the method, an AP (Access Point) can realize TCP virtual proxy by copying a part of data messages on TCP connection. Thus, when the cache of the AP comprises the data message that the STA fails to receive, the data message can be retransmitted to the STA by the AP, so that the retransmission path of the data message can be shortened. Therefore, according to the method, TCP connection throughput rate reduction and transmission time delay increase caused by packet loss can be avoided, the original transmission influence on TCP connection can be reduced by partially copying the data message, and the requirements for the load and resource occupation of the AP can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of terminal technology, and in particular to a communication method and device. Background Art

[0002] The transmission control protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol that is widely used in current communication networks. In order to ensure the reliability of the communication network, TCP can provide packet loss detection and retransmission control capabilities. When packet loss occurs in the communication network, TCP will control and reduce the frequency of packet transmission, reduce throughput, and increase transmission delay, which will have an impact on delay-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 network quality of two different transmission media is generally different, a low-quality network may affect the transmission efficiency of the entire TCP connection. For example, in a Wi-Fi network, data packet loss may occur due to Wi-Fi interference; and, when the Wi-Fi network loses packets, the server sending the data packet detects a transmission timeout, which triggers data retransmission. This will result in a long detection time, a long retransmission path, and a decrease in the throughput of the TCP connection and an increase in transmission delay. Summary of the invention

[0004] The present application provides a communication method and device. The method provides a method that can avoid the problem of reduced throughput and increased transmission delay of TCP connection through TCP virtual proxy; and also provides a technical solution that can evaluate the network quality of the network included in the TCP connection. Therefore, the method can improve the reliability and transmission efficiency of TCP-based transmission.

[0005] The first aspect provides a communication method. In the method, an access point receives L data messages sent by a service end to a station, caches M data messages of the L data messages, 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 messages to the station; when the access point detects that a first data message of the M data messages is sent successfully, the first data message of the M data messages in the cache is deleted; when the access point detects that a second data message of the M data messages fails to be sent, the second data message of the M data messages in the cache is sent to the station.

[0006] In this method, the TCP proxy function of the access point can be used to selectively copy and cache the data packets sent by the server to the site, so that when packet loss occurs at the site, the access point can retransmit the lost data packets based on the cached data packets. Therefore, this method can shorten the retransmission path, and through the selective replication method, the requirements for the load and resource occupation of the access point can be reduced. This method can improve the reliability and transmission efficiency of TCP transmission.

[0007] In a possible implementation, the caching of M data messages among the L data messages includes, but is not limited to, one or more of the following: the access point detects a discard event of the third data message in the process of receiving the data message, and caches the third data message; or, the access point detects that the sending time interval of the fourth data message in the process of sending the data message is greater than a preset interval value, and caches the fourth data message; or, the access point detects a link layer packet loss event of the fifth data message, and caches the fifth data message. It can be understood that the data message in the embodiment of the present application can also be called a data packet, the loss of the data message can also be called a packet loss, and the sending time interval can also be called a packet sending interval.

[0008] In this implementation, the TCP proxy of the access point can detect one or more possible packet loss scenarios, and by caching the data packets that may be lost, when packet loss occurs at the site, the access point can retransmit the lost data packets based on the cached data packets, thereby shortening the retransmission path. This method can improve the reliability and transmission efficiency of TCP transmission.

[0009] In a possible implementation, the access point detects that the first data message among the M data messages is sent successfully, including but not limited to the following methods: the access point receives a first ACK message for the first data message sent by the site; or, the access point receives a first SACK message for the sixth data message sent by the site, the first SACK message is used to indicate that the site requests the sixth data message, and the message sequence number of the sixth data message is greater than the message sequence number of the first data message.

[0010] In this implementation, the TCP proxy of the access point can timely process the data messages in the buffer area based on TCP transmission, and can timely delete the data messages that have been successfully sent, thereby reducing the occupation of buffer resources.

[0011] In a possible implementation, the access point detects that the second data message among the M data messages fails to be sent, including but not limited to the following methods: the access point does not receive a second ACK message of the second data message sent by the site within a preset time length; or, the access point receives a second SACK message of the second data message sent by the site, and the second SACK message is used to indicate that the site requests the second data message.

[0012] In this implementation, the TCP proxy of the access point can timely process the data packets in the buffer area based on TCP transmission, and can timely implement data retransmission when the site packet loss is detected. Therefore, the transmission efficiency of the data packets can be improved and the retransmission path can be shortened.

[0013] In a possible implementation, the method further includes: the access point receives a third SACK message of the seventh data message sent by the site, the third SACK message is used to indicate that the site requests the seventh data message, the M data messages do not include the seventh data message, and the message sequence number of the seventh data message is less than the message sequence number of the M data messages; the access point sends the third SACK message to the server.

[0014] In this implementation, through the TCP proxy of the access point, the data packets in the cache area can be processed in a timely manner based on TCP transmission, and when it is detected that the cache area does not include lost data packets, the server can be notified in a timely manner, thereby ensuring the reliability and transmission efficiency of TCP transmission.

[0015] In a possible implementation manner, after caching M of the L data messages, the method further includes: the access point sending one or more third ACK messages to the server, the one or more third ACK messages being used to indicate that the station has received the M data messages; and / or the access point receiving one or more fourth ACK messages sent by the station to the server, and sending the one or more fourth ACK messages to the server, the one or more fourth ACK messages being used to indicate that the station has received N data messages, where N is a positive integer less than or equal to L. It can be understood that the one or more third ACK messages sent by the access point to the server are ACK messages sent by the station to the server in simulation after the access point caches the M data messages, and it can also be understood that the M data messages are data messages that the access point confirms receipt of on behalf of the station; and the one or more fourth ACK messages are ACK messages sent by the station to the server after the station receives N of the L data messages, and it can also be understood that the N data messages are data messages that the station actually receives.

[0016] In this implementation, after selectively copying and caching the data message, the access point can simulate the station to reply an ACK message to the server, so that the server can promptly determine that the station has received this part of the data message, avoiding the detection time being too long, etc., which leads to a reduction in throughput. It can be understood that when the station does not receive this part of the data message, the access point can retransmit the data based on the data message included in the cache area, so as to ensure the transmission reliability of the data message.

[0017] In a possible implementation, after sending the second data message among the M data messages cached to the station, the method further includes: the access point receiving a fifth ACK message sent by the station to the server, and sending the fifth ACK message to the server, wherein the fifth ACK message is used to indicate that the station has received the second data message. It can be understood that after receiving the data message sent by the access point based on the cache, the station can send an ACK message to the server for the received data message.

[0018] In this implementation, the access point retransmits the lost data message, so that the station can receive the data message, and thus send an ACK message to the server, so that the server can determine that the station has received the data message.

[0019] In a possible implementation, the method for caching M data packets out of the L data packets further includes: when the remaining cache space of the cache queue is smaller than the space occupied by the eighth data packet, replacing the ninth data packet in the cache queue with the eighth data packet, the sending time interval of the ninth data packet is smaller than the sending time interval of any data packet included in the cache queue, or the cache time of the ninth data packet is earlier than or later than the cache 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 smaller 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 the cached data packets can be determined based on factors such as packet loss probability and packet transmission order, and data packets with a high probability of packet loss can be cached first, or data packets with the earliest or latest transmission time can be cached first, etc. Therefore, the reliability and transmission efficiency of TCP transmission can be improved.

[0021] In a possible implementation, the access point detects that a network quality evaluation result of a first network satisfies a preset condition, and updates the preset interval value, where the first network is a 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 a network quality evaluation result of the first network at a first moment, and the second evaluation result is a network quality evaluation result of the first network at a second moment.

[0022] In this embodiment, by adjusting the preset interval value, the data of the cached data message can be adjusted. Therefore, this implementation can achieve dynamic adjustment based on the network quality evaluation result.

[0023] In a possible implementation manner, the access point detects that the network quality evaluation result of the first network meets a preset condition, and updates the preset interval value, including: the access point detects that the transmission duration of the ACK message sent by the station increases, and the increase value is greater than a first preset threshold, and reduces the preset interval value; the access point detects that the transmission duration of the ACK message sent by the station decreases, and the decrease value is greater than a second preset threshold, and increases the preset interval value; wherein the transmission duration is determined based on the sending timestamp of the ACK message sent by the station and the receiving timestamp of the ACK message received by the access point. wherein the first preset threshold and the second preset threshold may be the same or different.

[0024] In this implementation, by evaluating the network quality, it is possible to reduce the cache probability when the network quality is good, thereby reducing the load and reducing the occupation of resources; and it is also possible to increase the cache probability when the network quality is poor, thereby ensuring the reliability of communication. Therefore, this implementation can achieve dynamic adjustment based on the network quality evaluation result.

[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, and the transmission media of the first network and the second network are different. In a possible implementation, the first network is, for example, a Wi-Fi network. In this embodiment, through the TCP proxy of the access point, it is possible to solve problems such as packet loss caused by Wi-Fi interference in the TCP connection including the Wi-Fi network, and the transmission efficiency and reliability in the TCP connection can be improved.

[0026] A second aspect provides a communication system, which includes an access point, a station, and a server as described in the first aspect and its embodiments. The access point can be used to execute the method described in the first aspect and its embodiments.

[0027] In a third aspect, an access point is provided, the access point comprising a plurality of functional modules; the plurality of functional modules interact with each other to implement the method performed by the access point in the first aspect and its respective embodiments. The plurality of functional modules may be implemented based on software, hardware, or a combination of software and hardware, and the plurality of functional modules may be arbitrarily combined or divided based on specific implementation.

[0028] A fourth aspect further provides an access point, comprising at least one processor and at least one memory, wherein the at least one memory stores a program, and when the access point is running, the at least one processor executes the method executed by the access point in the first aspect and each embodiment thereof.

[0029] A fifth aspect provides a readable storage medium, wherein the readable storage medium stores instructions, and when the instructions are executed on an access point, the access point executes the method described in the first aspect and its possible implementation modes.

[0030] A sixth aspect provides a program product. When the program product runs on an access point, the access point executes the method described in the first aspect and its possible implementation modes.

[0031] A seventh aspect further provides a chip, which is used to read a program stored in a memory and execute the method executed by the access point in the first aspect and its possible implementation modes.

[0032] In an eighth aspect, a chip system is also provided, the chip system comprising a processor, used to support an access point to implement the method executed by the access point in the first aspect and its possible implementation methods. In a possible implementation, the chip system also includes a memory, which is used to store programs and data necessary for the device. The chip system can be composed of a chip, or it can include a chip and other discrete devices.

[0033] For the beneficial effects of any aspect from the second to the eighth aspect and its possible implementation methods, please refer to the beneficial effects of various possible implementation methods in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] Figure 1a 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 the present application;

[0037] Figure 3A software system architecture block diagram of a device provided in an embodiment of the present application;

[0038] Figure 4 A schematic diagram of an application scenario of a communication method provided in an embodiment of the present application;

[0039] Figure 5 A possible structural diagram of an AP provided in an embodiment of the present application;

[0040] Figure 6 A schematic diagram of an interactive process of a communication method provided in an embodiment of the present application;

[0041] Figure 7 A schematic diagram of a cache area provided in an embodiment of the present application;

[0042] Figure 8 Another interactive flow diagram of a communication method provided in an embodiment of the present application. DETAILED DESCRIPTION

[0043] The embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0044] The method provided in the embodiment of the present application can be applied to a TCP connection including at least two network segments using different transmission media. Among them, the network using different transmission media may include, but is not limited to: optical fiber network, Ethernet, the fifth generation mobile communication technology (the 5th generation, 5G) network, 4G network, Wi-Fi network, Bluetooth network, near field communication (near field communication, NFC) network, etc. Due to the different network qualities of the two different networks, the low-quality network may affect the transmission efficiency of the entire TCP connection.

[0045] Take the two networks included in the TCP connection as Ethernet and Wi-Fi as an example. Figure 1a The following is a schematic diagram of a possible application scenario. The application scenario may include at least: a server, an access point (AP), and a station (STA). The server is a device that provides services for the business, such as a business server, a cloud server, a base station, etc.; the AP may be a wireless router, a Wi-Fi repeater, etc.; the STA may be a personal computer, a mobile phone, a tablet computer, etc. that is connected to the AP. Figure 1a The communication network shown can realize reliable communication based on TCP connection. For example, users can download files, browse web pages, and socialize through the communication network. Figure 1aAs shown, the server and AP can communicate through optical fiber network, Ethernet, 5G network, 4G network, etc. AP and STA can generally communicate based on Wi-Fi network.

[0046] In Wi-Fi networks, due to Wi-Fi interference such as the access of a large number of devices, physical obstacles, network congestion, etc., data packet loss may occur in the communication link between AP and STA. In addition, in a transmission network based on TCP connection, it has packet loss detection and retransmission control capabilities. When the server detects that the data packet sent to the STA has timed out, it can trigger the retransmission of the data packet from the server. Due to the long detection time and long retransmission path, the communication delay is increased. In addition, when packet loss occurs in the network, based on the TCP connection, the server will control the packet sending frequency, reduce the throughput, and increase the transmission delay. For example Figure 1a The packet loss of the Wi-Fi network shown in Figure 1a The packet transmission rate of the optical fiber network shown in , which will have a greater impact on latency-sensitive services. For example, in the whole-house device control scenario, packet loss may cause the whole-house device control to fail or increase the control delay, resulting in a poor user experience.

[0047] In a possible implementation, the retransmission efficiency can be improved by providing a TCP proxy in the middle of a TCP connection. Figure 1b This is another application scenario diagram. In the scenario where the server sends a data packet to the STA, Figure 1b The working principle of the TCP proxy provided in is: the AP can first receive the TCP packet sent by the server and store the TCP packet; then, the AP forwards the TCP packet to the STA. Figure 1b As shown in the figure, the TCP proxy function in the AP can divide the communication link from the server to the STA into TCP-1 link and TCP-2 link. In this way, even if the TCP-2 link loses packets, the AP can retransmit the TCP packets based on the TCP proxy function of the AP, thereby shortening the retransmission path. However, Figure 1bIn the AP TCP proxy method shown in , when the packet loss rate increases due to reasons such as TCP-1 link instability or TCP-2 link instability, TCP proxy may accumulate more data packets that need to be retransmitted, resulting in larger memory overhead; and, because the TCP proxy divides the original TCP connection into two links, terminates the original TCP connection, and carries the receiving and sending functions of the original TCP connection by the TCP proxy, this will lead to additional central processing unit (CPU) overhead of the TCP proxy, especially when the throughput is large, affecting the performance of data transmission; and, even in the scenario where the network quality of the links on both sides of the TCP proxy is good, Figure 1b The TCP proxy method shown will also affect the transmission throughput and transmission delay. Figure 1b The usage scenarios of the illustrated embodiments have great limitations.

[0048] In view of this, an embodiment of the present application provides a communication method. In this method, on the one hand, a virtual proxy can be implemented through an AP. In a scenario where a server sends a data message to a STA, after the AP receives a data message from the server (also understood as a "sender"), a portion of the data message sent by the server is cached; and for this portion of the cached data message, the STA (also understood as a "receiver") can be simulated to send an acknowledgement character (ACK) message (hereinafter collectively referred to as an ACK message) to the server. Based on the received ACK message, the server believes that the STA has received this portion of the data message sent by the server, and will not reduce the throughput and the frequency of the server sending data messages, thereby causing transmission delays.

[0049] On the other hand, the AP can evaluate the network quality status of the Wi-Fi link between the AP and the STA, and selectively copy the data message from the server according to the network quality evaluation result, and cache the selectively copied data message. Then, based on the ACK message of the data message sent by the STA, the AP can delete the data message when it is determined that the data message in the storage includes the data message corresponding to the ACK message; or, if the AP detects that the ACK message of the data message from the STA is not received after a preset time, the AP can determine that the data message is a data message that needs to be retransmitted, and then send the data message that needs to be retransmitted to the STA based on the cached data message, so as to achieve data retransmission of the data message.

[0050] Therefore, the method can achieve a more accurate TCP proxy function through network quality evaluation, avoid caching all TCP packets from the server, reduce the memory resource overhead of the network device due to the TCP proxy function, and reduce the load requirements. In addition, when the network quality of the TCP connection is good, the method will not truncate the original TCP connection, so there is no need for large resource overhead, and it will not affect the transmission throughput and transmission delay of the TCP connection. In addition, the TCP proxy function provided in the embodiment of the present application can improve the accuracy of identifying data packets that may be lost based on network quality evaluation, avoid the need for TCP proxy for data packets that are not lost, thereby reducing the proxy load of the TCP proxy, improving throughput, and reducing communication delay.

[0051] For example, the AP receives data message 1, data message 2, and data message 3 sent by the server to the STA. The AP evaluates the network quality status of the Wi-Fi link between the AP and the STA, and determines to copy and cache data message 2 and data message 3 based on the network quality evaluation result. Optionally, the AP can simulate the STA sending ACK messages for data message 2 and data message 3 to the server, so that the server can believe that the STA has received data message 2 and data message 3. When the AP receives the ACK message for data message 2 from the STA, the data message 2 in the cache is deleted; and when the AP still does not receive the ACK message for data message 3 from the STA after a preset time, based on the cached data message 3, data message 3 can be sent to the STA. In addition, it can be understood that when the AP sends data message 3 to the STA more than a preset number of times (for example, 3 times), the cached data message 3 can be deleted to release the cache resources in time.

[0052] In an optional embodiment, the embodiment of the present application can be applied to a communication system based on a TCP connection, and the TCP connection can include at least two networks using different transmission media. In a possible scenario, the communication system includes an Ethernet and a Wi-Fi network, wherein the Wi-Fi network can include one or more APs and one or more STAs. It can be understood that the communication system in the embodiment of the present application can also include a server such as a base station.

[0053] The types of servers involved in the embodiments of the present application are not limited. For example, the server is a device such as a business server, a cloud server, a base station, etc. that provides services for the business.

[0054] Furthermore, the number and type of APs and STAs in the embodiments of the present application are not limited. For example, the APs involved in the embodiments of the present application may be devices such as wireless routers and Wi-Fi repeaters. For another example, the STAs in the embodiments of the present application may be devices such as mobile phones, PCs, tablet computers, wearable devices (e.g., watches, bracelets, etc.), vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices (e.g., smart TVs, smart speakers, etc.), and the like. It is understandable that the embodiments of the present application do not impose any restrictions on the specific types of devices.

[0055] The present invention can be applied to devices including but not limited to: Or devices with other operating systems.

[0056] Figure 2 2 shows a possible hardware structure diagram of a device. The device 200 includes: 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 embodiment of the present application may include more or fewer components than those shown in the figure, may combine two or more components, or may have different component configurations. Figure 2 The various components shown in the EMBODIMENTS 2000 may 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] Combine the following Figure 2 The components of the device 200 are described in detail:

[0058] The RF circuit 210 can be used for receiving and sending data during communication or calls. In particular, after receiving downlink data from the base station, the RF circuit 210 sends it to the processor 230 for processing; in addition, the uplink data to be sent is sent to the base station. Generally, 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] In addition, the RF circuit 210 can also communicate with other devices through a wireless communication network. The wireless communication can use any communication standard or protocol, including but not limited to global system of mobile communication (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), long term evolution (LTE), 5G, email, short messaging service (SMS), etc.

[0060] The device 200 can also implement communication services and interact with other devices or network devices, so the device 200 needs to have a data transmission function, that is, the device 200 needs to include a communication module. Figure 2 Communication modules such as the RF circuit 210, the Wi-Fi module 290, and the communication interface 280 are shown, but it is understandable that at least one of the above components or other communication modules (such as a Bluetooth module) for implementing communication exist in the device 200 to perform data transmission.

[0061] For example, when the device 200 is a mobile phone, the device 200 may include the RF circuit 210, and may also include the Wi-Fi module 290, or may include a Bluetooth module ( Figure 2 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 ( Figure 2 When the device 200 is a tablet computer, the device 200 may include the Wi-Fi module, or may include a Bluetooth module ( Figure 2 not shown).

[0062] Wi-Fi technology belongs to short-range wireless transmission technology. The device 200 can connect to an access point (AP) through a Wi-Fi module 290 to access a data network. The Wi-Fi module 290 can be used for receiving and sending data during the communication process. In an embodiment of the present application, the device 200 can act as a STA, and receive data packets sent from the server from the AP through the Wi-Fi module 290, and can also send data packets that need to be sent to the server to the AP through the Wi-Fi module 290; and, based on the method provided in an embodiment of the present application, the data packets received by the STA from the AP through the Wi-Fi module 290 may include data packets from the server, and may also include data packets retransmitted by the AP after copying the data packets from the server.

[0063] The device 200 can be physically connected to other devices through the communication interface 280. Optionally, the communication interface 280 is connected to the communication interface of the other device through a cable to achieve data transmission between the device 200 and the other device.

[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. Among them, the program storage area can store an operating system (mainly including software programs or modules corresponding to the kernel layer, system layer, application framework layer, and application layer, etc.).

[0065] In addition, the memory 240 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0066] The input unit 250 can be used to receive the editing operations of various types of data objects such as digital or character information input by the user, and generate key signal input related to the user settings and function control of the device 200. Optionally, the input unit 250 can include a touch panel 251 and other input devices 252.

[0067] Among them, the touch panel 251, also known as a touch screen, can collect user touch operations on or near it (for example, the user uses fingers, stylus or any other suitable objects or accessories on or near the touch panel 251) and drive the corresponding connection device according to a pre-set program.

[0068] Optionally, the other input devices 252 may include, but are not limited to, one or more of a physical keyboard, function keys (such as a volume control button, a switch button, etc.), a trackball, a mouse, a joystick, etc.

[0069] The display unit 260 can be used to display information content input by the user or information content provided to the user and various menus of the device 200. The display unit 260 is the display system of the device 200, which is used to present an interface and realize human-computer interaction. The display unit 260 may include a display panel 261. Optionally, the display panel 261 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0070] The processor 230 is the control center of the device 200, and uses various interfaces and lines to connect various components, and executes various functions of the device 200 and processes data by running or executing software programs and / or modules stored in the memory 240, and calling data stored in the memory 240, thereby realizing various services based on the device 200. In the embodiment of the present application, the processor 230 can be used to implement the communication method provided in the embodiment of the present application.

[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, so that the power management system can manage functions such as charging, discharging, and power consumption.

[0072] like Figure 2 As shown, the device 200 also includes an audio circuit 270, a microphone 271 and a speaker 272, which can provide an audio interface between the user and the device 200. The audio circuit 270 can be used to convert audio data into a signal that can be recognized by the speaker 272, and transmit the signal to the speaker 272, which is converted into a sound signal and output by the speaker 272. The microphone 271 is used to collect external sound signals (such as the sound of a person speaking, or other sounds, etc.), and convert the collected external sound signals into signals that can be recognized by the audio circuit 270 and send them to the audio circuit 270. The audio circuit 270 can also be used to convert the signal sent by the microphone 271 into audio data, and then output the audio data to the RF circuit 210 to send it to, for example, another device, or output the audio data to the memory 240 for subsequent 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 herein. The at least one sensor may include but is not limited to a pressure sensor, an air pressure sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a touch sensor, a temperature sensor, etc.

[0074] The operating system (OS) involved in the embodiment of the present application is the most basic system software running on the device 200. The software system of the device 200 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes an operating system adopting a layered architecture as an example to illustrate the software system architecture of the device 200.

[0075] Figure 3 This is a software system architecture block diagram of a device provided in an embodiment of the present application. Figure 3 As shown, the software system architecture of the device can be a layered architecture, for example, the software can be divided into several layers, each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. In one embodiment, the operating system is divided into five layers, from top to bottom, namely, the application layer, the application framework layer (framework, FWK), the runtime and system library, the kernel layer, and the hardware layer.

[0076] The application layer can include a series of application packages. Figure 3 As shown, the application layer may include camera, settings, skin module, user interface (UI), third-party applications, etc. Among them, the third-party applications may include wireless local area network (WLAN), music, calls, Bluetooth, video, memo, information, some instant messaging software, etc.

[0077] In one possible implementation, applications can be developed using the Java language by calling the application programming interface (API) provided by the application framework layer. Developers can interact with the bottom layer of the operating system (such as the hardware layer, kernel layer, etc.) through the application framework layer to develop their own applications. The application framework layer is mainly a series of services and management systems of the operating system.

[0078] The application framework layer provides application programming interfaces and programming frameworks for applications in the application layer. The application framework layer includes some predefined functions. Figure 3As shown, the application framework layer may include an activity manager, a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0079] The activity manager is used to manage the life cycle of each application and provide common navigation back functions, providing an interactive interface for all program windows.

[0080] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data and make the data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.

[0081] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0082] The phone manager is used to provide communication functions for the device, such as the management of call status (including answering, hanging up, etc.).

[0083] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.

[0084] The notification manager allows applications to display notification information in the status bar. It can be used to convey notification-type messages and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a chart or scroll bar text, such as notifications of applications running in the background, or a notification that appears on the screen in the form of a dialog window. For example, a text message is displayed in the status bar, a prompt sound is emitted, the device vibrates, the indicator light flashes, etc.

[0085] The runtime includes the core library 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 is the function that the Java language needs to call, and the other is the core library of the operating system. The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0087] The system library may include multiple functional modules, such as a surface manager, a media framework, a 3D graphics processing library (such as OpenGL ES), a 2D graphics engine (such as SGL), etc.

[0088] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0089] The media framework supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media framework can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[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 drawings.

[0092] In one embodiment, the three-dimensional graphics processing library may be used to draw a three-dimensional motion trajectory image, and the two-dimensional graphics engine may be used to draw a two-dimensional motion trajectory image.

[0093] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, audio driver, and sensor driver.

[0094] The hardware layer can include various types of sensors, such as accelerometers, gravity sensors, touch sensors, etc.

[0095] Usually, the device 200 can run multiple applications at the same time. In a simpler way, one application can correspond to one process, and in a more complex way, one application can correspond to multiple processes. Each process has a process number (process ID).

[0096] It should be understood that in the embodiments of the present application, "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single items or plural 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, c can be single or multiple. "Multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships can exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0097] In addition, it should be understood that, in the description of this application, words such as "first" and "second" are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an 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 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 process of a communication method provided in an embodiment of the present application.

[0099] In order to facilitate understanding of the communication method provided by this application, the following Figures 4 to 7 The content shown introduces the implementation process of the method provided by this application.

[0100] See also Figure 4 , is a schematic diagram of an application scenario of a communication method provided in an embodiment of the present application. The application scenario can be applied to an interaction scenario in which a TCP connection includes at least two networks using different transmission media. For example, Figure 4 The application scenario shown may include a TCP connection consisting of a server 401, an AP 402, and a STA 403; wherein the server 401 and the AP 402 may communicate with each other using Ethernet, for example, and the AP 402 and the STA 403 may communicate with each other using a Wi-Fi network. It is understandable that Figure 4 The TCP connection shown in FIG. 1 passes through Ethernet and Wi-Fi networks. Since the network quality of the Wi-Fi network and the Ethernet network is different, a low-quality network may affect the transmission efficiency of the entire TCP connection.

[0101] Specifically, in a TCP connection, when the server 401 needs to transmit a data message to the STA 403, the server 401 transmits the data messages 1 to 7 to be transmitted to the AP 402 via Ethernet. After receiving the data messages 1 to 7, the AP 402 sends the data messages 1 to 7 to the STA 403 via the Wi-Fi network according to the destination address of the data message. After receiving the data message, the STA 403 sends an ACK message to the server 401 via the AP 402. It is understandable that when STA 403 successfully receives data packets 1 to 7, server 401 can receive ACK packets for data packets 1 to 7 sent by STA403; and when data packets 1 to 7 are lost, for example, data packets 3 and 5 are lost, server 401 can only receive ACK packets for data packets 1, 2, 4, 6 and 7 sent by STA 403, and will not receive ACK packets for data packets 3 and 5. In a traditional TCP connection, server 401 needs to resend data packets 3 and 5 at this time, and since packet loss is detected in the TCP connection, the packet sending frequency of server 401 will be reduced, thereby increasing the transmission delay in the TCP connection and reducing the transmission efficiency.

[0102] In the method provided in the embodiment of the present application, a TCP proxy function can be introduced in AP 402, and a balance between the quality differences of the two networks can be achieved through the TCP proxy function. In a possible embodiment, the TCP proxy can perform network quality assessment and data message processing based on the TCP connection without affecting the original TCP connection and its data transmission.

[0103] In a possible embodiment, the TCP proxy function of AP 402 can selectively copy data packets 1 to 7 based on the network quality evaluation result of the Wi-Fi network between AP 402 and STA 403, and cache the selectively copied data packets. Figure 4 As shown, AP 402 copies and caches data message 2, data message 3, and data message 5 among data messages 1 to 7.

[0104] In an optional embodiment, AP 402 may also simulate STA 403 to generate an ACK message based on the network layer and / or transport layer message sequence of data message 2, data message 3, and data message 5, and send the generated ACK messages of data message 2, data message 3, and data message 5 to server 401. Figure 4As shown in , AP 402 simulates STA 403 to send ACK messages of data message 2, data message 3 and data message 5 to server 401. It can be understood that after receiving the ACK messages of data message 2, data message 3 and data message 5, server 401 can determine that STA 403 has received data message 2, data message 3 and data message 5. In this way, by simulating STA 403 to send ACK messages, AP 402 can reduce the detection time of server 401 and ensure the packet sending frequency of server 401. In another possible embodiment, AP 402 can also send an ACK message for the lost data message to server 401 after simulating server 401 to retransmit the lost data message and receiving the ACK message for the lost data message from STA 403.

[0105] In a possible embodiment, it is taken as an example that data message 3 and data message 5 are lost among data messages 1 to 7 sent by AP 402 to STA 403. Figure 4 As shown, STA 403 successfully receives data message 1, data message 2, data message 4, data message 6 and data message 7, then STA403 sends ACK messages of data message 1, data message 2, data message 4, data message 6 and data message 7, and AP 402 sends the ACK messages of data message 1, data message 2, data message 4, data message 6 and data message 7 sent by STA to server 401. It can be understood that in the scenario where AP 402 simulates STA 403 to send ACK messages for data message 2, data message 3 and data message 5 to server 401, based on the ACK messages for data message 1, data message 2, data message 4, data message 6 and data message 7 sent by STA403 received by server 401, and the ACK messages for data message 2, data message 3 and data message 5 sent by AP 402 simulating STA 403 received, server 401 can receive ACK messages for data messages 1 to 7, then server 401 can determine that data messages 1 to 7 have all been transmitted successfully, and no packet loss problem will be detected at this time, so the packet sending frequency will not be reduced, thereby not affecting the packet sending efficiency in the TCP connection.

[0106] In addition to sending the ACK messages of data message 1, data message 2, data message 4, data message 6 and data message 7 sent by STA 403 to the server 401, AP 402 can also process the data messages in the buffer area based on the ACK messages. For example, if AP 402 determines that it has received the ACK message of data message 2 sent by STA 403, it deletes data message 2 cached in the buffer area. It can be understood that data message 3 and data message 5 are still cached in the buffer area at this time.

[0107] In a possible embodiment, when AP 402 sends data packets 1 to 7 to STA 403 and caches the data packets in a buffer area, timing of the data packets in the buffer area may be started, such as Figure 4 As shown, it can be understood that the timing of data message 2, data message 3 and data message 5 is started. For example, if AP 402 determines that the ACK message of data message 3 and data message 5 sent by STA 403 is not received within the preset time, the retransmission of data message 3 and data message 5 can be triggered, and it can also be understood that AP 402 sends data message 3 and data message 5 to STA403 based on data message 3 and data message 5 cached in the buffer area. In addition, it can be understood that when AP 402 receives the ACK message of the data message in the buffer area from STA 403, the timing of the data message can be stopped, for example, when AP 402 receives the ACK message of data message 2, the timing of data message 2 can be stopped. In a possible embodiment, AP 402 can implement the timing of data messages based on the retransmission timeout mechanism (RTO).

[0108] In another possible embodiment, AP 402 may also trigger retransmission of data message 3 and data message 5 by detecting that ACK messages of data message 3 and data message 5 sent by STA 403 are not received within a preset time period. It is understandable that after AP 402 sends data message 3 and data message 5 to STA 403, in the scenario where STA 403 successfully receives data message 3 and data message 5, ACK messages of data message 3 and data message 5 sent by STA 403 may also be received. At this time, AP 402 transparently transmits ACK messages of data message 3 and data message 5 to server 401, and server 401 may also determine that STA 403 receives data message 3 and data message 5. It can be understood that based on the fact that the server 401 has received ACK messages for STA 403 data messages 1, 2, 4, 6 and 7, when receiving ACK messages for data messages 3 and 5, it can be determined that data messages 1 to 7 have been transmitted successfully.

[0109] In this way, by AP 402 copying and caching some data messages that may be lost and retransmitting them, the data message retransmission path can be shortened; and compared with the implementation method in which AP 402 copies all the data messages of the sender, it can avoid causing greater pressure on the load and memory of AP 402, so that a technical solution that can balance the difference in quality between the two networks can be provided through AP.

[0110] To facilitate understanding of the following embodiments, Figure 5 A possible structural diagram of AP 402 provided in an embodiment of the present application. Among them, AP 402 may include at least a receiving module, a sending module, a forwarding module, a TCP proxy module and other functional units. It can be understood that these functional units can be Figure 2 The processor 230 shown is implemented, and the division of the functional units is only a logical division, which can be divided into more modules or fewer modules during implementation, and this application does not limit this.

[0111] (1) A receiving module, which can be used to receive a data message sent by the server 401 in a scenario where the server 401 sends a data message to the STA 403.

[0112] (2) A sending module, which can be used to send a data message to STA 403 in a scenario where the server 401 sends a data message to STA 403.

[0113] (3) A TCP proxy module, which can be used to implement the communication method provided in the embodiments of the present application.

[0114] (4) A forwarding module, which can be used for AP 402 to forward data based on a TCP connection. For example, in a scenario where the server 401 sends a data message to STA 403, the data message sent by the server 401 can be forwarded to STA 403. For another example, in a scenario where STA 403 sends a data message to the server 401, the data message sent by STA 403 can be forwarded to the server 401.

[0115] In addition, in the communication network, based on the open system interconnection communication reference model (OSI) model, data packet loss may occur in the Internet protocol transport layer, network layer, or link layer. Among them, the link layer can be used to forward data between adjacent devices, for example, it can be applied to data forwarding between devices in a Wi-Fi network.

[0116] based on Figure 4 The application scenarios and Figure 5 The structural diagram introduced in the following is a specific implementation process of the method provided in the embodiment of the present application through an embodiment. Figure 6 , which is a schematic diagram of an interaction flow of a communication method provided in an embodiment of the present application. For ease of understanding, the following embodiments take the data message transmission scenario in which the server 401 is the sender and the STA 403 is the receiver as an example. For details about the data message transmission scenario in which the server 401 is the receiver and the STA 403 is the sender, please refer to Figure 6 The described process, the interaction 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 It can be understood that the destination address of the L data messages sent by the server 401 and received by the AP 402 is STA 403, and the AP 402 can forward the L data messages based on the destination address indicated in the data message.

[0118] Step 602: AP 402 performs a network quality assessment on the first network, and based on the assessment result, caches M data packets among the L data packets, wherein M is a positive integer less than or equal to L. The first network is a network for implementing data transmission between AP 402 and STA 403, for example, a Wi-Fi network.

[0119] In a possible embodiment, AP 402 can also detect at least one of the congestion of the network layer between the server 401 and STA 403, the quality of the Wi-Fi network between AP 402 and STA 403, etc., predict the data packets that may be lost through the detection results, and then copy the data packets that may be lost to the buffer area. Among them, the network layer congestion between the server and the STA may generally be caused by factors such as poor signal quality and large interference at the transmission layer. When congestion occurs, the probability of packet loss is high; the quality of the Wi-Fi network between AP 402 and STA 403 can be measured by indicators such as signal quality and wireless interference. When the Wi-Fi network quality is poor, the probability of packet loss is also high.

[0120] In a possible embodiment, the buffer area in the AP 402 may be implemented in the form of a buffer queue or other possible data storage methods, which is not limited in the present application.

[0121] For ease of understanding, Figure 7 A schematic diagram of a cache area provided in an embodiment of the present application. Figure 5 As shown in the structural diagram, the data packets cached in the buffer area can come from one or more of the following: Figure 5 The detection of the receiving module shown in Figure 5 The detection of the sending module shown in the figure and the detection of link layer packet loss are combined with Figure 7 To introduce:

[0122] Method A: Figure 5Detection of the receiving module shown. The receiving module of AP 402 usually has a certain receiving capacity limitation. When the data message from the server 401 exceeds the receiving capacity of AP 402, the receiving module may have a data message overflow problem. However, according to the current network layer queue management algorithm, the overflowed data message may be strategically discarded, resulting in packet loss. In the embodiment of the present application, a buffer area is set based on the TCP proxy function of AP 402. When AP 402 detects that the overflowed data message needs to be lost, the data message can be saved in the buffer area. In this way, the method provided by the present application can reduce the packet loss problem caused by the capacity limitation of the receiving module.

[0123] like Figure 7 As shown, when the data message sent by the server 401 also includes data message 8, and the receiving capacity of the receiving module can only realize the reception of data messages 1 to 7, then AP 402 needs to execute the operation of discarding data message 8 according to the current network layer queue management algorithm. At this time, the TCP proxy module in AP 402 detects the discard event and saves data message 8 to the buffer area. Among them, AP 402 can realize traditional TCP transmission and TCP proxy through different processes or threads, so that the execution of the TCP proxy module will not affect the transmission process of the traditional TCP connection.

[0124] Method B: Figure 5 Detection of the sending module shown. AP 402 can count the packet sending interval between two adjacent data messages in the sending module, and the packet sending interval can be obtained by counting the interval between the sending moments of two adjacent data messages. For example, starting from the time after data message 1 is sent, the interval between the sending moment of statistical data message 2 and the sending moment of data message 1 is counted, which is the packet sending interval of data message 2, for example, which can be expressed as tx2; similarly, the packet sending interval of data message 3 can be expressed as tx3, etc. In a possible embodiment, when AP 402 detects that the packet sending interval tx of the data message is greater than the preset interval value T, it can be evaluated that the data message may be lost. In addition, the packet sending interval of the data message in the Wi-Fi network can generally depend on whether the data message can seize the transmission resources in the transport layer. It can be understood that when the Wi-Fi network is congested, the packet sending interval is generally longer, and it is also easier to cause packet loss due to congestion in this scenario. Therefore, when the packet sending interval of the data message is large, the probability of packet loss may be large, and the data message can be cached at this time.

[0125] like Figure 7As shown, AP 402 detects that tx2>T of data message 2, copies data message 2 to the buffer area for buffering, and detects that tx5>T of data message 5, copies data message 5 to the buffer area for buffering. It can be understood that Figure 7 Except for data message 2 and data message 5, the packet sending interval of data message 1, data message 3, data message 4, data message 6 and data message 7 is less than or equal to T.

[0126] It is understandable that when the packet transmission interval of the data message is large, it means that the network quality may be poor, thus increasing the probability of packet loss. In this way, based on the packet transmission interval of the data message, some data messages are selected from the data messages sent by the server 401 for caching, which can reduce the load and cache pressure on the AP, and can also achieve data message retransmission through the AP when packet loss occurs, thereby shortening the retransmission path.

[0127] Method C: Detection of packet loss at the link layer. When sending a data message, AP 402 transfers the data message from the network layer to the link layer for processing. Figure 7 As shown, taking data message 3 as an example, the link layer can split data message 3 into data message 3-1, data message 3-2 and data message 3-3. When one or more of data message 3-1, data message 3-2 and data message 3-3 are lost, the link layer can retransmit based on automatic repeat request (ARQ). However, when the link layer executes ARQ a certain number of times, it will also discard the data message, resulting in packet loss. Among them, the loss of data message 3-2 can be understood as the loss of data message 3, and data message 3 needs to be retransmitted. For example, Figure 7 Packet 3-2 in the datagram is lost, and the number threshold is 3. When the ARQ times reach three times, that is, the number threshold is reached, the discard needs to be executed. At this time, the TCP proxy module detects the discard event and can be used as follows: Figure 7 The ring buffer shown is used to cache the data message 3 to avoid packet loss; wherein the ring buffer is a circular buffer area used to send data messages.

[0128] In combination with the cache area introduced in the above embodiment, AP 402 can also adjust the cache probability of the cache area to reduce the occupation of AP memory resources. Exemplarily, a proportional-integration (PI) algorithm can be used to control the cache probability. In another exemplary embodiment, AP 402 can also adjust the cache probability by the transmission duration of the ACK message of STA 403. For example, when the transmission duration of the ACK message increases, the cache probability is increased, and when the transmission duration of the ACK message decreases, the cache probability is reduced; wherein, the transmission duration of the ACK message can be determined by the sending timestamp of the ACK message by STA 403 and the receiving timestamp of the ACK message sent by STA 403 received by AP 402. In a possible embodiment, AP 402 can adjust the preset interval value T in method B based on the change value of 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 cache probability can be improved by reducing T. For example, when the transmission duration becomes shorter and the change value is greater than or equal to the second preset threshold, the cache probability can be reduced by increasing T; wherein the first preset threshold and the second preset threshold can be the same or different.

[0129] It can be understood that when the network quality of the first network is poor, the cache ratio of the data message can be increased until all the data messages sent by the server 401 are copied, and M can be equal to L at this time; or, when the network quality of the first network is good, the cache ratio of the data message can be reduced until the data messages sent by the server 401 are not copied or a small number of data messages are copied, for example, M can be equal to 0 or 1.

[0130] In addition, the cache area of ​​AP 402 may also have a cache capacity limitation. When the data packets cached in the cache area exceed the cache capacity, the data packets with the smallest packet transmission interval tx, the data packets with the earliest cache time, the data packets with the latest cache time, or the randomly selected data packets may be selected from the cached data packets for replacement. In another possible embodiment, when the data packets cached in the cache area exceed the cache capacity, the newly cached data packets may no longer be received. In this way, when there is a large amount of packet loss in the network, the server 401 can also perceive the occurrence of the packet loss problem, thereby reducing the packet transmission frequency and avoiding the problem of data packet overflow in the cache area.

[0131] Step 603 : AP 402 sends L data packets sent by server 401 to STA 403 .

[0132] In the embodiment of the present application, step 603 may be executed after step 602, or step 603 may be executed simultaneously with step 602, for example, step 602 and step 603 may be executed synchronously through different processes or threads.

[0133] Among them, the following step 604 is an optional step, and the execution order of step 604 and any step from step 603 to step 609 is not limited. For example, it can be executed simultaneously with any step, or before or after any step, or step 604 may not be executed.

[0134] Step 604 : AP 402 simulates STA 403 to send ACK messages of the M data messages to server 401 .

[0135] like Figure 4 As shown, AP 402 can simulate STA 403 to send ACK messages of data message 2, data message 3 and data message 5 to server 401. Or, as Figure 7 As shown, AP 402 can simulate STA 403 to send ACK messages of data message 2, data message 3, data message 5 and data message 8 to server 401.

[0136] It is understandable that AP 402 can cache M data packets out of L data packets based on the TCP proxy function, so that in the scenario where M data packets are lost, AP 402 can simulate server 401 to resend the lost data packets to STA 403. At this time, AP 402 can simulate STA 403 to send ACK packets for M data packets to server 401, and can realize virtual proxy for STA 403 to receive M data packets, and server 401 can promptly confirm that M data packets have been sent successfully; it is understandable that at this time, AP 402 simulates STA 403 to realize virtual reception of M data packets.

[0137] Step 605: AP 402 starts timing for the M data messages. In a possible embodiment, AP 402 may start timing for the M data messages respectively, and when a data message is buffered in the buffer area, the timing of the data message is started.

[0138] In a possible embodiment, an ACK message may be used to implement feedback on the reception of the data message. Based on the ACK message, the following steps 606 to 608 may be included.

[0139] Step 606: AP 402 receives ACK messages for N data messages, where N is a positive integer less than or equal to L. Figure 4As shown, the N data packets may be data packet 1, data packet 2, data packet 4, data packet 6 and data packet 7.

[0140] Step 607: AP 402 sends ACK messages for the N data messages to server 401. It is understandable that when step 604 is executed, the ACK messages for the N data messages and the data messages corresponding to the ACK message in step 604 may be repeated, for example Figure 4 As shown, the server 401 receives two ACK messages for data message 2. When the server 401 receives the ACK message for data message 2 for the first time, it can be determined that data message 2 has been successfully transmitted. Therefore, the server 401 can directly ignore the second ACK message for data message 2.

[0141] Optionally, AP 402 may also compare the ACK messages of the M data messages with the ACK messages of the N data messages, and when an ACK message of the same data message is detected, the ACK message of the data message is no longer sent in step 607, for example, in combination with Figure 4 As shown, based on the fact that AP 402 has sent the ACK message for data message 2 in step 604, the ACK message for data message 2 from STA 503 may be discarded in step 607, thereby reducing the occupancy of the transmission bandwidth.

[0142] Step 608: AP 402 detects that the N data packets include the first data packet among the M data packets, and deletes the first data packet from the cache. For example, if the ACK packet in step 606 includes the ACK packet of data packet 2, AP 402 can determine that STA 403 has received data packet 2, and deletes data packet 2 in the cache. 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 packet received by AP 402 and the data packet in the cache.

[0143] It should be noted that the implementation of this application does not limit the execution order of step 607 and step 608. For example, step 607 and step 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 message among the M data messages exceeds the timing threshold. It can be understood that when the timing threshold is exceeded, the data message has a high probability of packet loss, and retransmission of the data message can be triggered at this time. In a possible embodiment, AP 402 can implement the timing of the data message based on a timeout retransmission mechanism (retransmission timeout, RTO).

[0145] It should be noted that the implementation of this application does not limit the execution order of step 609 and step 608. For example, step 609 and step 608 can be executed simultaneously through different processes or threads, or step 609 is executed before step 608, or step 609 is executed after step 608.

[0146] Step 610: AP 402 sends the second data message to STA 403 to retransmit the second data message. It should be noted that the second data message may be one or more, which may be determined by the timing of each data message in the buffer area of ​​AP 402 and the ACK message reception status. For example, AP 402 detects based on step 609 that Figure 4 As shown, the timing of the data message 3 and the data message 5 exceeds the timing threshold, and the server 401 can be simulated to send the data message 3 and the data message 5 to the STA 403 to achieve the retransmission of the data message 3 and the data message 5.

[0147] In a possible embodiment, when AP 402 retransmits a data message for more than a certain number of times (for example, the number of times threshold may be 3 times), the data message in the buffer area may be discarded, thereby avoiding occupation of AP memory resources.

[0148] In another possible embodiment, the STA may also implement the communication method provided in the embodiment of the present application by sending a selective ACK (SACK) message (hereinafter referred to as the SACK message) to the AP, where the SACK message indicates the data message requested by the STA. Exemplarily, AP 402 may monitor the message sequence number of the SACK message sent by STA 403 in real time, check the mapping table, and process the data message in the corresponding buffer area; wherein the SACK message is used to indicate the message sequence number of the data message requested by STA 403, and the mapping table may be used to indicate the mapping relationship between the message sequence number and the data message, so as to determine the message sequence number of the data message that has been confirmed to be received based on the SACK message and the mapping table. Based on the SACK message sent by STA 403, the processing operations that AP 402 may perform may be as follows:

[0149] (A) When the message sequence number of the data message stored in the buffer area is smaller than the message sequence number of the SACK message, it can be determined that the STA has received the data message whose message sequence number is smaller than the message sequence number indicated by the SACK message, and therefore the data message whose message sequence number in the buffer area is smaller than the message sequence number of the SACK message can be deleted.

[0150] For example, when the SACK message feedback is sequence number 5, it can represent that the data messages with sequence numbers 1 to 4 have been received, so the data messages with sequence numbers 1 to 4 in the buffer area can be deleted.

[0151] (B) When the message sequence number of the data message stored in the buffer area is equal to the message sequence number of the SACK message, it can be determined that the STA requests retransmission of the data message, and therefore the data message can be retransmitted; wherein, the data message whose message sequence number is equal to the message sequence number of the SACK message can be determined as a lost data message.

[0152] For example, when the SACK message is 5, it means that the current STA 403 needs the fifth data message, so the fifth data message needs to be retransmitted.

[0153] (C) When the message sequence number of the data message stored in the buffer area is greater than the message sequence number of the SACK message, it can be determined that the data message requested by the STA is not cached in the buffer area, so the SACK message can be transparently transmitted to the server 401 to enable the server 401 to retransmit the data message.

[0154] For example, when the received SACK message is 5, when the message numbers in the buffer are all greater than 5, it means that the data message required by the SACK message is not in the buffer, so it is transparently transmitted to the server 401 to enable the server 401 to retransmit the 5th data message.

[0155] In the form of SACK messages, data messages in the cache queue can be quickly retransmitted locally, thereby improving communication reliability and efficiency.

[0156] Step 611: AP 402 receives an ACK message for the second data message sent by STA 403 to server 401. It is understandable that when STA 403 receives the retransmitted data message, it may send an ACK message for the received data message.

[0157] Step 612: AP 402 sends an ACK message for the second data message sent by STA 403 to server 401. It is understandable that when server 402 receives repeated ACK messages for the same data message, the repeated ACK messages may be discarded.

[0158] Through the communication method provided in the embodiment of the present application, through the TCP proxy function of the intermediate network device such as AP, it is possible to achieve packet loss prediction based on network quality evaluation, so that the data message sent by the sender can be selectively cached based on the network quality evaluation result, for example, the data message predicted to be lost can be cached; wherein, in the embodiment of the present application, the network quality evaluation result can be obtained through at least one of the congestion situation of the network layer between the server and the STA, the Wi-Fi network quality between AP 402 and STA 403, etc. It can be understood that when the network quality evaluation result becomes better, the intermediate network device can reduce the number of cached data messages; and when the network quality evaluation result becomes worse, the number of cached data messages can be increased until all the data messages are copied and cached. Therefore, the method does not need to cache all the data messages of the sender, and can achieve a dynamic balance between the load capacity of the intermediate network device and the network quality, thereby reducing costs and improving communication efficiency and reliability.

[0159] In addition, through the TCP proxy function of the intermediate network device, it is also possible to simulate the ACK response of the receiving device, so that the sending end can perceive the successful sending of the data message, thereby ensuring the packet sending efficiency of the sending end, avoiding the sending end device from reducing the packet sending frequency in response to the packet loss problem, etc., ensuring the continuous packet sending of the sending end, thereby reducing the impact on delay-sensitive services and ensuring communication efficiency. In addition, through the TCP proxy function of the intermediate network device, it is also possible to simulate the sending end device to achieve data message retransmission, thereby shortening the retransmission path.

[0160] In addition, the method provided in the embodiment of the present application can also avoid the impact on traditional TCP transmission, and can also improve the reliability and efficiency of TCP transmission through the TCP proxy function.

[0161] In another possible implementation, Figure 8 Another interactive flow chart of a communication method provided in an embodiment of the present application. The flow may include the following steps:

[0162] Step 801: An access point receives L data messages sent by a server to a station, and caches M data messages among the L data messages, 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 message among the M data messages is sent successfully, the first data message among the M data messages in the cache is deleted.

[0165] Step 804: When the access point detects that the second data message among the M data messages fails to be sent, the access point sends the second data message among the M data messages cached to the station.

[0166] The specific implementation process of step 801 to step 804 can refer to the content of the aforementioned embodiment and will not be repeated here.

[0167] Based on the above embodiments, the present application further provides a device, which includes multiple functional modules; the multiple functional modules interact with each other to implement the functions performed by the device in each method described in the embodiments of the present 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 the specific implementation. Figure 6 In the embodiment shown, the AP 402 performs steps 601 to 612; Figure 8 In the illustrated embodiment, steps 801 to 804 are performed by an access point.

[0168] Based on the above embodiments, the present application further provides a device, which includes at least one processor and at least one memory, wherein the at least one memory stores program instructions, and when the device is running, the at least one processor executes the functions executed by the device in each method described in the embodiments of the present application. Figure 6 In the embodiment shown, the AP 402 performs steps 601 to 612; Figure 8 In the illustrated embodiment, steps 801 to 804 are performed by an access point.

[0169] Based on the above embodiments, the present application also provides a program product, which includes: a program (also referred to as code, or instruction), which, when executed, enables execution of the methods described in the embodiments of the present application.

[0170] Based on the above embodiments, the present application further provides a readable storage medium, in which a program is stored. When the program is executed by a computer, the computer executes the methods described in the embodiments of the present application.

[0171] Based on the above embodiments, the present application also provides a chip, which is used to read the program stored in the memory to implement the methods described in the embodiments of the present application.

[0172] Based on the above embodiments, the present application provides a chip system, which includes a processor for supporting a computer device to implement the methods described in the embodiments of the present application. In a possible design, the chip system also includes a memory, which is used to store the necessary programs and data of the computer device. The chip system can be composed of a chip, or it can include a chip and other discrete devices. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application can adopt 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 codes.

[0173] The present application is described with reference to the flowchart and / or block diagram of the method, device (system) and program product according to the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by program instructions. These program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device produce a device for realizing the function specified in one flow chart flow or multiple flow charts and / or one box or multiple boxes of the block diagram.

[0174] These program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0175] These program instructions may also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.

[0176] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of protection of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these 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 station, and caches M data packets of 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 station; When the access point detects that a first data message among the M data messages is sent successfully, deleting the first data message among the M data messages cached; When the access point detects that the second data message among the M data messages fails to be sent, the access point sends the second data message among the M data messages buffered to the station.

2. The method according to claim 1, characterized in that The caching of the M data packets among the L data packets includes one or more of the following: The access point detects a discard event of the third data message in the process of receiving the data message, and buffers the third data message; or, The access point detects that the sending time interval of the fourth data message during the process of sending the data message is greater than the preset interval value, and caches the fourth data message; or, The access point detects a link layer packet loss event of the fifth data message, and buffers the fifth data message.

3. The method according to claim 1 or 2, characterized in that: The access point detects that a first data message among the M data messages is sent successfully, including: The access point receives a first ACK message of the first data message sent by the station; or, The access point receives a first SACK message of the sixth data message sent by the station, where the first SACK message is used to indicate that the station requests the sixth data message, and the message sequence number of the sixth data message is greater than the message sequence number of the first data message.

4. The method according to any one of claims 1 to 3, characterized in that The access point detects that a second data message among the M data messages fails to be sent, including: The access point does not receive a second ACK message of the second data message sent by the station within a preset time period; or, The access point receives a second SACK message for the second data message sent by the station, where the second SACK message is used to indicate that the station requests the second data message.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: The access point receives a third SACK message of the seventh data message sent by the station, where the third SACK message is used to indicate that the station requests the seventh data message, the M data messages do not include the seventh data message, and the message sequence number of the seventh data message is less than the message sequence number of the M data messages; The access point sends the third SACK message to the server.

6. The method according to any one of claims 1 to 5, characterized in that After caching M data packets among the L data packets, the method further includes: The access point sends one or more third ACK messages to the server, where the one or more third ACK messages are used to indicate that the station has received the M data messages; and / or The access point receives one or more fourth ACK messages sent by the site to the server, and sends the one or more fourth ACK messages to the server, where the one or more fourth ACK messages are used to indicate that the site has received N data messages, where N is a positive integer less than or equal to L.

7. The method according to any one of claims 1 to 6, characterized in that After sending the second data message among the M data messages cached to the site, the method further includes: The access point receives a fifth ACK message sent by the station to the server, and sends the fifth ACK message to the server, where the fifth ACK message is used to indicate that the station has received the second data message.

8. The method according to any one of claims 1 to 7, characterized in that 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 smaller than the space occupied by the eighth data message, the eighth data message replaces the ninth data message in the cache queue, the sending time interval of the ninth data message is smaller than the sending time interval of any data message included in the cache queue, or the cache time of the ninth data message is earlier or later than the cache time of any data message included in the cache queue; wherein the M data messages include the eighth data message but do not include the ninth data message; or, When the remaining cache space of the cache queue is smaller than the space occupied by the eighth data message, the eighth data message is no longer cached; wherein the M data messages do not include the eighth data message.

9. The method according to claim 2, characterized in that: The method further comprises: The access point detects that a network quality evaluation result of a first network meets a preset condition, and updates the preset interval value, where the first network is a network between the access point and the station; Among them, 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 moment, and the second evaluation result is the network quality evaluation result of the first network at the second moment.

10. The method according to claim 9, characterized in that The access point detects that a network quality evaluation result of the first network meets a preset condition, and updates the preset interval value, including: The access point detects that the transmission duration of the ACK message sent by the station increases, and the increase value is greater than a first preset threshold, and reduces the preset interval value; The access point detects that the transmission duration of the ACK message sent by the station is reduced, and the reduction value is greater than a second preset threshold, and increases the preset interval value; The transmission duration is determined based on a sending timestamp when the station sends the ACK message and a receiving timestamp when the access point receives the ACK message.

11. An access point, characterized in that: The access point comprises at least one processor coupled to at least one memory, and the at least one processor is configured to read a program stored in the at least one memory so as to enable the access point to execute the method according to any one of claims 1 to 10.

12. A readable storage medium, characterized in that: The readable storage medium stores instructions, which, when executed on a device, enable the device to execute the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Data transmission control method and data transmission set

    CN101114999A

  • Method and system for optimizing TCP (Transmission Control Protocol) connection based on AP (Access Point), and AP

    CN105228181A

  • Communication protocol packet retransmission

    US20210359787A1