CN110753909A - Service scheduling method and device, computer equipment and computer readable storage medium - Google Patents

Service scheduling method and device, computer equipment and computer readable storage medium Download PDF

Info

Publication number
CN110753909A
CN110753909A CN201780092177.0A CN201780092177A CN110753909A CN 110753909 A CN110753909 A CN 110753909A CN 201780092177 A CN201780092177 A CN 201780092177A CN 110753909 A CN110753909 A CN 110753909A
Authority
CN
China
Prior art keywords
service
target application
white list
identifier
foreground
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.)
Granted
Application number
CN201780092177.0A
Other languages
Chinese (zh)
Other versions
CN110753909B (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.)
Shenzhen Huantai Technology Co Ltd
Original Assignee
Shenzhen Huantai Technology Co 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 Shenzhen Huantai Technology Co Ltd filed Critical Shenzhen Huantai Technology Co Ltd
Publication of CN110753909A publication Critical patent/CN110753909A/en
Application granted granted Critical
Publication of CN110753909B publication Critical patent/CN110753909B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Landscapes

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

Abstract

The service scheduling method comprises the following steps: if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program; judging whether the service white list comprises a service identifier of the target application service; and if the service white list comprises the service identifier of the target application service, the application service is operated in the foreground.

Description

Service scheduling method and device, computer equipment and computer readable storage medium Technical Field
The present application relates to the field of computer technologies, and in particular, to a service scheduling method and apparatus, a computer device, and a computer-readable storage medium.
Background
In an intelligent terminal, there is a service without an interface, which is generally divided into two types, namely foreground service and background service. The foreground service has a higher priority when running, and cannot be actively closed by the terminal when the memory of the terminal system is insufficient and the occupancy rate of a Central Processing Unit (CPU) is too high. The background service has a low priority, and may be closed by the terminal to recycle resources when the memory of the terminal system is insufficient and the CPU occupancy rate is too high. If the developer does not follow the rules of the foreground service, many useless application services in the terminal system can be operated in the form of the foreground service, and therefore, the terminal resources are occupied.
Disclosure of Invention
The embodiment of the application provides a service scheduling method and device, computer equipment and a computer readable storage medium, which can reduce resource occupation.
A method of service scheduling, the method comprising:
if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
judging whether the service white list comprises a service identifier of the target application service;
and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground.
A service scheduling apparatus, the apparatus comprising:
the system comprises a list acquisition module, a service white list generation module and a service display module, wherein the list acquisition module is used for acquiring a service white list corresponding to an application program if a target application service of the application program is detected to start a foreground service in a terminal, the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
the identification matching module is used for judging whether the service white list comprises the service identification of the target application service;
and the service running module is used for running the target application service in a foreground if the service white list comprises the service identifier of the target application service.
A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions that, when executed by the processor, cause the processor to perform the steps of:
if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
judging whether the service white list comprises a service identifier of the target application service;
and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground.
One or more non-transitory computer-readable storage media embodying computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of:
if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
judging whether the service white list comprises a service identifier of the target application service;
and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts;
FIG. 1 is a diagram of an application environment of a service scheduling method in one embodiment;
FIG. 2 is a flow diagram of a method of service scheduling in one embodiment;
FIG. 3 is a flow diagram of a method of service scheduling in another embodiment;
FIG. 4 is a diagram of an input interface for invoking permissions in one embodiment;
FIG. 5 is a diagram of a terminal interface for modifying a service white list in one embodiment;
FIG. 6 is a flow diagram of a method of service scheduling in yet another embodiment;
FIG. 7 is a diagram illustrating an exemplary architecture of a service invocation device;
FIG. 8 is a diagram showing the structure of a service invocation means in another embodiment;
FIG. 9 is a diagram showing an internal configuration of a server in one embodiment;
fig. 10 is a block diagram of a partial structure of a cellular phone related to a computer device provided in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
FIG. 1 is a diagram of an application environment of a service scheduling method in one embodiment. As shown in fig. 1, the application environment includes a user terminal 102 and a server 104. The server 104 may send an installation package of the application program to the user terminal, and the user terminal 102 may install the application program through the installation package, perform application interaction with the server 104 through the application program, and transmit application data. In the process of running an application program by a user terminal 102, if a target application service of the application program is detected to start a foreground service in the terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program; judging whether the service white list comprises a service identifier of the target application service; and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground. The user terminal 102 is an electronic device located at the outermost periphery of the computer network and mainly used for inputting user information and outputting a processing result, and may be, for example, a personal computer, a mobile terminal, a personal digital assistant, a wearable electronic device, and the like. The server 104 is a device, such as one or more computers, for responding to service requests while providing computing services. It is understood that in other embodiments provided herein, the application environment of the service scheduling method may include only the user terminal 102.
FIG. 2 is a flow diagram of a method for service scheduling in one embodiment. As shown in fig. 2, the service scheduling method includes steps 202 to 206. Wherein:
step 202, if it is detected that a target application service of an application program starts a foreground service in a terminal, a service white list corresponding to the application program is obtained, the service white list includes one or more service identifiers, and each service identifier is used for uniquely identifying one application service of the application program.
The application program refers to software written for a certain application purpose in the electronic device, and the electronic device realizes the required service for the user through the application program. The terminal can be installed with one or more Application programs, and the user can realize the Application purpose through the operation of the Application program, for example, the user can operate a shopping APP (Application program) to purchase goods, can also listen to music through a music APP, can also play games through a game APP, and the like. When the terminal runs, the application programs all complete application operations through application services (services), and one application program may simultaneously enable one or more application services, for example, one application program may include multiple services such as a data update service, a music play service, and a data transmission service. In general, application services can be divided into foreground services and background services, where the foreground services refer to services running in the foreground of a terminal and the background services refer to services running in the background of the terminal. Foreground services have higher priority and cannot be actively closed in the running process of the terminal; background services have a low priority and may be turned off by the system in general when terminal resources are insufficient.
In one embodiment, the terminal stores a service white list, the service white list corresponds to the application programs one by one, and the service white list is used for storing service identifications corresponding to the application services allowed to run in the foreground service form. It will be appreciated that the service white list may include one or more service identifiers, each for uniquely identifying an application service of an application. The service white list may be stored in a database of the terminal or in a file. And acquiring a corresponding service white list according to the application program identifier, and then acquiring the service identifier in the service white list. The application identifier refers to a unique identifier for distinguishing different applications, and the application identifier may be, but is not limited to, a package name of the application, for example, in an Android system, the package name of the application may be com. The service identification is a unique identification of the application service and may be, but is not limited to, a class name of the application service.
Step 204, judging whether the service white list includes the service identifier of the target application service.
In an embodiment, the service white list may be displayed through an interface of the terminal, and the user may view the service white list through the terminal interface and may modify, add, delete, and the like the service identifier in the service white list as needed. Specifically, an operation instruction which is input by a user and used for modifying the service white list is received, and the service white list is modified according to the operation instruction input by the user. For example, a user may first select an application program to be operated through a terminal interface, the terminal displays a service white list corresponding to the application program and service identifiers of all application services, and then the user may edit the service white list through the terminal interface. It is to be understood that the service whitelist may be pushed to the terminal by the server. Specifically, when the server sends the installation package of the application program to the terminal, the server sends a corresponding service white list to the terminal at the same time. The server sends the service white list to the terminal, the service identifier of the application service with higher priority can be stored in the service white list, and the user can not change the application service with higher priority in the service white list.
And when detecting that the target application service starts foreground service, acquiring the service identifier of the target application service. For example, in the Android system, information of all application services is encapsulated in an activtymanager.runningserviceinfo class, and a service identifier of an application service can be acquired by calling the activtymanager.runningserviceinfo class. After the service identification of the target application service is obtained, traversing the service identification in the service white list, comparing the service identification corresponding to the target application service with the service identification in the service white list one by one, and judging whether the service white list contains the service identification corresponding to the target application service.
Step 206, if the service white list includes the service identifier of the target application service, the target application service is operated in the foreground.
After comparing the service identification of the target application service with the service identifications in the service white list, a match may be found. Specifically, if there is a matching item indicating that the service white list includes the service identifier of the target application service, the target application service is run in foreground. The foreground running of the target application service refers to running the application service in the form of foreground service. If the matching item does not exist, the service white list does not include the service identifier of the target application service, and the target application service is run in the background or not. Generally, if the application service is operated in the foreground service form, the application service may be displayed in a notification bar of the terminal, and the user may view the application service operated in the foreground service through the notification bar. When the application service is terminated, the information related to the application service displayed in the notification bar also disappears. If the application service is running as a background service, the application service will not be displayed in the notification bar.
In the service scheduling method provided in the foregoing embodiment, when detecting that the target application service of the application program is starting the foreground service in the terminal, a service white list corresponding to the application program is obtained, and the operation mode of the target application service is determined through the service white list. Malicious application services can be prevented from occupying foreground services randomly, so that system resources are occupied, and the utilization rate of the system resources is improved.
Fig. 3 is a flow chart of a service scheduling method in another embodiment. As shown in fig. 3, the service scheduling method includes steps 302 to 324. Wherein:
step 302, if the target application service of the application program is detected to start the foreground service in the terminal, the service level of the target application service is obtained.
In an embodiment, when it is detected that the target application service starts the foreground service, the service level of the target application service may be first obtained, and whether to run in the form of the foreground service is determined according to the service level of the target application service. Generally, the application service can be prioritized, and the service level refers to the priority of the application service. The application services may be classified according to different criteria, and may be divided into multiple levels, which is not limited in this embodiment. For example, the application services are classified according to the operation range and can be divided into a Local Service (Local Service) and a Remote Service (Remote search), and the application Service of the Local operation may be defined to be ranked higher than the application Service of the Remote operation. The application services can be classified according to their importance, and classified into three levels, i.e., level 1, level 2, and level 3.
Step 304, judging whether the service level is less than a preset level, if so, executing step 306; if not, go to step 318.
Judging whether the service level of the target application service is smaller than a preset level, if so, directly running the target application service in a foreground service form; and if the service identifier is smaller than the preset grade, acquiring a service white list corresponding to the application program, and operating according to the matching result of the service identifier of the target application service and the service white list.
Step 306, a service white list corresponding to the application program is obtained, where the service white list includes one or more service identifiers, and each service identifier is used to uniquely identify an application service of the application program.
In the embodiments provided in the present application, the service white list may be stored in a file form, and each application corresponds to one service white list file. The service white list file can be stored in a memory of the terminal, and the corresponding service white list file is obtained according to the packet name of the application program. When a user needs to check the service white list, the terminal acquires the application program name input by the user, searches the corresponding application program package name according to the application program name, and then searches the corresponding service white list file in the memory according to the application program package name. And then the terminal reads the service identifier in the service white list file and displays the read service identifier in a terminal interface. The user can also add, delete and the like the service identification in the service white list through the terminal interface.
Step 308, obtaining the service identifier of the target application service, and matching the service identifier of the target application service with the service identifier in the service white list.
And acquiring a service identifier corresponding to the target application service, searching for the service identifier in the service white list, matching the service identifier of the target application service with the service identifier in the service white list, and determining whether a matching item exists. For example, the service identifiers stored in the service white list include service 1, service 2, service 3, service 4, service 5, and service 6, and if the acquired service identifier of the application service is service 4, it indicates that the service identifier of the application service exists in the service white list.
Step 310, determining whether the service white list includes the service identifier of the target application service, if yes, executing step 318; if not, go to step 312.
Matching the service identification of the target application service with the service identification in the service white list, and running the application service in the form of foreground service if the service identification corresponding to the target application service exists in the service white list; and if the service identifier corresponding to the application service does not exist in the service white list, matching the service identifier with the service black list.
Step 312, determining whether the service blacklist includes the service identifier of the target application service, if yes, performing step 328; if not, go to step 314.
In one embodiment, the terminal may store a service white list and a service black list at the same time, and manage the application service through the service white list and the service black list together. The service blacklist is used for storing service identifiers corresponding to application services which are forbidden to run in a foreground service form. For example, some application services with large memory consumption may be set to prohibit running in a foreground service form, add a service identifier of the application service to a service blacklist, and run in a background service form directly when the application service runs, or do not run. The service identifier in the service blacklist can be set through the system, and the user can also perform user-defined setting.
Matching the service identifier of the target application service with the service identifier in the service blacklist, and if the service identifier of the target application service exists in the service blacklist, directly operating the target application service in a background service mode; if the service identifier of the target application service does not exist in the service blacklist, it indicates that the service identifier of the target application service does not exist in both the service white list and the service blacklist, and the operation permission of the target application service can be set by the user.
And step 314, receiving the calling authority input by the terminal.
Specifically, the user can input the calling authority of the target application service through the terminal, wherein the calling authority is used for indicating whether the target application service is allowed to run in the form of foreground service. If the user inputs the permission to call through the terminal, the target application service is operated in the form of foreground service; and if the user inputs the call prohibition information through the terminal, running the target application service in the background service mode. FIG. 4 is a diagram of an input interface for invoking permissions in one embodiment. As shown in fig. 4, when the terminal detects that the target application service starts the foreground service, the terminal interface prompts the user to input the invocation permission in a popup mode, the user selects whether to allow the target application service to operate in a foreground service mode according to the popup interface, and if the user selects "yes", the target application service is operated in the foreground service mode, and the service identifier corresponding to the target application service is added to the service white list. If the user selects 'no', the target application service is operated in the background service mode, and the service identifier corresponding to the target application service is added to the service blacklist.
And step 316, if the calling permission is allowed to be called, adding the service identifier corresponding to the target application service into a service white list.
Step 318, foreground running target application service.
If the user inputs the permission to call through the terminal, the user indicates that the target application service is permitted to run in the form of foreground service, the service identifier corresponding to the target application service is added into a service white list, and the target application service can be directly run in the form of foreground service when the foreground service is re-enabled next time by the target application service. Specifically, if the calling authority input by the terminal is allowed to be called, the target application service is operated in a foreground service form, and a service identifier corresponding to the target application service is added to a service white list.
And 320, if the running time of the target application service in the foreground exceeds a time threshold, running the target application service in the background.
In one embodiment, a duration threshold may also be stored in the service white list, where the duration threshold refers to a length of time that the application service is allowed to run in the foreground service form. The service identification in the service white list is in one-to-one correspondence with the time length threshold, and the corresponding time length threshold can be obtained according to the service identification. Specifically, timing is started from the time when the target application service operates in a background mode, the operating duration of the current time is obtained in real time, and if the operating duration exceeds a duration threshold, the target application service is converted into a background service to operate. For example, the duration threshold corresponding to application service 1 is 30 minutes, and application service 1 is selected from 12: 00 starts running in foreground service, when the time reaches 12: and 30, converting the application service 1 into a background service to run.
And 322, acquiring the resource occupancy rate of the terminal, acquiring a service identifier corresponding to the resource occupancy rate in the service white list, and running the application service corresponding to the acquired service identifier in a background service mode.
In an embodiment, the resource occupancy rate refers to a ratio of occupied terminal resources, and may specifically include memory occupancy rate, CPU occupancy rate, and the like, which is not limited herein. The CPU is a structure providing operation and control functions in the electronic device, and may be a large-scale integrated circuit, and is mainly used for interpreting computer instructions and processing data in computer software. When the electronic device runs computer software, the application event needs to be processed through the CPU, and the CPU resource is occupied by the application event. The CPU occupancy may refer to a ratio of occupied CPU resources to total CPU resources, or may refer to a ratio of time for the CPU to execute a task to total operating time. In general, CPU occupancy may be, but is not limited to, being embodied in percentage form, and how much or how long a particular CPU resource is occupied is represented by a particular percentage value. For example, if the CPU occupancy rate is 50%, it may indicate that 50% of the CPU resources are occupied, or may indicate that 50% of the CPU resources are occupied in the total operating time.
The resource occupancy rate and the service identification can be established in a corresponding relationship, and the resource occupancy rate and the service level can also be established in a corresponding relationship, so that the corresponding service identification is obtained. And acquiring a corresponding service identifier according to the resource occupancy rate, and running the application service corresponding to the acquired service identifier in a background service mode. For example, the service level is divided into a level 1, a level 2 and a level 3, and when the memory occupancy rate is greater than 50%, the application service corresponding to the level 3 is operated in a background service mode; when the memory occupancy rate is more than 70%, the application services corresponding to the level 2 and the level 3 are operated in a background service mode; and when the memory occupancy rate is greater than 90%, running the application services corresponding to the level 1, the level 2 and the level 3 in a background service mode.
Specifically, the resource occupancy rate corresponding to each application program may be obtained, the corresponding service identifier may be obtained according to the resource occupancy rate corresponding to each application program, and the application service corresponding to the obtained service identifier may be run in the form of a background service. For example, if the CPU occupancy rate of a certain application program is higher than 20%, the application service with the service level of level 3 corresponding to the application program is run in the background service mode, so that the resources of the terminal can be reasonably managed.
In one embodiment, the monitoring log file may be obtained in a preset storage address, and the CPU occupancy rate may be obtained according to the monitoring log file. The preset storage address refers to a preset address for storing a monitoring log file, and the monitoring log file records the change of the specific running condition of the CPU from starting to the current moment. In the preset storage address, the monitoring log file can be searched according to the monitoring log file identifier. The monitoring log file identifier refers to a unique identifier for distinguishing the monitoring log file, such as the name and number of the monitoring log file. Specifically, the preset storage address may include a plurality of subfolders, and each of the subfolders stores a process log file. The process log files record the change of the specific operation condition of the process from the starting to the current time, and the condition of the CPU resource occupied by the process can be obtained according to the process log files, namely the CPU occupancy rate of the process can be obtained. The process refers to a basic unit for scheduling resource allocation by the CPU, and is also a basic unit for the CPU to execute a task. Each application program comprises one or more processes, so that the CPU occupancy rate corresponding to each application program can be acquired according to the CPU occupancy rate of the process and the corresponding relation between the process and the application program.
For example, in the Android system, a monitoring log file storing the CPU total occupancy information may be read in a/proc directory. The/proc directory includes a plurality of subfolders, and the subfolders store process log files of CPU occupation information corresponding to each process. The file name of the monitoring log file stored in the/proc directory is "stat", the subfolder in the/proc directory stores the process log file, and the file name of the process log file is "stat". The stat file under the/proc directory records the total CPU occupation information, and the stat file in the subfolder under the/proc directory records the CPU occupation information of each process. For example, a stat file under the/proc/pid directory records CPU occupation information of a pid process, where pid is a process identifier.
In step 324, if it is detected that the application program is deleted, the service white list corresponding to the application program is deleted.
In one embodiment, the service white list corresponds to the application program, and when the application program is detected to be deleted, the service white list corresponding to the application program can be deleted at the same time. It is understood that the service blacklist also corresponds to the application program, and when the application program is detected to be deleted, the service blacklist corresponding to the application program can also be deleted. And when the application program is installed again, the corresponding service white list and the service black list are established again.
Step 326, if the calling authority is call prohibition, adding the service identifier corresponding to the target application service into the service blacklist.
Step 328, the background runs the target application service.
If the user inputs the call prohibition information through the terminal, the user prohibits the target application service from running in a foreground service form, the service identifier corresponding to the target application service is added into a service blacklist, and the target application service is prohibited from running in the foreground service form when the target application service starts the foreground service again next time, and the target application service is directly run in the background service form. Specifically, if the call authority input by the terminal is call prohibition, the target application service is run in a background service mode, and a service identifier corresponding to the target application service is added to a service blacklist.
FIG. 5 is a diagram of a terminal interface for modifying a service white list in one embodiment. As shown in fig. 5, in the modification interface of the service white list, a user may select an application program that needs to be modified, and then the terminal may select the service white list corresponding to the application program for displaying. The user can select the service identification needing to be modified in the service white list, and click a 'delete' button to delete the selected service identification. The "add" button may also be clicked to add a new service identification.
In the service scheduling method provided in the foregoing embodiment, when detecting that the target application service of the application program is starting a foreground service in the terminal, a service white list corresponding to the target application program is obtained, and the operation mode of the target application service is determined through the service white list. Malicious application services can be prevented from occupying foreground services randomly, so that system resources are occupied, and the utilization rate of the system resources is improved.
Fig. 6 is a flow chart of a service scheduling method in yet another embodiment. The service scheduling method includes steps 602 to 614. Wherein:
step 602, detecting that a target application service of an application program starts a foreground service.
Step 604, determining whether the target application service has a calling authority, if yes, executing step 614; otherwise, go to step 606.
Acquiring a service identifier of a target application service, matching the service identifier of the target application service with a service identifier in a service white list, and if the service identifier of the target application service exists in the service white list, the target application service has a calling authority; and if the service identifier of the target application service does not exist in the service white list, the target application service has no calling authority.
Step 606, determining whether the target application service has been rejected, if yes, executing step 612; otherwise, step 608 is performed.
Matching the service identifier of the target application service with the service identifier in the service blacklist, and if the service identifier of the target application service exists in the service blacklist, indicating that the target application service is refused to call foreground service; and if the service identifier of the target application service does not exist in the service white list, the target application service is not refused to invoke the foreground service.
Step 608, receiving the invoking authority input by the user.
Step 610, judging whether the calling authority input by the user is allowed to be called, if so, executing step 614; otherwise, step 612 is performed.
Step 612, the target application service is executed in the background.
And step 614, the target application service is operated in the foreground.
FIG. 7 is a diagram illustrating an exemplary architecture of a service invocation device. As shown in fig. 7, the service invocation apparatus 700 includes a list acquisition module 702, an identification matching module 704 and a service operation module 706. Wherein:
a list obtaining module 702, configured to, if a foreground service is started by a target application service of an application program detected in a terminal, obtain a service white list corresponding to the application program, where the service white list includes one or more service identifiers, and each service identifier is used to uniquely identify an application service of the application program.
An identifier matching module 704, configured to determine whether the service white list includes the service identifier of the target application service.
A service running module 706, configured to, if the service white list includes the service identifier of the target application service, foreground run the target application service.
In the service scheduling apparatus provided in the foregoing embodiment, when detecting that the target application service having the application program starts a foreground service in the terminal, the service scheduling apparatus acquires the corresponding service white list, and determines the operation mode of the target application service through the service white list. Malicious application services can be prevented from occupying foreground services randomly, so that system resources are occupied, and the utilization rate of the system resources is improved.
Fig. 8 is a schematic structural diagram of a service invocation device in another embodiment. As shown in fig. 7, the service invocation apparatus 800 includes a list acquisition module 802, an identification matching module 804, a service execution module 806, a resource acquisition module 808, and a list deletion module 810. Wherein:
a list obtaining module 802, configured to, if a foreground service is started by a target application service of an application program detected in a terminal, obtain a service white list corresponding to the application program, where the service white list includes one or more service identifiers, and each service identifier is used to uniquely identify one application service of the application program.
An identifier matching module 804, configured to determine whether the service white list includes the service identifier of the target application service.
A service running module 806, configured to, if the service white list includes the service identifier of the target application service, foreground run the target application service.
A resource obtaining module 808, configured to obtain a resource occupancy rate of a terminal, and obtain a service identifier corresponding to the resource occupancy rate in the service white list; and running the application service corresponding to the acquired service identification in a background service mode.
The list deleting module 810 deletes the service white list corresponding to the application program if detecting that the application program is deleted.
In the service scheduling apparatus provided in the foregoing embodiment, when detecting that the target application service having the application program starts a foreground service in the terminal, the service scheduling apparatus acquires the corresponding service white list, and determines the operation mode of the target application service through the service white list. Malicious application services can be prevented from occupying foreground services randomly, so that system resources are occupied, and the utilization rate of the system resources is improved.
In an embodiment, the list obtaining module 802 is further configured to obtain a service level of a target application service of an application program if the target application service is detected to start a foreground service in the terminal; and if the service level is less than a preset level, acquiring a service white list corresponding to the application program.
In one embodiment, the service running module 806 is further configured to foreground-run the target application service if the service level is greater than or equal to a preset level.
In an embodiment, the service running module 806 is further configured to obtain a duration threshold corresponding to the service identifier in the service white list; and if the running time of the target application service in the foreground exceeds the time threshold, running the target application service in the background.
In one embodiment, the service running module 806 is further configured to run the target application service in the background if the service white list does not include the service identifier of the target application service.
In an embodiment, if the service white list does not include the service identifier of the target application service, the service running module 806 receives a call permission input by the terminal, where the call permission is used to indicate whether permission for foreground running of the target application service is allowed; and running the target application service according to the calling authority.
In an embodiment, the service running module 806 is further configured to, if the service white list does not include the service identifier of the target application service, match the service identifier with a service black list, where the service black list is used to store a service identifier corresponding to an application service prohibited from being run in a foreground; if the service blacklist does not include the service identifier of the target application service, receiving a calling authority input by the terminal; and running the target application service according to the calling authority.
The division of each module in the service invocation device is only used for illustration, and in other embodiments, the service invocation device may be divided into different modules as needed to complete all or part of the functions of the service invocation device.
The embodiment of the application also provides a storage medium. One or more non-volatile storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the steps of:
if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
judging whether the service white list comprises a service identifier of the target application service;
and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground.
In an embodiment, the obtaining, by the processor, a service white list corresponding to an application program if it is detected that a target application service of the application program starts a foreground service in a terminal includes:
if the target application service of the application program is detected to start foreground service in the terminal, acquiring the service level of the target application service;
and if the service level is less than a preset level, acquiring a service white list corresponding to the application program.
In one embodiment, the method performed by the processor further comprises:
and if the service level is greater than or equal to a preset level, the target application service is operated in the foreground.
In one embodiment, the method performed by the processor further comprises:
acquiring a time length threshold corresponding to the service identifier in the service white list;
and if the running time of the target application service in the foreground exceeds the time threshold, running the target application service in the background.
In one embodiment, the method performed by the processor further comprises:
and if the service white list does not comprise the service identifier of the target application service, the target application service is operated in a background.
In one embodiment, the method performed by the processor further comprises:
if the service white list does not include the service identifier of the target application service, receiving a calling authority input by the terminal, wherein the calling authority is used for indicating whether the authority of the target application service is allowed to be operated in the foreground;
and running the target application service according to the calling authority.
In one embodiment, the method performed by the processor further comprises:
if the service white list does not include the service identifier of the target application service, matching the service identifier with a service blacklist, wherein the service blacklist is used for storing the service identifier corresponding to the application service prohibited from running by a foreground;
if the service blacklist does not include the service identifier of the target application service, receiving a calling authority input by the terminal;
and running the target application service according to the calling authority.
In one embodiment, the running of the target application service according to the call authority by the processor comprises:
if the calling authority is allowed to be called, adding a service identifier corresponding to the target application service into the service white list, and running the target application service in a foreground;
and if the calling authority is forbidden to be called, adding a service identifier corresponding to the target application service into the service blacklist, and running the target application service in a background.
In one embodiment, the method performed by the processor further comprises:
acquiring resource occupancy rate of a terminal, and acquiring a service identifier corresponding to the resource occupancy rate in the service white list;
and running the application service corresponding to the acquired service identification in a background service mode.
In one embodiment, the method performed by the processor further comprises:
and if the application program is detected to be deleted, deleting the service white list corresponding to the application program.
Fig. 9 is a schematic diagram of an internal configuration of a server in one embodiment. As shown in fig. 9, the server includes a processor, a nonvolatile storage medium, an internal memory, and a network interface connected through a system bus. Wherein the non-volatile storage medium of the server stores an operating system and a computer program. The computer program is executed by a processor to implement a service scheduling method. The processor of the server is used for providing calculation and control capacity and supporting the operation of the whole server. The network interface of the server is used for communicating with an external terminal through network connection, such as receiving an installation package acquisition request sent by the terminal and returning an installation package and a service white list to the terminal. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers. Those skilled in the art will appreciate that the architecture shown in fig. 9 is a block diagram of only a portion of the architecture associated with the subject application, and does not constitute a limitation on the servers to which the subject application applies, as a particular server may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
The embodiment of the invention also provides computer equipment. As shown in fig. 10, for convenience of illustration, only the portion related to the embodiment of the present invention is shown, and the detailed technical details are not disclosed, please refer to the method portion of the embodiment of the present invention. The computer device may be any terminal device including a mobile phone, a tablet computer, a PDA (Personal Digital Assistant), a POS (Point of Sales), a vehicle-mounted computer, a wearable device, and the like, taking the computer device as the mobile phone as an example:
fig. 10 is a block diagram of a partial structure of a cellular phone related to a computer device provided in an embodiment of the present invention. Referring to fig. 10, the cellular phone includes: radio Frequency (RF) circuit 1010, memory 1020, input unit 1030, display unit 1040, sensor 1050, audio circuit 1060, wireless fidelity (WiFi) module 1070, processor 1080, and power source 1090. Those skilled in the art will appreciate that the handset configuration shown in fig. 10 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The RF circuit 1010 may be configured to receive and transmit signals during information transmission and reception or during a call, and may receive downlink information of a base station and then process the received downlink information to the processor 1080; the uplink data may also be transmitted to the base station. Typically, the RF circuitry 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. In addition, the RF circuitry 1010 may also communicate with networks and other devices via wireless communications. The wireless communication may use any communication standard or protocol, including but not limited to Global System for Mobile communication (GSM), General Packet Radio Service (GPRS), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Long Term Evolution (LTE)), e-mail, Short Messaging Service (SMS), and the like.
The memory 1020 can be used for storing software programs and modules, and the processor 1080 executes various functional applications and data processing of the mobile phone by operating the software programs and modules stored in the memory 1020. The memory 1020 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required for at least one function (such as an application program for a sound playing function, an application program for an image playing function, and the like), and the like; the data storage area may store data (such as audio data, an address book, etc.) created according to the use of the mobile phone, and the like. Further, the memory 1020 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The input unit 1030 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the cellular phone 1000. Specifically, the input unit 1030 may include a touch panel 1031 and other input devices 1032. The touch panel 1031, which may also be referred to as a touch screen, may collect touch operations by a user (e.g., operations by a user on or near the touch panel 1031 using any suitable object or accessory such as a finger, a stylus, etc.) and drive the corresponding connection device according to a preset program. In one embodiment, the touch panel 1031 may include two parts, a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 1080, and can receive and execute commands sent by the processor 1080. In addition, the touch panel 1031 may be implemented by various types such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. The input unit 1030 may include other input devices 1032 in addition to the touch panel 1031. In particular, 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.), and the like.
The display unit 1040 may be used to display information input by a user or information provided to the user and various menus of the cellular phone. The display unit 1040 may include a display panel 1041. In one embodiment, 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. In one embodiment, the touch panel 1031 can overlay the display panel 1041, and when the touch panel 1031 detects a touch operation on or near the touch panel 1031, the touch operation is transmitted to the processor 1080 to determine the type of the touch event, and then the processor 1080 provides a corresponding visual output on the display panel 1041 according to the type of the touch event. Although in fig. 10, the touch panel 1031 and the display panel 1041 are two separate components to implement the input and output functions of the mobile phone, in some embodiments, the touch panel 1031 and the display panel 1041 may be integrated to implement the input and output functions of the mobile phone.
The cell phone 1000 may also include at least one sensor 1050, such as a light sensor, motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 1041 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1041 and/or the backlight when the mobile phone moves to the ear. The motion sensor can comprise an acceleration sensor, the acceleration sensor can detect the magnitude of acceleration in each direction, the magnitude and the direction of gravity can be detected when the mobile phone is static, and the motion sensor can be used for identifying the application of the gesture of the mobile phone (such as horizontal and vertical screen switching), the vibration identification related functions (such as pedometer and knocking) and the like; the mobile phone may be provided with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor.
Audio circuitry 1060, speaker 1061, and microphone 1062 may provide an audio interface between a user and a cell phone. The audio circuit 1060 can transmit the electrical signal converted from the received audio data to the speaker 1061, and the electrical signal is converted into a sound signal by the speaker 1061 and output; on the other hand, the microphone 1062 converts the collected sound signal into an electrical signal, which is received by the audio circuit 1060 and converted into audio data, and the audio data is processed by the audio data output processor 1080 and then transmitted to another mobile phone through the RF circuit 1010, or the audio data is output to the memory 1020 for subsequent processing.
WiFi belongs to short-distance wireless transmission technology, and the mobile phone can help the user to send and receive e-mail, browse web pages, access streaming media, etc. through the WiFi module 1070, which provides wireless broadband internet access for the user. Although fig. 10 shows the WiFi module 1070, it is to be understood that it does not belong to the essential constitution of the handset 1000 and may be omitted as needed.
The processor 1080 is a control center of the mobile phone, connects various parts of the whole mobile phone by using various interfaces and lines, and executes various functions of the mobile phone and processes data by operating or executing software programs and/or modules stored in the memory 1020 and calling data stored in the memory 1020, thereby integrally monitoring the mobile phone. In one embodiment, processor 1080 may include one or more processing units. In one embodiment, processor 1080 may integrate an application processor and a modem processor, wherein the application processor primarily handles operating systems, user interfaces, applications, and the like; the modem processor handles primarily wireless communications. It is to be appreciated that the modem processor described above may not be integrated into processor 1080.
The handset 1000 also includes a power supply 1090 (e.g., a battery) for powering the various components, which may preferably be logically coupled to the processor 1080 via a power management system that may be configured to manage charging, discharging, and power consumption.
In one embodiment, the cell phone 1000 may also include a camera, a bluetooth module, and the like.
In the embodiment of the present invention, the processor 1080 included in the mobile terminal implements the service scheduling method provided by the above-described embodiment when executing the computer program stored in the memory.
A computer program product comprising instructions which, when run on a computer, cause the computer to perform the service scheduling method provided by the above embodiments.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), or the like.
Any reference to memory, storage, database, or other medium as used herein may include non-volatile and/or volatile memory. Suitable non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM), which acts as external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), Enhanced SDRAM (ESDRAM), synchronous Link (Synchlink) DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and bus dynamic RAM (RDRAM).
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (13)

  1. A method of service scheduling, the method comprising:
    if a target application service of an application program is detected to start a foreground service in a terminal, acquiring a service white list corresponding to the application program, wherein the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
    judging whether the service white list comprises a service identifier of the target application service;
    and if the service white list comprises the service identifier of the target application service, the target application service is operated in the foreground.
  2. The service scheduling method of claim 1, wherein, if it is detected that a target application service of an application starts a foreground service in a terminal, acquiring a service white list corresponding to the application comprises:
    if the target application service of the application program is detected to start foreground service in the terminal, acquiring the service level of the target application service;
    and if the service level is less than a preset level, acquiring a service white list corresponding to the application program.
  3. The service scheduling method of claim 2, wherein the method further comprises:
    and if the service level is greater than or equal to a preset level, the target application service is operated in the foreground.
  4. The service scheduling method of claim 1, wherein the method further comprises:
    acquiring a time length threshold corresponding to the service identifier in the service white list;
    and if the running time of the target application service in the foreground exceeds the time threshold, running the target application service in the background.
  5. The service scheduling method of claim 1, wherein the method further comprises:
    and if the service white list does not comprise the service identifier of the target application service, the target application service is operated in a background.
  6. The service scheduling method of claim 1, wherein the method further comprises:
    if the service white list does not include the service identifier of the target application service, receiving a calling authority input by the terminal, wherein the calling authority is used for indicating whether the authority of the target application service is allowed to be operated in the foreground;
    and running the target application service according to the calling authority.
  7. The service scheduling method of claim 1, wherein the method further comprises:
    if the service white list does not include the service identifier of the target application service, matching the service identifier with a service blacklist, wherein the service blacklist is used for storing the service identifier corresponding to the application service prohibited from running by a foreground;
    if the service blacklist does not include the service identifier of the target application service, receiving a calling authority input by the terminal;
    and running the target application service according to the calling authority.
  8. The service scheduling method according to claim 6 or 7, wherein the running the target application service according to the invocation authority comprises:
    if the calling authority is allowed to be called, adding a service identifier corresponding to the target application service into the service white list, and running the target application service in a foreground;
    and if the calling authority is forbidden to be called, adding a service identifier corresponding to the target application service into the service blacklist, and running the target application service in a background.
  9. The service scheduling method according to any of claims 1 to 7, wherein the method further comprises:
    acquiring resource occupancy rate of a terminal, and acquiring a service identifier corresponding to the resource occupancy rate in the service white list;
    and running the application service corresponding to the acquired service identification in a background service mode.
  10. The service scheduling method according to any of claims 1 to 7, wherein the method further comprises:
    and if the application program is detected to be deleted, deleting the service white list corresponding to the application program.
  11. A service scheduling apparatus, the apparatus comprising:
    the system comprises a list acquisition module, a service white list generation module and a service display module, wherein the list acquisition module is used for acquiring a service white list corresponding to an application program if a target application service of the application program is detected to start a foreground service in a terminal, the service white list comprises one or more service identifiers, and each service identifier is used for uniquely marking one application service of the application program;
    the identification matching module is used for judging whether the service white list comprises the service identification of the target application service;
    and the service running module is used for running the target application service in a foreground if the service white list comprises the service identifier of the target application service.
  12. A computer device comprising a memory and a processor, the memory having stored therein computer readable instructions that, when executed by the processor, cause the processor to perform the service scheduling method of any one of claims 1 to 10.
  13. One or more non-transitory computer-readable storage media containing computer-executable instructions that, when executed by one or more processors, cause the processors to perform the service scheduling method of any one of claims 1 to 10.
