CN118069240A - Application keep-alive method, device, equipment, storage medium and program product - Google Patents

Application keep-alive method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN118069240A
CN118069240A CN202410159690.9A CN202410159690A CN118069240A CN 118069240 A CN118069240 A CN 118069240A CN 202410159690 A CN202410159690 A CN 202410159690A CN 118069240 A CN118069240 A CN 118069240A
Authority
CN
China
Prior art keywords
foreground
application
push message
keep
application program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202410159690.9A
Other languages
Chinese (zh)
Inventor
孙鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bigo Technology Pte Ltd
Original Assignee
Bigo Technology Pte Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bigo Technology Pte Ltd filed Critical Bigo Technology Pte Ltd
Priority to CN202410159690.9A priority Critical patent/CN118069240A/en
Publication of CN118069240A publication Critical patent/CN118069240A/en
Pending legal-status Critical Current

Links

Landscapes

  • Stored Programmes (AREA)

Abstract

The embodiment of the application provides an application program keep-alive method, an application program keep-alive device, a storage medium and a program product, wherein the method comprises the following steps: and under the condition that the application program receives the push message, starting a pre-registered foreground service associated with the application program, creating a foreground notification bar in the foreground service, and displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state. According to the scheme, the application running in the background can be efficiently kept alive, the disturbance to the user is reduced while the application is in an active state, and the user experience and the keep-alive capability of the application are improved.

Description

Application keep-alive method, device, equipment, storage medium and program product
Technical Field
Embodiments of the present application relate to the field of computer technologies, and in particular, to a method, an apparatus, a device, a storage medium, and a program product for keeping an application program alive.
Background
During the operation of the system, in order to optimize the battery life, the system performance, etc., the system will typically automatically clean the background application, resulting in the application terminating operation. For some important applications, it is necessary to take measures such that the application can remain active without being terminated by the system while the system is running in the background.
In the related art, a keep-alive method is mainly adopted, and after a process corresponding to an application is ended, an independent daemon is used for restarting the ended process. For example, a separate daemon is created that is responsible for monitoring the state of the main process of the application and restarting the main process of the application if it is killed by the system. Or using third party software, when the process of the application is monitored to be ended, the ended process is called up. However, the above-mentioned processing method increases the chance of being activated again only after the process is finished, and the purpose of keeping alive is not achieved substantially. Meanwhile, applications that overuse daemons may be limited by the system, which is detrimental to the normal operation of the applications.
Disclosure of Invention
The embodiment of the application provides an application program keep-alive method, device, equipment, storage medium and program product, which solve the problems of low application keep-alive efficiency and unfavorable normal running of an application caused by restarting an application process through a daemon process or a third-party software when the application process is ended in the related technology, can reduce the disturbance to a user while ensuring that the application is in an active state, and improve the user experience and the keep-alive capability of the application.
In a first aspect, an embodiment of the present application provides an application keep-alive method, including:
under the condition that an application program receives a push message, starting a pre-registered foreground service associated with the application program, wherein the foreground service pre-creates a foreground notification bar;
binding the push message with the foreground service;
And displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
In a second aspect, an embodiment of the present application further provides an application keep-alive device, including:
The starting module is configured to start a pre-registered foreground service associated with the application program under the condition that the application program receives the push message, wherein the foreground service is pre-created with a foreground notification bar;
a creation module configured to create a foreground notification bar in the foreground service;
And the display module is configured to display the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
In a third aspect, an embodiment of the present application further provides an application keep-alive device, including:
One or more processors;
Storage means for storing one or more programs,
When the one or more programs are executed by the one or more processors, the one or more processors implement the application keep-alive method according to the embodiment of the application.
In a fourth aspect, embodiments of the present application also provide a storage medium storing computer-executable instructions that, when executed by a computer processor, are configured to perform the application keep-alive method of embodiments of the present application.
In a fifth aspect, the embodiment of the present application further provides a computer program product, where the computer program product includes a computer program, where the computer program is stored in a computer readable storage medium, and where at least one processor of the device reads and executes the computer program from the computer readable storage medium, so that the device executes the application keep-alive method according to the embodiment of the present application.
In the embodiment of the application, when the application program receives the push message, a pre-registered foreground service associated with the application program is started, a foreground notification bar is created in the foreground service, and the push message is displayed through the foreground notification bar, so that the application program is in a keep-alive state. When the application program receives the push message, the application program is displayed in the foreground notification bar created by the foreground service, and the application program can still keep active when the system background runs by utilizing the characteristic of high keep-alive priority of the foreground service. Meanwhile, the method is executed under the condition that the application program receives the push message, the push message is normally displayed, the active state of the application program is ensured, the disturbance to a user is avoided, and the user experience and the application keep-alive capability are improved.
Drawings
FIG. 1 is a flowchart of an application keep-alive method according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a foreground notification bar display message according to an embodiment of the present application;
FIG. 3 is a flowchart of another method for maintaining an application alive according to an embodiment of the application;
FIG. 4 is a flowchart of another method for maintaining an application alive in accordance with an embodiment of the application;
FIG. 5 is a flowchart of another method for maintaining an application alive according to an embodiment of the application;
FIG. 6 is a flowchart of another method for maintaining an application alive in accordance with an embodiment of the application;
FIG. 7 is a block diagram of a module configuration of an application keep-alive device according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an application keep-alive device according to an embodiment of the present application.
Detailed Description
Embodiments of the present application will be described in further detail below with reference to the drawings and examples. It should be understood that the particular embodiments described herein are illustrative only and are not limiting of embodiments of the application. It should be further noted that, for convenience of description, only some, but not all of the structures related to the embodiments of the present application are shown in the drawings.
The terms first, second and the like in the description and in the claims, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged, as appropriate, such that embodiments of the present application may be implemented in sequences other than those illustrated or described herein, and that the objects identified by "first," "second," etc. are generally of a type, and are not limited to the number of objects, such as the first object may be one or more. Furthermore, in the description and claims, "and/or" means at least one of the connected objects, and the character "/", generally means that the associated object is an "or" relationship.
The application program keep-alive method provided by the embodiment of the application can be used for ensuring that the application can still keep a certain active state when running in the background, and the related application scene can be the application program keep-alive method adopted under the operating systems such as Android, apple, windows and the like aiming at certain specific applications needing to keep-alive. For example, some applications that need to be kept alive are set by a user, or in the case that an application program determines that a keep alive policy needs to be executed at the time of installation, the application program keep alive method of the scheme is adopted when the application program runs. Of course, the method is not limited to the triggering mode, and is applicable to other reasonable and feasible application scenes.
The execution main body of each step of the application program keep-alive method provided by the embodiment of the application can be computer equipment, and the computer equipment refers to any electronic equipment with data calculation, processing and storage capabilities, such as terminal equipment of a mobile phone, a PC (Personal Computer, a personal computer), a tablet personal computer and the like, and also can be equipment of a server and the like.
Fig. 1 is a flowchart of an application keep-alive method according to an embodiment of the present application, where, as shown in fig. 1, the method includes:
Step S101, when the application program receives the push message, starting a pre-registered foreground service associated with the application program.
Wherein an application is a computer program that performs one or more specific tasks, that can run under an operating system, and that is capable of interacting with a user. In the case of a mobile phone terminal provided with an Android operating system, the mobile phone terminal can be provided with a plurality of application programs and operates in the system. Alternatively, the application program in this step is a preset or default application program that needs to execute the keep-alive policy, and may be set by a user or determined when the application is installed. The application program may be, for example, an instant messaging application developed by a designer.
The push message may be a message sent by the server based on the push service, or may be a notification sent by other terminal devices. Different applications correspond to different push messages. In case it receives the push message, a pre-registered foreground service associated with the application is started. The foreground service is a service which is visible to a user and does not allow the system to kill when the system memory is insufficient, has higher priority, and the system is more prone to keep the service running.
In one embodiment, before starting the pre-registered application associated foreground service, the method further comprises: in the event that application launch is detected, a foreground service associated with the application is created and registered in a system file. Optionally, taking the application program a in the mobile phone terminal as an example, triggering a creation instruction under the condition that the application program a is detected to be started, automatically creating a foreground service associated with the application program a, and registering the foreground service associated with the application program a in a global configuration file of the system. Taking Android operating system as an example, a foreground Service class of class inherited from Service may be created, and the foreground Service is registered in Android management.
Step S102, a foreground notification bar is created in the foreground service.
The foreground notification bar is a setting area visible on an operation interface when the terminal equipment capable of displaying the notification operates. Optionally, after the foreground service associated with the application program is started, a foreground notification bar is correspondingly created. Taking the foreground service as an example, a foreground service class is created and registered, a foreground notification bar may be created in the foreground service class for displaying a subsequent push message.
And step 103, displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
Wherein, the keep-alive state refers to a state that an application program can still keep certain activity when running in the background, and is not terminated by a system so as to provide services. In the step of receiving the push message, the push message is displayed by using a foreground notification bar created in the foreground service.
Alternatively, an exemplary display process may be: and setting a message attribute of the foreground notification, and displaying the push message in a foreground notification column based on the message attribute. As shown in fig. 2, fig. 2 is a schematic diagram of a foreground notification bar display message provided in an embodiment of the present application, where 01 is a terminal display interface, and 02 is a foreground notification bar, and a title, content, and a related avatar of a push message may be displayed in the foreground notification bar. The title, content and the position and size of the related head portrait of the specific push message can be determined by the preset message attribute, and the display category can be set by the message attribute, for example, only the title and content of the push message are displayed, or only the content and the corresponding head portrait of the push message are displayed. When the push message is displayed, the corresponding category and the push message under the display position are displayed based on the set message attribute.
Optionally, taking the Android operating system as an example, after the creation of the foreground notification bar is completed in step S102, a foreground notification channel is created correspondingly, and the message attribute is set through notificationcompat builder. The manner of displaying the push message through the foreground notification bar may be: the push message is displayed in the foreground notification bar using method startForeground in the foreground service. Of course, the Android operating system is taken as an example here, and other specific implementations of the operating system can be adaptively adjusted, which is not limited by the only way to display notifications.
As is clear from the above, when the application receives the push message, a pre-registered foreground service associated with the application is started, a foreground notification bar is created in the foreground service, and the push message is displayed in the foreground notification bar so that the application is in a keep-alive state. When the application program receives the push message, the application program is displayed in the foreground notification bar created by the foreground service, and the application program can still keep active when the system background runs by utilizing the characteristic of high keep-alive priority of the foreground service. Meanwhile, in the scheme, the push message is displayed through the foreground service, rather than keep-alive through the mode of generating the additional display content, the push message is executed under the condition that the application program receives the push message, the push message is normally displayed, meanwhile, the active state of the application program is ensured, the disturbance to a user is avoided, and the user experience and the keep-alive capability of the application are improved.
Fig. 3 is a flowchart of another method for keeping alive application program according to an embodiment of the application, as shown in fig. 3, including:
Step S201, when the application program receives the push message, starting a pre-registered foreground service associated with the application program.
Step S202, determining whether the push message is a binding message, and responding to a judging result that the push message is the binding message, creating a foreground notification bar in a foreground service for binding the push message and the foreground service.
In one embodiment, in the case that the application receives the push message, it is characterized that the application is in an active state, at which time the start of the pre-registered application-associated foreground service is completed in step S101. After the foreground service is started, not every push message is displayed through a foreground notification bar created by the foreground service. And firstly determining whether the push message is a binding message, if so, displaying a foreground notification bar created by a foreground service, otherwise, not displaying the foreground notification bar created by the foreground service. Alternatively, the push message may be displayed by applying a default display mode. Therefore, the problem that the user does not apply the application program frequently but keeps alive for a long time can be avoided, and the balance between keep alive and ending process is achieved.
The binding message is a push message that needs to be displayed through a foreground notification bar created by a foreground service, and the judgment condition of whether the push message is the binding message may be exemplified as follows: determining the inactive time length of the application program, determining the number of binding messages on the same day according to the set activity condition and the inactive time length, judging whether the push message is in the number of binding messages, and correspondingly, judging that the push message is the binding message if the push message is in the number of binding messages.
Optionally, the inactive duration is a time from a current time to a last time the application is active, where the activity may be determined that the application is active after the user clicks on and/or has used the application. The liveness condition is a judging condition of binding messages with different numbers corresponding to different set inactive time periods. The optional policy for determining the number of binding messages on the same day according to the set liveness condition and the inactive time length may be: if the application program is not active for more than or equal to 48 hours, determining the first 2 push messages received on the same day as binding messages; if the application program is not active for more than or equal to 3 days, determining the first 3 push messages received in the same day as binding messages; if the application program is not active for more than or equal to 5 days, determining the first 5 push messages received in the same day as binding messages; if the application program is not active for 7 days or more, the first 10 push messages received in the same day are determined to be binding messages.
For example, taking the case that the application program is not active for more than or equal to 48 hours, it is determined that the push message received by the current application program is the fifth push message, and is not within the first 2 push messages received on the same day, and then the push message is not a binding message.
In another embodiment, the manner of determining whether the push message is a binding message may also be: and carrying out semantic recognition on the push message received by the application program, determining whether the push message received by the application program is an important notification message according to a recognition result, and determining the push message determined to be the important notification message as a binding message. The important notification message may be, for example, a push message related to a change in the amount and a date and time.
And step 203, displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
After the pre-registered foreground service associated with the application program is started, whether the push message is a binding message or not is determined, and a foreground notification bar is created in the foreground service in response to a judgment result that the push message is the binding message and used for binding the push message and the foreground service. The push message determined to be the binding message is displayed by creating the foreground notification bar, so that excessive binding of the foreground service binding message and too frequent binding display can be avoided, and meanwhile, the problem that a user is not frequently applicable to the application program but keeps alive for a long time can be avoided, and the balance between keep alive and ending processes is achieved.
Fig. 4 is a flowchart of another method for keeping alive application program according to an embodiment of the application, as shown in fig. 4, including:
Step S301, when the application program receives the push message, starting a pre-registered foreground service associated with the application program.
Step S302, determining whether the push message is a binding message, and responding to a judging result that the push message is the binding message, creating a foreground notification bar in a foreground service for binding the push message and the foreground service.
And step S303, displaying the push message through the foreground notification bar.
Step S304, determining a binding duration according to the set liveness condition and the inactive duration, and unbinding the push message and the foreground service under the condition that the display time of the push message displayed by the foreground notification bar reaches the binding duration.
Optionally, the liveness condition includes a binding duration of each binding message in addition to the number of binding messages corresponding to different inactive durations. In one embodiment, the longer the application inactive time period, the less time the user typically uses the application, the less importance the application is to the user, and therefore the longer the application inactive time period, the shorter the corresponding binding time period. An exemplary policy may be: if the application program is not active for more than or equal to 48 hours, determining that the binding duration of each push message is 30 minutes; if the application program is not active for more than or equal to 3 days, determining that the binding duration of each push message is 20 minutes; if the application program is not active for more than or equal to 5 days, determining that the binding duration of each push message is 10 minutes; if the application program is not active for 7 days or more, determining that the binding duration of each push message is 5 minutes.
For example, taking the case that the application program is not active for more than or equal to 48 hours, the binding duration of each push message is 30 minutes, for example, the binding time of the current binding message b and the foreground service is 30 minutes, and it can be known that the binding time of the binding message b and the foreground service has reached the corresponding binding duration, and the binding of the binding message b and the foreground service is released. Alternatively, the unbinding process may be to clear the push message displayed in the foreground notification bar, or display the push message in a default display mode of the application program.
According to the method, in the process of binding the push message and the foreground service, different binding time lengths are determined based on the inactive time length of the application program, the keep-alive time length of the application program can be determined in a self-adaptive mode according to the activity degree of the application program, and the problems of system resource occupation and terminal operation cartoon caused by long-time keep-alive of the application program with low activity degree are avoided.
Fig. 5 is a flowchart of another method for keeping alive application program according to an embodiment of the application, as shown in fig. 5, including:
step S401, when the application program receives the push message, starting a pre-registered foreground service associated with the application program.
Step S402, a foreground notification bar is created in the foreground service.
Step S403, displaying the push message through the foreground notification bar, so that the application is in a keep-alive state.
Step S404, starting a foreground service process under the condition that the displayed push message is cleared, and binding the foreground service process with the push message so as to enable the application program to be in a keep-alive state.
The foreground service process is used for representing a preset process running in the foreground, and is different from the foreground service associated with the application program. After the push message is displayed through the foreground notification bar of the foreground service associated with the application program, starting a foreground service process under the condition that the push message displayed by the foreground notification bar is cleared, and binding the foreground service process with the cleared push message so as to ensure that the application program is still in a keep-alive state after the push message is cleared. In one embodiment, the clear condition of the push message that triggers the foreground notification bar display may be a push message that the user clicks on the foreground notification or a click off the foreground notification message. Alternatively, the binding process may be a foreground service process referencing the push message.
As can be seen from the above, after the push message is displayed through the foreground notification bar of the foreground service associated with the application, if the push message displayed in the foreground notification bar is cleared, the foreground service process is started, and the foreground service process is bound with the cleared push message, so that the corresponding application is in a keep-alive state. When the user clears the displayed push message, the new foreground service process is started, and the push message cleared currently is bound, so that the push message can still be bound with the foreground service process after being cleared, and keep-alive is realized.
Fig. 6 is a flowchart of another method for keeping alive application program according to an embodiment of the application, as shown in fig. 6, including:
Step S501, when the application program receives the push message, starting a pre-registered foreground service associated with the application program.
Step S502, a foreground notification bar is created in the foreground service.
And step S503, displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
Step S504, starting a system account synchronization mechanism, and calling the application program through the created synchronization adapter in the running process of the system account synchronization mechanism; and/or the application program is awakened at fixed time through the configured fixed-time awakening task, so that the application program is in a keep-alive state.
In one embodiment, in addition to creating a foreground notification bar in the foreground service, displaying a push message through the foreground notification bar to enable the application to be in a keep-alive state, the keep-alive probability of the application can be further improved in a synchronous mode by adopting the two modes described in step S504. It should be noted that, the mechanism execution manner described in step S504 is not limited to the creation of the foreground notification bar in the foreground service, and may be executed after the push message is displayed in the foreground notification bar, and may be executed in parallel, which does not affect the limitation of the execution sequence.
In one embodiment, the system account synchronization mechanism, the timed wakeup task, and the push message binding foreground service mechanism are performed in parallel. Among other things, synchronization adapter is a mechanism in a system for data synchronization, typically used in conjunction with an account synchronization framework. The system account synchronization mechanism is generally used for synchronizing application data to the cloud or from the cloud to the local, and the account synchronization is realized through a mechanism of a synchronization adapter so as to achieve the purpose of live pulling. The method comprises the steps of utilizing a system account synchronization mechanism to keep an application program alive, creating a class of a synchronization adapter inheriting from an abstract class for synchronization operation of an account, realizing synchronization logic, registering the synchronization adapter in a configuration file, creating an XML file to configure attributes of the synchronization adapter, creating and managing the account of an application by using an account manager, and requesting synchronization operation where synchronization is needed. In addition, the corresponding application program can be periodically awakened through the configured timed awakening task so as to enable the application program to be in a keep-alive state, and the timed awakening of the application program is realized through ALARMMANAGER (global timer), workManager (work manager), jobScheduler (job scheduling program) and other different mechanisms for processing background tasks and periodically executing tasks.
In one embodiment, the system account of the application program a is synchronized with the system account of the application program b, c, d, e, and the application program b, c, d, e is invoked to run through the created synchronization adapter while the application program a is running during the running of the system account synchronization mechanism.
The processing mechanism for the timed wake-up task may be to start JobService using JobScheduler when the application is started, and set corresponding execution conditions, such as network conditions, charging states, and the like, and a period for executing the wake-up task in the background, and wake up the application periodically based on the setting condition.
As can be seen from the above, the application keep-alive method further includes starting a system account synchronization mechanism, and calling a corresponding application program through the created synchronization adapter during the running process of the system account synchronization mechanism; and/or the corresponding application program is periodically awakened through the configured timed awakening task, so that the application program is in a keep-alive state. The scheme utilizes a system account synchronization mechanism and a timed wake-up task, combines different system keep-alive mechanisms to improve the background keep-alive capability of the application, and increases the possibility of continuous operation of the application in the background by comprehensively utilizing system resources.
Fig. 7 is a block diagram of a module structure of an application keep-alive device according to an embodiment of the present application, where the device is configured to execute an application keep-alive method according to the foregoing embodiment, and the device has functional modules and beneficial effects corresponding to the execution method. As shown in fig. 7, the apparatus includes:
A starting module 101, configured to start a pre-registered foreground service associated with an application program, where the foreground service creates a foreground notification bar in advance, when the application program receives a push message;
A creation module 102 configured to create a foreground notification bar in the foreground service;
and the display module 103 is configured to display the push message through the foreground notification bar so as to keep the application program in a keep-alive state.
As can be seen from the above-described scheme, when an application receives a push message, a pre-registered foreground service associated with the application is started, a foreground notification bar is created in the foreground service, and the push message is displayed through the foreground notification bar so that the application is in a keep-alive state. When the application program receives the push message, the application program is displayed in the foreground notification bar created by the foreground service, and the application program can still keep active when the system background runs by utilizing the characteristic of high keep-alive priority of the foreground service. Meanwhile, the method is executed under the condition that the application program receives the push message, the push message is normally displayed, the active state of the application program is ensured, the disturbance to a user is avoided, and the user experience and the application keep-alive capability are improved.
In one possible embodiment, the creation module 102 is further configured to:
Under the condition that the starting of an application program is detected, creating a foreground service class associated with the application program, and registering corresponding foreground service in a system file;
and creating a foreground notification bar in the foreground service class for displaying push messages.
In one possible embodiment, the apparatus further includes a determination module configured to:
before a foreground notification bar is created in the foreground service, determining whether the push message is a binding message;
Accordingly, the creation module is configured to:
And responding to the judgment result that the push message is the binding message, and creating a foreground notification bar in the foreground service, wherein the foreground notification bar is used for binding the push message and the foreground service.
In one possible embodiment, the determining module is configured to:
Determining the non-active time length of the application program, determining the number of binding information strips on the same day according to the set activity condition and the non-active time length, and judging whether the push information is in the number of binding information strips or not;
Correspondingly, the push message is a binding message, including:
the push message is within the binding message number.
In one possible embodiment, the apparatus further unbinding module is configured to:
After the push message is displayed through the foreground notification bar, determining a binding time length according to a set liveness condition and the inactive time length;
and under the condition that the display time of the push message displayed by the foreground notification bar reaches the binding duration, the binding between the push message and the foreground service is released.
In one possible embodiment, the apparatus further comprises a process binding module configured to:
After the push message is displayed through the foreground notification bar, starting a foreground service process under the condition that the displayed push message is cleared, and binding the foreground service process with the push message so as to enable the application program to be in a keep-alive state.
In one possible embodiment, the display module is configured to:
setting message attributes of foreground notification;
and displaying the push message on the foreground notification bar based on the message attribute.
In one possible embodiment, the device further includes an account synchronization module and a timed wake-up module, and further includes:
The account synchronization module is configured to start a system account synchronization mechanism, and call the application program through the created synchronization adapter in the running process of the system account synchronization mechanism so as to enable the application program to be in a keep-alive state;
The timing wake-up module is configured to:
And waking the application program at fixed time through the configured fixed-time wake-up task so as to enable the application program to be in a keep-alive state.
Fig. 8 is a schematic structural diagram of an application keep-alive device according to an embodiment of the present application, and as shown in fig. 8, the device includes a processor 201, a memory 202, an input device 203, and an output device 204; the number of processors 201 in the device may be one or more, one processor 201 being taken as an example in fig. 8; the processor 201, memory 202, input devices 203, and output devices 204 in the apparatus may be connected by a bus or other means, for example in fig. 8. The memory 202 is used as a computer readable storage medium for storing software programs, computer executable programs and modules, such as program instructions/modules corresponding to the application keep-alive method in the embodiment of the application. The processor 201 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory 202, i.e., implements the application keep-alive method described above. The input means 203 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output device 204 may include a display device such as a display screen.
Embodiments of the present application also provide a storage medium containing computer-executable instructions for performing an application keep-alive method when executed by a computer processor, the method comprising:
under the condition that an application program receives a push message, starting a pre-registered foreground service associated with the application program, wherein the foreground service pre-creates a foreground notification bar;
binding the push message with the foreground service;
And displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
It should be noted that, in the embodiment of the application keep-alive method system, each unit and module included are only divided according to the functional logic, but are not limited to the above-mentioned division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
In some possible embodiments, aspects of the method provided by the present application may also be implemented in the form of a program product, which includes a program code configured to cause a computer device to perform the steps of the method according to the various exemplary embodiments of the application described in the present specification when the program product is run on the computer device, for example, the computer device may perform the video transcoding method described in the embodiments of the present application. The program product may be implemented using any combination of one or more readable media.

