A WiFi keep-alive method, WiFi keep-alive device and WiFi chip
The WiFi chip generates pseudo-TCP messages and ARP response messages during the sleep of the main CPU system, which solves the problems of TCP connection shutdown and IP/MAC address aging, and realizes reliable recovery of TCP connections and low-power WiFi keep-aliveness.
Patent Information
- Application Number
- CN202210556358.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2042-05-20
AI Technical Summary
The existing WiFi keep-alive solution cannot effectively prevent the TCP connections of the main CPU system from being shut down by the server during a long sleep period, resulting in network connection failure and IP/MAC address information aging, affecting the overall network performance.
The wake-up and sleep phases are performed alternately through the WiFi chip, and pseudo-TCP messages are generated and periodically sent to the TCP server to maintain TCP connection activity and send ARP response messages to the router to prevent the IP/MAC address information from aging, avoid host wake-up, and reduce the Power consumption.
Effectively prevent the TCP connection from being closed by the server, ensure that the TCP connection can be restored after the host wakes up sleep, keep the IP address reachable, reduce the host power consumption, and avoid unnecessary wake-up.
Smart Images

Figure CN114980365B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of mobile electronic devices, and more specifically, to a WiFi keep-alive method, a WiFi keep-alive device, and a WiFi chip. Background Art
[0002] Smartphones, tablets and many other mobile electronic devices have battery life requirements, so device power consumption management is a very important link. Most battery-powered mobile electronic devices support standby modes to varying degrees.
[0003] Current mobile electronic devices will put the main CPU system into sleep mode in standby mode, and keep a small number of peripheral devices in working state to wake up the main CPU system, such as buttons, RTC alarm clocks, WiFi modules, etc. Among them, the WiFi module generally works in a low-power mode with periodic wake-up due to its high power consumption. Its sleep cycle is specified by the DTIM parameters specified by the WiFi protocol. After waking up at the DTIM time specified by the protocol, the WiFi module receives broadcast data cached by the AP, such as ARPRequest. In addition, the WiFi module will also send Null Data to the connected AP at a certain interval to inform the other party that it is still online, so as to avoid being disconnected by the AP. This process is usually called WiFi keep-alive.
[0004] However, the current WiFi keep-alive solution only aims at keeping the connection between the WiFi module and the AP alive. When the main CPU system is in long-term sleep mode, the network connection established on the main CPU, especially the TCP connection, will be regarded as an invalid connection by the other party due to long-term lack of communication with the server and will be forcibly closed. In addition, the ARP information on the AP will also be aged, which will lead to a series of operations that are detrimental to the overall network performance. These problems cannot be effectively solved. Summary of the invention
[0005] The present application is provided to solve the above-mentioned problems existing in the prior art.
[0006] A WiFi keep-alive method, a WiFi keep-alive device and a WiFi chip are needed, which can effectively prevent the TCP connection from being closed by the server, so that after the host is awakened from a long period of sleep, the application software can immediately resume use by establishing multiple TCP connections; the IP and MAC address information of the host will not be aged and deleted, thereby ensuring that the IP address of the host is reachable to the entire network link, the host can be awakened at any time through network data when the host is asleep for a long time, and the host can be avoided from being awakened during the keep-alive process, which can effectively reduce the power consumption of the host.
[0007] According to the first aspect of the present application, a WiFi keep-alive method is provided, which is applied to a WiFi chip and a host communicating with each other. The WiFi keep-alive method includes the WiFi chip alternately executing a wake-up phase and a sleep phase; when the WiFi chip switches from the sleep phase to the wake-up phase, obtaining the state of the host, and when the WiFi chip switches from the sleep phase to the wake-up phase and the host enters a dormant state, performing a WiFi keep-alive process for a target TCP connection, the WiFi keep-alive process including: obtaining a pseudo TCP message, the pseudo TCP message being obtained by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process; generating WiFi keep-alive data based on the obtained pseudo TCP message; updating the WiFi keep-alive data at a first predetermined time interval and sending the pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection; receiving data from the TCP server; filtering out the response data of the TCP server to the WiFi keep-alive data from the data received from the TCP server, and then sending it to the host, so that the host is not awakened by the response data.
[0008] According to a second aspect of the present application, a WiFi keep-alive device is provided, the WiFi keep-alive device communicates with a host and is arranged on a WiFi chip that alternately performs a wake-up phase and a sleep phase. The WiFi keep-alive device is configured to: when the WiFi chip switches from the sleep phase to the wake-up phase, obtain the state of the host, and when the WiFi chip switches from the sleep phase to the wake-up phase and the host enters a dormant state, perform a WiFi keep-alive process for a target TCP connection, the WiFi keep-alive process comprising: obtaining a TCP message, the TCP message being obtained by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process; generating WiFi keep-alive data based on the obtained TCP message; updating the WiFi keep-alive data at a first predetermined time interval and sending a pseudo TCP message generated based on the updated WiFi keep-alive data to a TCP server corresponding to the target TCP connection; receiving data from the TCP server; filtering out the response data of the TCP server to the WiFi keep-alive data from the data received from the TCP server, and then sending it to the host, so that the host is not awakened by the response data.
[0009] According to a third aspect of the present application, a WiFi chip is provided, comprising: a host interface configured to communicate with a host; and the WiFi keep-alive device as described above, configured to communicate with the host via the host interface.
[0010] According to the WiFi keep-alive method, WiFi keep-alive device and WiFi chip of the present application, the WiFi keep-alive device arranged on the WiFi chip is used so that the WiFi chip can periodically send pseudo TCP messages to the TCP server, which can effectively prevent the TCP connection from being closed by the server, so that after the host is awakened from a long period of sleep, the application software can immediately resume use by establishing multiple TCP connections; the WiFi chip periodically sends ARP response messages to the router gateway so that the IP and MAC address information of the host will not be aged and deleted, thereby ensuring that the IP address of the host is reachable to the entire network link, and the host can be awakened at any time by network data when the host is asleep for a long time; the keep-alive process avoids waking up the host, which can effectively reduce the power consumption of the host. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] In the drawings, which are not necessarily drawn to scale, the same reference numerals may describe similar parts in different views. The same reference numerals with letter suffixes or different letter suffixes may represent different instances of similar parts. The accompanying drawings generally illustrate various embodiments by way of example and not limitation, and together with the specification and claims, are used to illustrate the disclosed embodiments. When appropriate, the same reference numerals are used throughout the drawings to refer to the same or similar parts. Such embodiments are illustrative and are not intended to be exhaustive or exclusive embodiments of the present apparatus or method.
[0012] Figure 1 A flowchart of a WiFi keep-alive method according to a first embodiment of the present application is shown;
[0013] Figure 2 A flowchart showing a WiFi keep-alive method according to a second embodiment of the present application is shown;
[0014] Figure 3 A flowchart of generating and updating a pseudo TCP message according to an embodiment of the present application is shown;
[0015] Figure 4 A flowchart showing a WiFi keep-alive method in different situations according to an embodiment of the present application;
[0016] Figure 5 A WiFi keep-alive device and a WiFi keep-alive principle diagram according to the first embodiment of the present application are shown; and
[0017] Figure 6 A WiFi keep-alive device and a WiFi keep-alive principle diagram according to a second embodiment of the present application are shown. DETAILED DESCRIPTION
[0018] In order to enable those skilled in the art to better understand the technical solution of the present application, the present application is described in detail below in conjunction with the accompanying drawings and specific embodiments. The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and specific embodiments, but are not intended to limit the present application. The terms "first", "second" and "third" used in the present application are only intended to distinguish the corresponding features, do not represent the need for such an order, and do not necessarily represent only the singular form.
[0019] Figure 1 FIG. 1 is a flowchart of a WiFi keep-alive method according to a first embodiment of the present application. Figure 1 As shown, the WiFi keep-alive method is applied to a WiFi chip and a host that communicate with each other. It can be understood here that the host includes a CPU system and application software, etc. The host and the WiFi chip can send information to each other. In some embodiments, the host can communicate with the WiFi chip using application software when it is awake. The WiFi chip and the host are both independent of each other and can communicate with each other. When the host is in a dormant state, the WiFi chip can keep the TCP connection with the TCP server side and the AP connection with the router side alive separately, which can avoid waking up the host and reduce the power consumption of the host.
[0020] The WiFi keep-alive method includes the WiFi chip alternately executing the WiFi chip wake-up stage 101 and the WiFi chip sleep stage 109. In the WiFi chip wake-up stage 101, the WiFi chip operates normally. After running for a period of time, the WiFi chip may enter the WiFi chip sleep stage 109, and then the WiFi chip can enter the WiFi chip wake-up stage 101 after being awakened. These two stages of the WiFi chip can be executed alternately. In some embodiments, the WiFi chip wake-up method includes but is not limited to the following: WiFi chip periodic wake-up method (the sleep cycle is specified by the DTIM parameter specified by the WiFi protocol); a method of being awakened by the host, using the host software to send wake-up information to the WiFi chip according to a set period; being awakened by other modules through GPIO, setting a wake-up module on the WiFi chip or on the host, and communicating with the WiFi chip in a set period. The WiFi chip also supports the use of other wake-up methods.
[0021] When the WiFi chip switches from the sleep stage to the wake-up stage, the state of the host is obtained in step 102. The state information of the host is used to determine whether the host enters the wake-up state or the sleep state. For example, (the running process of the host is obtained through the psutil module or a monitoring module is set on the chip to monitor the running state of the host). It is determined whether the WiFi chip needs to be used for the keep-alive process.
[0022] Then, when the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the dormant state, the WiFi keep-alive process for the target TCP connection is executed. First, in step 103, the WiFi keep-alive data is obtained. The WiFi keep-alive data is obtained through step 104, and step 104 is specifically: the service data previously sent by the host is parsed based on the configuration information associated with the host and the WiFi keep-alive process. Specifically, the service data previously sent by the host in step 104 is obtained by the WiFi chip through listening when the host is in the awake state. In step 104, the service data sent by the host to the TCP connection includes TCP packet header information, TCP sequence number, checksum and packet content. The content of the packet includes configuration information associated with the host. The WiFi chip can identify the service data using the configuration information, and then obtain the WiFi keep-alive data through parsing.
[0023] Next, in step 105, a pseudo TCP message is generated based on the acquired WiFi keep-alive data. The WiFi chip generates a pseudo TCP message for maintaining a TCP connection when the host is in a dormant state through the WiFi keep-alive data. The pseudo TCP message has the same function as the service data sent by the host, thereby replacing the service data of the host.
[0024] In step 106, the WiFi chip updates the WiFi keep-alive data at a first predetermined time interval and sends a pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection. The WiFi chip sends the pseudo TCP message to the TCP server at a predetermined time interval. At the same time, when sending the pseudo TCP message, the WiFi chip updates the WiFi keep-alive data to obtain a new pseudo TCP message again, so as to avoid duplication of the pseudo TCP message sent to the TCP server and maintain the TCP connection. The WiFi chip maintains the connection with the TCP server during the host hibernation process. When the host wakes up, the application software on the host can be immediately restored using multiple TCP connections. At the same time, when the host is in hibernation, it is not necessary to send service data to the TCP server, so the power consumption of the host can be reduced.
[0025] In step 107, the WiFi chip receives data from the TCP server. After receiving the pseudo TCP message, the TCP server replies to the WiFi chip to respond, thereby maintaining the TCP connection.
[0026] In step 108, the WiFi chip filters out the response data of the TCP server to the pseudo TCP message from the data received from the TCP server, and then sends it to the host, so that the host is not awakened by the response data. The response data in the reply from the TCP server to the WiFi chip will wake up the host, so the WiFi chip filters the content of the reply, removes the response data, and then sends it to the host, which can prevent the host from being awakened, keep the host in a dormant state, and effectively reduce the power consumption of the host.
[0027] After working for a period of time in the WiFi chip awakening stage 101 , the WiFi chip enters the WiFi chip sleeping stage 109 , and then the WiFi chip is awakened, and the WiFi chip alternately executes the WiFi chip awakening stage 101 and the WiFi chip sleeping stage 109 .
[0028] In some embodiments, the WiFi chip integrates the TCP / IP protocol. This allows the service data previously sent by the host to be parsed based on the configuration information associated with the host and the WiFi keep-alive process, so as to extract the TCP message information associated with the target TCP connection in the service data; and the pseudo TCP message generated based on the WiFi keep-alive data complies with the TCP / IP protocol and can pass the verification of the TCP server. Through the TCP / IP protocol, the service data previously sent by the host can be identified, the service data can be parsed based on the configuration information, and then a pseudo TCP message of the target TCP connection that can be identified by the TCP server can be generated, which is beneficial for the WiFi chip to perform the keep-alive process and avoid the TCP connection from being closed.
[0029] Figure 2 FIG. 2 is a flow chart showing a WiFi keep-alive method according to a second embodiment of the present application. Figure 2 As shown, the WiFi keep-alive method includes the WiFi chip alternately executing the WiFi chip wake-up phase 201 and the WiFi chip sleep phase 205. In the WiFi chip wake-up phase 201, the WiFi chip operates normally. After running for a period of time, the WiFi chip may enter the WiFi chip sleep phase 205, and then the WiFi chip is awakened and enters the WiFi chip wake-up phase 201 again. The two phases of the WiFi chip are executed alternately.
[0030] When the WiFi chip switches from the sleep stage to the wake-up stage, the state of the host is obtained in step 202 to determine whether the host enters the wake-up state or the sleep state.
[0031] During the WiFi keep-alive process, if the host enters the awake state, the WiFi chip will stop the WiFi keep-alive process 203 for the TCP connection. During the WiFi keep-alive process, the host may be awakened by a key operation or a host period setting. In this case, the host may actively establish a TCP connection with the TCP server, so the WiFi chip can stop the keep-alive process.
[0032] Next, in step 204, the sequence number of the current pseudo-TCP message and / or the total length of the data sent during the WiFi keep-alive process are obtained and sent to the host, so that the host can use it to send service data. The WiFi chip synchronously sends the information of the pseudo-TCP message to the host, so that the host can start sending new service data at the synchronized sequence number to avoid duplication of WiFi keep-alive data. Specifically, there are two processes, one of which is that the WiFi chip notifies the host of the latest send sequence number, and the host software directly modifies the send sequence number of the TCP connection being kept alive. The second is that the WiFi chip notifies the host of the total length of the pseudo-TCP message content sent during the keep-alive process, and the host software indirectly updates the send sequence number of the TCP connection being kept alive by sending invalid data of equal length. The WiFi chip is responsible for filtering this invalid data to avoid sending data to the server end to cause TCP disconnection. The basis for judging whether it is invalid data is whether the send sequence number in the TCP packet header information is equal to the latest send sequence number of the WiFi chip keep alive.
[0033] In step 204, the WiFi chip has synchronized the latest transmission sequence number to the host, and then the WiFi chip does not perform the keep-alive process. Next, the WiFi chip can engage in other services, such as sending and receiving data, such as sending and receiving audio data, etc. It can also enter the WiFi chip sleep stage 205, and then the WiFi chip is awakened, and the WiFi chip alternately executes the WiFi chip awakening stage 201 and the WiFi chip sleep stage 205.
[0034] In some embodiments, in the case of multiple TCP connections between the host and the TCP server, the host generates the configuration information defining at least one target TCP connection for which the WiFi keep-alive process is to be performed, the configuration information including the host IP address, host MAC address, TCP server IP address, TCP server port number, router gateway IP address and router gateway MAC address corresponding to each target TCP connection; when the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, the WiFi keep-alive process is performed for multiple TCP connections respectively, so that WiFi keep-alive data is updated for multiple target TCP connections at respective first predetermined time intervals and a pseudo TCP message generated based on the updated WiFi keep-alive data is sent to the TCP server corresponding to the target TCP connection. The target TCP connection between the host and the TCP server may be one or more, and the WiFi keep-alive process of the WiFi chip may perform the keep-alive process for one TCP connection or multiple target TCP connections to ensure that the one or more target TCP connections will not be disconnected. The host generates configuration information for the one or more target TCP connections respectively, and the configuration information includes the message content required for the host to establish a TCP connection and an ARP connection, which is conducive to the WiFi chip identifying the service data sent by the host to each target connection, updating the WiFi keep-alive data at a first predetermined time interval, and using the updated WiFi keep-alive data to generate a new pseudo TCP message to maintain each TCP connection of the host.
[0035] In some embodiments, the configuration information includes the host IP address, host MAC address, TCP server IP address, TCP server port number, router gateway IP address and router gateway MAC address corresponding to each target TCP connection, which can be set to the WiFi chip through the application software on the host.
[0036] Specifically, Figure 3 A flowchart of generating and updating a pseudo TCP message according to an embodiment of the present application is shown. First, in step 301, based on the configuration information of each target TCP connection, the service data of each target TCP connection sent by the host to the WiFi chip is intercepted. The WiFi chip integrates the TCP / IP protocol, and based on the configuration information, the service data sent by the host that matches the configuration information is captured in the host wake-up state, and the configuration information is included in the content of the TCP message packet.
[0037] Secondly, in step 302, the intercepted business data is parsed to obtain the corresponding TCP header information of each target TCP connection, the latest sequence number of the TCP message and the corresponding message length as the TCP message information associated with the target TCP connection. The step of parsing the intercepted business data is to complete the parsing and extraction through the TCPIP protocol part integrated in the WiFi chip. Specifically, the business data sent by the host is parsed through the TCP server IP address (IP_server) and the TCP server port number (PORT_server) in the WiFi chip configuration information. Filter out the TCP messages that match the server IP address and the server port number, and record the TCP header information of the message, as well as the latest TCP message sequence number (SEQ_host_last) and the length of the message content (LEN_host_last).
[0038] Next, in step 303, the latest sequence number of the TCP message in the TCP message information is incremented, and according to the preset rules, the configuration information of the corresponding target TCP connection is used to fill the content of the TCP message, and a TCP checksum is generated according to the content of the filled TCP message, and the TCP header information is correspondingly modified according to the sequence number of the TCP message after the increment processing, and the modified TCP header information, the content of the filled TCP message, and the TCP checksum are used as the WiFi keep-alive data. By incrementing the latest sequence number, continuous and different sequence numbers can be obtained, so that the next sequence number can be distinguished from the previous sequence number, and the connection can be maintained to ensure that it is not disconnected. Specifically, the process of incrementing the latest sequence number of the TCP message can be: the latest TCP message sequence number (SEQ_host_last) obtained after parsing the service data of the host and the length of the message content (LEN_host_last) are summed up to obtain the sequence number of the first pseudo TCP message sent by the WiFi chip. Then the sequence number of the second pseudo TCP message is the result of the sum of the sequence number of the first pseudo TCP message and the length of the sequence number of the first pseudo TCP message. It can be expressed as: the sequence number of the first pseudo TCP message is SEQ_wifi_1=SEQ_host_last+LEN_host_last, the message content length is LEN_wifi_1, the sequence number of the nth pseudo keep-alive message is SEQ_wifi_n=(n-1th TCP keep-alive message sequence number) SEQ_wifi_n-1+(n-1th TCP keep-alive message content length) LEN_wifi_n-1, the content of the packet is filled according to the design agreement with the server, and its length LEN_wifi_n can be 0 or not. Multiple consecutive sequence numbers can be distinguished by summing up, which is conducive to maintaining TCP connection.
[0039] Finally, a pseudo TCP message is assembled based on the modified TCP header information, the content of the filled TCP message, the TCP checksum and the WiFi keep-alive data, so that the pseudo TCP message can pass the check of the TCP server. The WiFi chip sends the assembled TCP keep-alive message to the TCP server, and completes the connection with the TCP server after the check.
[0040] In some embodiments, the WiFi keep-alive process also includes: sending an ARP keep-alive message to the router at a second predetermined time interval, wherein the ARP keep-alive message includes at least the host's IP address (IP_host), the host's MAC address (MAC_host), the router's gateway IP address (IP_gw), and the router's gateway MAC address (MAC_gw). The format of the ARP keep-alive message is the same as the format of the ARP response message sent from the host's MAC address to the router's gateway MAC address. The message content includes IP_host, MAC_host and IP_gw, MAC_gw. When the router receives the ARP keep-alive message, the IP and MAC address information of the host will not be aged and deleted, thereby ensuring that the host's IP address is reachable to the entire network link, and the host can be awakened at any time through network data when the host is dormant for a long time.
[0041] In some embodiments, the host IP address (IP_host), the host MAC address (MAC_host) and the router gateway IP address (IP_gw), the router gateway MAC address is configured by the host to the WiFi chip, or is obtained by parsing the WiFi chip during the WiFi connection process. Specifically, the host directly configures the information to the WiFi chip through application software or parses and extracts it through the DHCP protocol module integrated in the WiFi chip during the WiFi connection process.
[0042] In some embodiments, during the WiFi keep-alive process and when the host enters the awake state: stop sending the ARP keep-alive message to the router. When the host enters the awake state, the host can send the ARP message and stop the keep-alive process through the WiFi chip.
[0043] In some embodiments, the target TCP connection is an encrypted TCP connection. The one or more target TCP connections may be encrypted TCP connections. For a TCP encrypted connection, that is, a TLS connection, the host needs to send the first packet of service data, the WiFi chip will monitor the encrypted service data, and the subsequent keep-alive data will be sent by the WiFi chip, and the sequence number and TCP checksum will be automatically updated.
[0044] Figure 4 FIG. 1 is a flowchart showing a WiFi keep-alive method in different situations according to an embodiment of the present application. Figure 4It can be seen that the WiFi chip awakening stage 401 and the WiFi chip sleeping stage 408 are executed alternately. When in the WiFi chip awakening stage 401, the WiFi chip performs step 402 to obtain the status of the host. When the host is in a dormant state and the WiFi keep-alive process has not started, the WiFi chip then performs the WiFi keep-alive process for the target TCP connection. First, step 403 is performed to obtain WiFi keep-alive data. The WiFi keep-alive data is obtained by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process. The configuration information comes from step 415, and the host sends the configuration information to the WiFi chip in the awakened state. Then in step 404, a pseudo TCP message is generated based on the obtained WiFi keep-alive data. At this time, the WiFi chip starts to execute step 405, updates the WiFi keep-alive data according to the first predetermined time interval, and sends the pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection. Then step 406 is performed, that is, the WiFi chip receives data from the TCP server. Then in step 407, the WiFi chip filters out the response data of the TCP server to the WiFi keep-alive data from the data received from the TCP server, and then sends it to the host, so that the host is not awakened by the response data.
[0045] The WiFi chip performs the wake-up phase and the sleep phase alternately. When the WiFi chip wake-up phase 401 enters the WiFi chip sleep phase 408, the WiFi chip is awakened. After entering the WiFi chip wake-up phase 401, the WiFi chip first performs step 402 to obtain the status of the host. If the host is in the sleep state and the WiFi keep-alive process has not started, then Figure 4 403 to 407 shown in FIG. If the host is in a dormant state and the WiFi keep-alive process has begun, proceed to step 409, update the WiFi keep-alive data at a first predetermined time interval and send a pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection. Then proceed to step 410, that is, the WiFi chip receives data from the TCP server. Then in step 411, the WiFi chip filters out the response data of the TCP server to the pseudo TCP message from the data received from the TCP server, and then sends it to the host. Then enter the WiFi chip sleep stage 408.
[0046] The WiFi chip alternately executes the wake-up phase and the sleep phase. When the WiFi chip wake-up phase 401 enters the WiFi chip sleep phase 408, the WiFi chip is awakened. After entering the WiFi chip wake-up phase 401, the WiFi chip first performs step 402 to obtain the status of the host. If the host enters the awake state, and the WiFi keep-alive process has begun at this time, then the WiFi chip performs step 412 to stop the keep-alive process of the TCP connection and send the sequence number in the current pseudo TCP message to the host. At this time, the WiFi chip no longer executes the keep-alive process, but can execute other functions of the WiFi chip, such as sending and receiving audio data, video data, etc. After the WiFi chip runs for a period of time, it may enter the WiFi chip sleep phase 408.
[0047] The WiFi chip alternately executes the awakening stage and the sleeping stage. When the WiFi chip awakening stage 401 enters the WiFi chip sleeping stage 408, the WiFi chip is awakened. After entering the WiFi chip awakening stage 401, the WiFi chip first performs step 402 to obtain the status of the host. If the host enters the awakening state, and the WiFi keep-alive process has not started at this time, then the WiFi chip performs step 413, the host requests to keep alive and sends configuration information to the WiFi chip, and the WiFi chip listens to the service data sent by the host. The host sends the request information in the awakening state, indicating that the host may enter the sleeping state next. The host associates the configuration information with the WiFi chip. The WiFi chip can obtain the WiFi keep-alive data in step 403 to facilitate the keep-alive process. In addition, in the process of the WiFi chip listening to the service data sent by the host, the WiFi chip receives the service data. The WiFi chip only parses and extracts the service data. At the same time, the WiFi chip sends the complete service data sent by the host to the TCP server normally.
[0048] The WiFi keep-alive device according to the embodiment of the present application is described in detail below.
[0049] Figure 5 FIG. 2 shows a WiFi keep-alive device and a WiFi keep-alive principle diagram according to an embodiment of the present application. Figure 4As shown, a WiFi keep-alive device 501 is disposed on a WiFi chip 502 that alternately executes a wake-up phase and a sleep phase, and the WiFi keep-alive device 501 communicates with a host via a host interface. The WiFi keep-alive device 501 is further configured to: obtain the state of the host 503 when the WiFi chip 502 switches from the sleep stage to the wake-up stage; and perform a WiFi keep-alive process for the target TCP connection when the WiFi chip 502 switches from the sleep stage to the wake-up stage and the host 503 enters the sleep state, wherein the WiFi keep-alive process includes: obtaining WiFi keep-alive data, wherein the WiFi keep-alive data is obtained by parsing the service data previously sent by the host 503 based on the configuration information associated with the WiFi keep-alive process of the host 503; generating a pseudo TCP message based on the obtained TCP message; updating the WiFi keep-alive data at a first predetermined time interval and sending the pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server 504 corresponding to the target TCP connection; receiving data from the TCP server 504; filtering out the response data of the TCP server 504 to the pseudo TCP message from the data received from the TCP server 504, and then sending the data to the host 503, so that the host 503 is not awakened by the response data. The host associates configuration information with the WiFi keep-alive device 501 on the WiFi chip through the host interface, and the service data previously sent by the host 503 can be obtained through the WiFi keep-alive device 501 through interception. The WiFi keep-alive device 501 uses the configuration information to match the service data, and obtains the WiFi keep-alive data related to WiFi keep-alive. The WiFi keep-alive device 501 uses the WiFi keep-alive data to generate a pseudo TCP message and sends it to the TCP server 504, and receives data from the TCP server 504. The data is filtered out by the WiFi keep-alive device 501 and then sent to the host.
[0050] When the host 503 is in a dormant state (or standby mode), the WiFi chip sends a pseudo TCP message to the TCP server 504 in an awake state, effectively preventing the TCP connection from being closed by the server. The host 503 does not need to actively maintain the TCP connection, thereby keeping the host 503 in a dormant state and preventing the host 503 from being awakened by the response data, thereby effectively reducing the power consumption of the host 503.
[0051] In some embodiments, the WiFi keep-alive device may be implemented by software integrated on the WiFi chip or by hardware integrated on the WiFi chip, or may be an application software that implements the keep-alive function.
[0052] Figure 6FIG. 2 shows a WiFi keep-alive device and a WiFi keep-alive principle diagram according to a second embodiment of the present application. Figure 6 As shown, the WiFi chip 602 integrates a TCP / IP protocol module 605, and the TCP / IP protocol module 605 is configured to parse the service data previously sent by the host based on the configuration information associated with the WiFi keep-alive process of the host to extract the TCP message information associated with the target TCP connection in the service data. And, based on the WiFi keep-alive data obtained via the WiFi keep-alive device, a pseudo TCP message corresponding to the target TCP connection is generated, and the pseudo TCP message complies with the TCP / IP protocol and can pass the verification of the TCP server. Specifically, the TCP / IP protocol module 605 uses the TCP / IP protocol integrated therein to intercept and parse the service data sent by the host 603, and extracts information including but not limited to the TCP server IP address, TCP server port number, etc. in the service data TCP message sent by the host, and compares it with the TCP server IP address and TCP server port number of the corresponding target TCP connection in the configuration information associated with the WiFi keep-alive process sent by the host. If they match, it is considered that the TCP message is a TCP message associated with the target TCP connection. Thus, through the above matching process, the TCP / IP protocol module 605 can extract the TCP messages matching each target TCP connection from the service data sent by the host 603, and obtain the corresponding TCP header information of each target TCP connection, the latest sequence number of the TCP message, the corresponding message length, etc. Specifically, the TCP / IP protocol module 605 can obtain the service data sent by the host 603 by intercepting.
[0053] When WiFi keep-alive starts to keep alive, the TCP / IP protocol module 605 parses the last service data sent by the host to obtain the latest TCP message information and sends it to the WiFi keep-alive device 601. The WiFi keep-alive device 601 generates WiFi keep-alive data using the TCP message information. The TCP / IP protocol module 605 generates a pseudo TCP message corresponding to the target TCP connection based on the WiFi keep-alive data obtained by the WiFi keep-alive device 601. The pseudo TCP message complies with the TCP / IP protocol and can pass the verification of the TCP server. By sending a pseudo TCP message to the TCP server, it is beneficial to keep alive the TCP connection of the host and avoid closing the TCP connection.
[0054] In this embodiment, the TCP / IP protocol module 605 is separately provided from the WiFi keep-alive device 601. The WiFi keep-alive device 601 uses the TCP / IP protocol module 603 to assemble and package the WiFi keep-alive data to form a pseudo TCP message that can be recognized by the TCP server 604 end and is connected to the keep-alive TCP connection. The pseudo TCP message can be directly sent by the TCP / IP protocol module 605 or sent by the WiFi keep-alive device 601. If it is directly sent by the TCP / IP protocol module 605, when the pseudo TCP message is processed in the next round, the information of the pseudo TCP message in the previous round needs to be sent to the WiFi keep-alive device 601 to update the WiFi keep-alive data. When the TCP / IP protocol module 605 is separately provided from the WiFi keep-alive device 601, the TCP / IP protocol module 605 and the WiFi keep-alive device 601 can exchange data through a buffer or by setting them on the same integrated circuit. The WiFi keep-alive device 601 is responsible for communicating with the host. The WiFi keep-alive device 601 uses the TCP / IP protocol module 605 to assemble and package pseudo TCP messages and to intercept, parse and extract the host service data. In another embodiment, the TCP / IP protocol module 605 may be integrated in the WiFi keep-alive device 601. In this way, a whole process of directly obtaining a pseudo TCP message by using the configuration information and service data of the host can be completed in the WiFi keep-alive device.
[0055] Specifically, the WiFi keep-alive device obtains the host status, for example, obtains the running process of the host through a psutil module or sets a monitoring module on the chip to monitor the running status of the host.
[0056] In some embodiments, the WiFi keep-alive device is further configured to: stop the WiFi keep-alive process for the TCP connection when the host enters the awake state during the WiFi keep-alive process; obtain from the TCP / IP protocol module and send to the host the sequence number of the current pseudo TCP message corresponding to the target TCP connection, and / or the total length of the data sent during the WiFi keep-alive process, so that the host can use it to send service data. During the WiFi keep-alive process, the host may be awakened by key operation or host period setting. In this case, the host may actively establish a TCP connection with the TCP server, so the WiFi chip can stop the keep-alive process.
[0057] Taking the WiFi keep-alive device and the TCP / IP protocol module as an example, the TCP / IP protocol module sends the sequence number of the current pseudo TCP message and / or the total length of the data sent in the WiFi keep-alive process to the WiFi keep-alive device, and the WiFi keep-alive device sends it to the host. Alternatively, if the TCP / IP protocol module is integrated in the WiFi keep-alive device, the WiFi keep-alive device directly uses the output information of the TCP / IP protocol module to send it to the host.
[0058] The host receives the information of the pseudo TCP message, which enables the host to send new service data from the latest synchronized TCP message sequence number, instead of reusing the old TCP message sequence number that has been used by the WiFi keep-alive data. Specifically, there are two optional methods. One is that the WiFi chip notifies the host of the latest send sequence number, and the host software directly modifies the send sequence number of the TCP connection being kept alive. The second is that the WiFi chip notifies the host of the total length of the pseudo TCP message content sent during the keep-alive process, and the host software indirectly updates the send sequence number of the TCP connection being kept alive by sending invalid data of equal length. The WiFi chip is responsible for filtering this invalid data to avoid sending data to the TCP server and causing TCP disconnection. The basis for judging whether it is invalid data is whether the send sequence number in the TCP packet header information is equal to the latest send sequence number kept alive by the WiFi chip. After that, the WiFi chip does not perform the keep-alive process.
[0059] In some embodiments, when there are multiple TCP connections between the host and the TCP server, the host generates the configuration information defining each target TCP connection for which the WiFi keep-alive process is to be performed, the configuration information includes the host IP address, host MAC address, TCP server IP address, TCP server port number, router gateway IP address and router gateway MAC address corresponding to each target TCP connection, and the WiFi keep-alive device is further configured to: when the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, perform the WiFi keep-alive process for each TCP connection separately, so that the WiFi keep-alive data is updated for each target TCP connection at each first predetermined time interval and a pseudo TCP message generated based on the updated WiFi keep-alive data is sent to the TCP server corresponding to each target TCP connection. The target TCP connection between the host and the TCP server may be one or more, and the WiFi keep-alive process of the WiFi chip may perform the keep-alive process for one TCP connection or multiple target TCP connections. The WiFi keep-alive data is updated at a first predetermined time interval, and a new pseudo TCP message is generated using the updated WiFi keep-alive data, for example, the information of the pseudo TCP message sent in the previous round is first updated to obtain new WiFi keep-alive data, and then a new pseudo TCP message is obtained using the updated WiFi keep-alive data, so as to maintain one TCP connection or multiple TCP connections of the host.
[0060] In some embodiments, the TCP / IP protocol module is further configured to: based on the configuration information of each target TCP connection, intercept the service data of each target TCP connection sent by the host to the WiFi chip; parse the intercepted service data to obtain the corresponding TCP header information of each target TCP connection, the latest sequence number of the TCP message and the corresponding message length as the TCP message information associated with the target TCP connection; after receiving the service data and configuration information of the WiFi keep-alive device, the TCP / IP protocol module begins to parse the service data to obtain the TCP message information. Specifically, the service data sent by the host can be parsed through the TCP server IP address (IP_server) and the TCP server port number (PORT_server) in the configuration information. Filter out the TCP message that matches the server IP address and the server port number, and record the TCP header information of the message, as well as the latest TCP message sequence number (SEQ_host_last) and the length of the message content (LEN_host_last).
[0061] In some embodiments, the pseudo TCP message that complies with the TCP message format and each layer transmission protocol can be assembled and generated based on the WiFi keep-alive data from the WiFi keep-alive device, so that the pseudo TCP message can pass the verification of the TCP server corresponding to each target TCP connection.
[0062] The WiFi keep-alive device is further configured to: increment the latest sequence number of the TCP message in the TCP message information from the TCP / IP protocol module, and fill the content of the TCP message using the configuration information of the corresponding target TCP connection according to a preset rule, generate a TCP checksum according to the content of the filled TCP message, and modify the TCP header information accordingly according to the sequence number of the TCP message after the increment processing, and use the modified TCP header information, the content of the filled TCP message, and the TCP checksum as the WiFi keep-alive data. Taking the WiFi keep-alive device and the TCP / IP protocol module as an example, the TCP / IP protocol module sends the TCP message information to the WiFi keep-alive device, and then the WiFi keep-alive device increments the latest sequence number of the TCP message in the message information, and fills the content of the TCP message with the configuration information of the corresponding target TCP connection according to the preset rules, generates a TCP checksum according to the content of the filled TCP message, and modifies the TCP header information according to the sequence number of the TCP message after the increment processing, and uses the modified TCP header information, the content of the filled TCP message, and the TCP checksum as the WiFi keep-alive data. By incrementing the latest sequence number, continuous and different sequence numbers can be obtained, so that the next sequence number can be distinguished from the previous sequence number, and the connection can be maintained to ensure that it is not disconnected. Specifically, the process of incrementing the latest sequence number of the TCP message can be: the latest TCP message sequence number (SEQ_host_last) obtained after parsing the service data of the host and the length of the message content (LEN_host_last) are summed to obtain the sequence number of the first pseudo TCP message sent by the WiFi chip. Then the sequence number of the second pseudo TCP message is the sum of the sequence number of the first pseudo TCP message and the length of the sequence number of the first pseudo TCP message. It can be expressed as: the sequence number of the first pseudo TCP message is SEQ_wifi_1=SEQ_host_last+LEN_host_last, the message content length is LEN_wifi_1, the sequence number of the nth pseudo keep-alive message is SEQ_wifi_n=(n-1th TCP keep-alive message sequence number) SEQ_wifi_n-1+(n-1th TCP keep-alive message content length) LEN_wifi_n-1, the content of the packet is filled according to the design agreement with the server, and its length LEN_wifi_n can be 0 or not 0.
[0063] In some embodiments, the WiFi keep-alive device is further configured to: send an ARP keep-alive message to the router at a second predetermined time interval, wherein the ARP keep-alive message includes at least the IP address of the host, the MAC address of the host, the IP address of the router gateway, and the MAC address of the router gateway. The WiFi keep-alive device is also configured to communicate with the router end, and the IP address of the host, the MAC address of the host, the IP address of the router gateway, and the MAC address of the router gateway constitute the information elements of the ARP keep-alive message. Further, these information elements can be configured by the host to the WiFi chip, or they can be parsed and extracted by the DHCP protocol integrated in the WiFi chip during the WiFi connection process. The WiFi keep-alive device is integrated in the WiFi chip, and can send and receive information through the connection between the WiFi chip and the router.
[0064] In some embodiments, the WiFi keep-alive device is further configured to: during the WiFi keep-alive process and when the host enters the awake state: stop sending the ARP keep-alive message to the router. When the host enters the awake state, the keep-alive process through the WiFi chip is stopped, and the host can send the ARP message.
[0065] In some embodiments, the target TCP connection is an encrypted TCP connection or an unencrypted TCP connection. The one or more target TCP connections may be encrypted TCP connections. For a TCP encrypted connection, that is, a TLS connection, the host needs to send the first packet of service data, and the WiFi chip will monitor the encrypted service data. Subsequent keep-alive data is sent by the WiFi chip, and the sequence number and TCP checksum are automatically updated.
[0066] According to an embodiment of the present application, there is also provided a WiFi chip, a host interface, which is configured to communicate with a host; and a WiFi keep-alive device as described above, which is configured to communicate with the host via the host interface. The WiFi chip according to an embodiment of the present application may also include a host interface, and the WiFi keep-alive device may be configured to communicate with the host via the host interface. In addition to the functions according to the various embodiments of the present application, the above-mentioned WiFi chip may also have general functions commonly possessed by existing WiFi chips, which are not described here. In a specific implementation, the above-mentioned WiFi chip can be obtained by, for example, integrating the various functions in the WiFi keep-alive device in the various embodiments of the present application with the functions of the existing WiFi chip, and adaptively modifying the interfaces, interaction protocols, etc. between the various devices and modules, which is not limited here.
[0067] In addition, although exemplary embodiments have been described herein, the scope includes any and all embodiments based on the present application with equivalent elements, modifications, omissions, combinations (e.g., solutions that cross various embodiments), adaptations or changes. Although several embodiments are listed and described for the wireless communication method and the wireless audio playback component, it should be noted that the method details involved in the description of the wireless audio playback component can also be incorporated into the various embodiments of the wireless communication method, and vice versa.
[0068] The elements in the claims are to be interpreted broadly based on the language employed in the claims and are not limited to the examples described in this specification or during the prosecution of the application, which examples are to be interpreted as non-exclusive. Therefore, the specification and examples are intended to be considered as examples only, with the true scope and spirit being indicated by the following claims and the full scope of their equivalents.
[0069] The order of each step in the present application is merely exemplary and not restrictive. Without affecting the implementation of the present application (without destroying the required logical relationship between the steps), the execution order of the steps can be adjusted, and the various embodiments obtained after the adjustment still fall within the scope of the present application.
[0070] The above description is intended to be illustrative rather than restrictive. For example, the above examples (or one or more of them) can be used in combination with each other. For example, a person of ordinary skill in the art can use other embodiments when reading the above description. In addition, in the above-mentioned specific embodiments, various features can be grouped together to simplify the application. This should not be interpreted as an intention that a disclosed feature that does not require protection is necessary for any claim. On the contrary, the subject matter of the present invention may be less than all the features of a specific disclosed embodiment. Thus, the following claims are incorporated into the specific embodiments as examples or embodiments, wherein each claim is independently used as a separate embodiment, and it is considered that these embodiments can be combined with each other in various combinations or arrangements. The scope of the present invention should be determined with reference to the attached claims and the full scope of equivalent forms granted by these claims.
Claims
1. A WiFi keep-alive method, characterized in that: WiFi chips and hosts used to communicate with each other, including: The WiFi chip performs the wake-up phase and the sleep phase alternately. When the WiFi chip switches from a sleep phase to a wake-up phase, obtaining a status of the host; When the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, a WiFi keep-alive process for the target TCP connection is performed, and the WiFi keep-alive process includes: Obtain corresponding TCP packet header information, the latest sequence number of the TCP message, and the corresponding message length of each target TCP connection by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process, as TCP message information associated with the target TCP connection; Incrementally process the latest sequence number of the TCP message in the TCP message information, and fill the content of the TCP message using the configuration information of the corresponding target TCP connection according to a preset rule, generate a TCP checksum according to the content of the filled TCP message, and modify the TCP header information accordingly according to the sequence number of the TCP message after the incremental process, use the modified TCP header information, the content of the filled TCP message, and the TCP checksum as WiFi keep-alive data, and assemble and generate a pseudo TCP message using the WiFi keep-alive data; updating the WiFi keep-alive data at a first predetermined time interval and sending a pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection; Receiving data from the TCP server; Response data of the TCP server to the pseudo TCP message is filtered out from the data received from the TCP server, and then sent to the host, so that the host is not awakened by the response data.
2. The WiFi keep-alive method according to claim 1, characterized in that: Also includes: The TCP / IP protocol is integrated in the WiFi chip, so that the TCP message information associated with the target TCP connection in the service data can be extracted by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process; and the pseudo TCP message generated based on the WiFi keep-alive data complies with the TCP / IP protocol and can pass the verification of the TCP server.
3. The WiFi keep-alive method according to claim 2, characterized in that: Also included is that, during the WiFi keep-alive process and when the host enters the awake state: Stop the WiFi keep-alive process for the TCP connection; The sequence number of the current pseudo TCP message corresponding to the target TCP connection and / or the total length of the data sent in the WiFi keep-alive process are obtained and sent to the host, so that the host can use it to send service data.
4. The WiFi keep-alive method according to claim 2, characterized in that: Also includes: In the case where there are multiple TCP connections between the host and the TCP server, the host generates the configuration information defining each target TCP connection for executing the WiFi keep-alive process, wherein the configuration information includes a host IP address, a host MAC address, a TCP server IP address, a TCP server port number, a router gateway IP address, and a router gateway MAC address corresponding to each target TCP connection; When the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, the WiFi keep-alive process is performed separately for each TCP connection, so that the WiFi keep-alive data is updated for each target TCP connection at its own first predetermined time interval and a pseudo TCP message generated based on the updated WiFi keep-alive data is sent to the TCP server corresponding to each target TCP connection.
5. The WiFi keep-alive method according to claim 1, characterized in that: The WiFi keep-alive process also includes: An ARP keep-alive message is sent to the router at a second predetermined time interval, wherein the ARP keep-alive message includes at least the IP address of the host, the MAC address of the host, the router gateway IP address, and the router gateway MAC address.
6. The WiFi keep-alive method according to claim 5, characterized in that: The IP address of the host, the MAC address of the host, the router gateway IP address and the router gateway MAC address are configured by the host to the WiFi chip, or are obtained by parsing the WiFi chip during the WiFi connection process.
7. The WiFi keep-alive method according to claim 5, characterized in that: During the WiFi keep-alive process and when the host enters the awake state: stop sending the ARP keep-alive message to the router.
8. The WiFi keep-alive method according to claim 1, characterized in that: The target TCP connection is an encrypted TCP connection or a non-encrypted TCP connection.
9. A WiFi keep-alive device, characterized in that: The WiFi keep-alive device communicates with the host via the host interface and is disposed on a WiFi chip that alternately executes a wake-up phase and a sleep phase. The WiFi keep-alive device is configured as follows: When the WiFi chip switches from a sleep phase to a wake-up phase, obtaining a status of the host; When the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, a WiFi keep-alive process for the target TCP connection is performed, and the WiFi keep-alive process includes: Obtain corresponding TCP packet header information, the latest sequence number of the TCP message, and the corresponding message length of each target TCP connection by parsing the service data previously sent by the host based on the configuration information associated with the host and the WiFi keep-alive process, as TCP message information associated with the target TCP connection; Incrementally process the latest sequence number of the TCP message in the TCP message information, and fill the content of the TCP message using the configuration information of the corresponding target TCP connection according to a preset rule, generate a TCP checksum according to the content of the filled TCP message, and modify the TCP header information accordingly according to the sequence number of the TCP message after the incremental process, use the modified TCP header information, the content of the filled TCP message, and the TCP checksum as WiFi keep-alive data, and assemble and generate a pseudo TCP message using the WiFi keep-alive data; updating the WiFi keep-alive data at a first predetermined time interval and sending a pseudo TCP message generated based on the updated WiFi keep-alive data to the TCP server corresponding to the target TCP connection; Receiving data from the TCP server; Response data of the TCP server to the pseudo TCP message is filtered out from the data received from the TCP server, and then sent to the host, so that the host is not awakened by the response data.
10. The WiFi keep-alive device according to claim 9, characterized in that: The WiFi chip is integrated with a TCP / IP protocol module, and the TCP / IP protocol module is configured as follows: Parsing the service data previously sent by the host based on the configuration information associated with the WiFi keep-alive process of the host to extract TCP message information associated with the target TCP connection in the service data; as well as, Based on the WiFi keep-alive data obtained via the WiFi keep-alive device, a pseudo TCP message corresponding to the target TCP connection is generated, wherein the pseudo TCP message complies with the TCP / IP protocol and can pass the verification of the TCP server.
11. The WiFi keep-alive device according to claim 10, characterized in that: The WiFi keep-alive device is further configured to, during the WiFi keep-alive process and when the host enters a wake-up state: Stop the WiFi keep-alive process for the TCP connection; The sequence number of the current pseudo TCP message corresponding to the target TCP connection and / or the total length of the data sent in the WiFi keep-alive process are obtained from the TCP / IP protocol module and sent to the host, so that the host can use it to send service data.
12. The WiFi keep-alive device according to claim 10, characterized in that: In the case where there are multiple TCP connections between the host and the TCP server, the host generates the configuration information defining each target TCP connection for executing the WiFi keep-alive process, the configuration information includes the host IP address, host MAC address, TCP server IP address, TCP server port number, router gateway IP address and router gateway MAC address corresponding to each target TCP connection, and the WiFi keep-alive device is further configured as follows: When the WiFi chip switches from the sleep stage to the wake-up stage and the host enters the sleep state, the WiFi keep-alive process is performed separately for each TCP connection, so that the WiFi keep-alive data is updated for each target TCP connection at its own first predetermined time interval and a pseudo TCP message generated based on the updated WiFi keep-alive data is sent to the TCP server corresponding to each target TCP connection.
13. The WiFi keep-alive device according to claim 9, characterized in that: The WiFi keep-alive device is further configured to: An ARP keep-alive message is sent to the router at a second predetermined time interval, wherein the ARP keep-alive message includes at least the IP address of the host, the MAC address of the host, the router gateway IP address, and the router gateway MAC address.
14. The WiFi keep-alive device according to claim 13, characterized in that: The IP address of the host, the MAC address of the host, the router gateway IP address and the router gateway MAC address are configured by the host to the WiFi chip via the host interface, or are obtained by parsing the service data sent by the host to the WiFi chip via the host interface.
15. The WiFi keep-alive device according to claim 13, characterized in that: The WiFi keep-alive device is further configured to: During the WiFi keep-alive process and when the host enters the awake state: stop sending the ARP keep-alive message to the router.
16. The WiFi keep-alive device according to claim 9, characterized in that: The target TCP connection is an encrypted TCP connection or a non-encrypted TCP connection.
17. A WiFi chip, characterized in that: include: a host interface configured to communicate with a host; as well as The WiFi keep-alive device according to any one of claims 9 to 16, configured to communicate with the host via the host interface.
