Method for processing push message and electronic device

By writing push messages to the synchronization data file when the application is not running and cross-process access is performed through the synchronization manager, the power consumption problem caused by the application process wake-up is solved, and the timely delivery and rapid acquisition of push messages is achieved, which improves the user experience.

WO2025139399A1PCT designated stage expired Publication Date: 2025-07-03HUAWEI TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/130821
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-01-10
Filing Date
2024-11-08
Publication Date
2025-07-03

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 cross-process access is performed through the synchronization manager, avoiding the application's process to synchronize and obtain messages.

Benefits of technology

Without adding additional power consumption, the timeliness and rapid acquisition of push messages is ensured, improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024130821_03072025_PF_FP_ABST
    Figure CN2024130821_03072025_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a method for processing a push message and an electronic device, the method being applied to an electronic device. The method comprises: receiving a first push message, the first push message being associated with a first application, and the first application not being running; writing the first push message into a first synchronization data file of the first application; and starting the first application, such that the first application acquires the first push message from the first synchronization data file. In the embodiments of the present application, when the first application does not run, the push message can be written into the synchronization data file by means of a synchronization manager, such that there is unnecessary for the process of the application to participate in the process of writing the push message, so as to ensure the timeliness of the push message and avoid an increase in extra power consumption, thereby helping to improve user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Method for processing push messages and electronic device

[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 29, 2023, with application number 202311861623.3 and application name “A method for transmitting messages through a Push channel without waking up an application”, and claims priority to the Chinese patent application filed with the China Patent Office on January 10, 2024, with application number 202410041871.1 and application name “A method for processing push messages and an 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 electronic devices, and more specifically, to a method for processing push messages and an electronic device. Background Art

[0003] With the advancement and development of technology, most applications in electronic devices provide message push functions, such as hot news recommendations in news applications, chat message reminders in chat applications, etc. These messages can be collectively referred to as push messages. Push messages play an important role in improving the activity of applications, improving the utilization rate of functional modules, improving user stickiness, and improving user retention. At present, in order for applications in electronic devices to receive push messages in a timely manner, it is necessary to ensure that the process of the application is alive. When the process of the application is not alive, the process of the application needs to be woken up first, and then the message is pushed to the application. However, waking up the process of the application consumes a lot of power. When an electronic device receives a large number of push messages and the process of the application corresponding to the push message is not alive, the corresponding processes need to be woken up one by one, which will increase the power consumption 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 push messages synchronously without waking up the process of the application has become a technical problem that needs to be solved urgently.

[0004] Summary of the Invention

[0005] The present application provides a method for processing push messages and an electronic device, which can synchronize push messages to an application without waking up the application process, ensuring the timeliness of the push messages without increasing additional power consumption, and helping to improve the user experience.

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

[0007] In an embodiment 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, thereby helping to improve the user experience.

[0008] 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.

[0009] 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, wherein 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.

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

[0011] In combination with the first aspect, in some implementations of the first aspect, the method further includes: receiving a second push message, the second push message being associated with the second application, the second application being running; and sending the second push message to the second application through an inter-process communication (IPC) mechanism.

[0012] In the embodiment of the present application, different methods of processing push messages can be adopted depending on whether the application is running, which ensures the delivery of push messages to the greatest extent and helps to improve the user experience.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the method further includes: identifying authorization information of the first application; and writing the first push message into the first synchronization data file of the first application, including: 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.

[0014] In the embodiment of the present application, a permission management mechanism is also introduced to manage the permissions of cross-process access to the synchronization data files of the application, thereby avoiding malicious access and improving security.

[0015] 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, including: determining that the preset condition is met, and writing the first push message into the first synchronization data file.

[0016] 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.

[0017] In combination with the first aspect, in some implementations of the first aspect, 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.

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

[0019] The second aspect is an electronic device of an embodiment of the present application, which includes modules / units for executing the above aspects or any possible design method of the above aspects; these modules / units can be implemented by hardware, or corresponding software implementations can be executed by hardware.

[0020] The third aspect is a chip according to an embodiment of the present application, which is coupled to a memory in an electronic device and is used to call a computer program stored in the memory and execute the above-mentioned aspects of the embodiment of the present application and any possible design of the above-mentioned aspects; in the embodiment of the present application, "coupling" refers to the direct or indirect combination of two components with each other.

[0021] The fourth aspect is an electronic device of an embodiment of the present application, which 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. When the instructions are executed by the one or more processors, the above aspects or any possible implementation of the above aspects are executed.

[0022] In a fifth aspect, a computer-readable storage medium is provided, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the first aspect and any possible implementation method of the first aspect are executed.

[0023] In a sixth aspect, a computer program product is provided, which includes a computer program or instructions. When the computer program or instructions are run on a computer, the first aspect and any possible implementation method of the first aspect are executed.

[0024] In a seventh aspect, a computer program is provided, which, when executed on a computer, enables the method in the first aspect and any possible implementation thereof to be executed.

[0025] Among them, 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. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application.

[0027] FIG2 is a block diagram of the software structure of the electronic device according to an embodiment of the present application.

[0028] FIG3 is a schematic diagram of a sandbox provided in an embodiment of the present application.

[0029] FIG4 is a schematic flow chart of a method for processing push messages.

[0030] FIG5 is a schematic flowchart of a method for processing push messages provided in an embodiment of the present application.

[0031] FIG6 is a schematic flowchart of a method for processing push messages provided in an embodiment of the present application.

[0032] FIG7 is a set of GUIs provided in an embodiment of the present application. DETAILED DESCRIPTION

[0033] 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 of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. 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. 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 mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.

[0034] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0035] The following describes an electronic device, a user interface for such an electronic device, and embodiments for 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 system used by the PC includes, but is not limited to, desktop operating systems such as Windows, Linux, and macOS, and may also be future desktop operating systems.