Claims (12)

1. An application keep-alive method, comprising:
starting a pre-registered foreground service associated with an application program under the condition that the application program receives a push message;
creating a foreground notification bar in the foreground service;
And displaying the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
2. The application keep-alive method of claim 1, further comprising, prior to the launching of the pre-registered foreground service associated with the application:
Under the condition that the starting of an application program is detected, creating a foreground service class associated with the application program, and registering corresponding foreground service in a system file;
the creating a foreground notification bar in the foreground service comprises:
and creating a foreground notification bar in the foreground service class for displaying push messages.
3. The application keep-alive method of claim 1, further comprising, prior to creating a foreground notification bar in the foreground service:
determining whether the push message is a binding message;
correspondingly, the creating the foreground notification bar in the foreground service comprises the following steps:
And responding to the judgment result that the push message is the binding message, and creating a foreground notification bar in the foreground service, wherein the foreground notification bar is used for binding the push message and the foreground service.
4. The application keep-alive method of claim 3, wherein the determining whether the push message is a binding message comprises:
Determining the non-active time length of the application program, determining the number of binding information strips on the same day according to the set activity condition and the non-active time length, and judging whether the push information is in the number of binding information strips or not;
Correspondingly, the push message is a binding message, including:
the push message is within the binding message number.
5. The application keep-alive method of claim 4, further comprising, after the displaying the push message via the foreground notification bar:
determining a binding time length according to the set liveness condition and the inactive time length;
and under the condition that the display time of the push message displayed by the foreground notification bar reaches the binding duration, the binding between the push message and the foreground service is released.
6. The application keep-alive method of any one of claims 1-5, further comprising, after the displaying the push message through the foreground notification bar:
And under the condition that the displayed push message is cleared, starting a foreground service process, and binding the foreground service process with the push message so as to enable the application program to be in a keep-alive state.
7. The application keep-alive method of any one of claims 1-5, wherein the displaying the push message through the foreground notification bar comprises:
setting message attributes of foreground notification;
and displaying the push message on the foreground notification bar based on the message attribute.
8. The application keep-alive method of any one of claims 1-5, further comprising:
starting a system account synchronization mechanism, and calling the application program through the created synchronization adapter in the running process of the system account synchronization mechanism; and/or the number of the groups of groups,
And waking the application program at fixed time through the configured fixed-time wake-up task so as to enable the application program to be in a keep-alive state.
9. An application keep-alive device, comprising:
The starting module is configured to start a pre-registered foreground service associated with the application program under the condition that the application program receives the push message, wherein the foreground service is pre-created with a foreground notification bar;
a creation module configured to create a foreground notification bar in the foreground service;
And the display module is configured to display the push message through the foreground notification bar so as to enable the application program to be in a keep-alive state.
10. An application keep-alive device, the device comprising: one or more processors; a storage device configured to store one or more programs that, when executed by the one or more processors, cause the one or more processors to implement the application keep-alive method of any one of claims 1-8.
11. A non-transitory storage medium storing computer-executable instructions which, when executed by a computer processor, are configured to perform the application keep-alive method of any one of claims 1-8.
12. A computer program product comprising a computer program, characterized in that the computer program, when executed by a processor, implements the application keep-alive method of any one of claims 1-8.
CN202410159690.9A 2024-02-04 2024-02-04 Application keep-alive method, device, equipment, storage medium and program product Pending CN118069240A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410159690.9A CN118069240A (en) 2024-02-04 2024-02-04 Application keep-alive method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410159690.9A CN118069240A (en) 2024-02-04 2024-02-04 Application keep-alive method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN118069240A true CN118069240A (en) 2024-05-24

