Method for establishing communication connection, and electronic device, chip system and storage medium

By pushing long-connection management down to the communication chip layer, with the communication chip acting as a proxy for the connection between the application processor and the server, the problem of high device power consumption is solved, resulting in lower power consumption and more stable long-connection management.

WO2026036902A1PCT designated stage Publication Date: 2026-02-19HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2025/102182
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-08-13
Filing Date
2025-06-19
Publication Date
2026-02-19

AI Technical Summary

Technical Problem

In existing technologies, the application processor and communication chip of the client device jointly participate in long connection management, resulting in high device power consumption.

Method used

By moving long-term connection management from the application processor layer to the communication chip layer, the communication chip acts as an intermediary between the application processor and the server, directly establishing and maintaining long-term connections with the server, thus reducing the involvement of the application processor.

Benefits of technology

It reduces device power consumption, especially during the establishment, termination, and heartbeat message sending of long connections, thereby reducing the number of application processor wake-ups and improving the stability of long connections and push services.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025102182_19022026_PF_FP_ABST
    Figure CN2025102182_19022026_PF_FP_ABST
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are a method for establishing a communication connection, and an electronic device, a chip system and a storage medium. The method is applied to an electronic device comprising an application processor (AP) and a first communication chip. The method comprises: an AP sending a connection proxy request to a first communication chip, wherein the connection proxy request is used for instructing the first communication chip to proxy a communication connection between the AP and a server for a push service; in response to the connection proxy request, the first communication chip using a first network supported by the first communication chip to establish a first communication connection with the server; and if the first communication connection is disconnected, the first communication chip using the first network to re-establish the first communication connection with the server. In the embodiments of the present application, allowing a communication chip to proxy a long connection, offloading the long connection from an AP layer to a communication chip layer, and managing the long connection by the communication chip reduce the power consumption of devices.
Need to check novelty before this filing date? Find Prior Art

Description

Method for establishing communication connection, electronic device, chip system and storage medium

[0001] The present application claims priority from the Chinese patent application No. 202411109298.X filed on August 13, 2024, and entitled "Method for establishing communication connection, electronic device, chip system and storage medium", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0002] The present application relates to the technical field of terminals, and in particular to a method for establishing a communication connection, an electronic device, a chip system and a storage medium. BACKGROUND

[0003] In a push service, when a server needs to push a message to a client device, the server can send the message to the client device through a long connection. The long connection is a communication connection between the server and the client device that is maintained for a long time. After the client device establishes a communication connection with the server, the client device can maintain the availability of the communication connection for a long time by periodically sending a heartbeat message to the server.

[0004] Currently, the application processor (AP) of the client device is responsible for the management of the long connection. Specifically, when a long connection is detected to be abnormally disconnected (for example, a weak network timeout), or when the long connection is disconnected due to no network and the network is perceived to be recovered, the AP needs to be woken up, and the AP re-establishes the long connection with the server through the communication chip.

[0005] The management of the long connection requires the participation of two different functional hardware architectures of the AP and the communication chip, resulting in high power consumption of the device. SUMMARY

[0006] The present application provides a method for establishing a communication connection, an electronic device, a chip system and a computer-readable storage medium, which can solve the problem of high power consumption of the device.

[0007] In a first aspect, an embodiment of the present application provides a method for establishing a communication connection, applied to an electronic device, the electronic device comprising an application processor and a first communication chip. In the method, the application processor sends a connection proxy request to the first communication chip, the connection proxy request being used to instruct the first communication chip to proxy a communication connection between the application processor and a server of a push service; the first communication chip establishes a first communication connection with the server using a first network supported by the first communication chip in response to the connection proxy request; and if the first communication connection is disconnected, the first communication chip re-establishes the first communication connection with the server using the first network.

[0008] The embodiment of the application makes the communication chip establish a communication connection with the server directly, without the participation of the application processor, thereby reducing the power consumption of the device. When it is necessary to reestablish a long connection (for example, the long connection is disconnected abnormally after the network is disconnected or the network is recovered), the communication chip can also directly reestablish a communication connection with the server, without waking up the AP, thereby reducing the power consumption of the device. That is, by sinking the long connection from the AP layer to the communication chip layer and managing the long connection by the communication chip, the main power consumption of the long connection management is the power consumption of the communication chip, thereby reducing the power consumption of the device.

[0009] In some possible implementation manners of the first aspect, the electronic device further includes a second communication chip; the first communication chip communicates with the server using the first communication connection, that is, the first communication connection carries the push service, and the second communication chip does not establish a communication connection with the server. At this time, if the first communication chip predicts that the first communication connection will enter a weak network environment in a first time period in the future, the first communication chip can send first synchronization information to the second communication chip, the first synchronization information being used to instruct the second communication chip to establish a communication connection with the server. In response to the first synchronization information, the second communication chip establishes a second communication connection with the server using a second network, the second network being a network supported by the second communication chip, and the establishment time of the second communication connection being earlier than the disconnection time of the first communication connection; and the second communication chip communicates with the server using the second communication connection to switch the communication connection carrying the push service from the first communication connection to the second communication connection when the first communication connection is disconnected or in a second time period before the first communication connection is disconnected.

[0010] In this implementation manner, through the signal synchronization between the first communication chip and the second communication chip, the first communication chip can notify the second communication chip to establish a second communication connection with the server in advance when it is about to enter a weak network environment, instead of establishing the second communication connection with the server after the first communication connection is disconnected, thereby more smoothly switching the push service from the first communication connection to the second communication connection.

[0011] In some possible implementation manners of the first aspect, the electronic device further includes a second communication chip; the first communication chip communicates with the server using the first communication connection, that is, the first communication connection is a communication connection carrying the push service, and the second communication chip does not establish a communication connection with the server. At this time, the second communication chip accesses the second network, and after determining that the network quality of the second network reaches the target quality, establishes a second communication connection with the server using the second network, sends second synchronization information to the first communication chip, the second synchronization information is used to instruct the first communication chip to release the first communication connection, and the second network is a network supported by the second communication chip; the first communication chip releases the first communication connection in response to the second synchronization information; and the second communication chip communicates with the server using the second communication connection, to switch the communication connection carrying the push service from the first communication connection to the second communication connection. That is, the push service is switched from the first communication connection to the second communication connection after the network connection is stable.

[0012] In this implementation manner, through signal synchronization between the first communication chip and the second communication chip, the second communication chip can notify the first communication chip to release the first communication connection and switch the push service from the first communication connection to the second communication connection after the network quality of the second network is good (that is, the second network is stable) and the second communication chip can provide stable long connection service. In this way, device power consumption can be further reduced, and the stability of the push service can be improved by avoiding packet loss of the push service caused by unstable network.

[0013] In some possible implementation manners of the first aspect, after establishing the first communication connection, the first communication chip sends a heartbeat message to the server through the first communication connection according to the heartbeat timer and the timeout timer, to maintain the first communication connection. In this way, only the first communication chip is woken up at the time point of sending the heartbeat message, and the first communication chip directly sends the heartbeat message to the server, without waking up the AP, to further reduce device power consumption.

[0014] In some possible implementation manners of the first aspect, in the process in which the first communication chip maintains the first communication connection through the heartbeat message, the first communication chip can determine the time point of sending the heartbeat message through the heartbeat period of the heartbeat timer; the first communication chip sends the heartbeat message to the server through the first communication connection at the time point; and after sending the heartbeat message, the first communication chip determines that the first communication connection is valid if an acknowledgement message is received within a timeout threshold of the timeout timer, the acknowledgement message being a message returned by the server for the heartbeat message.

[0015] In the implementation, after the long connection is sunk from the AP layer to the communication chip layer, the heartbeat timer and the service timeout timer are not affected by the unified control and alignment of the operating system on the AP, and the heartbeat timer and the service timeout timer can work according to various set periods, thereby improving the stability of the long connection.

[0016] In some possible implementation of the first aspect, after determining the time point for sending the heartbeat message, if the first communication chip receives a push message from the server through the first communication connection before the time point arrives, the time point for sending the heartbeat message is re-determined according to the reception time point of the push message and the heartbeat period, and the re-determined time point is later than the previously determined time point.

[0017] In the implementation, after the long connection is sunk from the AP layer to the communication chip layer, the heartbeat timer and the service timeout timer are not affected by the unified control and alignment of the operating system on the AP. In this way, after receiving the push message from the server, the heartbeat timer can be postponed to the next period, reducing the number of sending heartbeat messages and further reducing the device power consumption.

[0018] In some possible implementation of the first aspect, the first communication chip transmits the push message to the application processor, the application processor processes the push message to obtain a processing result, and transmits the processing result to the target communication chip, and the first communication chip sends a reply message to the server through the first communication connection according to the processing result. In this way, the long connection is sunk from the AP layer to the communication chip layer, and the processing of the push message and the wake-up of the system can be completed in the communication chip layer, further reducing the device power consumption.

[0019] In some possible implementation of the first aspect, after the cellular chip sends uplink data to the server, the cellular chip can further determine whether a release condition is met, and release the RRC connection if the release condition is met. The cellular chip is the first communication chip or the second communication chip.

[0020] In the implementation, by sinking the long connection from the AP layer to the communication chip layer, the communication chip can quickly release the RRC connection after sending uplink data, reducing the duration of holding the RRC connection, and further reducing the device power consumption.

[0021] In some possible implementation of the first aspect, in the process of determining whether the release condition is met, if there are multiple data radio bearers in a packet data convergence protocol (PDCP), the cellular chip determines that the release condition is not met; if there is only push service in the PDCP, it is determined that the release condition is met; if the network card of the application processor is in an inactive state, or there is a network card in an active state in the network card of the application processor and the application processor is in a sleep state, the cellular chip determines that the release condition is met.

[0022] In some possible implementation ways of the first aspect, in the process of releasing the RRC connection by the cellular chip, the cellular chip determines whether there is data transmission of the PDCP within a preset time period; if there is no data transmission of the PDCP within the preset time period, the cellular chip releases the RRC connection.

[0023] In the second aspect, the embodiments of the present application provide an electronic device, comprising an application processor and a first communication chip:

[0024] The application processor is configured to: send a connection proxy request to the first communication chip, the connection proxy request being used to instruct the first communication chip to proxy a communication connection between the application processor and a server of a push service;

[0025] The first communication chip is configured to: in response to the connection proxy request, establish a first communication connection with the server using a first network supported by the first communication chip; and if the first communication connection is disconnected, reestablish the first communication connection with the server using the first network.

[0026] In some possible implementation ways of the second aspect, the electronic device further comprises a second communication chip; the first communication chip communicates with the server using the first communication connection, and the second communication chip does not establish a communication connection with the server.

[0027] The first communication chip is configured to: if it is predicted that the first communication connection will enter a weak network environment within a first time period in the future, send first synchronization information to the second communication chip, the first synchronization information being used to instruct the second communication chip to establish a communication connection with the server.

[0028] The second communication chip is configured to: in response to the first synchronization information, establish a second communication connection with the server using a second network, the second network being a network supported by the second communication chip, and the second communication connection being established earlier than the disconnection time of the first communication connection; and when the first communication connection is disconnected or within a second time period before the first communication connection is disconnected, communicate with the server using the second communication connection, so as to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0029] In some possible implementation ways of the second aspect, the electronic device further comprises a second communication chip; the first communication connection is a communication connection carrying the push service, that is, the first communication chip communicates with the server using the first communication connection; and the second communication chip does not establish a communication connection with the server.

[0030] The second communication chip is configured to: after accessing the second network and determining that network quality of the second network reaches a target quality, establish a second communication connection with the server using the second network, and send second synchronization information to the first communication chip, the second synchronization information being used to instruct the first communication chip to release the first communication connection, and the second network being a network supported by the second communication chip.

[0031] The first communication chip is configured to: in response to the second synchronization information, release the first communication connection.

[0032] The second communication chip is further configured to: communicate with the server using the second communication connection, so as to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0033] In some possible implementation manners of the second aspect, after the first communication connection is established, the first communication chip is further configured to: according to the heartbeat timer and the timeout timer, send a heartbeat message to the server through the first communication connection, so as to maintain the first communication connection.

[0034] In some possible implementation manners of the second aspect, the first communication chip is further configured to: determine a time point for sending the heartbeat message through a heartbeat period of the heartbeat timer; when the time point arrives, send the heartbeat message to the server through the first communication connection; and after the heartbeat message is sent, if an acknowledgement message is received within a timeout threshold of the timeout timer, determine that the first communication connection is valid, the acknowledgement message being a message returned by the server in response to the heartbeat message.

[0035] In some possible implementation manners of the second aspect, the first communication chip is further configured to: if a push message of the server is received through the first communication connection before the time point arrives, re-determine the time point for sending the heartbeat message according to a receiving time point of the push message and the heartbeat period, the re-determined time point being later than the previously determined time point.

[0036] In some possible implementation manners of the second aspect, the first communication chip is further configured to: transmit the push message to an application processor; the application processor is configured to: process the push message, obtain a processing result, and transmit the processing result to the first communication chip; and the first communication chip is further configured to: according to the processing result, send a reply message to the server through the first communication connection.

[0037] In some possible implementation manners of the second aspect, after the cellular chip sends uplink data to the server, the cellular chip is further configured to: determine whether a release condition is met; and if the release condition is met, release the RRC connection; and the cellular chip is the first communication chip or the second communication chip.

[0038] In some possible implementation manners of the second aspect, the cellular chip is specifically configured to: determine that the release condition is not met if there are multiple data radio bearers of a packet data convergence protocol (PDCP); determine that the release condition is met if there is only push service of the PDCP; and determine that the release condition is met if a network card of the application processor is in an inactive state or the network card of the application processor has a network card in an active state and the application processor is in a sleep state.

[0039] In some possible implementation manners of the second aspect, the cellular chip is specifically configured to: determine whether there is data transmission of the PDCP within a preset time period; and release the RRC connection if there is no data transmission of the PDCP within the preset time period.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method in any one of the above first aspect when executing the computer program.

[0041] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, and the computer readable storage medium stores a computer program, and the computer program is executable on a processor to implement the method in any one of the above first aspect.

[0042] In a fifth aspect, an embodiment of the present application provides a chip system, and the chip system includes a processor, the processor is coupled with a memory, and the processor executes a computer program stored in the memory to implement the method in any one of the above first aspect. The chip system can be a single chip or a chip module composed of multiple chips.

[0043] In a sixth aspect, an embodiment of the present application provides a computer program product, and when the computer program product is executed on an electronic device, the electronic device executes the method in any one of the above first aspect.

[0044] It can be understood that the beneficial effects of the above second aspect to sixth aspect can be referred to the related description in the above first aspect, and will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0045] FIG. 1 is a schematic diagram of a message push process in an instant messaging service scenario according to an embodiment of the present application;

[0046] FIG. 2 is a schematic diagram of a push service scenario according to an embodiment of the present application;

[0047] FIG. 3 is a schematic diagram of the structure of an electronic device 300 according to an embodiment of the present application;

[0048] FIG. 4 is a schematic block diagram of a system architecture according to an embodiment of the present application;

[0049] FIG. 5 is a process diagram of a communication chip proxying a long connection according to an embodiment of the present application;

[0050] FIG. 6 is a process diagram of processing a heartbeat message and a push message according to an embodiment of the present application;

[0051] FIG. 7 is a process diagram of a connection switching according to an embodiment of the present application;

[0052] FIG. 8 is a process diagram of a connection switching according to an embodiment of the present application;

[0053] FIG. 9 is a system architecture diagram of a push service according to an embodiment of the present application;

[0054] FIG. 10 is a process diagram of a RRC fast release according to an embodiment of the present application;

[0055] FIG. 11 is a structure diagram of an electronic device 300 according to an embodiment of the present application. DETAILED DESCRIPTION

[0056] In the following description, specific details are set forth in order to provide a thorough understanding of embodiments of the application. However, persons having ordinary skill in the art will readily recognize that embodiments of the application can be practiced without

[0057] Referring to FIG. 1, a diagram of a message push process in an instant messaging scenario according to an embodiment of the present application is shown. The instant messaging service scenario can include a mobile phone 11, a mobile phone 12, a server 13, and a push cloud 14.

[0058] The mobile phone 11 and the mobile phone 12 both have an instant messaging application installed. The server 13 is a server of the instant messaging application. The push cloud 14 is a cloud for implementing a push service, which can be embodied as a push server.

[0059] The mobile phone 12 is in a screen-off state and has accessed a cellular network or a Wi-Fi network. The mobile phone 12 has started a push function of the instant messaging application and has established a long connection with the push cloud 14. The long connection can be a connection established using the cellular network or a connection established using the Wi-Fi network.

[0060] The mobile phone 11 displays a chat interface 111 of an instant messaging application, i.e., the user is using the instant messaging application of the mobile phone 11. When the user sends a chat message including chat content 112 to the mobile phone 12 using the instant messaging application of the mobile phone 11, the mobile phone 11 sends the chat message to the server 13 according to the chat content 112. The server 13 sends the chat message to the push cloud 14. The push cloud 14 pushes the chat message to the mobile phone 12 through the long connection. After the mobile phone 12 receives the chat message, the mobile phone 12 displays a message notification 122 on the lock screen interface 121. The user can click the message notification 122 on the lock screen interface 121 to pull up the instant messaging application to display the chat message. In this way, the message is pushed through the long connection, and even if the instant messaging application on the mobile phone 12 is in a closed state, the chat message sent by the mobile phone 11 can be received and displayed on the screen.

[0061] The push service can be applied to other scenarios in addition to the instant messaging scenario. For example, for a news information application program, the server can push news information to the mobile phone through the long connection; for an e-commerce application program, the server can push order status and preferential information to the mobile phone through the long connection.

[0062] In the related art, the AP of the client device is responsible for the processes of connection establishment of the long connection, re-connection when the network is recovered, re-connection when the connection is abnormally disconnected, and periodic sending of the heartbeat message.

[0063] Exemplarily, referring to a push service scenario diagram provided by an embodiment of the application shown in FIG. 2, a client device 21 includes an application processor 211, a notification management service 213, and an application program (Application, App) 212. The client device 21 is a device installed with a client (i.e., the application program 212), and a server 23 is a server of the application program 212. The application program 212 can perform service interaction with the server 23 through a network. The client device 21 can be a mobile phone or a tablet computer.

[0064] The application processor 211 includes a push service capability (Push Service Ability, Push SA). The push service capability is a push service framework and can provide a push service (Push Service). The push service is used for long connection management and implementation of long connection related services.

[0065] As shown in FIG. 1, when the push service in the application processor 211 detects that the network is available, the push service uses the network to establish a socket long connection with the push cloud 22. Specifically, the push service can detect whether the network is available through a communication chip (not shown in the figure). For example, when the communication chip is a cellular chip, the push service can detect whether the cellular network is available through the cellular chip, and when it is detected that the cellular network is available, the push service uses the cellular network to establish a long connection with the push cloud 22.

[0066] After the long connection is established, the push service periodically sends a heartbeat message to the push cloud 22 through the long connection according to a set heartbeat period, to maintain the availability of the long connection. After receiving the heartbeat message, the push cloud 22 returns an acknowledgement message to the client device 21 in response to the heartbeat message, to notify the client device 21 that the heartbeat message has been received.

[0067] In which, after the long connection is established, the application processor 211 can enter a sleep state or a low-power state when it is not necessary to send a heartbeat message, to reduce the power consumption of the device; and when it is necessary to send a heartbeat message, the application processor 211 is woken up, and the push service in the application processor 211 sends the heartbeat message through the communication chip.

[0068] When the server 23 needs to push a message to the client device 21, the server 23 calls a message sending interface of the push cloud 22, to send the message to the client device 21. The push cloud 22 sends a downlink message to the client device 21 through the long connection according to the message that the server 23 needs to send.

[0069] After the push service in the client device 21 receives the downlink message through the long connection, the push service processes the downlink message. If the downlink message is a background message, the push service pulls up the application program 212, and transmits the downlink message to the application program 212, to enable the application program 212 to process the downlink message. If the downlink message is a notification message, the push service calls an interface of the notification management service 213, to display the downlink message on the notification bar. The user can pull up the application program 212 by clicking the notification message.

[0070] After the long connection is established, when there is no network signal, the long connection will be disconnected due to the absence of the network. At this time, when it is detected that the network is restored, the application processor 211 is woken up, and the push service in the application processor 211 re-establishes the long connection with the push cloud 22 through the communication chip.

[0071] After the long connection is established, the long connection can be abnormally disconnected. For example, when a weak network timeout or a Network Address Translation (NAT) expiration occurs, the long connection is disconnected. The weak network timeout can refer to that after a heartbeat message is sent, no acknowledgement message is received within a specified time. The long connection is considered to be disconnected when no acknowledgement message is received within the specified time. At this time, when the long connection is detected to be abnormally disconnected, the application processor 211 is woken up, and the push service of the application processor 211 reestablishes the long connection with the push cloud 22 through the communication chip.

[0072] After the long connection is established, if it is needed to exit (i.e., actively disconnect) the long connection, the application processor 211 is woken up, and the push server of the application processor 211 disconnects the long connection between the push cloud 22 through the communication chip. In the process of establishing the long connection, the AP and the communication chip need to participate together, and the generated power consumption includes the power consumption of the AP and the power consumption of the communication chip, and the device power consumption is high. In the process of reestablishing the network recovery or abnormal disconnection, the exit process of the long connection, and the periodic sending process of the heartbeat message, the AP needs to be woken up, and the AP implements the corresponding process through the communication chip, and the device power consumption is high.

[0073] In view of the problem of high device power consumption caused by the AP managing the long connection mentioned above, the embodiment of the application sinks the long connection from the AP layer to the communication chip layer by letting the communication chip proxy the long connection, and loads the management of the long connection by the communication chip layer. In this way, only the communication chip needs to participate in the process of establishing the long connection, and the AP does not need to participate, and the generated power consumption is mainly the power consumption of the communication chip, thereby reducing the device power consumption; in the process of reestablishing the long connection (such as network recovery or abnormal disconnection) and actively disconnecting the long connection, the AP does not need to be woken up, but the long connection is directly reestablished and actively disconnected by the communication chip, thereby reducing the device power consumption.

[0074] The technical scheme provided by the embodiment of the application can be applied to electronic devices such as mobile phones, tablet computers, car machine devices, notebook computers, and wearable devices, and the specific type and specific structure of the electronic device are not limited here.

[0075] Exemplarily, FIG. 3 shows a structural schematic diagram of an electronic device 300. The electronic device 300 can include but is not limited to a processor 310, a memory 320, a mobile communication module 330, and a wireless communication module 340, and the like.

[0076] The structure illustrated by the embodiments of the present application does not constitute a specific limitation on the electronic device 300. In some other embodiments of the present application, the electronic device 300 can include more or fewer components than those illustrated, or combine certain components, or split certain components, or different arrangement of components. The illustrated components can be implemented in hardware, software, or a combination of software and hardware. For example, when the electronic device 300 is specifically a mobile phone, it can further include an audio module, a microphone, a display screen, a universal serial bus (USB) interface, a charging management module, a power management module, a camera, a battery, a loudspeaker, a receiver, an earphone interface, a sensor, a key, a motor, an indicator, and a subscriber identification module (SIM) card interface, etc.

[0077] The processor 310 can include one or more processing units, for example: the processor 310 can include an application processor (AP) and a controller, etc. Different processing units can be independent devices, or can be integrated in one or more processors. The controller can generate operation control signals according to instruction operation codes and timing signals, complete the control of fetching instructions and executing instructions.