CN201780092177.0A 2017-10-31 2017-10-31 Service scheduling method and device, computer equipment and computer readable storage medium Active CN110753909B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/108628 WO2019084783A1 (en) 2017-10-31 2017-10-31 Service scheduling method and apparatus, computer device, and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110753909A true CN110753909A (en) 2020-02-04
CN110753909B CN110753909B (en) 2024-04-02

Family

ID=66332823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201780092177.0A Active CN110753909B (en) 2017-10-31 2017-10-31 Service scheduling method and device, computer equipment and computer readable storage medium

Country Status (2)

Country Link
CN (1) CN110753909B (en)
WO (1) WO2019084783A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202728A (en) * 2020-09-11 2021-01-08 广州宸祺出行科技有限公司 Method and system for mobile terminal to call module through routing protocol

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164269A (en) * 2011-12-08 2013-06-19 中兴通讯股份有限公司 Method and terminal achieving multi-window display of application programs
CN105183135A (en) * 2015-09-02 2015-12-23 北京奇虎科技有限公司 Method for saving power consumption of smart phone and smart phone
US20160308879A1 (en) * 2014-02-11 2016-10-20 Tencent Technology (Shenzhen) Company Limited Application-Based Service Providing Method, Apparatus, and System

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104699218B (en) * 2013-12-10 2019-04-19 华为终端(东莞)有限公司 A kind of task management method and equipment
CN103927485A (en) * 2014-04-24 2014-07-16 东南大学 Android application program risk assessment method based on dynamic monitoring
CN104298549B (en) * 2014-09-30 2018-03-30 北京金山安全软件有限公司 Method and device for cleaning application programs in mobile terminal and mobile terminal
CN106909447B (en) * 2015-12-23 2019-11-15 北京金山安全软件有限公司 Background application processing method and device and terminal

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103164269A (en) * 2011-12-08 2013-06-19 中兴通讯股份有限公司 Method and terminal achieving multi-window display of application programs
US20160308879A1 (en) * 2014-02-11 2016-10-20 Tencent Technology (Shenzhen) Company Limited Application-Based Service Providing Method, Apparatus, and System
CN105183135A (en) * 2015-09-02 2015-12-23 北京奇虎科技有限公司 Method for saving power consumption of smart phone and smart phone

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112202728A (en) * 2020-09-11 2021-01-08 广州宸祺出行科技有限公司 Method and system for mobile terminal to call module through routing protocol

