WO2022179283A1 - 推送消息的发送方法、电子设备及可读介质 - Google Patents
推送消息的发送方法、电子设备及可读介质 Download PDFInfo
- Publication number
- WO2022179283A1 WO2022179283A1 PCT/CN2021/141151 CN2021141151W WO2022179283A1 WO 2022179283 A1 WO2022179283 A1 WO 2022179283A1 CN 2021141151 W CN2021141151 W CN 2021141151W WO 2022179283 A1 WO2022179283 A1 WO 2022179283A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- electronic device
- push message
- heartbeat packet
- mobile phone
- push
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 230000002776 aggregation Effects 0.000 description 26
- 238000004220 aggregation Methods 0.000 description 26
- 238000004891 communication Methods 0.000 description 14
- 238000010586 diagram Methods 0.000 description 10
- 230000006870 function Effects 0.000 description 9
- 238000007726 management method Methods 0.000 description 8
- 238000010295 mobile communication Methods 0.000 description 8
- 206010048669 Terminal state Diseases 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 3
- 230000003111 delayed effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000003993 interaction Effects 0.000 description 3
- 230000005236 sound signal Effects 0.000 description 3
- 238000013473 artificial intelligence Methods 0.000 description 2
- 230000002354 daily effect Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000001133 acceleration Effects 0.000 description 1
- 210000000988 bone and bone Anatomy 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 230000003203 everyday effect Effects 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000006116 polymerization reaction Methods 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
- 230000002618 waking effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F1/00—Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
- G06F1/26—Power supply means, e.g. regulation thereof
- G06F1/32—Means for saving power
- G06F1/3203—Power management, i.e. event-based initiation of a power-saving mode
- G06F1/3234—Power saving characterised by the action undertaken
- G06F1/3287—Power saving characterised by the action undertaken by switching off individual functional units in the computer system
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/10—Active monitoring, e.g. heartbeat, ping or trace-route
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/21—Monitoring or handling of messages
- H04L51/214—Monitoring or handling of messages using selective forwarding
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/55—Push-based network services
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W4/00—Services specially adapted for wireless communication networks; Facilities therefor
- H04W4/20—Services signaling; Auxiliary data signalling, i.e. transmitting data via a non-traffic channel
- H04W4/21—Services signaling; Auxiliary data signalling, i.e. transmitting data via a non-traffic channel for social networking applications
Definitions
- the present application relates to the field of content distribution, and in particular, to a method for sending push messages, an electronic device, and a readable medium.
- each push message arriving at the smart terminal may wake up the processor of the smart terminal from the sleep state for message processing, which often causes additional interruptions to the smart terminal. Wake up, resulting in increased power consumption of the smart terminal.
- the interrupted wake-up of smart terminals due to push messages accounts for about 45% of all interrupted wake-ups, and smart terminals receive an average of about 100 push messages during the day, which makes the extra power consumption of smart terminals due to push messages very considerable.
- Embodiments of the present application provide a method, electronic device, and readable medium for sending a push message, which can determine whether to send a push message immediately or with a delay according to the type of the push message, and automatically wake up the electronic device that receives the push message before waking up.
- the delayed-sent push message is sent to the electronic device, thereby reducing additional wake-up times of the electronic device, thereby reducing power consumption of the electronic device.
- an embodiment of the present application provides a method for sending a push message, where the method includes:
- the first electronic device determines that the type of the push message sent to the second electronic device is the first type, determine whether to receive the first heartbeat packet sent by the second electronic device;
- the first electronic device sends a push message after receiving the first heartbeat packet sent by the second electronic device.
- the above-mentioned method further includes:
- the first electronic device sends the push message to the second electronic device when it is determined that the type of the push message sent to the second electronic device is the second type.
- the above-mentioned method further includes:
- the first electronic device determines according to the terminal state that the type of the push message sent by the second electronic device is the second type , sending a push message to the second electronic device, wherein the terminal-side status includes at least one of the following information: system status; application status.
- the above-mentioned method further includes:
- the system state includes at least one of the following: screen-off time and system mode
- the application state includes at least one of the following: application usage, application usage settings, and application level.
- the first electronic device after receiving the first heartbeat packet sent by the second electronic device, the first electronic device sends a push message, including:
- the first electronic device After receiving the first heartbeat packet sent by the second electronic device, the first electronic device returns the second heartbeat packet to the second electronic device and simultaneously sends a push message.
- the first electronic device returns a second heartbeat packet to the second electronic device and simultaneously sends a push message, including:
- the first electronic device incorporates the push message into the second heartbeat packet and sends the second heartbeat packet to the second electronic device.
- the first electronic device returns a second heartbeat packet to the second electronic device and simultaneously sends a push message, including:
- the first electronic device sends the push message and the second heartbeat packet to the second electronic device respectively.
- the first electronic device after receiving the first heartbeat packet sent by the second electronic device, the first electronic device sends a push message, including:
- the first electronic device After receiving the first heartbeat packet sent by the second electronic device, the first electronic device sends a push message to the second electronic device within a predetermined time.
- the above-mentioned method further includes:
- the processor of the second electronic device is not in a sleep state for a predetermined time.
- an embodiment of the present application provides an electronic device, where the electronic device includes:
- a determining module configured to determine whether the first heartbeat packet sent by the second electronic device is received when the first electronic device determines that the type of the push message sent to the second electronic device is the first type
- the sending module is used for the first electronic device to send a push message after receiving the first heartbeat packet sent by the second electronic device.
- an embodiment of the present application provides an electronic device readable medium, where an instruction is stored on the electronic device readable medium, and when the instruction is executed on the electronic device, the electronic device can perform any one of the possibilities of the first aspect above. Methods.
- an embodiment of the present application provides an electronic device, including: a memory for storing instructions executed by one or more processors of the system, and a processor, which is one of the processors of the system, for executing Any one of the possible methods of the first aspect above.
- an embodiment of the present application provides an electronic device, where the electronic device has a function of implementing the above method for sending a push message.
- the functions can be implemented by hardware, or can be implemented by hardware executing corresponding software.
- the hardware or software includes one or more units corresponding to the above-mentioned functions.
- FIG. 1 shows a schematic diagram of a type scale of a push message according to some embodiments of the present application.
- FIG. 2 shows a sending scenario 10 of a push message according to some embodiments of the present application.
- FIG. 3 shows a schematic diagram of the power consumption of the electronic device 100 changing with time according to some embodiments of the present application.
- FIG. 4 shows a block diagram of a hardware structure of an electronic device 200 according to some embodiments of the present application.
- Fig. 5 shows an interaction flow chart of a method for sending a push message according to some embodiments of the present application.
- FIG. 6 shows a scenario in which a heartbeat packet and a push message are sent together in a method for sending a push message according to some embodiments of the present application.
- FIG. 7 shows a scenario in which a heartbeat packet and a push message are sent separately in a method for sending a push message, according to some embodiments of the present application.
- FIG. 8 shows a schematic structural diagram of an electronic device according to some embodiments of the present application.
- FIG. 9 is a schematic structural diagram of another electronic device according to some embodiments of the present application.
- Fig. 10 is a block diagram showing a software structure of an electronic device according to some embodiments of the present application.
- Illustrative embodiments of the present application include, but are not limited to, a method for sending a push message, an electronic device, and a readable medium, which are used to solve the problems of excessive wake-up times and high power consumption of the electronic device caused by the push message.
- first the terms “first”, “second” and the like used in this application may be used in this text to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish a first element from another element.
- FIG. 2 shows a sending scenario 10 of a push message according to some embodiments of the present application.
- the scene 10 includes an electronic device 100 and an electronic device 200 .
- the electronic device 200 can receive the push message of the application, and determine to send the push message immediately or delayed to the electronic device 100 according to the type of the push message or the terminal-side state of the electronic device 100, and the push message of the application may be from an external source.
- the push message of the third-party application may also be a push message from an application on the electronic device 200 .
- the push message sent immediately is sent by the electronic device 200 to the electronic device 100 in real time, and the push message sent after a delay is cached by the electronic device 200 .
- the electronic device 100 periodically wakes up actively and sends a heartbeat packet to the electronic device 200. After the electronic device 200 receives the heartbeat packet from the electronic device 100, it sends the cached and delayed push message to the electronic device 100. The electronic device 100 receives the push message. The message is then displayed to the user.
- FIG. 3 shows a process in which the power consumption of the electronic device 100 changes according to time.
- the electronic device 100 periodically wakes up actively and sends a Real Time Clock (RTC) heartbeat packet to the electronic device 200.
- RTC Real Time Clock
- the active wake-up of the electronic device 100 and the sending of the heartbeat packet will result in higher power consumption, that is, The figure corresponds to the power consumption peak of the RTC heartbeat packet, and this part of the power consumption must be generated by the electronic device 100 .
- directly pushing the push message to the electronic device 100 will cause additional wake-up of the electronic device 100, and the electronic device 100 will generate a news notification message, a video notification message, and a social notification message as shown in FIG. 3 .
- the electronic device 200 caches these notification messages, and after the electronic device 100 actively wakes up and sends a heartbeat packet to the electronic device 200 , the electronic device 200 sends the cached push message to the electronic device 100 .
- the electronic device 200 pushes the message during the active wake-up phase of the electronic device 100 , thereby avoiding additional wake-up of the electronic device 100 .
- the active wake-up phase of the electronic device 100 is a period of time during which the electronic device 100 actively wakes up and sends a heartbeat packet to the electronic device 200 and receives a heartbeat reply packet from the electronic device 200 .
- the news notification message in FIG. 3 may be pushed in the active wake-up phase when the electronic device 100 sends the second RTC heartbeat packet, and the video notification message and the social notification message may be sent by the electronic device 100 in the third RTC The heartbeat packet is pushed during the active wake-up phase.
- the electronic device 100 is actively woken up and then the push message sent by the electronic device 200 is received and processed. Power consumption for receiving and processing push messages. Therefore, the power consumption of sending and receiving heartbeat packets and receiving and processing push messages in the active wake-up phase of the electronic device 100 is much smaller than the sum of power consumption of sending and receiving heartbeat packets and receiving and processing push messages respectively. Since the electronic device 100 receives a large number of push messages every day, using the technical solution of the present application can reduce the power consumption of the electronic device 100 to a greater extent.
- the electronic device 100 and the electronic device 200 may include, but are not limited to, a laptop computer, a desktop computer, a tablet computer, a mobile phone, a wearable device, a head-mounted display, a server, a mobile email A device, a portable game console, a portable music player, a reader device, a television with one or more processors embedded or coupled therein, or other electronic device capable of accessing a network.
- FIG. 4 shows a block diagram of a hardware structure of an electronic device 200 according to some embodiments of the present application.
- the electronic device 200 may include one or more processors 201 , a system control logic 202 connected to at least one of the processors 201 , and a system memory connected to the system control logic 202 .
- a network interface 206 connected to the system control logic 202 .
- processor 201 may include one or more single-core or multi-core processors.
- processor 201 may comprise any combination of general purpose processors and special purpose processors (eg, graphics processors, application processors, baseband processors, etc.).
- the processor 201 may be configured to perform various conforming embodiments. For example, the processor 201 may be configured to execute the method for sending a push message as shown in FIG. 5 .
- system control logic 202 may include any suitable interface controller to provide any suitable interface to at least one of processors 201 and/or any suitable device or component in communication with system control logic 202 .
- system control logic 202 may include one or more memory controllers to provide an interface to system memory 203 .
- System memory 203 may be used to load as well as store data and/or instructions.
- the system memory 203 may load application program instructions for judging the type of push messages in the embodiments of the present application, may also load application program instructions for sending push messages to the electronic device 100, and may also load application program instructions for caching push messages program instructions, etc.
- memory 203 of system 200 may include any suitable volatile memory, such as suitable Dynamic Random Access Memory (DRAM).
- DRAM Dynamic Random Access Memory
- NVM/memory 204 may include one or more tangible, non-transitory computer-readable media for storing data and/or instructions.
- the NVM/memory 204 may include any suitable non-volatile memory such as flash memory and/or any suitable non-volatile storage device, such as a Hard Disk Drive (HDD), a Compact Disc (Compact Disc) , CD) drive, at least one of Digital Versatile Disc (DVD) drive.
- HDD Hard Disk Drive
- Compact Disc Compact Disc
- CD Compact Disc
- DVD Digital Versatile Disc
- the NVM/memory 204 may be used to store received application push messages and cache delayed sent push messages.
- the NVM/memory 204 may comprise a portion of storage resources on the apparatus in which the electronic device 200 is installed, or it may be accessed by the device, but not necessarily part of the device.
- NVM/storage 204 may be accessed over the network via network interface 206 .
- system memory 203 and NVM/memory 204 may include a temporary copy and a permanent copy of instructions 205, respectively.
- the instructions 205 may include instructions that when executed by at least one of the processors 201 cause the system 200 to implement the method shown in FIG. 7 .
- instructions 205 , hardware, firmware and/or software components thereof may additionally/alternately reside in system control logic 202 , network interface 206 and/or processor 201 .
- Network interface 206 may include a transceiver for providing a radio interface for electronic device 200 to communicate with any other suitable devices (eg, front-end modules, antennas, etc.) over one or more networks.
- network interface 206 may be integrated with other components of electronic device 200 .
- network interface 206 may be integrated into at least one of processor 201, system memory 203, NVM/memory 204, and a firmware device (not shown) having instructions, when at least one of processor 201 executes the When instructed, the electronic device 200 implements the method as shown in the method embodiment.
- the network interface 206 may be used to receive push messages and send the received push messages to the electronic device 100 , and may also receive a heartbeat packet sent by the electronic device 100 and return a heartbeat reply packet to the electronic device 100 .
- the network interface 206 may further include any suitable hardware and/or firmware to provide a multiple-input multiple-output radio interface.
- network interface 206 may be a network adapter, wireless network adapter, telephone modem, and/or wireless modem.
- At least one of the processors 201 may be packaged with logic for one or more controllers of the system control logic 202 to form a System In a Package (SiP). In some embodiments, at least one of the processors 201 may be integrated on the same die with logic for one or more controllers of the system control logic 202 to form a System on Chip (SoC).
- SiP System In a Package
- SoC System on Chip
- the electronic device 200 may further include an input/output (I/O) device 207 .
- the I/O device 207 may include a user interface that enables a user to interact with the electronic device 200 ; the peripheral component interface is designed so that the peripheral components can also interact with the electronic device 200 .
- the technical solutions of the present application will be described below by taking the electronic device 100 as a mobile phone and the electronic device 200 as a server as an example.
- the server 200 receives a push message of an application, and the application may be an external application or an application running on the server 200, and the push message is determined according to the type of the pushed message Whether it is a first type message or a second type message.
- the push message may be cached, and after receiving the heartbeat packet sent by the mobile phone 100 , the cached first type of push message is sent to the mobile phone 100 .
- the server 200 directly sends the push message to the mobile phone 100 .
- FIG. 5 shows a technical solution in which the server 200 caches the push message, and then pushes the cached push message to the mobile phone 100 after receiving the heartbeat packet sent by the mobile phone 100 according to some embodiments of the present application.
- the specific technical solution is described below by taking the first type of message as a non-emergency message and the second type of message as an emergency message as an example. Specifically, as shown in Figure 5:
- Step S501 the mobile phone 100 sends a heartbeat packet to the server 200 , and the heartbeat packet includes the terminal-side status of the mobile phone 100 .
- the time when the mobile phone 100 sends the heartbeat packet may be when the user uses the mobile phone 100 or when the user does not use the mobile phone 100 .
- the mobile phone 100 is usually in a sleep state. For example, after a period of time, such as 30 seconds, after the user stops using the mobile phone 100, the mobile phone 100 will automatically turn off the screen, stop the running of unnecessary applications, etc., thereby entering a sleep state.
- the mobile phone 100 periodically sends a heartbeat packet to the server 200, and the time interval for sending the heartbeat packet is pre-set, for example, set at the factory or set by the user as required.
- the set time interval can be, for example, 3 minutes, 5 minutes, or 10 minutes, and is generally set to 5 minutes. If the mobile phone 100 is in a sleep state when the time to send the heartbeat packet arrives, it will firstly wake up actively, so that the processor of the mobile phone 100 enters the working state, and then sends the heartbeat packet.
- the terminal-side status of the mobile phone 100 may include, but is not limited to, a system status and an application status.
- the system state of the mobile phone 100 refers to some information currently related to the mobile phone system, which may include, but is not limited to: screen-off time, system mode, and the like.
- the screen-off time refers to the time that lasts after the screen of the mobile phone 100 is automatically turned off.
- the system mode refers to the current mode of the mobile phone 100 , and the system mode may correspond to some system parameters of the mobile phone 100 , such as the power of the mobile phone 100 , the current time of the mobile phone 100 , and the like.
- the system mode can be automatically entered according to system parameters, such as automatically entering the low-power mode when the power of the mobile phone 100 is less than the power threshold, or can be entered according to the user's setting, for example, the user sets the mobile phone 100 to the silent mode during a meeting.
- the system mode may include, but is not limited to: low power mode, power saving mode, night mode, default mode or silent mode, and the like.
- the application status of the mobile phone 100 refers to the related usage information of the applications installed in the mobile phone 100 , which may include but not limited to: application usage, application usage settings, and application level.
- Application usage is used to describe how frequently users use the application. It can be described using different levels, such as: frequently used, generally used, rarely used, etc. It can also be described by numbers, such as: not used for more than 1 day, more than 3 Days unused, more than 7 days unused, etc.
- Application usage settings are used to describe related settings when using an application, for example, application A is set by the user to not allow activities, and application B is set by the user to mute notifications.
- the application level is used to describe the priority corresponding to the user. For example, application A corresponds to high priority, application B corresponds to low priority, and application C corresponds to medium priority.
- the heartbeat packet is a network data packet sent by the mobile phone 100 to the server 200 to inform the server 200 that the mobile phone 100 is currently online.
- the heartbeat packet is a network data packet using the Transmission Control Protocol (TCP), which is a reliable network transmission protocol and can ensure that the heartbeat packet sent by the mobile phone 100 reaches the server 200.
- TCP Transmission Control Protocol
- the terminal-side status data of the mobile phone 100 can be sent together with the heartbeat packet as a part of the heartbeat packet.
- the terminal-side status data of the mobile phone 100 can also be sent.
- the status data and the heartbeat packet are sent separately, and the embodiment of the present application does not limit the specific sending method of the terminal-side status of the mobile phone 100 .
- Step S502 the server 200 receives the terminal-side status sent by the mobile phone 100 and stores it.
- the server 200 saves the terminal-side status sent by the mobile phone 100 in the database of the server 200, so that it can determine whether to delay the sending of the message to be sent to the mobile phone 100 according to the terminal-side status corresponding to the mobile phone 100, thereby reducing the additional wake-up times of the mobile phone 100, Thus, the power consumption of the mobile phone 100 is reduced.
- Step S503 the server 200 sends a heartbeat reply packet to the mobile phone 100 .
- the server 200 After receiving the heartbeat packet sent by the mobile phone 100, the server 200 returns a heartbeat reply packet to the mobile phone 100, informing the mobile phone 100 that the server 200 is also currently online, and the two parties can interact normally.
- the heartbeat reply packet is a network data packet that also uses the Transmission Control Protocol, so as to ensure that the heartbeat reply packet returned by the server 200 can reliably reach the mobile phone 100 .
- Step S504 the server 200 receives the push message from the application.
- the application installed on the mobile phone 100 may be an application from a third party, and the third party is responsible for developing and operating third-party applications that can be run on the mobile phone 100.
- the application installed on the mobile phone 100 is the client version of the application, the server version of the application runs in the cloud, the server version of the application generates a message to be pushed, and pushes the generated push message to the client version of the application.
- the server-side version of the application does not directly push the generated push message to the client-side version of the application on the mobile phone 100, but pushes the push message to the server 200, and then the server 200 sends it to the mobile phone 100, As a result, the server-side version of the application only needs less computing resources to realize the push of the application message.
- Applications installed on the mobile phone 100 can be of various types, such as news applications, users read daily news through news applications; video applications, users use video applications to watch videos; social applications, users use social applications to read daily news; app for social communication.
- Push messages generated by different types of applications can be pushed to the server 200 first, and then sent by the server 200 to the mobile phone 100 .
- the push messages received by the server 200 come from different types of third-party applications, and the types of push messages of the third-party applications are also different.
- the types of push messages may include content recommendation, instant messages, financial news, subscription messages, logistics information, etc. kind.
- Step S505 the server 200 determines whether the push message is an emergency message according to the type of the push message. If it is determined that the push message is an emergency message, step S506 is executed; if the push message is a non-emergency message, step S507 is executed.
- the application push message received by the server 200 includes the type of the message, and the server 200 can know the type of the push message by parsing the third-party push message.
- the server 200 may determine received push messages of different types as emergency messages or non-emergency messages according to presets for different types of push messages.
- the types of push messages that are closely related to the user's life may be set as urgent messages, and the types of push messages that are less related to the user's life may be set as non-urgent messages.
- manually set a push message of type A to correspond to an emergency message, and a push message of type B to correspond to a non-emergency message, etc. and save the manually set corresponding information on the server 200, and the server 200 receives the push message after receiving the push message.
- it can be determined whether the push message is an emergency message or a non-emergency message by querying the manually set corresponding information according to the type of the push message.
- the server 200 may further determine the push message as an emergency message or a non-emergency message according to the timeliness requirements of different types of push messages.
- Different types of push messages have different timeliness requirements. For example, content recommendation type push messages have lower timeliness requirements, while instant message and financial dynamic push messages have higher timeliness requirements. Therefore, the push message type with high timeliness requirements can be judged as urgent messages, and the push message types with low timeliness requirements can be judged as non-urgent messages, so as to realize timely push of messages with high timeliness requirements.
- Step S506 the server 200 directly sends the push message when the push message is an emergency message.
- the emergency message is usually a push message that is important to the user, and needs to be sent to the mobile phone 100 in time to be displayed to the user. Therefore, the server 200 does not delay sending the emergency message. Push messages to send.
- step S507 the server 200 determines whether the push message is an emergency message according to the stored terminal-side status of the mobile phone 100.
- the push messages some of the push messages that are judged to be urgent messages by the message type have been sent in real time by the server 200.
- the server 200 judges the remaining push messages according to the terminal-side status of the mobile phone 100, and determines that the messages may be urgent messages.
- Push messages if there are emergency messages in the remaining push messages, the server 200 sends the emergency messages in real time.
- the server 200 determines whether the push message is an emergency message according to a preset emergency message determination rule.
- the emergency message determination rule is set according to the system state and application state, and the push message that satisfies the emergency message determination rule is an emergency message. For example, if the emergency message judgment rule is "screen-off time is less than 5 minutes, and the system mode is the default mode", then the system state of the mobile phone 100 received by the server 200 in advance is "screen-off time: 3 minutes, system mode: default mode" In the case of , the received push message is determined to be an urgent message.
- the message type of the push message A received by the server 200 is content recommendation
- the corresponding application is application A
- the push message of the content recommendation type is determined to be a non-emergency message in step S505, and in step S507, the server 200 according to the emergency message
- the determination rule continues to perform emergency message determination on the push message A.
- the application status on the mobile phone 100 obtained by the server 200 is, for example, "application name: application A, application usage: frequently used", indicating that the users of the mobile phone 100 use application A very frequently and pay more attention to the messages pushed by application A.
- the push message corresponding to application A is an emergency message, so the emergency message determination rule can be set as "application usage is frequently used", then the server 200 determines the push message A as an emergency message in the above situation, and pushes The message A is pushed in real time to meet the attention requirement of the user of the mobile phone 100 to the application A.
- the server 200 determines a new emergency message in the remaining push messages according to the terminal-side state of the mobile phone 100, the final remaining push messages are sent as non-emergency messages.
- Step S508 the server 200 caches the push messages determined to be non-urgent messages when the aggregation conditions are satisfied.
- Push messages determined to be non-urgent messages are generally less important messages to the user of the mobile phone 100, so the server 200 may cache multiple non-urgent messages when the aggregation conditions are met.
- the caching methods include but are not limited to The following ways: use file for caching, use database for caching, cache in memory, etc.
- One or more non-emergency messages cached constitute an aggregated push message corresponding to the mobile phone 100 .
- the server 200 may also directly push the push messages as non-urgent messages. For example, if the aggregation conditions are not satisfied, the user is using the mobile phone 100. The mobile phone 100 is in the wake-up state, and pushing non-emergency messages will not generate additional wake-up power consumption.
- the aggregation condition is determined according to the terminal-side status of the mobile phone 100 sent to the server 200 .
- the aggregation condition may be determined according to the system state of the mobile phone 100 , or may be determined according to the application state of the mobile phone 100 .
- the aggregation condition 1 indicates that when the system mode of the mobile phone 100 is the low-power mode and the screen-off time is longer than 5 minutes, the push messages as non-emergency messages are cached.
- Aggregation condition 4 indicates that when the system mode of the mobile phone 100 is the default mode, and the screen-off time is longer than 30 minutes or longer than 10 minutes, the push messages as non-emergency messages are cached. Other analogies.
- the application aggregation condition 1 indicates that when the application usage is rarely used, the push message of the corresponding application is cached.
- Application aggregation condition 2 indicates that when the application usage is set to not allow activities, the push messages of the corresponding application are cached.
- Application aggregation condition 3 indicates that when the application level is a low-priority application, the push message of the corresponding application is cached.
- Application aggregation condition 4 indicates that when the application usage is set to muted notifications, the push messages of the corresponding application are cached.
- the above aggregation conditions are only examples made according to the terminal-side status of the mobile phone 100, and do not constitute a limitation on the aggregation conditions in the embodiments of the present application.
- the aggregation conditions can be combined according to different state parameters in the terminal-side status of the mobile phone 100, The examples of the present application do not specifically limit the composition of the polymerization conditions.
- Step S509 the mobile phone 100 sends a heartbeat packet to the server 200 .
- the heartbeat packet of the mobile phone 100 may include the terminal-side status of the mobile phone 100, or may not include the terminal-side status. If the sent heartbeat packet includes the terminal state, the server 200 may replace the previous terminal state of the mobile phone 100 with the currently received terminal state of the mobile phone 100 .
- Step S510 the server 200 obtains the cached aggregated push message. Since the server 200 has received the heartbeat packet sent by the mobile phone 100, the server 200 already knows that the mobile phone 100 has been actively woken up. At this time, sending the aggregated push message to the mobile phone 100 will not cause the mobile phone 100 to wake up additionally.
- the server 200 acquires the aggregated push message corresponding to the mobile phone 100 from the cached aggregated push message database.
- the query and acquisition of the aggregated push messages corresponding to the mobile phone 100 can be facilitated.
- step S511 the server 200 judges whether to merge the aggregated push messages corresponding to the mobile phone 100 into the heartbeat reply package for push, and if so, execute step S512; otherwise, execute step S513.
- the server 200 can send the aggregated push message and the heartbeat reply package to the mobile phone 100 in two ways: the combined way of integrating the aggregated push message into the heartbeat reply package and sending the aggregated push message and the heartbeat reply package. Separate way to send reply packets separately.
- the server 200 may determine which mode to send according to a preset sending mode, and may also determine the sending mode according to the data amount of the aggregated push message.
- step S512 if it is determined to use the combining method, the server 200 combines the aggregated push message into a heartbeat reply packet for sending.
- the server 200 may send the aggregated push message as the bearer data of the heartbeat reply packet when the data amount of the aggregated push message is less than the data amount that can be carried by the heartbeat reply packet, thereby reducing the number of sent data packets .
- FIG. 6 shows a scenario in which aggregated push messages are merged into a heartbeat reply packet and pushed.
- the mobile phone 100 sends the terminal-side status and the heartbeat packet to the server 200.
- the server 200 receives the push message 2 from the news application and the push message 3 from the financial application.
- the server 200 determines that the push message 2 and push message 3 are non-emergency messages, then push message 2 and push message 3 are cached as aggregated push messages.
- the server 200 After the mobile phone 100 sends the heartbeat packet to the server 200 for the second time, the server 200 obtains the cached aggregated push messages corresponding to the mobile phone 100 , the aggregated push messages, namely push message 2 and push message 3, are used as the bearer data of the heartbeat reply packet, and combined with the heartbeat reply packet to form an aggregated data packet, the server 200 sends the aggregated data packet to the mobile phone 100, and the mobile phone 100 receives and displays the push message 2 and push messages 3.
- the server 200 After the mobile phone 100 sends the heartbeat packet to the server 200 for the second time, the server 200 obtains the cached aggregated push messages corresponding to the mobile phone 100 , the aggregated push messages, namely push message 2 and push message 3, are used as the bearer data of the heartbeat reply packet, and combined with the heartbeat reply packet to form an aggregated data packet, the server 200 sends the aggregated data packet to the mobile phone 100, and the mobile phone 100 receives and displays the push message 2 and push messages 3.
- step S513 if it is determined to use the separate mode, the server 200 pushes the aggregated push message and the heartbeat reply packet respectively.
- the server 200 may send the aggregated push message and the heartbeat reply packet separately when the data amount of the aggregated push message is larger than the data amount that the heartbeat reply packet can carry, so that more push messages can be sent.
- FIG. 7 shows a scenario in which aggregated push messages and heartbeat reply packets are pushed separately.
- the mobile phone 100 sends the terminal status and the heartbeat packet to the server 200
- the server 200 receives the push message 2 from the news application and the push message 3 from the financial application
- the server 200 determines that the push message 2 and push message 3 are non-emergency messages, then push message 2 and push message 3 are cached as aggregated push messages.
- the server 200 obtains the cached aggregated push messages corresponding to the mobile phone 100 , and send the aggregated push messages, namely, push message 2, push message 3, and heartbeat reply package, to the mobile phone 100, respectively, and the mobile phone 100 receives and displays the push message 2 and the push message 3 respectively.
- Step S514 after receiving the aggregated push message, the mobile phone 100 sends the push message to the corresponding application and displays it.
- the aggregated push message may include server-side push messages of multiple applications, and the mobile phone 100 parses the multiple push messages from the aggregated push messages and sends them to the client side of the corresponding application for display.
- FIG. 8 shows a schematic structural diagram of an electronic device 800. It can be understood that the specific technical details in the above method for sending a push message are also applicable to the electronic device 800. In order to avoid repetition ,No longer.
- the electronic device includes:
- Determining module 801 when the first electronic device determines that the type of the push message sent to the second electronic device is the first type, determine whether to receive the first heartbeat packet sent by the second electronic device;
- Sending module 802 After receiving the first heartbeat packet sent by the second electronic device, the first electronic device sends the push message.
- FIG. 9 shows a schematic structural diagram of a mobile phone 100 according to an embodiment of the present application.
- the mobile phone 100 may include a processor 910 , a power supply module 940 , a memory 980 , a mobile communication module 930 , a wireless communication module 920 , a sensor module 990 , an audio module 950 , a camera 970 , an interface module 960 , a key 901 and a display screen 902, etc.
- the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the mobile phone 100 .
- the mobile phone 100 may include more or less components than shown, or some components may be combined, or some components may be separated, or different component arrangements.
- the illustrated components may be implemented in hardware, software, or a combination of software and hardware.
- the mobile phone 100 is configured to send a heartbeat packet including the terminal status to the server 200, receive a heartbeat reply packet and an aggregated push message returned by the server 200, and display the aggregated push message.
- the processor 910 may include one or more processing units, for example, may include a central processing unit (Central Processing Unit, CPU), a graphics processor (Graphics Processing Unit, GPU), a digital signal processor (Digital Signal Processing, DSP), A processing module or processing circuit such as a microprocessor (Micro-programmed Control Unit, MCU), an artificial intelligence (Artificial Intelligence, AI) processor or a programmable logic device (Field Programmable Gate Array, FPGA). Wherein, different processing units may be independent devices, or may be integrated in one or more processors.
- a storage unit may be provided in the processor 910 for storing instructions and data. In some embodiments, the storage unit in processor 910 is cache memory 980 .
- the power module 940 may include power supplies, power management components, and the like.
- the power source can be a battery.
- the power management part is used to manage the charging of the power supply and the power supply of the power supply to other modules.
- the mobile communication module 930 may include, but is not limited to, an antenna, a power amplifier, a filter, a low noise amplifier (LNA), and the like.
- the mobile communication module 930 can provide wireless communication solutions including 2G/3G/4G/5G etc. applied on the mobile phone 100 .
- the mobile communication module 930 can receive electromagnetic waves through the antenna, filter, amplify, etc. the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation.
- the mobile communication module 930 can also amplify the signal modulated by the modulation and demodulation processor, and then convert it into electromagnetic waves for radiation through the antenna.
- at least part of the functional modules of the mobile communication module 930 may be provided in the processor 910 .
- at least part of the functional modules of the mobile communication module 930 may be provided in the same device as at least part of the modules of the processor 910 .
- the wireless communication module 920 may include an antenna, and transmit and receive electromagnetic waves via the antenna.
- the wireless communication module 920 can provide applications on the mobile phone 100 including wireless local area networks (WLAN), wireless fidelity (Wi-Fi) networks, bluetooth (BT), global navigation satellite systems (global Navigation satellite system, GNSS), frequency modulation (frequency modulation, FM), near field communication technology (near field communication, NFC), infrared technology (infrared, IR) and other wireless communication solutions.
- the cell phone 100 can communicate with the network and other devices through wireless communication technology.
- the wireless communication module is used to receive and check the marked network data packets, and aggregate the network data packets belonging to the same data segment from applications with high network delay requirements, and then send the aggregated network data packets as the same batch of data. package to send.
- the mobile communication module 930 and the wireless communication module 920 of the handset 100 may also be located in the same module.
- the display screen 902 is used for displaying human-computer interaction interfaces, images, videos, and the like.
- Display screen 902 includes a display panel.
- the sensor module 990 may include a proximity light sensor, a pressure sensor, a gyro sensor, an air pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, a bone conduction sensor, and the like.
- the audio module 950 is used for converting digital audio information into analog audio signal output, or converting analog audio input into digital audio signal. Audio module 950 may also be used to encode and decode audio signals. In some embodiments, the audio module 950 may include a speaker, earpiece, microphone, and headphone jack.
- Camera 970 is used to capture still images or video.
- the object is projected through the lens to generate an optical image onto the photosensitive element.
- the photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to Image Signal Processing (ISP) to convert it into a digital image signal.
- ISP Image Signal Processing
- the interface module 960 includes an external memory interface, a universal serial bus (universal serial bus, USB) interface, a subscriber identification module (subscriber identification module, SIM) card interface, and the like.
- the external memory interface can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the mobile phone 100 .
- the external memory card communicates with the processor 910 through the external memory interface to realize the data storage function.
- the Universal Serial Bus interface is used for communication between the cell phone 100 and other electronic devices.
- the subscriber identity module card interface is used to communicate with the SIM card installed in the handset 100 .
- the cell phone 100 further includes buttons 901, a motor, an indicator, and the like.
- the key 901 may include a volume key, an on/off key, and the like.
- the motor is used to make the mobile phone 100 vibrate. For example, when the user's mobile phone 100 is called, the mobile phone 100 vibrates, so as to prompt the user to answer the incoming call from the mobile phone 100 .
- Indicators may include laser pointers, radio frequency indicators, LED indicators, and the like.
- FIG. 10 it is a software structural block diagram of a mobile phone 100 in an embodiment of the present application.
- the mobile phone can be used to send a heartbeat packet including the terminal-side status to the server, receive a heartbeat reply packet and an aggregated push message returned by the server, and display the aggregated push message.
- FIG. 10 shows that the software system of the mobile phone 100 may adopt a layered architecture, an event-driven architecture, a microkernel architecture, a microservice architecture, or a cloud architecture.
- the embodiments of the present invention take an Android system with a layered architecture as an example to illustrate the software structure of the mobile phone 100 as an example.
- the layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces.
- the Android system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, an Android runtime (Android runtime) and a system library, and a kernel layer.
- the application layer can include a series of application packages.
- the application package may include applications such as phone, camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
- the application framework layer provides an application programming interface (application programming interface, API) and a programming framework for applications in the application layer.
- the application framework layer includes some predefined functions.
- the application framework layer may include window managers, content providers, view systems, telephony managers, resource managers, notification managers, and the like.
- a window manager is used to manage window programs.
- the window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
- Content providers are used to store and retrieve data and make these data accessible to applications.
- the data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
- the view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications.
- a display interface can consist of one or more views.
- the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
- the telephony manager is used to provide the communication function of the terminal device. For example, the management of call status (including connecting, hanging up, etc.).
- the resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
- the notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications of applications running in the background, and notifications on the screen in the form of dialog windows. For example, text information is prompted in the status bar, a prompt sound is issued, the terminal device vibrates, and the indicator light flashes.
- Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
- the core library consists of two parts: one is the function functions that the java language needs to call, and the other is the core library of Android.
- the application layer and the application framework layer run in virtual machines.
- the virtual machine executes the java files of the application layer and the application framework layer as binary files.
- the virtual machine is used to perform functions such as object life cycle management, stack management, thread management, safety and exception management, and garbage collection.
- a system library can include multiple functional modules. For example: surface manager (surface manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL), etc.
- surface manager surface manager
- media library Media Libraries
- 3D graphics processing library eg: OpenGL ES
- 2D graphics engine eg: SGL
- the Surface Manager is used to manage the display subsystem and provides a fusion of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to realize 3D graphics drawing, image rendering, compositing and layer processing, etc.
- 2D graphics engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer contains at least display drivers, camera drivers, audio drivers, and sensor drivers.
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Cardiology (AREA)
- Telephone Function (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
本申请涉及内容分发领域,公开了一种推送消息的发送方法、电子设备及可读介质。本申请的推送消息的发送方法包括:第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包,并且第一电子设备在接收到第二电子设备发送的第一心跳包后,再发送推送消息,从而实现在不同时间将不同类型的推送消息发送至第二电子设备,能够减少第二电子设备的额外唤醒次数,降低第二电子设备的功耗。
Description
本申请要求于2021年2月26日提交中国专利局、申请号为202110220947.3、申请名称为“推送消息的发送方法、电子设备及可读介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及内容分发领域,特别涉及一种推送消息的发送方法、电子设备及可读介质。
随着用户智能终端上安装的应用越来越多,各种应用推送到智能终端上的消息也越来越多,推送的应用消息中绝大多数都是内容推荐类型的消息,如图1所示,内容推荐类的消息在全部消息中占比70%以上。另外,由于应用消息推送到智能终端的时间和频率不定,到达智能终端的每一条推送消息都可能会使智能终端的处理器从睡眠状态中唤醒以进行消息处理,因此往往造成智能终端额外的中断唤醒,导致智能终端的功耗增加。根据相关统计,由于推送消息导致智能终端的中断唤醒约占全部中断唤醒的45%,并且智能终端白天平均收到约100条推送消息,使得智能终端由于推送消息导致的额外功耗十分可观。
发明内容
本申请实施例提供了一种推送消息的发送方法、电子设备及可读介质,能够根据推送消息的类型确定将推送消息进行即时发送或延迟发送,并且在接收推送消息的电子设备主动唤醒后再将延迟发送的推送消息发送到该电子设备,从而减少对该电子设备的额外唤醒次数,进而降低电子设备的功耗。
第一方面,本申请实施例提供了一种推送消息的发送方法,上述方法包括:
第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包;
第一电子设备在接收到第二电子设备发送的第一心跳包后,发送推送消息。
在上述第一方面的一种可能的实现中,上述方法还包括:
第一电子设备在判断出向第二电子设备发送的推送消息的类型为第二类型的情况下,向第二电子设备发送推送消息。
在上述第一方面的一种可能的实现中,上述方法还包括:
在第一心跳包之前发送的第三心跳包包含第二电子设备的端侧状态,并且第一电子设备根据端侧状态判断出第二电子设备发送的推送消息的类型为第二类型的情况下,向第二电子设备发送推送消息,其中,端侧状态包括如下信息中的至少一种:系统状态;应用状 态。
在上述第一方面的一种可能的实现中,上述方法还包括:
系统状态包括如下至少一种:灭屏时间和系统模式,应用状态包括如下至少一种:应用使用情况、应用使用设置和应用级别。
在上述第一方面的一种可能的实现中,第一电子设备在接收到第二电子设备发送的第一心跳包后,发送推送消息,包括:
第一电子设备在接收到第二电子设备发送的第一心跳包后,向第二电子设备返回第二心跳包并同时发送推送消息。
在上述第一方面的一种可能的实现中,第一电子设备向第二电子设备返回第二心跳包并同时发送推送消息,包括:
第一电子设备将推送消息合并到第二心跳包中并将第二心跳包发送至第二电子设备。
在上述第一方面的一种可能的实现中,第一电子设备向第二电子设备返回第二心跳包并同时发送推送消息,包括:
第一电子设备将推送消息和第二心跳包分别发送至第二电子设备。
在上述第一方面的一种可能的实现中,第一电子设备在接收到第二电子设备发送的第一心跳包后,发送推送消息,包括:
第一电子设备在接收到第二电子设备发送的第一心跳包后,在预定时间内向第二电子设备发送推送消息。
在上述第一方面的一种可能的实现中,上述方法还包括:
在预定时间内第二电子设备的处理器不处于休眠状态。
第二方面,本申请实施例提供了一种电子设备,上述电子设备包括:
确定模块,用于在第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包;
发送模块,用于第一电子设备在接收到第二电子设备发送的第一心跳包后,发送推送消息。
第三方面,本申请实施例提供了一种电子设备可读介质,电子设备可读介质上存储有指令,该指令在电子设备上执行时可以使电子设备执行上述第一方面的任意一种可能的方法。
第四方面,本申请实施例提供了一种电子设备,包括:存储器,用于存储由系统的一个或多个处理器执行的指令,以及处理器,是系统的处理器之一,用于执行上述第一方面的任意一种可能的方法。
第五方面,本申请实施例提供了一种电子设备,该电子设备具有实现上述推送消息的发送方法的功能。所述功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件包括一个或多于一个与上述功能相对应的单元。
图1根据本申请的一些实施例,示出了一种推送消息的类型比例示意图。
图2根据本申请的一些实施例,示出了一种推送消息的发送场景10。
图3根据本申请的一些实施例,示出了一种电子设备100的功耗随时间变化的示意图。
图4根据本申请的一些实施例,示出了一种电子设备200的硬件结构框图。
图5根据本申请的一些实施例,示出了一种推送消息的发送方法的交互流程图。
图6根据本申请的一些实施例,示出了一种推送消息的发送方法中心跳包和推送消息合并发送的场景。
图7根据本申请的一些实施例,示出了一种推送消息的发送方法中心跳包和推送消息分别发送的场景。
图8根据本申请的一些实施例,示出了一种电子设备的结构示意图。
图9根据本申请的一些实施例,示出了另一种电子设备的结构示意图。
图10根据本申请的一些实施例,示出了一种电子设备的软件结构框图。
本申请的说明性实施例包括但不限于一种推送消息的发送方法、电子设备及可读介质,用以解决推送消息造成的电子设备的额外唤醒次数过多、功耗高的问题。可以理解,本申请所使用的术语“第一”、“第二”等可在本文本中用于描述各种元件,但除非特别说明,这些元件不受这些术语限制。这些术语仅用于将第一个元件与另外一个元件区分。
下面将结合附图对本申请的实施例作进一步地详细描述。
图2根据本申请的一些实施例,示出了一种推送消息的发送场景10。具体的,如图2所示,场景10中包括电子设备100和电子设备200。其中,电子设备200能够接收应用的推送消息,并根据推送消息的类型或电子设备100的端侧状态确定将推送消息进行即时发送或延迟发送至电子设备100,应用的推送消息可以是来自外部第三方应用的推送消息,也可以是来自电子设备200上应用的推送消息。即时发送的推送消息由电子设备200实时发送至电子设备100,延迟发送的推送消息由电子设备200进行缓存。电子设备100定期主动唤醒并发送心跳包至电子设备200,电子设备200接收到来自电子设备100的心跳包后将缓存的延迟发送的推送消息发送至电子设备100,电子设备100在接收到推送消息后将消息展现给用户。
图3示出了电子设备100的功耗依照时间变化的过程。如图3所示,电子设备100定期主动唤醒,并向电子设备200发送实时时钟(Real Time Clock,RTC)心跳包,电子设备100的主动唤醒以及发送心跳包会产生较高的功耗,即图中对应RTC心跳包的功耗波峰,这部分功耗是电子设备100必定会产生的。另外,现有方案中直接将推送消息推送至电子设备100会造成电子设备100的额外唤醒,如图3中所示的新闻类通知消息、视频类通知消息和社交类通知消息导致电子设备100产生额外的功耗,使得电子设备100的功耗较高。在本申请技术方案中,电子设备200将这些通知消息进行缓存,并在电子设备100主动唤醒并发送心跳包给电子设备200后,电子设备200再将缓存的推送消息发送至电子设备100。通过改变通知消息的推送时间,使得电子设备200在电子设备100的主动唤醒阶段进行消息推送,从而避免对电子设备100的额外唤醒。在此,电子设备100的主动唤醒阶段是电子设备100主动唤醒并向电子设备200发送心跳包,并接收来自电子设备200的心跳回复包的一段时间。例如,可以将图3中的新闻类通知消息在电子设备100发送第二个RTC心跳包时的主动唤醒阶段进行推送,将视频类通知消息和社交类通知消息在电子设备100发送第三个RTC心跳包时的主动唤醒阶段进行推送。
本申请实施例中采用了电子设备100主动唤醒后再接收电子设备200发送的推送消息并进行处理的方式,这种方式中电子设备100所产生的功耗远小于将电子设备100从睡眠中唤醒再接收和处理推送消息所产生的功耗。因此电子设备100将心跳包的发送和接收与接收和处理推送消息在主动唤醒阶段中进行所产生的功耗远小于分别发送和接收心跳包与接收和处理推送消息所产生的功耗之和。由于电子设备100每天接收的推送消息数量较多,使用本申请的技术方案能够在较大程度上降低电子设备100的功耗。
可以理解,在本申请实施例中,电子设备100和电子设备200可以包括但不限于,膝上型计算机、台式计算机、平板计算机、手机、可穿戴设备、头戴式显示器、服务器、移动电子邮件设备、便携式游戏机、便携式音乐播放器、阅读器设备、其中嵌入或耦接有一个或多个处理器的电视机、或能够访问网络的其他电子设备。
图4根据本申请的一些实施例,示出了电子设备200的硬件结构框图。一些实施例在图4所示的实施例中,电子设备200可以包括一个或多个处理器201,与处理器201中的至少一个连接的系统控制逻辑202,与系统控制逻辑202连接的系统内存203,与系统控制逻辑202连接的非易失性存储器(Non-Volatile Memory,NVM)204,以及与系统控制逻辑202连接的网络接口206。
在一些实施例中,处理器201可以包括一个或多个单核或多核处理器。在一些实施例中,处理器201可以包括通用处理器和专用处理器(例如,图形处理器,应用处理器,基带处理器等)的任意组合。在电子设备200采用增强型基站(Evolved Node B,eNB)或无线接入网(Radio Access Network,RAN)控制器的实施例中,处理器201可以被配置为执行各种符合的实施例。例如,处理器201可以用于执行如图5所示的推送消息的发送方法。
在一些实施例中,系统控制逻辑202可以包括任意合适的接口控制器,以向处理器201中的至少一个和/或与系统控制逻辑202通信的任意合适的设备或组件提供任意合适的接口。
在一些实施例中,系统控制逻辑202可以包括一个或多个存储器控制器,以提供连接到系统内存203的接口。系统内存203可以用于加载以及存储数据和/或指令。例如,系统内存203可以加载本申请实施例中对推送消息进行类型判断的应用程序指令,也可以加载将推送消息发送至电子设备100的应用程序指令,还可以将加载将推送消息进行缓存的应用程序指令等。在一些实施例中系统200的内存203可以包括任意合适的易失性存储器,例如合适的动态随机存取存储器(Dynamic Random Access Memory,DRAM)。
NVM/存储器204可以包括用于存储数据和/或指令的一个或多个有形的、非暂时性的计算机可读介质。在一些实施例中,NVM/存储器204可以包括闪存等任意合适的非易失性存储器和/或任意合适的非易失性存储设备,例如硬盘驱动器(Hard Disk Drive,HDD),光盘(Compact Disc,CD)驱动器,数字通用光盘(Digital Versatile Disc,DVD)驱动器中的至少一个。在本申请实施例中,NVM/存储器204可以用于存储接收的应用推送消息和缓存延迟发送的推送消息。
NVM/存储器204可以包括安装电子设备200的装置上的一部分存储资源,或者它可以由设备访问,但不一定是设备的一部分。例如,可以经由网络接口206通过网络访问NVM/存储204。
特别地,系统内存203和NVM/存储器204可以分别包括:指令205的暂时副本和永久副本。指令205可以包括:由处理器201中的至少一个执行时导致系统200实施如图7所示的方法的指令。在一些实施例中,指令205、硬件、固件和/或其软件组件可另外地/替代地置于系统控制逻辑202,网络接口206和/或处理器201中。
网络接口206可以包括收发器,用于为电子设备200提供无线电接口,进而通过一个或多个网络与任意其他合适的设备(如前端模块,天线等)进行通信。在一些实施例中,网络接口206可以集成于电子设备200的其他组件。例如,网络接口206可以集成于处理器201的,系统内存203,NVM/存储器204,和具有指令的固件设备(未示出)中的至少一种,当处理器201中的至少一个执行所述指令时,电子设备200实现如方法实施例中示出的方法。在本申请实施例中,网络接口206可以用于接收推送消息,并将接收的推送消息发送至电子设备100,还可以接收电子设备100发送的心跳包,并将心跳回复包返回给电子设备100。
网络接口206可以进一步包括任意合适的硬件和/或固件,以提供多输入多输出无线电接口。例如,网络接口206可以是网络适配器,无线网络适配器,电话调制解调器和/或无线调制解调器。
在一些实施例中,处理器201中的至少一个可以与用于系统控制逻辑202的一个或多个控制器的逻辑封装在一起,以形成系统封装(System In a Package,SiP)。在一些实施例中,处理器201中的至少一个可以与用于系统控制逻辑202的一个或多个控制器的逻辑集成在同一管芯上,以形成片上系统(System on Chip,SoC)。
电子设备200可以进一步包括:输入/输出(I/O)设备207。I/O设备207可以包括用户界面,使得用户能够与电子设备200进行交互;外围组件接口的设计使得外围组件也能够与电子设备200交互。
下面将参考图5至图7,以电子设备100为手机,电子设备200为服务器为例,说明本申请的技术方案。
如前所述,在本申请的一些实施例中,服务器200接收到应用的推送消息,应用可以是来自外部的应用,也可以是服务器200上运行的应用,并根据推送的消息类型判断推送消息是第一类型消息还是第二类型消息。在判断出推送消息是第一类型消息的情况下,可以将推送消息进行缓存,在接收到手机100发送的心跳包后,将缓存的第一类型的推送消息发送至手机100。在判断出推送消息是第二类型消息的情况下,服务器200直接将推送消息发送至手机100。
图5根据本申请的一些实施例,示出了一种通过服务器200将推送消息进行缓存,在接收到手机100发送的心跳包后再将缓存的推送消息推送至手机100的技术方案。以下以第一类型消息为非紧急消息,第二类型消息为紧急消息为例说明具体技术方案。具体的,如图5所示:
步骤S501,手机100向服务器200发送心跳包,心跳包中包含手机100的端侧状态。手机100发送心跳包的时间可以是在用户使用手机100时,也可以是用户未使用手机100时。通常为了降低功耗,用户未使用手机100时,手机100通常处于睡眠状态。例如,从用户停止使用手机100后经过一段时间如30秒,手机100会自动关闭屏幕、停止不必要应用的运行等从而进入睡眠状态。
在本申请的一些实施例中,手机100定期向服务器200发送心跳包,发送心跳包的时间间隔预先进行设定,例如在出厂时设定或用户根据需要进行设定。设定的时间间隔例如可以为3分钟、5分钟或10分钟等,一般设定为5分钟。手机100在发送心跳包的时间到来时如果处于睡眠状态,则首先进行主动唤醒,使手机100的处理器进入工作状态,再发送心跳包。
本申请的一些实施例中,手机100的端侧状态可以包括但不限于系统状态和应用状态。手机100的系统状态是指当前与手机系统相关的一些信息,可以包括但不限于:灭屏时间、系统模式等。灭屏时间是指手机100的屏幕自动关闭后持续的时间。系统模式是指手机100当前所处的模式,系统模式可以对应手机100的一些系统参数,例如手机100的电量、手机100的当前时间等。系统模式可以根据系统参数自动进入,例如在手机100的电量少于电量阈值时自动进入低电量模式,也可以根据用户的设定进入,例如用户在开会时将手机100设定为静音模式等。系统模式可包括但不限于:低电量模式、省电模式、夜间模式、默认模式或静音模式等。
手机100的应用状态是指手机100中安装应用的相关使用信息,可以包括但不限于:应用使用情况、应用使用设置和应用级别等。应用使用情况用于描述用户使用应用的频繁程度,可以使用不同级别来描述,例如:经常使用、一般使用、很少使用等,也可以使用数字来描述,例如:超过1天未使用、超过3天未使用、超过7天未使用等。应用使用设置用于描述使用应用时的相关设置,例如:应用A被用户设置为不允许活动,应用B被用户设置为通知静音等。应用级别用于描述用户对应的优先级,例如:应用A对应高优先级,应用B对应低优先级,应用C对应中优先级等。
心跳包是手机100向服务器200发送的网络数据包,用于告知服务器200手机100当前正处于在线状态。在本申请的一些实施例中,心跳包是使用传输控制协议(Transmission Control Protocol,TCP)的网络数据包,TCP是可靠的网络传输协议,能够保证手机100发送的心跳包到达服务器200。
可以理解,手机100的端侧状态数据可以作为心跳包的一部分与心跳包一起发送,在手机100的端侧状态数据较大,超过了心跳包的承载容量后,也可以将手机100的端侧状态数据和心跳包分开进行发送,本申请实施例对手机100的端侧状态的具体发送方式不做限定。
步骤S502,服务器200接收到手机100发送的端侧状态并进行存储。服务器200将手机100发送的端侧状态保存在服务器200的数据库中,从而可以根据手机100对应的端侧状态确定是否将要发送给手机100的消息进行延迟发送,从而减少手机100的额外唤醒次数,进而降低手机100的功耗。
步骤S503,服务器200向手机100发送心跳回复包。服务器200在接收到手机100发送的心跳包之后,向手机100返回心跳回复包,告知手机100服务器200当前也处于在线状态,可以正常进行双方的交互。
在本申请的一些实施例中,心跳回复包是同样使用传输控制协议的网络数据包,从而保证服务器200返回的心跳包回复包能够可靠到达手机100。
步骤S504,服务器200接收来自应用的推送消息。本申请的一些实施例中,手机100上安装的应用可以是由来自第三方的应用,第三方负责开发和运营可以在手机100上运行 的第三方应用。手机100上安装的应用是应用的客户端版本,应用的服务器端版本运行在云端,应用的服务器端版本产生要推送的消息,并将产生的推送消息向应用的客户端版本推送。在一些实施例中,应用的服务器端版本不会直接将产生的推送消息推送到手机100上应用的客户端版本,而是将推送消息推送到服务器200,再由服务器200向手机100进行发送,从而使得应用的服务器端版本只需要较少的计算资源即可实现应用消息的推送。
手机100上安装的应用可以是多种类型应用,例如新闻类应用,用户通过新闻类应用来阅读每天的新闻;视频类应用,用户使用视频类应用来观看视频;社交类应用,用户通过社交类应用来进行社交通讯。不同类型的应用产生的推送消息都可以先推送到服务器200,再由服务器200发送到手机100。
服务器200接收的推送消息来自不同类型的第三方应用,第三方应用的推送消息的类型也各不相同,例如推送消息的类型可以包括内容推荐、即时消息、财经动态、订阅消息、物流信息等多种。
步骤S505,服务器200根据推送消息的类型,判断推送消息是否是紧急消息。如果确定推送消息是紧急消息,则执行步骤S506;如果推送消息是非紧急消息,则执行步骤S507。
服务器200接收的应用推送消息中包含消息的类型,服务器200通过解析第三方推送消息即可得知推送消息的类型。
在本申请的一些实施例中,服务器200可以根据对不同类型推送消息的预先设定,将接收的不同类型的推送消息判断为紧急消息或非紧急消息。例如,在一些实施例中,可以将与用户的生活紧密相关的推送消息类型设定为紧急消息,与用户的生活相关度不大的推送消息类型设定为非紧急消息。例如,以人工方式设定类型为A的推送消息对应为紧急消息,类型为B的推送消息对应为非紧急消息等,将人工设定的对应信息保存在服务器200上,服务器200在接收到推送消息后,根据推送消息的类型在人工设定的对应信息中查询即可判断出该推送消息是紧急消息还是非紧急消息。
在本申请的一些实施例中,服务器200还可以根据不同类型推送消息的时效性要求,将推送消息判断为紧急消息或非紧急消息。不同类型推送消息的时效性要求是不同的,例如内容推荐类型的推送消息的时效性要求较低,而即时消息类型和财经动态类型的推送消息的时效性要求就较高。因此可以将时效性要求高的推送消息类型判断为紧急消息,将时效性要求低的推送消息类型判断为非紧急消息,从而实现时效性要求高的消息的及时推送。
步骤S506,服务器200在推送消息是紧急消息的情况下,将推送消息直接进行发送。紧急消息通常是对用户比较重要的推送消息,需要及时发送至手机100向用户展示,因此服务器200对紧急消息不进行延迟发送,在判断出收到的推送消息为紧急消息的情况下,实时对推送消息进行发送。
步骤S507,服务器200根据存储的手机100的端侧状态,判断推送消息是否是紧急消息。推送消息中通过消息类型判断为紧急消息的部分推送消息已经由服务器200进行实时发送,此步骤中服务器200根据手机100的端侧状态在剩余的推送消息中进行判断,确定出可能为紧急消息的推送消息,如果在剩余的推送消息中存在紧急消息,则服务器200将其中的紧急消息进行实时发送。
本申请的一些实施例中,服务器200根据预设的紧急消息判定规则来判断推送消息是否是紧急消息。紧急消息判定规则根据系统状态和应用状态设定,满足紧急消息判定规则 的推送消息是紧急消息。例如,紧急消息判断规则为“灭屏时间小于5分钟,并且系统模式为默认模式”,则服务器200在预先接收的手机100的系统状态为“灭屏时间:3分钟,系统模式:默认模式”的情况下,将接收的推送消息确定为紧急消息。
又例如,服务器200接收的推送消息A的消息类型为内容推荐,对应的应用为应用A,内容推荐类型的推送消息在步骤S505中确定为非紧急消息,在步骤S507中,服务器200根据紧急消息判定规则继续对推送消息A进行紧急消息判定。服务器200获取的手机100上的应用状态例如为“应用名称:应用A,应用使用情况:经常使用”,说明手机100的用户使用应用A的频率很高,对应用A所推送消息的关注度较高,应用A对应的推送消息为紧急消息,因此可设定紧急消息判定规则为“应用使用情况为经常使用”,则服务器200在上述情况下将该推送消息A确定为紧急消息,并对推送消息A进行实时推送,以适应手机100的用户对应用A的关注度需求。
此外,服务器200根据手机100的端侧状态在剩余推送消息中确定了新的紧急消息后,最终剩余的推送消息作为非紧急消息进行发送。
步骤S508,服务器200在满足聚合条件的情况下将确定为非紧急消息的推送消息进行缓存。确定为非紧急消息的推送消息通常对于手机100的用户来说是不太重要的消息,因此服务器200在满足聚合条件的情况下可以将多条非紧急消息进行缓存,缓存的方式包括但不限于如下方式:使用文件进行缓存、使用数据库进行缓存、在内存中缓存等。缓存的一条或多条非紧急消息组成了手机100对应的聚合推送消息。
本申请的一些实施例中,如果不满足聚合条件,则服务器200也可以将作为非紧急消息的推送消息直接进行推送,例如一种不满足聚合条件的情况是用户正在使用手机100,此时由于手机100处于唤醒状态,推送非紧急消息不会产生额外的唤醒功耗。
在本申请的一些实施例中,聚合条件根据发送至服务器200的手机100的端侧状态确定。例如,聚合条件可以根据手机100的系统状态确定,也可以根据手机100的应用状态确定。
根据手机100的系统状态确定的多个聚合条件如下表1所示:
灭屏时间 | 系统模式 | |
聚合条件1 | >5分钟 | 低电量模式 |
聚合条件2 | >5分钟 | 省电模式 |
聚合条件3 | >5分钟 | 夜间模式 |
聚合条件4 | >30分钟或10分钟 | 默认模式 |
聚合条件5 | >5分钟 | 静音模式 |
表1
其中,聚合条件1表示在手机100的系统模式为低电量模式,且灭屏时间大于5分钟的情况下,将作为非紧急消息的推送消息进行缓存。聚合条件4表示在手机100的系统模式为默认模式,灭屏时间大于30分钟或大于10分钟的情况下,将作为非紧急消息的推送消息进行缓存。其它类推。
另外,根据手机100的应用状态确定的多个聚合条件如下表2所示:
应用使用情况 | 应用使用设置 | 应用级别 | |
应用聚合1 | 很少使用 |
应用聚合2 | 不允许活动 | ||
应用聚合3 | 低优先级 | ||
应用聚合4 | 通知静音 |
表2
其中,应用聚合条件1表示在应用使用情况为很少使用时,将相应应用的推送消息进行缓存。应用聚合条件2表示在应用使用设置为不允许活动的情况下,将相应应用的推送消息进行缓存。应用聚合条件3表示在应用级别为低优先级应用的情况下,将相应应用的推送消息进行缓存。应用聚合条件4表示在应用使用设置为通知静音的情况下,将相应应用的推送消息进行缓存。
可以理解,上述聚合条件只是根据手机100的端侧状态做出的示例,并不构成对本申请实施例中聚合条件的限制,聚合条件可以根据手机100的端侧状态中不同的状态参数进行组合,本申请实施例对聚合条件的组成不进行具体限制。
步骤S509,手机100向服务器200发送心跳包。手机100心跳包中可以包含手机100的端侧状态,也可以不包括端侧状态。如果发送的心跳包中包含端侧状态,服务器200可以用当前接收的手机100的端侧状态替换以前的手机100的端侧状态。
步骤S510,服务器200获取缓存的聚合推送消息。由于服务器200已经接收到手机100发送的心跳包,因此服务器200已经知道手机100已经主动唤醒,此时向手机100发送聚合推送消息不会导致手机100额外唤醒。
在本申请的一些实施例中,服务器200从缓存的聚合推送消息的数据库中获取手机100对应的聚合推送消息。通过使用数据库缓存手机100对应的聚合推送消息,可以方便进行手机100对应的聚合推送消息的查询和获取。
步骤S511,服务器200判断是否将手机100对应的聚合推送消息合并到心跳回复包中推送,如果是,执行步骤S512;否则执行步骤S513。
在本申请的一些实施例中,服务器200将聚合推送消息和心跳回复包发送至手机100可以采用两种方式:将聚合推送消息整合到心跳回复包中发送的合并方式和将聚合推送消息和心跳回复包分别进行发送的分开方式。服务器200可以根据预先设定的发送方式确定以哪种方式进行发送,也可以根据聚合推送消息的数据量大小来确定发送的方式。
步骤S512,在确定使用合并方式的情况下,服务器200将聚合推送消息合并到心跳回复包中进行发送。
在本申请的一些实施例中,服务器200可以在聚合推送消息的数据量小于心跳回复包可承载的数据量时将聚合推送消息作为心跳回复包的承载数据进行发送,减少发送的数据包的数量。
图6示出了一种将聚合推送消息合并到心跳回复包中推送的场景。如图6所示,手机100将端侧状态与心跳包一起发送到服务器200,服务器200接收到来自新闻类应用的推送消息2和来自金融类应用的推送消息3,服务器200判断出推送消息2和推送消息3为非紧急消息,则将推送消息2和推送消息3缓存为聚合推送消息,在手机100第二次向服务器200发送心跳包后,服务器200获取手机100对应的缓存的聚合推送消息,将聚合推送消息即推送消息2和推送消息3作为心跳回复包的承载数据,与心跳回复包组合成为聚合数据包,服务器200将聚合数据包发送至手机100,由手机100接收并展现推送消息2 和推送消息3。
步骤S513,在确定使用分开方式的情况下,服务器200将聚合推送消息和心跳回复包分别进行推送。
在本申请的一些实施例中,服务器200可以在聚合推送消息的数据量大于心跳回复包可承载的数据量时将聚合推送消息与心跳回复包分别进行发送,从而可以发送较多的推送消息。
图7示出了一种将聚合推送消息与心跳回复包分别进行推送的场景。如图7所示,手机100将端侧状态与心跳包一起发送到服务器200,服务器200接收到来自新闻类应用的推送消息2和来自金融类应用的推送消息3,服务器200判断出推送消息2和推送消息3为非紧急消息,则将推送消息2和推送消息3缓存为聚合推送消息,在手机100第二次向服务器200发送心跳包后,服务器200获取手机100对应的缓存的聚合推送消息,并将聚合推送消息即推送消息2、推送消息3和心跳回复包分别发送至手机100,由手机100接收并分别展现推送消息2和推送消息3。
步骤S514,手机100在接收到聚合推送消息后,将推送消息发给相应应用并展示。聚合推送消息可能包括多个应用的服务器端的推送消息,手机100从聚合推送消息中解析出多条推送消息并发给对应应用的客户端并进行展现。
另外,对应上述推送消息的发送方法,图8示出了一种电子设备800的结构示意图,可以理解,上述推送消息的发送方法中的具体技术细节,在电子设备800中也适用,为了避免重复,不再赘述。
如图8所示,该电子设备包括:
确定模块801,第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包;
发送模块802,所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,发送所述推送消息。
图9根据本申请实施例,示出了手机100的一种结构示意图。如图9所示,手机100可以包括处理器910、电源模块940、存储器980,移动通信模块930、无线通信模块920、传感器模块990、音频模块950、摄像头970、接口模块960、按键901以及显示屏902等。
可以理解的是,本发明实施例示意的结构并不构成对手机100的具体限定。在本申请另一些实施例中,手机100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。
手机100用于向服务器200发送包含端侧状态的心跳包并接收服务器200返回的心跳回复包和聚合的推送消息,并对聚合的推送消息进行展现。
处理器910可以包括一个或多个处理单元,例如,可以包括中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)、数字信号处理器(Digital Signal Processing,DSP)、微处理器(Micro-programmed Control Unit,MCU)、人工智能(Artificial Intelligence,AI)处理器或可编程逻辑器件(Field Programmable Gate Array,FPGA)等的处理模块或处理电路。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。处理器910中可以设置存储单元,用于存储指令和数 据。在一些实施例中,处理器910中的存储单元为高速缓冲存储器980。
电源模块940可以包括电源、电源管理部件等。电源可以为电池。电源管理部件用于管理电源的充电和电源向其他模块的供电。
移动通信模块930可以包括但不限于天线、功率放大器、滤波器、低噪声放大器(Low noise amplify,LNA)等。移动通信模块930可以提供应用在手机100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块930可以由天线接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块930还可以对经调制解调处理器调制后的信号放大,经天线转为电磁波辐射出去。在一些实施例中,移动通信模块930的至少部分功能模块可以被设置于处理器910中。在一些实施例中,移动通信模块930至少部分功能模块可以与处理器910的至少部分模块被设置在同一个器件中。
无线通信模块920可以包括天线,并经由天线实现对电磁波的收发。无线通信模块920可以提供应用在手机100上的包括无线局域网(wireless local area networks,WLAN),无线保真(wireless fidelity,Wi-Fi)网络,蓝牙(bluetooth,BT),全球导航卫星系统(global navigation satellite system,GNSS),调频(frequency modulation,FM),近距离无线通信技术(near field communication,NFC),红外技术(infrared,IR)等无线通信的解决方案。手机100可以通过无线通信技术与网络以及其他设备进行通信。另外,无线通信模块用于接收并检查带标记的网络数据包,并对来自网络时延要求高应用的属于同一数据段的网络数据包进行聚合,再将聚合的网络数据包作为同一批发送数据包进行发送。
在一些实施例中,手机100的移动通信模块930和无线通信模块920也可以位于同一模块中。
显示屏902用于显示人机交互界面、图像、视频等。显示屏902包括显示面板。
传感器模块990可以包括接近光传感器、压力传感器,陀螺仪传感器,气压传感器,磁传感器,加速度传感器,距离传感器,指纹传感器,温度传感器,触摸传感器,环境光传感器,骨传导传感器等。
音频模块950用于将数字音频信息转换成模拟音频信号输出,或者将模拟音频输入转换为数字音频信号。音频模块950还可以用于对音频信号编码和解码。在一些实施例中,音频模块950可以包括扬声器、听筒、麦克风以及耳机接口。
摄像头970用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件把光信号转换成电信号,之后将电信号传递给图像信号处理(Image Signal Processing,ISP)转换成数字图像信号。
接口模块960包括外部存储器接口、通用串行总线(universal serial bus,USB)接口及用户标识模块(subscriber identification module,SIM)卡接口等。其中外部存储器接口可以用于连接外部存储卡,例如Micro SD卡,实现扩展手机100的存储能力。外部存储卡通过外部存储器接口与处理器910通信,实现数据存储功能。通用串行总线接口用于手机100和其他电子设备进行通信。用户标识模块卡接口用于与安装至手机100的SIM卡进行通信。
在一些实施例中,手机100还包括按键901、马达以及指示器等。其中,按键901可以包括音量键、开/关机键等。马达用于使手机100产生振动效果,例如在用户的手机100 被呼叫的时候产生振动,以提示用户接听手机100来电。指示器可以包括激光指示器、射频指示器、LED指示器等。
现参考图10,是本申请实施例中的一种手机100的软件结构框图。该手机可以用于向服务器发送包含端侧状态的心跳包并接收服务器返回的心跳回复包和聚合的推送消息,并对聚合的推送消息进行展现。
图10为该手机100的软件系统可以采用分层架构,事件驱动架构,微核架构,微服务架构,或云架构。本发明实施例以分层架构的Android系统为例,示例性说明手机100的软件结构。
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将Android系统分为四层,从上至下分别为应用程序层,应用程序框架层,安卓运行时(Android runtime)和系统库,以及内核层。
应用程序层可以包括一系列应用程序包。
如图10所示,应用程序包可以包括电话、相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序。
应用程序框架层为应用程序层的应用程序提供应用编程接口(application programming interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。
如图10所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。
电话管理器用于提供终端设备的通信功能。例如通话状态的管理(包括接通,挂断等)。
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话窗口形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,终端设备振动,指示灯闪烁等。
Android Runtime包括核心库和虚拟机。Android runtime负责安卓系统的调度和管理。
核心库包含两部分:一部分是java语言需要调用的功能函数,另一部分是安卓的核心库。
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的java文件执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线 程管理,安全和异常的管理,以及垃圾回收等功能。
系统库可以包括多个功能模块。例如:表面管理器(surface manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),2D图形引擎(例如:SGL)等。
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了2D和3D图层的融合。
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。
三维图形处理库用于实现三维图形绘图,图像渲染,合成和图层处理等。
2D图形引擎是2D绘图的绘图引擎。
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动。
虽然通过参照本申请的某些优选实施例,已经对本申请进行了图示和描述,但本领域的普通技术人员应该明白,可以在形式上和细节上对其作各种改变,而不偏离本申请的精神和范围。
Claims (12)
- 一种推送消息的发送方法,其特征在于,包括:第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包;所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,发送所述推送消息。
- 根据权利要求1所述的方法,其特征在于,该方法还包括:所述第一电子设备在判断出向第二电子设备发送的推送消息的类型为第二类型的情况下,向所述第二电子设备发送所述推送消息。
- 根据权利要求1或2所述的方法,其特征在于,该方法还包括:在所述第一心跳包之前发送的第三心跳包包含所述第二电子设备的端侧状态,并且所述第一电子设备根据所述端侧状态判断出第二电子设备发送的推送消息的类型为第二类型的情况下,向所述第二电子设备发送所述推送消息,其中,所述端侧状态包括如下信息中的至少一种:系统状态;应用状态。
- 根据权利要求3所述的方法,其特征在于,所述系统状态包括如下至少一种:灭屏时间和系统模式,所述应用状态包括如下至少一种:应用使用情况、应用使用设置和应用级别。
- 根据权利要求1所述的方法,其特征在于,所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,发送所述推送消息,包括:所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,向所述第二电子设备返回第二心跳包并同时发送所述推送消息。
- 根据权利要求5所述的方法,其特征在于,所述第一电子设备向所述第二电子设备返回第二心跳包并同时发送所述推送消息,包括:所述第一电子设备将所述推送消息合并到第二心跳包中并将所述第二心跳包发送至所述第二电子设备。
- 根据权利要求5所述的方法,其特征在于,所述第一电子设备向所述第二电子设备返回第二心跳包并同时发送所述推送消息,包括:所述第一电子设备将所述推送消息和所述第二心跳包分别发送至所述第二电子设备。
- 根据权利要求1所述的方法,其特征在于,所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,发送所述推送消息,包括:所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,在预定时间 内向所述第二电子设备发送所述推送消息。
- 根据权利要求8所述的方法,其特征在于,该方法还包括:在所述预定时间内所述第二电子设备的处理器不处于休眠状态。
- 一种电子设备,其特征在于,包括:确定模块,用于在第一电子设备在判断出向第二电子设备发送的推送消息的类型为第一类型的情况下,确定是否接收到第二电子设备发送的第一心跳包;发送模块,用于所述第一电子设备在接收到所述第二电子设备发送的第一心跳包后,发送所述推送消息。
- 一种可读介质,其特征在于,所述可读介质上存储有指令,该指令在电子设备上执行时使电子设备执行权利要求1至9中任一项所述的方法。
- 一种电子设备,包括:存储器,用于存储由系统的一个或多个处理器执行的指令,以及处理器,是系统的处理器之一,用于执行权利要求1至9中任一项所述的方法。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110220947.3A CN115051968A (zh) | 2021-02-26 | 2021-02-26 | 推送消息的发送方法、电子设备及可读介质 |
CN202110220947.3 | 2021-02-26 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2022179283A1 true WO2022179283A1 (zh) | 2022-09-01 |
Family
ID=83048680
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2021/141151 WO2022179283A1 (zh) | 2021-02-26 | 2021-12-24 | 推送消息的发送方法、电子设备及可读介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN115051968A (zh) |
WO (1) | WO2022179283A1 (zh) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104703146A (zh) * | 2013-12-09 | 2015-06-10 | 腾讯科技(深圳)有限公司 | 信息推送方法、客户端及系统 |
CN105471964A (zh) * | 2015-11-16 | 2016-04-06 | 中国建设银行股份有限公司 | 用于数据推送的方法、服务器、客户端以及系统 |
CN109451025A (zh) * | 2018-11-14 | 2019-03-08 | 深圳市云歌人工智能技术有限公司 | 消息推送方法、装置及存储介质 |
US20190140888A1 (en) * | 2017-11-08 | 2019-05-09 | Line Corporation | Computer readable media, methods, and computer apparatuses for network service continuity management |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103259825A (zh) * | 2012-02-21 | 2013-08-21 | 腾讯科技(深圳)有限公司 | 消息推送方法和装置 |
CN112468372B (zh) * | 2017-04-10 | 2023-10-13 | 华为技术有限公司 | 电力线通信网络中设备状态检测方法和装置 |
CN108055189A (zh) * | 2017-10-30 | 2018-05-18 | 努比亚技术有限公司 | 一种消息处理方法、终端以及计算机可读存储介质 |
-
2021
- 2021-02-26 CN CN202110220947.3A patent/CN115051968A/zh active Pending
- 2021-12-24 WO PCT/CN2021/141151 patent/WO2022179283A1/zh active Application Filing
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104703146A (zh) * | 2013-12-09 | 2015-06-10 | 腾讯科技(深圳)有限公司 | 信息推送方法、客户端及系统 |
CN105471964A (zh) * | 2015-11-16 | 2016-04-06 | 中国建设银行股份有限公司 | 用于数据推送的方法、服务器、客户端以及系统 |
US20190140888A1 (en) * | 2017-11-08 | 2019-05-09 | Line Corporation | Computer readable media, methods, and computer apparatuses for network service continuity management |
CN109451025A (zh) * | 2018-11-14 | 2019-03-08 | 深圳市云歌人工智能技术有限公司 | 消息推送方法、装置及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN115051968A (zh) | 2022-09-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108512695B (zh) | 监控应用卡顿的方法及装置 | |
US20240020074A1 (en) | Multi-Window Projection Method and Electronic Device | |
US10631361B2 (en) | Method and apparatus for providing user with information received by electronic device | |
EP4145286A1 (en) | Memory management method and electronic device | |
US20190369700A1 (en) | Electronic Device Control Method and Apparatus, and Electronic Device | |
CN112527476B (zh) | 资源调度方法及电子设备 | |
KR20150066083A (ko) | 전자 장치의 멀티 태스킹 방법 및 그 전자 장치 | |
US20220353819A1 (en) | Method for Reducing Power Consumption of Mobile Terminal and Mobile Terminal | |
WO2020006711A1 (zh) | 一种消息的播放方法及终端 | |
US10432926B2 (en) | Method for transmitting contents and electronic device thereof | |
WO2022083465A1 (zh) | 电子设备的投屏方法及其介质和电子设备 | |
EP4206864A1 (en) | Process scheduling method and terminal device | |
CN110543333B (zh) | 针对处理器的休眠处理方法、装置、移动终端和存储介质 | |
WO2019128586A1 (zh) | 应用程序处理方法、电子设备、计算机可读存储介质 | |
CN111435318A (zh) | 应用程序的dex优化方法及终端 | |
WO2021042881A1 (zh) | 消息通知方法及电子设备 | |
CN109511139B (zh) | Wifi控制方法、装置、移动设备、计算机可读存储介质 | |
WO2022179283A1 (zh) | 推送消息的发送方法、电子设备及可读介质 | |
CN114339591A (zh) | 基于超宽带芯片进行定位的方法和相关装置 | |
CN113641431A (zh) | 二维码的增强显示的方法和终端设备 | |
WO2024032430A1 (zh) | 管理内存的方法和电子设备 | |
CN116708647B (zh) | 通知消息回复方法及电子设备 | |
WO2024093431A1 (zh) | 一种图像绘制方法及电子设备 | |
WO2023185152A1 (zh) | 来电处理方法、装置、设备及存储介质 | |
EP4415415A1 (en) | Method for reducing power consumption, and electronic device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21927707 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 21927707 Country of ref document: EP Kind code of ref document: A1 |