[0036] 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, 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, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air 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.

[0037] It should be understood that the structures illustrated in the embodiments of the present application do 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.

[0038] 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). The different processing units may be independent devices or integrated into one or more processors.

[0039] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.

[0040] 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.

[0041] 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.

[0042] 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.

[0043] 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.

[0044] 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 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.

[0045] The internal memory 121 can be used to store computer executable program codes, which 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, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can 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.

[0046] Figure 2 is a software structure diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers: the application layer, the application framework and service layer, the Android runtime and system libraries, and the kernel layer. The application layer may include a series of application packages.

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

[0048] The application framework layer provides an application programming interface (API) and a programming framework for applications in the application layer. The application framework layer may include some predefined functions.

[0049] As shown in FIG2 , the application framework and service layer may include a window manager, a content provider, a view system, a phone manager, a resource manager, a notification manager, and the like.

[0050] The window manager manages windowed applications. It can determine the display size, determine whether a status bar is present, lock the screen, and take screenshots. Content providers store and retrieve data and make it accessible to applications. This data can include video, images, audio, incoming and outgoing calls, browsing history and bookmarks, and phone books.

[0051] The view system includes visual controls, such as controls for displaying text and images, such as the instructions for prompting a virtual shutter button in the embodiments of this application. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0052] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).

[0053] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.

[0054] The push manager is used to receive push messages sent by the push server or application server. The push manager can also be called a push client or push service.

[0055] The synchronization manager identifies the application's authorization information, which indicates cross-process access to the synchronization data file. This synchronization data file is the application file that stores push messages. The synchronization manager also maps the synchronization data file based on the authorization information and manages cross-process access permissions to the synchronization data file. In other words, the synchronization manager determines whether the push manager is allowed to access the synchronization data file. The push manager accessing the synchronization data file can be understood as the push manager writing data to or reading data from the synchronization data file. The synchronization manager can also be referred to as a synchronization service.

[0056] For example, application #1 has authorized the push manager to access the synchronization data file #1, and application #2 has not authorized the push manager to access the synchronization data file #2. When the synchronization manager receives a push message sent by the push manager to application #1, since application #1 has authorized the push manager to access the synchronization data file #1, the push message can be written to the synchronization 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 has not authorized the push manager to access the synchronization data file #2, the push message will be prohibited from being written to the synchronization data file #2.

[0057] It should be noted that a detailed description of the push manager and the synchronization manager can be found below and will not be elaborated here.

[0058] The Android runtime includes the core library and the virtual machine. The Android runtime is responsible for scheduling and management of the Android system.

[0059] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.

[0060] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.

[0061] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).

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

[0063] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0064] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0065] A 2D graphics engine is a drawing engine for 2D drawings.

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

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

[0068] It should be noted that Figure 2 only uses the framework of the Android system as an example and should not be understood as a specific limitation on the embodiments of the present application. In the embodiments of the present application, the electronic device may also be equipped with other operating systems (for example, Hongmeng operating system), and different frameworks may be used for different operating systems. It is understandable that when different frameworks are adopted, the specific naming of each layer of the framework may be different.

[0069] To facilitate understanding of the embodiments of the present application, the following concepts may be involved in the embodiments of the present application:

[0070] Process: The running entity of an application. An application is a description of instructions, data, and their organization. A process is the running entity of an application.

[0071] Application files: Files owned by the application, including application installation files, application resource files, and application cache files. Data used and stored by applications on electronic devices is stored in a dedicated directory for the application in the form of files, key-value pairs, and databases. This directory is called the application file directory. All data within this directory is stored in different file formats, and these files are called application files. Push messages from applications are stored in application files.

[0072] Sandbox: Also known as a sandbox, it is a security mechanism used to provide an isolated environment for applications, separating different applications and protecting them from malicious attacks. Each application is associated with a user identification (UID). Electronic devices can set up a sandbox based on this UID and place applications within the sandbox to isolate them from each other. In other words, each application runs in its own independent process space, naturally isolating resources from applications with different UIDs. For each application, the system maps a dedicated application sandbox directory into the internal storage space. This directory consists of the application file directory and a collection of system files (a small number of system files required for application operation). 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 application's files are not visible to other applications, thereby protecting the security of the application files.

[0073] As shown in Figure 3, application process #1 runs in sandbox #1, and application process #2 runs in sandbox #2. 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.

[0074] Push messages are messages proactively pushed to users by the operating system or an application. Users can see push messages on their electronic device's lock screen, notification bar, or application interface. Currently, the most common method for applications to send push messages to users is for the application's server to send the push message to a push server, which then sends it to the user's electronic device, or for the application's server to send the push message directly to the user.

[0075] A method for processing push messages is described below with reference to FIG4 .

[0076] FIG4 shows a schematic flow chart of a method for processing a push message. As shown in FIG4 , the method 400 includes:

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

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

[0079] The push server can be provided by the electronic device manufacturer or the electronic device's operating system provider. Application Server #1 is the server corresponding to Application #1, and Push Message #1 is a push message sent to Application #1. When sending Push Message #1 to the push server, the application server can also indicate the electronic device's token. Different electronic devices have different tokens, thereby enabling precise push notifications.

[0080] S402: The push server sends a push message #1 to the push manager.

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

[0082] The electronic device includes a push manager that maintains a connection with a push server. Therefore, after receiving push message #1 from application server #1, the push server can, based on the token, send push message #1 to the push manager of the electronic device associated with the token. The push manager, also known as a push client, is a client that receives push messages from the push server.

[0083] S403: The push manager detects whether the process of application #1 is alive.

[0084] The push manager may detect whether the process of application #1 is alive. When it is determined that the process of application #1 is alive, the process proceeds to S404 . When it is determined that the process of application #1 is not alive, the process proceeds to S405 .

[0085] 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.

[0086] It should also be noted that the running of application #1 may include foreground running and background running.

[0087] S404: The push manager sends push message #1 to application #1.

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

[0089] The push manager determines that the process of application #1 is alive and can send push message #1 to application #1 through a mechanism such as inter-process communication.

[0090] S405: The push manager wakes up the process of application #1 and then sends push message #1 to application #1.

[0091] Since the push manager determines that the process of application #1 is not alive and sending push message #1 to application #1 requires relying on an inter-process communication mechanism, it is necessary to wake up the process of application #1 and then send push message #1 to application #1 through a mechanism such as inter-process communication.

[0092] In the method 400 shown in FIG4 above, 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 application server sends multiple push messages to the push manager, and the processes of the applications corresponding to the multiple push messages are not alive, the processes of the corresponding applications need to be woken up one by one, which will consume a lot of power, reduce the battery life of the electronic device, and also lead to a decline in the user experience.

[0093] In summary, how to quickly synchronize push messages to applications has become a technical problem that needs to be solved urgently. Based on this, the embodiments of the present application provide a method for processing push messages. According to the method for processing push messages provided in the embodiments of the present application, even if the application process is not alive, push messages can be quickly synchronized to the application without waking up the application, which not only ensures the timely delivery of push messages but also does not increase additional power consumption. The following will be described in detail with reference to Figure 5.

[0094] FIG5 shows a schematic flow chart of a method for processing push messages provided by an embodiment of the present application. The method is performed by an application server, a push server, and an electronic device. The electronic device includes a push manager, a synchronization manager, and application #1. As shown in FIG5 , the method 500 includes:

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

[0096] Specifically, application #1 can store authorization information in a specific description file, and the authorization information is used to indicate that the synchronization data file can be authorized to the push manager. The synchronization data file is used to store push messages, and the synchronization data file is an application file stored in the sandbox corresponding to application #1. The fact that the synchronization data file can be authorized to the push manager can be understood as the push manager being able to access the synchronization data file across processes, that is, to 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.

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

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

[0099] For another example, the authorization information indicates that the push manager can be granted write permission and read permission, so the push manager can write push messages into the synchronization data file through the synchronization manager and can also read push messages in the synchronization data file through the synchronization manager.

[0100] S502: The synchronization manager maps the synchronization data file according to the authorization information of application #1.

[0101] Specifically, the synchronization manager may determine, based on the authorization information, that the synchronization data file of application #1 can be authorized to the push manager, and the synchronization manager may then map the synchronization data file and manage cross-process access permissions to the synchronization data file.

[0102] It should be noted that the actual path of the synchronization data file of application #1 corresponds to a mapping path #1, and the mapping path #1 is a path for cross-process access to the synchronization data file of application #1.

[0103] 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.

[0104] 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.

[0105] 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. The embodiment of the present application does not specifically limit this. The following examples introduce several possible implementation methods.

[0106] In the first possible implementation, the mapping path is pre-defined. The operating system provider provides pre-defined rules, and application developers can declare the mapping path for synchronization data files according to these pre-defined rules. After the application is successfully installed, the synchronization manager can determine the mapping path for the application's synchronization data files.

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

[0108] It is also understandable that different application programs correspond to different mapping paths.

[0109] 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.

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

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

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

[0113] A third possible implementation involves the application server sending a mapping path along with the push message to the push server. The push server then forwards the push message and mapping path to the push manager. In other words, in this implementation, the application server instructs the push manager to write the push message to the synchronization data file according to the mapping path it sent.

[0114] In a fourth possible implementation, the push server can also send a mapping path when forwarding a push message. It should be noted that this fourth possible implementation differs from the third possible implementation in that the push server manages the mapping path for each application. Upon receiving a push message from an application, the push server can determine the application to which the push message corresponds and, when forwarding the push message, send the corresponding mapping path.

[0115] In a fifth possible implementation, the application server may simultaneously send the mapping path when sending a push message to the push manager.

[0116] It should be noted that, while the above description uses the association between the mapping path of a synchronization data file and the actual path of the synchronization data file as an example, this is not specifically limited in the embodiments of the present application. For example, in other embodiments, the application identifier (e.g., UID, package name, etc.) may be associated with the actual path of the synchronization data file, that is, the mapping relationship between the application identifier and the synchronization data file may be established according to any of the possible implementation methods described above, and the actual path of the synchronization data file may be determined by the application identifier.

[0117] S503: Application server #1 sends push message #1 to the push server.

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

[0119] S504: The push server sends a push message #1 to the push manager.

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

[0121] It should be understood that the description of S503 and S504 can refer to the description of S301 and S302 above, and for the sake of brevity, they are not repeated here.

[0122] It should be noted that the embodiments of the present application are based on an example in which an application server sends a push message to a push server, and the push server then sends a push message to a push manager, but this is not a specific limitation. In other embodiments, the application server can be connected to the push manager, so that the application server can directly send a push message to the push manager.

[0123] S505: The push manager writes push message #1 to the synchronization data file through the synchronization manager.

[0124] Specifically, after receiving push message #1, the push manager can determine that push message #1 is a push message corresponding to application #1. The push manager can then write push message #1 to the synchronization data file according to mapping path #1 through the synchronization manager's interface. During this process, the synchronization manager verifies whether the push manager is allowed to write data to the synchronization data file. If the verification is successful, push message #1 is written to the synchronization data file of application #1 according to mapping path #1.

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

[0126] In the embodiment of the present application, there is no specific limitation on the identifier of application #1. For example, the identifier of application #1 can be the package name of application #1.

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

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

[0129] In other embodiments, when the push manager inputs data through the interface of the synchronization manager, it is not necessary to input mapping path #1. Instead, the synchronization manager determines mapping path #1 based on the identifier of application #1, and then the synchronization manager verifies whether the push manager is allowed to write data to the synchronization data file #1. After the verification is passed, the push message #1 will be written to the synchronization data file of application #1 according to mapping path #1.

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

[0131] In an embodiment of the present application, the synchronization data file in the application sandbox is mapped, allowing the push manager to write push messages to the synchronization data file through the mapping path of the synchronization data file. This process of writing push messages does not require the participation of the application process. Therefore, even if the application process is not alive, the push manager can synchronize push messages to the application, ensuring the timeliness of push messages without increasing additional power consumption, which helps to improve the user experience. At the same time, a synchronization manager is introduced, which can be used to manage the permissions of cross-process access to the application's synchronization data files, avoiding malicious access and improving security.

[0132] Optionally, in some embodiments, as shown in FIG5 , the method 500 further includes:

[0133] S506: The push manager sends a push message #1 to the notification manager.

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

[0135] After receiving push message #1, the notification manager can display push message #1. This application does not specifically limit the form in which push message #1 is displayed. For example, it can appear in the form of a chart or scrolling text in the top status bar of the system. For another example, it can also appear on the screen in the form of a dialog window.

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

[0137] S507: The push manager determines whether the push message #1 meets a preset condition.

[0138] Before the push manager writes push message #1 to the synchronization data file through the synchronization manager, it can first determine whether the push message #1 meets the preset conditions. When it is determined that the preset conditions are met, the push message #1 can be written to the synchronization data file through the synchronization manager, that is, S505 is executed. When it is determined that the preset conditions are not met, the synchronization process is ended.

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

[0140] The push manager may execute S505 when determining that the type of the push message #1 is a preset type.

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

[0142] Exemplarily, the preset type may be a notification message type.

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

[0144] Exemplarily, the preset type may be an IM message type.

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

[0146] Exemplarily, push message #1 is a configuration data message type.

[0147] If the push manager determines that the type of push message #1 is a configuration data message type, the push manager can write push information #1 into the synchronization data file of the application corresponding to push information #1 through mapping path #1, so that when the application is started, the application can quickly obtain push information #1 directly from the synchronization data file to update the configuration data.

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