Also Published As

Publication number Publication date
CN110753909B (en) 2024-04-02
WO2019084783A1 (en) 2019-05-09

Similar Documents

Publication Publication Date Title
US11099900B2 (en) Memory reclamation method and apparatus
US10635449B2 (en) Method and apparatus for running game client
US9800609B2 (en) Method, device and system for detecting malware in a mobile terminal
CN108536783B (en) Data processing method and device, terminal and computer readable storage medium
CN107734616B (en) Application program closing method and device, storage medium and electronic equipment
CN107329985B (en) Page collection method and device and mobile terminal
CN108156508B (en) Barrage information processing method and device, mobile terminal, server and system
CN110532764B (en) Authority processing method, mobile terminal and readable storage medium
CN108549698B (en) File processing method and device, mobile terminal and computer readable storage medium
JP6492184B2 (en) Method, device, and system for managing information recommendations
CN109992965B (en) Process processing method and device, electronic equipment and computer readable storage medium
CN109445917B (en) Application processing method and device, electronic equipment and computer readable storage medium
CN106713608B (en) Application function state modification method and device and terminal
EP2869604B1 (en) Method, apparatus and device for processing a mobile terminal resource
US10298590B2 (en) Application-based service providing method, apparatus, and system
CN108509788B (en) Information sharing method and device, computer readable storage medium and terminal
CN109992399B (en) Resource management method, resource management device, mobile terminal and computer-readable storage medium
CN110018886B (en) Application state switching method and device, electronic equipment and readable storage medium
CN111274463B (en) Information display method, device and storage medium based on IM contact person grouping setting
CN106020945B (en) Shortcut item adding method and device
CN107463395B (en) Component calling method and device
CN115225966B (en) Application starting method, device, terminal equipment and storage medium
CN110213597B (en) Method and device for entering live broadcast room through browser
CN110753909B (en) Service scheduling method and device, computer equipment and computer readable storage medium
CN108513005B (en) Contact person information processing method and device, electronic equipment and storage medium

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
GR01 Patent grant
GR01 Patent grant