[0078] The memory 320 can be used to store computer executable program codes, and the executable program codes include instructions. The memory 320 can include a program storage area and a data storage area. The program storage area can store an operating system, at least one application program required by a function (such as an image playing function, etc.), etc. The data storage area can store data created during the use of the electronic device 300. In addition, the memory 320 can include a high-speed random access memory, and can also include a non-volatile memory, for example, at least one magnetic disk storage device, a flash memory device, a universal flash memory (UFS), etc. The processor 310 executes various function applications and data processing of the electronic device 300 by running the instructions stored in the memory 320 and / or the instructions stored in the memory arranged in the processor.

[0079] The wireless communication function of the electronic device 300 can be realized by the antenna 1, the antenna 2, the mobile communication module 330, the wireless communication module 340, the modem, and the baseband processor, etc.

[0080] The antenna 1 and the antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in the electronic device 300 can be used to cover a single or multiple communication frequency bands. Different antennas can also be multiplexed to improve the utilization rate of the antennas. For example: the antenna 1 can be multiplexed as a diversity antenna of a wireless local area network. In some other embodiments, the antenna can be used in combination with a tuning switch.

[0081] The mobile communication module 330 can provide a solution for wireless communication including 2G / 3G / 4G / 5G, etc. applied to the electronic device 300. The mobile communication module 330 can include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 330 can receive an electromagnetic wave by the antenna 1, and perform filtering, amplification, etc. on the received electromagnetic wave, and transfer the processed signal to the modem for demodulation. The mobile communication module 330 can also amplify a signal modulated by the modem, and radiate the signal as an electromagnetic wave through the antenna 1. In some embodiments, at least part of the functional modules of the mobile communication module 330 can be disposed in the processor 310. In some embodiments, at least part of the functional modules of the mobile communication module 330 can be disposed in the same device as at least part of the modules of the processor 310.

[0082] The modem can include a modulator and a demodulator. The modulator is configured to modulate a low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is configured to demodulate a received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low-frequency baseband signal processed by the baseband processor is transmitted to the application processor. In some embodiments, the modem can be a separate device. In other embodiments, the modem can be independent of the processor 310, and disposed in the same device as the mobile communication module 330 or other functional modules.

[0083] The wireless communication module 340 can provide a solution for wireless communication including wireless local area networks (WLAN) (e.g., wireless fidelity (Wi-Fi) network), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR) technology, etc. applied to the electronic device 300. The wireless communication module 340 can be one or more devices integrated with at least one communication processing module. The wireless communication module 340 receives an electromagnetic wave via the antenna 2, performs frequency modulation and filtering on the electromagnetic wave signal, and transmits the processed signal to the processor 310. The wireless communication module 340 can also receive a signal to be transmitted from the processor 310, perform frequency modulation and amplification, and radiate the signal as an electromagnetic wave through the antenna 2.

[0084] In some embodiments, the antenna 1 and the mobile communication module 330 of the electronic device 300 are coupled, and the antenna 2 and the wireless communication module 340 are coupled, so that the electronic device 300 can communicate with a network and other devices through wireless communication technology. The wireless communication technology can include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology, etc. The GNSS can include global positioning system (GPS), global navigation satellite system (GLONASS), beidou navigation satellite system (BDS), quasi-zenith satellite system (QZSS), and / or satellite based augmentation systems (SBAS).

[0085] It should be noted that the electronic device 300 can simultaneously include the mobile communication module 330 and the wireless communication module 340, or can only include one of the mobile communication module 330 and the wireless communication module 340.

[0086] After the hardware architecture of the electronic device 300 is exemplarily introduced, the software architecture of the electronic device 300 is exemplarily introduced below.

[0087] The software system of the electronic device 300 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Embodiments of the present application take a layered architecture system as an example to exemplarily illustrate the software structure of the electronic device 300.

[0088] Referring to FIG. 4, a system architecture provided by an embodiment of the present application is shown in a schematic block diagram. The system architecture includes an electronic device 300 and a cloud. The cloud can include a push server.

[0089] A layered architecture divides software into several layers, each of which has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, as shown in FIG. 4, the software system is divided into four layers, from top to bottom, the application layer, the framework and system service layer, the kernel and driver layer, and the chip layer.

[0090] The application layer can include a series of application packages. Exemplarily, the application packages can include camera, gallery, calendar, call, map, music, video, and short message applications.

[0091] The software system of the electronic device 300 can be an Android operating system, a Harmony operating system, or an IOS operating system. When the software system of the electronic device 300 is an Android operating system, the application of the application layer can be an Android application; when the software system of the electronic device 300 is a Harmony operating system, the application of the application layer can be a Harmony application.

[0092] In the push service, the application can apply for a push token to the cloud. The push token is used for push messages. For example, when the push server needs to push a message to the application of the electronic device 300, it can carry the push token in the message to indicate that the message is sent to the application of the electronic device 300.

[0093] Exemplarily, the application can be an instant messaging application (such as a chat application), a news information application, or an e-commerce application.

[0094] The framework and system service layer can provide system services, and provide application programming interfaces (APIs) and programming frameworks for the applications of the application layer.

[0095] As shown in FIG. 4, the framework and system service layer can include a push service, an MLPS service, and a modem engine. The push service can include connection management, a Wi-Fi connection agent, and a cellular connection agent.

[0096] The push service is used to manage the push long connection, and can determine the number of long connections and the used communication chip according to the device condition and the network condition. For example, the push service can determine whether to use a Wi-Fi chip or a cellular chip to establish a long connection according to the device condition and the network condition; and can also determine whether to use the Wi-Fi chip and the cellular chip to establish long connections respectively, or to use only one of the chips to establish a long connection.

[0097] The Wi-Fi connection proxy is a proxy of the long connection established by using the Wi-Fi chip; and the cellular connection proxy is a proxy of the long connection established by using the cellular chip.

[0098] The MLPS service is an interface component provided by the Wi-Fi chip to the application program, and is used to provide a message transmission channel between the push service and the second push proxy. The MLPS service can be unaware of the specific business of the push proxy.

[0099] The modem engine is an interface component provided by the cellular chip to the application program, and is used to provide a message transmission channel between the push service and the first push proxy. The modem engine can be unaware of the specific business of the push proxy.

[0100] The chip layer can include a Wi-Fi chip and a cellular chip. The cellular chip includes the first push proxy, and the Wi-Fi chip includes the second push proxy.

[0101] The first push proxy is a push proxy module of the cellular chip, and is used to manage the life cycle of the long connection established by using the cellular network. The life cycle can include processes such as connection of the long connection, exit of the long connection, recovery of the long connection, and reestablishment of the long connection. The connection can refer to the process of initially establishing the long connection; the recovery can refer to the process of reestablishing the long connection with the server when the long connection is detected to be abnormally disconnected; and the reestablishment can refer to the process of reestablishing the long connection with the server when the network is detected to be recovered. The exit can refer to actively disconnecting the long connection.

[0102] The second push proxy is a push proxy module of the Wi-Fi chip, and is used to manage the life cycle of the long connection established by using the Wi-Fi network.

[0103] The kernel and the driver layer can include Inter-Process Communication (IPC), Shared Memory (SHMEM), and HiSilicon Message Interface (HISI Message Interface). The MLPS service communicates with the Wi-Fi chip through the IPC / SHMEM; and the modem engine communicates with the cellular chip through the HISI Message Interface.

[0104] The cloud-based push server can provide an interface for sending messages and distribute messages to the corresponding terminals of the push service through the end-to-cloud channel.

[0105] It should be noted that the software system architecture of the electronic device 300 shown in Figure 4 is merely an example. In other embodiments, the chip layer in Figure 4 may include only one chip, for example, only a Wi-Fi chip or a cellular chip; it may also include multiple chips, and the types of chips included may be chips other than Wi-Fi chips and cellular chips. When the electronic device 300 includes other types of chips, related modules such as Wi-Fi connection proxy, cellular connection proxy, MLPS service, and modem engine can be changed accordingly, without limitation here.

[0106] The push service is set up on the AP. By setting up push agents on the Wi-Fi chip and cellular chip, the Wi-Fi chip and cellular chip can act as agents for long connections. This pushes the management of long connections down from the AP layer to the communication chip layer, reducing the power consumption of electronic devices 300.

[0107] Optionally, the cellular chip and the Wi-Fi chip can also synchronize signals, so that the cellular chip and the Wi-Fi chip can sense the network situation with each other and manage the long connection based on the sensed network situation.

[0108] For example, electronic device 300 is using a Wi-Fi network to carry out push services. That is, it uses a cellular network supported by the Wi-Fi chip to establish a long-term connection with the server, and uses this long-term connection to carry out push services. When the Wi-Fi chip detects that it is about to leave the Wi-Fi network's coverage area, meaning the long-term connection established using the Wi-Fi network is about to be disconnected, it can notify the cellular chip by sending a synchronization signal to inform it to establish a long-term connection with the server using the cellular network in advance. Once the long-term connection established using the Wi-Fi network is disconnected, or for a period of time before it is disconnected, the push service is switched to the long-term connection established using the cellular network. This avoids waiting until the long-term connection established using the Wi-Fi network is disconnected before establishing a communication connection with the cellular chip, making the switching of communication connections for carrying push services smoother.

[0109] For example, the electronic device 300 is using a long connection established by the cellular chip to carry push service with a server; at this time, the electronic device 300 accesses a Wi-Fi network through the Wi-Fi chip and establishes a long connection with the server using the Wi-Fi network. The Wi-Fi chip can notify the cellular chip to release the long connection after detecting that the Wi-Fi network is stable, or that the Wi-Fi network is stable and the long connection established using the Wi-Fi network is stable, and then switch the push service to the long connection established using the Wi-Fi network. In this way, the push service can be switched after waiting for the Wi-Fi chip network to be stable, avoiding packet loss caused by unstable network and thus failing to implement the push service.

[0110] The following takes the electronic device 300 as an example to exemplarily introduce the technical solutions provided by the embodiments of the present application.

[0111] Please refer to FIG. 5, which is a process diagram of the communication chip proxying a long connection provided by the embodiments of the present application. The process can include but is not limited to the following steps:

[0112] Step S501, the application processor sends a connection proxy request to the first communication chip.

[0113] The application processor and the first communication chip are devices or modules in the electronic device 300. The first communication chip can be a Wi-Fi chip, a cellular chip, or other types of communication chips, which are not limited here.

[0114] The connection proxy request is used to instruct the first communication chip to proxy the communication connection between the application processor and the server of the push service. The server of the push service can be, for example, a push server or a push cloud in the cloud. That is, the connection proxy request is used to instruct the first communication chip to proxy the long connection.

[0115] The push service is set on the application processor, and the push service can send the connection proxy request to the first communication chip.

[0116] Step S502, the first communication chip establishes a first communication connection with the server using a first network supported by the first communication chip in response to the connection proxy request.

[0117] For example, the first communication chip is a Wi-Fi chip, and the first network is a Wi-Fi network. At this time, the first communication connection established using the Wi-Fi network is a Wi-Fi connection. For example, the first communication chip is a cellular chip, and the first network is a cellular network. At this time, the first communication connection established using the cellular network is a cellular connection.

[0118] The first communication chip can use the first network to establish the first communication connection with the server according to the server address and the heartbeat related information issued by the push service. The heartbeat related information can include but is not limited to the sending period of the heartbeat message, the heartbeat timeout time, the authentication information, and the heartbeat message content, etc. Optionally, the connection agent request can include the server address and the heartbeat related information. The server is a push server.

[0119] In the related art, the long connection is managed by the push service of the AP, and when the first communication connection is established, the AP and the communication chip jointly participate in the connection process, and the power consumption of the connection process includes the power consumption generated by the AP and the communication chip. In the embodiment of the present application, the push service registers the connection agent related service, and after the agent starting process is completed, the communication chip can directly establish a communication connection with the server, without the participation of the AP, and the device power consumption is lower.

[0120] The first communication connection is a long connection established by the first communication chip using the first network and the server.

[0121] Optionally, after the first communication connection is established, the first communication chip can maintain the first communication connection through the heartbeat mechanism. That is, the process of the above communication chip proxying the long connection can further include step S503: the first communication chip sends a heartbeat message to the server through the first communication connection according to the heartbeat timer and the timeout timer, to maintain the first communication connection.

