CN107391198B - Method for scheduling task and device, computer readable storage medium, mobile terminal - Google Patents

Method for scheduling task and device, computer readable storage medium, mobile terminal Download PDF

Info

Publication number
CN107391198B
CN107391198B CN201710613803.8A CN201710613803A CN107391198B CN 107391198 B CN107391198 B CN 107391198B CN 201710613803 A CN201710613803 A CN 201710613803A CN 107391198 B CN107391198 B CN 107391198B
Authority
CN
China
Prior art keywords
foreground application
foreground
module
application
stable state
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.)
Active
Application number
CN201710613803.8A
Other languages
Chinese (zh)
Other versions
CN107391198A (en
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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201710613803.8A priority Critical patent/CN107391198B/en
Publication of CN107391198A publication Critical patent/CN107391198A/en
Application granted granted Critical
Publication of CN107391198B publication Critical patent/CN107391198B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44594Unloading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals

Abstract

A kind of method for scheduling task and device, computer readable storage medium, mobile terminal.Method for scheduling task, comprising: process corresponding to background application consuming task is registered;It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include the stability information of the foreground application;When the foreground application is in stable state and belongs to the protection category of white list, then process corresponding to the consuming task is closed.Above-mentioned method for scheduling task is when the foreground application is in stable state and belongs to the protection category of white list; then close process corresponding to the consuming task; the case where just can be avoided consuming task and foreground application preempting resources generation; it can guarantee there are enough resources can use when foreground application operation; smoothness operation, provides user experience.

Description

Method for scheduling task and device, computer readable storage medium, mobile terminal
Technical field
The present invention relates to technical field of data processing, more particularly to method for scheduling task and device, computer-readable deposit Storage media, mobile terminal.
Background technique
With mobile terminal, such as universal and function the enhancing of smart phone and tablet computer, user is for smart phone Performance requirement it is higher and higher, wherein system performance can be analyzed in the operating system of mobile terminal.
The operating system of intelligent mobile terminal in use, has many task process in running background, and wherein Some background applications are easy to cause foreground application to obtain because seizing cpu resource when executing the high work of time-consuming, CPU usage Resource it is few, cause foreground application execution Caton occurs not in time, influence user experience.
Summary of the invention
The embodiment of the present invention provides a kind of method for scheduling task and device, computer readable storage medium, mobile terminal, can To improve the fluency of foreground application and the Experience Degree of user.
A kind of method for scheduling task, comprising:
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include that the foreground is answered Stability information;
When the foreground application is in stable state and belongs to the protection category of white list, then the consuming task is closed Corresponding process.
Above-mentioned method for scheduling task, by the registration for receiving process corresponding to background application consuming task;Obtain foreground The foreground application data monitored using module is monitored, the foreground application data include the stability information of the foreground application; When the foreground application is in stable state and belongs to the protection category of white list, then close corresponding to the consuming task Process, it will be able to which the case where avoiding consuming task and foreground application preempting resources generation can guarantee have when foreground application operation Enough resources can use, and smoothness operation provides user experience.
A kind of task scheduling apparatus, comprising:
Registration module, for being registered to process corresponding to background application consuming task;
Module is obtained, monitors the foreground application data that module is monitored, the foreground application data for obtaining foreground application Stability information including the foreground application;And
Scheduler module, for when the foreground application is in stable state and belongs to the protection category of white list, then closing Close process corresponding to the consuming task.
One or more includes the non-volatile computer readable storage medium storing program for executing of computer executable instructions, when the calculating When machine executable instruction is executed by one or more processors, so that the processor executes following steps:
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include that the foreground is answered Stability information;
When the foreground application is in stable state and belongs to the protection category of white list, then the consuming task is closed Corresponding process.
A kind of mobile terminal, including memory and processor store computer-readable instruction in the memory, described When instruction is executed by the processor, so that the processor executes following steps:
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include that the foreground is answered Stability information;
When the foreground application is in stable state and belongs to the protection category of white list, then the consuming task is closed Corresponding process.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is the schematic diagram of internal structure figure of mobile terminal in one embodiment;
Fig. 2 is the flow chart of method for scheduling task in one embodiment;
Fig. 3 is the flow chart for obtaining foreground application in one embodiment and monitoring the foreground application data that module is monitored;
Fig. 4 is the flow chart of method for scheduling task in another embodiment;
Fig. 5 is the schematic diagram of internal structure of task scheduling apparatus in one embodiment;
Fig. 6 is that the computer program stored on computer readable storage medium in one embodiment is real when being executed by processor The flow chart of existing step;
Fig. 7 is the block diagram of the part-structure of mobile phone relevant to computer equipment provided in an embodiment of the present invention;
Fig. 8 is flow chart the step of realization when terminal handler executes computer program in one embodiment.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Fig. 1 is the schematic diagram of internal structure of mobile terminal in one embodiment.As shown in Figure 1, the movement includes passing through to be Processor, non-volatile memory medium, built-in storage and the network interface of bus of uniting connection, loudspeaker, are shown voice collection device Display screen and input unit.Wherein, the non-volatile memory medium of mobile terminal is stored with operating system and computer-readable instruction. To realize a kind of method for scheduling task when the computer-readable instruction is executed by processor.The processor is calculated and is controlled for providing Ability processed supports the operation entirely moved.Built-in storage in mobile terminal is that the computer in non-volatile memory medium can The operation of reading instruction provides environment.Network interface is used to carry out network communication with server.The display screen of mobile terminal can be Liquid crystal display or electric ink display screen etc., input unit can be the touch layer covered on display screen, be also possible to move Key, trace ball or the Trackpad being arranged in dynamic terminal enclosure, are also possible to external keyboard, Trackpad or mouse etc..The shifting Dynamic terminal can be mobile phone, tablet computer or personal digital assistant or wearable device etc..Those skilled in the art can manage It solves, structure shown in Fig. 1, only the block diagram of part-structure relevant to application scheme, is not constituted to the application side The restriction for the mobile terminal that case is applied thereon, specific mobile terminal may include than more or fewer portions as shown in the figure Part perhaps combines certain components or with different component layouts.
The embodiment of the present invention provides a kind of method for scheduling task, and this method can be applied to the operating system of mobile terminal In, such as mobile phone, tablet computer etc.;Also the equipment that can be applied to network side, such as network server.Aforesaid operations system is suitable For the system of particular version, that is, has the system of JobScheduler.Jobscheduler can support a variety of condition settings The Task Scheduling Mechanism of (network, time, complete machine i dle state, database are monitored).Using required condition setting task is pressed, it is System dispatches the task execution when can meet certain condition under some following time.In embodiments of the present invention, it was initially believed that tool The system of standby JobScheduler be Android5.0 system above (such as: Android 5.1, Android 6.0, Android 7.1 etc.).If other systems (IOS etc.) also have JobScheduler, the equally applicable embodiment of the present invention is provided Method for scheduling task.
Fig. 2 is the flow chart of method for scheduling task in one embodiment, and this method comprises the following steps:
Step S202: process corresponding to background application consuming task is registered.
Specifically, interface can be added in JobInfo.java, JobService.java SetRequiresProtectFore () interface.In the consuming task for needing to be implemented background application, pass through JobScheudler.schedule () interface realizes JOB manager (JobSchedulerService) to the consumption of background application When task corresponding to process registration.Consuming task can be understood as background application time-consuming, the task in cost source.For example, backstage Using for photograph album, photograph album occupies resource, JOB manager than relatively time-consuming, consumption CPU in background scanning photo (JobSchedulerService) registration of the process corresponding to scanned photograph can be passed through JobScheudler.schedule () interface is by process registers corresponding to scanned photograph to JOB manager (JobSchedulerService) in.
Step S204: it obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include The stability information of the foreground application.
JOB manager (JobSchedulerService) obtains foreground application and monitors the foreground application data that module is monitored. Specifically, the StateController interface () of JobSchedule module is inherited, it will be able to realize that foreground application monitors mould Block, foreground application monitor module and are also referred to as AppChangeController.Foreground application monitors module (AppChangeController) foreground application data can be monitored, wherein foreground application data include the stabilization of foreground application Property information.
Optionally, step S202, step S204 execution sequence under without limitation, step S202 can be first carried out, then Execute step S204;It is of course also possible to first carry out step S204, then execute step S202.
Step S206: when the foreground application is in stable state and belongs to the protection category of white list, then institute is closed State process corresponding to consuming task.
Stable state, and foreground application category are according to the stability information of the foreground application of acquisition, and in foreground application When the protection category of white list, it is right that JOB manager (JobSchedulerService) then closes background application consuming task institute The process answered.Wherein, be provided with multiple applications in white list, application can for third party application (such as: social activity, music, The application programs such as video, trip, financing, game, office), or and the application of system intialization and implementing procedure (such as: refer to Compass, calendar, weather, browser etc.).User can first set the application in white list according to their own needs.
Optionally, white list can be pushed by Cloud Server to mobile terminal.
Above-mentioned method for scheduling task, by the registration for receiving process corresponding to background application consuming task;Obtain foreground The foreground application data monitored using module is monitored, the foreground application data include the stability information of the foreground application; When the foreground application is in stable state and belongs to the protection category of white list, then close corresponding to the consuming task Process, it will be able to which the case where avoiding consuming task and foreground application preempting resources generation can guarantee have when foreground application operation Enough resources can use, and smooth can run, provide user experience.
In one embodiment, it obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Step S302: the acquisition instructions for obtaining the foreground application data are received.
During needing to be implemented task, it is arranged by the setRequiresProtectFore () interface of jobInfo The condition of " needing to obtain foreground application data ", that is, obtain foreground application monitor module monitor foreground application data it Before, it is also necessary to receive the acquisition instructions of " needing to obtain foreground application data ".
Step S304: it is monitored in module according to the acquisition instructions from the foreground application and obtains the steady of the foreground application Qualitative information.
Wherein, foreground application monitors the operating status that module is used to monitor the foreground application in real time, and according to the fortune Row state determines the stability information of the foreground application.Wherein, the stability information of foreground application includes stable state and not Stable state.
Further, foreground application monitors the stability that module determines the foreground application according to the operation state, packet It includes and the step of whether foreground application duration in operating status is more than preset duration is judged.That is, foreground application Whether monitoring module can monitor in real time foreground application in operating status.When foreground application duration in operating status When more than preset duration, then it can assert that the foreground application is in stable state, when in operating status lasting of foreground application When length is not above preset duration, then it can assert that the foreground application plays pendulum.Wherein, in order to provide the experience of user Degree can be set to preset duration 5~10 seconds, and certainly, the preset duration is also adjustable for suitable mobile terminal category Property or user open foreground application time numerical value, do not further limit herein.
JOB manager (JobSchedulerService) is according to the acquisition of " the needing to obtain foreground application data " of setting Instruction can monitor the stability information that the foreground application is obtained in module from foreground application.
Specifically, JOB manager is monitoring the stability information that the foreground application is obtained in module from foreground application In the process, when foreground application monitoring module, which listens to foreground application, is in stable state, actively to JOB manager (JobSchedulerService) data information that foreground application is in stable state is sent, before can thus directly acquiring Platform applies the information in stable state, can simplify JOB manager and monitor module acquisition foreground application to foreground application in real time The efficiency of data interaction can be improved in the interactive process of data.
In an example, method for scheduling task, comprising:
Step S402: process corresponding to background application consuming task is registered.
Step S404: process corresponding to the consuming task of the background application of registration is included in schedule of tasks.
Process corresponding to the consuming task of the background application of registration is included in schedule of tasks, by setting up task tune Table is spent, it being capable of more process corresponding to the management consuming task of system.
Step S406: it obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include The stability information of the foreground application.
Step S402, S406 corresponds respectively to the step S202 of abovementioned steps, step S204, here, repeating no more.
Step S408: it when the foreground application is in stable state and belongs to the protection category of white list, then closes and appoints The process being engaged in dispatch list.
Stable state, and foreground application category are according to the stability information of the foreground application of acquisition, and in foreground application When the protection category of white list, it is right that JOB manager (JobSchedulerService) then closes background application consuming task institute The process answered.Wherein, be provided with multiple applications in white list, application can for third party application (such as: social activity, music, The application programs such as video, trip, financing, game, office), or and the application of system intialization and implementing procedure (such as: refer to Compass, calendar, weather, browser etc.).User can first set the application in white list according to their own needs.
When the foreground application is in stable state and belongs to the protection category of white list, then close in schedule of tasks The process.Pass through the process closed in schedule of tasks, it will be able to consuming task and foreground application be avoided to seize money The case where source, occurs, and can guarantee have enough resources can use when foreground application operation, it is ensured that the stream of foreground application Smooth operation, provides user experience.
In one embodiment, step S408 works as the foreground application and is in stable state and belongs to the protection model of white list When farmland, then after closing the process in schedule of tasks, further includes:
Step S410: after the foreground application exits, the process of closing is registered again, the process turned off It is included in the schedule of tasks.
After the foreground application belonged in white list protection category exits foreground, i.e., when foreground application is not at operating status When, the corresponding process of consuming task which closes when in operating status can be registered again, be its closing The process is included in the schedule of tasks to wait scheduling to execute.Wherein, in confirmation when foreground application is not at operation shape When state, module can also be monitored by foreground application to monitor.Module is monitored continuous 10 seconds when foreground application all to answer to listen to this Operating status is not at that is, it is believed that the foreground application has dropped out foreground with the operating status in foreground.
In one embodiment, method for scheduling task further includes when the foreground application is in stable state and is not belonging to white When the protection category of list, then according to the priority of the foreground application reduce the consuming task accordingly corresponding to process The step of quantity.
When an application program of the foreground of mobile terminal in stable operation one non-white list protection category, according to working as The priority of the foreground application of preceding operation reduces the quantity of process corresponding to background application consuming task accordingly, in this way may be used To accordingly increase the available resources of currently running foreground application, the process degree of foreground application is provided, the body being used for is improved Degree of testing.Wherein it is possible to the height for the frequency being used by a user within a preset period of time according to foreground application, where foreground application Priority is arranged in the information such as the size of memory, and priority is higher, the number of processes of corresponding reduction is also more, and then ensures The process degree of foreground application, improves the Experience Degree being used for.
Optionally, the priority of process corresponding to consuming task in schedule of tasks can also be set, wherein process Priority is higher, more early to be closed.
In one embodiment, method for scheduling task further includes detecting whether the mobile terminal is in bright screen state Step.
By detecting whether mobile terminal is in bright screen state, so that it may which judging the foreground application of current mobile terminal is It is no in running order.If bright screen, show that the foreground application of mobile terminal is in running order, foreground can be will appear and answered With occurring the situation of Caton in operational process, the foreground that acquisition foreground application monitoring module is monitored can be continued to execute at this time and is answered With data, the foreground application data include the steps that the stability information of the foreground application.Correspondingly, when the foreground is answered When with being in stable state and belong to the protection category of white list, then process corresponding to the consuming task is closed, before realization The smooth operation of platform application, provides user experience.
The embodiment of the present invention also provides a kind of task scheduling apparatus.Fig. 5 is the interior of task scheduling apparatus in one embodiment Portion's structural schematic diagram.In one embodiment, task scheduling apparatus includes:
Registration module 510, for being registered to process corresponding to background application consuming task;
Module 520 is obtained, monitors the foreground application data that module 540 is monitored for obtaining foreground application, the foreground is answered It include the stability information of the foreground application with data;And
Scheduler module 530, for when the foreground application is in stable state and belongs to the protection category of white list, then Close process corresponding to the consuming task.
In one embodiment, the foreground application monitors the operation that module 540 is used to monitor the foreground application in real time State, and the stability information of the foreground application is determined according to the operation state.
Specifically, the stability information of the foreground application includes stable state and unstable state.
In one embodiment, module 520 is obtained for receiving the acquisition instructions for obtaining the foreground application data, and root The stability information that the foreground application is obtained in module is monitored from the foreground application according to the acquisition instructions.
In one embodiment, foreground application, which monitors module 540, can judge that the foreground application is in operating status Whether duration is more than preset duration;If so, the foreground application is in stable state, if it is not, the then foreground application It plays pendulum.
In one embodiment, scheduler module 530 is also used to register the institute of closing again after the foreground application exits Process is stated, the process turned off is included in the schedule of tasks.
In one embodiment, scheduler module 530 is also used to be in stable state when the foreground application and be not belonging to white When the protection category of list, then according to the priority of the foreground application reduce the consuming task accordingly corresponding to process Quantity.
In one embodiment, task scheduling apparatus further includes detection module, and detection module is described mobile whole for detecting Whether end is in bright screen state.
Above-mentioned task scheduling apparatus receives the registration of process corresponding to background application consuming task;Obtain foreground application The foreground application data that module is monitored are monitored, the foreground application data include the stability information of the foreground application;Scheduling Module 530 can close described time-consuming when the foreground application is in stable state and belongs to the protection category of white list The corresponding process of business, avoids consuming task and generation the case where foreground application preempting resources, can guarantee that foreground application is transported There are enough resources can use when row, smooth can run, user experience is provided.
The division of modules is only used for for example, in other embodiments, can fill scheduling in above-mentioned dispatching device It sets and is divided into different modules as required, to complete all or part of function of above-mentioned dispatching device.
The embodiment of the invention also provides a kind of computer readable storage mediums.Fig. 6 is that computer can in one embodiment The flow chart for the step of computer program for reading to store on storage medium is realized when being executed by processor.As shown in fig. 6, a kind of meter Calculation machine readable storage medium storing program for executing, is stored thereon with computer program, which performs the steps of when being executed by processor
Step S602: process corresponding to background application consuming task is registered;
Step S604: it obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include The stability information of the foreground application;
Step S606: when the foreground application is in stable state and belongs to the protection category of white list, then institute is closed State process corresponding to consuming task.
The foreground application monitors the operation that module is used to monitor the foreground application in real time in one of the embodiments, State, and the stability information of the foreground application is determined according to the operation state;
It obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Receive the acquisition instructions for obtaining the foreground application data;
The stability information that the foreground application is obtained in module is monitored from the foreground application according to the acquisition instructions.
The stability information of the foreground application includes stable state and unstable state in one of the embodiments,;
The stability of the foreground application is determined according to the operation state, comprising:
Judge whether foreground application duration in operating status is more than preset duration;
If so, the foreground application is in stable state, if it is not, then the foreground application plays pendulum.
In one of the embodiments, further include:
Process corresponding to the background application consuming task is included in schedule of tasks;
When the foreground application is in stable state and belongs to the protection category of white list, then close in schedule of tasks The process.
In one of the embodiments, further include:
After the foreground application exits, the process of closing is registered again, and the process turned off is included in described In schedule of tasks.
In one of the embodiments, further include:
When the foreground application is in stable state and is not belonging to the protection category of white list, then answered according to the foreground Priority reduces the quantity of process corresponding to the consuming task accordingly.
In one of the embodiments, further include:
Detect whether the mobile terminal is in bright screen state;
If so, obtaining foreground application monitors the foreground application data that module is monitored.
Computer program (instruction) when executed, is consumed by receiving background application in above-mentioned computer readable storage medium When task corresponding to process registration;It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application Data include the stability information of the foreground application;When the foreground application is in stable state and belongs to the protection of white list When scope, then process corresponding to the consuming task is closed, it will be able to avoid consuming task and foreground application preempting resources It happens, can guarantee there are enough resources can use when foreground application operation, smooth can run, user experience is provided Degree.
The embodiment of the invention also provides a kind of computer equipments.As shown in fig. 7, for ease of description, illustrate only with The relevant part of the embodiment of the present invention, it is disclosed by specific technical details, please refer to present invention method part.The calculating Machine equipment can be include mobile phone, tablet computer, PDA (Personal Digital Assistant, personal digital assistant), Any mobile terminal devices such as POS (Point of Sales sells mobile terminal), vehicle-mounted computer, wearable device, to calculate Machine equipment is for mobile phone:
Fig. 7 is the block diagram of the part-structure of mobile phone relevant to computer equipment provided in an embodiment of the present invention.With reference to figure 7, mobile phone include: radio frequency (Radio Frequency, RF) circuit 710, memory 720, input unit 730, display unit 740, Sensor 750, voicefrequency circuit 760, Wireless Fidelity (wireless fidelity, WiFi) module 770, processor 780 and The components such as power supply 790.It will be understood by those skilled in the art that handset structure shown in Fig. 7 does not constitute the restriction to mobile phone, it can To include perhaps combining certain components or different component layouts than illustrating more or fewer components.
Wherein, RF circuit 710 can be used for receiving and sending messages or communication process in, signal sends and receivees, can be by base station After downlink information receives, handled to processor 780;The data of uplink can also be sent to base station.In general, RF circuit include but Be not limited to antenna, at least one amplifier, transceiver, coupler, low-noise amplifier (Low Noise Amplifier, LNA), duplexer etc..In addition, RF circuit 710 can also be communicated with network and other equipment by wireless communication.Above-mentioned channel radio Any communication standard or agreement, including but not limited to global system for mobile communications (Global System of can be used in letter Mobile communication, GSM), general packet radio service (General Packet Radio Service, GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access (Wideband Code Division Multiple Access, WCDMA), long term evolution (Long Term Evolution, LTE)), Email, Short message service (Short Messaging Service, SMS) etc..
Memory 720 can be used for storing software program and module, and processor 780 is stored in memory 720 by operation Software program and module, thereby executing the various function application and data processing of mobile phone.Memory 720 can mainly include Program storage area and data storage area, wherein program storage area can application journey needed for storage program area, at least one function Sequence (such as application program, application program of image player function of sound-playing function etc.) etc.;Data storage area can store root Created data (such as audio data, address list etc.) etc. are used according to mobile phone.In addition, memory 720 may include high speed Random access memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or Other volatile solid-state parts.
Input unit 730 can be used for receiving the number or character information of input, and generate the user setting with mobile phone 700 And the related key signals input of function control.Specifically, input unit 730 may include touch panel 731 and other inputs Equipment 732.Touch panel 731, alternatively referred to as touch screen collect touch operation (such as the user of user on it or nearby Use the operation of any suitable object or attachment such as finger, stylus on touch panel 731 or near touch panel 731), And corresponding attachment device is driven according to preset formula.In one embodiment, touch panel 731 may include touching inspection Survey two parts of device and touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation Bring signal, transmits a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and will It is converted into contact coordinate, then gives processor 780, and can receive order that processor 780 is sent and be executed.In addition, Touch panel 731 can be realized using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch surface Plate 731, input unit 730 can also include other input equipments 732.Specifically, other input equipments 732 may include but not It is limited to one of physical keyboard, function key (such as volume control button, switch key etc.) etc. or a variety of.
Display unit 740 can be used for showing information input by user or be supplied to user information and mobile phone it is various Menu.Display unit 740 may include display panel 741.In one embodiment, liquid crystal display (Liquid can be used Crystal Display, LCD), the forms such as Organic Light Emitting Diode (Organic Light-Emitting Diode, OLED) To configure display panel 741.In one embodiment, touch panel 631 can cover display panel 741, when touch panel 731 is examined After measuring touch operation on it or nearby, processor 780 is sent to determine the type of touch event, is followed by subsequent processing device 780 provide corresponding visual output according to the type of touch event on display panel 741.Although in Fig. 7, touch panel 731 and display panel 641 are the input and input function for realizing mobile phone as two independent components, but in certain implementations In example, can be integrated by touch panel 731 and display panel 741 and that realizes mobile phone output and input function.
Mobile phone 700 may also include at least one sensor 750, such as optical sensor, motion sensor and other sensings Device.Specifically, optical sensor may include ambient light sensor and proximity sensor, wherein ambient light sensor can be according to environment The light and shade of light adjusts the brightness of display panel 741, and proximity sensor can close display panel when mobile phone is moved in one's ear 741 and/or backlight.Motion sensor may include acceleration transducer, can detect by acceleration transducer and adds in all directions The size of speed can detect that size and the direction of gravity when static, can be used to identify application (such as the horizontal/vertical screen of mobile phone posture Switching), Vibration identification correlation function (such as pedometer, tap) etc.;In addition, mobile phone can also configure gyroscope, barometer, humidity Other sensors such as meter, thermometer, infrared sensor etc..
Voicefrequency circuit 760, loudspeaker 761 and microphone 762 can provide the audio interface between user and mobile phone.Audio-frequency electric Electric signal after the audio data received conversion can be transferred to loudspeaker 761, be converted to sound by loudspeaker 761 by road 760 Signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 762, is turned after being received by voicefrequency circuit 760 It is changed to audio data, then by after the processing of audio data output processor 780, another mobile phone can be sent to through RF circuit 710, or Person exports audio data to memory 720 so as to subsequent processing.
WiFi belongs to short range wireless transmission technology, and mobile phone can help user's transceiver electronics postal by WiFi module 770 Part, browsing webpage and access streaming video etc., it provides wireless broadband internet access for user.Although Fig. 7 is shown WiFi module 770, but it is understood that, and it is not belonging to must be configured into for mobile phone 700, it can according to need and omit.
Processor 780 is the control centre of mobile phone, using the various pieces of various interfaces and connection whole mobile phone, is led to It crosses operation or executes the software program and/or module being stored in memory 720, and call and be stored in memory 720 Data execute the various functions and processing data of mobile phone, to carry out integral monitoring to mobile phone.In one embodiment, it handles Device 780 may include one or more processing units.In one embodiment, processor 780 can integrate application processor and modulation Demodulation processor, wherein the main processing operation system of application processor, user interface and application program etc.;Modulation /demodulation processing Device mainly handles wireless communication.It is understood that above-mentioned modem processor can not also be integrated into processor 780.
Mobile phone 700 further includes the power supply 790 (such as battery) powered to all parts, it is preferred that power supply can pass through electricity Management system and processor 780 are logically contiguous, to realize management charging, electric discharge and power consumption by power-supply management system The functions such as management.
In one embodiment, mobile phone 700 can also include camera, bluetooth module etc..
Mobile terminal provided in an embodiment of the present invention, including memory, processor and storage on a memory and can located The computer program run on reason device, which is characterized in that the processor performs the steps of when executing described program
Step S802: process corresponding to background application consuming task is registered;
Step S804: it obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include The stability information of the foreground application;
Step S806: when the foreground application is in stable state and belongs to the protection category of white list, then institute is closed State process corresponding to consuming task.
The foreground application monitors the operation that module is used to monitor the foreground application in real time in one of the embodiments, State, and the stability information of the foreground application is determined according to the operation state;
It obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Receive the acquisition instructions for obtaining the foreground application data;
The stability information that the foreground application is obtained in module is monitored from the foreground application according to the acquisition instructions.
The stability information of the foreground application includes stable state and unstable state in one of the embodiments,;
The stability of the foreground application is determined according to the operation state, comprising:
Judge whether foreground application duration in operating status is more than preset duration;
If so, the foreground application is in stable state, if it is not, then the foreground application plays pendulum.
In one of the embodiments, further include:
Process corresponding to the background application consuming task is included in schedule of tasks;
When the foreground application is in stable state and belongs to the protection category of white list, then close in schedule of tasks The process.
In one of the embodiments, further include: after the foreground application exits, register again closing it is described into Journey, the process turned off are included in the schedule of tasks.
In one of the embodiments, further include: when the foreground application is in stable state and is not belonging to white list When protection category, then according to the priority of the foreground application reduce the consuming task accordingly corresponding to process quantity.
In one of the embodiments, further include: detect whether the mobile terminal is in bright screen state;If so, obtaining Foreground application is taken to monitor the foreground application data that module is monitored.
Above-mentioned storage on a memory and the computer program that can run on a processor when executed, after receiving The registration of process corresponding to platform application consuming task;It obtains foreground application and monitors the foreground application data that module is monitored, it is described Foreground application data include the stability information of the foreground application;When the foreground application is in stable state and belongs to white name When the protection category of list, then process corresponding to the consuming task is closed, it will be able to consuming task be avoided to rob with foreground application The case where accounting for resource generation can guarantee have enough resources can use when foreground application operation, smooth can run, provide User experience.
Those of ordinary skill in the art will appreciate that realizing all or part of the process in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a non-volatile computer and can be read In storage medium, the program is when being executed, it may include such as the process of the embodiment of above-mentioned each method.Wherein, the storage is situated between Matter can be magnetic disk, CD, read-only memory (Read-Only Memory, ROM) etc..
The embodiments described above only express several embodiments of the present invention, and the description thereof is more specific and detailed, but simultaneously Limitations on the scope of the patent of the present invention therefore cannot be interpreted as.It should be pointed out that for those of ordinary skill in the art For, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to guarantor of the invention Protect range.Therefore, the scope of protection of the patent of the invention shall be subject to the appended claims.

Claims (9)

1. a kind of method for scheduling task, the mobile terminal applied to the operating system for having JobScheduler, which is characterized in that Include:
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include the foreground application Stability information, the stability information includes stable state and unstable state;When the foreground application is in stable state And when belonging to the protection category of white list, then process corresponding to the consuming task is closed;
The foreground application monitors the operating status that module is used to monitor the foreground application in real time, and according to the operation state Determine the stability information of the foreground application;Wherein,
It obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Pass through the item of setRequiresProtectFore () the interface setting " needing to obtain foreground application data " of jobInfo Part;
Receive the acquisition instructions of " needing to obtain foreground application data ";
The stability information for obtaining the foreground application from foreground application monitoring module according to the acquisition instructions is specific It include: when foreground application monitoring module listens to foreground application and is in stable state, before actively being sent to JOB manager Platform applies the data information in stable state.
2. method for scheduling task according to claim 1, which is characterized in that determine the foreground according to the operation state The stability of application, comprising:
Judge whether foreground application duration in operating status is more than preset duration;
If so, the foreground application is in stable state, if it is not, then the foreground application plays pendulum.
3. method for scheduling task according to claim 1, which is characterized in that further include:
Process corresponding to the background application consuming task is included in schedule of tasks;
When the foreground application is in stable state and belongs to the protection category of white list, then the institute in schedule of tasks is closed State process.
4. method for scheduling task according to claim 3, which is characterized in that further include:
After the foreground application exits, the process of closing is registered again, and the process turned off is included in the task In dispatch list.
5. method for scheduling task according to claim 1, which is characterized in that further include:
When the foreground application is in stable state and is not belonging to the protection category of white list, then according to the foreground application Priority reduces the quantity of process corresponding to the consuming task accordingly.
6. method for scheduling task according to claim 1, which is characterized in that further include:
Detect whether the mobile terminal is in bright screen state;
If so, obtaining foreground application monitors the foreground application data that module is monitored.
7. a kind of task scheduling apparatus, which is characterized in that applied to the mobile terminal for the operating system for having JobScheduler, Include:
Registration module, for being registered to process corresponding to background application consuming task;
Module is obtained, " needs to obtain foreground to answer for setRequiresProtectFore () the interface setting by jobInfo With data " condition;Receive the acquisition instructions of " needing to obtain foreground application data ";According to the acquisition instructions from foreground application The stability information for obtaining the foreground application in module is monitored, module is monitored when the foreground application and listens at foreground application When stable state, the data information that foreground application is in stable state, the foreground application number actively are sent to JOB manager According to the stability information including the foreground application, the stability information includes stable state and unstable state, before described Platform application monitors module and is used to monitor the operating status of the foreground application in real time, and determine according to the operation state it is described before The stability information of platform application;And
Scheduler module, for when the foreground application is in stable state and belongs to the protection category of white list, then closing institute State process corresponding to consuming task.
8. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is held by processor It is performed the steps of when row
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include the foreground application Stability information, the stability information include stable state and unstable state,
The foreground application monitors the operating status that module is used to monitor the foreground application in real time, and according to the operation state Determine the stability information of the foreground application;Wherein,
It obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Pass through the item of setRequiresProtectFore () the interface setting " needing to obtain foreground application data " of jobInfo Part;
Receive the acquisition instructions of " needing to obtain foreground application data ";
The stability information for obtaining the foreground application from foreground application monitoring module according to the acquisition instructions is specific It include: when foreground application monitoring module listens to foreground application and is in stable state, before actively being sent to JOB manager Platform applies the data information in stable state;
When the foreground application is in stable state and belongs to the protection category of white list, then it is right to close the consuming task institute The process answered.
9. a kind of mobile terminal, operating system, memory and processor including JobScheduler are stored in the memory There is computer-readable instruction, when described instruction is executed by the processor, so that the processor executes following steps:
Process corresponding to background application consuming task is registered;
It obtains foreground application and monitors the foreground application data that module is monitored, the foreground application data include the foreground application Stability information, the stability information include stable state and unstable state,
The foreground application monitors the operating status that module is used to monitor the foreground application in real time, and according to the operation state Determine the stability information of the foreground application;Wherein,
It obtains foreground application and monitors the foreground application data that module is monitored, comprising:
Pass through the item of setRequiresProtectFore () the interface setting " needing to obtain foreground application data " of jobInfo Part;
Receive the acquisition instructions of " needing to obtain foreground application data ";
The stability information for obtaining the foreground application from foreground application monitoring module according to the acquisition instructions is specific It include: when foreground application monitoring module listens to foreground application and is in stable state, before actively being sent to JOB manager Platform applies the data information in stable state;
When the foreground application is in stable state and belongs to the protection category of white list, then it is right to close the consuming task institute The process answered.
CN201710613803.8A 2017-07-25 2017-07-25 Method for scheduling task and device, computer readable storage medium, mobile terminal Active CN107391198B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710613803.8A CN107391198B (en) 2017-07-25 2017-07-25 Method for scheduling task and device, computer readable storage medium, mobile terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710613803.8A CN107391198B (en) 2017-07-25 2017-07-25 Method for scheduling task and device, computer readable storage medium, mobile terminal

Publications (2)

Publication Number Publication Date
CN107391198A CN107391198A (en) 2017-11-24
CN107391198B true CN107391198B (en) 2019-07-16

Family

ID=60336100

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710613803.8A Active CN107391198B (en) 2017-07-25 2017-07-25 Method for scheduling task and device, computer readable storage medium, mobile terminal

Country Status (1)

Country Link
CN (1) CN107391198B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108040330B (en) * 2017-11-30 2021-04-27 努比亚技术有限公司 WiFi directional transmission method, mobile terminal and readable storage medium
CN108762834A (en) * 2018-05-17 2018-11-06 努比亚技术有限公司 A kind of application acceleration method, terminal and computer readable storage medium
CN109299600B (en) * 2018-08-02 2021-07-13 珠海格力电器股份有限公司 Application locking and unlocking method and device, terminal and readable storage medium
CN111898117A (en) * 2020-04-26 2020-11-06 广州视源电子科技股份有限公司 Mutually exclusive application processing method, device, terminal and storage medium
CN111797110B (en) * 2020-06-23 2024-01-26 北京金堤科技有限公司 Method, device, computer equipment and storage medium for generating scheduling model
CN111859367A (en) * 2020-07-28 2020-10-30 中移(杭州)信息技术有限公司 Screen locking password setting method, terminal and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105979095A (en) * 2016-06-27 2016-09-28 努比亚技术有限公司 Mobile terminal and application power consumption control method
CN105975301A (en) * 2016-04-29 2016-09-28 北京小米移动软件有限公司 Memory cleaning method and device, and electronic equipment
CN106547640A (en) * 2016-11-23 2017-03-29 深圳市金立通信设备有限公司 A kind of method and terminal of backstage cleaning
CN106959892A (en) * 2017-03-30 2017-07-18 联想(北京)有限公司 Process handling method, device and electronic equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105975301A (en) * 2016-04-29 2016-09-28 北京小米移动软件有限公司 Memory cleaning method and device, and electronic equipment
CN105979095A (en) * 2016-06-27 2016-09-28 努比亚技术有限公司 Mobile terminal and application power consumption control method
CN106547640A (en) * 2016-11-23 2017-03-29 深圳市金立通信设备有限公司 A kind of method and terminal of backstage cleaning
CN106959892A (en) * 2017-03-30 2017-07-18 联想(北京)有限公司 Process handling method, device and electronic equipment

Also Published As

Publication number Publication date
CN107391198A (en) 2017-11-24

Similar Documents

Publication Publication Date Title
CN107391198B (en) Method for scheduling task and device, computer readable storage medium, mobile terminal
CN104850434B (en) Multimedia resource method for down loading and device
CN105404585B (en) Obtain the method and device of code coverage
CN103327102B (en) A kind of method and apparatus recommending application program
CN107391259A (en) Method for processing resource and device, computer-readable recording medium, mobile terminal
CN104519485B (en) Communication means, device and system between a kind of terminal
CN104618217B (en) Share method, terminal, server and the system of resource
CN105363201B (en) The display methods and device of prompt message
CN106502906B (en) A kind of method and apparatus of test application program
CN107204964B (en) Authority management method, device and system
CN106708554B (en) Program operating method and device
CN107277752B (en) Bluetooth connecting method, device, computer equipment and computer readable storage medium
TW201508312A (en) Method, device and system for forecasting weather
CN104954233B (en) Information-pushing method, device and system
CN104965722B (en) A kind of method and device of display information
CN105740145B (en) The method and device of element in orient control
CN106294168B (en) A kind of method and system carrying out Application testing
CN106775828A (en) Application program installation method and device, computer equipment
CN104699501B (en) A kind of method and device for running application program
CN106303605B (en) A kind of methods, devices and systems to send a notification message
CN104901992B (en) A kind of method and apparatus of resource transfers
CN105721282B (en) Message display method and device
CN103546632A (en) Method and device for alarm ringing of mobile terminal and mobile terminal
CN105897917B (en) Multi-medium data sharing method and device
CN106302101B (en) Message reminding method, terminal and server

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: 523860 No. 18, Wu Sha Beach Road, Changan Town, Dongguan, Guangdong

Applicant before: Guangdong OPPO Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant