WO2020015571A1 - 移动终端和应用程序后台运行的方法、装置 - Google Patents

移动终端和应用程序后台运行的方法、装置 Download PDF

Info

Publication number
WO2020015571A1
WO2020015571A1 PCT/CN2019/095486 CN2019095486W WO2020015571A1 WO 2020015571 A1 WO2020015571 A1 WO 2020015571A1 CN 2019095486 W CN2019095486 W CN 2019095486W WO 2020015571 A1 WO2020015571 A1 WO 2020015571A1
Authority
WO
WIPO (PCT)
Prior art keywords
application
background
running
command
application program
Prior art date
Application number
PCT/CN2019/095486
Other languages
English (en)
French (fr)
Inventor
李巍宏
陈佩斯
Original Assignee
奇酷互联网络科技(深圳)有限公司
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 奇酷互联网络科技(深圳)有限公司 filed Critical 奇酷互联网络科技(深圳)有限公司
Publication of WO2020015571A1 publication Critical patent/WO2020015571A1/zh

Links

Images

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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/451Execution arrangements for user interfaces

Definitions

  • the present invention relates to the field of computers, and in particular, to a method and device for mobile terminal and application program running in the background.
  • the main purpose of the present invention is to provide a method and a device for running an application in the background, which aim to solve the problem that the application cannot continue running after the application is returned to the system background.
  • the present invention proposes a method for running an application in the background.
  • the application for a single system runs in the background.
  • the method includes the following steps:
  • the method includes:
  • the step of generating the first command includes:
  • the first application is a preset designated application, generating and displaying an option of whether to generate the first command
  • the method includes:
  • the second application is the designated application, determining whether the second application is running in the background of the system;
  • the method includes:
  • This application also provides a device for running an application in the background.
  • the application for a single system runs in the background.
  • the device includes:
  • a first obtaining unit configured to obtain a first command for returning a first application program currently running in the foreground of the system to the system background to continue running;
  • a shielding unit configured to return the focus corresponding to the first application to the system, and shield the system's input and interface response to the first application;
  • a background running unit is configured to control the first application program to continue running in the background of the system.
  • the apparatus further includes:
  • a first determining unit configured to determine whether the first application is a preset designated application, where the designated application is an application that needs to continue running in the background;
  • a generating unit is configured to generate the first command if the first application is a preset designated application.
  • the generating unit includes:
  • Generating an option module configured to generate and display an option for generating the first command if the first application is a preset designated application;
  • a first generating module is configured to generate the first command if an instruction that triggers an option to generate the first command is received within a specified time.
  • the apparatus further includes:
  • a receiving unit configured to receive a second command for switching a second application in the background of the system to the foreground of the system
  • a second determining unit configured to determine whether the second application is the specified application
  • a third determining unit configured to determine whether the second application is running in the background of the system if the second application is the designated application
  • a release unit configured to, if it is determined that the second application program is running in the background of the system, focus on the second application program and release the input and interface response to the second application program;
  • the foreground running unit is configured to run the second application program in the foreground of the system.
  • the apparatus further includes:
  • a second obtaining unit configured to obtain a preset level of the first application program
  • the allocating unit is configured to allocate a system resource running the first application according to a preset level of the first application.
  • This application also provides a mobile terminal, including a processor and a memory,
  • the memory is configured to store a program of a device running in the background of the application program to execute any one of the foregoing methods of running the background of the application program;
  • the processor is configured to execute a program stored in the memory.
  • the mobile terminal and the method and device for running an application in the background of the present application return the focus of the first application that continues to run in the background to the system, and shield the input and interface response of the first application to realize the first application in The system runs automatically in the background. In the same system, multiple applications are run simultaneously, which greatly improves the user's on-hook experience.
  • FIG. 1 is a schematic flowchart of a method for running an application program in the background according to an embodiment of the present application
  • FIG. 2 is a schematic block diagram of a device for running an application in the background according to an embodiment of the present application
  • FIG. 3 is a schematic block diagram of a mobile terminal according to an embodiment of the present application.
  • an embodiment of the present application provides a method for running an application in the background, and an application for a single system runs in the background.
  • the above single system refers to an Android system and the like.
  • an Android phone has two parallel Android systems installed. Then the method of running the application in the background is applicable to any or all of the two parallel Android systems. That is, the background running of the application in this application is not to enable the application to continue running in the background after switching between the system and the system, but to implement the background running of the application in the same system.
  • the above method includes steps:
  • the front desk of the system is a visible display platform for a terminal such as a mobile phone.
  • the current interface of the mobile phone runs as an application for a game
  • the application for the game runs in the front desk of the system .
  • the above system background is the running background of a terminal such as a mobile phone. After an application of a game is returned to the system background of the mobile phone, the display interface of the terminal such as a mobile phone no longer displays the application of the game.
  • the first command for the first application program to return to the system background to continue running is the command to quit the first application program from the system foreground to the system background and continue to run in the system background.
  • the focus is a certain target.
  • the focus corresponds to the application program currently running in the foreground of the system, so that the system operations are corresponding to the focus. s application.
  • the foregoing returns the focus corresponding to the first application to the system, that is, the system does not take the first application as the determined target, and instead corresponds the focus to other applications.
  • the foregoing blocking of the system's input and interface response to the first application program is to stop the outside world from inputting operation commands to the first application program.
  • the first application program Do not respond.
  • the first game application is currently running.
  • the system's focus is no longer the first game application; when the first game application is After the program input and interface response are shielded, any input from the interface will not affect the operation of the first game application program, that is, before the system's input and interface response to the first game application program are shielded, After setting the game's automatic running rules, when the system's input and interface response to the first game application are blocked, the game will still run automatically according to the set running rules and will not respond to commands input by the mobile terminal.
  • the foregoing returns the focus corresponding to the first application to the system, and the implementation of closing the input and interface of the first application.
  • it can be: when the window of the first application is If the status is invisible, then the system will regain the focus corresponding to the first application. When the focus of the window is not on the first application that is hung in the background, the event input process about the first application will be ignored.
  • the focus of the system is not on the first application, the focus can be on other new applications to be run in the foreground of the system; when the first application is returned to After the system background, because the input and interface response of the first application have been blocked, the system will not operate the first application at the same time when operating the new application running in the system foreground, making the first application
  • the program can run automatically in accordance with preset operating rules, so that in the case of a single system, one or more applications can continue to run in the background of the system, increasing the number of applications running simultaneously on the system, and satisfying users such as running multiple games simultaneously. Demand, etc.
  • the step of obtaining the first command that currently runs the foreground of the system and returns the first command to continue running in the background of the system before the step S1 includes:
  • S101 Determine whether the first application is a preset designated application, where the designated application is an application that needs to continue running in the background;
  • the application programs in the system that need to continue to run in the background are marked.
  • the specific marking method includes setting an identifier on the package name of the application.
  • the method includes:
  • the first command is not directly generated, but an option interface is first generated.
  • the option interface It contains at least the option to generate the first command.
  • the above specified time is a preset time threshold range, such as within 5 seconds, etc., and if the command that triggers the generation of the first command option is received within the specified time, the first command is generated, and if it is not received within the specified time.
  • the first of the above two execution processes is that if the time is not exceeded, When the command triggered by any of the options is generated, the first command is generated; if the command triggered by any of the options is not received within the specified time, a command that is not running in the system background is generated. command.
  • step S3 of controlling the first application to continue running in the background of the system the method includes:
  • multiple applications may be placed in the background of the system, including designated applications that are always running in the background of the system, and applications that do not need to continue running in the background of the system.
  • the second application in the background of the system is returned to the front of the system, it is necessary to determine whether the second application is the above-mentioned designated application. If it is not, then normally execute processes such as onResume and execute it according to the native system logic; If the second application is the above-mentioned designated application, you cannot directly execute processes such as onResume, and you need to determine whether it remains running when it is in the system background. If so, you need to skip the process of executing onResume and get focus from the system , And release the input and interface response of the second application, and restore the assignments that were modified when switching to the background, so that it can run normally in the system foreground.
  • step S3 of controlling the first application program to continue running in the background of the system the method includes:
  • the preset level refers to the priority level set by the user for different applications. Specifically, a level label is added to a specified position such as the package name of the specified application, and different level labels correspond to Different system resource allocation. Generally, a data list corresponding to the level and system resources is set. The data list is a one-to-one mapping relationship between the level and system resources. After determining the level of the application, look up the corresponding system resource in the data list, and then The found system resources allocate system resources to corresponding applications. In a specific embodiment, the preset level includes three levels, the system resources corresponding to the first level are 30%, the system resources corresponding to the second level are 20%, and the system resources corresponding to the third level are 10%. When the first application program When the level is 1 level, 30% of system resources are allocated to run the first application in the system background.
  • the method when multiple first applications are running in the background of the system, before step S3 of controlling the first applications to continue running in the background of the system, the method includes:
  • the first rule is to gradually reduce the allocation of each first application in order.
  • System resources in the second type, the system resources of each first application program are gradually increased in order; in the third type, the system resources of each first application program are allocated in the same order.
  • the above three rules can be set freely according to specific usage habits and the like.
  • step S311 of allocating system resources according to the time sequence of each said first application being placed in the system background the method further includes:
  • step S311 that is, no matter how many first application programs are running in the system background, the system only gives a fixed system resource of 30%, for example, to the system background to prevent the running speed of the applications running in the system foreground. Drop too much, affecting user use.
  • the system resources of the fixed system background can be allocated according to the method in S311.
  • the method when multiple first applications are running in the background of the system, after step S3 of controlling the first applications to continue running in the background of the system, the method includes:
  • the third application currently running in the foreground of the system is stuck, the first application running in the system background is closed according to a preset rule, and system resources corresponding to the closed first application are allocated to the first application.
  • the above preset rules include multiple types, such as stopping the first application (the first level is higher than the second level, and the second level is higher than the third level) with a lower preset level; The first application with the longest time stops running; or, the first application that consumes the most system resources in the background running of the system stops running, etc., so as to improve the running flow of the third application and so on.
  • the method for running an application in the background of the present application returns the focus of the first application that continues to run in the background to the system, and shields the input and interface response of the first application, so that the first application automatically runs in the background of the system. And it will not affect the operation of other applications in the foreground of the system. In the same system, multiple applications can be run at the same time, which greatly improves the user's on-hook experience.
  • an embodiment of the present application further provides a device for running an application in the background, which is used for a single system application running in the background.
  • the above single system refers to an Android system and the like.
  • an Android phone has two parallel Android systems installed. Then the method of running the application in the background is applicable to any or all of the two parallel Android systems. That is, the background running of the application in this application is not to enable the application to continue running in the background after switching between the system and the system, but to implement the background running of the application in the same system.
  • the above devices include:
  • a first obtaining unit 10 configured to obtain a first command for returning a first application program currently running in the foreground of the system to the system background to continue running;
  • a shielding unit 20 configured to return the focus corresponding to the first application to the system, and shield the system's input and interface response to the first application;
  • the background running unit 30 is configured to control the first application program to continue running in the background of the system.
  • the front desk of the system is a visible display platform of a terminal such as a mobile phone.
  • the current interface of the mobile phone runs as an application of a game, and the application of the game is in the system Run in the foreground.
  • the above system background is the running background of a terminal such as a mobile phone.
  • the display interface of the terminal no longer displays the application of the game.
  • the first command for the first application program to return to the system background to continue running is the command to quit the first application program from the system foreground to the system background and continue to run in the system background.
  • the focus is a determined target.
  • the focus corresponds to the application program currently running in the foreground of the system, so that the system operations are directed at The application corresponding to the focus.
  • the foregoing returns the focus corresponding to the first application to the system, that is, the system does not take the first application as the determined target, and instead corresponds the focus to other applications.
  • the foregoing blocking of the system's input and interface response to the first application program is to stop the outside world from inputting operation commands to the first application program.
  • the first application program Do not respond.
  • the first game application is currently running.
  • the system's focus is no longer the first game application; when the first game application is After the input and interface response are blocked, any input on the interface will not affect the operation of the first game application, that is, before the system's input and interface response to the first game application are blocked, set The game automatically runs the rules. When the system's input and interface response to the first game application is blocked, the game will still run automatically according to the set running rules and will not respond to commands entered by the mobile terminal.
  • the foregoing returns the focus corresponding to the first application to the system, and the implementation of closing the input and interface of the first application.
  • it can be: when the window of the first application is If the status is invisible, then the system will regain the focus corresponding to the first application. When the focus of the window is not on the first application that is hung in the background, the event input process about the first application will be ignored.
  • the apparatus for running the above-mentioned application in the background further includes:
  • a first determining unit configured to determine whether the first application is a preset designated application, where the designated application is an application that needs to continue running in the background;
  • a generating unit is configured to generate the first command if the first application is a preset designated application.
  • an application program in the system that needs to continue to run in the background is marked, and a specific marking method includes setting an identifier on a package name of the application.
  • the generating unit includes:
  • Generating an option module configured to generate and display an option for generating the first command if the first application is a preset designated application;
  • a first generating module is configured to generate the first command if an instruction that triggers an option to generate the first command is received within a specified time.
  • the first command when it is determined that the first application is a specified application that needs to continue running in the background, the first command is not directly generated, but an option interface is generated first.
  • This option interface contains at least the option to generate the first command.
  • the above specified time is a preset time threshold range, such as within 5 seconds, etc., and if the command that triggers the generation of the first command option is received within the specified time, the first command is generated, and if it is not received within the specified time
  • There are two execution processes when the first command option trigger command is generated which can be specifically set according to the user's settings.
  • the first of the above two execution processes is that if the time is not exceeded, When the command triggered by any of the options is generated, the first command is generated; if the command triggered by any of the options is not received within the specified time, a command that is not running in the system background is generated. command.
  • the apparatus for running the above-mentioned application in the background further includes:
  • a receiving unit configured to receive a second command for switching a second application in the background of the system to the foreground of the system
  • a second determining unit configured to determine whether the second application is the specified application
  • a third determining unit configured to determine whether the second application is running in the background of the system if the second application is the designated application
  • a release unit configured to, if it is determined that the second application program is running in the background of the system, focus on the second application program and release the input and interface response to the second application program;
  • the foreground running unit is configured to run the second application program in the foreground of the system.
  • multiple application programs may be placed in the background of the system, including designated applications that have been running in the background of the system and applications that do not need to continue running in the background of the system.
  • the second application in the background of the system is returned to the front of the system, it is necessary to determine whether the second application is the above-mentioned designated application. If it is not, then normally execute processes such as onResume and execute it according to the native system logic; If the second application is the above-mentioned designated application, you cannot directly execute processes such as onResume. You need to determine whether it remains running when it is in the background of the system. If so, you need to skip the process of executing onResume and get focus from the system. , And release the input and interface response of the second application, and restore the assignments that were modified when switching to the background, so that it can run normally in the system foreground.
  • the apparatus for running the above-mentioned application in the background further includes:
  • a second obtaining unit configured to obtain a preset level of the first application program
  • the allocating unit is configured to allocate a system resource running the first application according to a preset level of the first application.
  • the preset level refers to a priority level set by a user for different applications, specifically, adding a level tag to a specified position such as a package name of the above-mentioned designated application, and different level tags correspond to different system resources distribution.
  • a data list corresponding to the level and system resources is set. The data list is a one-to-one mapping relationship between the level and system resources. After determining the level of the application, look up the corresponding system resource in the data list, and then The found system resources allocate system resources to corresponding applications.
  • the preset level includes three levels, the system resources corresponding to the first level are 30%, the system resources corresponding to the second level are 20%, and the system resources corresponding to the third level are 10%.
  • 30% of system resources are allocated to run the first application in the system background.
  • the device for running the above applications in the background further includes:
  • a time allocation unit is configured to allocate system resources according to a time sequence in which each of the first applications is placed in a system background.
  • the rules for allocating system resources according to the chronological order in which the first application is put into the system background include a variety of rules, specifically, the first one is to gradually reduce the allocation of the system resources of each first application in order; According to the sequence, the system resources of the first application programs are gradually increased and allocated. In the third way, the system resources of the first application programs are allocated in the same order.
  • the above three types of rules can be freely set according to specific usage habits and the like.
  • the apparatus for running the above-mentioned application in the background further includes:
  • a fixed allocation unit is configured to allocate a fixed system resource to a first application program running in a system background.
  • the system only gives a fixed, eg, 30%, system resources to the system background to prevent the running speed of the applications running in the system foreground from dropping too much , Affecting the use of users.
  • the system resources of the fixed system background can be allocated according to the method of the time allocation unit described above.
  • the device for running the above applications in the background further includes:
  • a closing unit configured to close the first application running in the system background according to a preset rule if the third application currently running in the system foreground is stuck, and use the system resources corresponding to the closed first application Assigned to the third application.
  • the above preset rules include multiple types, such as stopping the first application (the first level is higher than the second level and the second level is higher than the third level) with a lower preset level; or, it will be in the system background The first application program with the longest running time stops running; or, the first application program that consumes the most system resources in the background running of the system stops running, etc., so as to improve the running flow of the third application program and the like.
  • the application running in the background of the application returns the focus of the first application that continues to run in the background to the system, and shields the input of the first application and the interface response, so that the first application runs automatically in the background of the system And it will not affect the operation of other applications in the foreground of the system.
  • multiple applications can be run at the same time, which greatly improves the user's on-hook experience.
  • an embodiment of the present invention further provides a mobile terminal, including a processor 1080 and a memory 1020, where the memory 1020 is configured to store a program that the processor 1080 executes the above-mentioned application program background running method; Configured to execute a program stored in the memory.
  • the mobile terminal may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), and a vehicle-mounted computer.
  • a mobile phone a mobile phone
  • PDA Personal Digital Assistant
  • POS Point of Sales
  • FIG. 3 is a block diagram showing a partial structure of a mobile phone related to a mobile terminal according to an embodiment of the present invention.
  • the mobile phone includes: a radio frequency (RF) circuit 1010, a memory 1020, an input unit 1030, a display unit 1040, a sensor 1050, an audio circuit 1060, a wireless fidelity (WiFi) module 1070, and a processor 1080 , And power supply 1090 and other components.
  • RF radio frequency
  • the RF circuit 1010 can be used for receiving and transmitting signals during information transmission and reception or during a call.
  • the downlink information of the base station is received and processed by the processor 1080; in addition, the uplink data of the design is transmitted to the base station.
  • the RF circuit 1010 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a Low Noise Amplifier (LNA), a duplexer, and the like.
  • the RF circuit 1010 can also communicate with a network and other devices through wireless communication.
  • the above wireless communication can use any communication standard or protocol, including but not limited to Global System of Mobile (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (Code Division Multiple Access) Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE), E-mail, Short Messaging Service (SMS), etc.
  • GSM Global System of Mobile
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • E-mail Short Messaging Service
  • the memory 1020 may be used to store software programs and modules.
  • the processor 1080 executes various functional applications and data processing of the mobile phone by running the software programs and modules stored in the memory 1020.
  • the memory 1020 may mainly include a storage program area and a storage data area, where the storage program area may store an operating system, at least one function required application program (such as a sound playback function, an image playback function, etc.), etc .; the storage data area may store data according to Data (such as audio data, phone book, etc.) created by the use of mobile phones.
  • the memory 1020 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.
  • the input unit 1030 can be used to receive inputted numeric or character information, and generate key signal inputs related to user settings and function control of the mobile phone.
  • the input unit 1030 may include a touch panel 1031 and other input devices 1032.
  • Touch panel 1031 also known as touch screen, can collect user's touch operations on or near it (such as the user using a finger, stylus, etc. any suitable object or accessory on touch panel 1031 or near touch panel 1031 Operation), and drive the corresponding connection device according to a preset program.
  • the touch panel 1031 may include a touch detection device and a touch controller.
  • the touch detection device detects the user's touch position, and detects the signal caused by the touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch detection device, converts it into contact coordinates, and sends it To the processor 1080, and can receive the commands sent by the processor 1080 and execute them.
  • various types such as resistive, capacitive, infrared, and surface acoustic wave can be used to implement the touch panel 1031.
  • the input unit 1030 may include other input devices 1032.
  • other input devices 1032 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, an operation lever, and the like.
  • the display unit 1040 may be used to display information input by the user or information provided to the user and various menus of the mobile phone.
  • the display unit 1040 may include a display panel 1041, and optionally, the display panel 1041 may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), or the like.
  • the touch panel 1031 may cover the display panel 1041. When the touch panel 1031 detects a touch operation on or near the touch panel 1031, the touch panel 1031 transmits the touch operation to the processor 1080 to determine the type of the touch event. The type provides corresponding visual output on the display panel 1041.
  • the touch panel 1031 and the display panel 1041 are implemented as two independent components to implement the input and input functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 can be integrated and Realize the input and output functions of the mobile phone.
  • the mobile phone may further include at least one sensor 1050, such as a light sensor, a motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor.
  • the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of the ambient light.
  • the proximity sensor may close the display panel 1041 and / Or backlight.
  • the accelerometer sensor can detect the magnitude of acceleration in various directions (usually three axes), and can detect the magnitude and direction of gravity when it is stationary.
  • the mobile phone can be used for applications that recognize the attitude of mobile phones (such as horizontal and vertical screen switching, related Games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tap), etc .; as for the mobile phone can also be equipped with gyroscope, barometer, hygrometer, thermometer, infrared sensor and other sensors, no longer here To repeat.
  • attitude of mobile phones such as horizontal and vertical screen switching, related Games, magnetometer attitude calibration
  • vibration recognition related functions such as pedometer, tap
  • the mobile phone can also be equipped with gyroscope, barometer, hygrometer, thermometer, infrared sensor and other sensors, no longer here To repeat.
  • the audio circuit 1060, the speaker 1061, and the microphone 1062 can provide an audio interface between the user and the mobile phone.
  • the audio circuit 1060 can transmit the received electrical data converted electrical signal to the speaker 1061, and the speaker 1061 converts the sound signal to an audio signal output.
  • the microphone 1062 converts the collected sound signal into an electrical signal, and the audio circuit 1060 After receiving, it is converted into audio data, and then the audio data is output to the processor 1080 for processing, and then sent to, for example, another mobile phone via the RF circuit 1010, or the audio data is output to the memory 1020 for further processing.
  • WiFi is a short-range wireless transmission technology.
  • the mobile phone can help users send and receive emails, browse web pages, and access streaming media through the WiFi module 1070. It provides users with wireless broadband Internet access.
  • FIG. 3 shows the WiFi module 1070, it can be understood that it does not belong to the necessary configuration of the mobile phone, and can be omitted as needed without changing the essence of the invention.
  • the processor 1080 is the control center of the mobile phone. It uses various interfaces and lines to connect various parts of the entire mobile phone.
  • the processor 1080 runs or executes software programs and / or modules stored in the memory 1020, and calls data stored in the memory 1020 to execute.
  • Various functions and processing data of the mobile phone so as to monitor the mobile phone as a whole.
  • the processor 1080 may include one or more processing units; preferably, the processor 1080 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and an application program, etc.
  • the modem processor mainly handles wireless communication. It can be understood that the foregoing modem processor may not be integrated into the processor 1080.
  • the mobile phone also includes a power supply 1090 (such as a battery) for supplying power to various components.
  • a power supply 1090 (such as a battery) for supplying power to various components.
  • the power supply can be logically connected to the processor 1080 through a power management system, so as to implement functions such as management of charging, discharging, and power consumption management through the power management system.
  • the mobile phone may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the processor 1080 included in the mobile terminal also has the following functions:
  • the disclosed systems, devices, and methods may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit is only a logical function division.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or units, which may be electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist separately physically, or two or more units may be integrated into one unit.
  • the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
  • the program may be stored in a computer-readable storage medium.
  • the medium may be a read-only memory, a magnetic disk, or an optical disk.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Stored Programmes (AREA)

Abstract

本发明揭示了一种移动终端和应用程序后台运行的方法、装置,用于单系统的应用程序在后台运行,其中方法包括步骤:获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;控制所述第一应用程序在所述系统后台继续运行。本申请将在后台继续运行的第一应用程序的焦点还给系统,以及屏蔽第一应用程序的输入和界面响应,以实现第一应用程序在系统后台中自动运行,在同一个系统中,实现多个应用程序的同时运行,大大提高了用户的挂机体验等。

Description

移动终端和应用程序后台运行的方法、装置 【技术领域】
本发明涉及到计算机领域,特别是涉及到一种移动终端和应用程序后台运行的方法、装置。
【背景技术】
安卓(android)系统在运行的过程中,当系统前台的应用程序退到系统后台后,该应用程序会在系统后台停止运行。因此用户会遇到不能并行执行多个应用程序的问题,比如,用户有多个游戏或者一个游戏有多个账户,需要在前台玩一个游戏,其它游戏或其它账号的游戏需要挂机运行时,则由于上述机制,无法实现,不能满足用户的需求,所以如何提供一种支持在系统后台自动运行的方法,是亟需解决的问题。
【发明内容】
本发明的主要目的为提供一种应用程序后台运行的方法和装置,旨在解决上述应用程序退到系统后台后无法继续运行的问题。
为了实现上述发明目的,本发明提出一种应用程序后台运行的方法,用于单系统的应用程序在后台运行,所述方法包括步骤:
获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
控制所述第一应用程序在所述系统后台继续运行。
进一步地,所述获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令的步骤之前,包括:
判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
若是,则生成所述第一命令。
进一步地,所述若是,则生成所述第一命令的步骤,包括:
若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令 的选项并显示;
若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令;
若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成所述第一命令。
进一步地,所述控制所述第一应用程序在所述系统后台继续运行的步骤之后,包括:
接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
判断所述第二应用程序是否为所述指定应用程序;
若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
将所述第二应用程序在所述系统前台运行。
进一步地,所述控制所述第一应用程序在所述系统后台继续运行的步骤之前,包括:
获取所述第一应用程序的预设等级;
根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
本申请还提供一种应用程序后台运行的装置,用于单系统的应用程序在后台运行,所述装置包括:
第一获取单元,用于获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
屏蔽单元,用于将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
后台运行单元,用于控制所述第一应用程序在所述系统后台继续运行。
进一步地,所述装置还包括:
第一判断单元,用于判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
生成单元,用于若所述第一应用程序是预设的指定应用程序,则生成所述第一命令。
进一步地,所述生成单元,包括:
生成选项模块,用于若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令的选项并显示;
第一生成模块,用于若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令。
进一步地,所述装置还包括:
接收单元,用于接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
第二判断单元,用于判断所述第二应用程序是否为所述指定应用程序;
第三判断单元,用于若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
释放单元,用于若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
前台运行单元,用于将所述第二应用程序在所述系统前台运行。
进一步地,所述装置还包括:
第二获取单元,用于获取所述第一应用程序的预设等级;
分配单元,用于根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
本申请还提供一种移动终端,包括处理器和存储器,
所述存储器用于存储应用程序后台运行的装置执行上述任一项的应用程序后台运行的方法的程序;
所述处理器被配置为用于执行所述存储器中存储的程序。
本申请的移动终端和应用程序后台运行的方法、装置,将在后台继续运行的第一应用程序的焦点还给系统,以及屏蔽第一应用程序的输入和界面响应,以实现第一应用程序在系统后台中自动运行,在同一个系统中,实现多个应用程序的同时运行,大大提高了用户的挂机体验等。
【附图说明】
图1为本申请一实施例的应用程序后台运行的方法的流程示意图;
图2为本申请一实施例的应用程序后台运行的装置的结构示意框图;
图3为本申请一实施例的移动终端的结构示意框图。
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
【具体实施方式】
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。
参照图1,本申请实施例提供一种应用程序后台运行的方法,用于单系统的应用程序在后台运行。
上述单系统是指一个安卓系统等,比如,一部安卓手机上安装有两个并行的安卓系统,那么上述应用程序后台运行的方法适用于上述两个并行的安卓系统中的任意一个或全部,即,本申请中的应用程序后台运行不是系统与系统之间的切换后实现应用程序在后台继续运行,而是在同一个系统中实现应用程序后台运行。
上述方法包括步骤:
S1、获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
S2、将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
S3、控制所述第一应用程序在所述系统后台继续运行。
如上述步骤S1所述,上述系统前台即为手机等终端的可见显示平台,如在一个具体实施例中,手机当前界面运行为某一游戏的应用程序,则该游戏的应用程序在系统前台运行。上述系统后台即为手机等终端的运行后台,如某一游戏的应用程序退到手机的系统后台后,手机等终端的显示界面不在显示该游戏的应用程序。上述第一应用程序退到系统后台继续运行的第一命令,即为将第一应用程序由系统前台退出到系统后台,并且继续在系统后台运行的命令。
如上述步骤S2和S3所述,上述焦点(focus)即为确定的目标,在手机等运行应用程序时,焦点便对应当前在系统前台运行的应用程序,使系统的操作均为针对焦点所对应的应用程序。上述将对应所述第一应用程序的焦点还给所述系统,即为系统不将上述第一应用程序作为确定的目标,而将焦点对应其它应用程序等。上述屏蔽所述系统对所述第一应用程序的输入和界面响应,即为停止外界对该第一应用程序输入操作命令,当手机等终端接收到对界的操作命 令时,该第一应用程序不做响应等。在一个具体实施例中,当前运行第一游戏应用程序,当将该第一游戏应用程序的焦点还给系统后,则系统的关注目标不再是第一游戏应用程序;当将第一游戏应用程序的输入和界面响应被屏蔽后,界面的任何输入均不会对第一游戏应用程序的运行产生影响,即在屏蔽所述系统对所述第一游戏应用程序的输入和界面响应之前,设定游戏自动运行规则,当屏蔽所述系统对所述第一游戏应用程序的输入和界面响应之后,游戏仍然会按照设定的运行规则自动运行,不会对手机终端输入的命令产生响应。
上述将对应所述第一应用程序的焦点还给所述系统,以及关闭第一应用程序的输入和界面的实施,本实施例中,可以为:当上述的第一应用程序的window(窗口)状态是不可见,那么系统会收回对应第一应用程序的焦点,当窗口的焦点不在后台挂机的第一应用程序的时候,关于第一应用程序的事件输入流程会被忽略等。在一个具体实施例中,在将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应的同时,还会根据具体的设置,修改系统前台的赋值等,即在Activity生命周期管理中,当第一应用程序在系统后台运行,会跳过onResume和onStop等流程。
本申请实施例的应用程序后台运行的方法,因为将系统的焦点不在针对第一应用程序,所以可以将焦点针对其它要在系统前台运行的新的应用程序上;当将第一应用程序退到系统后台后,因为已经屏蔽了第一应用程序的输入和界面响应,则系统在对系统前台运行的新的应用程序进行操作用时,不会同时也对第一应用程序进行操作,使第一用程序可以按照预设的运行规则自动运行,使在单系统的情况下,实现一个或多个应用程序在系统后台继续运行,提高系统同时运行应用程序的数量,满足用户比如同时运行多个游戏的需求等。
在一个实施例中,上述获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令的步骤S1之前,包括:
S101、判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
S102、若是,则生成所述第一命令。
如上述步骤S101和S102所述,对系统中需要在后台可以继续运行的应用程序进行标记,具体的标记方法包括在应用程序的包名上设置标识符等。当将在系统前台运行的第一应用程序退到系统后台的时候,先查看一下该第一应用程序是否为需要在后台继续运行的指定应用程序,如果是,则生成上述第一命 令,然后跳过常规的onResume和onStop等流程,执行上述步骤S2、S3的步骤;如果否,则执行系统正常的onResume和onStop等流程。
在一个实施例中,上述若是,则生成所述第一命令的步骤S102,包括:
S1021、若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令的选项并显示;
S1022、若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令。
如上述步骤S1021至S1023所述,当判定上述第一应用程序为预设的需要在后台继续运行的指定应用程序时,并不是直接生成第一命令,而是先生成一个选项界面,该选项界面内至少含有生成第一命令的选项。上述的指定时间是一个预设时间阈值范围,如5秒钟之内等,在该指定时间内接收到生成第一命令选项被触发的指令,则生成第一命令,如果在指定时间内未接收到生成第一命令选项被触发的指令,则存在两种执行流程,可以根据用户的设定进行具体的设置,上述两种执行流程的第一种是,若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成所述第一命令;第二种是,若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成不在系统后台运行的命令。
在一个实施例中,上述控制所述第一应用程序在所述系统后台继续运行的步骤S3之后,包括:
S4、接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
S5、判断所述第二应用程序是否为所述指定应用程序;
S6、若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
S7、若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
S8、将所述第二应用程序在所述系统前台运行。
如上述步骤S4至S8所述,在系统后台可能放置有多个应用程序,其中包括在系统后台一直运行的指定应用程序,以及不需要在系统后台继续运行的应用程序。当将在系统后台的第二应用程序返回系统前台的时候,需要判断该第二应用程序是否为上述的指定应用程序,如果不是,则正常执行onResume等流程,按照原生的系统逻辑执行即可;如果第二应用程序是上述指定应用程序,则不能直接按照正常执行onResume等流程,需要判断其在系统后台的时候是否 保持运行状态,如果是,则需要跳过执行onResume的流程,从系统得到焦点,并且释放第二应用程序的输入和界面响应等,并且还原其在切换到后台时修改的赋值等,使其能够在系统前台正常的运行。
在一个实施例中,上述控制所述第一应用程序在所述系统后台继续运行的步骤S3之前,包括:
S301、获取所述第一应用程序的预设等级;
S302、根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
如上述步骤S301和S302所述,上述预设等级是指用户对不同的应用程序设定的优先等级,具体为,在上述指定应用程序的包名等指定位置加入等级标签,不同的等级标签对应不同的系统资源分配。一般会设置一个等级和系统资源对应的数据列表,数据列表中是等级与系统资源的一对一的映射关系,当确定应用程序的等级之后,在数据列表中查找与其对应的系统资源,然后按照查找到的系统资源分配系统资源给对应的应用程序。在一具体实施例中,上述预设等级包括三级,一级对应的系统资源为30%,二级对应的系统资源为20%,三级对应的系统资源为10%,当第一应用程序的等级为一级时,则分配30%的系统资源在系统后台运行第一应用程序等。
在一个实施例中,当系统后台运行多个第一应用程序时,上述控制所述第一应用程序在所述系统后台继续运行的步骤S3之前,包括:
S311、根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源。
如上述步骤S311所述,按照第一应用程序被放入系统后台的时间顺序分配系统资源的规则包括多种,具体地包括,第一种,按照先后顺序逐渐得减少分配各第一应用程序的系统资源;第二种,按照先后顺序逐渐得增加分配各第一应用程序的系统资源;第三种,不按照先后顺序,分配各第一应用程序的系统资源均相同等。本实施例中,可以根据具体的使用习惯等自由设置上述三种规则。
在一个实施例中,上述根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源的步骤S311之前,还包括:
S311’、分配出固定的系统资源给位于系统后台运行的第一应用程序。
如上述步骤S311’所述,即不管在系统后台存在多少个运行的第一应用程序,系统只给出固定的如30%的系统资源给系统后台,以防止系统前台运行的应 用程序的运行速度下降过多,影响用户的使用。而固定的系统后台的系统资源,则可以根据上述S311中的方法进行分配等。
在一个具体实施例中,当系统后台运行多个第一应用程序时,上述控制所述第一应用程序在所述系统后台继续运行的步骤S3之后,包括:
如果当前在系统前台运行的第三应用程序出现卡顿情况,则根据预设规则关闭系统后台中运行的第一应用程序,并将该关闭的第一应用程序对应的系统资源分配给所述第三应用程序。
在本步骤中,上述预设规则包括多种,比如将预设等级较低的第一应用程序(一级高于二级,二级高于三级)停止运行;或者,将在系统后台运行时间最长的第一应用程序停止运行;或者,将系统后台运行中消耗系统资源最高的第一应用程序停止运行等,以提高第三应用程序的运行流程度等。
本申请的应用程序后台运行的方法,将在后台继续运行的第一应用程序的焦点还给系统,以及屏蔽第一应用程序的输入和界面响应,以实现第一应用程序在系统后台中自动运行,且不会影响在系统前台的对其它应用程序的操作,在同一个系统中,实现多个应用程序的同时运行,大大提高了用户的挂机体验等。
参照图2,本申请实施例还提供一种应用程序后台运行的装置,用于单系统的应用程序在后台运行。
上述单系统是指一个安卓系统等,比如,一部安卓手机上安装有两个并行的安卓系统,那么上述应用程序后台运行的方法适用于上述两个并行的安卓系统中的任意一个或全部,即,本申请中的应用程序后台运行不是系统与系统之间的切换后实现应用程序在后台继续运行,而是在同一个系统中实现应用程序后台运行。
上述装置包括:
第一获取单元10,用于获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
屏蔽单元20,用于将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
后台运行单元30,用于控制所述第一应用程序在所述系统后台继续运行。
在上述第一获取单元10中,上述系统前台即为手机等终端的可见显示平台, 如在一个具体实施例中,手机当前界面运行为某一游戏的应用程序,则该游戏的应用程序在系统前台运行。上述系统后台即为手机等终端的运行后台,如某一游戏的应用程序退到手机的系统后台后,手机等终端的显示界面不在显示该游戏的应用程序。上述第一应用程序退到系统后台继续运行的第一命令,即为将第一应用程序由系统前台退出到系统后台,并且继续在系统后台运行的命令。
在上述屏蔽单元20和后台运行单元30中,上述焦点(focus)即为确定的目标,在手机等运行应用程序时,焦点便对应当前在系统前台运行的应用程序,使系统的操作均为针对焦点所对应的应用程序。上述将对应所述第一应用程序的焦点还给所述系统,即为系统不将上述第一应用程序作为确定的目标,而将焦点对应其它应用程序等。上述屏蔽所述系统对所述第一应用程序的输入和界面响应,即为停止外界对该第一应用程序输入操作命令,当手机等终端接收到对界的操作命令时,该第一应用程序不做响应等。在一个具体实施例中,当前运行第一游戏应用程序,当将该第一游戏应用程序的焦点还给系统后,系统的关注目标不再是第一游戏应用程序;当将第一游戏应用程序的输入和界面响应被屏蔽后,界面的任何输入均不会对第一游戏应用程序的运行产生影响,即在屏蔽所述系统对所述第一游戏应用程序的输入和界面响应之前,设定游戏自动运行规则,当屏蔽所述系统对所述第一游戏应用程序的输入和界面响应之后,游戏仍然会按照设定的运行规则自动运行,不会对手机终端输入的命令产生响应。
上述将对应所述第一应用程序的焦点还给所述系统,以及关闭第一应用程序的输入和界面的实施,本实施例中,可以为:当上述的第一应用程序的window(窗口)状态是不可见,那么系统会收回对应第一应用程序的焦点,当窗口的焦点不在后台挂机的第一应用程序的时候,关于第一应用程序的事件输入流程会被忽略等。在一个具体实施例中,在将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应的同时,还会根据具体的设置,修改系统前台的赋值等,即在Activity生命周期管理中,当第一应用程序在系统后台运行,会跳过onResume和onStop等流程。
在一个实施例中,上述应用程序后台运行的装置还包括:
第一判断单元,用于判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
生成单元,用于若所述第一应用程序是预设的指定应用程序,则生成所述 第一命令。
在上述第一判断单元和生成单元中,对系统中需要在后台可以继续运行的应用程序进行标记,具体的标记方法包括在应用程序的包名上设置标识符等。当将在系统前台运行的第一应用程序退到系统后台的时候,先查看一下该第一应用程序是否为需要在后台继续运行的指定应用程序,如果是,则生成上述第一命令,然后跳过常规的onResume和onStop等流程,执行上述屏蔽单元20和后台运行单元30所能指定的动作;如果否,则执行系统正常的onResume和onStop等流程。
在一实施例中,上述生成单元,包括:
生成选项模块,用于若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令的选项并显示;
第一生成模块,用于若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令。
在上述生成选项模块和第一生成模块中,当判定上述第一应用程序为预设的需要在后台继续运行的指定应用程序时,并不是直接生成第一命令,而是先生成一个选项界面,该选项界面内至少含有生成第一命令的选项。上述的指定时间是一个预设时间阈值范围,如5秒钟之内等,在该指定时间内接收到生成第一命令选项被触发的指令,则生成第一命令,如果在指定时间内未接收到生成第一命令选项被触发的指令,则存在两种执行流程,可以根据用户的设定进行具体的设置,上述两种执行流程的第一种是,若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成所述第一命令;第二种是,若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成不在系统后台运行的命令。
在一个实施例中,上述应用程序后台运行的装置还包括:
接收单元,用于接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
第二判断单元,用于判断所述第二应用程序是否为所述指定应用程序;
第三判断单元,用于若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
释放单元,用于若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
前台运行单元,用于将所述第二应用程序在所述系统前台运行。
本实施例中,在系统后台可能放置有多个应用程序,其中包括在系统后台一直运行的指定应用程序,以及不需要在系统后台继续运行的应用程序。当将在系统后台的第二应用程序返回系统前台的时候,需要判断该第二应用程序是否为上述的指定应用程序,如果不是,则正常执行onResume等流程,按照原生的系统逻辑执行即可;如果第二应用程序是上述指定应用程序,则不能直接按照正常执行onResume等流程,需要判断其在系统后台的时候是否保持运行状态,如果是,则需要跳过执行onResume的流程,从系统得到焦点,并且释放第二应用程序的输入和界面响应等,并且还原其在切换到后台时修改的赋值等,使其能够在系统前台正常的运行。
在一个实施例中,上述应用程序后台运行的装置还包括:
第二获取单元,用于获取所述第一应用程序的预设等级;
分配单元,用于根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
本实施例中,上述预设等级是指用户对不同的应用程序设定的优先等级,具体为,在上述指定应用程序的包名等指定位置加入等级标签,不同的等级标签对应不同的系统资源分配。一般会设置一个等级和系统资源对应的数据列表,数据列表中是等级与系统资源的一对一的映射关系,当确定应用程序的等级之后,在数据列表中查找与其对应的系统资源,然后按照查找到的系统资源分配系统资源给对应的应用程序。在一具体实施例中,上述预设等级包括三级,一级对应的系统资源为30%,二级对应的系统资源为20%,三级对应的系统资源为10%,当第一应用程序的等级为一级时,则分配30%的系统资源在系统后台运行第一应用程序等。
在一个实施例中,当系统后台运行多个第一应用程序时,上述应用程序后台运行的装置还包括:
时间分配单元,用于根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源。
按照第一应用程序被放入系统后台的时间顺序分配系统资源的规则包括多种,具体地包括,第一种,按照先后顺序逐渐得减少分配各第一应用程序的系统资源;第二种,按照先后顺序逐渐得增加分配各第一应用程序的系统资源;第三种,不安按照先后顺序,分配各第一应用程序的系统资源均相同等。本实 施例中,可以根据具体的使用习惯等自由设置上述三种股则。
在一个实施例中,上述应用程序后台运行的装置还包括:
固定分配单元,用于分配出固定的系统资源给位于系统后台运行的第一应用程序。
本实施例中,即不管在系统后台存在多少个运行的第一应用程序,系统只给出固定的如30%的系统资源给系统后台,以防止系统前台运行的应用程序的运行速度下降过多,影响用户的使用。而固定的系统后台的系统资源,则可以根据上述时间分配单元的方法进行分配等。
在一个具体实施例中,当系统后台运行多个第一应用程序时,上述应用程序后台运行的装置还包括:
关闭单元,用于如果当前在系统前台运行的第三应用程序出现卡顿情况,则根据预设规则关闭系统后台中运行的第一应用程序,并将该关闭的第一应用程序对应的系统资源分配给所述第三应用程序。
在本实施例中,上述预设规则包括多种,比如将预设等级较低的第一应用程序(一级高于二级,二级高于三级)停止运行;或者,将在系统后台运行时间最长的第一应用程序停止运行;或者,将系统后台运行中消耗系统资源最高的第一应用程序停止运行等,以提高第三应用程序的运行流程度等。
本申请的应用程序后台运行的装置,将在后台继续运行的第一应用程序的焦点还给系统,以及屏蔽第一应用程序的输入和界面响应,以实现第一应用程序在系统后台中自动运行,且不会影响在系统前台的对其它应用程序的操作,在同一个系统中,实现多个应用程序的同时运行,大大提高了用户的挂机体验等。
参照图3,本发明实施例还提供一种移动终端,包括处理器1080和存储器1020,所述存储器1020用于存储处理器1080执行上述的应用程序后台运行的方法的程序;所述处理器1080被配置为用于执行所述存储器中存储的程序。
为了便于说明,仅示出了与本发明实施例相关的部分,具体技术细节未揭示的,请参照本发明实施例方法部分。该移动终端可以为包括手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、POS(Point of Sales,销售终端)、车载电脑等任意终端设备,以移动终端为手机为例:
图3示出的是与本发明实施例提供的移动终端相关的手机的部分结构的框 图。参考图3,手机包括:射频(Radio Frequency,RF)电路1010、存储器1020、输入单元1030、显示单元1040、传感器1050、音频电路1060、无线保真(wireless fidelity,WiFi)模块1070、处理器1080、以及电源1090等部件。本领域技术人员可以理解,图3中示出的手机结构并不构成对手机的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
下面结合图3对手机的各个构成部件进行具体的介绍:
RF电路1010可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,给处理器1080处理;另外,将设计上行的数据发送给基站。通常,RF电路1010包括但不限于天线、至少一个放大器、收发信机、耦合器、低噪声放大器(Low Noise Amplifier,LNA)、双工器等。此外,RF电路1010还可以通过无线通信与网络和其他设备通信。上述无线通信可以使用任一通信标准或协议,包括但不限于全球移动通讯系统(Global System of Mobile communication,GSM)、通用分组无线服务(General Packet Radio Service,GPRS)、码分多址(Code Division Multiple Access,CDMA)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、长期演进(Long Term Evolution,LTE)、电子邮件、短消息服务(Short Messaging Service,SMS)等。
存储器1020可用于存储软件程序以及模块,处理器1080通过运行存储在存储器1020的软件程序以及模块,从而执行手机的各种功能应用以及数据处理。存储器1020可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据手机的使用所创建的数据(比如音频数据、电话本等)等。此外,存储器1020可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。
输入单元1030可用于接收输入的数字或字符信息,以及产生与手机的用户设置以及功能控制有关的键信号输入。具体地,输入单元1030可包括触控面板1031以及其他输入设备1032。触控面板1031,也称为触摸屏,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触控面板1031上或在触控面板1031附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触控面板1031可包括触摸检测装置和触摸控制器两个 部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1080,并能接收处理器1080发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触控面板1031。除了触控面板1031,输入单元1030还可以包括其他输入设备1032。具体地,其他输入设备1032可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
显示单元1040可用于显示由用户输入的信息或提供给用户的信息以及手机的各种菜单。显示单元1040可包括显示面板1041,可选的,可以采用液晶显示器(Liquid Crystal Display,LCD)、有机发光二极管(Organic Light-Emitting Diode,OLED)等形式来配置显示面板1041。进一步的,触控面板1031可覆盖显示面板1041,当触控面板1031检测到在其上或附近的触摸操作后,传送给处理器1080以确定触摸事件的类型,随后处理器1080根据触摸事件的类型在显示面板1041上提供相应的视觉输出。虽然在图3中,触控面板1031与显示面板1041是作为两个独立的部件来实现手机的输入和输入功能,但是在某些实施例中,可以将触控面板1031与显示面板1041集成而实现手机的输入和输出功能。
手机还可包括至少一种传感器1050,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板1041的亮度,接近传感器可在手机移动到耳边时,关闭显示面板1041和/或背光。作为运动传感器的一种,加速计传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别手机姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于手机还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,在此不再赘述。
音频电路1060、扬声器1061,传声器1062可提供用户与手机之间的音频接口。音频电路1060可将接收到的音频数据转换后的电信号,传输到扬声器1061,由扬声器1061转换为声音信号输出;另一方面,传声器1062将收集的声音信号转换为电信号,由音频电路1060接收后转换为音频数据,再将音频数据输出处理器1080处理后,经RF电路1010以发送给比如另一手机,或者将音 频数据输出至存储器1020以便进一步处理。
WiFi属于短距离无线传输技术,手机通过WiFi模块1070可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图3示出了WiFi模块1070,但是可以理解的是,其并不属于手机的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器1080是手机的控制中心,利用各种接口和线路连接整个手机的各个部分,通过运行或执行存储在存储器1020内的软件程序和/或模块,以及调用存储在存储器1020内的数据,执行手机的各种功能和处理数据,从而对手机进行整体监控。可选的,处理器1080可包括一个或多个处理单元;优选的,处理器1080可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1080中。
手机还包括给各个部件供电的电源1090(比如电池),优选的,电源可以通过电源管理系统与处理器1080逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。
尽管未示出,手机还可以包括摄像头、蓝牙模块等,在此不再赘述。
参照图3,在本发明实施例中,该移动终端所包括的处理器1080还具有以下功能:
获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
控制所述第一应用程序在所述系统后台继续运行。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直 接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一种计算机可读存储介质中,上述提到的存储介质可以是只读存储器,磁盘或光盘等。
以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。

Claims (20)

  1. 一种应用程序后台运行的方法,其中,用于单系统的应用程序在后台运行,所述方法包括步骤:
    获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
    将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
    控制所述第一应用程序在所述系统后台继续运行。
  2. 根据权利要求1所述的应用程序后台运行的方法,其中,所述获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令的步骤之前,包括:
    判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
    若是,则生成所述第一命令。
  3. 根据权利要求2所述的应用程序后台运行的方法,其中,所述若是,则生成所述第一命令的步骤,包括:
    若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令的选项并显示;
    若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令;
    若在超出所述时间内,未接收到任何所述选项被触发的指令,则生成所述第一命令。
  4. 根据权利要求2所述的应用程序后台运行的方法,其中,所述控制所述第一应用程序在所述系统后台继续运行的步骤之后,包括:
    接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
    判断所述第二应用程序是否为所述指定应用程序;
    若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
    若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
    将所述第二应用程序在所述系统前台运行。
  5. 根据权利要求1所述的应用程序后台运行的方法,其中,所述控制所述第一应用程序在所述系统后台继续运行的步骤之前,包括:
    获取所述第一应用程序的预设等级;
    根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
  6. 根据权利要求5所述的应用程序后台运行的方法,其中,所述预设等级是指用户对不同的应用程序设定的优先等级;
    所述根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源的步骤,包括:
    当确定所述第一应用程序的等级之后,在数据列表中查找与其对应的系统资源,然后按照查找到的所述对应的系统资源分配系统资源给所述第一应用程序;
    其中,所述数据列表包括等级与系统资源的一对一的映射关系。
  7. 根据权利要求1所述的应用程序后台运行的方法,其中,当系统后台运行多个所述第一应用程序时,在所述控制所述第一应用程序在所述系统后台继续运行的步骤之前,还包括:
    根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源。
  8. 根据权利要求7所述的应用程序后台运行的方法,其中,所述根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源的规则,包括以下规则当中的任意一种:
    按照先后顺序逐渐得减少分配各第一应用程序的系统资源的规则;
    按照先后顺序逐渐得增加分配各第一应用程序的系统资源的规则;或
    不按照先后顺序,分配各第一应用程序的系统资源均相同的规则。
  9. 根据权利要求7所述的应用程序后台运行的方法,其中,在所述根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源的步骤之前,还包括:
    分配出固定的系统资源给位于系统后台运行的所述第一应用程序。
  10. 根据权利要求1所述的应用程序后台运行的方法,其中,当系统后台运行多个所述第一应用程序时,在所述控制所述第一应用程序在所述系统后台继续运行的步骤之后,还包括:
    若当前在系统前台运行的第三应用程序出现卡顿情况,则根据预设规则关闭系统后台中运行的第一应用程序,并将该关闭的第一应用程序对应的系统资源分配给所述第三应用程序。
  11. 根据权利要求10所述的应用程序后台运行的方法,其中,所述预设规则包括以下规则当中的任意一种:
    将预设等级较低的第一应用程序停止运行的规则;
    将在系统后台运行时间最长的第一应用程序停止运行的规则;或
    将系统后台运行中消耗系统资源最高的第一应用程序停止运行。
  12. 一种应用程序后台运行的装置,其中,用于单系统的应用程序在后台运行,所述装置包括:
    第一获取单元,用于获取将当前在系统前台运行的第一应用程序退到系统后台继续运行的第一命令;
    屏蔽单元,用于将对应所述第一应用程序的焦点还给所述系统,并屏蔽所述系统对所述第一应用程序的输入和界面响应;
    后台运行单元,用于控制所述第一应用程序在所述系统后台继续运行。
  13. 根据权利要求12所述的应用程序后台运行的装置,其中,所述装置还包括:
    第一判断单元,用于判断所述第一应用程序是否为预设的指定应用程序,所述指定应用程序为需要在后台继续运行的应用程序;
    生成单元,用于若所述第一应用程序是预设的指定应用程序,则生成所述第一命令。
  14. 根据权利要求13所述的应用程序后台运行的装置,其中,所述生成单元,包括:
    生成选项模块,用于若所述第一应用程是预设的指定应用程序,则生成是否生成所述第一命令的选项并显示;
    第一生成模块,用于若在指定时间内,接收到生成所述第一命令的选项被触发的指令,则生成所述第一命令。
  15. 根据权利要求13所述的应用程序后台运行的装置,其中,所述装置还包括:
    接收单元,用于接收将所述系统后台的第二应用程序切换到所述系统前台的第二命令;
    第二判断单元,用于判断所述第二应用程序是否为所述指定应用程序;
    第三判断单元,用于若所述第二应用程序是所述指定应用程序,则判断所述第二应用程序是否为在所述系统后台运行;
    释放单元,用于若判定所述第二应用程序在所述系统后台运行,则将焦点关注于所述第二应用程序,以及释放对所述第二应用程序的输入和界面响应;
    前台运行单元,用于将所述第二应用程序在所述系统前台运行。
  16. 根据权利要求12所述的应用程序后台运行的装置,其中,所述装置还包括:
    第二获取单元,用于获取所述第一应用程序的预设等级;
    分配单元,用于根据所述第一应用程序的预设等级,分配运行所述第一应用程序的系统资源。
  17. 根据权利要求12所述的应用程序后台运行的装置,其中,当系统后台运行多个第一应用程序时,所述装置还包括:
    时间分配单元,用于根据各所述第一应用程序被放入系统后台的时间顺序分配系统资源。
  18. 根据权利要求17所述的应用程序后台运行的装置,其中,所述装置还包括:
    固定分配单元,用于分配出固定的系统资源给位于系统后台运行的第一应用程序。
  19. 根据权利要求12所述的应用程序后台运行的装置,其中,当系统后台运行多个第一应用程序时,所述装置还包括:
    关闭单元,用于如果当前在系统前台运行的第三应用程序出现卡顿情况,则根据预设规则关闭系统后台中运行的第一应用程序,并将该关闭的第一应用程序对应的系统资源分配给所述第三应用程序。
  20. 一种移动终端,其中,包括处理器和存储器,
    所述存储器用于存储应用程序后台运行的装置执行权1至权11中任一项所述的应用程序后台运行的方法的程序;
    所述处理器被配置为用于执行所述存储器中存储的程序。