[0149] When sending a push message, the application server can specify whether the push message is pushed in the foreground or in the background. Foreground push can be understood as push to the application when the application is running in the foreground, and background push can be understood as push to the application when the application is running in the background or when the application is not running. Therefore, it can be preset that when the scenario corresponding to the push message is background push, the push manager can execute S505. Push messages pushed to the application in the background can be understood as push messages that need to be processed by the application itself and do not need to be displayed to the user. For example, push messages for updating the interface layout, push messages 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.

[0150] The push manager may determine that the process of application #1 associated with push message #1 is not alive, and execute S505. Conversely, when the process of application #1 is alive, push message #1 may be sent to application #1 through a mechanism such as cross-process communication according to the method shown in FIG. 4 .

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

[0152] Alternatively, in some other embodiments, the synchronization manager may determine whether the push message #1 meets a preset condition.

[0153] In these embodiments, the synchronization manager can also determine whether the push message #1 meets the preset conditions when verifying the push manager's permissions. When it is determined that the push message #1 meets the preset conditions, the push message #1 will be written into the synchronization data file of the application #1 according to the mapping path #1.

[0154] In some embodiments, when application #1 is launched in response to a user operation, application #1 may obtain push message #1 from the synchronization data file.

[0155] In the embodiment of the present application, 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, thereby improving the speed at which the application obtains the push message.

[0156] In the above embodiment, the push message synchronized by the method provided in the embodiment of the present application may be a push message that does not require immediate processing by the application. Conversely, if the push message is a push message that requires immediate processing by the application, the method shown in Figure 4 can be used to wake up the application process and then send it to the application through the IPC mechanism, or the method provided in the embodiment of the present application can be used to synchronize the push message and then wake up the application process.

[0157] For example, a push message is a voice over internet protocol (VoIP) message that needs to be processed immediately by an application.

[0158] For another example, the push message is a positioning message, which is a message that needs to be processed immediately by the application.

[0159] The above text introduces the method for processing push messages provided by the embodiment of the present application 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 other embodiments, the push manager and the synchronization manager can be combined into a new module, and the new module is used to indicate the operations performed by the push manager and the synchronization manager above. The following text will introduce the method for processing push messages provided by the embodiment of the present application with an electronic device as the main body.

[0160] FIG6 shows a schematic flow chart of a method for processing a push message provided in an embodiment of the present application. As shown in FIG6 , the method 600 includes:

[0161] S601: Receive a first push message.

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

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

[0164] The first push message is associated with the first application, that is, the first push message is a push message of the first application, and the first application is not running, that is, the process of the first application is not alive.

[0165] S602: Write the first push message into a first synchronization data file of the first application.

[0166] After receiving the first push message, the electronic device may write the first push message into the synchronization data file of the first application through the synchronization manager.

[0167] S603: Start a first application program, and the first application program obtains a first push message from a first synchronization data file.

[0168] 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.

[0169] In an embodiment 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, thereby helping to improve the user experience.

[0170] 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.

[0171] In some embodiments, S603 specifically includes: writing the first push message into the first synchronization data file through the first mapping path, wherein the first mapping path is the path for accessing 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.

[0172] 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, bundleName#1 is the package name of the first application, and 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.

[0173] In some embodiments, the first mapping path is pre-set.

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

[0175] In some embodiments, when the application server sends the first push message to the push server, it may simultaneously send the 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, the push server may also send the first mapping path when forwarding the first push message. It should be noted that in this manner, the push server manages the mapping path of each application.

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

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

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

[0180] receiving a second push message, where the second push message is associated with a second application, and the second application is running;

[0181] The second push message is sent to the second application through an inter-process communication (IPC) mechanism.

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

[0183] In the embodiment of the present application, different methods for processing push messages can be adopted according to whether the application is running, and multiple paths for synchronous push messages are provided, which ensures the delivery of push messages to the greatest extent and helps improve the user experience.

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

[0185] 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.

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

[0187] 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 permission to write the first push message to the first synchronization data file. If it is determined that it has permission, the first push message can be written.

[0188] In the embodiment of the present application, a permission management mechanism is also introduced to manage the permissions of cross-process access to the synchronization data files of the application, thereby avoiding malicious access and improving security.

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

[0190] S603 specifically includes: determining that a preset condition is met, and writing the first push message into a first synchronization data file.

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

[0192] In some embodiments, 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.

[0193] In some embodiments, 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.

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

[0195] FIG7 shows a set of graphical user interfaces (GUIs) provided in an embodiment of the present application.

[0196] As shown in (a) of Figure 7, the mobile phone receives a push message from "Huawei Music" to prompt the user to play the newly added songs every day. The mobile phone can display a notification bar 702 on the desktop 701, and the notification bar 702 displays "Daily New Songs".

[0197] In some embodiments, launching the first application may include: detecting an operation of a user on the first push message, and launching the first application in response to the operation of the user on the first push message.

[0198] For example, as shown in Figure 7 (a) and (b), the phone detects a user tapping notification bar 702. In response, the phone displays interface 703, which is the "Huawei Music" interface and includes information about newly added songs. It's understood that the newly added song information on interface 703 is obtained by "Huawei Music" from its synchronized data files. Compared to existing applications that obtain push messages from the push manager through cross-process communication, obtaining push messages from synchronized data files is much faster.

[0199] In the embodiment of the present application, 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, thereby improving the speed at which the application obtains the push message.

[0200] The present application provides a computer program product that, when executed on an electronic device, enables the electronic device to execute the technical solution in the above embodiment. The implementation principle and technical effects are similar to those of the above method-related embodiments and will not be described in detail here.

[0201] The embodiment of the present application provides a readable storage medium, which contains instructions. When the instructions are executed on an electronic device, the electronic device executes the technical solution of the above embodiment. The implementation principle and technical effect are similar and will not be repeated here.

[0202] The present application provides a chip for executing instructions. When the chip is running, the technical solution of the above embodiment is executed. The implementation principle and technical effect are similar and will not be described here.

[0203] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of this application.

[0204] 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.

[0205] In the 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 schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as 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 mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0206] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0207] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0208] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present application is essentially 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, and the computer software product is stored in a storage medium, including a number of instructions for enabling 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 method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0209] The above description is merely a specific implementation of the embodiments of the present application, but the scope of protection of the embodiments of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the embodiments of the present application should be included in the scope of protection of the embodiments of the present application. Therefore, the scope of protection of the embodiments of the present application should be based on the scope of protection of the claims.< / bundlename>

Claims

1. A method for processing push messages, characterized in that, The method is applied to an electronic device, and the method 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.

2. The method according to claim 1, characterized in that, The writing the first push message into the first synchronization data file of the first application program includes: Writing the first push message into the first synchronization data file through a first mapping path, where the first mapping path is a path for accessing the first synchronization data file of the first application program, 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.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Receiving a second push message, where the second push message is associated with a second application program and the second application program is running; Sending the second push message to the second application program through an Inter-Process Communication (IPC) mechanism.

4. The method according to any one of claims 1 to 3, characterized in that The method further includes: Identifying authorization information of the first application program; The writing the first push message into the first synchronization data file of the first application program 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 program.

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

6. The method according to claim 5, wherein 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.

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

8. The method according to any one of claims 1 to 7, characterized in that The method further includes: Displaying the first push message.

9. An electronic device, characterized in that, Including 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 method according to any one of claims 1 to 8 to be executed.

10. A chip, characterized in that, The chip includes a processor and a communication interface. 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, A computer instruction is stored in the computer-readable storage medium, and when the computer instruction runs on a computer, it causes the method according to any one of claims 1 to 8 to be executed.

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

Citation Information

Patent Citations

  • Push message sending method, electronic equipment and readable medium

    CN115051968A

  • Push message processing method and device, electronic equipment and storage medium

    CN115529347A

  • Web push notifications in the background

    US20190141152A1

  • Electronic device for processing background task by using external input and storage medium thereof

    US20210311783A1