Disclosure of Invention
Aiming at the defects in the prior art, the invention provides the timing keep-alive and awakening method, the timing keep-alive and awakening system, the timing keep-alive and awakening terminal and the timing keep-alive and awakening medium based on the mobile terminal, and the closed application can be automatically awakened in time without manual operation of a user.
In a first aspect, a timing keep-alive and wake-up method based on a mobile terminal includes:
setting a timer;
when the time of the timer is up, detecting whether the awakenable application exists in the mobile terminal;
if the awakenable application exists, awakening the awakenable application and recording an awakening result;
and generating a wake-up report according to the wake-up result, and reporting the wake-up report.
Further, when the timer time reaches, detecting whether the wakenable application exists in the mobile terminal specifically includes:
when the timer time is up, scanning all applications of preset awakening identifications configured in a target file of the mobile terminal;
and defining the application with the awakening identification configured in the target file as the awakenable application.
Further, the waking up the wakeable application specifically includes:
waking up a wakeable application by one or more of four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
fourthly, starting the BroadcastReceiver component configured in the awakenable application through sendBascast, and recording the awakening result.
Further, the waking up the wakeable application specifically includes:
judging whether the mobile terminal has an optimal awakening mode or not;
if so, waking up the awakenable application by adopting an optimal wake-up mode;
if not, the wakenable application is woken up by one or more of the following four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
starting a BroadcastReceiver component configured in the awakenable application through sendBascast, and recording an awakening result;
defining the awakening mode with successful awakening as the optimal awakening mode.
In a second aspect, a timing keep-alive and wake-up system based on a mobile terminal comprises a wake-up module and a reporting module;
the awakening module is used for setting a timer; when the timer time is up, detecting whether the awakenable application exists in the mobile terminal, and when the awakenable application exists, awakening the awakenable application and recording an awakening result;
and the reporting module is used for generating a wake-up report according to the wake-up result and reporting the wake-up report.
Further, when the timer time reaches, detecting whether the wakenable application exists in the mobile terminal specifically includes:
when the timer time is up, scanning all applications of preset awakening identifications configured in a target file of the mobile terminal;
and defining the application with the awakening identification configured in the target file as the awakenable application.
Further, the waking up the wakeable application specifically includes:
waking up a wakeable application by one or more of four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
fourthly, starting the BroadcastReceiver component configured in the awakenable application through sendBascast, and recording the awakening result.
Further, the waking up the wakeable application specifically includes:
judging whether the mobile terminal has an optimal awakening mode or not;
if so, waking up the awakenable application by adopting an optimal wake-up mode;
if not, the wakenable application is woken up by one or more of the following four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
starting a BroadcastReceiver component configured in the awakenable application through sendBascast, and recording an awakening result;
defining the awakening mode with successful awakening as the optimal awakening mode.
In a third aspect, a mobile terminal comprises a processor, an input device, an output device, and a memory, the processor, the input device, the output device, and the memory being connected to each other, wherein the memory is configured to store a computer program, the computer program comprising program instructions, and the processor is configured to call the program instructions to execute the method of the first aspect.
In a fourth aspect, a computer-readable storage medium stores a computer program comprising program instructions which, when executed by a processor, cause the processor to perform the method of the first aspect.
According to the technical scheme, the timing keep-alive and awakening method, the timing keep-alive and awakening system, the timing keep-alive terminal and the timing keep-alive and awakening medium based on the mobile terminal detect whether the awakenable application exists or not through the timer timing cycle, and if the awakenable application exists, the application can be immediately awakened, and the application which is closed can be automatically awakened in time without manual operation of a user.
Detailed Description
Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are only for illustrating the technical solutions of the present invention more clearly, and therefore are only examples, and the protection scope of the present invention is not limited thereby. It is to be noted that, unless otherwise specified, technical or scientific terms used herein shall have the ordinary meaning as understood by those skilled in the art to which the invention pertains.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In particular implementations, the terminals described in embodiments of the invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the terminal may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
The first embodiment is as follows:
referring to fig. 1, an embodiment provides a timing keep-alive and wake-up method based on a mobile terminal, including:
s1: setting a timer; for example, one detection may be triggered for 1 hour.
S2: when the time of the timer is up, detecting whether the awakenable application exists in the mobile terminal; referring to fig. 2, the method specifically includes:
when the timer time is up, scanning all applications of preset awakening identifications configured in a target file of the mobile terminal;
specifically, for a mobile terminal of the android system, the target file may be android manifest. And when the A application needs to be automatically awakened, configuring an awakening identifier for the A application in android manifest.
And defining the application with the awakening identification configured in the target file as the awakenable application.
S3: if the awakenable application exists, awakening the awakenable application and recording an awakening result;
specifically, for the mobile terminal of the android system, since the android system cross-process interaction technology is a technology supported by the system itself, the cross-process interaction technology can be used for target wake-up.
S4: and generating a wake-up report according to the wake-up result, and reporting the wake-up report.
The method detects whether the application which can be awakened exists or not through the timer timing cycle, and if the application which can be awakened exists, the application which is closed can be automatically awakened in time without manual operation of a user.
Example two:
due to the openness of the android system, each manufacturer system can change the native android system, so that the cross-process technology of each manufacturer system has certain limitation. So embodiment two proposes the following wake-up approach:
waking up a wakeable application by one or more of four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
fourthly, starting the BroadcastReceiver component configured in the awakenable application through sendBascast, and recording the awakening result.
Specifically, the above four methods are methods for waking up applications commonly used by a mobile terminal of the existing android system, and in the method, one or more of the above methods can be selected to wake up each time of waking up an application, so that the application can be timely woken up. In general, the first and third ways may be used simultaneously, or the first or second way may be selected to wake up.
Example three:
the second embodiment of the wake-up method has the following problem that it takes a long time to wake up the application by trying multiple wake-up methods each time. For the third embodiment, a wake-up method with memory function is proposed for the defects existing in the second embodiment, and refer to fig. 3:
judging whether the mobile terminal has an optimal awakening mode or not;
if so, waking up the awakenable application by adopting an optimal wake-up mode;
if not, the wakenable application is woken up by one or more of the following four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
starting a BroadcastReceiver component configured in the awakenable application through sendBascast, and recording an awakening result;
defining the awakening mode with successful awakening as the optimal awakening mode.
Specifically, when the method wakes up for the application a for the first time (there is no optimal wake up mode), the method may wake up for the application a by adopting a combination of the above four modes. Then, in the first awakening process, the awakening mode which is awakened successfully is defined as the optimal awakening mode, and in the subsequent awakening process (the optimal awakening mode exists), the awakening is carried out by the optimal awakening mode without trying a plurality of awakening modes every time of awakening, so that the awakening time is shortened.
Example four:
referring to fig. 4, a timing keep-alive and wake-up system based on a mobile terminal is provided in the fourth embodiment, and includes a wake-up module and a reporting module;
the awakening module is used for setting a timer; when the timer time is up, detecting whether the awakenable application exists in the mobile terminal, and when the awakenable application exists, awakening the awakenable application and recording an awakening result;
and the reporting module is used for generating a wake-up report according to the wake-up result and reporting the wake-up report.
Further, when the timer time reaches, detecting whether the wakenable application exists in the mobile terminal specifically includes:
when the timer time is up, scanning all applications of preset awakening identifications configured in a target file of the mobile terminal;
and defining the application with the awakening identification configured in the target file as the awakenable application.
Further, the waking up the wakeable application specifically includes:
waking up a wakeable application by one or more of four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
fourthly, starting the BroadcastReceiver component configured in the awakenable application through sendBascast, and recording the awakening result.
Further, the waking up the wakeable application specifically includes:
judging whether the mobile terminal has an optimal awakening mode or not;
if so, waking up the awakenable application by adopting an optimal wake-up mode;
if not, the wakenable application is woken up by one or more of the following four ways:
starting a Service component configured in the awakenable application through startService, and recording an awakening result;
starting a Service component configured in the awakenable application through bindService, and recording an awakening result;
starting a ContentProvider component configured in the awakenable application through the getType, and recording an awakening result;
starting a BroadcastReceiver component configured in the awakenable application through sendBascast, and recording an awakening result;
defining the awakening mode with successful awakening as the optimal awakening mode.
The system provided by the embodiment of the present invention has the same implementation principle and technical effect as the foregoing method embodiment, and for the sake of brief description, no mention is made in the system embodiment, and reference may be made to the corresponding contents in the foregoing method embodiment.
Example five:
referring to fig. 5, a fifth embodiment provides a mobile terminal, which includes aprocessor 101, aninput device 102, anoutput device 103, and amemory 104, where the processor, the input device, the output device, and the memory are connected to each other through abus 105, where the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions to execute the methods of the first to third embodiments.
It should be understood that, in the embodiment of the present invention, theProcessor 101 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Theinput device 102 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and theoutput device 103 may include a display (LCD, etc.), a speaker, etc.
Thememory 104 may include read-only memory and random access memory, and provides instructions and data to theprocessor 101. A portion of thememory 104 may also include non-volatile random access memory. For example, thememory 104 may also store device type information.
Example six:
a sixth embodiment provides a computer-readable storage medium storing a computer program comprising program instructions that, when executed by a processor, cause the processor to perform the method of the first to third embodiments.
The computer readable storage medium may be an internal storage unit of the terminal according to any of the foregoing embodiments, for example, a hard disk or a memory of the terminal. The computer readable storage medium may also be an external storage device of the terminal, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the terminal. Further, the computer-readable storage medium may also include both an internal storage unit and an external storage device of the terminal. The computer-readable storage medium is used for storing the computer program and other programs and data required by the terminal. The computer readable storage medium may also be used to temporarily store data that has been output or is to be output.
It should be noted that: the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems and methods according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working processes of the system, the terminal and the unit described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, terminal and method can be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially or partially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; such modifications and substitutions do not depart from the spirit and scope of the present invention, and they should be construed as being included in the following claims and description.