Family

ID=91098393

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410159690.9A Pending CN118069240A (en) 2024-02-04 2024-02-04 Application keep-alive method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN118069240A (en)

Similar Documents

Publication Publication Date Title
CN104252389B (en) application program operation method, system
CN106484509B (en) Output method and device of popup window and terminal
EP2977854B1 (en) Method, apparatus, and user terminal for removing malicious power consuming application
CN109992310A (en) Application program keepalive method, device, computer equipment and storage medium
US20180336060A1 (en) Method, terminal and storage medium for displaying media files
CN110058889A (en) A kind of application awakening method and device
EP2751666B1 (en) Terminal and application management method thereof
US10417062B2 (en) Method and apparatus of unloading out of memory processing flow to user space
CN112579304A (en) Resource scheduling method, device, equipment and medium based on distributed platform
CN111625322B (en) Data processing method, system and equipment
CN104346563A (en) Information processing method and electronic equipment
CN107391274A (en) The processing method and processing device of deferred information
CN107231386B (en) Application state conversion method and device and mobile terminal
CN114237896A (en) Distributed node resource dynamic scheduling method and device
WO2021037228A1 (en) System application management method and apparatus
CN113542256A (en) Method, device, equipment and storage medium for updating login credentials in client
CN110377140B (en) Method, device, terminal and storage medium for awakening operating system
CN118069240A (en) Application keep-alive method, device, equipment, storage medium and program product
CN103257894A (en) Program management method and electronic terminal
CN113676504B (en) Low-power-consumption distributed calling method, equipment and device
TW201041364A (en) Mobile device, power saving method and computer executable medium
CN107436674A (en) terminal control method, device and non-transitory computer-readable medium
CN114691343B (en) Polling task execution method and device, computer equipment and readable storage medium
WO2019071830A1 (en) Flash and js page efficient rendering communication method, storage medium, device, and system
EP4020131A1 (en) Power saving method for terminal and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination