Method for processing push message and electronic equipment

By writing push messages into synchronous data files when the application is not running, and using the mapping path for cross-process access, the increase in power consumption caused by waking up the application process in the prior art is solved, and the timely delivery of push messages and user experience is achieved.

CN120238568APending Publication Date: 2025-07-01HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410041871.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-12-29
Filing Date
2024-01-10
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In the prior art, in order to ensure that the application of the electronic device receives push messages in a timely manner, it is necessary to wake up the application process, resulting in an increase in power consumption and affecting the device battery life and user experience.

Method used

By writing push messages to the synchronization data file when the application is not running, and synchronizing through mapping paths without the participation of the application process, ensuring message timeliness and no power consumption is increased.

Benefits of technology

It realizes the rapid synchronous push of messages without waking up the application process, ensuring timely delivery of messages without adding additional power consumption, and improving user experience and security.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120238568A_ABST
    Figure CN120238568A_ABST
Patent Text Reader

Abstract

The invention provides a method for processing a push message and electronic equipment, the method is applied to the electronic equipment, and the method comprises the following steps: receiving a first push message, the first push message is associated with a first application program, and the first application program is not operated; writing the first push message into a first synchronous data file of the first application program; and starting the first application program, wherein the first application program obtains the first push message from the first synchronous data file. In the embodiment of the invention, when the first application program does not run, the push message can be written into the synchronous data file through the synchronous manager, and the process of writing the push message does not need the participation of the process of the application program, so that the timeliness of the push message is ensured, additional power consumption is not increased, and the user experience is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electronic devices, and more specifically, to a method for processing push messages and an electronic device. Background Art

[0002] With the progress and development of technology, most application programs in electronic devices provide a message push function, such as the hot news recommendation of news application programs, the chat message reminder of chat application programs, etc. These messages can be collectively referred to as push messages. Push messages play an important role in improving the activity of application programs, increasing the usage rate of functional modules, enhancing user stickiness, and improving user retention rate. Currently, in order for application programs in electronic devices to receive push messages in a timely manner, it is necessary to ensure that the process of the application program is alive. When the process of the application program is not alive, it is first necessary to wake up the process of the application program, and then push the message to the application program. However, waking up the process of the application program consumes a large amount of power. When the electronic device receives a large number of push messages and the process of the application program corresponding to the push message is not alive, it is necessary to wake up the corresponding processes one by one, which will increase the power consumption wake-up of the electronic device, thereby reducing the battery life of the electronic device and resulting in a decline in the user experience. Based on this, how to synchronize push messages without waking up the process of the application program has become a technical problem to be solved urgently. Summary of the Invention

[0003] This application provides a method for processing push messages and an electronic device, which can synchronize push messages to the application program without waking up the process of the application program, ensuring the timeliness of push messages and not increasing additional power consumption, which helps to improve the user experience.

[0004] In a first aspect, a method for processing push messages is provided. The method is applied to an electronic device and includes: receiving a first push message, where the first push message is associated with a first application program and the first application program is not running; writing the first push message into a first synchronization data file of the first application program; starting the first application program, and the first application program obtains the first push message from the first synchronization data file.

[0005] In an embodiment of this application, when the first application program is not running, the push message can be written into the synchronization data file through a synchronization manager. The process of writing the push message does not require the participation of the process of the application program, ensuring the timeliness of the push message and not increasing additional power consumption, which helps to improve the user experience.

[0006] In addition, since the push message has been synchronized to the synchronization data file of the application program, when the application program is started, the application program can directly obtain the push message from the synchronization data file, improving the speed at which the application program obtains the push message.

[0007] In combination with the first aspect, in certain implementations of the first aspect, writing the first push message into the first synchronization data file of the first application includes: writing the first push message into the first synchronization data file through the first mapping path, where the first mapping path is a path for cross-process access to the first synchronization data file of the first application, the first mapping path is different from the actual path of the first synchronization data file, and the first synchronization data file is used to store push messages.

[0008] In the embodiments of the present application, the synchronization data file in the application sandbox is mapped, so that push messages can be written into the synchronization data file through the mapping path of the synchronization data file.

[0009] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: receiving a second push message, where the second push message is associated with a second application and the second application is running; sending the second push message to the second application through an Inter-Process Communication (IPC) mechanism.

[0010] In the embodiments of the present application, different methods for processing push messages can be adopted according to whether the application is running, which maximally ensures the delivery of push messages and helps improve the user experience.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: identifying the authorization information of the first application; and writing the first push message into the first synchronization data file of the first application includes: determining that the authorization information indicates that the first synchronization data file can be accessed, and writing the first push message into the first synchronization data file of the first application.

[0012] In the embodiments of the present application, a permission management mechanism is also introduced, which can manage the permissions for cross-process access to the synchronization data files of applications, avoid malicious access, and improve security.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: detecting whether the first push message meets a preset condition; and writing the first push message into the first synchronization data file of the first application includes: determining that the preset condition is met, and writing the first push message into the first synchronization data file.

[0014] In combination with the first aspect, in certain implementations of the first aspect, the preset condition includes one or more of the following: the type of the first push message is a preset type; the scenario corresponding to the first push message is a background push scenario.

[0015] In combination with the first aspect, in certain implementations of the first aspect, the preset type includes one or more of the following: notification message type, instant messaging (IM) message type, and configuration data message type.

[0016] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: displaying the first push message.

[0017] In a second aspect, an electronic device according to an embodiment of the present application includes modules / units that execute the method according to the above aspect or any possible design of the above aspect; these modules / units can be implemented by hardware or by hardware executing corresponding software.

[0018] In a third aspect, a chip according to an embodiment of the present application is coupled to a memory in an electronic device and is configured to call a computer program stored in the memory and execute the technical solutions according to the above aspect and any possible design of the above aspect in the embodiment of the present application; in the embodiment of the present application, "coupled" means that two components are directly or indirectly combined with each other.

[0019] In a fourth aspect, an electronic device according to an embodiment of the present application includes one or more processors; one or more memories; the one or more memories store one or more computer programs, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the above aspect or any possible implementation of the above aspect to be executed.

[0020] In a fifth aspect, a computer-readable storage medium is provided, which includes a computer program or instructions that, when the computer program or instructions are run on a computer, cause the first aspect and any possible method of implementing the first aspect to be executed.

[0021] In a sixth aspect, a computer program product is provided, which includes a computer program or instructions that, when the computer program or instructions are run on a computer, cause the first aspect and any possible method of implementing the first aspect to be executed.

[0022] In a seventh aspect, a computer program is provided, which, when run on a computer, causes the method according to the first aspect and any possible implementation thereof to be executed.

[0023] For the beneficial effects of the second to seventh aspects, please refer to the beneficial effects of the first to third aspects and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0024] Figure 1 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.

[0025] Figure 2 It is a software structure block diagram of the electronic device according to an embodiment of the present application.

[0026] Figure 3 It is a schematic diagram of the sandbox provided by an embodiment of the present application.

[0027] Figure 4 It is a schematic flowchart of a method for processing push messages.

[0028] Figure 5 It is a schematic flowchart of the method for processing push messages provided by an embodiment of the present application.

[0029] Figure 6 It is a schematic flowchart of the method for processing push messages provided by an embodiment of the present application.

[0030] Figure 7 It is a set of GUIs provided by an embodiment of the present application. Detailed implementation manners

[0031] The terms used in the following embodiments are only for the purpose of describing specific embodiments, and are not intended to limit the present application. As used in the specification and claims of the present application, the singular forms "a", "an", "the", "above-mentioned", "said", and "this" are also intended to include expressions such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more than two. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects before and after.

[0032] Referring to "one embodiment" or "some embodiments" described in this specification means that specific features, structures, or characteristics described in conjunction with the embodiment are included in one or more embodiments of the present application. Thus, the statements "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "include", "comprise", "have" and their variants all mean "including but not limited to", unless otherwise specifically emphasized in other ways.

[0033] The following describes an electronic device, a user interface for such an electronic device, and examples of using such an electronic device. In some embodiments, the electronic device may be a personal computer (PC), such as a laptop computer or a desktop computer. The operating systems installed on the PC include, but are not limited to, desktop operating systems such as Windows, Linux, and MacOS, and may also be future desktop operating systems.

[0034] Exemplarily, Figure 1 A schematic structural diagram of the electronic device 100 is shown. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, 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, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, a headphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display screen 194, and a subscriber identification module (SIM) card interface 195, etc. Among them, the sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, a barometric pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.

[0035] It can be understood that the structure illustrated in the embodiments of the present application 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 those shown, or combine certain components, or split certain components, or have different component arrangements. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.

[0036] 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 memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors.

[0037] Among them, the controller may be the nerve center and command center of the electronic device 100. The controller may generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching and executing instructions.

[0038] A memory may also be provided in the processor 110 for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. This memory may save the instructions or data that the processor 110 has just used or recycled. If the processor 110 needs to use the instruction or data again, it can directly call it from the memory. This avoids repeated accesses, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0039] 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, etc.

[0040] The wireless communication function of the electronic device 100 can be implemented by antenna 1, antenna 2, mobile communication module 150, wireless communication module 160, modulation and demodulation processor, baseband processor, etc.

[0041] The display screen 194 is used to display images, videos, etc. The display screen 194 includes a display panel. The display panel can adopt a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a Miniled, a MicroLed, a Micro-oLed, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device 100 may include one or N display screens 194, where N is a positive integer greater than 1.

[0042] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 through the external memory interface 120 to implement the data storage function. For example, files such as music and videos are saved in the external memory card.

