Electronic equipment and communication method and communication system thereof

By adaptively adjusting the communication method between the terminal device and the server, adjusting the heartbeat cycle according to the time point of pushing the message, and processing the push message in combination with the message priority, the problem of high power consumption of the terminal device and message delay is solved, and more efficient is achieved communication and better user experience.

CN118540769APending Publication Date: 2024-08-23HONOR DEVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310194153.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-02-23
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

During the long connection maintenance process between the terminal device and the server, too many communications lead to increased power consumption. Existing technologies are difficult to effectively reduce power consumption. At the same time, push messages may be delayed, affecting user experience.

Method used

By adopting an adaptive communication method between the terminal device and the server, interrupting and recalculating the heartbeat cycle according to the time point of the received push message, and combining the priority of the push message, delaying or aggregating low-priority messages to reduce Number of communications and power consumption.

Benefits of technology

It effectively reduces the power consumption of terminal equipment, reduces the number of communications, avoids push message delays, improves user experience, and maintains the stability of long connections.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540769A
    Figure CN118540769A
Patent Text Reader

Abstract

The invention relates to the technical field of terminal equipment, and relates to electronic equipment and a communication method and a communication system thereof. The communication method comprises the following steps: a first electronic device sends a first wake-up instruction to a second electronic device at a first moment, wherein the first wake-up instruction is used for keeping communication connection between the first electronic device and the second electronic device; at the second moment, the first electronic equipment receives a first message sent by the second electronic equipment, and the duration between the first moment and the second moment is smaller than the awakening period; the first electronic device sends a second wake-up instruction to the second electronic device at a third moment, and the duration between the third moment and the second moment is equal to the wake-up period. If the second electronic device sends the push message to the first electronic device in one wake-up period, the first electronic device can interrupt and recalculate the heartbeat period, thereby reducing the communication connection between the first electronic device and the second electronic device maintained through heartbeat wake-up, and reducing the power consumption of the first electronic device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of terminal equipment, and in particular to an electronic device and a communication method and a communication system thereof. Background Art

[0002] As more and more applications are installed on terminal devices, the number of messages pushed by the server (also called content provider, CP) to each application is also increasing. The messages here can include push messages, application data messages, etc. For example, news applications can push news messages and hot news; financial applications can push financial hot spots and amount change information; instant messaging (IM) applications can push instant messages, news hot spots, etc.

[0003] Usually, the terminal device and the server can push messages through a long connection. The long connection here can be a communication connection between the terminal device and the server. The way to achieve a long connection between the terminal device and the server is usually to use heartbeat wake-up. Heartbeat wake-up can be a periodic handshake between the terminal device and the server, that is, the terminal device sends a heartbeat instruction to the server at a certain interval (for example, the heartbeat cycle is 5 minutes) to ensure that the terminal device and the server remain connected.

[0004] In the above scheme, the process in which the terminal device sends heartbeat instructions to the server and receives push messages from the server at a fixed period will result in a large number of communications between the terminal device and the server, and the terminal device consumes a large amount of power. Summary of the invention

[0005] The present application provides an electronic device and a communication method and a communication system thereof.

[0006] In a first aspect, an embodiment of the present application provides a communication method, which is applied to a first electronic device, and the method includes:

[0007] The first electronic device sends a first wake-up instruction to the second electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device;

[0008] At a second moment, the first electronic device receives a first message sent by the second electronic device, wherein the duration between the first moment and the second moment is less than the wake-up period;

[0009] The first electronic device sends a second wake-up instruction to the second electronic device at a third moment, wherein a time length between the third moment and the second moment is equal to the wake-up period.

[0010] That is, in the embodiment of the present application, the first electronic device here may be a terminal device, and the second electronic device here may be a server or a push server. The first wake-up instruction and the second wake-up instruction here may be heartbeat instructions, and the first message may be a push message. The first electronic device and the second electronic device send / receive the first wake-up instruction, the second wake-up instruction and the first message to keep the connection between the first electronic device and the second electronic device connected. The wake-up cycle here may be a heartbeat cycle, and the wake-up cycle may be continuous, for example: continuous heartbeat cycle 1, heartbeat cycle 2 and heartbeat cycle 3, etc. The first moment and the second moment here may be the starting time point of the wake-up cycle, such as: the first moment may be the starting time point of heartbeat cycle 1; the third moment may be the starting time point of heartbeat cycle 2. Before the first electronic device receives the first message sent by the second electronic device, the duration between the first moment and the third moment is equal to the wake-up cycle. At the second moment, the first electronic device receives the first message sent by the second electronic device, and the second moment here may be a time point in the time period corresponding to the first moment and the third moment, and the third moment is postponed to a time point between the third moment and the second moment equal to the wake-up cycle, that is, the wake-up cycle between the first moment and the third moment is interrupted, and the wake-up cycle is recalculated with the second moment as the reference time point.

[0011] It can be seen that after implementing the communication method provided in the embodiment of the present application, if the second electronic device does not send a push message to the first electronic device within each heartbeat cycle, the first electronic device will not adaptively adjust the heartbeat cycle of heartbeat wake-up; if the second electronic device sends a push message to the first electronic device within each heartbeat cycle, the first electronic device can interrupt and recalculate the heartbeat cycle, so that the first electronic device and the second electronic device can reduce the need to maintain a long connection between the first electronic device and the second electronic device through heartbeat wake-up, thereby reducing the power consumption of the first electronic device.

[0012] In a possible implementation of the first aspect, the present invention further includes:

[0013] At a fourth time between the first time and the second time, the first electronic device also receives a second message sent by the second electronic device.

[0014] That is, in an embodiment of the present application, the fourth moment here may be earlier than the second moment, and may be a time point within the time period corresponding to the first moment and the second moment. At the fourth moment, the first electronic device receives the second message sent by the second electronic device, and postpones the third moment to a time period between the third moment and the fourth moment that is equal to the wake-up cycle, that is, interrupting the wake-up cycle between the first moment and the third moment, and recalculating the wake-up cycle with the fourth moment as the reference time point.

[0015] In a possible implementation of the first aspect, the present invention further includes:

[0016] The first electronic device also receives a third message sent by the second electronic device at the second moment, wherein the second electronic device generates the third message earlier than the first message, and the sending priority of the third message is lower than that of the first message.

[0017] That is, in the embodiment of the present application, the sending priority here is determined according to the type of application or message type corresponding to the first message and the third message. If the sending priority of the third message is lower than the sending priority of the first message, the second electronic device can postpone the third message to be sent to the first electronic device at the same time as the first message. The number of communications between the first electronic device and the second electronic device is reduced, and the power consumption of the first electronic device is further reduced.

[0018] In a possible implementation of the first aspect, the present invention further includes:

[0019] At a fifth moment between the first moment and the second moment, the first electronic device also receives a fourth message sent by the second electronic device, wherein the second electronic device generates the fourth message earlier than the first message, and the sending priority of the fourth message is the same as the sending priority of the first message.

[0020] That is, in the embodiment of the present application, the fifth moment here can be earlier than the second moment, and can be a time point within the time period corresponding to the first moment and the second moment. At the fifth moment, the first electronic device receives the fourth message sent by the second electronic device, and postpones the third moment to a time period between the third moment and the fifth moment equal to the wake-up cycle, that is, interrupts the wake-up cycle between the first moment and the third moment, and recalculates the wake-up cycle with the fifth moment as the reference time point. In other words, each time the first electronic device receives a high-priority push message from the server, it can adjust the starting time point of the next heartbeat wake-up. Receiving a high-priority push message can interrupt the current heartbeat cycle and re-time, thereby reducing the power consumption of the first electronic device.

[0021] In a possible implementation of the first aspect above, the first message includes a push message.

[0022] That is, in the embodiment of the present application, the type of the first message may be a push message, where the push message may be a message from the server to the client in real time, that is, a message that the second electronic device (server or push server) actively pushes to the first electronic device. The push message may be displayed in the notification bar of the first electronic device, and the user may click on the push message in the notification bar to wake up the application, so that the first electronic device opens the application page.

[0023] In a possible implementation of the first aspect above, the first message includes a push message sent to at least one of the following applications: an instant messaging application, a travel application, a news application, and a financial application.

[0024] That is, in the embodiments of the present application, the first message here may include but is not limited to the following push messages, for example: push messages of news applications may include: news messages, hot messages, etc.; push messages of financial applications may include: financial hot spots, amount change information, etc.; push messages of instant messaging applications may include: instant messages, news hot spots, etc.

[0025] In a possible implementation of the first aspect above, the third message includes a push message sent to at least one of the following applications: a shopping application and a reading application.

[0026] That is, in an embodiment of the present application, the second message here may include but is not limited to the following push messages. For example, push messages of shopping applications may include: new product listing messages, promotional messages, etc.; push messages of reading applications may include: new book listing messages, etc.

[0027] In a second aspect, an embodiment of the present application provides a communication method, which is applied to a second electronic device, and the method includes:

[0028] The second electronic device receives a first wake-up instruction sent by the first electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device;

[0029] At a second moment, the second electronic device sends a first message to the first electronic device, wherein the duration between the first moment and the second moment is less than the wake-up period;

[0030] The second electronic device receives the second wake-up instruction sent by the first electronic device at a third moment, wherein the duration between the third moment and the second moment is equal to the wake-up period.

[0031] That is, in an embodiment of the present application, the first electronic device here may be a mobile terminal, and the second electronic device here may be a server or a push server. The first wake-up instruction and the second wake-up instruction here may be heartbeat instructions, and the first message may be a push message. The first electronic device and the second electronic device send / receive the first wake-up instruction, the second wake-up instruction and the first message to keep the connection between the first electronic device and the second electronic device connected. The wake-up cycle here may be a heartbeat cycle, and the wake-up cycle may be continuous. At the second moment, the second electronic device sends the first message to the first electronic device, and the second electronic device may receive the second wake-up instruction sent by the first electronic device at the third moment, and the second moment here may be a time point in the time period corresponding to the first moment and the third moment. The first electronic device postpones the third moment to a time period between the third moment and the second moment equal to the wake-up cycle, that is, interrupts the wake-up cycle between the first moment and the third moment, and recalculates the wake-up cycle with the second moment as the reference time point.

[0032] In a possible implementation of the second aspect, the method further includes:

[0033] At a fourth time between the first time and the second time, the second electronic device further sends a second message to the first electronic device.

[0034] That is, in an embodiment of the present application, the fourth moment here may be earlier than the second moment, and may be a time point within the time period corresponding to the first moment and the second moment. At the fourth moment, the second electronic device sends a second message to the first electronic device, and the first electronic device postpones the third moment to a time period between the third moment and the fourth moment that is equal to the wake-up cycle, that is, interrupts the wake-up cycle between the first moment and the third moment, and recalculates the wake-up cycle with the fourth moment as the reference time point.

[0035] In a possible implementation of the second aspect, the method further includes:

[0036] The second electronic device generates a third message before generating the first message;

[0037] When determining that the sending priority of the third message is lower than the sending priority of the first message, the second electronic device further sends the third message to the first electronic device at the second moment.

[0038] That is, in the embodiment of the present application, the sending priority here is determined according to the type of application or message type corresponding to the first message and the third message. If the sending priority of the third message is lower than the sending priority of the first message, the second electronic device can postpone the third message to be sent to the first electronic device at the same time as the first message.

[0039] In a possible implementation of the second aspect, the method further includes:

[0040] The second electronic device generates a fourth message before generating the first message;

[0041] When determining that the sending priority of the fourth message is the same as the sending priority of the first message, the second electronic device sends the fourth message to the first electronic device at a fifth time between the first time and the second time.

[0042] That is, in an embodiment of the present application, the fifth moment here may be earlier than the second moment, and may be a time point within the time period corresponding to the first moment and the second moment. At the fifth moment, the first electronic device receives the fourth message sent by the second electronic device, and postpones the third moment to a time period between the third moment and the fifth moment that is equal to the wake-up cycle, that is, interrupting the wake-up cycle between the first moment and the third moment, and recalculating the wake-up cycle with the fifth moment as the reference time point.

[0043] In a third aspect, an embodiment of the present application provides a communication system, the system comprising a first electronic device and a second electronic device, wherein:

[0044] The first electronic device sends a first wake-up instruction to the second electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device;

[0045] The second electronic device sends a first message to the first electronic device at a second time, wherein the duration between the first time and the second time is less than the wake-up period;

[0046] The first electronic device sends a second wake-up instruction to the second electronic device at a third moment, wherein a time length between the third moment and the second moment is equal to the wake-up period.

[0047] That is, in an embodiment of the present application, the first electronic device here may be a mobile terminal, and the second electronic device here may be a server or a push server. Before the first electronic device receives the first message sent by the second electronic device, the duration between the first moment and the third moment is equal to the wake-up cycle. At the second moment, the first electronic device receives the first message sent by the second electronic device, and the second moment here may be a time point within the time period corresponding to the first moment and the third moment, and the third moment is postponed to a time period between the third moment and the second moment that is equal to the wake-up cycle, that is, the wake-up cycle between the first moment and the third moment is interrupted, and the wake-up cycle is recalculated with the second moment as the reference time point.

[0048] In a fourth aspect, an embodiment of the present application provides an electronic device, including:

[0049] a memory for storing instructions to be executed by one or more processors of the terminal device, and

[0050] The processor is one of the processors of the terminal device and is used to execute the communication methods of the first aspect and the second aspect.

[0051] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium containing a computer program code for executing the communication method of the first aspect, the second aspect, and the third aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] Figure 1a to Figure 1c A schematic diagram of a scenario in which a terminal device provided in an embodiment of the present application realizes adaptive adjustment of a communication mode;

[0053] Figure 2a to Figure 2d A schematic diagram of a scenario in which a terminal device provided in an embodiment of the present application realizes adaptive adjustment of a communication mode;

[0054] Figure 3a to Figure 3c A schematic diagram of a scenario in which a terminal device according to an embodiment of the present application adaptively adjusts a communication mode by interrupting a heartbeat cycle;

[0055] Figure 4 A schematic diagram of the structure of a terminal device provided in an embodiment of the present application;

[0056] Figure 5 A software structure diagram of a terminal device provided by an embodiment of the present invention;

[0057] Figure 6 A flow chart of a communication method provided in an embodiment of the present application;

[0058] Figure 7a to Figure 7b A schematic diagram of a scenario in which a terminal device according to an embodiment of the present application adaptively adjusts a communication mode based on a sending priority of a push message;

[0059] Figure 8a to Figure 8b A schematic diagram of a scenario in which a terminal device according to an embodiment of the present application adaptively adjusts the communication mode based on the sending priority of push messages combined with the interruption of the heartbeat cycle. DETAILED DESCRIPTION

[0060] The technical solutions in the embodiments of the present application will be described clearly and in detail below with reference to the accompanying drawings.

[0061] refer to Figure 1a to Figure 1c , Figure 1a to Figure 1c A schematic diagram of a scenario in which the terminal device 100 provided in an embodiment of the present application implements adaptive adjustment of the communication mode is exemplarily shown.

[0062] like Figure 1a As shown, the terminal device 100 displays a user interface 110, which is a screen display interface of the terminal device 100. The user interface 110 displays a desktop 111 of the terminal device 100. The desktop 111 displays multiple push messages received by the terminal device 100, such as push messages 112 and push messages 113. The push messages 112 and 113 here can be the push messages received by the terminal device 100 from Figure 1b The server 200 (push server) shown receives it.

[0063] Figure 1b and Figure 1c FIG. 2 shows a schematic diagram of implementing message wake-up and heartbeat wake-up between the terminal device 100 and the server 200. Figure 1b As shown, within a heartbeat cycle (such as 5 minutes, including the time point of heartbeat wake-up 2, that is, the starting time point of the next heartbeat cycle), the terminal device 100 and the server 200 perform 2 message wake-ups and 2 heartbeat wake-ups. The heartbeat wake-up here can be the terminal device 100 sending a heartbeat instruction to the server 200 according to the heartbeat cycle, and the message wake-up here can be a push message received by the terminal device 100 from the server 200. The message wake-up and the heartbeat wake-up can be used to keep the connection between the terminal device 100 and the server 200 from being disconnected. For example: the terminal device 100 sends a push heartbeat 1 to the server 200 at the first moment within a heartbeat cycle, and the server 200 sends push message 1 and push message 2 to the terminal device 100 in turn at two different second moments within a heartbeat cycle, so as to keep the long connection between the terminal device 100 and the server 200 within a heartbeat cycle from being disconnected. The first moment here can be the starting time point of the heartbeat cycle, and the second moment can be a time point within the heartbeat cycle.

[0064] refer to Figure 1c , Figure 1c It shows the number of wake-ups between the terminal device 100 and the server 200 within the time period corresponding to three consecutive heartbeat cycles. For example, within 15 minutes corresponding to heartbeat cycle 1, heartbeat cycle 2 and heartbeat cycle 3, the number of wake-ups between the terminal device 100 and the server is 6 times, including 4 heartbeat wake-ups and 2 message wake-ups.

[0065] It can be understood that in addition to the terminal device sending a heartbeat instruction to the server at regular intervals, the message pushed by the server to the terminal device (message wake-up) can also achieve the effect of heartbeat wake-up, that is, keep the long connection between the terminal device and the server unbroken. Figure 1b and Figure 1cThe heartbeat cycle is set to 5 minutes. The 5 minutes here is exemplary. In some embodiments, the heartbeat cycle can also be set to 6 minutes, 10 minutes, etc., which is not limited here.

[0066] It can be seen that after the server 200 sends the push message 2 and the terminal device 100 receives the push message 2 from the server 200, the terminal device 100 and the server 200 have been able to maintain a long connection for a subsequent set time (for example, the same time as the heartbeat cycle) without being disconnected. If the terminal device 100 keeps the heartbeat cycle unchanged, after the terminal device 100 receives the push message 2 from the server 200, after a short time interval, the terminal device 100 sends a heartbeat wake-up 2 to the server 200 again, which will cause too many communications between the terminal device 100 and the server 200, thereby increasing the power consumption of the terminal device 100.

[0067] In order to solve the problem that the number of communications between the terminal device and the server is too many and the power consumption of the terminal device is increased in the process of keeping the long connection between the terminal device and the server unbroken, the server 200 can set the priority for the push message and adopt different push methods for push messages of different priorities (sending priorities). In some embodiments, the server 200 can divide the push messages into high-priority push messages and low-priority push messages. For high-priority push messages, the server 200 can push them to the terminal device 100 in real time; for low-priority push messages, the server 200 can delay the low-priority push messages to the starting time point of the next heartbeat cycle, and push them to the terminal device 100 together with the push heartbeat. In other words, the terminal device 100 and the server 200 can simultaneously exchange low-priority push messages and push heartbeats at the same time, reducing the number of communications between the terminal device 100 and the server 200, and further reducing the power consumption of the terminal device 100.

[0068] It can be understood that the priority (sending priority) of the push message here can be determined according to the type of application corresponding to the push message. For example, the push message of a travel application can be of high priority, and the push message of a shopping application or a reading application can be of low priority. In some embodiments, the priority of the push message can be determined according to the message type of the push message. For example, the push message of a flight change included in a travel application can be of high priority, and the push message of a push advertisement included in a travel application can be of low priority, etc. The embodiments of the present application are not limited to this.

[0069] refer to Figure 2a to Figure 2b , Figure 2a to Figure 2b A schematic diagram of a scenario in which the terminal device 100 provided in an embodiment of the present application implements adaptive adjustment of the communication mode is exemplarily shown.

[0070] like Figure 2a and 2b As shown, the server 200 can set push message 1 as a high-priority push message and push message 2 as a low-priority push message. The server sends push message 1 within heartbeat cycle 1. When it is necessary to send push message 2, push message 2 can be delayed to the next heartbeat cycle, that is, the starting time point of heartbeat cycle 2, so that the terminal device 100 and the server 200 can simultaneously receive and send push message 2 and push heartbeat 2. It can be seen that, Figure 2b As shown, within 15 minutes corresponding to heartbeat cycle 1, heartbeat cycle 2 and heartbeat cycle 3, the number of wake-up times between the terminal device 100 and the server 200 is 5 times, including 4 heartbeat wake-ups and 1 message wake-up.

[0071] In some embodiments, the above Figure 2a to Figure 2b A communication method is proposed in which a server can set a priority for a push message and use different push methods for push messages of different priorities. That is, the server 200 can push a high-priority push message in real time, and delay a low-priority push message to the start time point of the next heartbeat cycle, and push it to the terminal device 100 together with the push heartbeat. In some embodiments, the server 200 can delay a low-priority push message to the push moment of the next high-priority push message, and push the low-priority push message and the high-priority push message together to the terminal device 100. In other words, the terminal device 100 and the server 200 can first delay the push of a low-priority push message until the push moment of the next high-priority push message, and push the low-priority push message and the high-priority push message at the same time at the same time point, thereby reducing the number of communications between the terminal device 100 and the server 200, and further reducing the power consumption of the terminal device 100.

[0072] refer to Figure 2c to Figure 2d , Figure 2c to Figure 2d A schematic diagram of a scenario in which the terminal device 100 provided in an embodiment of the present application implements adaptive adjustment of the communication mode is exemplarily shown.

[0073] like Figure 2c As shown, the server 200 can set push message 1 as a low-priority push message and push message 2 as a high-priority push message. When the server needs to send push message 1, it can delay push message 1 to the next high-priority push message, that is, the push message 2. This enables the terminal device 100 to receive push message 1 and push message 2 from the server 200 at the same time. Figure 2dAs shown, within 15 minutes corresponding to heartbeat cycle 1, heartbeat cycle 2 and heartbeat cycle 3, the number of wake-up times between the terminal device 100 and the server 200 is 5 times, including 4 heartbeat wake-ups and 1 message wake-up.

[0074] It can be seen that through 2c to Figure 2d In the communication method shown, the server can delay at least one low-priority push message to the next high-priority push message, so that the server can push multiple messages at the same time, reducing the number of communications between the server and the terminal device. Since the real-time requirements of low-priority push messages are relatively low, they will not affect the user experience and can also reduce the power consumption of the terminal device. Figure 2a to Figure 2d The communication method shown can reduce the number of wake-up times between the terminal device 100 and the server, but it will cause delays in some push messages. For example, the maximum delay period may reach a heartbeat period (such as: 5 minutes), so that the application of the terminal device 100 cannot receive the push message in time, affecting the user experience.

[0075] In order to solve the problem that the number of communications between the terminal device and the server is too many in the process of keeping the long connection between the terminal device and the server unbroken, the power consumption of the terminal device is increased, and the push message sent by the server to the terminal device is delayed, the embodiment of the present application proposes a method for the terminal device to adaptively adjust the communication mode. When the terminal device receives the push message, the time point of receiving the push message can be used as the reference time point, the current heartbeat cycle is interrupted, and the heartbeat cycle is recalculated with the reference time point as the starting time point, that is, the time point of delaying one heartbeat cycle after the reference time point is used as the time point of the next heartbeat wake-up. In other words, the terminal device can adjust the starting time point of the next heartbeat wake-up every time it receives a push message from the server. The current heartbeat cycle can be interrupted and re-timing can be achieved by receiving a push message. If at least one push message can be received within a heartbeat cycle, it can be achieved that the heartbeat instruction is no longer sent periodically to the server. In this way, there is no need to delay the push message as in the aforementioned scheme, and the number of communications between the terminal device and the server can be effectively reduced, and the power consumption of the terminal device can be reduced.

[0076] refer to Figure 3a to Figure 3c , Figure 3a to Figure 3c Schematic diagrams of scenarios in which the terminal device 100 provided in the embodiments of the present application implements adaptive adjustment of the communication mode are shown respectively and exemplarily.

[0077] like Figure 3aAs shown, within a heartbeat cycle 1 (such as: 5 minutes), one message wake-up and one heartbeat wake-up are required between the terminal device 100 and the server 200, that is, after the terminal device 100 sends a push heartbeat 1 to the server 200 at the first moment within the heartbeat cycle 1, 2 minutes have passed and the server 200 sends a push message 1 to the terminal device 100 at the second moment. At this time, the terminal device 100 can obtain the time point of receiving the push message 1 as the reference time point, and interrupt and recalculate the heartbeat cycle 1 if the heartbeat cycle 1 has not ended, that is, recalculate the time point (third moment) of sending the push heartbeat 2 based on the duration of the heartbeat cycle (5 minutes), that is, set the duration between the second moment and the third moment to the duration of the heartbeat cycle 1, that is, interrupt and retime the heartbeat cycle 1. In some embodiments, as Figure 3b As shown, another minute has passed, and the server 200 has sent a push message 2 to the terminal device 100. At this time, the terminal device 100 can obtain the time point of receiving the push message 2 as the reference time point, and if the heartbeat cycle 1 has not ended, interrupt and recalculate the heartbeat cycle 1, that is, recalculate the time point of sending the push heartbeat 2 based on the length of the heartbeat cycle (5 minutes). In other words, if the terminal device 100 receives push messages sent by the server 200 multiple times within one heartbeat cycle (5 minutes), it will interrupt and recalculate the heartbeat cycle multiple times.

[0078] From the above, it can be seen that Figure 3b As shown, from the time when the terminal device 100 receives the push heartbeat 1 to the time when the terminal device 100 receives the push heartbeat 3, the number of wake-up times between the terminal device 100 and the server 200 is 5, including 3 heartbeat wake-ups and 2 message wake-ups. Figure 3c In the scenario shown, the terminal device 100 does not adjust the time point of the push heartbeat according to the time point of the push message received from the server 200 within the heartbeat cycle. Within the 15 minutes corresponding to heartbeat cycle 1, heartbeat cycle 2 and heartbeat cycle 3, the number of wake-ups between the terminal device 100 and the server is 6 times, including 4 heartbeat wake-ups and 2 message wake-ups. Figure 3c The scenario shown uses the method of keeping the heartbeat cycle unchanged. Figure 3a and Figure 3b The described method can flexibly adjust the heartbeat cycle according to the time point of pushing the message, thereby reducing the number of heartbeat wake-ups between the terminal device and the server.

[0079] In some embodiments, if the server 200 does not send a push message to the terminal device 100 within each heartbeat cycle, the terminal device 100 will not adaptively adjust the heartbeat cycle of heartbeat wake-up; if the server 200 sends a push message to the terminal device 100 within each heartbeat cycle, then through the method of adaptively adjusting the communication mode in the embodiment of the present application, the number of heartbeat instructions sent by the terminal device 100 to the server 200 can be reduced to 0 times, that is, the number of heartbeat wake-ups can be reduced to 0 times, so that the terminal device 100 and the server 200 can maintain the long connection between the terminal device and the server without heartbeat wake-up, which can reduce the power consumption of the terminal device 100.

[0080] In order to more clearly and in detail introduce the prompt method provided in the embodiment of the present application, the terminal device 100 involved in implementing the method provided in the embodiment of the present application is first introduced below. The terminal device 100 can be a mobile terminal such as a mobile phone, a tablet computer, a wearable device, a vehicle-mounted device, an augmented reality (AR) / virtual reality (VR) device, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a personal digital assistant (PDA), etc. The embodiment of the present application does not impose any restrictions on the specific type of the terminal device.

[0081] Figure 4 1 is a schematic diagram of the structure of a terminal device 100 provided in an embodiment of the present application. Figure 4 As shown, the terminal device (such as a mobile phone) may include: a processor 410, an external memory interface 420, an internal memory 421, a universal serial bus (USB) interface 430, a charging management module 440, a power management module 441, a battery 442, an antenna 1, an antenna 2, a mobile communication module 450, a wireless communication module 460, an audio module 470, a speaker 470A, a receiver 470B, a microphone 470C, an earphone interface 470D, a sensor module 480, a button 490, a motor 491, an indicator 492, a camera 493, a display screen 494, and a subscriber identification module (SIM) card interface 495, etc.

[0082] Among them, the above-mentioned sensor module 480 may include sensors such as a pressure sensor, a gyroscope sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor and an ambient light sensor.

[0083] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the terminal device. In other embodiments, the terminal device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0084] The processor 410 may include one or more processing units, for example, the processor 410 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.

[0085] The processor 410 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 410 is a cache memory. The memory may store instructions or data that the processor 410 has just used or cyclically used. If the processor 410 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 410, and thus improves the efficiency of the system.

[0086] In some embodiments, the processor 410 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0087] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation on the terminal device. In other embodiments, the terminal device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0088] The terminal device implements the display function through a GPU, a display screen 494, and an application processor. The GPU is a microprocessor for image processing, connecting the display screen 494 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 410 may include one or more GPUs that execute program instructions to generate or change display information.

[0089] The display screen 494 is used to display images, videos, etc. The display screen 494 includes a display panel.

[0090] The terminal device can realize the shooting function through ISP, camera 493, video codec, GPU, display screen 494 and application processor. ISP is used to process the data fed back by camera 493. Camera 493 is used to capture static images or videos. In some embodiments, the terminal device may include 1 or N cameras 493, where N is a positive integer greater than 1.

[0091] The external memory interface 420 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the terminal device. The external memory card communicates with the processor 410 through the external memory interface 420 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0092] The internal memory 421 may be used to store computer executable program codes, which include instructions. The processor 410 executes various functional applications and data processing of the terminal device by running the instructions stored in the internal memory 421. For example, in an embodiment of the present application, the processor 410 may execute the instructions stored in the internal memory 421, and the internal memory 421 may include a program storage area and a data storage area.

[0093] The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the terminal device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 421 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.

[0094] It is to be understood that the structure illustrated in the embodiments of the present application does not constitute a specific limitation on the terminal device. In other embodiments of the present application, the terminal device may include more or fewer components than shown in the figure, or combine certain components, or split certain components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0095] Figure 5 It is a software structure block diagram of the terminal device 100 according to an embodiment of the present invention.

[0096] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: application layer, application framework layer, Android runtime and system library, and kernel layer.

[0097] like Figure 5 As shown, the application layer may include applications such as life, video, reading, shopping, gallery, calendar, call, navigation and music. It is understood that the application here may be an application or service installed by the terminal device 100, or an application or service not installed by the terminal device 100 retrieved by the quick service center.

[0098] The application framework layer may include a layout subsystem, a window management module, an event input module, a connection management module, and the like. Among them, the layout subsystem is used to determine the position of each display element in the screen of the terminal device. The event input module is used to respond to the user's operation on the terminal device and change the display content in the screen of the terminal device. The window management module is used to obtain the properties of the window corresponding to the application. The connection management module is used to send a heartbeat instruction to the push server according to the preset heartbeat cycle to keep the long connection between the terminal device and the push server from being disconnected. The connection management module can also use the time point of the most recent push message received from the push server as the reference time point, interrupt and recalculate the heartbeat cycle corresponding to the reference time point, that is, delay the time point of the next heartbeat wake-up by one heartbeat cycle. In other words, each time the connection management module receives a push message from the push server, it can adjust the starting time point of the next heartbeat wake-up.

[0099] The system library may include a drawing service module (SurfaceFlinger), a layout module, a view module, etc. Among them, the drawing service module (SurfaceFlinger) is used to draw and synthesize one or more layers in the windows of one or more applications to obtain frame data. The layout module and the view module can be used to manage the operation mode of the user interface in the window.

[0100] The kernel layer includes display driver, event driver, sensor driver, etc.

[0101] The following is based on Figure 6 The method flow diagram shown is combined with Figure 3a to Figure 3b The communication method provided in the embodiments of the present application is described in detail. Figure 6 The method shown can be implemented by the processor of the terminal device 100 executing relevant instructions.

[0102] refer to Figure 6 , the communication method may include the following steps:

[0103] S601: Send a first heartbeat instruction to the server 200.

[0104] For example, continue to refer to Figure 3a , the first heartbeat instruction here may be push heartbeat 1. At the starting time point (first moment) of heartbeat cycle 1, the terminal device 100 sends push heartbeat 1 to the server 200, that is, a heartbeat wake-up is performed between the terminal device 100 and the server 200.

[0105] S602: receiving a first push message sent by the server 200.

[0106] Exemplarily, the first push message here may be push message 1. After 2 minutes have passed in heartbeat cycle 1, the server 200 may send push message 1 to the terminal device 100 at the second moment, that is, a message wake-up is performed between the terminal device 100 and the server 200.

[0107] S603: Adjust the sending time point of the second heartbeat instruction according to the time information of receiving the first push message.

[0108] For example, the second heartbeat instruction here may be a push heartbeat 2, and the time information of the first push message may be a time point at which the terminal device 100 can obtain and receive the push message 1. Figure 3a The terminal device 100 can obtain the time point of receiving the push message 1 as the reference time point. If the heartbeat cycle 1 has not passed, the heartbeat cycle 1 can be interrupted and recalculated, that is, the time point of sending the push heartbeat 2 can be delayed by one heartbeat cycle.

[0109] In some embodiments, reference may be made to Figure 3b , after the terminal device 100 receives the first push message (push message 1) sent by the server, 1 minute has passed, and the terminal device 100 receives the second push message (push message 2) sent by the server 200. At this time, the terminal device 100 can obtain the time point (second moment) of receiving the push message 2 as the reference time point, and interrupt and recalculate the heartbeat cycle 1 if the heartbeat cycle 1 has not ended, that is, recalculate the time point of sending the push heartbeat 2 based on the duration of the heartbeat cycle (5 minutes). In other words, if the terminal device 100 receives push messages sent by the server 200 multiple times within one heartbeat cycle (5 minutes), the heartbeat cycle will be interrupted and recalculated multiple times.

[0110] S604: Sending a second heartbeat instruction to the server 200 based on the sending time point of the second heartbeat instruction.

[0111] Exemplarily, if the terminal device 100 does not receive the push message sent by the server 200 within a heartbeat cycle (5 minutes), it sends a push heartbeat 2 to the server 200. If the terminal device 100 receives the push message sent by the server 200 again within a heartbeat cycle (5 minutes), it continues to interrupt and recalculate the heartbeat cycle 1.

[0112] It can be seen that through Figure 6The communication method shown avoids the problem that when a long connection between the terminal device and the server is maintained, if the terminal device frequently receives push messages from the server, the terminal device still needs to use a fixed heartbeat cycle to send heartbeat instructions to the server. The terminal device can flexibly adjust the heartbeat cycle according to the time point of the push message received from the server, thereby reducing the number of heartbeat wake-ups between the terminal device and the server and reducing the power consumption of the terminal device.

[0113] In some embodiments, the terminal device may also combine the priority and Figure 3a to Figure 3c The proposed method of interrupting and recalculating the heartbeat cycle is a method for a terminal device to adaptively adjust the communication mode. When the terminal device receives a high-priority (higher sending priority) push message, it can use the time point of receiving the high-priority push message as the reference time point, interrupt the current heartbeat cycle and recalculate the heartbeat cycle with the reference time point as the starting time point. That is to say, every time the terminal device receives a high-priority push message from the server, it can adjust the starting time point of the next heartbeat wake-up without delaying the push message, which can effectively reduce the number of communications between the terminal device and the server and reduce the power consumption of the terminal device.

[0114] refer to Figure 7a to Figure 7b , Figure 7a to Figure 7b Schematic diagrams of scenarios in which the terminal device 100 provided in the embodiments of the present application implements adaptive adjustment of the communication mode are shown respectively and exemplarily.

[0115] like Figure 7a As shown, after the terminal device 100 sends push heartbeat 1 to the server 200 at the first moment within the heartbeat cycle 1, the server 200 sends a low-priority (lower sending priority) push message and a high-priority (higher sending priority) push message to the terminal device 100 at the second moment, i.e., push message 1 and push message 2. The duration of the heartbeat cycle 1 has not ended. The terminal device 100 can obtain the time point when the push message 2 is received as the reference time point. When the heartbeat cycle 1 has not ended, the heartbeat cycle 1 is interrupted and recalculated, i.e., the time point (third moment) for sending the push heartbeat 2 is recalculated based on the duration of the heartbeat cycle (5min). That is, the duration between the second moment and the third moment is set to the duration of the heartbeat cycle 1, i.e., the heartbeat cycle 1 is interrupted and re-timing is achieved. It can be seen that, Figure 7b As shown, from the time when the terminal device 100 receives the push heartbeat 1 to the time when the terminal device 100 receives the push heartbeat 3, and then within a period of 15 minutes, the number of wake-up times between the terminal device 100 and the server 200 is 5 times, including 3 heartbeat wake-ups and 2 message wake-ups.

[0116] It can be seen that by adaptively adjusting the communication method shown in 7a and 7b, the terminal device can adjust the heartbeat cycle according to the time point of receiving the high-priority push message from the server, reduce the number of heartbeat wake-ups between the terminal device and the server, and reduce the power consumption of the terminal device.

[0117] In some embodiments, the server can delay a low-priority push message to the push time of the next high-priority push message, and push the low-priority push message and the high-priority push message together to the terminal device. At the same time, the terminal device can use the time point when the low-priority push message and the high-priority push message are received as the reference time point, interrupt the current heartbeat cycle and recalculate the heartbeat cycle with the reference time point as the starting time point, further reducing the number of communications between the terminal device and the server and reducing the power consumption of the terminal device.

[0118] refer to Figure 8a to Figure 8b , Figure 8a to Figure 8b Schematic diagrams of scenarios in which the terminal device 100 provided in the embodiments of the present application implements adaptive adjustment of the communication mode are shown respectively and exemplarily.

[0119] like Figure 8a to Figure 8b As shown, after the terminal device 100 sends push heartbeat 1 to the server 200 at the first moment within the heartbeat cycle 1, the server 200 can delay the push message 1 set as a low priority to the next high priority push message push moment, that is, the push message 2 push moment, that is, the server 200 sends a low priority push message and a high priority push message to the terminal device 100 at the second moment, that is, push message 1 and push message 2, and the duration of the heartbeat cycle 1 has not ended. The terminal device 100 can obtain the time point of receiving push message 1 and push message 2 as the reference time point, and in the case that the heartbeat cycle 1 has not ended, the heartbeat cycle 1 is interrupted and recalculated, that is, the time point (third moment) of sending push heartbeat 2 is recalculated based on the duration of the heartbeat cycle (5min), that is, the duration between the second moment and the third moment is set to the duration of the heartbeat cycle 1, that is, the heartbeat cycle 1 is interrupted and retiming is achieved. It can be seen that, Figure 8b As shown, from the time when the terminal device 100 receives the push heartbeat 1 to the time when the terminal device 100 receives the push heartbeat 3, and then within a period of 15 minutes, the number of wake-up times between the terminal device 100 and the server 200 is 4 times, including 3 heartbeat wake-ups and 1 message wake-up.

[0120] It can be seen that through the communication methods shown in 8a and 8b, the server can delay at least one low-priority push message to the push time of the next high-priority push message, so that the server can push multiple messages at the same time, reducing the number of communications between the server and the terminal device. Since the real-time requirements of low-priority push messages are low, they will not affect the user experience. At the same time, the terminal device can adjust the heartbeat cycle according to the time point of the high-priority push message received from the server, reduce the number of heartbeat wake-ups between the terminal device and the server, and reduce the power consumption of the terminal device.

[0121] In the description of the embodiments of the present application, unless otherwise specified, “ / ” means or. For example, A / B can mean A or B. The “and / or” in the text is merely a description of the association relationship between associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone.

[0122] In the following, the terms "first" and "second" are used for descriptive purposes only and are not to be understood as suggesting or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features, and in the description of the embodiments of the present application, unless otherwise specified, "plurality" means two or more.

[0123] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0124] It should be understood that although the terms "first", "second", etc. may be used herein to describe various features, these features should not be limited by these terms. These terms are used only to distinguish and should not be understood as indicating or implying relative importance. For example, a first feature may be referred to as a second feature, and similarly a second feature may be referred to as a first feature without departing from the scope of the exemplary embodiments.

[0125] In addition, various operations will be described as multiple separate operations in a manner that is most helpful for understanding the illustrative embodiments; however, the order of description should not be interpreted as implying that these operations must rely on the order of description, and many of the operations can be implemented in parallel, concurrently, or simultaneously. In addition, the order of the operations can also be rearranged. When the described operations are completed, the process can be terminated, but there can also be additional operations not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.

[0126] References in the specification to "one embodiment," "an embodiment," "an illustrative embodiment," etc. indicate that the described embodiment may include a particular feature, structure, or property, but each embodiment may or may not necessarily include the particular feature, structure, or property. Moreover, these phrases are not necessarily directed to the same embodiment. In addition, when particular features are described in conjunction with a specific embodiment, the knowledge of those skilled in the art can affect the combination of these features with other embodiments, whether or not these embodiments are explicitly described.

[0127] Unless the context dictates otherwise, the terms "comprising," "having," and "including" are synonymous. The phrase "A / B" means "A or B." The phrase "A and / or B" means "(A), (B), or (A and B)."

[0128] As used herein, the term "module" may refer to, be part of, or include: a memory (shared, dedicated, or group) for running one or more software or firmware programs, an application-specific integrated circuit (ASIC), an electronic circuit and / or processor (shared, dedicated, or group), a combinational logic circuit, and / or other suitable components that provide the described functionality.

[0129] In the accompanying drawings, some structural or method features may be shown in a specific arrangement and / or order. However, it should be understood that such a specific arrangement and / or order is not required. Instead, in some embodiments, these features may be described in a manner and / or order different from that shown in the illustrative drawings. In addition, the structural or method features included in a specific figure do not mean that all embodiments need to include such features. In some embodiments, these features may not be included, or these features may be combined with other features.

[0130] The embodiments of the present application are described in detail above in conjunction with the accompanying drawings, but the use of the technical solution of the present application is not limited to the various applications mentioned in the embodiments of the present patent. Various structures and variations can be easily implemented with reference to the technical solution of the present application to achieve the various beneficial effects mentioned herein. Various changes made within the knowledge of ordinary technicians in the field without departing from the purpose of the present application should all fall within the scope of the patent application.

Claims

1. A communication method, applied to a first electronic device, characterized in that: The method comprises: The first electronic device sends a first wake-up instruction to the second electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device; At a second moment, the first electronic device receives a first message sent by the second electronic device, wherein a time duration between the first moment and the second moment is less than a wake-up cycle; The first electronic device sends a second wake-up instruction to the second electronic device at a third moment, wherein a time length between the third moment and the second moment is equal to the wake-up period.

2. The method according to claim 1, characterized in that Also includes: At a fourth time between the first time and the second time, the first electronic device also receives a second message sent by the second electronic device.

3. The method according to claim 1, characterized in that Also includes: The first electronic device also receives a third message sent by the second electronic device at a second moment, wherein the second electronic device generates the third message earlier than the first message, and the sending priority of the third message is lower than the sending priority of the first message.

4. The method according to claim 1, characterized in that Also includes: At a fifth moment between the first moment and the second moment, the first electronic device also receives a fourth message sent by the second electronic device, wherein the second electronic device generates the fourth message earlier than the first message, and the sending priority of the fourth message is the same as the sending priority of the first message.

5. The method according to claim 1, characterized in that The first message includes a push message.

6. The method according to claim 3 or 4, characterized in that: The first message includes a push message sent to at least one of the following applications: an instant messaging application, a travel application, a news application, and a financial application.

7. The method according to claim 3, characterized in that The third message includes a push message sent to at least one of the following applications: a shopping application and a reading application.

8. A communication method, applied to a second electronic device, characterized in that: The method comprises: The second electronic device receives a first wake-up instruction sent by the first electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device; At a second moment, the second electronic device sends a first message to the first electronic device, wherein the duration between the first moment and the second moment is less than a wake-up cycle; The second electronic device receives a second wake-up instruction sent by the first electronic device at a third moment, wherein a duration between the third moment and the second moment is equal to the wake-up period.

9. The method according to claim 8, characterized in that Also includes: The second electronic device further sends a second message to the first electronic device at a fourth time between the first time and the second time.

10. The method according to claim 8, characterized in that Also includes: The second electronic device generates a third message before generating the first message; When determining that the sending priority of the third message is lower than the sending priority of the first message, the second electronic device further sends the third message to the first electronic device at a second moment.

11. The method according to claim 8, characterized in that Also includes: The second electronic device generates a fourth message before generating the first message; When determining that the sending priority of the fourth message is the same as the sending priority of the first message, the second electronic device sends a fourth message to the first electronic device at a fifth time between the first time and the second time.

12. A communication system, characterized in that: The system includes a first electronic device and a second electronic device, wherein: The first electronic device sends a first wake-up instruction to the second electronic device at a first moment, where the first wake-up instruction is used to maintain a communication connection between the first electronic device and the second electronic device; The second electronic device sends a first message to the first electronic device at a second time, wherein the duration between the first time and the second time is less than a wake-up period; The first electronic device sends a second wake-up instruction to the second electronic device at a third moment, wherein a time length between the third moment and the second moment is equal to the wake-up period.

13. An electronic device, characterized in that: include: a memory for storing instructions to be executed by one or more processors of the electronic device, and The processor is one of the processors of the electronic device, and is used to execute the communication method according to any one of claims 1 to 11.

14. A computer program product, characterized in that include: A non-volatile computer-readable storage medium, the non-volatile computer-readable storage medium comprising a computer program code for executing the communication method according to any one of claims 1 to 12.