[0122] After the first communication chip establishes the first communication connection with the server, in order to maintain the long-term availability of the first communication connection, the first communication chip can periodically send a heartbeat message to the server according to the heartbeat timer and the timeout timer, and determine the validity of the first communication connection according to the confirmation message of the server for the heartbeat message.

[0123] The heartbeat timer is used to determine the time point of sending the heartbeat message. After the heartbeat message is sent, the next time point of sending the heartbeat message is determined according to the current time and the heartbeat period; the heartbeat timer is set according to the next time point of sending the heartbeat message; when the heartbeat timer determines that the next time point of sending the heartbeat message is reached, the first communication chip can be awakened or triggered to send the heartbeat message to the server through the first communication connection.

[0124] The timeout timer is a timeout timer of the push service, which is used to determine whether the confirmation message of the server is received within a specified time. After the first communication chip sends the heartbeat message to the server, the time point of receiving the confirmation message can be determined according to the timeout threshold of the service timeout timer; when the confirmation message is received before the time point, it is determined that the first communication connection is valid, and when the confirmation message is not received before the time point, it is determined that the first communication connection is not available, i.e. it is determined that the first communication connection has been disconnected.

[0125] It should be noted that in the related art, when the time point of sending the heartbeat message is reached, the AP and the communication chip are woken up, and the AP sends the heartbeat message to the server through the communication chip. In the embodiment of the present application, when the time point of sending the heartbeat message is reached, only the communication chip is woken up, and the communication chip directly sends the heartbeat message to the server, without waking up the AP, thereby further reducing the device power consumption.

[0126] In step S504, if the first communication connection is disconnected, the first communication chip re-establishes the first communication connection with the server using the first network.

[0127] It should be noted that in the related art, when it is necessary to re-establish the first communication connection, the AP and the communication chip need to be woken up, and the AP re-establishes the first communication connection with the server through the communication chip, which has high device power consumption. In the embodiment of the present application, after the first communication connection is disconnected, only the first communication chip can be woken up, and the first communication chip can directly re-establish the first communication connection using the first network, without waking up the AP, thereby reducing the device power consumption.

[0128] After the first communication connection is established, the AP and the first communication chip can enter a low-power state or a sleep state; when it is necessary to send a heartbeat message or re-establish a connection, the first communication chip can be woken up, and the first communication chip sends the heartbeat message or re-establishes the first communication connection. After sending the heartbeat message or re-establishing the first communication connection, the first communication chip can again enter the low-power state or the sleep state, and wait to be woken up next time.

[0129] Under normal circumstances, if the first communication connection is not actively disconnected, but is disconnected due to some abnormal reasons, the first communication chip can re-establish the first communication connection with the server to ensure the normal operation of the push service. The abnormal reasons can be, for example, no first network, NAT expiration, or weak network timeout.

[0130] After the first communication connection is disconnected due to no first network, when the first communication chip detects that the network is restored, the AP does not need to be woken up, but can directly re-establish the first communication connection with the server according to the server address and the heartbeat related information. After re-establishing the first communication connection, the first communication chip periodically sends the heartbeat message to the server through the first communication connection to maintain the availability of the first communication connection.

[0131] For example, after entering the coverage of the Wi-Fi network, the electronic device 300 uses the Wi-Fi chip to establish a Wi-Fi connection with the server using the Wi-Fi network, and the Wi-Fi connection is used to carry the push service, that is, the Wi-Fi connection is a long connection of the push service. After establishing the Wi-Fi connection, the electronic device 300 leaves the coverage of the Wi-Fi network, and thus there is no Wi-Fi network, and the Wi-Fi connection is disconnected. After the Wi-Fi connection is disconnected, after the electronic device 300 enters the coverage of the Wi-Fi network again, the Wi-Fi chip detects that the Wi-Fi network is restored, and then automatically re-establishes the Wi-Fi connection with the server for carrying the push service.

[0132] The weak network timeout can refer to that after sending the heartbeat message, the confirmation message returned by the server is not received within a specified time. For example, the timeout threshold of the timeout timer of the push service is 5 seconds, and the confirmation message is not received within 5 seconds after sending the heartbeat message, and it is confirmed that the first communication connection is unavailable, and an abnormal disconnection occurs. At this time, the AP does not need to be awakened, and the first communication chip can automatically re-establish the first communication connection with the server according to the server address and the heartbeat related information.

[0133] As can be seen from the above, the embodiment of the application sets a push agent at the communication chip layer, and the management of the long connection is lowered from the AP layer to the communication chip layer, and the long connection is managed by the communication chip layer. In this way, the communication chip can directly establish a long connection with the server, and after the long connection is disconnected due to no network or weak network timeout, the communication chip can also directly establish a long connection with the server, without awakening the AP, and the device power consumption is reduced.

[0134] Optionally, after the first communication chip establishes the first communication connection with the server, the first communication chip can send a heartbeat message to the server through the first communication connection according to the heartbeat timer and the timeout timer, to maintain the availability of the first communication connection. In this process, the first communication chip can not awaken the AP when sending the heartbeat message; the heartbeat timer and the timeout timer of the push service are not aligned by the unified control of the system on the AP, so that the communication chip layer can timely perceive the abnormal situation of the long connection; the heartbeat timer can be delayed for one period when receiving the push message; and the communication chip layer can directly perceive when sending a false network or network switching.

[0135] Exemplarily, referring to FIG. 6, a processing process diagram of the heartbeat message and the push message provided by the embodiment of the application is shown, and the process can include but is not limited to the following steps:

[0136] Step S601, the first communication chip determines a time point for sending a heartbeat message through a heartbeat period of a heartbeat timer.

[0137] After the first communication connection is established, the first communication chip periodically sends the heartbeat message according to the heartbeat timer. In the process of periodically sending the heartbeat message, when the first communication chip sends the heartbeat message, the first communication chip determines the time point of sending the next heartbeat message according to the heartbeat period of the heartbeat timer.

[0138] For example, the heartbeat period of the heartbeat timer is 5 minutes. According to the heartbeat period of the heartbeat timer, the first communication chip sends the heartbeat message through the first communication connection at 5:00. After sending the heartbeat message, the first communication chip determines the time point of sending the next heartbeat message according to the heartbeat period. At this time, the time point of sending the next heartbeat message is 5:05.

[0139] In some embodiments, after the first communication chip receives the push message sent by the server, the heartbeat timer does not extend by one heartbeat period. At this time, after determining the time point of sending the next heartbeat message, the process can proceed to step S603.

[0140] In other embodiments, after the first communication chip receives the push message sent by the server, the heartbeat timer extends by one heartbeat period. At this time, if the push message sent by the server is not received before the time point of sending the next heartbeat message arrives, the process proceeds to step S603; if the push message sent by the server is received before the time point of sending the next heartbeat message arrives, the process proceeds to step S602 to re-determine the time point of sending the heartbeat message, and then proceeds to step S603.

[0141] Optionally, the process further includes step S602: before the time point of sending the heartbeat message arrives, if the first communication chip receives the push message sent by the server through the first communication connection, the process re-determines the time point of sending the heartbeat message according to the reception time point of the push message and the heartbeat period, and the re-determined time point is later than the previously determined time point.

[0142] When the first communication chip receives the push message through the first communication connection, it proves that the current first communication connection is valid. In order to reduce the number of times of sending the heartbeat message, the heartbeat timer can be extended by one heartbeat period, that is, the heartbeat message is sent after being extended by one heartbeat period.

[0143] For example, the heartbeat period of the heartbeat timer is 5 minutes, and the time point of sending the next heartbeat message is 5:05. At 5:02, the first communication chip receives the push message through the first communication connection, that is, the reception time point of the push message is 5:02. According to the reception time of the push message and the heartbeat period, the time point of sending the next heartbeat message is re-determined to be 5:07. At this time, the re-determined time point is 5:07, and the previously determined time point is 5:05. The next heartbeat message is sent using the re-determined time point.

[0144] Step S603, when the time point of sending the heartbeat message arrives, the first communication chip sends the heartbeat message to the server through the first communication connection.

[0145] In some embodiments, the time point of sending the heartbeat message can be the time point determined in step S602. That is, not to postpone one heartbeat period according to the received push message. For example, in step S602, the determined next time point of sending the heartbeat message is 5:05. When 5:05 arrives, the first communication chip is woken up, and the first communication chip sends the heartbeat message to the server through the first communication connection.

[0146] In other embodiments, the time point of sending the heartbeat message can be the time point determined in step S604. That is, to postpone one heartbeat period according to the received push message. For example, in step S604, the re-determined next time point of sending the heartbeat message is 5:07. When 5:07 arrives, the first communication chip is woken up, and the first communication chip sends the heartbeat message to the server through the first communication connection.

[0147] Step S604, after sending the heartbeat message, if the first communication chip receives the confirmation message within the timeout threshold of the timeout timer, it is determined that the first communication connection is valid, and if the first communication chip does not receive the confirmation message within the timeout threshold of the timeout timer, it is determined that the first communication connection is disconnected.

[0148] The timeout timer is a timer of the push service, which can also be referred to as a service timeout timer. The timeout threshold can refer to the period of the timeout timer. For example, the timeout threshold is 10 seconds, that is, the timeout timer is a 10-second timer. After sending the heartbeat message, the 10-second timeout timer is started. If the confirmation message returned by the server for the heartbeat message is not received within 10 seconds, it is determined that the first communication connection is disconnected, otherwise, if the confirmation message returned by the server for the heartbeat message is received within 10 seconds, it is determined that the first communication connection is valid.

[0149] It should be noted that in the related art, the AP is responsible for the management of the long connection, which not only makes the device power consumption high, but also makes the stability of the long connection poor.

[0150] Specifically, in order to reduce the device power consumption, the related art will let the system on the AP uniformly control the alignment of the heartbeat timer and the service timeout timer. That is, the heartbeat timer and the service timeout timer are woken up according to a uniform wake-up period. In this way, the AP layer cannot timely perceive the connection abnormality, and thus cannot timely perform abnormality repair processing, affecting the stability of the long connection.

[0151] For example, the heartbeat period of the heartbeat timer is 5 minutes, and the period of the timeout timer of the push service is 10 seconds. Normally, the heartbeat timer and the timeout timer wake up according to the respective periods. That is, the heartbeat timer wakes up every 5 minutes to send a heartbeat message every 5 minutes; the timeout timer wakes up 10 seconds after sending the heartbeat message to determine whether an acknowledgement message is received within 10 seconds after sending the heartbeat message, so that the AP layer can timely perceive whether the long connection is valid. If no acknowledgement message is received within 10 seconds, the long connection is confirmed to be disconnected; if an acknowledgement message is received within 10 seconds, the long connection is confirmed to be valid.

[0152] If an acknowledgement message returned by the server for the heartbeat message is received within 10 seconds after sending the heartbeat message, the timeout timer is not started, and the set timeout timer is removed; otherwise, if no acknowledgement message is received within 10 seconds after sending the heartbeat message, the timeout timer is started to wake up the electronic device to perform a corresponding countermeasure.

[0153] However, after aligning the heartbeat timer and the timeout timer according to the unified wake-up period, the heartbeat timer and the timeout timer cannot wake up according to the respective set periods, but wake up according to the unified wake-up period. At this time, assuming that the unified wake-up period is 5 minutes, that is, the heartbeat timer and the timeout timer are woken up every 5 minutes. In this way, the timeout timer is woken up only 5 minutes after sending the heartbeat message to determine whether the acknowledgement message corresponding to the heartbeat message is received in time, and further determine whether the long connection is valid. That is, the long connection cannot be perceived to be valid until 5 minutes after sending the heartbeat message, so that the AP layer cannot timely perceive the connection abnormality.

[0154] The long connection management by the AP layer needs the network subsystem to detect the occurrence of the false network or the network switching, and then the network subsystem notifies the AP layer, so that the AP layer can perceive the occurrence of the false network or the network switching, which has a lag. This also affects the stability of the long connection.