PCT/CN2019/095486 2018-07-17 2019-07-10 移动终端和应用程序后台运行的方法、装置 WO2020015571A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810785954.6 2018-07-17
CN201810785954.6A CN109101328A (zh) 2018-07-17 2018-07-17 移动终端和应用程序后台运行的方法、装置

Publications (1)

Publication Number Publication Date
WO2020015571A1 true WO2020015571A1 (zh) 2020-01-23

Family

ID=64846656

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/095486 WO2020015571A1 (zh) 2018-07-17 2019-07-10 移动终端和应用程序后台运行的方法、装置

Country Status (2)

Country Link
CN (1) CN109101328A (zh)
WO (1) WO2020015571A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427745A (zh) * 2020-03-19 2020-07-17 惠州Tcl移动通信有限公司 一种终端的使用控制方法、装置、存储介质及终端
CN114584613A (zh) * 2020-11-28 2022-06-03 华为技术有限公司 一种推送消息的方法、消息推送系统及电子设备

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109101328A (zh) * 2018-07-17 2018-12-28 奇酷互联网络科技(深圳)有限公司 移动终端和应用程序后台运行的方法、装置

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729240A (zh) * 2013-12-02 2014-04-16 青岛海信电器股份有限公司 应用程序控制方法
CN107315554A (zh) * 2016-04-26 2017-11-03 上海炬力集成电路设计有限公司 一种用户界面显示方法及装置
CN109101328A (zh) * 2018-07-17 2018-12-28 奇酷互联网络科技(深圳)有限公司 移动终端和应用程序后台运行的方法、装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8780130B2 (en) * 2010-11-30 2014-07-15 Sitting Man, Llc Methods, systems, and computer program products for binding attributes between visual components
CN105893142A (zh) * 2015-12-31 2016-08-24 乐视移动智能信息技术(北京)有限公司 一种资源分配方法及装置
CN108196947B (zh) * 2017-12-28 2020-02-07 维沃移动通信有限公司 一种应用运行状态控制方法及移动终端

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729240A (zh) * 2013-12-02 2014-04-16 青岛海信电器股份有限公司 应用程序控制方法
CN107315554A (zh) * 2016-04-26 2017-11-03 上海炬力集成电路设计有限公司 一种用户界面显示方法及装置
CN109101328A (zh) * 2018-07-17 2018-12-28 奇酷互联网络科技(深圳)有限公司 移动终端和应用程序后台运行的方法、装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427745A (zh) * 2020-03-19 2020-07-17 惠州Tcl移动通信有限公司 一种终端的使用控制方法、装置、存储介质及终端
CN114584613A (zh) * 2020-11-28 2022-06-03 华为技术有限公司 一种推送消息的方法、消息推送系统及电子设备
CN114584613B (zh) * 2020-11-28 2024-05-14 华为技术有限公司 一种推送消息的方法、消息推送系统及电子设备

