METHOD FOR PROCESSING PUSH MESSAGES AND ELECTRONIC DEVICE
Patent Information
- Application Number
- RU2026125614
- Authority / Receiving Office
- RU · RU
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-26
- Filing Date
- 2024-09-04
- Publication Date
- 2026-09-07
AI Technical Summary
When an electronic device receives a large number of push messages, the main processor is frequently waked up, resulting in increased power consumption, affecting the standby time.
The main processor and the coprocessor share the push message processing task, and the coprocessor prioritizes the processing of some or all push messages, reducing the number of wake-up times of the main processor.
Reduces power consumption of electronic devices and extends standby time.
Abstract
Description
Push message processing method and electronic device
[0001] This invention claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on January 26, 2024, with application number 202410121859.1 and application name “Push Message Processing Method and Electronic Device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of data processing technology, and in particular to a push message processing method and electronic device. Background Art
[0003] Push services are services that notify users of specific content. For example, cloud push services involve cloud servers sending push messages to applications on electronic devices. For example, these services can send instant messages (IMs) to instant messaging applications or shopping ads to shopping apps.
[0004] As push services continue to develop in electronic devices, more and more applications provide push services, so electronic devices receive more and more push messages, resulting in increasing power consumption of electronic devices by push services, affecting the standby time of electronic devices.
[0005] Summary of the Invention
[0006] The embodiments of the present application provide a push message processing method and an electronic device, which can reduce the power consumption of the push service on the electronic device and extend the standby time of the electronic device.
[0007] In a first aspect, the present application provides a push message processing method, which is applied to an electronic device, the electronic device including a main processor and a coprocessor; the method comprising: the coprocessor receiving a push message; the coprocessor processing the push message, or the coprocessor sending the push message to the main processor for the main processor to process the push message. The method comprises the coprocessor receiving the push message, and the coprocessor or the main processor processing the push message, thereby eliminating the need to wake up the main processor every time a push message is received, reducing the number of times the main processor is woken up, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0008] In some embodiments, the method may further include: the coprocessor determines the target processor from the main processor and the coprocessor based on the push message. The target processor may be only the main processor, or only the coprocessor, or the main processor and the coprocessor. In some embodiments, there may be multiple coprocessors. When there are multiple coprocessors, the coprocessor that receives the push message and the coprocessor that processes the push message may be the same or different. For example, when the coprocessor includes a first coprocessor and a second coprocessor, the first coprocessor may receive the push message, send the push message to the second coprocessor, and the second coprocessor may process the push message. In some embodiments, when determining the target processor, the priority of the coprocessor may be higher than that of the main processor. In other words, when both the coprocessor and the main processor are capable of processing the push message, the target processor is determined to be the coprocessor, thereby eliminating the need to wake up the main processor and reducing the power consumption of the electronic device.
[0009] In some embodiments, the push message may include a first identifier, and the coprocessor may determine a target processor from the main processor and the coprocessor based on the push message, including: the coprocessor determining the target processor based on the first identifier. By setting the first identifier in the push message, the coprocessor can quickly and accurately determine the target processor, thereby improving the processing efficiency of the coprocessor.
[0010] Optionally, the first identifier may be used to indicate capabilities related to the push message. The capabilities may be hardware capabilities or software capabilities. The coprocessor may determine the target processor based on the capabilities supported by the coprocessor and the main processor. Specifically, the coprocessor may determine capabilities related to the push message based on the first identifier; and determine the target processor based on the capabilities related to the push message.
[0011] Alternatively, the first identifier may be used to indicate a target processor, for example, may be an identifier of the target processor, and the coprocessor may directly determine the target processor according to the first identifier.
[0012] In some embodiments, the coprocessor determines a target processor from the main processor and the coprocessor based on the push message, including: the coprocessor parses the push message and determines capabilities related to the push message; and determines the target processor based on the capabilities related to the push message.
[0013] Optionally, the capabilities related to the push message may be hardware capabilities. The coprocessor parsing the push message and determining the capabilities related to the push message may include: the coprocessor parsing the push message and determining the hardware related to the push message. Accordingly, the coprocessor may specifically determine the target processor based on the hardware related to the push message.
[0014] In some embodiments, determining the target processor based on hardware related to the push message may include: determining the target processor based on whether the hardware connected to the target processor includes hardware related to the push message. In this embodiment, the determination of the target processor is associated with the hardware connected to the processor, thereby ensuring that the target processor can process the push message and preventing the problem of the determined target processor being unable to process the push message. Optionally, when the hardware connected to the coprocessor and the main processor both include hardware related to the push message, the coprocessor can be preferentially determined as the target processor, thereby reducing the number of times the main processor is awakened, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0015] In some embodiments, the coprocessor parsing the push message and determining the capabilities associated with the push message may include: the coprocessor determining the capabilities associated with the push message based on keywords included in the push message. This process enables the coprocessor to more accurately obtain the capabilities associated with the push message and further determine an appropriate target processor to process the push message.
[0016] In some embodiments, a mapping relationship between capabilities and processors can be stored on the coprocessor. Accordingly, the coprocessor can search for keywords in the push message and determine the capabilities corresponding to the keywords based on the mapping relationship as the capabilities associated with the push message. By storing the above mapping relationship on the coprocessor, the coprocessor can more quickly determine the capabilities associated with the push message based on the keywords.
[0017] In some embodiments, the main processor may be an AP, and / or the coprocessor may be an MCU. Since an MCU consumes less power than an AP, processing push messages by an MCU consumes less power than processing push messages by an AP, thereby reducing power consumption of the electronic device and extending the standby time of the electronic device.
[0018] In a second aspect, an embodiment of the present application provides a push message processing method, which is applied to an electronic device, wherein the electronic device includes a main processor and a coprocessor; the method includes: receiving a push message; sending the push message to the coprocessor for the coprocessor to process the push message; or sending the push message to the main processor for the main processor to process the push message. In this method, after receiving the push message, the push message is preferentially sent to the coprocessor or the main processor for processing, thereby eliminating the need to wake up the main processor every time a push message is received, reducing the number of times the main processor is woken up, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0019] In some embodiments, the method may further include: determining a target processor from the main processor and the coprocessor according to the push message.
[0020] In some embodiments, the push message may include a first identifier, and determining a target processor from the main processor and the coprocessor based on the push message may include: determining the target processor based on the first identifier. By setting the first identifier in the push message, the coprocessor can quickly and accurately determine the target processor, thereby improving the processing efficiency of the coprocessor.
[0021] Optionally, the above-mentioned first identifier can be used to indicate the capabilities related to the push message. The above-mentioned capabilities can be hardware capabilities or software running capabilities. Determining the target processor based on the first identifier can include: determining the capabilities related to the push message based on the first identifier; determining the target processor based on the capabilities related to the push.
[0022] Alternatively, the first identifier may be used to indicate a target processor, for example, may be an identifier of a target processor, and the target processor may be directly determined according to the first identifier.
[0023] In some embodiments, if the first identifier is used to indicate hardware related to the push message, determining the capability related to the push message based on the first identifier may include: determining the hardware related to the push message based on the first identifier.
[0024] In some embodiments, determining the target processor based on capabilities related to push messages may include: determining the target processor based on whether hardware connected to the target processor includes hardware related to push messages.
[0025] In some embodiments, the main processor may be an AP, and / or the coprocessor may be an MCU. Since an MCU consumes less power than an AP, processing push messages by an MCU consumes less power than processing push messages by an AP, thereby reducing power consumption of the electronic device and extending the standby time of the electronic device.
[0026] In a third aspect, an embodiment of the present application provides an electronic device comprising: a main processor, a coprocessor, and a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the coprocessor, enable the electronic device to execute any one of the methods of the first aspect.
[0027] In a fourth aspect, an embodiment of the present application provides an electronic device, comprising: a main processor, a coprocessor, a routing processor, and a memory; wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the routing processor, enable the electronic device to perform any method of the second aspect.
[0028] In a fifth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer executes the method of any one of the first aspect or the second aspect.
[0029] In a sixth aspect, an embodiment of the present application provides a chip system, comprising a processor coupled to a memory, wherein the processor executes a computer program stored in the memory to implement the method described in either the first or second aspect. The chip system may be a single chip or a chip module composed of multiple chips. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0031] FIG2 is a schematic diagram of the structure of the Hongmeng system provided in an embodiment of the present application;
[0032] FIG3 is a schematic diagram of a push service processing flow according to an embodiment of the present application;
[0033] FIG4 is a flow chart of a push message processing method provided in an embodiment of the present application;
[0034] FIG5 is another flow chart of a push message processing method according to an embodiment of the present application;
[0035] FIG6 is a schematic diagram of a third flow chart of a push message processing method provided in an embodiment of the present application;
[0036] FIG7 is a schematic diagram of a fourth flow chart of a push message processing method provided in an embodiment of the present application;
[0037] FIG8 is a schematic diagram of a fifth flow chart of a push message processing method provided in an embodiment of the present application;
[0038] FIG9 is a sixth flow chart of a push message processing method according to an embodiment of the present application;
[0039] FIG10 is a seventh flow chart of a push message processing method according to an embodiment of the present application;
[0040] FIG11 is a schematic diagram of an eighth flow chart of a push message processing method according to an embodiment of the present application;
[0041] FIG12 is a ninth flow chart of the push message processing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0043] The embodiments of the present application provide a push message processing method and an electronic device, which can reduce the power consumption of the push service on the electronic device and extend the standby time of the electronic device.
[0044] The embodiments of the present application can be applied to electronic devices such as mobile phones, tablet computers (PADs), personal computers (PCs), wearable smart devices such as smart watches, etc.
[0045] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, a display screen 194, and the like.
[0046] Optionally, the electronic device 100 may also include: a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, and a subscriber identification module (SIM) card interface 195, etc.
[0047] It should be understood that the structure illustrated in the embodiments of the present invention does not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0048] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0049] The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of instruction fetching and execution.
[0050] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0051] In some embodiments, the processor 110 may include one or more interfaces. The interfaces 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.
[0052] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0053] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0054] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0055] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0056] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0057] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0058] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0059] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0060] The internal memory 121 can be used to store computer executable program codes, which include instructions. The internal memory 121 may include a program storage area and a data storage area. Among them, 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 electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 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. The processor 110 executes various functional applications and data processing of the electronic device 100 by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.
[0061] Figure 2 shows a block diagram of the software structure of an electronic device provided in an embodiment of the present application. The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. The layers communicate with each other through software interfaces. The embodiment of the present application takes the Hongmeng system as an example to illustrate the software structure of the electronic device of the Hongmeng system. In some embodiments, the Hongmeng system is divided into four layers, namely, the application layer, the application framework layer, the basic service layer, and the kernel layer from top to bottom.
[0062] The application layer may include several applications (hereinafter referred to as applications), such as a camera application, a gallery application, a video application, an instant messaging application, etc. The application layer of the electronic device in the embodiment of the present application includes an application A that supports push services, such as an instant messaging application, a shopping application, a browser application, a video application, a short video application, etc.
[0063] The application framework layer provides application programming interfaces (APIs) and programming frameworks for applications in the application layer, including various components and capabilities to support developers' Hongmeng development. Ability represents atomic basic capabilities in the Hongmeng system, which can correspond to Android (Android) service (Service) or content provider (ContentProvider), The uniform resource identifier (URI) of the service exposed in the package, such as ringtone playback, Bluetooth, Wi-Fi, battery management, etc. Whether it is Android, iOS, or Hongmeng, the application will declare the set of capabilities it uses when packaging, so that the system can initialize the corresponding resources.
[0064] Basic services are a collection of core capabilities of the HarmonyOS, providing services to applications through the framework layer.
[0065] The kernel layer is the layer between hardware and software. The kernel layer may include: display driver, camera driver, audio driver, sensor driver, etc.
[0066] In the following embodiments, the push message processing method of the embodiment of the present application will be described in detail in combination with the structure of the above-mentioned electronic device.
[0067] First, the processing flow of the push service to which the push message processing method according to the embodiment of the present application is applicable is exemplified.
[0068] As shown in Figure 3, the user installs application A in the electronic device, and the electronic device sends the user account of application A to the push server through application A to register for the push service; after the push server completes the registration based on the user account, it assigns a device token to the user and sends the device token to application A of the electronic device; application A of the electronic device sends the user account and device token to the application processing server corresponding to application A, and the application processing server stores the user account and the corresponding device token; when there is data that needs to be pushed to the user, the application processing server sends the data to be pushed and the device token to the push server, and the push server sends the data to be pushed to application A of the electronic device through a push message based on the device token.
[0069] In some embodiments, the application processing server can implement business processing and push message delivery through the business processing server and the push message delivery server, respectively. In this case, when the push message delivery server has a push message to deliver, it can send the user account and the data to be pushed to the business processing server. The business processing server finds the corresponding device token based on the user account and sends the device token and the data to be pushed to the push server. The above-mentioned push message is also called push notification in some related technologies.
[0070] In some embodiments, when a communication chip in an electronic device receives a push message, it sends the push message to a message receiving module in an AP. The message receiving module in the AP then sends the push message to the corresponding application for processing. For example, as shown in Figure 4, assuming that the push message belongs to application A, the message receiving module sends the push message to application A in the AP. Application A in the AP then processes the push message, including parsing the push message, obtaining the push content, and drawing the relevant UI.
[0071] In some embodiments, as shown in FIG4 , an AP in an electronic device can serve as a main processor, and a coprocessor can be provided in addition to the main processor. In the embodiment of the present application, taking the coprocessor as a microcontroller unit (MCU) as an example, application A can be provided in each of the AP and the MCU. Application A in the two processors can communicate and collaborate within the application to implement the functions of application A. As shown in FIG4 , the message receiving module in the AP can only communicate with application A provided in the AP, and cannot communicate with application A in the MCU.
[0072] To save power, the AP of an electronic device will enter a dormant state when no tasks are running. For example, when the screen of an electronic device is off and there is no active interrupt source, the AP will automatically enter a dormant state. If the communication chip of the mobile phone receives a push message, it will wake up the AP of the electronic device. The AP of the electronic device will be powered on, and the communication chip will send the push message to the message receiving module in the AP. The message receiving module in the AP and the corresponding application will process the push message. When there are many push messages, the AP of the mobile phone will be woken up frequently, causing the electronic device to consume more power to process push messages. Taking wearable electronic devices such as smart watches as an example, the power consumption of smart watches for processing push messages accounts for more than 40% of the standby power consumption of the entire device.
[0073] In order to solve the power consumption of electronic devices in processing push messages, an embodiment of the present application provides a solution for processing push messages on multiple processors of a mobile phone.
[0074] The electronic device of the embodiment of the present application may include a main processor and at least one coprocessor. Optionally, the main processor may be a processor that can provide relatively more resources and computing power, but relatively high power consumption, such as an AP, and the coprocessor may be a processor that provides relatively fewer resources and computing power, but relatively low power consumption, such as an MCU. For example, in the electronic device shown in Figure 5, the electronic device includes a main processor and one coprocessor, and the main processor is an AP and the coprocessor is an MCU as an example.
[0075] In the push message processing method provided in the embodiment of the present application, when the communication chip in the electronic device receives a push message, the push message is sent to the coprocessor. After the coprocessor receives the push message, the coprocessor processes the push message, or sends the message to the main processor, which processes the push message. Thus, the push message received in the embodiment of the present application is partially processed by the coprocessor and partially processed by the main processor. Compared with the above embodiment that directly wakes up the main processor to process the push message, the number of times the main processor is woken up is reduced, thereby reducing the power consumption of the electronic device in processing the push message and extending the standby time of the electronic device.
[0076] In some embodiments, after receiving a push message, the coprocessor can first determine the target processor for processing the push message from the coprocessor and the main processor. When the target processor is the coprocessor, the coprocessor processes the push message. When the target processor is the main processor, the coprocessor sends the push message to the main processor for processing.
[0077] To improve the rationality and accuracy of the coprocessor's determination of the target processor, in an embodiment of the present application, the coprocessor may determine the target processor based on the matching between the capabilities related to the push message and the capabilities of the processor (main processor or coprocessor).
[0078] In the embodiment of the present application, a certain number of capabilities may be respectively arranged in the main processor and the coprocessor.
[0079] In some embodiments, the capabilities of a processor (main processor or coprocessor) may be hardware mounted on the processor, which, for ease of explanation, is also referred to as hardware capabilities below. Assuming that a piece of hardware is mounted on the processor, the processor has the capabilities corresponding to the hardware, or the processor supports the capabilities corresponding to the hardware. The above-mentioned hardware may be hardware other than the processor on an electronic device, such as the camera, speaker, display, and / or various sensors listed in Figure 1. Taking the AP as an example where a camera is mounted on the AP, the AP has the "camera" capability. Similarly, if a camera is mounted on the MCU, the MCU has the "camera" capability. In some embodiments, the above-mentioned processor-mounted hardware can also be referred to as the processor being connected to the hardware.
[0080] Alternatively, mounting a hardware component on a processor generally means that the processor is connected to the hardware component and has the hardware driver installed, so that the processor can drive the hardware to operate normally. For example, if an AP is mounted with a camera, the AP is connected to the camera and has the camera driver installed to drive the camera to operate normally.
[0081] In other embodiments, the capabilities of a processor may be software execution capabilities related to the hardware mounted on the processor. For ease of explanation, this is also referred to as software execution capabilities below. Assuming a piece of hardware is mounted on a processor, the processor has at least one software execution capability related to that hardware. For example, if an AP is mounted with a camera, the AP may have video capture capabilities related to the camera; if an AP is mounted with a display, the AP may have text display capabilities, badge display capabilities, and so on.
[0082] In the embodiment of the present application, there is no restriction on which hardware the main processor and coprocessor respectively mount and the number of hardware mounted respectively, and they can be set independently in actual applications. In some embodiments, the hardware mounted on each processor can be arranged based on the differences in resources, computing power, etc. corresponding to different processors. For example, capabilities with relatively high requirements for resources and computing power can be mounted on the main processor, and capabilities with relatively low requirements for resources and computing power can be mounted on the coprocessor, or mounted on the main processor and coprocessor at the same time. For example, for a camera, which has relatively high requirements for resources and computing power, it can be mounted on the AP, and for display screens, speakers, various sensors, etc., which have relatively low requirements for resources and computing power, they can be mounted only on the MCU, or mounted on the AP and MCU at the same time. Through the layout of the above-mentioned processor-mounted hardware, the resources and computing power of the main processor and coprocessor can be better utilized, thereby improving the processing efficiency of electronic devices for push messages.
[0083] In the embodiments of the present application, the set of capabilities possessed by the main processor is referred to as capability set 1, and the set of capabilities possessed by the coprocessor is referred to as capability set 2. Optionally, capability set 1 and capability set 2 may or may not intersect. In some embodiments, capability set 2 is a subset of capability set 1.
[0084] In one embodiment of the push message processing method provided in the present application, the main processor and the coprocessor do not cooperate to process the push message. Specifically: if the coprocessor has all the capabilities declared to be used by the push message, then regardless of whether the main processor has all the capabilities declared to be used by the push message, the coprocessor will preferentially call the capabilities declared to be used by the push message to process the push message; if the coprocessor does not have all the capabilities declared to be used by the push message, the main processor will call the capabilities declared to be used by the push message to process the push message.
[0085] In conjunction with Figure 5, taking the main processor as AP and the coprocessor as MCU as an example, if the push message declares the use of the "display" capability and the "camera" capability, and the MCU has the "display" capability and the "camera" capability, the MCU will use the "display" capability and the "camera" capability to process the push message; otherwise, if the MCU only has the "display" capability or only has the "camera" capability or does not have both capabilities, the AP will use the "display" capability and the "camera" capability to process the push message.
[0086] Optionally, in some embodiments, in order to ensure that when the coprocessor does not have all the capabilities declared to be used by a push message, the main processor can have all the capabilities declared to be used by the push message, so that the electronic device can process the push message normally, the capability set 1 of the main processor can be a set of all capabilities that can be declared to be used by the push message in the electronic device, and the capability set 2 of the coprocessor can be a subset of the capability set 1 of the main processor.
[0087] In an embodiment of the present application, the coprocessor is given priority to process push messages. When the coprocessor does not have all the capabilities declared for the push message, the main processor processes the push message, thereby reducing the number of times the main processor is awakened and reducing the power consumption of the electronic device.
[0088] In some embodiments, the routing of the push message can be specifically performed by a coprocessor. After the communication chip of the electronic device receives the push message, it can send a wake-up signal to the coprocessor (e.g., an MCU). The coprocessor is awakened from a dormant state by the wake-up signal, and the communication chip sends the push message to the coprocessor, which then routes the push message to the coprocessor or the main processor for processing.
[0089] 5 and 6 , an exemplary description is given of the implementation of the method for processing push messages according to an embodiment of the present application.
[0090] As shown in FIG5 , the electronic device may include: a communication chip, a main processor (eg, AP) and a coprocessor (eg, MCU); wherein,
[0091] The communication chip can be a communication chip that supports any wireless communication method. The communication chip includes a communication chip controller, which is used to communicate wirelessly with other devices based on the communication protocol supported by the communication chip. In the embodiment of the present application, the communication chip can connect to the network and receive push messages sent by the push server to the electronic device.
[0092] When installing application A that supports push services (such as an instant messaging application) in an electronic device, application A can be installed in the main processor and the coprocessor respectively. Application A in the main processor and application A in the coprocessor both have the function of processing push messages. In other words, both can process push messages of application A.
[0093] It is understood that Application A in the main processor and Application A in the coprocessor may also have other functions besides the push message processing function, and this embodiment of the application does not specifically limit this. For example, if Application A is a shopping application, Application A in the main processor and Application A in the coprocessor may have, in addition to the push message processing function, product search function, product display function, product purchase function, etc.
[0094] The functions of application A in the main processor and application A in the coprocessor may be the same or different. In some embodiments, the functions of application A in the coprocessor may be a subset of the functions of hardware A in the main processor. For example, application A in the main processor may have all the functions that application A can provide, such as push message processing, product search, product display, and product purchase. Application A in the coprocessor may have all or some of the above functions, as long as they include push message processing.
[0095] To support push message routing, the coprocessor may be provided with a message processing module. The message processing module may be a module provided by the operating system. In some embodiments, the message processing module may specifically be an application provided by the operating system, which may be different from application A.
[0096] The message processing module is used to parse the received push message, identify the capabilities declared in the push message, and route the push message to application A in the coprocessor or application A in the main processor according to the capabilities declared in the push message.
[0097] FIG6 is a flow chart of a method for processing push messages according to an embodiment of the present application provided based on the electronic device structure shown in FIG5 . As shown in FIG6 , the method may include:
[0098] Step 601: The communication chip controller receives a push message.
[0099] Step 602: The communication chip controller sends a push message to the message processing module of the coprocessor.
[0100] Optionally, before the communication chip controller sends a push message to the message processing module of the coprocessor, the communication chip can send a wake-up signal to the coprocessor. If the coprocessor is in a sleep state, the coprocessor is awakened, and then the message processing module of the coprocessor can receive the push message sent by the communication chip controller.
[0101] Step 603: The message processing module identifies the capabilities declared in the push message and obtains a capability list of the push message.
[0102] For the specific implementation of this step, please refer to the corresponding description in the subsequent embodiments and will not be repeated here.
[0103] Step 604: The message processing module determines the target processor for processing the push message according to the capability list of the push message and the distribution routing table. If the target processor is a coprocessor, step 605 is executed; otherwise, step 607 is executed.
[0104] Optionally, the message processing module can search the distribution routing table for the processor corresponding to each capability in the capability list. If the processors corresponding to each capability include a coprocessor, the target processor is determined to be a coprocessor; otherwise, the target processor is determined to be a main processor. For the specific implementation of this step, please refer to the corresponding description in the subsequent embodiments and will not be repeated here.
[0105] Step 605 : The message processing module sends the push message to application A in the coprocessor, and then executes step 606 .
[0106] Step 606: Application A in the coprocessor processes the push message using the capabilities declared in the push message, and this branch of the process ends.
[0107] Step 607 : The message processing module sends the push message to application A in the coprocessor, and then executes step 608 .
[0108] Optionally, in order to prevent the main processor from being in a sleep state and unable to receive push messages, before executing this step, the coprocessor can send a wake-up signal to the main processor. If the main processor is in a sleep state, the main processor is awakened by the wake-up signal. After that, application A in the main processor can receive the push message sent by the message processing module in the coprocessor.
[0109] Step 608: Application A in the main processor processes the push message using the capabilities declared in the push message, and this branch of the process ends.
[0110] In this method, after the communication chip receives the push message, the message processing module of the coprocessor parses and routes the push message. When the coprocessor has all the capabilities declared for use in the push message, application A in the coprocessor can directly use the capabilities in the coprocessor to process the push message. During the entire process, only the coprocessor needs to be woken up, and the main processor does not need to be woken up to process the push message, thereby avoiding the main processor from being woken up frequently and reducing the power consumption of the electronic device.
[0111] The following is an illustrative description of possible implementations of the capability of the message processing module to identify the declared use of a push message in the above embodiment.
[0112] The push message code declares the processing that the application needs to perform, and these processing are identified by relatively fixed strings. For example, the push message code is as follows:
[0113] {
[0114] "aps":{
[0115] "alert":"message" / / message
[0116] "badge":9 / / Display 9 badges
[0117] "sound":"default" / / vibration prompt sound. Default is default
[0118] },
[0119] "parm1":"bar" / / Extended parameter 1
[0120] "parm2":2 / / Extended parameter 2
[0121] }
[0122] Alternatively, a push message for a voice call in an instant messaging application may look like this:
[0123] {
[0124] "aps":{
[0125] "alert":"message", / / Message (text display)
[0126] "badge":9, / / Display 9 badges
[0127] "sound":"default" / / Vibration sound. Default is default (audio playback)
[0128] },
[0129] "voicecall":"123456789" (incoming voice call from 123456789)
[0130] }
[0131] Among them, there are character strings such as "alert", "badge", and "sound", which are respectively used to indicate that the push message needs to be processed by application A. In the embodiment of the present application, the capabilities declared for use in the push message can be identified based on the above keywords.
[0132] In some embodiments, keywords corresponding to each capability can be pre-set, and the push message can be searched for the corresponding keyword to identify the capability declared in the push message. Specifically, the push message can be searched for the keyword corresponding to each capability in turn. If the keyword corresponding to a capability exists, it can be identified that the push message declares the use of that capability.
[0133] In some embodiments, if the capability used in the push message declaration is hardware mounted on the processor, the message processing module may pre-store a mapping relationship between each capability and a keyword, such as shown in Table 1 below:
[0134] Table 1
[0135] Then, the message processing module can search for keywords such as sound, alert, badge, camera, etc. in the above push messages in turn. Since the keywords sound, alert and badge can be found in the above push messages, it can be identified that the capabilities declared to be used in the push message include: speaker and display, and the capability list of the push message can be obtained, including: speaker and display.
[0136] In some embodiments, if the capability declared in the push message is a software running capability related to the hardware mounted on the processor, the mapping relationship between each capability and keyword pre-stored in the message processing module is shown in Table 2 below:
[0137] Table 2
[0138] Then, the message processing module can search for keywords such as sound, alert, badge, etc. in the above push messages in turn. Since the keywords sound, alert and badge can be found in the above push messages, it can be identified that the capabilities declared in the push message include: sound playback capability, text display capability and badge display capability, and the capability list of the push message can be obtained, including: sound playback capability, text display capability and badge display capability.
[0139] The following is an exemplary description of the implementation of the message processing module in the above embodiment determining the target processor for processing the push message based on the distribution routing table.
[0140] Optionally, the message processing module may generate a push message distribution routing table based on the capabilities of the main processor and the coprocessor. Specifically, the distribution routing table may record information about processors with each capability. Optionally, the distribution routing table may include a capability field and a processor field, with the processor field corresponding to each capability field recording the processor with that capability.
[0141] In some embodiments, when the processor (including the main processor and the coprocessor) in the electronic device is started, the processor can obtain the hardware mounted on the processor, thereby obtaining the capabilities of the processor. The message processor module can obtain the capabilities of each processor from the processor and generate the above-mentioned distribution routing table based on the capabilities of each processor.
[0142] Optionally, if the message processing module identifies that the capabilities declared to be used in the push message and the capabilities recorded in the distribution routing table are of the same type, for example, both are hardware capabilities or both are software running capabilities, then when the message processing module determines the target processor for processing the push message based on the distribution routing table, it can search the distribution routing table for the processor corresponding to each capability in the capability list (that is, each capability declared to be used in the push message) based on the capability list of the push message. When the processors corresponding to each capability in the capability list include coprocessors, it is determined that the target processor of the push message is a coprocessor; otherwise, it is determined that the target processor is the main processor.
[0143] The following examples illustrate this.
[0144] In some embodiments, if the capability of the processor is hardware mounted on the processor, the distribution routing table is shown in Table 3 below.
[0145] Table 3
[0146] Table 3 includes a capability field and a processor field. Each capability field's corresponding processor field records the processor with that capability. For example, in Table 3, assuming the main processor is an AP and the coprocessor is an MCU, the processors with the "display" capability, "speaker" capability, and "touchscreen" capability are the AP and MCU, respectively. The processor with the "barometer" and "accelerometer" capabilities is the MCU, and the processor with the "camera" capability is the AP.
[0147] In this embodiment, when the message processing module determines the target processor for processing the push message based on the distribution routing table:
[0148] If the capability list of the push message includes: speaker and display, it can be found from Table 3 that the processors corresponding to the "speaker" capability are AP and MCU, and the processors corresponding to the "display" capability are also AP and MCU. The processors corresponding to both capabilities include MCU, so it is determined that the target processor of the push message is MCU.
[0149] If the capability list of the push message includes: display and camera, it can be found from Table 3 that the processors corresponding to the "display" capability are AP and MCU, and the processor corresponding to the "camera" capability is AP. Only one capability corresponds to the processor including MCU, so it is determined that the target processor of the push message is AP.
[0150] Other possible implementations of the present application will not be listed one by one.
[0151] In other embodiments, if the capability of the processor is the software running capability related to the hardware mounted on the processor, the distribution routing table is shown in Table 4 below, for example.
[0152] Table 4
[0153] Table 4 includes a capability field and a processor field. Each capability field corresponds to a processor field that records the processor with that capability. For example, in Table 4, assuming the main processor is an AP and the coprocessor is an MCU, the processors with text display capability, audio playback capability, and subscript display capability are the AP and MCU, respectively, while the processor with video playback capability is the AP.
[0154] In this embodiment, when the message processing module determines the target processor for processing the push message based on the distribution routing table:
[0155] If the capability list of the push message includes: text display capability and audio playback capability, it can be found from Table 4 that the processors corresponding to the text display capability and audio playback capability are both AP and MCU. Therefore, the processors corresponding to the two capabilities include MCU, and it is determined that the target processor of the push message is MCU.
[0156] If the capability list of the push message includes: text display capability and video playback capability, it can be found from Table 4 that the processors corresponding to the text display capability are AP and MCU, and the processor corresponding to the video playback capability is AP. Only one capability corresponds to the processor including MCU, then it is determined that the target processor of the push message is AP.
[0157] Other possible implementations of the present application will not be listed one by one.
[0158] Optionally, if the message processing module identifies that the capability declared to be used in the push message is a software running capability, and the capability recorded in the distribution routing table is a hardware capability, in other words, the types of the two capabilities do not match, then before the message processing module determines the target processor for processing the push message based on the distribution routing table, it can first convert the software running capability declared to be used in the push message into a hardware capability, and then based on the hardware capability obtained after the conversion, search the distribution routing table for the processor corresponding to each capability in the capability list (that is, each capability declared to be used in the push message). When the processors corresponding to each capability in the capability list include coprocessors, it is determined that the target processor of the push message is a coprocessor; otherwise, it is determined that the target processor is the main processor.
[0159] The following examples illustrate this.
[0160] The message processing module may preset a capability type conversion table, such as that shown in Table 5 below, which includes a hardware capability field and a software running capability field. The hardware capability field corresponding to the software running capability field records the hardware capability corresponding to the software running capability.
[0161] Table 5
[0162] If the message processing module identifies, through a preset relationship such as shown in Table 2, that the capability declared to be used in the push message is software running capability, and the capability recorded in the distribution routing table preset in the message processing module is hardware capability, such as shown in Table 3, then, before the message processing module determines the target processor for processing the push message based on the distribution routing table such as shown in Table 3, it may first convert the capability declared to be used in the push message from software running capability to hardware capability based on the capability type conversion table shown in Table 5.
[0163] For example, if the capabilities declared in the push message include text display capability and audio playback capability, the message processing module can convert the text display capability into the "display screen" capability and the audio playback capability into the "speaker" capability based on Table 5. The following will not list them one by one.
[0164] In conjunction with the electronic device structure shown in FIG5 , in another embodiment of the push message processing method provided in this application, the main processor and the coprocessor can collaboratively process the push message, specifically:
[0165] If the coprocessor has all the capabilities declared for use in a push message, the coprocessor shall prioritize calling the capabilities declared for use in a push message to process the push message; if the coprocessor only has some of the capabilities declared for use in a push message, the coprocessor shall call the aforementioned capabilities to process the push message, and the main processor shall call other capabilities declared for use in the push message to process the push message; if the coprocessor does not have any of the capabilities declared for use in a push message, the main processor shall call the capabilities declared for use in the push message to process the push message.
[0166] Still taking the example where the main processor is AP and the coprocessor is MCU, if the push message declares the use of text display capability and audio playback capability, and the MCU has text display capability and audio playback capability, the MCU will call the text display capability and audio playback capability to process the push message. If the MCU only has text display capability, the MCU will call the text display capability to process the push message, and the AP will call the audio playback capability to process the push message. If the MCU does not have text display capability and audio playback capability, the AP will call the text display capability and audio playback capability to process the push message.
[0167] Optionally, in some embodiments, in order to ensure that the main processor and the coprocessor can collaboratively process all push messages, the union of the main processor's capability set 1 and the coprocessor's capability set 2 can be a set of all capabilities that can be declared for use in push messages in the electronic device, and the coprocessor's capability set 2 may or may not have an intersection with the main processor's capability set 1.
[0168] In this embodiment, the coprocessor is given priority to process push messages. When the coprocessor does not have all the capabilities declared for the push message, the main processor and the coprocessor will jointly process the push message or process the push message alone, thereby reducing the number of times the main processor is awakened and reducing the power consumption of the electronic device.
[0169] 5 and 7 are used to illustrate the implementation of the push message processing method of the embodiment of the present application.
[0170] The main difference between the message processing module in this embodiment and the message processing module in the previous embodiment is that: in the previous embodiment, the message processing module routes the push message to application A of the main processor or application A of the coprocessor for processing, while in this embodiment, the message processing module routes the push message to application A of the main processor and / or application A of the coprocessor for processing.
[0171] Figure 7 is a flow chart of a push message processing method according to an embodiment of the present application provided based on the electronic device structure shown in Figure 5. As shown in Figure 7 , the difference between this method and the method shown in Figure 6 is mainly that steps 604 to 608 are replaced by the following steps 701 to 707.
[0172] Step 701: The message processing module determines the target processor for processing the push message based on the distribution routing table according to the capability list of the push message. When the target processor is a coprocessor, execute step 702; when the target processor is a main processor, execute step 704; when the target processor is a main processor and a coprocessor, execute step 706.
[0173] Optionally, the message processing module can find the processor corresponding to each capability in the capability list from the distribution routing table, and when the processor corresponding to each capability includes a coprocessor, determine that the target processor is a coprocessor; when the processor corresponding to each capability does not include a coprocessor, determine that the target processor is a main processor; when the processors corresponding to some capabilities include a coprocessor, determine that the target processor is a main processor and a coprocessor.
[0174] Step 702 : The message processing module sends the push message to application A in the coprocessor, and then executes step 703 .
[0175] Step 703: Application A in the coprocessor processes the push message using the capabilities declared in the push message, and this branch of the process ends.
[0176] Step 704 : The message processing module sends the push message to application A in the main processor, and then executes step 705 .
[0177] Optionally, in order to prevent the main processor from being in a sleep state and unable to receive push messages, before executing this step, the coprocessor can send a wake-up signal to the main processor. If the main processor is in a sleep state, the main processor is awakened by the wake-up signal. After that, application A in the main processor can receive the push message sent by the message processing module in the coprocessor.
[0178] Step 705: Application A in the main processor processes the push message using the capabilities declared in the push message, and this branch of the process ends.
[0179] Step 706 : The message processing module sends the push message to the application A of the main processor and the application A of the coprocessor respectively, and then executes step 707 .
[0180] Step 707: Application A of the coprocessor uses the capabilities declared in the push message that the coprocessor supports to process the push message, and Application A of the main processor uses the capabilities declared in the push message that the coprocessor does not support to process the push message, and this branch process ends.
[0181] Optionally, in this step, the application A of the coprocessor can use a method similar to the message processing module to determine the capabilities declared to be used by the push message and the capabilities supported by the coprocessor, thereby using the corresponding capabilities to process the push message; the application A of the main processor can use a method similar to the message processing module to determine the capabilities declared to be used by the push message and the capabilities supported by the coprocessor, and then obtain the capabilities that are not supported by the coprocessor among the capabilities declared to be used by the push message, thereby using the corresponding capabilities to process the push message.
[0182] In other embodiments provided herein, to conserve processing resources and improve processing efficiency, the message processing module in the above embodiment, when determining whether the target processor is a main processor or a coprocessor, can divide the capability list of the push message into capability sublist 1 and capability sublist 2 based on the processor corresponding to each capability found in the distribution routing table. Capability sublist 1 records the capabilities supported by the coprocessor among the capabilities declared in the push message, while capability sublist 2 records the capabilities not supported by the coprocessor among the capabilities declared in the push message. For example, if the push message declares the use of text display capability and video playback capability, and the MCU only has text display capability but not video playback capability, while the AP has video playback capability, capability sublist 1 can include text display capability, and capability sublist 2 can include video playback capability. In step 706, when the message processing module sends a push message to application A of the main processor, it can also send capability sublist 2, and when sending a push message to application A of the coprocessor, it can also send capability sublist 1. As a result, in step 707, application A of the main processor and application A of the coprocessor do not need to determine the capabilities they need to use from the push message, thereby improving the efficiency of push message processing by both applications A.
[0183] It can be understood that the union of the capability sublist 1 and the capability sublist 2 is the capability list, and the capability sublist 2 is the part of the capability list excluding the capability sublist 1.
[0184] In other embodiments provided herein, when the message processing module determines that the target processor is a main processor or a coprocessor, it may not send the aforementioned capability sublist 1 and capability sublist 2. Instead, it may split the push message into push message 1 and push message 2 according to the capabilities used by the main processor and coprocessor to process the push message, respectively. Push message 1 is the portion of the push message corresponding to the capabilities supported by the coprocessor, and push message 2 is the portion of the push message corresponding to the capabilities not supported by the coprocessor but supported by the main processor. Thus, in step 706, the message processing module may send push message 1 to application A of the coprocessor and push message 2 to application A of the main processor. Accordingly, in step 707, application A of the coprocessor processes push message 1, and application B of the main processor processes push message 2.
[0185] Take the following push message as an example:
[0186] {
[0187] "aps":{
[0188] "alert":"message"
[0189] "badge":9
[0190] "sound":"default"
[0191] },
[0192] "parm1":"bar"
[0193] "parm2":2
[0194] }
[0195] Assuming that the coprocessor only supports the "speaker" capability and the main processor supports the "display" capability, the push message can be split into the following push message 1 and push message 2.
[0196] Push message 1 is:
[0197] {
[0198] "aps":{
[0199] "sound":"default"
[0200] },
[0201] "parm1":"bar"
[0202] "parm2":2
[0203] Push message 2 is:
[0204] {
[0205] "aps":{
[0206] "alert":"message"
[0207] "badge":9
[0208] },
[0209] "parm1":"bar"
[0210] "parm2":2
[0211] In other embodiments provided in the present application, when the message processing module determines that the target processor is the main processor and the coprocessor, it may not split the push message or the capability list. Instead, before sending the push message to the main processor and the coprocessor in step 706, the message processing module may mark the push message according to the capabilities used by the main processor and the coprocessor to process the push message respectively, so that in step 707 the main processor and the coprocessor can determine the capabilities they need to use in the push message based on the mark, and then process the push message.
[0212] In one example, the message processing module may use different tags in the same push message to indicate the parts of the message content that the main processor and the coprocessor need to process respectively.
[0213] Take the following push message as an example:
[0214] {
[0215] "aps":{
[0216] "alert":"message"
[0217] "badge":9
[0218] "sound":"default"
[0219] },
[0220] "parm1":"bar"
[0221] "parm2":2
[0222] }
[0223] Assuming that the coprocessor only supports the "speaker" capability and the main processor supports the "display" capability, the part of the message content corresponding to the "speaker" capability in the push message can be indicated with tag 1, and the part of the message content corresponding to the "display" capability in the push message can be indicated with tag 2. The marked push message is shown below:
[0224] {
[0225] "aps":{
[0226] "alert":"message" / / Δ
[0227] "badge":9 / / Δ
[0228] "sound":"default" / / √
[0229] },
[0230] "parm1":"bar"
[0231] "parm2":2
[0232] }
[0233] Among them, √ represents mark 1, Δ represents mark 2, and the unmarked part can indicate that both processors are processing.
[0234] It should be noted that the above marks Δ and √ are only examples, and there is no limitation on how marks 1 and 2 are specifically implemented in the embodiments of the present application.
[0235] In another example, the message processing module may use mark a in a push message sent to the main processor to indicate the portion of the message content that the main processor needs to process, and use mark b in a push message sent to the coprocessor to indicate the portion of the message content that the coprocessor needs to process. Mark a and mark b may be the same or different marks, and the embodiment of the present application is not limited thereto.
[0236] Continuing with the previous push message example, the push message sent to the main processor is as follows:
[0237] {
[0238] "aps":{ / / Δ
[0239] "alert":"message" / / Δ
[0240] "badge":9 / / Δ
[0241] "sound":"default"
[0242] }
[0243] "parm1":"bar" / / Δ
[0244] "parm2":2 / / Δ
[0245] }
[0246] Wherein, Δ represents a mark a, and the marked part of the message content in the push message indicates that the main processor needs to process it, and the unmarked part of the message content in the push message indicates that the main processor does not need to process it.
[0247] The push message sent to the coprocessor is as follows:
[0248] {
[0249] "aps":{ / / Δ
[0250] "alert":"message"
[0251] "badge":9
[0252] "sound":"default" / / Δ
[0253] }
[0254] "parm1":"bar" / / Δ
[0255] "parm2":2 / / Δ
[0256] }
[0257] Wherein, Δ represents a mark b, and the marked part of the message content in the push message indicates that the coprocessor needs to process it, and the unmarked part of the message content in the push message indicates that the coprocessor does not need to process it.
[0258] In the above-mentioned embodiment of the present application, after the communication chip receives the push message, the coprocessor parses and routes the push message. When the coprocessor has all the capabilities declared to be used in the push message, application A in the coprocessor can directly call the capabilities in the coprocessor to process the push message. During the entire process, only the coprocessor needs to be woken up, and the main processor does not need to be woken up to process the push message, thereby reducing the number of times the main processor is woken up, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0259] In conjunction with the electronic device structure shown in FIG5 , in another embodiment of the push message processing method provided in this application, the main processor and the coprocessor can collaboratively process push messages. The difference from the previous embodiment is that:
[0260] In the previous embodiment, if the coprocessor only has some of the capabilities declared for use in the push message, the coprocessor calls the aforementioned partial capabilities to process the push message, and the main processor calls other capabilities declared for use in the push message to process the push message;
[0261] In this embodiment, if the coprocessor has only some of the capabilities declared for use by the push message, but the main processor has all the capabilities declared for use by the push message, the main processor invokes the capabilities declared for use by the push message to process the push message;
[0262] If both the main processor and the coprocessor have only part of the capabilities declared for use by the push message, the coprocessor calls the part of the capabilities declared for use by the push message to process the push message, and the main processor calls other capabilities declared for use by the push message to process the push message; or, if both the coprocessor and the main processor have only part of the capabilities declared for use by the push message, the main processor calls the part of the capabilities declared for use by the push message to process the push message, and the coprocessor calls other capabilities declared for use by the push message to process the push message.
[0263] For example, assuming that the push message declares the use of text display capability, audio playback capability, and badge display capability, then: if the MCU has the above three capabilities, regardless of whether the AP has the above three capabilities, the MCU will prioritize calling the above three capabilities to process the push message; if the MCU does not have the above three capabilities, the AP will call the above three capabilities to process the push message; if the MCU has text display capability but the AP has the above three capabilities, the AP will call the above three capabilities to process the push message; if the MCU has text display capability and audio playback capability, and the AP has audio playback capability and badge display capability, the MCU can call the text display capability and audio playback capability to process the push message, and the AP can call the badge display capability to process the push message, or the MCU can call the text display capability to process the push message, and the AP can call the audio playback capability and badge display capability to process the push message.
[0264] Optionally, in order to ensure that the main processor and the coprocessor can collaboratively process all push messages, the union of the main processor's capability set 1 and the coprocessor's capability set 2 can be the set of all capabilities that can be declared for use in push messages in the electronic device. The coprocessor's capability set 2 may or may not have an intersection with the main processor's capability set 1.
[0265] The specific implementation of the embodiment of the present application can still refer to the process shown in FIG7 , with the main difference being:
[0266] In the embodiment of the present application, step 701 may specifically include:
[0267] The message processing module can find the processor corresponding to each capability in the capability list from the distribution routing table; when the processors corresponding to each capability include a coprocessor, it is determined that the target processor is a coprocessor; when the processors corresponding to each capability do not include a coprocessor, it is determined that the target processor is a main processor; when the processors corresponding to some capabilities include a coprocessor, but the processors corresponding to each capability include a main processor, it is determined that the target processor is a main processor; when the processors corresponding to some capabilities include a coprocessor, and the processors corresponding to some capabilities include a main processor, it is determined that the target processor is a main processor and a coprocessor.
[0268] In this embodiment, the coprocessor is given priority to process push messages. When the coprocessor does not have all the capabilities declared for the push message, the main processor processes the push message alone or in collaboration with the coprocessor to process the push message, thereby reducing the number of times the main processor is awakened, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0269] In the aforementioned embodiment, taking the arrangement of a main processor and one coprocessor in an electronic device to process push messages as an example, in other embodiments provided in the present application, two or more coprocessors may be arranged in the electronic device to process push messages, and the specific number of coprocessors is not specifically limited in the embodiments of the present application. At this time, application A may be arranged in a main processor and multiple coprocessors, one of which (hereinafter referred to as the main coprocessor) may be provided with a message processing module, through which the push message is routed to application A of the target processor for processing. It is understandable that the target processor here may be one or more processors, and this embodiment of the present application does not impose any restrictions. When the message processing module determines the target processor, the priority relationship between the processors may be: main coprocessor (including the coprocessor of the message processing module)> other coprocessors> main processor.
[0270] For example, in Figure 8, an electronic device is provided with a main processor (e.g., AP), coprocessor 1 (e.g., MCU1), and coprocessor 2 (e.g., MCU2), a total of three processors, to process push messages. Coprocessor 1 may correspond to the coprocessor in Figure 5. Different from the electronic device structure shown in Figure 5, the message processing module in coprocessor 1 in the embodiment of the present application can route push messages to application A of coprocessor 1, application A of coprocessor 2, and / or application A of the main processor. Optionally, in this embodiment, the priority of processors processing push messages can be coprocessor 1>coprocessor 2>main processor.
[0271] In one embodiment of the push message processing method provided herein, if the main processor and coprocessor do not collaborate to process a push message, the message processing module in coprocessor 1, based on the aforementioned priority, can preferentially route the push message to application A on coprocessor 1 for processing, thereby waking up only coprocessor 1 and reducing power consumption. If coprocessor 1 is unable to process the push message, the message is then routed to coprocessor 2 or the main processor for processing. If both coprocessor 2 and the main processor can process the push message, the message is preferentially routed to coprocessor 2, thereby preferentially using coprocessor 2, which has relatively low power consumption, to process the push message, thereby reducing power consumption associated with push message processing.
[0272] Figure 9 is a flow chart of a push message processing method according to an embodiment of the present application provided based on the electronic device structure shown in Figure 8. As shown in Figure 9 , the main difference between this method and the method shown in Figure 6 is that: due to the addition of coprocessor 2, step 901 in this embodiment adds a branch that the target processor is coprocessor 2, relative to step 604 in Figure 6, thereby replacing steps 604 to 608 with the following steps 901 to 907.
[0273] Step 901: The message processing module determines the target processor for processing the push message based on the distribution routing table according to the capability list of the push message. When the target processor is coprocessor 1, execute step 902; when the target processor is coprocessor 2, execute step 904; when the target processor is the main processor, execute step 906.
[0274] Optionally, the message processing module can find the processor corresponding to each capability in the capability list from the distribution routing table. When coprocessor 1 is included in the processors corresponding to each capability, the target processor is determined to be coprocessor 1. When coprocessor 1 is not included in the processors corresponding to at least one capability, and coprocessor 2 is included in the processors corresponding to each capability, the target processor is determined to be coprocessor 2. When coprocessor 1 and coprocessor 2 are not included in the processors corresponding to some capabilities, the target processor is determined to be the main processor.
[0275] Steps 902 to 903: The message processing module sends the push message to application A in coprocessor 1. Application A in coprocessor 1 processes the push message using the capability declared in the push message. This branch of the process ends.
[0276] Steps 904 to 905: the message processing module sends the push message to application A in coprocessor 2. Application A in coprocessor 2 processes the push message using the capability declared in the push message. This branch of the process ends.
[0277] Optionally, in order to prevent coprocessor 2 from being in a sleep state and unable to receive push messages, before sending the push message, coprocessor 1 can send a wake-up signal to coprocessor 2. If coprocessor 2 is in a sleep state, coprocessor 2 is awakened by the wake-up signal. After that, application A in coprocessor 2 can receive the push message sent by the message processing module in coprocessor 1.
[0278] Steps 906-907: The message processing module sends the push message to the application A of the main processor. The application A of the main processor processes the push message using the capability declared in the push message. This branch process ends.
[0279] In this method, after the communication chip receives the push message, the message processing module of coprocessor 1 parses and routes the push message. When coprocessor 1 has all the capabilities declared to be used in the push message, application A in coprocessor 1 can directly use the capabilities in the coprocessor to process the push message. When coprocessor 1 does not have all the capabilities declared to be used in the push message but coprocessor 2 has all the capabilities declared to be used in the push message, the push message is routed to application A of coprocessor 2 for processing. During the entire process, only the coprocessor needs to be woken up, and the main processor does not need to be woken up to process the push message, thereby reducing the number of times the main processor is woken up, reducing the power consumption of the electronic device, and extending the standby time of the electronic device.
[0280] In another embodiment of the push message processing method provided in the present application, if the main processor and the coprocessor jointly process the push message, the message processing module in the coprocessor 1 can, based on the above-mentioned priority, preferentially route the push message to application A of coprocessor 1 and / or application A of coprocessor 2 for processing; when the coprocessor cannot process the push message, it will be routed to the main processor for processing.
[0281] Figure 10 is a flow chart of a push message processing method according to an embodiment of the present application provided based on the electronic device structure shown in Figure 8. The main difference from the embodiment shown in Figure 7 is that: due to the addition of coprocessor 2, step 1001 in this embodiment adds a branch that the target processor is coprocessor 2 and the processors that co-process push messages include coprocessor 2, relative to step 701 in Figure 7, thereby replacing steps 701 to 707 with the following steps 1001 to 1015.
[0282] Specifically, in step 1001, when the message processing module of coprocessor 1 determines the target processor for processing the push message based on the push message capability list and the distribution routing table, the determined target processors may be: coprocessor 1, coprocessor 2, main processor, coprocessor 1 and coprocessor 2, coprocessor 2 and main processor, coprocessor 1 and main processor, coprocessor 1, coprocessor 2 and main processor, etc. Therefore, in subsequent steps, the message processing module of coprocessor 1 can route the push message to application A of the target processor, and application A of the target processor will process the push message.
[0283] The specific implementation of this embodiment can refer to the relevant embodiments in which the electronic device includes a main processor and a coprocessor, and the main processor and the coprocessor can collaboratively process push messages, which will not be repeated here.
[0284] In other embodiments provided herein, the message processing module in the aforementioned embodiments may also be disposed in the communication chip controller of the communication chip. For example, as shown in FIG11 , the message processing module in the electronic device structure shown in FIG5 is disposed in the communication chip controller of the communication chip. In this case, the implementation of the push message processing method in the embodiments of the present application can refer to the aforementioned embodiments and will not be elaborated upon here.
[0285] In other embodiments provided by the present application, a routing processor may be connected between the communication chip and each processor in the above embodiment, and the message processing module may be set in the routing processor. For example, as shown in Figure 12, the message processing module in the electronic device structure shown in Figure 5 is set in the routing processor as an example. In this case, the implementation of the push message processing method of the embodiment of the present application can refer to the above embodiment and will not be repeated here. Optionally, the above routing processor can be implemented by a low-power processor such as an MCU.
[0286] In another embodiment of the push message processing method provided in the present application, the push message sent by the push server to the electronic device may carry identification information, which may be a capability identifier for indicating the capability required for the push message, or an identifier for indicating the target processor for processing the push message, hereinafter referred to as the target processor identifier.
[0287] The following are illustrative examples.
[0288] In some embodiments, the push message sent by the push server to the electronic device may carry a capability identifier, which is used to indicate the capability required for the push message. In this case, the message processing module in the above embodiment does not need to identify the capability declared in the push message through keywords in the push message, but can directly obtain the capability identifier from the push message to obtain the capability declared in the push message.
[0289] The capabilities required for pushing messages may correspond to the hardware capabilities or software running capabilities of the above-mentioned processors, which will not be described in detail here.
[0290] In some embodiments, the push server may also use the above-mentioned keyword search method to identify the capabilities used in the push message life, and set the identification of the above-mentioned capabilities in the push message. For specific implementation, please refer to the above-mentioned corresponding instructions and will not be repeated here.
[0291] The embodiment of the present application does not limit the location where the capability identifier is set in the push message, as long as it is pre-defined between the push server and the electronic device so that the electronic device can obtain the capability identifier from the push message.
[0292] In some embodiments, the capability identifier may be set as a parameter in the push message, for example, taking the following push message as an example:
[0293] {
[0294] "aps":{
[0295] "alert":"message"
[0296] "badge":9
[0297] "sound":"default"
[0298] "abilityID":"1,3"
[0299] },
[0300] "parm1":"bar"
[0301] "parm2":2
[0302] }
[0303] The 1 and 3 corresponding to the abilityID are capability identifiers, for example, they can identify the "display" capability and the "speaker" capability respectively.
[0304] In some embodiments, the push message sent by the push server to the electronic device may carry a target processor identifier. At this time, the message processing module in the above embodiment does not need to identify the capabilities declared in the push message, nor does it need to determine the target server based on the distribution routing table. It only needs to obtain the target processor identifier from the push message and determine the target processor based on the target processor identifier. The setting position of the target processor identifier in the push message is not limited in the embodiment of the present application, as long as it is pre-defined between the push server and the electronic device so that the electronic device can obtain the capability identifier from the push message.
[0305] In some embodiments, the target processor identifier may be set as a parameter in the push message, for example, taking the following push message as an example:
[0306] {
[0307] "aps":{
[0308] "alert":"message"
[0309] "badge":9
[0310] "sound":"default"
[0311] "CPUID":"1"
[0312] },
[0313] "parm1":"bar"
[0314] "parm2":2
[0315] }
[0316] The 1 corresponding to the CPUID is the target processor identifier. For example, when the electronic device is implemented by the structure shown in FIG5 , “1” can identify that the coprocessor in FIG5 is the target processor.
[0317] In some embodiments, if the target processor identifier carried in the push message sent by the push server to the electronic device indicates at least two target processors, the push server can divide and / or identify the message content in the push message, so that the electronic device can know the message content that each target processor needs to process.
[0318] In one example, a push message can be divided into sub-messages according to the push message that each target processor needs to process, and the target server corresponding to each portion of the message content can be identified. Accordingly, the message processing module in the electronic device can split the push message into sub-messages and send them to the corresponding target processors for processing; or, after the message processing module in the electronic device sends the push message to application A of the target processor, application A of each target processor can obtain the message content it needs to process from the push message and process it.
[0319] Take the following push message as an example:
[0320] {
[0321] "aps":{
[0322] "alert":"message"
[0323] "badge":9
[0324] "sound":"default"
[0325] },
[0326] "parm1":"bar"
[0327] "parm2":2
[0328] }
[0329] Assuming that the coprocessor only supports the "speaker" capability and the main processor supports the "display" capability, the push message content can be split and represented to obtain the following push message.
[0330] {
[0331] "aps":{
[0332] "sound":"default"
[0333] "CPUID":"1"
[0334] },
[0335] "parm1":"bar"
[0336] "parm2":2
[0337] { / / / / The boundary between the two parts of the message content
[0338] "aps":{
[0339] "alert":"message"
[0340] "badge":9
[0341] "CPUID":"2"
[0342] },
[0343] "parm1":"bar"
[0344] "parm2":2
[0345] The first part of the message content has the ID "1" of the coprocessor and is executed by the coprocessor, and the second part of the message content has the ID "2" of the main processor and is executed by the main processor.
[0346] In another example, push messages can be tagged according to the push message content that each target processor needs to process. Accordingly, the message processing module in the electronic device can split the push message into sub-messages according to the different tags and send them to the corresponding target processors for processing. Alternatively, after the message processing module in the electronic device sends the push message to application A of the target processor, application A of each target processor can obtain the message content it needs to process from the push message according to its corresponding tag and process it.
[0347] Continuing with the previous push message example, the marked push message is as follows:
[0348] {
[0349] "aps":{
[0350] "alert":"message" / / Δ
[0351] "badge":9 / / Δ
[0352] "sound":"default" / / √
[0353] },
[0354] "parm1":"bar"
[0355] "parm2":2
[0356] }
[0357] Among them, √ represents mark 1, which is used to mark the push message content that the coprocessor needs to process, Δ represents mark 2, which is used to mark the push message content that the main processor needs to process, and the unmarked part may indicate that both processors need to process it.
[0358] In some embodiments, in order to enable the push server to obtain information about the processor set in the electronic device and information about the capabilities of the processor, so as to accurately indicate the target processor for the electronic device, the electronic device can send the above information to the push server. Specifically, for example, the above information can be sent during the registration process shown in Figure 3.
[0359] Since information such as the brand and model of an electronic device can also be associated with information about the processor set in the electronic device and information about the capabilities of the processor, in some embodiments, the electronic device may not send the above-mentioned processor information and information about the capabilities of the processor to the push server, but instead send device information such as the brand and model of the electronic device that is associated with the above-mentioned information to the push server, so that the push server can determine information about the processor set in the electronic device and information about the capabilities of the processor based on the above-mentioned device information.
[0360] In some embodiments, the push server determines the target server for push messages based on information about the processor set in the electronic device and information about the capabilities of the processor. Specifically, the method for determining the target server for push messages in the aforementioned electronic device can be used.
[0361] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program. When the computer-readable storage medium is run on a computer, the computer executes the method provided by the embodiment of the present application.
[0362] An embodiment of the present application also provides a computer program product, which includes a computer program. When the computer program product is run on a computer, it enables the computer to execute the method provided by the embodiment of the present application.
[0363] In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can represent: a, b, c, a and b, a and c, b and c or a and b and c, where a, b, c can be single or multiple.
[0364] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented using a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0365] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0366] In the several embodiments provided in this application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of this application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory; hereinafter referred to as: ROM), random access memory (Random Access Memory; hereinafter referred to as: RAM), magnetic disk or optical disk, and other media that can store program code.
[0367] The above description is merely a specific embodiment of the present application. Any person skilled in the art may easily conceive of variations or substitutions within the technical scope disclosed in this application, and such variations or substitutions shall be within the scope of protection of this application. The scope of protection of this application shall be subject to the scope of protection of the claims.
Claims
1. A method for processing push messages applied to an electronic device, wherein the electronic device comprises a main processor and a coprocessor, and the method includes receiving a push message by the coprocessor; and processing the push message by the coprocessor; or sending the push message by the coprocessor to the main processor, so that the main processor processes the push message.
2. The method according to claim 1, characterized in that it further includes determining by the coprocessor the target processor from the main processor and the coprocessor based on the push message.
3. The method according to claim 2, characterized in that the push message contains a first identifier, and the coprocessor determining the target processor from the main processor and the coprocessor based on the push message includes the coprocessor determining the target processor based on the first identifier.
4. The method according to paragraph 3, characterized in that the coprocessor determining the target processor based on the first identifier includes determining, by the coprocessor, based on the first identifier, a capability associated with the push message; and determining the target processor based on the capability associated with the push message.
5. The method according to paragraph 2, characterized in that the coprocessor determining the target processor from the main processor and the coprocessor based on the push message includes parsing the push message by the coprocessor to determine a capability associated with the push message; and determining the target processor based on the capability associated with the push message.
6. The method according to paragraph 5, characterized in that the coprocessor parsing the push message to determine the capability associated with the push message includes parsing the push message by the coprocessor to determine the hardware associated with the push message; and Determining the target processor based on the capability associated with the push message includes: determining the target processor based on the hardware associated with the push message.
7. The method of claim 6, wherein determining the target processor based on hardware associated with the push message includes determining the target processor based on whether hardware connected to the target processor contains hardware associated with the push message.
8. The method according to claim 5, characterized in that the coprocessor parsing the push message to determine a capability associated with the push message includes the coprocessor determining, based on a keyword contained in the push message, a capability associated with the push message.
9. The method according to any one of paragraphs 5-8, characterized in that it further includes storing in the coprocessor a correspondence relationship between the capability and the processor.
10. The method according to any one of paragraphs 1-9, characterized in that the main processor is an AP, and / or the coprocessor is an MCU.
11. A method for processing push messages applied to an electronic device, wherein the electronic device comprises a main processor and a coprocessor, and the method includes receiving a push message; and sending a push message to a coprocessor so that the coprocessor processes the push message; or sending a push message to the main processor so that the main processor processes the push message.
12. The method according to claim 11, characterized in that it further includes determining the target processor from the main processor and the coprocessor based on the push message.
13. The method according to claim 12, characterized in that the push message contains a first identifier, and determining the target processor from the main processor and the coprocessor based on the push message includes determining the target processor based on the first identifier.
14. The method according to claim 13, characterized in that determining the target processor based on the first identifier includes determining, based on the first identifier, a capability associated with the push message; and determining the target processor based on the capability associated with the push message.
15. The method according to claim 14, characterized in that determining based on the first identifier of a capability associated with the push message includes determining based on the first identifier of hardware associated with the push message.
16. The method of claim 15, wherein determining the target processor based on the capability associated with the push message includes determining the target processor based on whether hardware connected to the target processor contains hardware associated with the push message.
17. The method according to any one of paragraphs 11-16, characterized in that the main processor is an AP and / or the coprocessor is an MCU.
18. An electronic device comprising a main processor, a coprocessor, and a memory device, wherein one or more computer programs are stored in the memory device, and the one or more computer programs comprise instructions; and when the instructions are executed by the coprocessor, the electronic device has the ability to perform the method according to any one of paragraphs 1-10.
19. An electronic device comprising a main processor, a coprocessor, a routing processor, and a memory device, wherein one or more computer programs are stored in the memory device, and the one or more computer programs comprise instructions; and when the instructions are executed by the routing processor, the electronic device has the ability to perform the method according to any one of paragraphs 11-17.
20. A machine-readable storage medium, wherein the machine-readable storage medium stores a computer program; and when executing the computer program on a computer, the computer has the capability of performing the method according to any one of paragraphs 1-17.
21. A microcircuit system, wherein the microcircuit system comprises a processor, the processor is connected to a storage device, and the processor executes a computer program stored in the storage device for implementing the method according to any one of paragraphs 1-17.