Message processing method and device
By setting the main process of the application in the terminal device to prohibit automatic startup and restarting during user operation, the increase in power consumption caused by frequent startup of the main process is solved, and the real-time performance of power consumption reduction and message push service is achieved. accuracy.
Patent Information
- Application Number
- CN202310771208.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-27
- Publication Date
- 2024-12-27
AI Technical Summary
The main process is frequently started in the terminal device due to message reception services, resulting in an increase in power consumption and affecting the performance of the device.
When receiving message events through the perception module and the intercepting module, it is determined that the main process of the application is frozen or removed, and is set to prohibit automatic startup, preventing the main process from occupying system resources, and restarting the main process only during user operations to obtain message content .
It effectively reduces the power consumption of terminal equipment, improves the utilization rate of system resources, and ensures the real-time and accuracy of message push services.
Smart Images

Figure CN119211180A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of terminal technology, and in particular to a message processing method and device. Background Art
[0002] Message push service refers to the service that mobile application service providers use servers to send messages to terminal devices. The message push process usually includes: the mobile application service provider uses the cloud server to push message events to the terminal device through the mobile network; the application on the terminal device that can receive message events generally includes a message receiving service and a main process. The message receiving service notifies the main process after receiving the message event. The main process requests the cloud server for the message content corresponding to the message event based on the message event, and displays the message content through the terminal device.
[0003] However, in the current application ecosystem, there are many applications that can receive message events in terminal devices. Each application has a permanent message receiving service in the terminal device. After receiving a message event, if the terminal device freezes or removes the application from the application background of the terminal device for energy saving, resulting in the freezing or removal of the main process of the application, the message receiving service automatically wakes up the main process. As the number of message events received by the terminal device increases, the number of main processes automatically started also increases, increasing the power consumption of the terminal device. Summary of the invention
[0004] The embodiments of the present application provide a message processing method and apparatus for saving power consumption of a terminal device when a message event is received.
[0005] In the first aspect, the embodiment of the present application proposes a message processing method, which is applied to a terminal device. The system resources of the terminal device include memory and CPU (Central Processing Unit) resources. Basic applications (or system applications, such as pre-installed applications that cannot be uninstalled by users) and / or third-party applications are installed on the terminal device. Usually, when the system resource occupancy rate of the terminal device is high, the main process of the application will be frozen or removed, so that the main process of the application does not occupy the memory and CPU resources of the terminal device, thereby reducing the power consumption of the terminal. To achieve the above purpose, in a possible implementation, the application framework layer of the terminal device includes a perception module, an interception module and a display module. The method includes: the terminal device receives a message event, and the message event is used to notify the application corresponding to the message event to obtain the message content; after the perception module perceives the reception of the message event, it determines that the main process of the application corresponding to the message event is removed or frozen, and determines that the application is set to prohibit automatic startup of the main process, and keeps the main process of the application removed or frozen through the interception module; the display module performs a message reception prompt according to the message event.
[0006] A message event is pushed to a terminal device by a server for a certain application, and is used to notify the application to obtain the message content from the server. When the perception module determines that the main process of the application has been removed or frozen, and the application is set to prohibit automatic startup of the main process, it notifies the interception module to enable the interception module to keep the main process of the application removed or frozen, and prevent the main process of the application from automatically starting, thereby reducing the main process of the application from occupying system resources, thereby saving the power consumption of the terminal device. By providing a message reception prompt for the message event through the display module, the user can be notified that a new message has been received, and the user can then decide whether to view the message content as needed. Compared with starting the main process to obtain the message content as long as the terminal device receives the message event, the above implementation method of the present application can save the power consumption of the terminal device while meeting the user's needs.
[0007] In some embodiments, the application framework layer of the terminal device also includes a configuration module, and the determination that the application is set to prohibit automatic starting of the main process includes: if the perception module perceives that the application is set with configuration information or the application exists in an application list, then it determines that the application is set to prohibit automatic starting of the main process; wherein the application list and the configuration information are pre-stored, and the perception module sends a query instruction to the configuration module, so that the configuration module can query the applications that are set with configuration information or exist in the application list, and the application list includes identification information of the application that is set to prohibit automatic starting of the main process, and the configuration information is used to indicate that automatic starting of the main process is prohibited.
[0008] Based on the above solution, applications that are prohibited from automatically starting are predefined through an application list and configuration information, thereby improving the flexibility of limiting the occupation of system resources by applications.
[0009] In some embodiments, the configuration information of the application is set by the system, or is set based on user operations.
[0010] In some embodiments, the application list is set by the system; or, the application list is generated based on user operations; or, some applications in the application list are set by the system, and other applications are set based on user operations.
[0011] Based on the above solution, the application that is prohibited from automatically starting can be set by the system or based on user operation, thereby ensuring the flexibility of resource restriction on the application.
[0012] In some embodiments, providing a message reception prompt based on the message event includes: a display module updating an identifier corresponding to the application on an interface of the terminal device, the identifier being used to indicate the number of received message events.
[0013] Based on the above solution, when the main process of the application is removed or frozen, the message content corresponding to the message event cannot be obtained from the server. By displaying the number of message events received by the application during the time period when it was removed or frozen, the user is ensured to perceive that the application has received new message events, and then the user can decide whether to view the message content corresponding to the message event, thereby meeting user needs.
[0014] In some embodiments, after determining that the main process of the application is removed or frozen and the application is set to prohibit automatic startup of the main process, it also includes: the interception module caching the message events of the application; after the message reception prompt is given according to the message event, it also includes: the perception module starts the main process of the application according to user operations; the notification interception module sends the cached message events of the application to the main process of the application; the display module displays the message content, and the message content is obtained by the main process of the application from the server according to the message event.
[0015] Based on the above scheme, after the user perceives the message event of the application, the user triggers the wake-up instruction by operating the terminal device. The perception module starts the main process of the application according to the wake-up instruction and sends a release instruction to the interception module. After receiving the release instruction, the interception module sends the message event of the application stored in itself to the main process of the application, so that the main process of the application obtains the corresponding message content from the server according to the message event, and then sends the message content to the display module, which displays the message content. In this way, after starting the application, the message content corresponding to the message event is obtained in real time, and the real-time and accuracy of the message push service are guaranteed.
[0016] In some embodiments, after starting the main process of the application according to user operation, it also includes: a perception module establishing a communication channel between the message receiving service of the application and the main process.
[0017] Based on the above scheme, after the perception module starts the main process of the application according to the user operation, the perception module establishes a Binder channel between the message receiving service of the application and the main process through the system's preset driver (such as Binder driver), so that after the subsequent message receiving service receives the message event, it sends the message event to the main process through the Binder channel, thereby ensuring the real-time and accuracy of the message push service after the main process of the application is started.
[0018] In some embodiments, before the terminal device receives the message event, it also includes: when the terminal device meets the resource occupation condition, the perception module removes or freezes the main process of the application in the running state.
[0019] Based on the above scheme, resource occupation conditions include but are not limited to excessive system power consumption, too long background occupation time of the application, etc. When the terminal device meets the resource occupation conditions, if the perception module determines through the configuration module that the application is set with configuration information or the application exists in the application list, and the main process of the application is in a running state, the interception module is notified, and the interception module removes or freezes the main process of the application, thereby releasing system resources, reducing the application's occupation of system resources, and improving the utilization of system resources.
[0020] In a second aspect, an embodiment of the present application provides a message processing device, including a receiving unit and a processing unit;
[0021] The receiving unit is used to receive a message event, and the message event is used to notify the application corresponding to the message event to obtain the message content; the processing unit is used to determine that the main process of the application is removed or frozen, and determine that the application is set to prohibit automatic startup of the main process, and keep the main process of the application removed or frozen; and provide a message reception prompt according to the message event.
[0022] In some embodiments, the processing unit is specifically used to: if the application is set with configuration information or the application exists in an application list, determine that the application is set to prohibit automatic starting of the main process; wherein the application list includes identification information of the application that is set to prohibit automatic starting of the main process, and the configuration information is used to indicate that automatic starting of the main process is prohibited.
[0023] In some embodiments, the configuration information of the application is set by the system, or is set based on user operations.
[0024] In some embodiments, the application list is set by the system; or, the application list is generated based on user operations; or, some applications in the application list are set by the system, and other applications are set based on user operations.
[0025] In some embodiments, the processing unit is specifically used to: update an identifier corresponding to the application displayed on an interface of the terminal device, where the identifier is used to indicate the number of received message events.
[0026] In some embodiments, the processing unit is also used to: cache message events of the application after determining that the main process of the application is removed or frozen and the application is set to prohibit automatic startup of the main process; start the main process of the application according to user operations after providing a message reception prompt based on the message event; send the cached message events of the application to the main process of the application; and display the message content, which is obtained by the main process of the application from the server based on the message event.
[0027] In some embodiments, the processing unit is further used to: after starting the main process of the application according to a user operation, establish a communication channel between the message receiving service of the application and the main process.
[0028] In some embodiments, the processing unit is further configured to: before the message event is received, when the terminal device meets a resource occupation condition, remove or freeze the main process of the application in the running state.
[0029] In a third aspect, an embodiment of the present application provides a readable storage medium, wherein the readable storage medium stores a program, and when the program code runs on a device, the device executes the method described in the first aspect above.
[0030] In a fourth aspect, an embodiment of the present application provides a device, comprising: one or more processors; wherein, when instructions of one or more computer programs are executed by the one or more processors, the device executes the method described in the first aspect above.
[0031] In a fifth aspect, an embodiment of the present application provides a chip system, comprising at least one chip and a memory, wherein the at least one chip is coupled to the memory and is used to read and execute program instructions stored in the memory to implement the method described in the first aspect above.
[0032] In a sixth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute the method described in the first aspect above.
[0033] Based on the implementations provided in the above aspects, the embodiments of the present application can be further combined to provide more implementations.
[0034] The technical effects that can be achieved in any of the second to sixth aspects mentioned above can be described with reference to the technical effects that can be achieved in the first aspect mentioned above, and the repetitions will not be discussed here. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 A schematic diagram of a system architecture for implementing a message push service provided in an embodiment of the present application;
[0036] Figure 2 A schematic diagram of the architecture of a message processing method provided in an embodiment of the present application;
[0037] Figure 3 A schematic diagram of a layered software structure of a terminal device provided in an embodiment of the present application;
[0038] Figure 4A flowchart of a message processing method provided in an embodiment of the present application;
[0039] Figure 5 A flowchart of a message processing method provided in an embodiment of the present application;
[0040] Figure 6 A schematic diagram of a message receiving prompt provided in an embodiment of the present application;
[0041] Figure 7 A schematic diagram of a message receiving prompt provided in an embodiment of the present application;
[0042] Figure 8 A schematic diagram of a message processing method provided in an embodiment of the present application;
[0043] Fig. 9 A schematic diagram of a message processing method provided in an embodiment of the present application;
[0044] Fig.10 A schematic diagram of a message processing method provided in an embodiment of the present application;
[0045] Fig.11 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application;
[0046] Fig.12 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present application. The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to be used as limitations on the present application. As used in the specification and the appended claims of the present application, the singular expressions "one", "a kind", "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 embodiments of the present application, "one or more" refers to one, two or more; "and / or" describes the association relationship of associated objects, indicating that three relationships may exist; for example, A and / or B can represent: 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 objects associated before and after are in an "or" relationship.
[0048] References to "one embodiment" or "some embodiments" etc. described in this specification mean that a particular feature, structure or characteristic described in conjunction with the embodiment is included in one or more embodiments of the present application. Thus, the phrases "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear at 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 "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0049] The multiple involved in the embodiments of the present application means greater than or equal to two. It should be noted that in the description of the embodiments of the present application, the words "first", "second", etc. are only used for the purpose of distinguishing the description, and cannot be understood as indicating or implying relative importance, nor can they be understood as indicating or implying an order.
[0050] In order to better illustrate the technical solution of the present application, the terms appearing in the embodiments of the present application are explained below.
[0051] Message push service: A service in which mobile application service providers push messages to users' terminal devices through servers.
[0052] Application (APP), software installed on terminal devices, generally includes basic applications that come with the terminal device when it leaves the factory and third-party applications provided by third parties. Some applications on terminal devices have the function of receiving push messages, such as basic applications receiving messages with new versions, third-party applications receiving messages about news information, etc. Unless otherwise stated, the applications or applications mentioned below all have the function of receiving push messages.
[0053] Message events and message content: Message events are events that apply named messages, indicating that the operation of delivering a message has been triggered; the message content is the specific information corresponding to the message event. For example, if the message event is an operation of delivering news information, the message content corresponding to the message event is the specific content of the news information.
[0054] In the related art, in order to complete the implementation of the message push service, the mobile application service provider generally sends message events to the terminal device through the mobile network based on the cloud server. The application installed on the terminal device includes a message receiving service and a main process, wherein the message receiving service resides on the terminal device and is used to receive the message events pushed by the cloud server, and notify the main process of the application after receiving the message event, so that after the main process receives the message event, it requests the cloud server for the message content corresponding to the message event, and finally displays the message content to the user through the terminal device and interacts with the user. Among them, the mobile application service provider is the party that provides the application, including terminal device manufacturers, third-party application service providers, etc.
[0055] For example, Figure 1 A schematic diagram of a system architecture for implementing a message push service provided in an embodiment of the present application includes a terminal device, a cloud server, and a business server. Among them, the cloud server is a server for unified push message events, and the business server is a server corresponding to a mobile application service provider. The business server can provide message push services for the corresponding application. Different business servers can provide message push services for different applications, such as business server a1 corresponding to application 1 and business server a2 corresponding to application 2. Business server a1 provides a message push service for news information for application 1, and business server a2 provides a message push service for the terminal device location for application 2.
[0056] In the related art, the process of message push service is as follows: the terminal device requests the token of the terminal device from the cloud server; wherein the token of the terminal device is bound to the terminal device and the application installed on the terminal device. Then the terminal device sends the token to the business server of the mobile application service provider corresponding to the application installed on the terminal device, so that the business server stores the token, that is, the token is bound to the mobile application service provider. For example, if application 1 and application 2 are installed on the terminal device, the terminal device sends its corresponding token to business server a1 and business server a2. When the mobile application service provider sends a message event, the token bound to the mobile application service provider, the message event, and the message content corresponding to the message event are sent to the cloud server, and then the cloud server sends the message event to the corresponding application in the terminal device bound to the token according to the token, and then the message receiving service of the application forwards the message event to the main process of the application, so that the main process of the application sends a request to the cloud server based on the message event, and then obtains the message content corresponding to the message event from the cloud server.
[0057] The above technical solution can be implemented in the system layer of the terminal device. After the system layer of the terminal device receives the message event based on the token, it determines the application corresponding to the message event according to the preset adaptation information between the application layer of the terminal device (including the applications installed on the terminal device) and the system layer, and then sends the message event to the message receiving service of the application. The preset adaptation information is configured based on the access address of the application, that is, in order to achieve interaction between the system layer and the application layer, the application needs to be modified and adapted. And in order to ensure the real-time nature of the message push service, the application's message receiving service needs to be resident in the terminal device, that is, the application's message receiving service always occupies system resources to receive message events sent by the mobile application service provider in real time.
[0058] In order to reduce the power consumption of the terminal device, the main process of the running application can be frozen or removed, but the message receiving service of the application still resides in the terminal device. After the main process of the application is removed or frozen, if the message receiving service of the application receives a message event, the main process of the application is actively started, and the message event is sent to the main process, so that the main process of the application obtains the message content from the cloud service based on the message event, thereby ensuring the implementation of obtaining the message content. However, the main process after startup will occupy the system resources of the terminal device. As the number of message events received by the terminal increases, the number of main processes started will increase accordingly, which increases the application's occupation of system resources and increases the power consumption of the system.
[0059] To this end, an embodiment of the present application provides a message processing method that does not require preset adaptation information for the system layer and application configuration of the terminal device, and is used to reduce the application's occupancy of system resources when a message event is received.
[0060] The embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0061] First, the system architecture of the embodiment of the present application is introduced. Figure 2 As shown, it is a schematic diagram of the architecture of a message processing method provided in an embodiment of the present application, including a perception module 210, a configuration module 220, an interception module 230 and a display module 240.
[0062] The perception module 210 is used to perceive whether the terminal device receives a message event. If so, a query instruction is sent to the configuration module 220, and the query result fed back by the configuration module 220 is received. The query result indicates whether the application corresponding to the message event is removed or frozen, and whether the application corresponding to the message event is set with configuration information or exists in the application list, so as to determine whether the application corresponding to the message event is set to prohibit automatic start of the main process according to the query result. After determining that the application corresponding to the message event is set to prohibit automatic start of the main process, an interception instruction is sent to the interception module 230, and the interception result fed back by the interception module 230 is received, and the interception result indicates whether the application corresponding to the message event has been prohibited from starting, that is, whether the main process of the application corresponding to the message event is removed or frozen. It is also used to remove or freeze the main process of the application if it is determined that the main process of the application is in a running state when the terminal device meets the resource occupation condition, and the configuration module 220 is queried that the application is set with configuration information or exists in the application list. It is also used to start the main process of the application according to the user operation, and then establish a communication channel between the message receiving service of the application and the main process. Exemplarily, the perception module 210 can be obtained after the media service in the terminal device is modified. For example, the perception module 210 is a module modified based on the AMS (Activity Management System) in the Apple mobile phone.
[0063] The configuration module 220 is used to set configuration information for the application according to user operations or system settings, or add the identification information of the application to the application list. It is also used to query whether the application list has the identification information of the application corresponding to the message event or whether the application corresponding to the message event has configuration information after receiving the query instruction sent by the perception module 210, and feed back the query result to the perception module 210, wherein the query instruction includes the application corresponding to the message event.
[0064] The interception module 230 is used to keep the main process of the application removed or frozen after receiving the interception instruction sent by the perception module 210, prohibit the main process of the application from communicating with the message receiving service of the application, cache the message event of the application, and then send a display instruction to the display module 240 so that the display module 240 can receive the message according to the message event. It is also used to receive the removal instruction sent by the perception module 210, remove or freeze the main process of the application, wherein the removal instruction is sent by the perception module 210 after the terminal device meets the resource occupation condition, determines that the main process of the application is in a running state, and the application is set with configuration information or exists in the application list, including the application to be removed or frozen.
[0065] The display module 240 is used to receive the display instruction sent by the interception module 230, and then call the display driver of the terminal device to update the identifier corresponding to the application on the display 341 of the terminal device through the display driver, wherein the identifier is used to indicate the number of received message events.
[0066] In one possible implementation, Figure 2 The framework shown is applied to the software system of the terminal device. Optionally, the terminal device can be a mobile phone, a tablet computer, a laptop computer, a netbook, a vehicle-mounted device, a business intelligent terminal (including: videophone, conference desktop intelligent terminal, etc.), a personal digital assistant (personal digital assistant, PDA), an augmented reality (augmented reality, AR)\virtual reality (virtual reality, VR) device, etc. The embodiment of the present application does not limit the specific form of the terminal device.
[0067] The software system of the terminal device can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. Taking the system as an example, the software structure of the terminal device is explained. Figure 3 , is a schematic diagram of the layered software structure of a terminal device provided in an embodiment of the present application. The layered architecture divides the software system of the terminal device into several layers, and each layer has its own role and division of labor. The layers communicate with each other through software interfaces. The Android system is divided into four layers, namely the application layer (applications) 310, the application framework layer (application framework) 320, the Android runtime environment ART (Android runtime) and the system library and the kernel layer (kernel). The embodiment of the present application does not limit the layering of the software structure of the terminal device. The Android runtime, system library and kernel layer can be regarded as one layer, called the system layer 330. It should be understood that Figure 3 On the basis of the Android system, a hardware layer 340 in the terminal device is also added.
[0068] It should be understood that Figure 3 The modules included in each layer shown are the modules involved in the embodiments of the present application. The modules included in each layer below do not constitute a limitation on the structure of the terminal device and the level of module deployment (example description). Figure 3 The modules shown in can be deployed individually, or several modules can be deployed together. Figure 3 The division of modules and the names of the modules are only examples.
[0069] The application layer may include a series of application packages. The application layer may include applications such as camera, gallery, calendar, call, map, navigation, Bluetooth, music, video, short message, browser, etc. Applications may include system applications and third-party applications. The figure only shows the first application 311 and the second application 312 by way of example. Exemplarily, the first application 311 may be a game application, and the second application 312 may be a browser. A browser is a software that can be installed on a terminal device. The browser provided in the embodiment of the present application has the functions of rendering pages and accessing applications of different systems.
[0070] The application framework layer can provide application programming interface (API) and programming framework for the applications in the application layer. The application framework layer can include some predefined functions. Figure 3 , the application framework layer includes Figure 2 All modules shown, including Figure 2 The perception module 210, configuration module 220, interception module 230, and display module 240 shown in the figure do not elaborate on the functions of each module here. The application framework layer also includes other modules, such as a window manager service (WMS) module, a graphics and image processing module, etc. The window management service module is used to manage the user interface, and the graphics and image processing module is used to draw the user interface. Exemplarily, the graphics and image processing module may include a rendering module and a layer synthesizer, the rendering module is used to render the user interface according to the page resources, and the layer synthesizer is used to perform layer synthesis on the rendered layers to obtain the user interface to be displayed. It can be understood that the technical solution of the present application is implemented in the application framework layer, so the implementation of the message push service does not require the preset adaptation information for the system layer and application configuration of the terminal device, thereby improving the universality of the message push service.
[0071] Because the Android runtime, system library, and kernel layer are considered as one layer in the embodiment of the present application, the system layer 330 may include the functional modules in the Android runtime, system library, and kernel layer. Figure 3 The system layer may include hardware drivers for driving hardware operations, such as display driver 331, sensor driver 332, graphics processing unit driver (GPU driver) 333, etc., which are not limited in the present embodiment.
[0072] The hardware layer 340 includes the hardware in the terminal device. It can be understood that Figure 3The hardware layer in FIG. 3 shows the display 341 and the sensor 342 involved in the following embodiments. The display 341 is used to display the application icon, message events, message content, and the number of message events received by the application. The function of the display 341 is not limited here.
[0073] Based on the above Figure 3 As shown, a message processing method provided by the present application is applied to the application framework layer of a terminal device, and is used to keep the main process of the application removed or frozen after receiving a message event, if it is determined that the main process of the application corresponding to the message event is removed or frozen, and the application is set to prohibit automatic start of the main process, that is, prohibit the main process of the application from starting, prohibit the communication between the message receiving service of the application and the main process, thereby reducing the occupation of system resources by the main process of the application. Figure 4 , Figure 4 A schematic diagram of a message processing method provided in an embodiment of the present application, the process specifically includes:
[0074] Step 410: The terminal device receives a message event sent by the server.
[0075] Step 420: The main process of the application corresponding to the message event maintained by the terminal device is removed or frozen.
[0076] Step 430: The terminal device issues a message reception prompt for the message event.
[0077] For better explanation Figure 4 The technical solution is as follows, combined with the terminal device such as Figure 2 or Figure 3 The perception module 210, configuration module 220, interception module 230 and display module 240 shown are further described.
[0078] See also Figure 5 , Figure 5 The present invention provides a flow chart of a message processing method using a perception module, a configuration module, an interception module and a display module as examples. The flow chart specifically includes:
[0079] Step 510: Receive a message event.
[0080] The perception module can sense the message event sent by the terminal device when it receives the message, and then obtain the message event. The server can be a server corresponding to a mobile application service provider, or a cloud server that uniformly pushes message events, which is not specifically limited here. The message event includes an application identifier, which is used to indicate the application corresponding to the message event. The message event is used to notify the application corresponding to the message event to obtain the message content. For example, the application identifier is w1, which represents the WeChat application, and the message event is a news hotspot notification, which is used to notify the WeChat application to obtain the news content corresponding to the news hotspot.
[0081] Step 520: When it is determined that the application corresponding to the message event is removed or frozen, a query instruction is sent.
[0082] In a possible implementation, the application corresponding to the message event is removed or frozen based on a user operation. For example, the user removes the application corresponding to the message event from the background of the terminal device, thereby removing the application corresponding to the message event; or in another example, the background of the user's terminal device freezes the application corresponding to the message event, thereby freezing the application corresponding to the message event.
[0083] In another possible implementation, when the perception module determines that the terminal device meets the resource occupation condition, if the main process of the application corresponding to the message event is in a running state, the interception module is notified, and the interception module removes or freezes the main process of the application corresponding to the message event.
[0084] In this step, the query instruction includes the identification information of the application corresponding to the message event, and the query instruction is used to instruct the configuration module to query whether the application corresponding to the message event is set with configuration information or the application exists in the application list according to the identification information of the application corresponding to the message event. Exemplarily, the application corresponding to the message event is set with configuration information or the application exists in the application list, wherein the application list includes the identification information of the application that is set to prohibit automatic start of the main process, such as the identification information of the application is the application ID, application name and other information, and the configuration information can be an interception flag (such as 1 or 0) used to indicate whether the application is set with configuration information. The application in the application list indicates that the application is prohibited from automatically starting the main process, and the configuration information is used to indicate that the main process is prohibited from automatically starting.
[0085] In the embodiments of the present application, the configuration information of the application is set by the system or is set based on user operations. For example, when the basic applications of the terminal device (such as the mall application, camera application, browser application, etc. corresponding to the terminal device) are shipped from the factory, the system of the terminal device adaptively sets the interception flag of the browser application to "1", which means that the browser application is set with configuration information. For another example, a third-party application (such as a shopping application, a chat application, etc.) sets the interception flag of the chat application to "1" based on user operations, which means that the chat application is set with configuration information.
[0086] Exemplarily, some applications in the application list are set by the system, and other applications are set based on user operations. For example, when the terminal device leaves the factory, the terminal device's system adaptively adds the application name of the browser application to the application list, and the third-party application adds the identification name of the chat application to the application list based on user operations. Exemplarily, the application list is set by the system, that is, the basic applications and third-party applications of the terminal device are added to the application list by the system. Or the application list is generated based on user operations, that is, the basic applications and third-party applications of the terminal device are added to the application list based on user operations, so as to ensure the flexibility of removing or freezing applications.
[0087] Exemplarily, the main process of the application includes at least one service. When the main process of the application is removed or frozen, some services of the main process of the application can be removed or frozen according to preset conditions. For example, application R includes message receiving service R1 and main process R2, and main process R2 includes services R2.1 and R2.2. When the main process R2 of the application is removed or frozen, service R2.1 will be removed or frozen. It can be understood that the preset conditions can be preset based on experience and are not specifically limited here. In this way, when starting the removed or frozen application, the services that need to be started are reduced, the startup efficiency of the application is improved, and the real-time performance of the message push service is improved.
[0088] Step 530: Feedback the query result.
[0089] The configuration module queries whether the identification information of the application corresponding to the message event exists in the application list, or whether the interception flag of the application corresponding to the message event is "1", based on the identification information of the application corresponding to the message event. If so, the first result is fed back, otherwise the second result is fed back. Exemplarily, the application corresponding to the message event is a chat application, and the chat application exists in the application list, or the interception flag of the chat application is "1", and the configuration module feeds back the first result to the perception module.
[0090] Step 540: When it is determined according to the query result that the application corresponding to the message event is set to prohibit automatic start of the main process, an interception instruction is sent.
[0091] When the perception module determines that the feedback result sent by the configuration module is the first result, it indicates that the application name of the application corresponding to the message event exists in the application list (that is, the application corresponding to the message event is in the application list), or the interception flag is "1" (that is, the application corresponding to the message event is set with configuration information), and then determines that the application corresponding to the message event is set to prohibit automatic startup of the main process, and then sends an interception instruction to the interception module, where the interception instruction includes the message event and the identification information of the application corresponding to the message event.
[0092] Step 550: The main process of the application corresponding to the message event is removed or frozen, and the message event is cached.
[0093] After the interception module receives the interception instruction sent by the perception module, it prohibits the message receiving service of the application from establishing a communication channel with the main process based on the identification information of the application corresponding to the message event in the interception instruction, that is, prohibits the message receiving service of the application from communicating with the main process, thereby prohibiting the application corresponding to the message event from automatically starting, and keeps the main process of the application corresponding to the message event removed or frozen, thereby reducing the occupation of system resources by the main process of the application.
[0094] After the main process of the application corresponding to the message event is removed or frozen, the message event in the interception instruction is cached.
[0095] Step 560, sending a display instruction.
[0096] After the interception module caches the message event in the interception instruction, it sends a display instruction to the display module, where the display instruction includes identification information of the application corresponding to the message event.
[0097] Step 570: Prompt for receiving a message based on the message event.
[0098] After receiving the display instruction sent by the interception module, the display module determines the application corresponding to the message event according to the identification information of the application corresponding to the message event, and then updates the identification corresponding to the application on the interface of the display terminal device, which is used to indicate the number of received message events. The update method can be a cumulative method, see Figure 6 , Figure 6 A schematic diagram of a message receiving prompt provided in an embodiment of the present application, wherein an icon of application R is displayed on the unlock screen interface of the terminal device, and the icon of application R displays the number K of message events received during the time period when application R is removed or frozen.
[0099] In a possible implementation, the message receiving prompt is provided in the form of a text message. Figure 7 , Figure 7 A schematic diagram of a message receiving prompt provided in an embodiment of the present application, on the lock screen interface of the terminal device, the identification information of the application corresponding to the message event (application R), the number K of message events received during the time period when application R is removed or frozen, and / or the receiving time of the i-th message event (xxxx-xx-xx:xx) are displayed through text information, wherein the receiving time of the message event is determined based on the system time of the terminal device. On the unlock screen interface of the terminal device, a display service such as a floating window, a prompt box, etc. is displayed. Figure 7 The text information shown is not specifically limited here.
[0100] In another possible implementation, the message reception prompt is performed by other means, wherein the other means include a vibration mode of the terminal device, a voice playback mode, and the like. For example, the user is prompted by vibration that a certain application that has been removed or frozen has received a message event, and the application name of the application corresponding to the message event, the number of currently received message events K, and / or the receiving time of the i-th message event (xxxx-xx-xx:xx) are played by voice playback. It can be understood that the terminal device can use other methods for message reception prompts in both the locked screen state and the unlocked state, and no specific limitation is made here. In the embodiment of the present application, when the main process of the application is removed or frozen, the message content corresponding to the message event cannot be obtained from the server. By displaying information such as the number of message events received by the application during the time period when it was removed or frozen, the receiving time of the message event, etc., it is ensured that the user perceives the message event of the application in real time, thereby meeting the user's need to perceive the message event.
[0101] In order to better explain the above technical solution, see Figure 8 , Figure 8 A schematic diagram of a message processing method provided for an embodiment of the present application. In the application layer, when the main process of the application is removed or frozen, the function of the main process of the application is limited, and the message receiving service (push service) function of the application runs normally. After the message receiving service of the application receives the message event pushed by the mobile application service provider corresponding to the application, the message receiving service of the application requests the perception module in the framework to establish a communication channel. In the framework layer, the perception module queries the configuration module, and when it is determined that the application is prohibited from automatically starting the main process, the interception module is notified to prohibit the message receiving service of the application from establishing a communication channel (such as a Binder channel) between the main process of the application and the message receiving service of the application through the channel driver of the kernel layer (such as a Binder driver), and keep the main process of the application removed or frozen, and then the interception module caches the message event of the application, and the message reception prompt is given to the message event through the display module.
[0102] Based on the above description, after the terminal device receives a message event, it interacts with the user and starts the main process of the application according to the user operation. The user operation includes operation instructions and voice instructions on the screen interface of the terminal device, and the user operation is not limited here. After the main process of the removed or frozen application is started, the interception module sends the cached application message event to the main process of the application, so that the main process of the application obtains the message content from the server according to the message event, and finally displays the message content through the main process of the application.
[0103] See also Fig. 9 , Fig. 9A schematic diagram of a message processing method provided in an embodiment of the present application, in the framework layer, the perception module starts the main process of the removed or frozen application based on the user operation, and sends a release instruction to the interception module, wherein the release instruction includes the identification information of the application. The interception module sends the message event of the application corresponding to the identification information to the main process of the application after it is started, and clears the cached message events of the application, based on the identification information of the application in the release instruction. In the application layer, the main process of the application is started, and after receiving the message event, it sends a get request to the server corresponding to the application based on the message event, thereby obtaining the message content sent by the server based on the get request. After receiving the message content, the main process of the application displays the message content according to its own display service.
[0104] Exemplarily, after the perception module starts the main process of the removed or frozen application based on the user operation, a communication channel is established between the message receiving service of the application and the main process. Fig.10 , Fig.10 A schematic diagram of a message processing method provided for an embodiment of the present application. In the application layer, after the application's message receiving service determines that the main process of the application is started, or after receiving a message event, the application's message receiving service requests the perception module in the framework to establish a communication channel, and the perception module returns a request response to the application's message receiving service, which indicates that a channel is allowed to be established between the application's main process and the application's message receiving service, and then the application's message receiving service establishes a communication channel with the application's main process through the channel driver of the kernel layer, thereby sending the message event received after the communication channel is established to the application's main process, thereby ensuring the implementation of the message push service.
[0105] In the embodiment of the present application, the system resources of the terminal device include memory resources and CPU resources, wherein the removal of the main process of the application indicates that the main process of the application does not occupy the memory resources and CPU resources of the terminal device, and the freezing of the main process of the application indicates that the main process of the application does not occupy the CPU resources of the terminal device. Therefore, when the perception module determines that the main process of the application is removed or frozen, and the application is set to prohibit the automatic start of the main process, the interception module is notified to enable the interception module to keep the main process of the application removed or frozen, and prohibit the communication between the message receiving service of the application and the main process, so as to prevent the message receiving service of the application from automatically starting the main process of the application, thereby reducing the occupation of system resources by the main process of the application. The message event is prompted for message reception through the display module, so that the user perceives the reception of the message event, ensuring that the user's real-time perception of the message event is met. After the removed or frozen main process is started, the message event is sent to the started main process to achieve the replay of the message event, ensuring that there is no loss problem of the message event, and ensuring the security and accuracy of the message push service.
[0106] The embodiment of the present application also proposes a message processing device for executing each step in the above method. The relevant features can be found in the introduction of the above embodiment and will not be repeated here. Fig.11 A schematic diagram of the structure of a message processing device provided in an embodiment of the present application.
[0107] See also Fig.11 , the device includes a receiving unit 1110 and a processing unit 1120;
[0108] The receiving unit 1110 is used to receive a message event, and the message event is used to notify the application corresponding to the message event to obtain the message content; the processing unit 1120 is used to determine that the main process of the application is removed or frozen, and determine that the application is set to prohibit automatic startup of the main process, keeping the main process of the application removed or frozen; and provide a message reception prompt based on the message event.
[0109] In some embodiments, the processing unit 1120 is specifically used to: if the application is set with configuration information or the application exists in the application list, determine that the application is set to prohibit automatic starting of the main process; wherein the application list includes identification information of the application that is set to prohibit automatic starting of the main process, and the configuration information is used to indicate that automatic starting of the main process is prohibited.
[0110] In some embodiments, the configuration information of the application is set by the system, or is set based on user operations.
[0111] In some embodiments, the application list is set by the system; or, the application list is generated based on user operations; or, some applications in the application list are set by the system, and other applications are set based on user operations.
[0112] In some embodiments, the processing unit 1120 is specifically used to: update an identifier corresponding to the application on an interface displayed on the terminal device, where the identifier is used to indicate the number of received message events.
[0113] In some embodiments, the processing unit 1120 is also used to: cache message events of the application after determining that the main process of the application is removed or frozen and the application is set to prohibit automatic startup of the main process; start the main process of the application according to user operations after providing a message reception prompt based on the message event; send the cached message events of the application to the main process of the application; and display the message content, which is obtained by the main process of the application from the server based on the message event.
[0114] In some embodiments, the processing unit 1120 is further used to: after starting the main process of the application according to a user operation, establish a communication channel between the message receiving service of the application and the main process.
[0115] In some embodiments, the processing unit 1120 is further configured to: before the message event is received, when the terminal device meets a resource occupation condition, remove or freeze the main process of the application in the running state.
[0116] In a simple embodiment, those skilled in the art can imagine that the page rendering device in the above embodiment can be used Fig.12 As shown in the form. Fig.12 As shown, the device 1200 includes at least one processor 1210 and an interface circuit 1220. The processor 1210 and the interface circuit 1220 are coupled to each other. It is understandable that the interface circuit 1220 can be a transceiver or an input-output interface. Optionally, the device 1200 may also include a memory 1230 for storing instructions executed by the processor 1210 or storing input data required for the processor 1210 to run the instructions or storing data generated after the processor 1210 runs the instructions. The specific connection medium between the above-mentioned processor 1210 and the memory 1230 is not limited in the embodiment of the present application. When the processor 1210 communicates with other devices, data can be transmitted through the interface circuit 1220.
[0117] When the device 1200 is used to implement the above Figure 4 , Figure 5 When the method is shown, the processor 1210 is used to implement the functions of the above-mentioned processing unit 1120, and the interface circuit 1220 is used to implement the functions of the above-mentioned receiving unit 1110.
[0118] When the device 1200 is applied to a chip of a terminal, the terminal chip implements the functions of the terminal device in the above method embodiment. The terminal chip receives information from other modules (such as a radio frequency module or an antenna) in the terminal device, and the information is sent by the network device to the terminal device; or the terminal chip sends information to other modules (such as a radio frequency module or an antenna) in the terminal device, and the information is sent by the terminal to the network device.
[0119] When the device 1200 is applied to a module of a network device, the network device module implements the functions of the network device in the above method embodiment. The network device module receives information from other modules in the network device (such as a radio frequency module or an antenna), and the information is sent by the terminal to the network device; or, the network device module sends information to other modules in the network device (such as a radio frequency module or an antenna), and the information is sent by the network device to the terminal device. The network device module here can be a baseband chip of the network device, or it can be a DU or other module, and the DU here can be a DU under the open radio access network (openradio access network, O-RAN) architecture.
[0120] It is understandable that the processor in the embodiments of the present application may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. The general-purpose processor may be a microprocessor or any conventional processor.
[0121] It should be understood that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of complete hardware embodiments, complete software embodiments, or embodiments in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0122] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0123] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0124] Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present application without departing from the scope of the embodiments of the present application. Thus, if these modifications and variations of the embodiments of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A message processing method, characterized in that: The method is applied to a terminal device, comprising: Receive a message event, where the message event is used to notify an application corresponding to the message event to obtain message content; Determining that the main process of the application is removed or frozen, and determining that the application is set to prohibit automatic start of the main process, and keeping the main process of the application removed or frozen; A message reception prompt is provided according to the message event.
2. The method according to claim 1, characterized in that The determining that the application is set to prohibit automatic start of the main process includes: If the application is set with configuration information or the application exists in the application list, determining that the application is set to prohibit automatic start of the main process; The application list includes identification information of applications that are set to prohibit automatic startup of the main process, and the configuration information is used to indicate prohibition of automatic startup of the main process.
3. The method according to claim 2, characterized in that The configuration information of the application is set by the system or based on user operations.
4. The method according to claim 2, characterized in that: The application list is set by the system; or, The application list is generated based on user operations; or, Some applications in the application list are set by the system, and other applications are set based on user operations.
5. The method according to any one of claims 1 to 4, characterized in that: Prompting message reception according to the message event includes: Update and display the identifier corresponding to the application on the interface of the terminal device, where the identifier is used to indicate the number of received message events.
6. The method according to any one of claims 1 to 5, characterized in that: After determining that the main process of the application is removed or frozen, and the application is set to prohibit automatic start of the main process, the method further includes: Cache message events of the application; After the message receiving prompt is performed according to the message event, the method further includes: Starting the main process of the application according to user operation; Sending the cached message events of the application to the main process of the application; Display the message content, where the message content is obtained by the main process of the application from the server according to the message event.
7. The method according to claim 6, characterized in that After starting the main process of the application according to the user operation, the method further includes: A communication channel is established between the message receiving service of the application and the main process.
8. The method according to any one of claims 1 to 7, characterized in that: Before the message receiving event, it also includes: When the terminal device meets the resource occupation condition, the main process of the application in the running state is removed or frozen.
9. A device, characterized in that: comprising a receiving unit and a processing unit; The receiving unit is used to receive a message event, where the message event is used to notify an application corresponding to the message event to obtain message content; The processing unit is used to determine that the main process of the application is removed or frozen, and determine that the application is set to prohibit automatic start of the main process, and keep the main process of the application removed or frozen; And a message reception prompt is performed according to the message event.
10. The device according to claim 9, characterized in that The processing unit is specifically used for: If the application is set with configuration information or the application exists in the application list, determining that the application is set to prohibit automatic start of the main process; The application list includes identification information of applications that are set to prohibit automatic startup of the main process, and the configuration information is used to indicate prohibition of automatic startup of the main process.
11. The device according to claim 10, characterized in that The configuration information of the application is set by the system or based on user operations.
12. The device according to claim 10, characterized in that The application list is set by the system; or, The application list is generated based on user operations; or, Some applications in the application list are set by the system, and other applications are set based on user operations.
13. The device according to any one of claims 9 to 12, characterized in that: The processing unit is specifically used for: Update and display the identifier corresponding to the application on the interface of the terminal device, where the identifier is used to indicate the number of received message events.
14. The device according to any one of claims 9 to 13, characterized in that: The processing unit is also used for: After determining that the main process of the application is removed or frozen and the application is set to prohibit automatic start of the main process, caching message events of the application; After the message reception prompt is performed according to the message event, the main process of the application is started according to the user operation; Sending the cached message events of the application to the main process of the application; Display the message content, where the message content is obtained by the main process of the application from the server according to the message event.
15. The device according to claim 14, characterized in that The processing unit is also used for: After the main process of the application is started according to the user operation, a communication channel is established between the message receiving service of the application and the main process.
16. The device according to any one of claims 9 to 15, characterized in that: The processing unit is also used for: Before the message receiving event, when the terminal device meets the resource occupation condition, the main process of the application in the running state is removed or frozen.
17. A readable storage medium, characterized in that: The readable storage medium includes a program, and when the program is executed on a device, the device is caused to execute the method according to any one of claims 1 to 8.
18. A device, characterized in that: include: One or more processors; wherein, when instructions of one or more computer programs are executed by the one or more processors, the device performs the method according to any one of claims 1-8.
19. A chip system, characterized in that: The system comprises at least one chip and a memory, wherein the at least one chip is coupled to the memory and is used to read and execute program instructions stored in the memory to implement the method as described in any one of claims 1 to 8.
20. A computer program product, characterized in that When the computer program product is called by a computer, the computer is caused to execute the method according to any one of claims 1 to 8.