[0043] The internal memory 121 can be used to store computer-executable program codes, and the executable program codes include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.). The data storage area can store data created during the use of the electronic device 100 (such as audio data, phone book, 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.

[0044] Figure 2It is a software structure block diagram of the electronic device 100 according to 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. In some embodiments, the Android system is divided into four layers, from top to bottom, namely the application layer, the application framework and service layer, the Android runtime, and the system library, and the kernel layer. The application layer may include a series of application packages.

[0045] As Figure 2 shown, the application layer may include a camera, settings, third-party applications, etc. Among them, the third-party applications may include a gallery, a calendar, a call, a map, a navigation, a WLAN, a Bluetooth, music, a video, a short message, etc.

[0046] The application framework layer provides application programming interfaces (APIs) and programming frameworks for the applications in the application layer. The application framework layer may include some predefined functions.

[0047] As Figure 2 shown, the application framework and service layer may include a window manager, a content provider, a view system, a telephone manager, a resource manager, a notification manager, etc.

[0048] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc. The content provider is used to store and obtain data, and make this data accessible to applications. The data may include videos, images, audio, incoming and outgoing calls, browsing history and bookmarks, phone books, etc.

[0049] The view system includes visible controls, such as controls for displaying text, controls for displaying pictures, etc., such as the indication information for prompting the virtual shutter key in the embodiment of the present application. The view system can be used to build applications. The display interface can be composed of one or more views. For example, a display interface including a short message notification icon may include a view for displaying text and a view for displaying pictures.

[0050] The telephone manager is used to provide the communication function of the electronic device 100. For example, the management of call states (including answering, hanging up, etc.).

[0051] The notification manager enables an application to display notification information in the status bar. It can be used to convey messages of the notification type, and can disappear automatically after a short stay without user interaction. For example, the notification manager is used to inform that a download is completed, a message reminder, etc. The notification manager can also be a notification that appears in the system top status bar in the form of a graph or a scroll bar text, such as a notification of a background running application, or a notification that appears on the screen in the form of a dialogue window. For example, it prompts text information in the status bar, emits a prompt tone, the electronic device vibrates, the indicator light flashes, etc.

[0052] The push manager is used to receive push messages sent by a push server or an application server. The push manager can also be referred to as a push client or a push service.

[0053] The synchronization manager is used to identify the authorization information of an application. The authorization information is used to indicate that synchronized data files can be accessed across processes. The synchronized data files are application files that store push messages. The synchronization manager is also used to map the synchronized data files according to the authorization information and manage the permissions for accessing the synchronized data files across processes. In other words, the synchronization manager can determine whether to allow the push manager to access the synchronized data files. The push manager accessing the synchronized data files can be understood as the push manager writing data to the synchronized data files or reading data from the synchronized data files. The synchronization manager can also be referred to as a synchronization service.

[0054] For example, application #1 authorizes the push manager to access synchronized data file #1, and application #2 does not authorize the push manager to access synchronized data file #2. When the synchronization manager receives a push message sent by the push manager to application #1, since application #1 authorizes the push manager to access synchronized data file #1, the push message can be written to synchronized data file #1 through the inter process communication (IPC) mechanism. When the synchronization manager receives a push message sent by the push manager to application #2, since application #2 does not authorize the push manager to access synchronized data file #2, writing the push message to synchronized data file #2 will be prohibited.

[0055] It should be noted that for a detailed description of the push manager and the synchronization manager, please refer to the following text and will not be elaborated here.

[0056] Android runtime includes core libraries and a virtual machine. Android runtime is responsible for the scheduling and management of the Android system.

[0057] The core libraries include two parts: one part is the functional functions that need to be called by the Java language, and the other part is the core libraries of Android.

[0058] The application layer and the application framework layer run in the virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, security and exception management, and garbage collection.

[0059] The system libraries can include multiple functional modules. For example: surface manager, media libraries, 3D graphics processing libraries (such as OpenGL ES), 2D graphics engines (such as SGL), etc.

[0060] The surface manager is used to manage the display subsystem and provides the fusion of 2D and 3D layers for multiple applications.

[0061] The media libraries support the playback and recording of various common audio and video formats, as well as static image files, etc. The media libraries can support multiple audio and video coding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0062] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, synthesis, and layer processing, etc.

[0063] The 2D graphics engine is a drawing engine for 2D drawing.

[0064] The kernel layer is the layer between the hardware and the software. The kernel layer at least includes a display driver, a camera driver, an audio driver, and a sensor driver.

[0065] The hardware layer can include various sensors, such as Figure 1 the various sensors introduced in , the acceleration sensor, the gyroscope sensor, the touch sensor, etc. involved in the embodiments of the present application.

[0066] It should be noted that Figure 2 only the framework of the Android system is taken as an example in , and it should not be construed as a specific limitation on the embodiments of the present application. In the embodiments of the present application, the electronic device can also be equipped with other operating systems (for example, HarmonyOS). For different operating systems, there can be different frameworks. It can be understood that when different frameworks are adopted, the specific names of the layers of the framework can be different.

[0067] To facilitate the understanding of the embodiments of the present application, the concepts that the embodiments of the present application may involve are first introduced:

[0068] Process: The running entity of an application. An application is a description of instructions, data, and their organizational forms, and a process is the running entity of an application.

[0069] Application files: The file owner is the application, including application installation files, application resource files, application cache files, etc. The data used and stored by applications on an electronic device is saved in a dedicated directory of an application in the form of files, key-value pairs, databases, etc. This dedicated directory can be called the application file directory. All data under this directory is stored in different file formats, and these files are called application files. The push messages of the application are stored in the application files.

[0070] Sandbox: Also known as a sand box, it is a security mechanism used to provide an isolated environment for applications. It can separate different applications and protect applications from attacks by malicious applications. Each application corresponds to a user identification (UID). The electronic device can set up a sandbox based on this UID and place the application in the sandbox to achieve isolation between applications. In other words, each application runs in its own independent process space, and applications with different UIDs are naturally isolated from resources. For each application, the system maps out a dedicated application sandbox directory in the internal storage space. It is a collection composed of the application file directory and the directory where a small number of system files (a small number of system files required for the application to run) are located. The sandbox limits the minimum scope of data visible to the application. In the application sandbox directory, the application can only see its own application files and a small number of system files. Therefore, the files of this application are not visible to other applications either, thus protecting the security of the application files.

[0071] As Figure 3 shown, application process #1 runs in sandbox #1, and application process #2 runs in sandbox #2. Among them, application process #1 corresponds to application #1, and application process #2 corresponds to application #2. Application process #1 can directly access the application files of application #1 in sandbox #1, but cannot access the application files of application #2 in sandbox #2.

[0072] Push message: It is a message actively pushed by the operating system or application to the user. The user can see the push message on the lock screen interface, notification bar, application interface, etc. of the electronic device. Currently, the common method for an application to send a push message to the user is that the application's server sends the push message to the push server, and then the push server sends it to the user's electronic device, or the application's server directly sends the push message to the user.

[0073] The following combines Figure 4 to introduce a method for processing push messages.

[0074] Figure 4The schematic flowchart of a method for processing push messages is shown, as Figure 4 shown. The method 400 includes:

[0075] S401, the application server #1 sends push message #1 to the push server.

[0076] Correspondingly, the push server receives push message #1 sent by the application server #1.

[0077] Among them, the push server can be provided by the manufacturer of the electronic device, or can also be provided by the operating system provider of the electronic device. The application server #1 is the server corresponding to application #1, and push message #1 is the push message sent to application #1. When the application server sends push message #1 to the push server, it can also indicate the token of the electronic device. The tokens of different electronic devices are different, and thus accurate push can be achieved.

[0078] S402, the push server sends push message #1 to the push manager.

[0079] Correspondingly, the push manager receives push message #1 sent by the push server.

[0080] The electronic device includes a push manager, which is connected to the push server. Therefore, after the push server receives push message #1 sent by the application server #1, it can send push message #1 to the push manager of the electronic device corresponding to the token according to the token. The push manager can also be called a push client, that is, the client used to receive the push message sent by the push server.

[0081] S403, the push manager detects whether the process of application #1 is alive.

[0082] The push manager can detect whether the process of application #1 is alive. When it is determined that the process of application #1 is alive, S404 is performed. When it is determined that the process of application #1 is not alive, S405 is performed.

[0083] It should be noted that the push manager detecting whether the process of application #1 is alive can also be understood as the push manager detecting whether application #1 is running. When application #1 is running, the process of application #1 is alive. When application #1 is not running, the process of application #1 is not alive. The process of application #1 can be the main process of application #1.

[0084] It should also be noted that application #1 being running can include running in the foreground and running in the background.

[0085] S404, the push manager sends push message #1 to application #1.

[0086] Correspondingly, application #1 receives push message #1 sent by the push manager.

[0087] The push manager determines that the process of application #1 is alive and can send push message #1 to application #1 through mechanisms such as cross-process communication.

[0088] S405, after the push manager wakes up the process of application #1, it sends push message #1 to application #1.

[0089] Since the push manager determines that the process of application #1 is not alive and sending push message #1 to application #1 depends on the cross-process communication mechanism, it is necessary to wake up the process of application #1 and then send push message #1 to application #1 through mechanisms such as cross-process communication.

[0090] In the method 400 shown above Figure 4 when the process of application #1 is not alive, the push manager needs to wake up the process of application #1 first and then send push message #1 to application #1. However, the power consumption of the push manager waking up the process of application #1 is relatively large. If the push server or the application server sends multiple push messages to the push manager and the processes of the applications corresponding to these multiple push messages are not alive, then it is necessary to wake up the processes of the corresponding applications one by one, which will consume a large amount of power, reduce the battery life of the electronic device, and also lead to a decline in the user experience.

[0091] In summary, how to quickly synchronize push messages to applications has become a technical problem to be solved urgently. Based on this, a method for processing push messages provided by an embodiment of the present application can quickly synchronize push messages to an application without waking up the application even if the process of the application is not alive, which not only ensures the timely delivery of push messages but also does not increase additional power consumption. The following will be combined with Figure 5 for a detailed introduction.

[0092] Figure 5 shows a schematic flowchart of a method for processing push messages provided by an embodiment of the present application. This method is executed by an application server, a push server, and an electronic device. Among them, the electronic device includes a push manager, a synchronization manager, and application #1. As Figure 5 shown, the 500 includes:

[0093] S501, the synchronization manager identifies the authorization information of application #1.

[0094] Specifically, Application #1 can store authorization information in a specific description file. This authorization information is used to indicate that a synchronization data file can be authorized to the push manager. The synchronization data file is used to store push messages and is an application file stored in the sandbox corresponding to Application #1. That the synchronization data file can be authorized to the push manager can be understood as that the push manager can access the synchronization data file across processes, that is, it can write data to the synchronization data file and / or read data in the synchronization data file. Therefore, when the electronic device successfully installs Application #1, the synchronization manager can identify the authorization information of Application #1, or when the electronic device successfully installs Application #1 and runs Application #1 for the first time, the synchronization manager can identify the authorization information of Application #1.

[0095] In some embodiments, the authorization information is also used to indicate operation permissions.

[0096] For example, if the authorization information indicates that write permission can be authorized to the push manager, the push manager can write push messages to the synchronization data file through the synchronization manager. However, since read permission is not authorized to the push manager, the push manager cannot read the push messages in the synchronization data file through the synchronization manager.

[0097] For another example, if the authorization information indicates that write permission and read permission can be authorized to the push manager, the push manager can not only write push messages to the synchronization data file through the synchronization manager, but also read the push messages in the synchronization data file through the synchronization manager.

[0098] S502. The synchronization manager maps the synchronization data file according to the authorization information of Application #1.

[0099] Specifically, if the synchronization manager determines according to the authorization information that the synchronization data file of Application #1 can be authorized to the push manager, the synchronization manager can map the synchronization data file to manage the permissions for accessing the synchronization data file across processes.

[0100] It should be noted that the actual path of the synchronization data file of Application #1 will correspond to a mapped path #1, which is the path for accessing the synchronization data file of Application #1 across processes.

[0101] For example, the actual path of the synchronized data file of application #1 is: / data / app / <UID#1> / <bundleName#1> / file.db, where UID#1 is the UID corresponding to application#1, bundleName#1 is the package name corresponding to application#1, and the mapping path of the synchronization data file of application#1 is dataproxy: / / <bundleName#1> / file.db.

[0102] It is understandable that, since the synchronization manager maps the synchronization data file of application #1, the push manager can write the push message into the synchronization data file of application #1 through the mapping path #1 and after authorization by the synchronization manager.

[0103] In the embodiment of the present application, the mapping path of the synchronization data file of the application can be determined in a variety of ways, and the embodiment of the present application does not specifically limit this. The following is an exemplary introduction to several possible implementation methods.

[0104] In a first possible implementation, the mapping path is pre-set. The operating system provider provides a preset rule, and the application developer can declare the mapping path of the synchronization data file according to the preset rule, so that after the application is successfully installed, the synchronization manager can determine the mapping path of the synchronization data file of the application.

[0105] It is understandable that in this manner, the push manager can also determine the mapping path of the synchronization data file of the application.

[0106] It is also understandable that the mapping paths corresponding to different applications are different.

[0107] In a second possible implementation, the mapping path is generated by the synchronization manager. In this implementation, the synchronization manager can generate different mapping paths for synchronization data files of different applications.

[0108] For example, the synchronization manager can generate different mapping paths based on the package names of different applications.

[0109] For another example, the synchronization manager may generate different mapping paths according to the UIDs of different applications.

[0110] In this way, the synchronization manager can also synchronize the generated mapping path to the push manager.

[0111] The third possible implementation method is that when the application server sends a push message to the push server, it can synchronously send the mapping path, and then the push server forwards the push message and the mapping path to the push manager. In other words, in this method, it is the application server that specifies the push manager to write the push message to the synchronization data file according to the mapping path it sends.

[0112] The fourth possible implementation method is that when the push server forwards the push message, it can also send the mapping path. It should be noted that the difference between the fourth possible implementation method and the third possible implementation method is that the push server manages the mapping path of each application. When the push server receives the push message sent by the application, it can determine the application corresponding to the push message, and then can send the mapping path corresponding to the application when forwarding the push message.

[0113] The fifth possible implementation method is that when the application server sends a push message to the push manager, it can synchronously send the mapping path.

[0114] It should be noted that in the above text, the mapping path of the synchronization data file and the actual path of the synchronization data file are associated as an example, but the embodiments of the present application do not specifically limit this. For example, in some other embodiments, it can also be the identifier of the application (such as UID, package name, etc.) associated with the actual path of the synchronization data file, that is, the mapping relationship between the identifier of the application and the synchronization data file can be established according to any of the above possible implementation methods, and then the actual path of the synchronization data file can be determined through the identifier of the application.

[0115] S503. The application server #1 sends the push message #1 to the push server.

[0116] Correspondingly, the push server receives the push message #1 sent by the application server #1.

[0117] S504. The push server sends the push message #1 to the push manager.

[0118] Correspondingly, the push manager receives the push message #1 sent by the push server.

[0119] It should be understood that the descriptions of S503 and S504 can refer to the descriptions of S301 and S302 in the above text. For the sake of brevity, they will not be repeated here.

[0120] It should be noted that in the embodiments of the present application, only an example is given where the application server sends a push message to the push server, and then the push server sends the push manager. However, no specific limitation is made thereto. In other embodiments, the application server may be connected to the push manager, so that the application server can directly send a push message to the push manager.

[0121] S505, the push manager writes the push message #1 to the synchronization data file through the synchronization manager.

[0122] Specifically, after receiving the push message #1, the push manager can determine that the push message #1 is the push message corresponding to the application #1. Furthermore, the push manager can write the push message #1 to the synchronization data file according to the mapping path #1 through the interface of the synchronization manager. In the above process, the synchronization manager will verify whether the push manager is allowed to write data to the synchronization data file. After the verification passes, the push message #1 will be written to the synchronization data file of the application #1 according to the mapping path #1.

[0123] It can be understood that in the above process of writing the push message #1 to the synchronization data file of the application #1, it is written through the mapping path, and the actual path (or called the real path) of the synchronization data file of the application #1 will not be exposed. Moreover, the synchronization manager will also verify the permission of the process of writing data to the synchronization data file, which can fully ensure that the synchronization data file of the application #1 will not be maliciously accessed.

[0124] In the embodiments of the present application, no specific limitation is made to the identifier of the application #1. For example, the identifier of the application #1 may be the package name of the application #1.

[0125] For another example, the identifier of the application #1 may be the UID of the application #1.

[0126] For another example, a new parameter can be defined to identify different applications.

[0127] In other embodiments, when the push manager inputs data through the interface of the synchronization manager, it may not input the mapping path #1 either. Instead, the synchronization manager determines the mapping path #1 according to the identifier of the application #1, and then the synchronization manager will verify whether the push manager is allowed to write data to the synchronization data file #1. After the verification passes, the push message #1 will be written to the synchronization data file of the application #1 according to the mapping path #1.

[0128] For example, the unified format of the mapping path of the application is: dataproxy: / / <bundlename> / file.db, when the synchronization manager determines the package name of Application #1, it can determine the corresponding mapping path #1 of Application #1 according to this unified format.

[0129] In the embodiments of the present application, the synchronization data files in the application sandbox are mapped, so that the push manager can write the push message into the synchronization data file through the mapping path of the synchronization data file. The process of writing the push message does not require the participation of the application process. Therefore, even if the application process is not alive, the push manager can synchronize the push message to the application, ensuring the timeliness of the push message and not increasing the additional power consumption, which helps to improve the user experience. At the same time, a synchronization manager is introduced. Through the synchronization manager, the permission to access the synchronization data file of the application across processes can be managed, avoiding malicious access and improving security.

[0130] Optionally, in some embodiments, as Figure 5 shown, the method 500 further includes:

[0131] S506, the push manager sends the push message #1 to the notification manager.

[0132] Correspondingly, the notification manager receives the push message #1 sent by the push manager.

[0133] After receiving the push message #1, the notification manager can display the push message #1. The present application does not specifically limit the form of displaying the push message #1. For example, it can appear in the system top status bar in the form of a chart or a scroll bar text. For another example, it can also appear on the screen in the form of a dialogue window.

[0134] Optionally, in some embodiments, as Figure 5 shown, before the push manager executes S505, the method 500 further includes:

[0135] S507, the push manager determines whether the push message #1 meets the preset conditions.

[0136] Before writing the push message #1 into the synchronization data file through the synchronization manager, the push manager can first determine whether the push message #1 meets the preset conditions. When it is determined that the preset conditions are met, it can write the push message #1 into the synchronization data file through the synchronization manager, that is, execute S505. When it is determined that the preset conditions are not met, the synchronization process ends.

[0137] In some embodiments, the preset condition is that the type of the push message #1 is a preset type.

[0138] The push manager can execute S505 when it determines that the type of the push message #1 is the preset type.

[0139] Push messages can be divided into different types. For example, types such as instant messaging (IM) type, news and information message type, operation and sales message type, personalized recommendation message type, system notification message type, notification message type, configuration data message type, etc. One or more types can be preset. When the push message is one of the preset one or more types, the push manager can execute S505.

[0140] Exemplarily, the preset type can be the notification message type.

[0141] For example, Application #1 is a social application. The push manager determines that the type of push message #1 is the notification message type, and this push message #1 is used to prompt the user that the login has expired. Then the push manager can write the push information #1 into the synchronization data file of the social application through mapping path #1.

[0142] Exemplarily, the preset type can be the IM message type.

[0143] For example, Application #1 is a social application. When the push manager determines that the type of push message #1 is the IM message type, the push manager can write the push information #1 into the synchronization data file of this social application through mapping path #1. Thus, when starting this social application, this social application can directly obtain this IM message quickly from the synchronization data file, improving the speed of obtaining push messages.

[0144] Exemplarily, push message #1 is of the configuration data message type.

[0145] The push manager determines that the type of push message #1 is the configuration data message type. Then the push manager can write the push information #1 into the synchronization data file of the application corresponding to push information #1 through mapping path #1. Thus, when starting this application, this application can directly obtain push information #1 quickly from the synchronization data file to update the configuration data.

[0146] In some embodiments, the preset condition is that the scenario of push message #1 is a background push scenario.

[0147] When the application server sends a push message, it can specify whether the push message is a foreground push or a background push. A foreground push can be understood as pushing the message to the application when the application is running in the foreground, and a background push can be understood as pushing the message to the application when the application is running in the background or not running at all. Therefore, it can be preset that when the scenario corresponding to the push message is a background push, the push manager can execute S505. The push message pushed to the application in the background can be understood as a push message that requires the application itself to process and does not need to be displayed to the user. For example, a push message for updating the interface layout, a push message for updating the application configuration. In some embodiments, the preset condition is that the process of Application #1 associated with Push Message #1 is not alive.

[0148] The push manager can determine that when it is determined that the process of Application #1 associated with Push Message #1 is not alive, it executes S505. Conversely, when it is determined that the process of Application #1 is alive, the push message #1 can be sent to Application #1 through mechanisms such as cross-process communication according to the method shown in Figure 4 as shown.

[0149] It should be noted that Figure 5 the cross-process access to synchronize the data file in the method shown in is different from the cross-process communication mechanism in the method shown in Figure 4 The cross-process communication mechanism means that the sending process copies the data to the kernel space through a system call, and then the kernel copies the data in the kernel space to the application file of the receiving process through a system call. Cross-process access to synchronize the data file means writing data directly to the synchronized data file through a mapped path, and the receiving process is not involved during the data writing process.

[0150] Alternatively, in some other embodiments, the synchronization manager can determine whether Push Message #1 meets the preset condition.

[0151] In these embodiments, when the synchronization manager verifies the permissions of the push manager, it can also determine whether Push Message #1 meets the preset condition. When it is determined that Push Message #1 meets the preset condition, Push Message #1 will be written to the synchronized data file of Application #1 according to Mapped Path #1.

[0152] In some embodiments, when Application #1 is started in response to a user operation, Application #1 can obtain Push Message #1 from the synchronized data file.

[0153] In the embodiments of the present application, since the push message has been synchronized to the synchronized data file of the application, when the application is started, the application can directly obtain the push message from the synchronized data file, which improves the speed at which the application obtains the push message.

[0154] In the above embodiments, the push message synchronized by the method provided in the embodiments of the present application may be a push message that does not require the application to process immediately. On the contrary, when the push message is a push message that requires the application to process immediately, it may be sent to the application through the IPC mechanism after waking up the process of the application by the method shown in Figure 4 or after synchronously pushing the message by the method provided in the embodiments of the present application, then waking up the process of the application.

[0155] For example, the push message is a voice over internet protocol (VoIP) message based on IP, and this VoIP message is a message that requires the application to process immediately.

[0156] For another example, the push message is a location message, and this location message is a message that requires the application to process immediately.

[0157] In the above, the method for processing push messages provided in the embodiments of the present application is introduced with each module as the main body. The division of the modules above is only a logical function division, and there may be other division methods in actual implementation. For example, in some other embodiments, the push manager and the synchronization manager may be combined into a new module, and this new module is used to instruct the operations performed by the push manager and the synchronization manager above. Below, the method for processing push messages provided in the embodiments of the present application will be introduced with the electronic device as the main body.

[0158] Figure 6 shows a schematic flowchart of the method for processing push messages provided in the embodiments of the present application. As shown in Figure 6 shown, this method 600 includes:

[0159] S601, receive a first push message.

[0160] In some embodiments, the electronic device may receive the first push message sent by the push server, where the push server may be provided by the manufacturer of the electronic device, or may also be provided by the operating system provider of the electronic device, or may also be a third-party push server.

[0161] In some embodiments, the electronic device may receive the first push message sent by the application server.

[0162] Among them, the first push message is associated with the first application, that is, the first push message is the push message of the first application, and the first application is not running, that is, the process of the first application does not exist.

[0163] S602, write the first push message into the first synchronization data file of the first application.

[0164] After the electronic device receives the first push message, the first push message can be written into the synchronization data file of the first application through the synchronization manager.

[0165] S603, start the first application, and the first application obtains the first push message from the first synchronization data file.

[0166] After the first push message is synchronized to the first synchronization data file of the first application, when the first application is started, the first application can obtain the first push message from the first synchronization data file.

[0167] In the embodiments of the present application, when the first application is not running, the push message can be written into the synchronization data file through the synchronization manager. The process of writing the push message does not require the participation of the application process, which ensures the timeliness of the push message and does not increase additional power consumption, helping to improve the user experience.

[0168] In addition, since the push message has been synchronized to the synchronization data file of the application, when the application is started, the application can directly obtain the push message from the synchronization data file, which improves the speed at which the application obtains the push message.

[0169] In some embodiments, S603 specifically includes: writing the first push message into the first synchronization data file through the first mapping path, where the first mapping path is a path for accessing the first synchronization data file of the first application, and the first mapping path is different from the actual path of the first synchronization data file, and the first synchronization data file is used to store the push message.

[0170] For example, the actual path of the first synchronization data file is: / data / app / <UID#1> / <bundleName#1> / file.db, where UID#1 is the UID corresponding to the first application, and bundleName#1 is the package name of the first application. The first mapping path is dataproxy: / / <bundleName#1> / file.db. It can be seen that the first mapping path is different from the actual path of the first synchronization data file.

[0171] In some embodiments, the first mapping path is preset.

[0172] In some embodiments, the first mapping path is generated by the synchronization manager of the electronic device.

[0173] In some embodiments, when the application server sends the first push message to the push server, the first mapping path can be synchronously sent, and then the push server forwards the first push message and the first mapping path to the electronic device.

[0174] In some embodiments, when the push server forwards the first push message, it may also send a first mapping path. It should be noted that in this method, the push server manages the mapping path of each application.

[0175] In some embodiments, when the application server sends the first push message to the push server, it may synchronously send a first mapping path, and then the push server forwards the first push message and the first mapping path to the electronic device.

[0176] In some embodiments, when the application server sends the first push message to the electronic device, it may synchronously send a first mapping path.

[0177] In some embodiments, the method 600 further includes:

[0178] Receiving a second push message, the second push message is associated with a second application, and the second application is running;

[0179] Sending the second push message to the second application through an Inter-Process Communication (IPC) mechanism.

[0180] When the electronic device receives the second push message of the running second application, it may send the second push message to the second application through the IPC mechanism.

[0181] In the embodiments of the present application, different methods for processing push messages may be adopted according to whether the application is running, providing multiple paths for synchronously pushing messages, ensuring the delivery of push messages to the greatest extent, and helping to improve the user experience.

[0182] In some embodiments, before the electronic device executes S603, the method 600 further includes: identifying the authorization information of the first application.

[0183] S603 specifically includes: determining that the authorization information indicates that the first synchronization data file can be accessed, and writing the first push message into the first synchronization data file.

[0184] Accessing the first synchronization data file may include writing data to the first synchronization data file, and may also include reading data from the first synchronization data file.

[0185] The first application stores authorization information. When the electronic device writes the first push message to the first synchronization data file, it needs to first verify whether it has the permission to write the first push message to the first synchronization data file. When it is determined that there is permission, the first push message can be written.

[0186] In the embodiments of the present application, a permission management mechanism is further introduced, which can manage the permissions for accessing the synchronized data files of the application across processes, avoiding malicious access and enhancing security.

[0187] In some embodiments, before the electronic device executes S603, the method 600 further includes: detecting whether a preset condition is satisfied.

[0188] S603 specifically includes: determining that the preset condition is satisfied and writing the first push message into the first synchronized data file.

[0189] When the electronic device writes the first push message into the first synchronized data file, it can first detect whether the first push message satisfies the preset condition through the push manager or synchronization management. When the preset condition is satisfied, the first push message is written into the first synchronized data file. In other words, not all push messages can be written into the synchronized data file according to the method for processing push messages provided in the embodiments of the present application.

[0190] In some embodiments, the preset condition includes one or more of the following: the type of the first push message is a preset type; the scenario corresponding to the first push message is a background push scenario.

[0191] In some embodiments, the preset type includes one or more of the following: notification message type, instant messaging IM message type, and configuration data message type.

[0192] In some embodiments, the method 600 further includes: displaying the first push message.

[0193] Figure 7 A set of graphical user interfaces (GUI) provided by the embodiments of the present application is shown.

[0194] As Figure 7 shown in (a) of [], the mobile phone receives a push message from "Huawei Music" to prompt the user that new songs are added every day. The mobile phone can display a notification bar 702 on the desktop 701, and "New Songs Every Day" is displayed in the notification bar 702.

[0195] In some embodiments, starting the first application may be: detecting an operation of the user on the first push message, and in response to the operation of the user on the first push message, starting the first application.

[0196] For example, as Figure 7 As shown in (a) and (b) therein, the mobile phone detects the user's operation of clicking on the notification bar 702. In response to this operation, the mobile phone displays the interface 703, and the interface 703 is the interface of "Huawei Music". This interface 703 may include information about newly added songs. It can be understood that the information about the newly added songs on the interface 703 is obtained by "Huawei Music" from its synchronization data file. Compared with the existing application programs that obtain push messages from the push manager through cross-process communication, the speed of obtaining push messages from the synchronization data file will be faster.

[0197] In the embodiments of the present application, since the push messages have been synchronized to the synchronization data file of the application program, when the application program is started, the application program can directly obtain the push messages from the synchronization data file, which improves the speed at which the application program obtains push messages.

[0198] The embodiments of the present application provide a computer program product. When the computer program product runs on an electronic device, it causes the electronic device to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those of the related embodiments of the above method, and will not be elaborated here.

[0199] The embodiments of the present application provide a readable storage medium. The readable storage medium contains instructions. When the instructions run on an electronic device, it causes the electronic device to execute the technical solutions of the above embodiments. Its implementation principle and technical effects are similar, and will not be elaborated here.

[0200] The embodiments of the present application provide a chip. The chip is used to execute instructions. When the chip runs, it executes the technical solutions in the above embodiments. Its implementation principle and technical effects are similar, and will not be elaborated here.

[0201] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or by a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the embodiments of the present application.

[0202] Those skilled in the art can 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 foregoing method embodiments, and will not be elaborated here.

[0203] In several embodiments provided in this application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of devices or units can be in electrical, mechanical, or other forms.

[0204] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0205] In addition, in each embodiment of this application, each functional unit can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0206] If the 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 the embodiments of this application, in essence, or the part that contributes to the prior art, or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in each embodiment of this application. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs that can store program codes.

[0207] As described above, it is only the specific implementation manners of the embodiments of this application, but the protection scope of the embodiments of this application is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the embodiments of this application, and all should be covered by the protection scope of the embodiments of this application. Therefore, the protection scope of the embodiments of this application should be subject to the protection scope of the claims.< / bundlename>

Claims

1. A method for processing a push message, characterized in that: The method is applied to an electronic device, and the method comprises: receiving a first push message, the first push message being associated with a first application, the first application being not running; Writing the first push message into a first synchronization data file of the first application; The first application is started, and the first application obtains the first push message from the first synchronization data file.

2. The method according to claim 1, characterized in that The step of writing the first push message into a first synchronization data file of the first application program includes: The first push message is written into the first synchronization data file through a first mapping path, wherein the first mapping path is a path for accessing the first synchronization data file of the first application, the first mapping path is different from an actual path of the first synchronization data file, and the first synchronization data file is used to store push messages.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: receiving a second push message, wherein the second push message is associated with a second application, and the second application is running; The second push message is sent to the second application via an inter-process communication (IPC) mechanism.

4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: identifying authorization information for the first application; The step of writing the first push message into a first synchronization data file of the first application program includes: It is determined that the authorization information indicates that the first synchronization data file can be accessed, and the first push message is written into the first synchronization data file of the first application.

5. The method according to any one of claims 1 to 4, characterized in that The method further comprises: Detecting whether the first push message meets a preset condition; The step of writing the first push message into a first synchronization data file of the first application program includes: Determine that the preset condition is met, and write the first push message into the first synchronization data file.

6. The method according to claim 5, characterized in that The preset conditions include one or more of the following: The type of the first push message is a preset type; The scenario corresponding to the first push message is a background push scenario.

7. The method according to claim 6, characterized in that The preset type includes one or more of the following: a notification message type, an instant messaging IM message type, and a configuration data message type.

8. The method according to any one of claims 1 to 7, characterized in that The method further comprises: The first push message is displayed.

9. An electronic device, characterized in that: The method comprises one or more processors; one or more memories; the one or more memories store one or more computer programs, the one or more computer programs include instructions, and when the instructions are executed by the one or more processors, the method according to any one of claims 1 to 8 is executed.

10. A chip, characterized in that: The chip includes a processor and a communication interface, wherein the communication interface is used to receive a signal and transmit the signal to the processor, and the processor processes the signal so that the method according to any one of claims 1 to 8 is executed.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and when the computer instructions are executed on a computer, the method according to any one of claims 1 to 8 is executed.

12. A computer program product, characterized in that When the computer program product is run on a computer, the computer is caused to execute the method according to any one of claims 1 to 8.