Method for establishing communication connection, electronic equipment, chip system and storage medium
By pushing long-connection management down to the communication chip layer, with the communication chip acting as an intermediary between the application processor and the server, the problem of high device power consumption is solved, resulting in lower power consumption and smoother long-connection management.
Patent Information
- Application Number
- CN202411109298.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-13
- Publication Date
- 2026-02-13
AI Technical Summary
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.
By shifting long-term connection management from the application processor 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.
It reduces device power consumption, especially during the establishment, restoration, and disconnection of long connections, as it eliminates the need to wake up the application processor, thus reducing unnecessary power consumption.
Smart Images

Figure CN121531434A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of terminal technology, and in particular to a method for establishing a communication connection, an electronic device, a chip system, and a storage medium. Background Technology
[0002] In push notification services, when a server needs to push a message to a client device, it can send the message via a persistent connection. A persistent connection is a communication connection maintained between the server and the client device for an extended period. After establishing a communication connection with the server, the client device can periodically send heartbeat messages to the server to maintain the availability of the communication connection over a long period.
[0003] Currently, the application processor (AP) of the client device is responsible for managing persistent connections. Specifically, when an abnormal disconnection of a persistent connection is detected (such as a timeout due to a weak network), or when a persistent connection is lost due to a lack of network access but the network is detected to have recovered, the AP needs to be woken up, and the AP will re-establish the persistent connection with the server through the communication chip.
[0004] Managing long-term connections requires the involvement of two hardware architectures with different functions: the AP and the communication chip, resulting in higher device power consumption. Summary of the Invention
[0005] This 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 device power consumption.
[0006] In a first aspect, embodiments of this application provide a method for establishing a communication connection, applied to an electronic device, the electronic device including an application processor and a first communication chip. In this method, the application processor sends a connection proxy request to the first communication chip, the connection proxy request instructing the first communication chip to proxy the communication connection between the application processor and a push service server; in response to the connection proxy request, the first communication chip establishes a first communication connection with the server using a first network supported by the first communication chip; if the first communication connection is broken, the first communication chip re-establishes the first communication connection with the server using the first network.
[0007] This application embodiment uses a communication chip to proxy the communication connection between the application processor and the server. This allows the communication chip to directly establish a communication connection with the server without the application processor's involvement, reducing device power consumption. Furthermore, when it's necessary to re-establish a long-term connection (e.g., after a long-term connection is lost due to network interruption and network recovery is detected, or after an abnormal disconnection), the communication chip can also directly re-establish the communication connection with the server without waking up the AP, further reducing device power consumption. In other words, by moving the long-term connection management from the AP layer to the communication chip layer, the main power consumption for long-term connection management becomes the power consumption of the communication chip, thereby reducing device power consumption.
[0008] In some possible implementations of the first aspect, the electronic device further includes a second communication chip; the first communication chip uses a first communication connection to communicate with the server, i.e., the first communication connection carries the push service, while the second communication chip does not establish a communication connection with the server. In this case, if the first communication chip predicts that the first communication connection will enter a weak network environment in a future first time period, the first communication chip can send a first synchronization message to the second communication chip, which instructs the second communication chip to establish a communication connection with the server. In response to the first synchronization message, the second communication chip uses a second network to establish a second communication connection with the server. The second network is a network supported by the second communication chip, and the establishment time of the second communication connection is earlier than the disconnection time of the first communication connection. When the first communication connection is disconnected or during 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 to switch the communication connection carrying the push service from the first communication connection to the second communication connection.
[0009] In this implementation, by synchronizing the signals 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 waiting for the first communication connection to be disconnected before establishing a second communication connection with the server. This allows for a smoother switch of the push service from the first communication connection to the second communication connection.
[0010] In some possible implementations of the first aspect, the electronic device further includes a second communication chip; the first communication chip communicates with the server using a first communication connection, i.e., the first communication connection is the communication connection carrying the push service, and the second communication chip has not established a communication connection with the server. At this time, the second communication chip accesses a second network, and after determining that the network quality of the second network reaches the target quality, it establishes a second communication connection with the server using the second network and 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. The second network is a network supported by the second communication chip. In response to the second synchronization information, the first communication chip releases the first communication connection. The second communication chip then 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, after the network connection stabilizes, the push service is switched from the first communication connection to the second communication connection.
[0011] In this implementation, by synchronizing the signals between the first and second communication chips, the second communication chip can wait until the network quality of the second network is good (i.e., the second network has reached stability) and can provide a stable long-term connection service before instructing 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. 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.
[0012] In some possible implementations 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 a heartbeat timer and a timeout timer to maintain the first communication connection. In this way, when the time for sending the heartbeat message arrives, only the first communication chip is woken up, and it directly sends the heartbeat message to the server without waking up the AP, further reducing device power consumption.
[0013] In some possible implementations of the first aspect, during the process of the first communication chip maintaining the first communication connection through heartbeat messages, the first communication chip can determine the time point for sending heartbeat messages by the heartbeat period of the heartbeat timer; when the time point arrives, the first communication chip sends heartbeat messages to the server through the first communication connection; after sending heartbeat messages, if the first communication chip receives an acknowledgment message within the timeout threshold of the timeout timer, it determines that the first communication connection is valid, and the acknowledgment message is the message returned by the server in response to the heartbeat messages.
[0014] In this implementation, after the long connection is moved from the AP layer to the communication chip layer, the heartbeat timer and the service timeout timer are not affected by the unified management and alignment of the operating system on the AP. The heartbeat timer and the service timeout timer can work according to various set periods, thereby improving the stability of the long connection.
[0015] In some possible implementations 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, it re-determines the time point for sending the heartbeat message based on the time point of receiving the push message and the heartbeat cycle. The re-determined time point is later than the previously determined time point.
[0016] In this implementation, after the long-lived connection is moved down from the AP layer to the communication chip layer, the heartbeat timer and service timeout timer are not affected by the unified management and alignment of the operating system on the AP. Thus, after receiving a push message from the server, the heartbeat timer can be postponed to the next cycle, reducing the number of heartbeat messages sent and further reducing device power consumption.
[0017] In some possible implementations of the first aspect, the first communication chip transmits the push message to the application processor; the application processor processes the push message, obtains the processing result, and transmits the processing result to the target communication chip; the first communication chip sends a reply message to the server through the first communication connection based on the processing result. In this way, the long-term connection is moved down from the AP layer to the communication chip layer, allowing push message processing and system wake-up to be completed at the communication chip layer, further reducing device power consumption.
[0018] In some possible implementations of the first aspect, after the cellular chip sends uplink data to the server, it can also determine whether the release condition is met; if the release condition is met, the cellular chip releases the RRC connection. The cellular chip is either a first communication chip or a second communication chip.
[0019] In this implementation, by moving the long-lived 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 device power consumption.
[0020] In some possible implementations of the first aspect, during the process of determining whether the release condition is met by the cellular chip, if there are multiple data radio bearers in the Packet Data Convergence Protocol (PDCP), the cellular chip determines that the release condition is not met; if there is only push service in PDCP, the release condition is met; if the network card of the application processor is inactive, or if the network card of the application processor has an active network card and the application processor is in a sleep state, the cellular chip determines that the release condition is met.
[0021] In some possible implementations of the first aspect, during the process of the cellular chip releasing the RRC connection, 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.
[0022] Secondly, embodiments of this application provide an electronic device, including an application processor and a first communication chip:
[0023] The application processor is used 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 the communication connection between the application processor and the server of the push service;
[0024] The first communication chip is used to: in response to a connection proxy request, establish a first communication connection with the server using a first network supported by the first communication chip; if the first communication connection is broken, the first communication chip re-establishes the first communication connection with the server using the first network.
[0025] In some possible implementations of the second aspect, the electronic device further includes a second communication chip; the first communication chip communicates with the server using a first communication connection, while the second communication chip does not establish a communication connection with the server;
[0026] The first communication chip is used to: if it is predicted that the first communication connection will enter a weak network environment in the first time period in the future, send the first synchronization information to the second communication chip. The first synchronization information is used to instruct the second communication chip to establish a communication connection with the server.
[0027] The second communication chip is used to: in response to the first synchronization information, establish a second communication connection with the server using a second network, wherein the second network is a network supported by the second communication chip, and the establishment time of the second communication connection is earlier than the disconnection time of the first communication connection; when the first communication connection is disconnected or during a second time period before the first communication connection is disconnected, communicate 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.
[0028] In some possible implementations of the second aspect, the electronic device also includes a second communication chip; the first communication connection is a communication connection that carries the push service, that is, the first communication chip uses the first communication connection to communicate with the server; the second communication chip does not establish a communication connection with the server.
[0029] The second communication chip is used to: after accessing the second network and determining that the network quality of the second network has reached 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. The second synchronization information is used to instruct the first communication chip to release the first communication connection. The second network is a network supported by the second communication chip.
[0030] The first communication chip is used to: release the first communication connection in response to the second synchronization information;
[0031] The second communication chip is also used to: communicate 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.
[0032] In some possible implementations of the second aspect, after establishing the first communication connection, the first communication chip is further used to: send a heartbeat message to the server through the first communication connection according to the heartbeat timer and the timeout timer, so as to maintain the first communication connection.
[0033] In some possible implementations of the second aspect, the first communication chip is also used to: determine the time point for sending a heartbeat message by the heartbeat period of a heartbeat timer; when the time point arrives, send a heartbeat message to the server through the first communication connection; after sending the heartbeat message, if an acknowledgment message is received within the timeout threshold of the timeout timer, then the first communication connection is determined to be valid, and the acknowledgment message is a message returned by the server in response to the heartbeat message.
[0034] In some possible implementations of the second aspect, the first communication chip is also used to: if a push message from the server is received through the first communication connection before the time point arrives, then, based on the time point of receiving the push message and the heartbeat cycle, redetermine the time point for sending the heartbeat message, wherein the redetermined time point is later than the previously determined time point.
[0035] In some possible implementations of the second aspect, 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 the 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 based on the processing result.
[0036] In some possible implementations of the second aspect, after the cellular chip sends uplink data to the server, the cellular chip is also used to: determine whether the release condition is met; if the release condition is met, release the RRC connection; the cellular chip is a first communication chip or a second communication chip.
[0037] In some possible implementations of the second aspect, the cellular chip is specifically used to: determine that the release condition is not met if there are multiple data radio bearers in the Packet Data Convergence Protocol (PDCP); determine that the release condition is met if there is only push service in PDCP; and determine that the release condition is met if the application processor's network card is inactive, or if the application processor's network card has an active network card and the application processor is in a sleep state.
[0038] In some possible implementations of the second aspect, the cellular chip is specifically used to: determine whether the PDCP has data transmission within a preset time period; if the PDCP has no data transmission within the preset time period, release the RRC connection.
[0039] Thirdly, embodiments of this application provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the method described in any of the first aspects above.
[0040] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method described in any of the first aspects above.
[0041] Fifthly, embodiments of this application provide a chip system including a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the method described in any of the first aspects above. The chip system may be a single chip or a chip module composed of multiple chips.
[0042] In a sixth aspect, embodiments of this application provide a computer program product that, when run on an electronic device, causes the electronic device to perform the method described in any of the first aspects above.
[0043] It is understood that the beneficial effects of the second to sixth aspects mentioned above can be found in the relevant descriptions in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0044] Figure 1 A schematic diagram illustrating the message push process in an instant messaging service scenario provided in this application embodiment;
[0045] Figure 2 This is a schematic diagram of a push service scenario provided in an embodiment of this application;
[0046] Figure 3 This is a schematic diagram of the structure of the electronic device 300 provided in the embodiments of this application;
[0047] Figure 4A schematic block diagram of a system architecture provided in this application embodiment;
[0048] Figure 5 A schematic diagram illustrating a process of a communication chip acting as a proxy for a long connection, as provided in an embodiment of this application;
[0049] Figure 6 This is a schematic diagram illustrating the processing of heartbeat messages and push messages provided in an embodiment of this application.
[0050] Figure 7 This is a schematic diagram of the connection switching process provided in an embodiment of this application;
[0051] Figure 8 This is a schematic diagram of the connection switching process provided in an embodiment of this application;
[0052] Figure 9 A schematic diagram of the system architecture for the push service provided in the embodiments of this application;
[0053] Figure 10 This is a schematic diagram of the RRC rapid release process provided in an embodiment of this application;
[0054] Figure 11 This is a schematic block diagram of an electronic device 300 provided in an embodiment of this application. Detailed Implementation
[0055] In the following description, specific details such as particular system architectures and technologies are set forth for illustrative purposes and not for limiting purposes, in order to provide a thorough understanding of the embodiments of this application.
[0056] See Figure 1 The diagram shown is a schematic of a message push process in an instant messaging scenario provided by an embodiment of this application. The instant messaging service scenario may include mobile phone 11, mobile phone 12, server 13 and push cloud 14.
[0057] Both mobile phones 11 and 12 have an instant messaging application installed, and server 13 is the server for the instant messaging application. Push cloud 14 is a cloud platform used to implement push services, which can be specifically represented as a push server.
[0058] Phone 12 is in screen-off mode and is connected to a cellular or Wi-Fi network. Phone 12 has activated push notifications for its instant messaging application and established a persistent connection with the push cloud 14. This persistent connection can be established using either a cellular network or a Wi-Fi network.
[0059] Mobile phone 11 displays the chat interface 111 of an instant messaging application, indicating that the user is using the instant messaging application on mobile phone 11. When the user sends a chat message containing chat content 112 to mobile phone 12 using the instant messaging application on mobile phone 11, mobile phone 11 sends the chat message to server 13 based on the chat content 112. Server 13 then sends the chat message to push cloud 14. Push cloud 14 pushes the chat message to mobile phone 12 via a long connection. After receiving the chat message, mobile phone 12 displays a message notification 122 on the lock screen 121. The user can tap the message notification 122 on the lock screen 121 to launch the instant messaging application and display the chat message. In this way, message push via a long connection allows mobile phone 12 to receive chat messages sent by mobile phone 11 and display them on the screen even if the instant messaging application on mobile phone 12 is closed.
[0060] Push notifications can be applied not only to instant messaging scenarios but also to other scenarios. For example, for news and information applications, servers can push news and information to mobile phones via long-lived connections; for e-commerce applications, servers can push order status and promotional information to mobile phones via long-lived connections.
[0061] In related technologies, the AP on the client device is responsible for establishing long-term connections, re-establishing connections when the network recovers, re-establishing connections when abnormal connections are lost, and periodically sending heartbeat messages.
[0062] For example, see Figure 2 The illustrated schematic diagram of the push service scenario provided in this application embodiment shows that the client device 21 includes an application processor 211, a notification management service 213, and an application (App) 212. The client device 21 is a device with the client (i.e., application 212) installed, and the server 23 is the server for application 212. Application 212 can interact with server 23 via a network. The client device 21 can be a mobile phone or tablet computer, etc.
[0063] Application processor 211 includes Push Service Ability (Push SA). Push Service Ability is a push service framework that provides push services. Push services are used for long-connection management and the implementation of long-connection related services.
[0064] like Figure 1As shown, when the push service in application processor 21 detects network availability, it uses that network to establish a long-lived socket connection with push cloud 22. Specifically, the push service can monitor network availability via a communication chip (not shown in the figure). For example, when the communication chip is a cellular chip, the push service can monitor cellular network availability via the cellular chip, and when it detects cellular network availability, it uses the cellular network to establish a long-lived connection with push cloud 22.
[0065] After establishing a persistent connection, the push service periodically sends heartbeat messages to the push cloud 22 via the persistent connection according to the set heartbeat period to maintain the availability of the persistent connection. After receiving the heartbeat message, the push cloud 22 will return an acknowledgment message to the client device 21 to notify the client device 21 that the heartbeat message has been received.
[0066] After a 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, so as to reduce the power consumption of the device; when it is necessary to send a heartbeat message, the application processor 211 is woken up and the application processor 211 sends the heartbeat message through the communication chip.
[0067] When server 23 needs to push a message to client device 21, it calls the message sending interface of push cloud 22 to send the message to client device 21. Push cloud 22 then sends the downlink message to client device 21 via a long connection based on the message that server 23 needs to send.
[0068] After receiving a downlink message via a long connection, the push service in client device 21 processes it. If the downlink message is a background message, the push service launches application 212 and transmits the downlink message to application 212 for processing. If the downlink message is a notification message, the push service calls the interface of notification management service 213 to display the downlink message in the notification bar. The user can launch application 212 by clicking the notification message.
[0069] After a long connection is established, it will be disconnected due to the lack of network signal. At this time, when the network is detected to be restored, the application processor 211 will be woken up, and the push service of the application processor 211 will re-establish the long connection with the push cloud 22 through the communication chip.
[0070] After a long-lived connection is established, it may experience abnormal disconnection. For example, the long-lived connection will be disconnected when a weak network timeout occurs or when Network Address Translation (NAT) expires. A weak network timeout can refer to the failure to receive an acknowledgment message within a specified time after sending a heartbeat message. If no acknowledgment message is received within the specified time, the long-lived connection is considered to have been broken. In this case, upon detecting an abnormal disconnection of the long-lived connection, the application processor 211 will be awakened, and the push service of the application processor 211 will re-establish the long-lived connection with the push cloud 22 through the communication chip.
[0071] After a long connection is established, if it needs to be terminated (i.e., actively disconnected), the application processor 211 is woken up, and the push server of the application processor 211 disconnects the long connection with the push cloud 22 through the communication chip. During the establishment of the long connection, both the AP and the communication chip are required, resulting in high power consumption for both the AP and the communication chip. During network recovery or re-establishment after an abnormal disconnection, the termination of the long connection, and the periodic sending of heartbeat messages, the AP needs to be woken up, and the AP performs the corresponding processes through the communication chip, resulting in high power consumption for the device.
[0072] To address the high power consumption issue caused by AP managing long-lived connections mentioned above, this application embodiment addresses this problem by having the communication chip handle long-lived connections, thus shifting the management of these connections from the AP layer to the communication chip layer. This way, only the communication chip needs to participate during long-lived connection establishment, eliminating the need for AP involvement. The power consumption is primarily that of the communication chip, thereby reducing overall device power consumption. Furthermore, during reconnection (e.g., network recovery or abnormal disconnection) and active disconnection of long-lived connections, the AP does not need to be woken up; instead, the communication chip directly re-establishes and actively disconnects the long-lived connection, further reducing device power consumption.
[0073] The technical solutions provided in this application can be applied to electronic devices such as mobile phones, tablets, in-vehicle systems, laptops, and wearable devices. No specific type or structure of the electronic device is limited herein.
[0074] For example, Figure 3 A schematic diagram of the structure of electronic device 300 is shown. Electronic device 300 may include, but is not limited to, processor 310, memory 320, mobile communication module 330, and wireless communication module 340.
[0075] The illustrated structures in this application do not constitute a specific limitation on the electronic device 300. In other embodiments of this application, the electronic device 300 may include more or fewer components than illustrated, or combine some components, or split some components, or have different component arrangements. The illustrated components may 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 may also include an audio module, microphone, display screen, universal serial bus (USB) interface, charging management module, power management module, camera, battery, speaker, receiver, headphone jack, sensor, buttons, motor, indicator, and subscriber identification module (SIM card) interface, etc.
[0076] Processor 310 may include one or more processing units, such as an application processor (AP) and a controller. These processing units may be independent devices or integrated into one or more processors. The controller can generate operation control signals based on instruction opcodes and timing signals to control instruction fetching and execution.
[0077] The memory 320 can be used to store computer executable program code, including instructions. The memory 320 may include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as image playback), etc. The data storage area may store data created during the use of the electronic device 300. Furthermore, the memory 320 may include high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device, flash memory device, universal flash storage (UFS), etc. The processor 310 executes various functional applications and data processing of the electronic device 300 by running instructions stored in the memory 320 and / or instructions stored in memory disposed within the processor.
[0078] The wireless communication function of electronic device 300 can be realized through antenna 1, antenna 2, mobile communication module 330, wireless communication module 340, modem, and baseband processor.
[0079] Antenna 1 and antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 300 can be used to cover one or more communication frequency bands. Different antennas can also be multiplexed to improve antenna utilization. For example, antenna 1 can be multiplexed as a diversity antenna for a wireless local area network. In some other embodiments, the antennas can be used in conjunction with a tuning switch.
[0080] The mobile communication module 330 can provide solutions for wireless communication, including 2G / 3G / 4G / 5G, applied to the electronic device 300. The mobile communication module 330 may include at least one filter, switch, power amplifier, low noise amplifier (LNA), etc. The mobile communication module 330 can receive electromagnetic waves via antenna 1, and perform filtering, amplification, and other processing on the received electromagnetic waves before transmitting them to a modem for demodulation. The mobile communication module 330 can also amplify the signal modulated by the modem and convert it into electromagnetic waves for radiation via antenna 1. In some embodiments, at least some functional modules of the mobile communication module 330 may be housed in the processor 310. In some embodiments, at least some functional modules of the mobile communication module 330 and at least some modules of the processor 310 may be housed in the same device.
[0081] A modem may include a modulator and a demodulator. The modulator modulates a low-frequency baseband signal to be transmitted into a mid-to-high frequency signal. The demodulator demodulates the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to a baseband processor for processing. After processing by the baseband processor, the low-frequency baseband signal is transmitted to an application processor. In some embodiments, the modem may be a separate device. In other embodiments, the modem may be independent of the processor 310 and may be housed within the same device as the mobile communication module 330 or other functional modules.
[0082] The wireless communication module 340 can provide solutions for wireless communication applications on the electronic device 300, including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), and infrared (IR) technologies. The wireless communication module 340 can be one or more devices integrating at least one communication processing module. The wireless communication module 340 receives electromagnetic waves via antenna 2, performs frequency modulation and filtering of the electromagnetic wave signals, and sends the processed signal to processor 310. The wireless communication module 340 can also receive signals to be transmitted from processor 310, perform frequency modulation and amplification, and convert them into electromagnetic waves for radiation via antenna 2.
[0083] In some embodiments, antenna 1 of electronic device 300 is coupled to mobile communication module 330, and antenna 2 is coupled to wireless communication module 340, enabling electronic device 300 to communicate with networks and other devices via wireless communication technology. The wireless communication technology may 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 technologies, etc. The GNSS may include the Global Positioning System (GPS), the Global Navigation Satellite System (GLONASS), the BeiDou Navigation Satellite System (BDS), the Quasi-Zenith Satellite System (QZSS), and / or satellite-based augmentation systems (SBAS).
[0084] It should be noted that the electronic device 300 may include both the mobile communication module 330 and the wireless communication module 340; or it may include only one of the mobile communication module 330 and the wireless communication module 340.
[0085] After exemplarily introducing the hardware architecture of the electronic device 300, the software architecture of the electronic device 300 will be exemplarily introduced below.
[0086] The software system of electronic device 300 can adopt a layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture. This application embodiment uses a layered architecture system as an example to illustrate the software structure of electronic device 300.
[0087] See Figure 4The illustrated embodiment of this application provides a schematic block diagram of a system architecture, which includes an electronic device 300 and a cloud, the cloud of which may include a push server.
[0088] A layered architecture divides software into several layers, each with a clear role and function. Layers communicate with each other through software interfaces. In some embodiments, such as... Figure 4 As shown, the software system is divided into four layers, from top to bottom: application layer, framework and system service layer, kernel and driver layer, and chip layer.
[0089] The application layer may include a series of application packages. For example, an application package may include applications such as camera, gallery, calendar, calling, map, music, video, and text messaging.
[0090] The software system of the electronic device 300 can be an Android operating system, a HarmonyOS operating system, or an iOS operating system. When the software system of the electronic device 300 is an Android operating system, the application layer can be an Android application; when the software system of the electronic device 300 is a HarmonyOS operating system, the application layer can be a HarmonyOS application.
[0091] In push notification services, applications can request push tokens from the cloud. Push tokens are used to push messages. For example, when a push server needs to push a message to an application on electronic device 300, it can include a push token in the message to indicate that the message is intended for the application on electronic device 300.
[0092] For example, the application can be an instant messaging application (such as a chat application), a news application, or an e-commerce application.
[0093] The framework and system service layer can provide system services, as well as application programming interfaces (APIs) and programming frameworks for applications in the application layer.
[0094] like Figure 4 As shown, the framework and system service layer may include push service, MLPS service, and modem engine. Push service may include connection management, Wi-Fi connection proxy, and cellular connection proxy.
[0095] The push service manages persistent push connections and can determine the number of persistent connections and the communication chip used based on device and network conditions. For example, the push service can determine whether to use a Wi-Fi chip or a cellular chip to establish a persistent connection based on device and network conditions; it can also determine whether to use both Wi-Fi and cellular chips to establish persistent connections simultaneously, or to use only one of the chips to establish a persistent connection.
[0096] A Wi-Fi connection proxy is a proxy that establishes a long-lived connection using a Wi-Fi chip; a cellular connection proxy is a proxy that establishes a long-lived connection using a cellular chip.
[0097] The MLPS service is an interface component provided by the Wi-Fi chip to applications, used to provide a message transmission channel between the push service and a second push proxy. The MLPS service is unaware of the specific business of the push proxy.
[0098] The modem engine is the interface component provided by the cellular chip to applications, used to provide a message transmission channel between the push service and the first push proxy. The modem engine is unaware of the specific business of the push proxy.
[0099] The chip layer can include Wi-Fi chips and cellular chips. The cellular chip includes a first push agent, and the Wi-Fi chip includes a second push agent.
[0100] The first push agent is the push agent module of the cellular chip, used to manage the lifecycle of long-lived connections established using the cellular network. This lifecycle can include processes such as connection establishment, termination, recovery, and reconstruction. Connection establishment refers to the initial establishment of a long-lived connection; recovery refers to the process of re-establishing a long-lived connection with the server when an abnormal connection loss is detected; reconstruction refers to the process of re-establishing a long-lived connection with the server when network recovery is detected. Termination can refer to actively disconnecting a long-lived connection.
[0101] The second push agent is the push agent module of the Wi-Fi chip, which is used to manage the lifecycle of long-lived connections established using the Wi-Fi network.
[0102] The kernel and driver layers can include inter-process communication (IPC), shared memory (SHMEM), and the HISIMessage Interface. The MLPS service communicates with the Wi-Fi chip via IPC / SHMEM; the modem engine communicates with the cellular chip via the HISIMessage Interface.
[0103] 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.
[0104] It should be noted that, Figure 4 The software system architecture of the illustrated electronic device 300 is merely an example; in other embodiments, Figure 4 The chip layer in the device can also include only one chip, for example, only a Wi-Fi chip or a cellular chip; it can also include multiple chips, and the types of chips included can 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 to corresponding modules accordingly, without limitation here.
[0105] 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.
[0106] 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.
[0107] 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.
[0108] For example, electronic device 300 is using a long-lived connection established with a server via a cellular chip to carry out push services. At this time, electronic device 300 also accesses a Wi-Fi network via a Wi-Fi chip and uses the Wi-Fi network to establish a long-lived connection with the server. The Wi-Fi chip can detect that the Wi-Fi network is stable, or that the Wi-Fi network is stable and the long-lived connection established using the Wi-Fi network is stable, before notifying the cellular chip to release the long-lived connection, thereby switching the push service to the long-lived connection established using the Wi-Fi network. This way, the push service can wait for the Wi-Fi chip's network to stabilize before switching, avoiding packet loss due to network instability, which could prevent the push service from functioning.
[0109] The following uses electronic device 300 as an example to illustrate the technical solution provided in the embodiments of this application.
[0110] Please see Figure 5 This is a schematic diagram illustrating a process of a communication chip acting as a proxy for a long connection, as provided in an embodiment of this application. This process may include, but is not limited to, the following steps:
[0111] Step S501: The application processor sends a connection proxy request to the first communication chip.
[0112] The application processor and the first communication chip are devices or modules within the electronic device 300. The first communication chip may be a Wi-Fi chip, a cellular chip, or other types of communication chips, and is not limited thereto.
[0113] A connection proxy request is used to indicate the communication connection between the first communication chip proxy application processor and the push service server. The push service server can be, for example, a push server in the cloud or a push cloud. That is, the connection proxy request is used to indicate a long-lived connection by the first communication chip proxy.
[0114] The application processor has a push service, which can send connection proxy requests to the first communication chip.
[0115] Step S502: In response to the connection proxy request, the first communication chip establishes a first communication connection with the server using the first network supported by the first communication chip.
[0116] For example, if the first communication chip is a Wi-Fi chip and the first network is a Wi-Fi network, then the first communication connection established using the Wi-Fi network is a Wi-Fi connection. Alternatively, if the first communication chip is a cellular chip and the first network is a cellular network, then the first communication connection established using the cellular network is a cellular connection.
[0117] The first communication chip can establish a first communication connection with the server using the first network, based on the server address and heartbeat-related information provided by the push service. The heartbeat-related information may include, but is not limited to, the heartbeat message sending cycle, heartbeat timeout, authentication information, and heartbeat message content. Optionally, the connection proxy request may include the server address and heartbeat-related information. The server is a push server.
[0118] In related technologies, long-lived connections are managed by the AP's push service. Establishing the first communication connection requires the joint participation of both the AP and the communication chip, and the power consumption during this process includes the power consumption generated by both the AP and the communication chip. However, in this embodiment, the push service registers connection proxy services. After completing the proxy startup process, the communication chip can directly establish a communication connection with the server without AP involvement, resulting in lower device power consumption.
[0119] The first communication connection is a long-term connection established between the first communication chip and the server using the first network.
[0120] Optionally, after establishing the first communication connection, the first communication chip can maintain the first communication connection through a heartbeat mechanism. That is, the process of the communication chip acting as a proxy for a long connection may also include step S503, in which 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, in order to maintain the first communication connection.
[0121] After the first communication chip establishes a first communication connection with the server, in order to maintain the long-term availability of the first communication connection, it can periodically send heartbeat messages to the server according to the heartbeat timer and timeout timer, and determine the validity of the first communication connection based on the server's confirmation message for the heartbeat message.
[0122] The heartbeat timer is used to determine the time point for sending a heartbeat message. After sending a heartbeat message, the time point for sending the next heartbeat message is determined based on the current time and the heartbeat cycle; the heartbeat timer is set according to the time point for the next heartbeat message; when the heartbeat timer determines that the time point for sending the next heartbeat message has arrived, the first communication chip can be woken up or triggered so that the first communication chip can send a heartbeat message to the server through the first communication connection.
[0123] The timeout timer is a timeout timer for push services, used to determine whether an acknowledgment message has been received from the server within a specified time. After the first communication chip sends a heartbeat message to the server, it can determine the time point for receiving the acknowledgment message based on the timeout threshold of the service timeout timer. If an acknowledgment message is received before that time point, the first communication connection is determined to be valid; if no acknowledgment message is received before that time point, the first communication connection is determined to be unavailable, i.e., the first communication connection has been disconnected.
[0124] It should be noted that in related technologies, when the time for sending a heartbeat message is reached, both the AP and the communication chip are woken up, and the AP sends the heartbeat message to the server through the communication chip. However, in this embodiment, when the time for sending a 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, further reducing device power consumption.
[0125] Step S504: If the first communication connection is broken, the first communication chip uses the first network to re-establish the first communication connection with the server.
[0126] It should be noted that in related technologies, when the first communication connection needs to be re-established, both the AP and the communication chip need to be woken up. The AP then re-establishes the first communication connection with the server through the communication chip, resulting in high device power consumption. However, in this embodiment, after the first communication connection is broken, only the first communication chip needs to be woken up. The first communication chip can directly use the first network to re-establish the first communication connection without waking up the AP, resulting in lower device power consumption.
[0127] After establishing the first communication connection, 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 the connection, the first communication chip can be woken up to send the heartbeat message or re-establish the first communication connection. After sending the heartbeat message or re-establishing the first communication connection, the first communication chip can enter the low-power state or sleep state again, waiting to be woken up again.
[0128] Normally, if the initial communication connection is not actively disconnected but due to some abnormal reason, the initial communication chip can re-establish the initial communication connection with the server to ensure the normal operation of the push service. Abnormal reasons could include, for example, the absence of a primary network, expired NAT, or weak network timeout.
[0129] When the first communication connection is lost due to the absence of a first network connection, the first communication chip, upon detecting network recovery, does not need to wake up the AP. Instead, it can directly re-establish the first communication connection with the server based on the server address and heartbeat information. After re-establishing the first communication connection, the first communication chip periodically sends heartbeat messages to the server through the first communication connection to maintain its availability.
[0130] For example, after electronic device 300 enters the coverage area of a Wi-Fi network, its Wi-Fi chip establishes a Wi-Fi connection with the server. This Wi-Fi connection is used to carry push services; that is, it is a persistent connection for the push service. After establishing the Wi-Fi connection, if electronic device 300 leaves the Wi-Fi network coverage area, the Wi-Fi connection will be lost. After the Wi-Fi connection is lost, when electronic device 300 re-enters the Wi-Fi network coverage area, the Wi-Fi chip detects that the Wi-Fi network has been restored and automatically re-establishes the Wi-Fi connection with the server to carry the push service.
[0131] Weak network timeout refers to the failure to receive an acknowledgment message from the server within a specified time after sending a heartbeat message. For example, if the timeout threshold for a push service is 5 seconds, and no acknowledgment message is received within 5 seconds of sending the heartbeat message, the first communication connection is considered unusable, resulting in an abnormal disconnection. In this case, without waking up the access point (AP), the first communication chip can automatically re-establish the first communication connection with the server based on the server address and heartbeat-related information.
[0132] As can be seen from the above, this application embodiment sets up a push agent at the communication chip layer, allowing the management of long connections to be pushed down from the AP layer to the communication chip layer. The communication chip layer manages the long connections, so the communication chip can directly establish a long connection with the server. Furthermore, after the long connection is disconnected due to reasons such as no network or weak network timeout, the communication chip can also directly establish a long connection with the server without waking up the AP, thus reducing device power consumption.
[0133] Optionally, after establishing a 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 a heartbeat timer and a timeout timer to maintain the availability of the first communication connection. During this process, the first communication chip can send a heartbeat message without waking up the AP; the heartbeat timer and the timeout timer for the push service are not subject to unified management and alignment by the AP system, allowing the communication chip layer to promptly detect long-term connection anomalies; the heartbeat timer can be extended by one cycle upon receiving a push message; and the communication chip layer can directly detect when a fake network is sent or a network switch occurs.
[0134] For example, see Figure 6 The diagram illustrates the processing steps for heartbeat messages and push messages provided in this embodiment of the application. This process may include, but is not limited to, the following steps:
[0135] Step S601: The first communication chip determines the time point for sending a heartbeat message by using the heartbeat cycle of the heartbeat timer.
[0136] After the first communication connection is established, the first communication chip periodically sends heartbeat messages according to a heartbeat timer. During the periodic sending of heartbeat messages, after the first communication chip finishes sending a heartbeat message, it determines the time point for sending the next heartbeat message based on the heartbeat cycle of the heartbeat timer.
[0137] For example, the heartbeat timer has a heartbeat cycle of 5 minutes. According to the heartbeat timer's cycle, the first communication chip sends a heartbeat message through the first communication connection at 5:00. After sending the heartbeat message, the first communication chip determines the time for sending the next heartbeat message according to the heartbeat cycle. In this case, the next heartbeat message will be sent at 5:05.
[0138] In some embodiments, after receiving a push message from the server, the heartbeat timer of the first communication chip does not extend by one heartbeat cycle. Then, after determining the time point for the next heartbeat message to be sent, the process can proceed to step S603.
[0139] In other embodiments, after the first communication chip receives the push message sent by the server, the heartbeat timer is extended by one heartbeat cycle. At this time, if the push message sent by the server is not received before the time point for 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 for sending the next heartbeat message arrives, the process proceeds to step S602 to redetermine the time point for sending the heartbeat message, and then proceeds to step S603.
[0140] Optionally, the method further includes step S602: if the first communication chip receives a push message from the server through the first communication connection before the time point for sending the heartbeat message arrives, then the time point for sending the heartbeat message is re-determined based on the time point for receiving the push message and the heartbeat cycle, and the re-determined time point is later than the previously determined time point.
[0141] When the first communication chip receives a push message through the first communication connection, it proves that the current first communication connection is valid. To reduce the number of heartbeat message transmissions, the heartbeat timer can be delayed by one heartbeat cycle, that is, the heartbeat message can be sent after a delay of one heartbeat cycle.
[0142] For example, the heartbeat timer has a heartbeat cycle of 5 minutes, and the next heartbeat message is scheduled to be sent at 5:05. At 5:02, the first communication chip receives a push message through the first communication connection; that is, the push message reception time is 5:02. Based on the push message reception time and the heartbeat cycle, the new heartbeat message transmission time is determined to be 5:07. At this point, the newly determined time is 5:07, and the previously determined time was 5:05. The next heartbeat message is sent using the newly determined time.
[0143] Step S603: When the time for sending the heartbeat message arrives, the first communication chip sends a heartbeat message to the server through the first communication connection.
[0144] In some embodiments, the time point for sending the heartbeat message can be the time point determined in step S602. That is, it does not postpone by one heartbeat cycle based on the received push message. For example, in step S602, the determined time point for the next heartbeat message to be sent is 5:05. When 5:05 is reached, the first communication chip is woken up, and the first communication chip sends the heartbeat message to the server through the first communication connection.
[0145] In other embodiments, the time point for sending the heartbeat message can be the time point determined in step S604. That is, based on the received push message, the time is postponed by one heartbeat cycle. For example, in step S604, the next time to send the heartbeat message is redefined as 5:07. When 5:07 is reached, 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] Step S604: After sending the heartbeat message, if the first communication chip receives an acknowledgment message within the timeout threshold of the timeout timer, it determines that the first communication connection is valid; if it does not receive an acknowledgment message within the timeout threshold of the timeout timer, it determines that the first communication connection is disconnected.
[0147] The timeout timer is a timer for push services, also known as a service timeout timer. The timeout threshold refers to the period of the timeout timer. For example, a timeout threshold of 10 seconds means the timeout timer is a 10-second timer. After sending a heartbeat message, a 10-second timeout timer is started. If no acknowledgment message is received from the server in response to the heartbeat message within 10 seconds, the first communication connection is considered broken. Conversely, if an acknowledgment message is received from the server in response to the heartbeat message within 10 seconds, the first communication connection is considered valid.
[0148] It should be noted that in related technologies, having the AP manage long-term connections not only results in high device power consumption but also in poor stability of the long-term connections.
[0149] Specifically, to reduce device power consumption, related technologies require the system on the AP to uniformly manage and align heartbeat timers and service timeout timers. That is, the heartbeat timer and service timeout timer are woken up according to a unified wake-up cycle. This prevents the AP layer from promptly detecting connection anomalies and thus hinders timely anomaly repair, affecting the stability of long-lived connections.
[0150] For example, the heartbeat timer has a heartbeat period of 5 minutes, and the push service's timeout timer has a period of 10 seconds. Normally, the heartbeat timer and timeout timer wake up according to their 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 acknowledgment message has been received within 10 seconds, allowing the AP layer to promptly detect whether the long connection is valid. Specifically, if no acknowledgment message is received within 10 seconds, the long connection is considered closed; if an acknowledgment message is received within 10 seconds, the long connection is considered valid.
[0151] Specifically, if a confirmation message is received from the server within 10 seconds of sending the heartbeat message, the timeout timer will not be started and will be removed; otherwise, if no confirmation message is received within 10 seconds of sending the heartbeat message, the timeout timer will be started to wake up the electronic device to perform corresponding countermeasures.
[0152] However, after aligning the heartbeat timer and timeout timer with a unified wake-up cycle, the heartbeat timer and timeout timer cannot wake up according to their individual set cycles, but instead wake up according to a unified wake-up cycle. In this case, assuming the unified wake-up cycle is 5 minutes, that is, the heartbeat timer and timeout timer are uniformly woken up every 5 minutes. Thus, the timeout timer is only woken up 5 minutes after the heartbeat message is sent to determine whether the corresponding acknowledgment message has been received in time, and thus whether the long connection is valid. That is, the validity of the long connection can only be detected 5 minutes after the heartbeat message is sent, thus preventing the AP layer from promptly detecting connection anomalies.
[0153] The management of long-lived connections, handled by the AP layer, requires the network subsystem to detect and notify the AP layer before any fake network or network handover occurs. This delay in notification introduces a time lag, which can negatively impact the stability of long-lived connections.
[0154] Furthermore, the unified management of the aligned heartbeat timer and timeout timer by the AP layer also increases device power consumption. Specifically, during the periodic sending of heartbeat messages, if a push message from the server is received, the heartbeat can be postponed by one period to reduce the number of heartbeat messages sent, thereby reducing power consumption. However, because the system uniformly manages the aligned heartbeat timer and timeout timer, the postponed heartbeat timer becomes invalid after receiving a push message from the server, resulting in higher device power consumption.
[0155] For example, suppose the uniform wake-up cycle is 5 minutes, and after a heartbeat message is sent at 5:00, the next heartbeat message is scheduled for 5:05. However, a push notification is received from the server at 5:02. If the heartbeat could be delayed by one cycle, the next heartbeat message would be sent at 5:07. But because the system uniformly manages and aligns the heartbeat timer and timeout timer, the heartbeat delay fails, and the heartbeat message will still be sent at 5:05. This increases unnecessary heartbeat message sending and leads to higher device power consumption.
[0156] As can be seen from the above, this embodiment of the application, by sinking the long-lived connection from the AP layer to the communication chip layer, allows the communication chip layer to manage the long-lived connection. During the periodic sending of heartbeat messages, it is not necessary to wake up the AP, thus freeing the timeout timer and heartbeat timer from unified control and alignment on the AP system. This allows the heartbeat timer to be extended by one heartbeat cycle after receiving a push message, reducing unnecessary heartbeat message sending and lowering device power consumption. Furthermore, the timeout timer can operate according to a set cycle, enabling the communication chip to promptly detect whether the long-lived connection has been broken. When sending fake networks or network switching occurs, the communication chip layer can directly detect it, reducing latency. In this way, the stability of the long-lived connection is improved, and device power consumption is reduced.
[0157] The electronic device 300 may include only one communication chip (e.g., a first communication chip), or it may include at least two communication chips, each of which supports different networks. For example, the at least two communication chips may include a Wi-Fi chip and a cellular chip.
[0158] When an electronic device 300 includes only one communication chip, or includes at least two communication chips but uses only one communication chip to implement push services, the communication chip can... Figure 5 and Figure 6 The process steps shown demonstrate how to implement push notifications.
[0159] 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 push services. For example, the first communication chip performs... Figure 5 and Figure 6 The process steps are shown below. 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.
[0160] The system includes at least two communication chips, namely a first communication chip and a second communication chip, which 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.
[0161] However, activating the second communication chip and establishing the second communication connection takes a certain amount of time. Therefore, the second communication connection cannot be established immediately after the first communication connection is disconnected. This means that there is no communication connection between the electronic device 300 and the server during the period between the disconnection of the first communication connection and the establishment of the second communication connection, which affects the stability of the long connection.
[0162] To address this, this application embodiment synchronizes the signals of the first and second communication chips. When the first communication connection carrying the push service is about to be disconnected, the first communication chip notifies the second communication chip to establish a second communication connection in advance. Thus, after the first communication connection is disconnected, since the second communication connection has already been established, there is no need to wait for the second communication chip to activate and for the second communication connection to be established. The push service can be seamlessly switched to the second communication connection, achieving a smooth switch of the communication connection carrying the push service and improving the stability of long-term connections.
[0163] In other words, during the process of switching the communication connection carrying the push service from the first communication connection to the second communication connection, there is no gap between the electronic device 300 and the server. The gap refers to the time period during which there is no communication connection between the electronic device 300 and the server.
[0164] For example, see Figure 7 The diagram illustrates a connection switching process provided in an embodiment of this application. This process may include, but is not limited to, the following steps:
[0165] Step S701: The first communication chip communicates with the server using the first communication connection.
[0166] The first communication chip establishes a first communication connection with the push service server using a first network, and uses this first communication connection to carry the push service. The first communication chip is equipped with a push proxy program to act as an intermediary for the push connection between the application processor of the electronic device 300 and the server.
[0167] Using the first communication connection to carry push services can refer to the first communication chip periodically sending heartbeat messages to the server through the first communication connection and receiving confirmation messages from the server through the first communication connection; the server can send push messages to electronic devices through the first communication connection.
[0168] If the electronic device 300 also includes a second communication chip, and push services are implemented through the first and second communication chips, then steps S702 to S704 may be included after establishing the first communication connection. For example, in... Figure 5 After step S502 or step S504, steps S702 to S704 may also be included.
[0169] Step S702: If the first communication chip predicts that the first communication connection will enter a weak network environment in the first time period in the future, it sends the first synchronization information to the second communication chip. The first synchronization information is used to instruct the second communication chip to establish a communication connection with the server.
[0170] The first communication chip can predict whether the first communication connection is about to enter a weak network environment based on the network signal strength of the first network. For example, it can determine the trend of network signal strength changes based on the network signal strength of the first network; if the trend of network signal strength changes from strong to weak, and the network signal strength at the current moment is lower than a preset strength threshold, then it is determined that the electronic device 300 is about to leave the coverage area of the first network and enter a weak network environment. For example, if the first network is a Wi-Fi network, the network signal strength can be the Wi-Fi Received Signal Strength Indication (RSSI).
[0171] The first communication chip can also predict the upcoming weak network environment through scene perception. Scene perception refers to predicting whether the electronic device 300 is about to enter a pre-defined scene. Pre-defined scenes may include, but are not limited to, elevators, tunnels, high-speed trains, and airports. That is, when it is predicted that the electronic device 300 is about to enter a scene such as an elevator, tunnel, high-speed train, or airport, it is determined that it is about to enter a weak network environment.
[0172] In scenarios such as elevators, tunnels, high-speed trains, or airports, electronic devices 300 typically lack network signals. When predicting an upcoming weak network environment, it's even possible to further predict the timeframe (i.e., the first time period) within which this weak network environment will occur. For example, if the first time period is 1 minute, it predicts that the device will enter a weak network environment within the next minute.
[0173] When the first communication chip predicts that it will soon enter a weak network environment, it can send a first synchronization signal to the second communication chip through the signal synchronization mechanism between the first and second communication chips. This first synchronization signal is used to inform the second communication chip to establish a second communication connection with the server in advance.
[0174] A weak network environment refers to an environment with poor network quality. Specifically, it can manifest as slow and unstable network speeds. A weak network can lead to inefficient data transmission, untimely or incomplete information delivery, and even data loss or connection interruptions. Weak networks can be caused by insufficient network coverage, signal interference, equipment malfunctions, and other factors. In a weak network environment, problems such as slow data upload and download speeds, real-time communication delays, and even connection failures may occur.
[0175] The first synchronization information may include instruction information, which is derived by the first communication chip based on perceived network status and network connection status. This instruction information can be used to notify the second communication chip to establish a second communication connection with the server in advance. Alternatively, the first synchronization information may also include the first communication chip's own network status and network connection status. In this case, after receiving the first synchronization information, the second communication chip can decide whether it needs to establish a second communication connection with the server in advance based on the first communication chip's network status and network connection status.
[0176] Of course, in other embodiments, the first communication chip may also send the first synchronization information to the second communication chip after predicting that the first communication connection will be disconnected in the first time period in the future.
[0177] Step S703: In response to the first synchronization information, the second communication chip establishes a second communication connection with the server using the second network supported by the second communication chip.
[0178] The second communication connection is established before the first communication connection is closed. That is, the second communication connection is established before the first communication connection is closed. The second communication connection is a long-lived connection established by the second communication chip with the push server using the second network. The second communication chip is equipped with a push proxy program to act as an intermediary for the push connection between the application processor of the electronic device 300 and the server.
[0179] The second communication chip can establish a second communication connection with the server using a second network based on the server address and heartbeat-related information.
[0180] The server address and heartbeat 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 information to the second communication chip through a signal synchronization mechanism. For example, the first communication chip can carry the server address and heartbeat information in the first synchronization information.
[0181] The server address and heartbeat information on the second communication chip can also be sent by the AP. Specifically, when the AP starts the proxy, it registers proxy-related services not only with the first communication chip but also with other communication chips (such as the second communication chip), and sends server address and heartbeat information to each communication chip. For example, the AP can send connection proxy requests to the first and second communication chips, where the first communication chip is the chip corresponding to the default network. The electronic device 300 enables the first communication chip (i.e., using the default network) to establish a first communication connection to carry push services; when a network switch is needed (e.g., the first communication connection is about to be disconnected or enter a weak network environment), the first communication chip notifies the second communication chip in advance to establish a second communication connection.
[0182] Step S704: When the first communication connection is disconnected or during the second time period before the first communication connection is disconnected, the second communication chip uses 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.
[0183] The second communication chip establishes a second communication connection before the first communication connection is disconnected. The push service can be switched from the first to the second communication connection only when the first connection is disconnected; alternatively, it can be switched before the first connection is disconnected. For example, the switch can occur within a second time period before the first connection is disconnected. This second preset time period can be set as needed and is not limited here. For example, the second time period could be 30 seconds, meaning the switch to the second communication connection occurs within 30 seconds before the first connection is disconnected.
[0184] After the communication connection carrying the push service changes 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 heartbeat messages to the server through the second communication connection and receives confirmation messages returned by the server to maintain the long-term availability of the second communication connection; it also receives push messages sent by the server through the second communication connection and sends messages to the server. For example, the second communication chip can perform... Figure 5 and Figure 6 The process steps executed by the first communication chip in the process.
[0185] 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. Electronic device 300 first uses the Wi-Fi chip to establish a Wi-Fi connection with the server, using this Wi-Fi connection to carry the push service. When the Wi-Fi chip predicts that it will soon leave the Wi-Fi network coverage area, i.e., predicts that it will enter a weak network environment and the Wi-Fi connection will soon be disconnected, it sends a synchronization signal to the cellular chip to notify it 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.
[0186] As can be seen from the above, the embodiments of this application, through signal synchronization between the first communication chip and the second communication chip, can notify the second communication chip to establish a second communication connection in advance when it is predicted that the first communication connection carrying the push service is about to enter a weak network environment. This allows the communication connection carrying the push service to smoothly switch from the first communication connection to the second communication connection, improving the stability of long connections.
[0187] As described above, the first communication chip can communicate with the server of the push service through the first communication connection, that is, it carries the push service through the first communication connection. For example, the first communication chip can... Figure 5 and Figure 6 The illustrated process steps implement the push service. At this point, after establishing the first communication connection, if the electronic device 300 also includes a second communication chip, the second communication chip can use the second network to establish a second communication connection with the server, and the communication connection carrying the push service can be switched from the first communication connection to the second communication connection.
[0188] Optionally, during 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, it may not immediately use the second network to establish a second communication connection with the server, nor may it immediately have the first communication chip release the first communication connection. Instead, it may wait until the second network is stable and can provide a stable long-term connection service before using the second network to establish a second communication connection with the server. Then, the second communication chip may notify the first communication chip to actively release the first communication connection, thus switching the push service from the first communication connection to the second communication connection.
[0189] For example, see Figure 8 The diagram illustrates a connection switching process provided in an embodiment of this application. This process may include, but is not limited to, the following steps:
[0190] Step S801: The first communication chip establishes a first communication connection with the server using the first network, and communicates with the server using the first communication connection.
[0191] The first communication connection is the communication connection that carries the push service. The first network is the network supported by the first communication chip. For example, the first communication chip can perform actions such as... Figure 5 or Figure 6 The process steps are shown.
[0192] At this time, if the electronic device 300 also includes a second communication chip, the second communication chip has not established a communication connection with the server. Optionally, after establishing the first communication connection, steps S802 to S804 may also be included. For example, in Figure 5 After step S502 or step S504, steps S802 to S804 may also be included.
[0193] Step S802: The second communication chip accesses the second network. After determining that the network quality of the second network has reached the target quality, it uses the second network to establish a second communication connection with the server and 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.
[0194] The second communication chip is equipped with a push agent program, which is used to proxy the push connection between the application processor of electronic device 300 and the server.
[0195] The second communication chip can determine whether the network quality of the second network meets the target quality by using parameters such as network signal strength and network latency. For example, if the network signal strength of the second network is greater than or equal to a preset strength threshold for a continuous preset time period (e.g., 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 period, then the network quality of the second network is determined to meet the target quality. The second network is the network supported by the second communication chip.
[0196] Once the network quality of the second network reaches the target quality, it means that the second network has reached stability. The second communication chip then uses the second network to establish a second communication connection with the server. Optionally, after establishing the second communication connection, it can wait for the second communication connection to stabilize, i.e., to provide a stable long-term connection service, before notifying the first communication chip to actively release the first communication connection.
[0197] Optionally, after the second communication chip accesses the second network, it can use the second network to establish a second communication connection with the server and then determine whether the network quality of the second network reaches the target quality; alternatively, it can establish the second communication connection after determining that the network quality of the second network has reached the target quality.
[0198] The second communication chip can establish a second communication connection with the server using a second network based on 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 it can be sent by the access point (AP).
[0199] Step S803: The first communication chip responds to the second synchronization information and releases the first communication connection.
[0200] That is, the first communication chip actively disconnects (or exits) the first communication connection.
[0201] Step S804: 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.
[0202] 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. In this case, the cellular chip establishes a cellular connection with the server, and this cellular connection is the communication connection that carries the push service. When the electronic device 300 accesses the Wi-Fi network through the Wi-Fi chip, the second communication chip can use the Wi-Fi network to establish a Wi-Fi connection, and then determine whether the network quality of the Wi-Fi network meets 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 meets the target quality, and only uses the Wi-Fi network to establish a Wi-Fi connection after the network quality meets the target quality.
[0203] After the second communication chip determines that the Wi-Fi network quality has reached the target quality, it sends the second synchronization information to the first communication chip. Alternatively, after the second communication chip determines that the Wi-Fi network quality has reached the target quality and the second communication connection is stable (i.e., able to provide a stable long-term connection service), it sends the second synchronization information to the first communication chip. Upon receiving 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.
[0204] 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.
[0205] 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.
[0206] It should be noted that, in Figure 7 In the process, when it is necessary to switch the communication connection carrying the push service from the first communication connection to the second communication connection, it can also be executed. Figure 8 Steps S802 and S803 are described. 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.
[0207] 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.
[0208] It should be noted that when the electronic device 300 includes at least two communication chips, multiple communication chips can be used simultaneously to establish communication connections with the server, and each communication connection carries the push service, that is, multiple long connections exist at the same time; multiple communication chips can be used simultaneously to establish communication connections with the server, but only one communication connection carries the push service, that is, only one long connection exists at the same time; or, only one communication chip can be used at the same time to establish a communication connection with the server, and that communication connection carries the push service.
[0209] For example, see Figure 9 The diagram illustrates the system architecture of the push service provided in an embodiment of this application. Figure 9 As shown, the electronic device 300 includes a push service, a socket proxy adapter, a Wi-Fi chip, and a cellular chip. The push service is set up on the access point (AP), and the socket proxy adapter is an adaptation layer.
[0210] The push service completes the proxy startup process by registering with the proxy-related services. After the proxy startup process is completed, a second push proxy is set up on the Wi-Fi chip, and a first push proxy is set up on the cellular chip.
[0211] The first and second push agents can establish long-term connections with the push cloud based on the server address, heartbeat information, and other relevant information provided by the push service.
[0212] Before establishing a persistent connection, the push service can send the server address and heartbeat information to the Wi-Fi and cellular chips. For example, after registering proxy services with the Wi-Fi and cellular chips, the push service sends the server address and heartbeat information to each chip. This way, when a connection switch is needed later, the Wi-Fi and cellular chips can establish a persistent connection with the server based on the pre-sent server address and heartbeat information.
[0213] At any given time, there can only be a persistent connection between the Wi-Fi chip and the push cloud, or a persistent connection between the cellular chip and the push cloud; alternatively, there can be both persistent connections between the Wi-Fi chip and the push cloud, and between the cellular chip and the push cloud. In this case, the Wi-Fi chip and the cellular chip each maintain their own persistent connection, and the push cloud can send downlink messages through both connections simultaneously. Of course, the push cloud can also choose to send downlink messages through only one of the persistent connections. For example, the push cloud can prioritize using the Wi-Fi connection to send downlink messages. That is, when there are multiple persistent connections, the push cloud can prioritize using the persistent connection established by the Wi-Fi network to send downlink messages.
[0214] 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.
[0215] Once a long-lived connection is established, its lifecycle is maintained by the Wi-Fi chip and the cellular chip.
[0216] 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).
[0217] 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.
[0218] 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.
[0219] For example, a persistent connection exists between the cellular chip and the push cloud, and this persistent connection is used to carry push services. When the electronic device 300 accesses the Wi-Fi network via the Wi-Fi chip, the Wi-Fi chip first establishes a persistent connection with the push cloud using the Wi-Fi network. The Wi-Fi chip determines whether the network quality of the Wi-Fi network meets the target quality; if the network quality meets the target quality and the Wi-Fi connection is stable, it notifies the cellular chip to actively release the persistent connection with the push cloud and switches the push service to the persistent connection between the Wi-Fi chip and the push cloud. That is, after the Wi-Fi network stabilizes, the push service residing on the cellular connection is switched to the Wi-Fi connection.
[0220] After receiving downlink messages from the push cloud via a long-lived connection, the first or second push agent can postpone the heartbeat timer to the next heartbeat cycle to reduce unnecessary heartbeat message sending and lower device power consumption. Furthermore, the first or second push agent can also transmit downlink messages to the AP (Access Point), where the AP processes the messages and obtains the processing results. The AP then sends the processing results back to the first or second push agent, which, based on the results, sends uplink messages to the push cloud via the long-lived connection.
[0221] 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 push services, the cellular chip can send uplink data to the server through the cellular connection. This uplink data can be a heartbeat message or an uplink message, which is a message sent by the cellular chip to the server based on the processing result of the downlink message sent by the server after the AP processes it.
[0222] When a cellular chip sends uplink data to a server via a cellular connection, the cellular chip needs to establish a Radio Resource Control (RRC) connection with the base station to communicate. The RRC connection is the connection between the electronic device 300 and the base station, while the cellular connection is the push connection between the electronic device 300 and the push server.
[0223] The cellular chip can be either the first communication chip or the second communication chip mentioned above.
[0224] In related technologies, the AP layer is responsible for managing long-lived connections, uniformly using the default RRC connection holding time. After sending uplink data to the server, the RRC connection is not actively released, resulting in an excessively long RRC connection holding time and increased device power consumption. The uplink data volume is typically small, usually a single packet, and the uplink data transmission time is in the millisecond range. However, the default RRC connection holding time is typically 5 to 20 seconds.
[0225] In response, this application embodiment moves the long connection from the AP layer to the communication chip layer, which allows the cellular chip to actively and quickly release the RRC connection after sending uplink data to the server, thereby reducing the holding time of the RRC connection and lowering device power consumption.
[0226] For example, after sending uplink data, the cellular chip determines whether the release condition is met; if the release condition is met, it actively releases the RRC connection; if the release condition is not met, it does not actively release the RRC connection.
[0227] Optionally, if multiple Data Radio Bearers (DRBs) exist within the Packet Data Convergence Protocol (PDCP), the cellular chip determines that the release condition is not met. Specifically, the presence of multiple DRBs within the PDCP indicates that multiple services (such as IMS and MMS) are currently in operation, not just push services. IMS stands for IP Multimedia Subsystem. Releasing the RRC connection at this time would affect the normal operation of non-push services such as IMS and MMS.
[0228] If PDCP only has push services, then the release conditions are met.
[0229] When all network cards of the application processor are in an inactive state (i.e., in a DOWN state), it indicates that no data is being received or generated by the application processor, and the fast release of the RRC connection can be initiated, meaning that the release condition has been met.
[0230] If the application processor's network interface card (NIC) is active (UP) and the application processor is in sleep mode, then the release condition is met. Specifically, after determining that there is a UP NIC, the sleep state of the application processor can be further determined; if the application processor is in sleep mode, the release condition is met, and a fast RRC connection can be established; if the application processor is not in sleep mode, the release condition is not met.
[0231] Once the release conditions are met, the RRC connection can be quickly released. Optionally, the PDCP NO DATA mechanism can be used for quick release of the RRC connection. The PDCP NO DATA mechanism involves setting a NO_DATA threshold; if PDCP does not transmit data within the NO_DATA threshold, it triggers a quick RRC release.
[0232] For example, when all network cards of the application processor are inactive (i.e., in a DOWN state), the NO_DATA threshold can be set to 500ms. That is, if PDCP does not transmit data within 500ms, RRC fast release is triggered. For example, when one network card of the application processor is active (in a UP state) and the application processor is in a sleep state, the NO_DATA threshold can be set to 1s. The NO_DATA threshold can be updated as needed.
[0233] In other words, during the active and rapid release of the RRC connection, the cellular chip determines whether the PDCP has transmitted data within a preset time period; if the PDCP has not transmitted data within the preset time period, the cellular chip releases the RRC connection. The preset time period is the NO_DATA threshold mentioned above.
[0234] To better illustrate the fast release scheme for RRC connections provided in the embodiments of this application, the following is combined with... Figure 10 The schematic diagram of the RRC rapid release process provided in the embodiment of this application is shown for description.
[0235] like Figure 10 As shown, the process may include the following steps:
[0236] Step S1: After receiving the heartbeat confirmation, the push agent triggers the rapid release of the RRC connection.
[0237] The push proxy is a proxy program within the cellular chip. Heartbeat acknowledgment is the acknowledgment message returned by the server in response to the heartbeat message sent by the cellular chip. That is, upon receiving the acknowledgment message from the server, the cellular chip's push proxy triggers the RRC connection fast release process.
[0238] In other embodiments, the cellular chip's push agent can also trigger a rapid release of the RRC connection after sending an uplink message to the server. The uplink message is a message sent after processing the downlink message from the server.
[0239] Step S2: The push agent sends PUSH_PROXY_PDCP_CONN_REL_NTF to PDCP.
[0240] The push agent sends PUSH_PROXY_PDCP_CONN_REL_NTF to the PDCP to notify the PDCP to initiate RRC connection fast release. After receiving PUSH_PROXY_PDCP_CONN_REL_NTF, the PDCP proceeds to step S3.
[0241] Step S3: PDCP determines whether the rapid release condition is met.
[0242] For example, if only push services are present in the PDCP, the fast release condition is determined to be met. If multiple DRBs exist in the PDCP, the fast release condition is determined not to be met. If all network cards of the application processor are in a DOWN state, the fast release condition is determined to be met. If one network card of the application processor is in an UP state and the application processor is in sleep mode, the fast release condition is determined to be met. If one network card of the application processor is in an UP state but the application processor is not in sleep mode, the fast release condition is determined not to be met.
[0243] Step S4: PDCP sets the NO_DATA threshold according to the conditions.
[0244] PDCP sets the NO_DATA threshold based on the fast release conditions that are met. For example, if the fast release condition is that all network cards of the application processor are in a DOWN state, the NO_DATA threshold is set to 500ms; if the fast release condition is that one of the network cards of the application processor is in an UP state and the application processor is in sleep mode, the NO_DATA threshold is set to 1s.
[0245] The NO_DATA threshold can be updated online as needed.
[0246] Step S5: PDCP sends ID_NL2_RRC_NPPDCP_NO_DATA_IND to RRC to trigger RRC fast release.
[0247] Specifically, PDCP reuses the NO_DATA mechanism, reporting to RRC when there is no data at the NO_DATA threshold.
[0248] ID_NL2_RRC_NPPDCP_NO_DATA_IND is used to trigger RRC to release the connection.
[0249] In contrast, related technologies manage long connections through the AP layer, which cannot identify the RRC connection corresponding to the push service and uses the default configured User Equipment (UE) inactivity timer. The default configured UE inactivity timer has a relatively long duration, typically 5 to 20 seconds, resulting in an excessively long RRC connection holding time and causing an excessively long RRC connection tail.
[0250] In addition, during RRC tailing, connected mode discontinuous reception (CDRX) may be disabled, which further increases the device power consumption.
[0251] This application embodiment moves the long connection from the AP layer to the communication chip layer, which can accurately identify the RRC connection corresponding to the push service and quickly release the RRC connection after sending uplink data, thereby reducing the holding time of the RRC connection and reducing device power consumption.
[0252] Please see Figure 11 The diagram shows a schematic block diagram of an electronic device 300 provided in an embodiment of this application. The electronic device 300 may include an application processor 1101 and a first communication chip 1102.
[0253] The application processor 1101 is used 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 act as a proxy for the communication connection between the application processor 1101 and the server of the push service;
[0254] The first communication chip is used for 1102: in response to a connection proxy request, to establish a first communication connection with the server using a first network supported by the first communication chip 1102; if the first communication connection is disconnected, to re-establish the first communication connection with the server using the first network.
[0255] In some possible implementations 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 a first communication connection, while the second communication chip 1103 does not establish a communication connection with the server.
[0256] The first communication chip 1102 is used to: if it is predicted that the first communication connection will enter a weak network environment in the first time period in the future, send the first synchronization information to the second communication chip 1103. The first synchronization information is used to instruct the second communication chip 1103 to establish a communication connection with the server.
[0257] The second communication chip 1103 is used to: in response to the first synchronization information, establish a second communication connection with the server using a second network, wherein the second network is a network supported by the second communication chip 1103, and the establishment time of the second communication connection is earlier than the disconnection time of the first communication connection; when the first communication connection is disconnected or during a second time period before the first communication connection is disconnected, communicate 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.
[0258] In some possible implementations, the electronic device 300 also includes a second communication chip 1103; the first communication connection is a communication connection that carries the push service, that is, the first communication chip 1102 uses the first communication connection to communicate with the server; the second communication chip 1103 does not establish a communication connection with the server.
[0259] The second communication chip 1103 is used to: after accessing the second network and determining that the network quality of the second network has reached 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. The second synchronization information is used to instruct the first communication chip 1102 to release the first communication connection. The second network is a network supported by the second communication chip.
[0260] The first communication chip 1102 is used to: release the first communication connection in response to the second synchronization information;
[0261] The second communication chip 1103 is also used to: communicate 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.
[0262] In some possible implementations, after establishing the first communication connection, the first communication chip 1102 is further configured to: send a heartbeat message to the server through the first communication connection according to the heartbeat timer and the timeout timer, so as to maintain the first communication connection.
[0263] In some possible implementations, the first communication chip is also used to: determine the time point for sending a heartbeat message by the heartbeat period of a heartbeat timer; when the time point arrives, send a heartbeat message to the server through the first communication connection; after sending the heartbeat message, if an acknowledgment message is received within the timeout threshold of the timeout timer, then the first communication connection is determined to be valid, and the acknowledgment message is a message returned by the server in response to the heartbeat message.
[0264] In some possible implementations, the first communication chip is also used to: if a push message from the server is received through the first communication connection before the time point arrives, then based on the time point of receiving the push message and the heartbeat cycle, redetermine the time point for sending the heartbeat message, wherein the redetermined time point is later than the previously determined time point.
[0265] In some possible implementations, 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 the processing result, and transmit the processing result to the target communication chip; the first communication chip is further configured to: send a reply message to the server through the first communication connection based on the processing result.
[0266] In some possible implementations, after the cellular chip sends uplink data to the server, the cellular chip is also used to: determine whether the release condition is met; if the release condition is met, release the RRC connection; the cellular chip is either the first communication chip 1102 or the second communication chip 1103.
[0267] In some possible implementations, the cellular chip is specifically used to: determine that the release condition is not met if there are multiple data radio bearers in the Packet Data Convergence Protocol (PDCP); determine that the release condition is met if there is only push service in PDCP; and determine that the release condition is met if the application processor's network card is inactive, or if the application processor's network card has an active network card and the application processor is in a sleep state.
[0268] In some possible implementations, the cellular chip is specifically used to: determine whether the PDCP has data transmission within a preset time period; if the PDCP has no data transmission within the preset time period, release the RRC connection.
[0269] The aforementioned electronic device 300 has the function of implementing the above-mentioned method for establishing a communication connection. This function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above-mentioned function. The modules can be software and / or hardware.
[0270] It should be noted that the information interaction and execution process between the aforementioned electronic devices 300 are based on the same concept as the method embodiments of this application. For details on their specific functions and technical effects, please refer to the method embodiments section, which will not be repeated here.
[0271] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0272] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of this application can be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include at least: any entity or device capable of carrying computer program code to a photographing device / terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electrical carrier signal, a telecommunication signal, and a software distribution medium. Examples include USB flash drives, portable hard drives, magnetic disks, or optical disks. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electrical carrier signals or telecommunication signals.
[0273] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0274] In the embodiments provided in this application, it should be understood that the disclosed devices, electronic devices, and methods can be implemented in other ways. For example, the device / electronic device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings or direct couplings or communication connections may be through some interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0275] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0276] The electronic device provided in this application embodiment may include a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the method as described in any of the above method embodiments.
[0277] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps described in the various method embodiments above.
[0278] This application provides a computer program product that, when run on an electronic device, enables the electronic device to perform the steps described in the various method embodiments above.
[0279] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented, in whole or in part, as a computer program product. A 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 flow or function according to the embodiments of this application is generated, for example... Figure 5 , Figure 6 , Figure 7 or Figure 8The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. Computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, training device, or data center to another via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. A computer-readable storage medium can be any available medium that a computer can store, or a data storage device such as a training device or data center that integrates one or more available media. Available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0280] This application also provides a chip system, which includes a processor coupled to a memory. The processor executes a computer program stored in the memory to implement the methods described in the above embodiments. The chip system may be a single chip or a chip module composed of multiple chips.
[0281] In the above embodiments, the descriptions of each embodiment have their own emphasis. Parts not detailed or described in a particular embodiment can be referred to in the relevant descriptions of other embodiments. It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. Furthermore, in the description of this application specification and appended claims, the terms "first," "second," "third," etc., are only used to distinguish descriptions and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Thus, features defined with "first," "second," "third," and "fourth" may explicitly or implicitly include one or more of that feature. Additionally, it should be understood that at least one in the embodiments of this application includes one or more; where "more" means greater than or equal to two. In the embodiments of this application, "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the objects before and after it are in an "or" relationship.
[0282] References to "one embodiment" or "some embodiments" in this specification mean that one or more embodiments of this application include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized.
[0283] Finally, it should be noted that the above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions within the technical scope disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the 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.