Also Published As

Publication number Publication date
CN109101328A (zh) 2018-12-28

Similar Documents

Publication Publication Date Title
US11237724B2 (en) Mobile terminal and method for split screen control thereof, and computer readable storage medium
CN104298436B (zh) 一种快捷回复操作方法和终端
US10379696B2 (en) Method and apparatus for displaying popup window message
US11023296B2 (en) Method for managing multiple operating systems in a terminal
US20160315999A1 (en) Device and method for associating applications
CN105022552B (zh) 一种显示消息列表的方法和装置
CN105975190B (zh) 一种图形界面的处理方法、装置及系统
CN107066268B (zh) 微件应用的显示位置切换方法及装置
JP2015536009A (ja) 仮想キーボード表示方法、装置、端末、プログラム及び記録媒体
WO2020015571A1 (zh) 移动终端和应用程序后台运行的方法、装置
CN109960584A (zh) Cpu调频控制方法、终端及计算机可读存储介质
CN104077184B (zh) 一种应用程序的进程控制方法及计算机系统
CN109976611B (zh) 终端设备的控制方法及终端设备
CN109669784A (zh) 一种进程间通信的方法及系统
WO2021036926A1 (zh) 显示方法和电子设备
US20150089431A1 (en) Method and terminal for displaying virtual keyboard and storage medium
WO2020215969A1 (zh) 内容输入方法及终端设备
CN108958626A (zh) 手势识别方法、装置、可读存储介质及移动终端
CN109062634A (zh) 一种应用启动方法及移动终端
CN110096213B (zh) 基于手势的终端操作方法、移动终端及可读存储介质
WO2024082913A1 (zh) 多任务管理方法及电子设备
US11150913B2 (en) Method, device, and terminal for accelerating startup of application
WO2021012955A1 (zh) 界面切换方法及终端设备
US20230004273A1 (en) Ranging method and apparatus thereof, storage medium, and terminal device
US20150070360A1 (en) Method and mobile terminal for drawing sliding trace

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19837998

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19837998

Country of ref document: EP

Kind code of ref document: A1