[0155] In addition, the system of the AP layer uniformly controls and manages the aligned heartbeat timer and timeout timer, which also increases the device power consumption. Specifically, in the process of periodically sending the heartbeat message, if a push message issued by the server is received, the heartbeat can be postponed for a period to reduce the number of times of sending the heartbeat message, and further reduce the power consumption. However, since the system uniformly controls and manages the aligned heartbeat timer and timeout timer, the heartbeat timer is invalid after receiving the push message of the server, and further causes high device power consumption.

[0156] For example, assuming that the unified wake-up period is 5 minutes, and assuming that the time point for sending the heartbeat message next time is determined to be 5:05 after sending the heartbeat message at 5:00. But the push message issued by the server is received at 5:02. If the heartbeat can be postponed for one period, the time point for sending the heartbeat message next time is 5:07. But because the system uniformly controls the alignment of the heartbeat timer and the timeout timer, the postponing of the heartbeat is invalid, and the heartbeat message will still be sent at 5:05. In this way, unnecessary sending of the heartbeat message is increased, and the device power consumption is high.

[0157] As can be seen from the above, in the embodiment of the application, the long connection is sunk from the AP layer to the communication chip layer, and the communication chip layer is responsible for the management of the long connection. In the process of periodically sending the heartbeat message, the AP does not need to be woken up, so that the timeout timer and the heartbeat timer are not uniformly controlled and aligned by the system on the AP, and further, the heartbeat timer can be postponed for one heartbeat period after receiving the push message, thereby reducing unnecessary sending of the heartbeat message and reducing device power consumption. The timeout timer can also work according to the set period, so that the communication chip can timely perceive whether the long connection is disconnected. When sending the fake network or network switching, the communication chip layer can directly perceive, thereby reducing the hysteresis. In this way, the stability of the long connection is improved, and the device power consumption is reduced.

[0158] The electronic device 300 can include only one communication chip (for example, the first communication chip), or can include at least two communication chips, and each communication chip in the at least two communication chips supports different networks. For example, the at least two communication chips include a Wi-Fi chip and a cellular chip.

[0159] When the electronic device 300 includes only one communication chip, or includes at least two communication chips but only uses one communication chip to implement the push service, the communication chip can implement the push service through the flow steps shown in FIGS. 5 and 6.

[0160] When the electronic device 300 includes at least two communication chips, the electronic device 300 can use the first communication chip to establish a first communication connection with the server, and use the first communication connection to carry the push service. For example, the first communication chip performs the flow steps shown in FIGS. 5 and 6. When it is necessary to switch the communication connection carrying the push service from the first communication connection to the second communication connection, the electronic device 300 first disconnects the first communication connection, then activates the second communication chip, establishes a second communication connection with the server using the second communication chip, and then uses the second communication connection to carry the push service. In this way, the communication connection carrying the push service can be switched from the first communication connection to the second communication connection.

[0161] The at least two communication chips include a first communication chip and a second communication chip, and the first communication chip and the second communication chip support different networks. The second communication chip supports a second network, and the second communication connection is a communication connection established by the second communication chip with the server of the push service using the second network.

[0162] However, it takes a certain time to activate the second communication chip and the establishment of the second communication connection, so the second communication connection cannot be established immediately after the first communication connection is disconnected, so that there is no communication connection between the electronic device 300 and the server during the period from the disconnection of the first communication connection to the establishment of the second communication connection, thereby affecting the stability of the long connection.

[0163] To this end, the embodiments of the present application synchronize the first communication chip and the second communication chip to notify the second communication chip to establish the second communication connection in advance when the first communication connection carrying the push service is about to be disconnected. In this way, after the first communication connection is disconnected, since the second communication connection has been established, there is no need to wait for the second communication chip to be activated and the second communication connection to be established, and the push service can be seamlessly switched to the second communication connection, thereby realizing smooth switching of the communication connection carrying the push service and improving the stability of the long connection.

[0164] That is, there is no gap period between the electronic device 300 and the server during the process of switching the communication connection carrying the push service from the first communication connection to the second communication connection. The gap period refers to the period during which there is no communication connection between the electronic device 300 and the server.

[0165] Exemplarily, referring to FIG. 7, a connection switching process provided by the embodiments of the present application is shown, which can include but is not limited to the following steps:

[0166] In step S701, the first communication chip communicates with the server using the first communication connection.

[0167] The first communication chip establishes the first communication connection with the server of the push service using the first network, and carries the push service using the first communication connection. The first communication chip is provided with a push proxy program for proxying the push connection between the application processor of the electronic device 300 and the server.

[0168] Carrying the push service using the first communication connection can mean that the first communication chip periodically sends a heartbeat message to the server through the first communication connection, and receives an acknowledgement message sent by the server through the first communication connection; the server can send a push message to the electronic device through the first communication connection.

[0169] If the electronic device 300 further comprises the second communication chip, and the push service is implemented through the first communication chip and the second communication chip. Optionally, after the first communication connection is established, steps S702-S704 can be further included. For example, after step S502 or step S504 in FIG. 5, steps S702-S704 can be further included.

[0170] In step S702, if the first communication chip predicts that the first communication connection will enter a weak network environment in a first time period in the future, the first communication chip sends first synchronization information to the second communication chip, the first synchronization information being used to instruct the second communication chip to establish a communication connection with the server.

[0171] The first communication chip can predict whether the first communication connection will enter a weak network environment according to the network signal strength of the first network. For example, according to the network signal strength of the first network, a change trend of the network signal strength is determined; if the change trend of the network signal strength is from strong to weak, and the network signal strength at the current time is lower than a preset strength threshold, it is determined that the electronic device 300 will leave the coverage range of the first network and will enter a weak network environment. For example, the first network is a Wi-Fi network, and the network signal strength can be a received signal strength indication (RSSI) of the Wi-Fi.

[0172] The first communication chip can also predict that it will enter a weak network environment through scene perception. Scene perception refers to predicting whether the electronic device 300 will enter a pre-labeled scene. The pre-labeled scene can include but is not limited to elevators, tunnels, high-speed rails, and airports, etc. That is, when it is predicted that the electronic device 300 will enter a scene such as an elevator, a tunnel, a high-speed rail, or an airport, it is determined that it will enter a weak network environment.

[0173] In the scene of an elevator, a tunnel, a high-speed rail, or an airport, the electronic device 300 usually has no network signal. When it is predicted that it will enter a weak network environment, it can be further predicted how long (i.e., the first time period) it will enter a weak network environment in the future. For example, the first time period is 1 minute, that is, it is predicted that it will enter a weak network environment in 1 minute in the future.

[0174] When the first communication chip predicts that it will enter a weak network environment, the first communication chip can send a first synchronization signal to the second communication chip through a signal synchronization mechanism between the first communication chip and the second communication chip. The first synchronization signal is used to inform the second communication chip to establish a second communication connection with the server in advance.

[0175] Weak network environment refers to an environment with poor network quality. Specifically, it can manifest as slow and unstable network speed. Weak network can lead to low data transmission efficiency, delayed or incomplete information transmission, and even data loss or connection interruption. Weak network can be caused by insufficient network coverage, signal interference, device failure, etc. In a weak network environment, problems such as slow data upload and download speed, real-time communication delay, and even inability to connect can occur.

[0176] The first synchronization information can include instruction information derived by the first communication chip based on the perceived network state and network connection state, etc. The instruction information can be used to inform the second communication chip to establish a second communication connection with the server in advance. Of course, the first synchronization information can also include the network state and network connection state of the first communication chip itself. At this time, the second communication chip can decide whether to establish a second communication connection with the server in advance according to the network state and network connection state of the first communication chip after receiving the first synchronization information.

[0177] Of course, in other embodiments, the first communication chip can also send the first synchronization information to the second communication chip after predicting that the first communication connection will be disconnected in the future first time period.

[0178] Step S703, the second communication chip establishes a second communication connection with the server using a second network supported by the second communication chip in response to the first synchronization information.

[0179] The establishment time of the second communication connection is earlier than the disconnection time of the first communication connection. That is, the second communication connection has been established before the first communication connection is disconnected. The second communication connection is a long connection established by the second communication chip using the second network with the push server. The second communication chip is provided with a push proxy program for proxying the push connection between the application processor of the electronic device 300 and the server.

[0180] The second communication chip can establish a second communication connection with the server using the second network according to the server address and heartbeat related information, etc.

[0181] The server address and heartbeat related information on the second communication chip can be sent by the first communication chip, that is, the first communication chip sends the server address and heartbeat related information to the second communication chip through the signal synchronization mechanism. For example, the first communication chip can carry the server address and heartbeat related information in the first synchronization information.

[0182] The server address and heartbeat related information on the second communication chip can also be issued by the AP. Specifically, when starting the agent, the AP not only registers the agent related service to the first communication chip, but also registers the agent related service to other communication chips (for example, the second communication chip), and issues the server address and heartbeat related information to each communication chip. For example, the AP can send a connection agent request to the first communication chip and the second communication chip, and the first communication chip is the chip corresponding to the default network. The electronic device 300 can make the first communication chip (i.e., using the default network) establish a first communication connection for carrying the push service; when network switching is needed (for example, the first communication connection is about to be disconnected or is about to enter a weak network environment), the first communication chip notifies the second communication chip in advance to establish a second communication connection.

[0183] Step S704, when the first communication connection is disconnected or within a second time period before the first communication connection is disconnected, the second communication chip uses the second communication connection to communicate with the server, so as to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0184] The second communication chip establishes the second communication connection before the first communication connection is disconnected. The push service carried by the first communication connection can be switched to the second communication connection when the first communication connection is disconnected; or the push service carried by the first communication connection can be switched to the second communication connection before the first communication connection is disconnected. For example, the second communication connection can be switched within a second time period before the first communication connection is disconnected. The second preset time period can be set according to needs, which is not limited here. For example, the second time period can be 30 seconds, that is, the second communication connection is switched within 30 seconds before the first communication connection is disconnected.

[0185] After the communication connection carrying the push service is changed from the first communication connection to the second communication connection, the second communication chip can use the second communication connection to communicate with the server. Specifically, the second communication chip periodically sends a heartbeat message to the server through the second communication connection, and receives an acknowledgement message returned by the server, so as to maintain the long-term availability of the second communication connection; also receives the push message sent by the server through the second communication connection, and sends a message to the server. For example, the second communication chip can execute the flow steps executed by the first communication chip in FIGS. 5 and 6.

[0186] For example, the first communication chip is a Wi-Fi chip, and the first communication connection is a Wi-Fi connection; the second communication chip is a cellular chip, and the second communication connection is a cellular connection. The electronic device 300 first uses the Wi-Fi chip to establish a Wi-Fi connection with the server, and uses the Wi-Fi connection to carry the push service. When the Wi-Fi chip predicts that it will soon leave the coverage of the Wi-Fi network, that is, it will soon enter a weak network environment, and the Wi-Fi connection will be disconnected, a synchronization signal is sent to the cellular chip to notify the cellular chip to establish a cellular connection with the server in advance. When the Wi-Fi connection is disconnected, the communication connection carrying the push service is smoothly switched from the Wi-Fi connection to the cellular connection.

[0187] As can be seen from the above, through the signal synchronization between the first communication chip and the second communication chip, when it is predicted that the first communication connection carrying the push service will soon enter a weak network environment, the second communication chip is notified to establish a second communication connection in advance, so that the communication connection carrying the push service can be smoothly switched from the first communication connection to the second communication connection, and the stability of the long connection is improved.

[0188] As described above, the first communication chip can communicate with the server of the push service through the first communication connection, that is, carry the push service through the first communication connection. For example, the first communication chip can implement the push service through the flow steps shown in FIGS. 5 and 6. At this time, after establishing the first communication connection, if the electronic device 300 further includes a second communication chip, the second communication chip can use a second network to establish a second communication connection with the server, and then the communication connection carrying the push service can be switched from the first communication connection to the second communication connection.

[0189] Optionally, in the process of switching the communication connection carrying the push service from the first communication connection to the second communication connection, after the second communication chip accesses the second network, the second communication chip can not immediately use the second network to establish a second communication connection with the server, and the first communication chip is not immediately released. Instead, the second communication chip can wait until the second network is stable and can provide stable long connection service, and then use the second network to establish a second communication connection with the server, and then notify the first communication chip to actively release the first communication connection, and switch the push service from the first communication connection to the second communication connection.

[0190] Exemplarily, referring to FIG. 8, a connection switching process schematic diagram provided by an embodiment of the present application is shown, which can include but is not limited to the following steps:

[0191] Step S801, the first communication chip uses a first network to establish a first communication connection with a server, and communicates with the server using the first communication connection.

[0192] The first communication connection is a communication connection carrying a push service. The first network is a network supported by the first communication chip. For example, the first communication chip can perform the flow steps shown in FIG. 5 or FIG. 6.

[0193] At this time, if the electronic device 300 further includes a second communication chip, the second communication chip does not have a communication connection established with the server. Optionally, after the first communication connection is established, steps S802-S804 can be further included. For example, after step S502 or step S504 in FIG. 5, steps S802-S804 can be further included.

[0194] In step S802, the second communication chip accesses a second network, and after determining that the network quality of the second network reaches a target quality, the second communication chip establishes a second communication connection with the server using the second network, and sends second synchronization information to the first communication chip, where the second synchronization information is used to instruct the first communication chip to release the first communication connection.

[0195] The second communication chip is provided with a push proxy program, which is used to proxy a push connection between an application processor of the electronic device 300 and the server.

[0196] The second communication chip can determine whether the network quality of the second network reaches the target quality by using related parameters such as network signal strength and network latency of the second network. For example, when the network signal strength of the second network is greater than or equal to a preset strength threshold for a continuous preset time (for example, 3 minutes), and the network latency of the second network is less than or equal to a preset latency threshold for a continuous preset time, it is determined that the network quality of the second network reaches the target quality. The second network is a network supported by the second communication chip.

[0197] The network quality of the second network reaching the target quality means that the second network is stable, and the second communication chip establishes a second communication connection with the server using the second network. Optionally, after the second communication connection is established, the second communication connection can be waited to be stable, that is, to provide a stable long connection service, and then the first communication chip is instructed to release the first communication connection.

[0198] Optionally, after the second communication chip accesses the second network, the second communication chip can establish a second communication connection with the server using the second network, and then determine whether the network quality of the second network reaches the target quality; or the second communication chip can establish the second communication connection after determining that the network quality of the second network reaches the target quality.

[0199] The second communication chip can establish a second communication connection with the server using the second network according to the server address and heartbeat related information. The server address and heartbeat related information on the second communication chip can be sent by the first communication chip through a signal synchronization mechanism, or can be issued by the AP.

[0200] In step S803, the first communication chip releases the first communication connection in response to the second synchronization information.

[0201] That is, the first communication chip actively disconnects (or exits) the first communication connection.

[0202] In step S804, the second communication chip communicates with the server using the second communication connection to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0203] For example, the first communication chip is a cellular chip, the first network is a cellular network, and the first communication connection is a cellular connection; the second communication chip is a Wi-Fi chip, the second network is a Wi-Fi network, and the second communication connection is a Wi-Fi connection. At this time, the cellular chip has established a cellular connection with the server, and the cellular connection is the communication connection carrying the push service. When the electronic device 300 accesses the Wi-Fi network through the Wi-Fi chip, the second communication chip can establish a Wi-Fi connection using the Wi-Fi network, and then determine whether the network quality of the Wi-Fi network reaches the target quality. Alternatively, after accessing the Wi-Fi network, the second communication chip first determines whether the network quality of the Wi-Fi network reaches the target quality, and then establishes a Wi-Fi connection using the Wi-Fi network after the network quality reaches the target quality.

[0204] After the second communication chip determines that the network quality of the Wi-Fi network reaches the target quality, the second communication chip sends second synchronization information to the first communication chip. Alternatively, after the second communication chip determines that the network quality of the Wi-Fi network reaches the target quality and the second communication connection is stable (i.e., can provide a stable long connection service), the second communication chip sends second synchronization information to the first communication chip. After the first notification chip receives the second synchronization information, the first notification chip actively releases the cellular connection and switches the push service residing on the cellular connection to the Wi-Fi connection.

[0205] It should be noted that in related technologies, the electronic device 300 uses a cellular chip's cellular connection to carry push services and does not have a Wi-Fi network. At any given moment, when the electronic device 300 connects to a Wi-Fi network, it does not switch the push service residing on the cellular connection to the Wi-Fi network; instead, the push service remains residing on the cellular connection. This increases the activation time of the cellular chip, thereby increasing device power consumption. However, in this embodiment, after connecting to a Wi-Fi network, the electronic device 300 switches the push service residing on the cellular connection to the Wi-Fi connection, reducing the activation time of the cellular chip and thus lowering device power consumption. Furthermore, waiting until the Wi-Fi network is stable, or until both the Wi-Fi network and the second communication connection are stable, before switching the push service from the cellular connection to the Wi-Fi connection avoids packet loss due to Wi-Fi network instability, which could lead to push service failure and improve the stability of the push service.

[0206] Push services typically involve small amounts of data. Packet loss due to network instability can easily lead to push service failure. This application addresses this by employing an inter-chip signal synchronization mechanism to switch the push service from cellular to Wi-Fi once the network stabilizes, minimizing packet loss and ensuring the normal operation of the push service.

[0207] It should be noted that, in Figure 7, when it is necessary to switch the communication connection carrying the push service from the first communication connection to the second communication connection, steps S802 and S803 in Figure 8 can also be executed. For example, after receiving the first synchronization information, the second communication chip accesses the second network and determines whether the second network has reached the target quality; when the second network reaches the target quality, it uses the second network to establish a second communication connection with the server; after the second communication connection stabilizes, the second communication chip sends the second synchronization information to the first communication chip to notify the first communication chip to actively release the first communication connection; the second communication chip then uses the second communication connection to communicate with the server. In this way, the communication connection carrying the push service can be switched from the first communication connection to the second communication connection.

[0208] As can be seen from the above, the embodiments of this application achieve signal synchronization between the first communication chip and the second communication chip, and wait for the network connection to stabilize before switching the push service from the first communication connection to the second communication connection. This not only further reduces device power consumption, but also improves the stability of the push service by avoiding packet loss due to network instability.

[0209] It should be noted that when the electronic device 300 includes at least two communication chips, the multiple communication chips can be simultaneously used to establish a communication connection with the server, each communication connection carries the push service, that is, multiple long connections exist simultaneously; the multiple communication chips can be simultaneously used to establish a communication connection with the server, but only one communication connection carries the push service, that is, one long connection exists simultaneously; or only one of the multiple communication chips can be simultaneously used to establish a communication connection with the server, and the communication connection carries the push service.

[0210] Exemplarily, referring to FIG. 9, a system architecture diagram of the push service provided by the embodiment of the application is shown. As shown in FIG. 9, the electronic device 300 includes a push service, a socket proxy adapter, a Wi-Fi chip, and a cellular chip. The push service is arranged on an AP, and the socket proxy adapter is an adaptation layer.

[0211] The push service completes the proxy starting process by registering a connection proxy related service. After the proxy starting process is completed, a second push proxy (push socket proxy) is arranged on the Wi-Fi chip, and a first push proxy (push socket proxy) is arranged on the cellular chip.

[0212] The first push proxy and the second push proxy can establish a long connection with the push cloud according to the server address and heartbeat related information issued by the push service.

[0213] Before the long connection is established, the push service can issue the server address and the heartbeat related information to the Wi-Fi chip and the cellular chip. For example, after the push service registers the proxy related service to the Wi-Fi chip and the cellular chip, the push service sends the server address and the heartbeat related information to the Wi-Fi chip and the cellular chip, respectively. In this way, when the connection switching needs to be performed subsequently, the Wi-Fi chip and the cellular chip can establish a long connection with the server according to the pre-issued server address and heartbeat related information.

[0214] At the same time, there can be only a long connection between the Wi-Fi chip and the push cloud, or a long connection between the cellular chip and the push cloud; or there can be a long connection between the Wi-Fi chip and the push cloud and a long connection between the cellular chip and the push cloud simultaneously. At this time, the Wi-Fi chip and the cellular chip maintain their own long connections respectively, and the push cloud can issue a downlink message through the two long connections simultaneously. Of course, the push cloud can also select one of the long connections to issue a downlink message. For example, the push cloud can preferentially use the Wi-Fi connection to issue a downlink message. That is, when there are multiple long connections, the push cloud can preferentially use the long connection established by the Wi-Fi network to issue a downlink message.

[0215] The first or second push agent can periodically send heartbeat messages to the push cloud and receive downlink messages from the server via a long connection.

[0216] Once a long-lived connection is established, its lifecycle is maintained by the Wi-Fi chip and the cellular chip.

[0217] Specifically, when Wi-Fi or cellular networks are restored, the communication chip can automatically initiate the connection establishment process without waking up the access point (AP), thus reducing device power consumption. That is, the Wi-Fi chip uses the Wi-Fi network to establish a persistent connection with the push cloud. If the connection is lost due to the absence of Wi-Fi, the chip can automatically initiate the persistent connection establishment process again when Wi-Fi is detected to be restored (i.e., Wi-Fi is available again). Similarly, the cellular chip uses the cellular network to establish a persistent connection with the push cloud. If the connection is lost due to the absence of cellular networks, the chip can automatically initiate the persistent connection establishment process again when cellular networks are detected to be restored (i.e., cellular is available again).

[0218] When a long-term connection is disconnected due to NAT expiration or weak network timeout, the long-term connection can be directly re-established by the Wi-Fi chip or cellular chip without waking up the AP, thus reducing device power consumption.

[0219] The Wi-Fi chip and the new cellular chip work together through signal synchronization. They can synchronize information such as network and connection status. For example, when the Wi-Fi chip senses it is about to leave the Wi-Fi network's coverage area—that is, when the long-lived connection established using the Wi-Fi network (which is currently carrying push services) is about to disconnect—it sends a synchronization message to the cellular chip, notifying it to establish a long-lived connection with the push cloud using the cellular network in advance. When the long-lived connection between the Wi-Fi chip and the push cloud is broken, the push service can smoothly switch to the long-lived connection between the cellular chip and the push cloud.

[0220] For example, the cellular chip has a long connection with the push cloud, and uses the long connection to carry push services. When the electronic device 300 accesses a Wi-Fi network through the Wi-Fi chip, the Wi-Fi chip first uses the Wi-Fi network to establish a long connection with the push cloud. The Wi-Fi chip determines whether the network quality of the Wi-Fi network reaches a target quality; if the network quality of the Wi-Fi network reaches the target quality, and the Wi-Fi connection is stable, the Wi-Fi chip notifies the cellular chip to actively release the long connection between the cellular chip and the push cloud, and switches the push service to the long connection between the Wi-Fi chip and the push cloud. That is, after the Wi-Fi network is stable, the push service residing on the cellular connection is switched to the Wi-Fi connection.

[0221] After the first push agent or the second push agent receives the downlink message issued by the push cloud through the long connection, the first push agent or the second push agent can extend the heartbeat timer to the next heartbeat period, so as to reduce unnecessary heartbeat message sending and reduce device power consumption. In addition, the first push agent or the second push agent can also transmit the downlink message to the AP, and the AP processes the downlink message to obtain a processing result. The AP transmits the processing result to the first push agent or the second push agent, and the first push agent or the second push agent sends an uplink message to the push cloud through the long connection according to the processing result.

[0222] When the communication chip in the electronic device 300 includes a cellular chip, and the cellular connection between the cellular chip and the server carries the push service, the cellular chip can send uplink data to the server through the cellular connection. The uplink data can be a heartbeat message, or an uplink message, which is a message sent by the cellular chip to the server according to a processing result of the server issuing a downlink message to the AP.

[0223] When the cellular chip sends uplink data to the server through the cellular connection, the cellular chip needs to establish a radio resource control (RRC) connection with the base station to communicate through the RRC connection. The RRC connection is a connection between the electronic device 300 and the base station, and the cellular connection is a push connection between the electronic device 300 and the push server.

[0224] The cellular chip can be the first communication chip or the second communication chip described above.

[0225] In the related art, the AP layer is responsible for the management of the long connection, and a default configured RRC connection holding time is uniformly used. After sending uplink data to the server, the RRC connection is not actively released, which leads to a long RRC connection holding time and increases the device power consumption. The amount of uplink data is small, and it is usually a packet scenario. The sending time of uplink data is usually in milliseconds. However, the holding time of the default configured RRC connection is usually 5-20 seconds.

[0226] To this end, the embodiment of the present application can actively and quickly release the RRC connection after the cellular chip sends uplink data to the server by sinking the long connection from the AP layer to the communication chip layer, so as to reduce the RRC connection holding time and reduce the device power consumption.

[0227] Exemplarily, after sending uplink data, the cellular chip determines whether the release condition is met; if the release condition is met, the RRC connection is actively released; and if the release condition is not met, the RRC connection is not actively released.

[0228] Optionally, when there are multiple data radio bearers (DRBs) in the packet data convergence protocol (PDCP), the cellular chip determines that the release condition is not met. When there are multiple DRBs in the PDCP, it indicates that there are multiple services (such as IMS, multimedia message service, etc.) in addition to the push service. IMS is the IP multimedia subsystem (IP Multimedia Subsystem). If the RRC connection is released at this time, it will affect the normal operation of the non-push services such as IMS and multimedia message service.

[0229] When the PDCP only has the push service, it is determined that the release condition is met.

[0230] When the network cards of the application processor are all in the inactive state (DOWN state), it indicates that there is no data reception and data generation of the application processor, and the quick release of the RRC connection can be started, that is, it is determined that the release condition is met.

[0231] When the network cards of the application processor have network cards in the active state (UP state) and the application processor is in the sleep state, it is determined that the release condition is met. Specifically, after determining that there are network cards in the UP state, the sleep state of the application processor can be further judged; if the application processor has slept, it is determined that the release condition is met, and the RRC connection can be quickly released; and if the application processor has not slept, it is determined that the release condition is not met.

[0232] After determining that the release condition is met, the RRC connection can be released quickly. Optionally, the PDCP NO DATA mechanism can be used for the quick release of the RRC connection. The PDCP NO DATA mechanism refers to setting a NO_DATA threshold, and when there is no data transmission of the PDCP within the NO_DATA threshold, the RRC quick release is triggered.

[0233] For example, when the network cards of the application processor are all in the inactive state (i.e., the DOWN state), the NO_DATA threshold can be set to 500 ms. That is, if there is no data transmission of the PDCP within 500 ms, the RRC quick release is triggered. For example, when the network cards of the application processor have a network card in the active state (the UP state) and the application processor is in the sleep state, the NO_DATA threshold can be set to 1 s. The NO_DATA threshold can be updated as needed.

[0234] That is, in the process of actively releasing the RRC connection quickly, the cellular chip determines whether there is data transmission of the PDCP within a preset time period; if there is no data transmission of the PDCP within the preset time period, the cellular chip releases the RRC connection. The preset time period is the NO_DATA threshold described above.

[0235] In order to better introduce the scheme of the quick release of the RRC connection provided by the embodiments of the present application, the RRC quick release process provided by the embodiments of the present application shown in FIG. 10 is introduced and described below.

[0236] As shown in FIG. 10, the process can include the following steps:

[0237] Step S1, after receiving the heartbeat confirmation, the push proxy triggers the quick release of the RRC connection.

[0238] The push proxy is a proxy program in the cellular chip. The heartbeat confirmation is an acknowledgment message (HeartBeat ACK) returned by the server for the heartbeat message sent by the cellular chip. That is, after receiving the acknowledgment message returned by the server, the push proxy of the cellular chip triggers the RRC connection quick release process.

[0239] In other embodiments, the push proxy of the cellular chip can also trigger the RRC connection quick release after sending the uplink message to the server. The uplink message is a message sent after processing the downlink message issued by the server.

[0240] Step S2, the push proxy sends PUSH_PROXY_PDCP_CONN_REL_NTF to the PDCP.

[0241] The push agent sends a PUSH_PROXY_PDCP_CONN_REL_NTF to the PDCP to inform the PDCP to start the RRC connection fast release. After the PDCP receives the PUSH_PROXY_PDCP_CONN_REL_NTF, it proceeds to step S3.

[0242] Step S3, the PDCP determines whether the fast release condition is met.

[0243] For example, when there is only push service in the PDCP, it is determined that the fast release condition is met. When there are multiple DRBs in the PDCP, it is determined that the fast release condition is not met. When the network cards of the application processor are all in the DOWN state, it is determined that the fast release condition is met. When the network cards of the application processor have network cards in the UP state and the application processor has been hibernated, it is determined that the fast release condition is met. When the network cards of the application processor have network cards in the UP state, but the application processor is not hibernated, it is determined that the fast release condition is not met.

[0244] Step S4, the PDCP sets the NO_DATA threshold according to the condition.

[0245] The PDCP sets the NO_DATA threshold according to the fast release condition met. For example, when the fast release condition met is that the network cards of the application processor are all in the DOWN state, the NO_DATA threshold is set to 500 ms; when the fast release condition met is that the network cards of the application processor have network cards in the UP state and the application processor has been hibernated, the NO_DATA threshold is set to 1 s.

[0246] The NO_DATA threshold can be updated as needed.

[0247] Step S5, the PDCP sends an ID_NL2_RRC_NPPDCP_NO_DATA_IND to the RRC to trigger the RRC fast release.

[0248] The PDCP multiplexes the NO_DATA mechanism, and reports the ID_NL2_RRC_NPPDCP_NO_DATA_IND to the RRC when there is no data in the NO_DATA threshold, which is used to trigger the RRC to release the connection.

[0249] Compared with the related art, the AP layer is responsible for the management of the long connection, and cannot identify the RRC connection corresponding to the push service, and the user equipment (UE) inactivity timer is configured by default. The inactivity timer of the UE configured by default has a long duration, usually 5s-20s, which makes the RRC connection holding time too long, causing the RRC connection to be too long.

[0250] In addition, during RRC tailing, Connected Mode Discontinuous Reception (CDRX) may also be disabled, further increasing device power consumption.

[0251] According to the embodiment of the present application, the long connection is sunk from the AP layer to the communication chip layer, the RRC connection corresponding to the push service can be accurately identified, and the RRC connection is quickly released after the uplink data is sent, so that the RRC connection holding time is reduced and the device power consumption is reduced.

[0252] Please refer to FIG. 11, which shows a structural schematic block diagram of an electronic device 300 provided by an embodiment of the present application. The electronic device 300 can include an application processor 1101 and a first communication chip 1102.

[0253] The application processor 1101 is configured to send a connection proxy request to the first communication chip 1102, the connection proxy request being used to instruct the first communication chip 1102 to proxy the communication connection between the application processor 1101 and a server of a push service.

[0254] The first communication chip 1102 is configured to, in response to the connection proxy request, establish a first communication connection with the server using a first network supported by the first communication chip 1102; and if the first communication connection is disconnected, reestablish the first communication connection with the server using the first network.

[0255] In some possible implementation ways of the second aspect, the electronic device 300 further includes a second communication chip 1103. The first communication chip 1102 communicates with the server using the first communication connection, and the second communication chip 1103 does not establish a communication connection with the server.

[0256] The first communication chip 1102 is configured to, if it is predicted that the first communication connection will enter a weak network environment in a first time period in the future, send first synchronization information to the second communication chip 1103, the first synchronization information being used to instruct the second communication chip 1103 to establish a communication connection with the server.

[0257] The second communication chip 1103 is configured to, in response to the first synchronization information, establish a second communication connection with the server using a second network, the second network being a network supported by the second communication chip 1103, and the second communication connection being established earlier than the disconnection time of the first communication connection; and communicate with the server using the second communication connection when the first communication connection is disconnected or in a second time period before the first communication connection is disconnected, so as to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0258] In some possible implementation manners, the electronic device 300 further includes a second communication chip 1103; the first communication connection is a communication connection carrying the push service, that is, the first communication chip 1102 communicates with the server using the first communication connection; and the second communication chip 1103 does not establish a communication connection with the server.

[0259] The second communication chip 1103 is configured to: after accessing the second network and determining that network quality of the second network reaches the target quality, establish a second communication connection with the server using the second network, and send second synchronization information to the first communication chip 1102, where the second synchronization information is used to instruct the first communication chip 1102 to release the first communication connection, and the second network is a network supported by the second communication chip.

[0260] The first communication chip 1102 is configured to: in response to the second synchronization information, release the first communication connection.

[0261] The second communication chip 1103 is further configured to: communicate with the server using the second communication connection, so as to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

[0262] In some possible implementation manners, after establishing the first communication connection, the first communication chip 1102 is further configured to: according to the heartbeat timer and the timeout timer, send a heartbeat message to the server through the first communication connection, so as to maintain the first communication connection.

[0263] In some possible implementation manners, the first communication chip is further configured to: determine a time point for sending the heartbeat message through the heartbeat period of the heartbeat timer; when the time point arrives, send the heartbeat message to the server through the first communication connection; and after sending the heartbeat message, if an acknowledgement message returned by the server in response to the heartbeat message is received within a timeout threshold of the timeout timer, determine that the first communication connection is valid, where the acknowledgement message is a message returned by the server in response to the heartbeat message.

[0264] In some possible implementation manners, the first communication chip is further configured to: if a push message of the server is received through the first communication connection before the time point arrives, re-determine the time point for sending the heartbeat message according to a receiving time point of the push message and the heartbeat period, and the re-determined time point is later than the previously determined time point.

[0265] In some possible implementation manners, the first communication chip is further configured to: transmit the push message to the application processor 1101; the application processor 1101 is configured to: process the push message, obtain a processing result, and transmit the processing result to the target communication chip; and the first communication chip is further configured to: according to the processing result, send a reply message to the server through the first communication connection.

[0266] In some possible implementation manners, after the cellular chip sends the uplink data to the server, the cellular chip is further configured to: determine whether a release condition is met; and release the RRC connection if the release condition is met. The cellular chip is the first communication chip 1102 or the second communication chip 1103.

[0267] In some possible implementation manners, the cellular chip is specifically configured to: determine that the release condition is not met if there are multiple data radio bearers of a packet data convergence protocol (PDCP); determine that the release condition is met if there is only push service of the PDCP; and determine that the release condition is met if a network card of the application processor is in an inactive state or there is a network card in an active state of the application processor and the application processor is in a sleep state.

[0268] In some possible implementation manners, the cellular chip is specifically configured to: determine whether there is data transmission of the PDCP within a preset time period; and release the RRC connection if there is no data transmission of the PDCP within the preset time period.

[0269] The electronic device 300 described above has the function of implementing the method of establishing a communication connection, which can be implemented by hardware, or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. The modules can be software and / or hardware.

[0270] It should be noted that the information interaction, execution process, and the like between the electronic device 300 described above are based on the same concept as the method embodiments of the present application. For specific functions and technical effects brought by the method embodiments, refer to the method embodiments part, which will not be described here.

[0271] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is taken as an example for illustration. In actual applications, the above functions can be completed by different functional units or modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. Each functional unit or module in the embodiments can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or software. In addition, the specific names of the functional units and modules are only for mutual distinction, and do not limit the protection scope of the present application. The specific working process of the units and modules in the system can refer to the corresponding process in the foregoing method embodiments, which will not be described here.

[0272] The integrated unit, if implemented in the form of a software function unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, the present application can implement all or part of the processes in the above-mentioned embodiment methods through a computer program to instruct related hardware to complete, and the computer program can be stored in a computer readable storage medium. When the computer program is executed by a processor, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable files or some intermediate forms. The computer readable medium can at least include any entity or device capable of carrying the computer program code to the photographing device / terminal equipment, recording medium, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium. For example, U disk, mobile hard disk, magnetic disk or optical disk, etc. In some jurisdictions, according to legislation and patent practice, the computer readable medium can not be an electrical carrier signal and a telecommunication signal.

[0273] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. The skilled person can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0274] In the embodiments provided by the present application, it should be understood that the disclosed devices, electronic devices and methods can be implemented in other ways. For example, the above-described device / electronic device embodiments are merely illustrative, and the division of the modules or units is merely a logical function division, and there can be another division manner in actual implementation, for example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the units shown or discussed can be indirect coupling or communication connection through some interface, device or unit, and can be electrical, mechanical or other forms.

[0275] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on a plurality of network units. Some or all of the units can be selected to achieve the purpose of the embodiment scheme according to actual needs.

[0276] The electronic device provided in the embodiments of the present application can include a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements the method of any of the above method embodiments when executing the computer program.

[0277] The embodiments of the present application also provide a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps in the above various method embodiments.

[0278] The embodiments of the present application provide a computer program product, which, when running on an electronic device, causes the electronic device to implement the steps in the above various method embodiments.

[0279] In the above embodiments, all or part of the embodiments can be implemented by software, hardware, firmware, or any combination thereof. When implemented by software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions according to the embodiments of the present application, such as the processes or functions of FIG. 5, FIG. 6, FIG. 7, or FIG. 8, are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium. For example, the computer instructions can be transmitted from one website, computer, training device, or data center to another website, computer, training device, or data center through a wired (such as a coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (such as infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be used by a computer or data storage device such as a training device, data center, etc. that includes one or more available media sets. The available media can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), or a semiconductor medium (for example, a solid state disk (SSD)), etc.

[0280] The embodiments of the present application also provide a chip system, which includes a processor coupled with a memory, and the processor executes a computer program stored in the memory to implement the method according to the above various method embodiments. The chip system can be a single chip or a chip module composed of multiple chips.

[0281] In the above embodiments, the description of each embodiment is focused on, and the part not described or recorded in a certain embodiment can be referred to the relevant description of other embodiments. It should be understood that the size of the serial number of each step in the above embodiments does not mean the order of execution, and the execution order of each process should be determined according to its function and inherent logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. In addition, in the description of the present application and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the description, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features limited by "first", "second", "third", "fourth" can be explicitly or implicitly included one or more features. In addition, it should be understood that at least one of the embodiments of the present application includes one or more, and the plurality refers to more than or equal to two. In the embodiments of the present application, "and / or" is only a description of the association between the associated objects, which means that there are three kinds of relationships, for example, A and / or B, which can represent the existence of A, the existence of A and B, and the existence of B. In addition, the character " / " in this paper generally represents that the front and rear associated objects are a kind of "or" relationship.

[0282] In the present application, the reference "one embodiment" or "some embodiments" means that in one or more embodiments of the present application, the specific features, structures or characteristics described in connection with the embodiment are included. Therefore, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in other some embodiments" and the like appearing in the specification are not necessarily all referring to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized.

[0283] Finally, it should be noted that: the above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto, any change or replacement within the technical scope disclosed in the present application should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A method of establishing a communication connection, characterized by The application is applied to an electronic device, which comprises an application processor and a first communication chip: The application processor sends a connection proxy request to the first communication chip, the connection proxy request being used to instruct the first communication chip to proxy a communication connection between the application processor and a server of a push service; The first communication chip establishes a first communication connection with the server using a first network supported by the first communication chip in response to the connection proxy request; If the first communication connection is disconnected, the first communication chip re-establishes a first communication connection with the server using the first network.

2. The method of claim 1, wherein, The electronic device further comprises a second communication chip, the first communication chip communicates with the server using the first communication connection, and the second communication chip does not establish a communication connection with the server; the method further comprises: If the first communication chip predicts that the first communication connection will enter a weak network environment in a first time period in the future, the first communication chip sends first synchronization information to the second communication chip, the first synchronization information being used to instruct the second communication chip to establish a communication connection with the server; The second communication chip establishes a second communication connection with the server using a second network in response to the first synchronization information, the second network being a network supported by the second communication chip, and the second communication connection being established earlier than the disconnection time of the first communication connection; When the first communication connection is disconnected or within a second time period before the first communication connection is disconnected, the second communication chip communicates with the server using the second communication connection to switch a communication connection carrying the push service from the first communication connection to the second communication connection.

3. The method of claim 1, wherein, The electronic device further comprises a second communication chip, the first communication chip communicates with the server using the first communication connection, and the second communication chip does not establish a communication connection with the server; the method further comprises: The second communication chip accesses a second network, establishes a second communication connection with the server using the second network after determining that the network quality of the second network reaches a target quality, and sends second synchronization information to the first communication chip, the second synchronization information being used to instruct the first communication chip to release the first communication connection, the second network being a network supported by the second communication chip; The first communication chip releases the first communication connection in response to the second synchronization information; The second communication chip communicates with the server using the second communication connection to switch a communication connection carrying the push service from the first communication connection to the second communication connection.

4. The method according to any one of claims 1 to 3, characterized in that, After the first communication connection is established, the method further comprises: The first communication chip sends a heartbeat message to the server through the first communication connection according to a heartbeat timer and a timeout timer to maintain the first communication connection.

5. The method of claim 4, wherein, The first communication chip sends a heartbeat message to the server through the first communication connection according to a heartbeat timer and a timeout timer to maintain the first communication connection, comprising: The first communication chip determines a time point for sending the heartbeat message through a heartbeat period of the heartbeat timer; When the time point arrives, the first communication chip sends the heartbeat message to the server through the first communication connection; After sending the heartbeat message, if the first communication chip receives an acknowledgement message within a timeout threshold of the timeout timer, the first communication chip determines that the first communication connection is valid, and the acknowledgement message is a message returned by the server for the heartbeat message.

6. The method of claim 5, wherein, After determining the time point for sending the heartbeat message, the method further comprises: If the first communication chip receives a push message from the server through the first communication connection before the time point arrives, the first communication chip re-determines the time point for sending the heartbeat message according to a receiving time point of the push message and the heartbeat period, and the re-determined time point for sending the heartbeat message is later than the previously determined time point.

7. The method of claim 6, wherein, The method further comprises: The first communication chip transmits the push message to the application processor; The application processor processes the push message, obtains a processing result, and transmits the processing result to the first communication chip; The first communication chip sends a reply message to the server through the first communication connection according to the processing result.

8. The method according to any one of claims 1 to 7, characterized in that, After the cellular chip sends uplink data to the server, the method further comprises: The cellular chip determines whether a release condition is met; If the release condition is met, the cellular chip releases a radio resource control (RRC) connection; The cellular chip is the first communication chip or the second communication chip.

9. The method of claim 8, wherein, The cellular chip determining whether the release condition is met comprises: If there are multiple data radio bearers in a packet data convergence protocol (PDCP), the cellular chip determines that the release condition is not met; If the PDCP only has push services, the cellular chip determines that the release condition is met; If a network card of the application processor is in an inactive state, or there is a network card in an active state in the network card of the application processor and the application processor is in a sleep state, the cellular chip determines that the release condition is met.

10. The method of claim 8, wherein, The cellular chip releasing the RRC connection comprises: The cellular chip determines whether the PDCP has data transmission within a preset time period; If the PDCP has no data transmission within the preset time period, the cellular chip releases the RRC connection.

11. An electronic device, comprising: The application processor and the first communication chip comprise: The application processor is configured to send a connection proxy request to the first communication chip, and the connection proxy request is used to instruct the first communication chip to proxy a communication connection between the application processor and a server of a push service; The first communication chip is configured to establish a first communication connection with the server using a first network supported by the communication chip in response to the connection proxy request, and re-establish the first communication connection with the server using the first network if the first communication connection is disconnected.

12. The apparatus of claim 11, wherein, The electronic device further comprises a second communication chip; the first communication chip communicates with the server using the first communication connection, and the second communication chip does not establish a communication connection with the server; The first communication chip is configured to: if it is predicted that the first communication connection enters a weak network environment in a first time period in the future, send first synchronization information to the second communication chip, the first synchronization information being used to instruct the second communication chip to establish a communication connection with the server; The second communication chip is configured to: in response to the first synchronization information, establish a second communication connection with the server using a second network, the second network being a network supported by the second communication chip, and the establishment time of the second communication connection being earlier than the disconnection time of the first communication connection; When the first communication connection is disconnected or within a second time period before the first communication connection is disconnected, the second communication connection is used to communicate with the server to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

13. The apparatus of claim 11, wherein, The electronic device further comprises a second communication chip, the first communication chip communicates with the server using the first communication connection, and the second communication chip does not establish a communication connection with the server; The second communication chip is configured to: after accessing a second network and determining that the network quality of the second network reaches a target quality, establish a second communication connection with the server using the second network, and send second synchronization information to the first communication chip, the second synchronization information being used to instruct the first communication chip to release the first communication connection, the second network being a network supported by the second communication chip; The first communication chip is configured to: in response to the second synchronization information, release the first communication connection; The second communication chip is further configured to: use the second communication connection to communicate with the server to switch the communication connection carrying the push service from the first communication connection to the second communication connection.

14. The apparatus of any one of claims 11 to 13, wherein, After establishing the first communication connection, the first communication chip is further configured to: according to a heartbeat timer and a timeout timer, send a heartbeat message to the server through the first communication connection to maintain the first communication connection.

15. The apparatus of claim 14, wherein, The first communication chip is specifically configured to: determine a time point for sending the heartbeat message through a heartbeat period of the heartbeat timer; send the heartbeat message to the server through the first communication connection when the time point arrives; after sending the heartbeat message, if an acknowledgement message is received within a timeout threshold of the timeout timer, it is determined that the first communication connection is valid, the acknowledgement message being a message returned by the server in response to the heartbeat message.

16. The apparatus of claim 15, wherein, The first communication chip is further configured to: if a push message of the server is received through the first communication connection before the time point arrives, the time point for sending the heartbeat message is re-determined according to a reception time point of the push message and the heartbeat period, and the re-determined time point for sending the heartbeat message is later than the previously determined time point.

17. The apparatus of claim 16, wherein, The first communication chip is further configured to transmit the push message to the application processor. The application processor is configured to process the push message, obtain a processing result, and transmit the processing result to the first communication chip. The first communication chip is further configured to send a reply message to the server through the first communication connection according to the processing result.

18. The apparatus of any one of claims 11 to 17, wherein, After the cellular chip sends uplink data to the server, the cellular chip is further configured to: determine whether a release condition is met; release an RRC connection if the release condition is met; The cellular chip is the first communication chip or the second communication chip.

19. The apparatus of claim 18, wherein, The cellular chip is specifically configured to: determine that the release condition is not met if there are multiple data radio bearers in a packet data convergence protocol (PDCP); determine that the release condition is met if the PDCP only has push services; determine that the release condition is met if a network card of the application processor is in an inactive state or there is a network card in an active state and the application processor is in a sleep state.

20. The apparatus of claim 18, wherein, The cellular chip is specifically configured to: determine whether there is data transmission in the PDCP within a preset time period; release the RRC connection if there is no data transmission in the PDCP within the preset time period.

21. A chip system, characterized by The chip system includes a processor coupled with a memory, and the processor executes a computer program stored in the memory to implement the method of any one of claims 1 to 10.

22. A computer-readable storage medium, the computer-readable storage medium storing a computer program, characterized in that, The computer program, when executed by the processor, implements the method of any one of claims 1 to 10.

23. A computer program product, characterised in that, When the computer program product runs on the electronic device, the electronic device is caused to perform the method of any one of claims 1 to 10.

Citation Information

Patent Citations

  • Information sending method, terminal device, application server and system

    CN103546876A

  • Proxy-based push service

    CN104054322A

  • Method and device for transmitting heartbeat information

    CN108768763A

  • Data connection method and mobile terminal

    CN112491810A

  • Method For Acting as Service Agent, Modem, and Terminal

    US20150121100A1