CN110727473A - Resource control method, device, system, storage medium and electronic equipment - Google Patents
Resource control method, device, system, storage medium and electronic equipment Download PDFInfo
- Publication number
- CN110727473A CN110727473A CN201910957155.7A CN201910957155A CN110727473A CN 110727473 A CN110727473 A CN 110727473A CN 201910957155 A CN201910957155 A CN 201910957155A CN 110727473 A CN110727473 A CN 110727473A
- Authority
- CN
- China
- Prior art keywords
- target
- application
- module
- resource
- application program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 50
- 230000006399 behavior Effects 0.000 claims abstract description 73
- 230000004044 response Effects 0.000 claims abstract description 24
- 238000001514 detection method Methods 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 12
- 238000012545 processing Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 10
- 230000003287 optical effect Effects 0.000 description 4
- 238000004891 communication Methods 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 238000011156 evaluation Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000000644 propagated effect Effects 0.000 description 2
- 241000282414 Homo sapiens Species 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000003190 augmentative effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000008014 freezing Effects 0.000 description 1
- 238000007710 freezing Methods 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44505—Configuring for program initiating, e.g. using registry, configuration files
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44594—Unloading
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/50—Allocation of resources, e.g. of the central processing unit [CPU]
- G06F9/5005—Allocation of resources, e.g. of the central processing unit [CPU] to service a request
- G06F9/5011—Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
- G06F9/5022—Mechanisms to release resources
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 invention discloses a resource control method, a resource control device, a resource control system, a storage medium and electronic equipment, and relates to the technical field of computers. The resource control method comprises the following steps: responding to an application program starting instruction, and detecting whether a currently started target application program is an application program in a preset application set; if the target application program is an application program in a preset application set, generating an application starting message, and determining a target resource occupation module running in the background; and sending an application starting message to the target resource occupation module so that the target resource occupation module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupation module, and stops the one or more target background behaviors. The method and the device can improve the response speed of starting and running of the application program.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a resource control method, a resource control apparatus, a resource control system, a storage medium, and an electronic device.
Background
With the development of mobile terminal technology and the increasing demand of people for daily work and life, various types of applications are installed on a mobile terminal, and even if an application is not displayed on the current interface, the application may run in the background.
The application program running in the background occupies system resources, and when the application program with a large resource demand needs to be started at present, the problems of unsmooth locking and low response speed may occur.
For example, in the case where, for example, a video application or a communication chat application is running in the background, when a user opens a game application, there may be a problem of a screen jam or an unsmooth operation.
It is to be noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure, and thus may include information that does not constitute prior art known to those of ordinary skill in the art.
Disclosure of Invention
The present disclosure is directed to a resource control method, a resource control apparatus, a resource control system, a storage medium, and an electronic device, so as to overcome, at least to some extent, a problem of a slow response speed when a new application is started due to other programs running in a background.
According to a first aspect of the present disclosure, there is provided a resource control method applied to a mobile terminal, including: responding to an application program starting instruction, and detecting whether a currently started target application program is an application program in a preset application set; if the target application program is an application program in a preset application set, generating an application starting message, and determining a target resource occupation module running in the background; and sending an application starting message to the target resource occupation module so that the target resource occupation module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupation module, and stops the one or more target background behaviors.
According to a second aspect of the present disclosure, there is provided a resource control apparatus applied to a mobile terminal, including: the application detection module is used for responding to an application program starting instruction and detecting whether a currently started target application program is an application program in a preset application set; the starting message generating module is used for generating an application starting message and determining a target resource occupying module running in a background if the target application program is an application program in a preset application set; and the starting message sending module is used for sending an application starting message to the target resource occupying module so that the target resource occupying module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupying module, and stops the one or more target background behaviors.
According to a third aspect of the present disclosure, there is provided a resource control system applied to a mobile terminal, including: the resource control device is used for responding to an application program starting instruction, detecting whether a currently started target application program is an application program in a preset application set, if the target application program is the application program in the preset application set, generating an application starting message, determining a target resource occupation module running in a background, and sending the application starting message to the target resource occupation module; and the target resource occupation module is used for responding to the application starting message, determining one or more target background behaviors executed by the target resource occupation module and stopping the one or more target background behaviors.
According to a fourth aspect of the present disclosure, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described resource control method.
According to a fifth aspect of the present disclosure, there is provided an electronic device comprising: a processor; and a memory for storing executable instructions for the processor; wherein the processor is configured to perform the above-described resource control method via execution of executable instructions.
In the technical solutions provided in some embodiments of the present disclosure, when a currently-started target application is an application in a predetermined application set, an application start message is generated, a target resource occupying module that runs in a background is determined, and the application start message is sent to the target resource occupying module, so that the target resource occupying module stops one or more target background behaviors in response to the application start message, and further releases background resources occupied by the target resource occupying module. On one hand, when the currently started target application program is judged to be the preset application program, background resources occupied by the target resource occupation module running in the background are released, so that the target application program can run smoothly, and the response speed of starting and running of the target application program is improved; on the other hand, compared with a scheme that some important services may be disabled due to resource release of the system, in the exemplary embodiment of the present disclosure, the target resource occupying module itself executes an operation of releasing the background resources occupied by the target resource occupying module, so that smooth execution of the background important services can be ensured, and the problem that some services or systems are in error is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure. It is to be understood that the drawings in the following description are merely exemplary of the disclosure, and that other drawings may be derived from those drawings by one of ordinary skill in the art without the exercise of inventive faculty. In the drawings:
FIG. 1 shows a schematic diagram of a resource control framework according to an example embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a resource control method according to an exemplary embodiment of the present disclosure;
FIG. 3 schematically illustrates an interaction diagram of the overall resource control process, as exemplified by a game scenario, according to an exemplary embodiment of the present disclosure;
FIG. 4 schematically illustrates a block diagram of a resource control apparatus according to an exemplary embodiment of the present disclosure;
FIG. 5 schematically illustrates a block diagram of a resource control apparatus according to another exemplary embodiment of the present disclosure;
FIG. 6 schematically illustrates a block diagram of a resource control apparatus according to yet another exemplary embodiment of the present disclosure;
FIG. 7 schematically illustrates a block diagram of a resource control system according to an exemplary embodiment of the present disclosure;
fig. 8 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, devices, steps, and the like. In other instances, well-known technical solutions have not been shown or described in detail to avoid obscuring aspects of the present disclosure.
Furthermore, the drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted. Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the steps. For example, some steps may be decomposed, and some steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The mobile terminal described in the exemplary embodiments of the present disclosure may include, but is not limited to, a mobile phone, a tablet computer, a smart watch, and the like, and the present disclosure does not limit the type of the mobile terminal.
When the mobile terminal starts and runs some application programs with large resource consumption, the problems of screen blocking, slow response speed, unsmooth and the like caused by insufficient background resources may exist, and the normal use and experience of a user are seriously influenced. For example, when a user runs a game program, due to insufficient background resources, problems of untimely operation response, screen jam and the like may exist.
In some schemes, when some applications with large resource consumption are run, the mobile terminal may stop the background behavior and release the resources, so that the applications can run smoothly. However, when the mobile terminal stops the background behavior, some necessary system behaviors or some important application background behaviors may not be run, and thus, the stability of the terminal system may be reduced or the system may be in error.
In view of this, the exemplary embodiments of the present disclosure provide a new resource control method, which ensures the stability of the system and the normal operation of important services while releasing background resources.
FIG. 1 shows a schematic diagram of a resource control framework of an exemplary embodiment of the present disclosure.
The resource control module 11 may be in communication connection with a resource occupation module, and the resource occupation module may include a module 13 running in the background, a module 14 running in the background, a module 15 running in the background, and the like. Specifically, each background running module may be registered with a target event listener to monitor the start and stop of a predetermined application program.
The resource control device 11 may determine whether the currently started target application is an application in the predetermined application set based on the application list stored in the database 12 in response to the application start instruction. If the target application is an application in a predetermined set of applications, an application start message may be generated and sent to each of the background-running modules.
For example, module 13 running in the background may determine one or more target background behaviors in response to the application start message, where the one or more target background behaviors may be background behaviors with higher resource consumption and lower importance. Next, the background running module 13 may stop the one or more target background behaviors. Similarly, the background running module 14 may stop one or more target background activities corresponding to the background running module 14, and the background running module 15 may stop one or more target background activities corresponding to the background running module 15.
The resource control device 11 may send an application close message to each module running in the background in response to the application close instruction. Each background-running module may resume the stopped one or more target background behaviors in response to the application shutdown message.
Fig. 2 schematically shows a flow chart of a resource control method according to an exemplary embodiment of the present disclosure. It should be understood that the method shown in fig. 2 can be performed by a resource control device disposed in the mobile terminal, which is a specially configured program execution unit according to the present disclosure. Referring to fig. 2, a resource control method of an exemplary embodiment of the present disclosure may include the steps of:
and S22, responding to an application program starting instruction, and detecting whether the currently started target application program is an application program in a preset application set.
In an exemplary embodiment of the present disclosure, the application starting instruction may be an instruction generated by the mobile terminal in response to a user opening operation for an application, where the opening operation is, for example, the user clicking an application icon. In addition, it will be readily appreciated that a jump between applications may also trigger the generation of the application launch instruction.
The predetermined set of applications may include a plurality of applications that consume large amounts of background resources. In one embodiment of the present disclosure, the applications may be of the same type, for example, the applications are all game applications. However, it is readily understood that if the exemplary methods described in this disclosure are applied to a live video scene, these applications may also be all live video applications.
In another embodiment of the present disclosure, the applications may be of different types, for example, the applications may include gaming applications, augmented reality applications, video live applications, text or image processing applications, and the like.
In case the predetermined set of applications comprises a plurality of applications, these applications may be determined by human beings. For example, on a configuration interface, a user may select an application program to execute the disclosed solution, forming a predetermined set of applications.
Furthermore, the predetermined set of applications may also include only one application program that is more resource consuming. The application may be a user-specified application. For example, if a user frequently opens the same game application that responds slowly when opened or run, the resource control method of the exemplary embodiment of the present disclosure may be applied, that is, the game application may be an application in a predetermined set of applications.
The resource control means may detect whether the currently started target application is an application of a predetermined set of applications in response to the application start instruction. In particular, the package names of the applications in the predetermined set of applications may be recorded in an application list, which may be stored in the database 12. In this case, first, the resource control device may parse the package name of the currently activated target application. Next, it may be detected whether the package name of the target application is in the application list. If in the application list, the target application is an application in a predetermined set of applications.
Some embodiments of the present disclosure also relate to a scheme of updating the application list.
In the embodiment that the application programs in the predetermined application set belong to the same predetermined type, when the mobile terminal installs a new application program, the resource control device may determine the type of the new application program through a download channel of the new application program, and if the type of the new application program is the predetermined type, the package name of the new application program may be saved to the application list. The predetermined type may be, for example, a game type, and the new application program may be acquired from an application store that downloads the new application program.
In another embodiment, when the mobile terminal installs a new application, if the new application does not belong to the predetermined application set, that is, the package name of the new application is not in the application list, a popup may be presented for the user to select whether to determine the new application as an application in the predetermined application set. Next, in response to a determination operation by the user, the package name of the new application program may be added to the application list to implement the update of the predetermined application set.
And S24, if the target application program is the application program in the preset application set, generating an application starting message and determining a target resource occupation module running in the background.
In an exemplary embodiment of the present disclosure, the application start message is a message characterizing the start of the target application program. In the case where the resource control device determines that the target application program is an application program in the predetermined application set, the resource control device may generate an application start message.
According to some embodiments of the present disclosure, the target resource occupying module may be all modules running in the background, and all of the modules occupy system resources because they provide different services.
According to other embodiments of the present disclosure, the target resource occupying module may be some modules that run in the background and occupy a larger resource. Specifically, resource occupation evaluation can be performed on all modules running in the background, and a module with a large resource occupation is screened out from all modules according to a resource occupation evaluation result and used as a target resource occupation module.
For example, a resource occupation score of each module running in the background may be calculated, where the resource occupation score may be a weighted calculation result of indexes such as CPU (Central Processing Unit) resource consumption, memory resource consumption, and network resource consumption of the module. And if the resource occupation score is larger than a score threshold value, determining the corresponding module as a target resource occupation module.
According to further embodiments of the present disclosure, first, one or more modules registered with a target event listener may be determined from all resource consuming modules running in the background, and a candidate resource occupation module set may be obtained. The monitoring events corresponding to the target event listener are to open the application programs in the predetermined application set and to close the application programs in the predetermined application set. In addition, the number of the candidate resource occupation modules in the candidate resource occupation module set is not limited by the disclosure, and may be one or more.
Next, a target resource occupancy module may be determined from the set of candidate resource occupancy modules. Specifically, a resource occupation score of the candidate resource occupation module in the candidate resource occupation module set is calculated, and the score may be a weighted calculation result of indexes of the module, such as CPU resource consumption, memory resource consumption, network resource consumption, and the like. And determining the candidate resource occupation module with the resource occupation score larger than a score threshold value as a target resource occupation module.
The resource occupancy score for a module may be calculated by:
S=A1×W1+A2×W2+A3×W3
wherein, S is the resource occupation score of the module, a1, a2, A3 respectively represent the CPU resource consumption, memory resource consumption, network resource consumption of the module, W1, W2, W3 are the corresponding weights, and W1, W2, W3 are all between 0 and 1 and the sum is 1.
S26, sending an application starting message to the target resource occupation module so that the target resource occupation module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupation module, and stops the one or more target background behaviors.
It should be understood that the number of target resource occupying modules determined in step S24 may be one or more. The following operations may be performed for each target resource occupying module.
The target resource occupation module may determine one or more target background behaviors executed by itself in response to the application start message sent by the resource control device, and stop the one or more target background behaviors.
According to some embodiments of the present disclosure, the one or more target background behaviors may be all operations performed in the background by the target resource occupying module. That is, all background behaviors of the target resource occupying module may be determined as target background behaviors. The number of target background activities may be one or more.
In this case, the target background behavior may be stopped. The term "stop" may be understood as temporarily freezing the corresponding process, and taking the target background behavior as an example of acquiring the network data, after the stop, the network data will not be acquired temporarily.
According to other embodiments of the disclosure, the target resource occupation module may determine all background behaviors thereof as candidate background behaviors, and determine occupied resources and importance levels for each candidate background behavior. If the occupied resources are greater than a resource occupancy threshold and the importance level is lower than a level threshold, the candidate background behavior may be determined as the target background behavior. The resource occupation threshold and the grade threshold can be set manually.
In one embodiment, the importance level of the candidate background behavior may be determined first, and if the importance level is greater than the importance level threshold, it is indicated that the candidate background behavior is an important behavior and cannot be stopped. In this case, it is not necessary to perform the process of judging occupation of resources.
In another embodiment, the resource occupied by the candidate background behavior may be determined first, and if the occupied resource is smaller than the resource occupancy threshold, it indicates that the resource occupied by the candidate background behavior is smaller, in which case, the candidate background behavior may not be stopped.
Taking starting the game application as an example, after the target background behavior of the target resource occupation module is stopped, the target background behavior is not executed when the game application runs, and therefore more background resources can serve the game application.
In addition, when the target application program is closed, the resource control device may generate an application close message and transmit the application close message to the target resource occupying module. The target resource occupying module may respond to the application close message to recover the one or more target background behaviors to ensure that each service of the target resource occupying module is executed normally.
The resource control method according to the exemplary embodiment of the present disclosure is described by taking, as an example, a currently-started target application as a game application and a target resource occupying module as a cloud service module.
In the case where the game application is an application in a predetermined application set, when the game application is started, the resource control device may transmit a message that the game application is started to the cloud service module. The cloud service module can respond to the starting message to determine one or more target background behaviors which are relatively high in resource consumption and relatively low in importance and correspond to the cloud service module, and the cloud service module automatically stops the one or more target background behaviors. In addition, when the game application is closed, the resource control device may send a message that the game application is closed to the cloud service module. The cloud service module may resume the one or more target background behaviors in the stopped state in response to the close message.
FIG. 3 schematically shows an interaction diagram of the overall resource control process, exemplified by a game scenario, according to an exemplary embodiment of the present disclosure.
In step S302, the resource control device may detect whether the package name of the currently started target application is in the game application list; in step S304, if the package name of the target application program is in the game application list, a game start message is generated; in step S306, the resource control device may send a game start message to the target resource occupying module; in step S308, the target resource occupation module determines background behaviors that need to be stopped in response to the game start message, and performs a stopping operation of the background behaviors.
In step S310, if the game application is closed, the resource control device generates a game close message; in step S312, the resource control device sends the game close message to the target resource occupying module; in step S314, the target resource occupation module resumes the stopped background behavior in response to the game close message.
In summary, with the resource control method according to the exemplary embodiment of the present disclosure, on one hand, when the currently started target application is determined to be the predetermined application, the background resource occupied by the target resource occupation module running in the background is released, so that the target application can run smoothly, and the response speed of starting and running the target application is increased; on the other hand, compared with a scheme that some important services may be disabled due to resource release of the system, in the exemplary embodiment of the present disclosure, the target resource occupying module itself executes an operation of releasing the background resources occupied by the target resource occupying module, so that smooth execution of the background important services can be ensured, and the problem that some services or systems are in error is avoided.
It should be noted that although the various steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that these steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Further, the present exemplary embodiment also provides a resource control apparatus.
Fig. 4 schematically shows a block diagram of a resource control apparatus according to an exemplary embodiment of the present disclosure. Referring to fig. 4, the resource control device 4 according to an exemplary embodiment of the present disclosure may include an application detection module 41, a start message generation module 43, and a start message transmission module 45.
Specifically, the application detecting module 41 may be configured to respond to an application program starting instruction, and detect whether a currently started target application program is an application program in a predetermined application set; the start message generating module 43 may be configured to generate an application start message if the target application is an application in the predetermined application set, and determine a target resource occupation module running in the background; the start message sending module 45 may be configured to send an application start message to the target resource occupying module, so that the target resource occupying module responds to the application start message, determines one or more target background behaviors executed by the target resource occupying module, and stops the one or more target background behaviors.
On the one hand, when the currently started target application is judged to be the preset application, the resource control device releases background resources occupied by the target resource occupation module running in the background so that the target application can run smoothly, and the response speed of starting and running of the target application is improved; on the other hand, compared with a scheme that some important services may be disabled due to resource release of the system, in the exemplary embodiment of the present disclosure, the target resource occupying module itself executes an operation of releasing the background resources occupied by the target resource occupying module, so that smooth execution of the background important services can be ensured, and the problem that some services or systems are in error is avoided.
According to an exemplary embodiment of the present disclosure, the application detection module 41 may be configured to perform: analyzing the package name of the target application program; detecting whether the package name of the target application program is in an application list, wherein the application list comprises the package name of the application program in a preset application set; and if the package name of the target application program is in the application list, the target application program is an application program in the preset application set.
According to an exemplary embodiment of the present disclosure, referring to fig. 5, the resource control device 5 may further include an application list update module 51 compared to the resource control device 4.
In particular, the application list updating module 51 may be configured to perform: when a new application program is installed on the mobile terminal, determining the type of the new application program through a download channel; and if the type of the new application program is a preset type, saving the package name of the new application program to an application list.
According to an exemplary embodiment of the present disclosure, the process of the start message generation module 43 determining the target resource occupying module running in the background may be configured to perform: determining one or more modules registered with a target event listener from all resource consuming modules running in the background to obtain a candidate resource occupation module set; and determining a target resource occupation module from the candidate resource occupation module set.
According to an exemplary embodiment of the present disclosure, the process of the initiation message generation module 43 determining the target resource occupancy module from the set of candidate resource occupancy modules may be configured to perform: calculating a resource occupation score of a candidate resource occupation module in the candidate resource occupation module set; and determining the candidate resource occupation module with the resource occupation score larger than a score threshold value as a target resource occupation module.
According to an exemplary embodiment of the present disclosure, referring to fig. 6, the resource control device 6 may further include an application shutdown processing module 61, compared to the resource control device 4.
Specifically, the application shutdown processing module 61 may be configured to perform: when the target application program is closed, generating an application closing message; and sending the application closing message to the target resource occupation module so that the target resource occupation module recovers the one or more target background behaviors.
Since each functional module of the resource control device in the embodiment of the present invention is the same as that in the embodiment of the present invention, it is not described herein again.
Further, the present exemplary embodiment also provides a resource control system.
Fig. 7 schematically illustrates a block diagram of a resource control system of an exemplary embodiment of the present disclosure. Referring to fig. 7, the resource control device 7 according to an exemplary embodiment of the present disclosure may include a resource control device 71 and a target resource occupying module 72.
Specifically, the resource control device 71 may be configured to respond to an application starting instruction, detect whether a currently started target application is an application in a predetermined application set, generate an application starting message if the target application is the application in the predetermined application set, determine a target resource occupation module running in a background, and send the application starting message to the target resource occupation module; target resource engagement module 72 may be configured to determine one or more target background behaviors executed by the target resource engagement module in response to the application start message, and to cease the one or more target background behaviors.
On the one hand, when the currently started target application is judged to be the preset application, the resource control system releases background resources occupied by the target resource occupation module running in the background so that the target application can run smoothly, and the response speed of starting and running of the target application is improved; on the other hand, compared with a scheme that some important services may be disabled due to resource release of the system, in the exemplary embodiment of the present disclosure, the target resource occupying module itself executes an operation of releasing the background resources occupied by the target resource occupying module, so that smooth execution of the background important services can be ensured, and the problem that some services or systems are in error is avoided.
According to an example embodiment of the present disclosure, target resource occupancy module 72 may be further configured to perform: determining resources occupied by a candidate background behavior of the target resource occupation module and the importance level of the candidate background behavior; and if the resources occupied by the candidate background behaviors are larger than a resource occupation threshold value and the importance level of the candidate background behaviors is lower than a level threshold value, determining the candidate background behaviors as the target background behaviors.
According to an exemplary embodiment of the present disclosure, the resource control device 71 may be further configured to perform: when the current target application program is closed, generating an application closing message, and sending the application closing message to the target resource occupation module 72; the target resource occupancy module 72 is further configured to perform: restoring the one or more target background behaviors in response to the application shutdown message.
Since the resource control device 71 and the target resource occupying module 72 in the resource control system 7 according to the embodiment of the present invention are the same as those in the above-described method and embodiment of the present invention, they are not described herein again.
In an exemplary embodiment of the present disclosure, there is also provided a computer-readable storage medium having stored thereon a program product capable of implementing the above-described method of the present specification. In some possible embodiments, aspects of the invention may also be implemented in the form of a program product comprising program code means for causing a terminal device to carry out the steps according to various exemplary embodiments of the invention described in the above section "exemplary methods" of the present description, when said program product is run on the terminal device.
The program product for implementing the above method according to an embodiment of the present invention may employ a portable compact disc read only memory (CD-ROM) and include program codes, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical disk, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
In an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above method is also provided.
As will be appreciated by one skilled in the art, aspects of the present invention may be embodied as a system, method or program product. Thus, various aspects of the invention may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
An electronic device 800 according to this embodiment of the invention is described below with reference to fig. 8. The electronic device 800 shown in fig. 8 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present invention.
As shown in fig. 8, electronic device 800 is in the form of a general purpose computing device. The components of the electronic device 800 may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, a bus 830 connecting different system components (including the memory unit 820 and the processing unit 810), and a display unit 840.
Wherein the storage unit stores program code that is executable by the processing unit 810 to cause the processing unit 810 to perform steps according to various exemplary embodiments of the present invention as described in the above section "exemplary methods" of the present specification. For example, the processing unit 810 may perform steps S22 through S26 as shown in fig. 2.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
The electronic device 800 may also communicate with one or more external devices 900 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the electronic device 800, and/or with any devices (e.g., router, modem, etc.) that enable the electronic device 800 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the electronic device 800 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 860. As shown, the network adapter 860 communicates with the other modules of the electronic device 800 via the bus 830. It should be appreciated that although not shown, other hardware and/or software modules may be used in conjunction with the electronic device 800, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Furthermore, the above-described figures are merely schematic illustrations of processes involved in methods according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is to be limited only by the terms of the appended claims.
Claims (12)
1. A resource control method is applied to a mobile terminal, and is characterized by comprising the following steps:
responding to an application program starting instruction, and detecting whether a currently started target application program is an application program in a preset application set;
if the target application program is the application program in the preset application set, generating an application starting message and determining a target resource occupation module running in the background;
and sending the application starting message to the target resource occupation module so that the target resource occupation module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupation module, and stops the one or more target background behaviors.
2. The resource control method of claim 1, wherein detecting whether the currently launched target application is an application in a predetermined set of applications comprises:
analyzing the package name of the target application program;
detecting whether the package name of the target application program is in an application list, wherein the application list comprises the package names of the application programs in the preset application set;
wherein if the package name of the target application program is in the application list, the target application program is an application program in the predetermined application set.
3. The resource control method according to claim 2, wherein the resource control method further comprises:
when a new application program is installed on the mobile terminal, determining the type of the new application program through a downloading channel;
and if the type of the new application program is a preset type, saving the package name of the new application program to the application list.
4. The resource control method of claim 1, wherein determining the target resource occupancy module running in the background comprises:
determining one or more modules registered with a target event listener from all resource consuming modules running in the background to obtain a candidate resource occupation module set;
determining the target resource occupancy module from the set of candidate resource occupancy modules.
5. The method of claim 4, wherein determining the target resource occupancy module from the set of candidate resource occupancy modules comprises:
calculating the resource occupation scores of the candidate resource occupation modules in the candidate resource occupation module set;
and determining the candidate resource occupation module with the resource occupation score larger than a score threshold value as the target resource occupation module.
6. The resource control method according to any one of claims 1 to 5, characterized in that the resource control method further comprises:
when the target application program is closed, generating an application closing message;
and sending the application closing message to the target resource occupation module so that the target resource occupation module recovers the one or more target background behaviors.
7. A resource control device applied to a mobile terminal is characterized by comprising:
the application detection module is used for responding to an application program starting instruction and detecting whether a currently started target application program is an application program in a preset application set;
a starting message generating module, configured to generate an application starting message if the target application is an application in the predetermined application set, and determine a target resource occupation module running in a background;
and the starting message sending module is used for sending the application starting message to the target resource occupying module so that the target resource occupying module responds to the application starting message, determines one or more target background behaviors executed by the target resource occupying module and stops the one or more target background behaviors.
8. A resource control system applied to a mobile terminal is characterized by comprising:
the resource control device is used for responding to an application program starting instruction, detecting whether a currently started target application program is an application program in a preset application set, if the target application program is the application program in the preset application set, generating an application starting message, determining a target resource occupation module running in a background, and sending the application starting message to the target resource occupation module;
and the target resource occupation module is used for responding to the application starting message, determining one or more target background behaviors executed by the target resource occupation module and stopping the one or more target background behaviors.
9. The resource control system of claim 8, wherein the target resource occupancy module is further configured to perform: determining resources occupied by a candidate background behavior of the target resource occupation module and the importance level of the candidate background behavior; and if the resources occupied by the candidate background behaviors are larger than a resource occupation threshold value and the importance level of the candidate background behaviors is lower than a level threshold value, determining the candidate background behaviors as the target background behaviors.
10. The resource control system according to claim 8 or 9, wherein the resource control apparatus is further configured to perform: when the current target application program is closed, generating an application closing message, and sending the application closing message to the target resource occupation module;
the target resource occupancy module is further configured to perform: restoring the one or more target background behaviors in response to the application shutdown message.
11. A storage medium having stored thereon a computer program, characterized in that the computer program, when being executed by a processor, implements the resource control method of any one of claims 1 to 6.
12. An electronic device, comprising:
a processor; and
a memory for storing executable instructions of the processor;
wherein the processor is configured to perform the resource control method of any one of claims 1 to 6 via execution of the executable instructions.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910957155.7A CN110727473B (en) | 2019-10-10 | 2019-10-10 | Resource control method, device, system, storage medium and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910957155.7A CN110727473B (en) | 2019-10-10 | 2019-10-10 | Resource control method, device, system, storage medium and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110727473A true CN110727473A (en) | 2020-01-24 |
CN110727473B CN110727473B (en) | 2023-11-03 |
Family
ID=69219846
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910957155.7A Active CN110727473B (en) | 2019-10-10 | 2019-10-10 | Resource control method, device, system, storage medium and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110727473B (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112148448A (en) * | 2020-09-22 | 2020-12-29 | 北京字节跳动网络技术有限公司 | Resource allocation method, device, equipment and computer readable medium |
CN113434149A (en) * | 2021-07-07 | 2021-09-24 | 腾讯科技(深圳)有限公司 | Application program generating and loading method, device and medium |
CN113676881A (en) * | 2021-08-06 | 2021-11-19 | Oppo广东移动通信有限公司 | Device control method, device, electronic device and storage medium |
CN113868199A (en) * | 2021-10-10 | 2021-12-31 | 普华云创科技(北京)有限公司 | Method, storage medium and system for protecting exclusive system screen application program |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080005190A1 (en) * | 2006-06-28 | 2008-01-03 | Nokia Corporation | System, Method, Apparatus and Computer Program Product for Providing Resource Reclamation in a Virtual Machine |
CN107734616A (en) * | 2017-10-31 | 2018-02-23 | 广东欧珀移动通信有限公司 | Application closing method, device, storage medium and electronic device |
WO2019034104A1 (en) * | 2017-08-16 | 2019-02-21 | 捷开通讯(深圳)有限公司 | Method of automatically releasing resource occupied by background process of terminal, storage medium and terminal |
CN109857555A (en) * | 2019-01-15 | 2019-06-07 | Oppo广东移动通信有限公司 | Method for recovering internal storage and device, storage medium and electronic equipment |
CN109857544A (en) * | 2018-12-27 | 2019-06-07 | 努比亚技术有限公司 | Resource reclaim control method, terminal and computer readable storage medium |
CN109992370A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Application program processing method and device, electronic equipment and computer readable storage medium |
CN109992438A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Information processing method, apparatus, computer device, and computer-readable storage medium |
CN110018904A (en) * | 2018-01-10 | 2019-07-16 | 广东欧珀移动通信有限公司 | Information processing method, device, computer equipment and computer readable storage medium |
CN110045809A (en) * | 2018-01-12 | 2019-07-23 | 广东欧珀移动通信有限公司 | Information processing method, information processing device, computer equipment and computer readable storage medium |
-
2019
- 2019-10-10 CN CN201910957155.7A patent/CN110727473B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20080005190A1 (en) * | 2006-06-28 | 2008-01-03 | Nokia Corporation | System, Method, Apparatus and Computer Program Product for Providing Resource Reclamation in a Virtual Machine |
WO2019034104A1 (en) * | 2017-08-16 | 2019-02-21 | 捷开通讯(深圳)有限公司 | Method of automatically releasing resource occupied by background process of terminal, storage medium and terminal |
CN107734616A (en) * | 2017-10-31 | 2018-02-23 | 广东欧珀移动通信有限公司 | Application closing method, device, storage medium and electronic device |
CN109992370A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Application program processing method and device, electronic equipment and computer readable storage medium |
CN109992438A (en) * | 2017-12-29 | 2019-07-09 | 广东欧珀移动通信有限公司 | Information processing method, apparatus, computer device, and computer-readable storage medium |
CN110018904A (en) * | 2018-01-10 | 2019-07-16 | 广东欧珀移动通信有限公司 | Information processing method, device, computer equipment and computer readable storage medium |
CN110045809A (en) * | 2018-01-12 | 2019-07-23 | 广东欧珀移动通信有限公司 | Information processing method, information processing device, computer equipment and computer readable storage medium |
CN109857544A (en) * | 2018-12-27 | 2019-06-07 | 努比亚技术有限公司 | Resource reclaim control method, terminal and computer readable storage medium |
CN109857555A (en) * | 2019-01-15 | 2019-06-07 | Oppo广东移动通信有限公司 | Method for recovering internal storage and device, storage medium and electronic equipment |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112148448A (en) * | 2020-09-22 | 2020-12-29 | 北京字节跳动网络技术有限公司 | Resource allocation method, device, equipment and computer readable medium |
CN112148448B (en) * | 2020-09-22 | 2024-01-19 | 抖音视界有限公司 | Resource allocation method, apparatus, device and computer readable medium |
CN113434149A (en) * | 2021-07-07 | 2021-09-24 | 腾讯科技(深圳)有限公司 | Application program generating and loading method, device and medium |
CN113434149B (en) * | 2021-07-07 | 2023-09-08 | 腾讯科技(深圳)有限公司 | Application program generating and loading method, device and medium |
CN113676881A (en) * | 2021-08-06 | 2021-11-19 | Oppo广东移动通信有限公司 | Device control method, device, electronic device and storage medium |
CN113676881B (en) * | 2021-08-06 | 2024-05-07 | Oppo广东移动通信有限公司 | Equipment control method, device, electronic equipment and storage medium |
CN113868199A (en) * | 2021-10-10 | 2021-12-31 | 普华云创科技(北京)有限公司 | Method, storage medium and system for protecting exclusive system screen application program |
Also Published As
Publication number | Publication date |
---|---|
CN110727473B (en) | 2023-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110727473B (en) | Resource control method, device, system, storage medium and electronic equipment | |
CN109240576B (en) | Image processing method and device in game, electronic device and storage medium | |
CN110351572B (en) | Method, device and equipment for updating live broadcast room information and storage medium | |
US9760413B2 (en) | Power efficient brokered communication supporting notification blocking | |
CN109726076B (en) | Applet life cycle management method and system | |
CN111190673B (en) | Page display method and device based on operation monitoring and electronic equipment | |
CN112130937A (en) | Page display method and device, storage medium, and electronic device | |
US11768672B1 (en) | Systems and methods for user-controlled deployment of software updates | |
CN111330280B (en) | Method and device for processing data in game, storage medium and electronic equipment | |
CN110502345A (en) | A kind of overload protection method, device, computer equipment and storage medium | |
CN107045475B (en) | Test method and device | |
CN112947813B (en) | Resident display method, resident display device, resident display medium and electronic equipment for controlling floating window | |
CN109656781A (en) | A kind of blog management method, system, medium and electronic equipment | |
CN109343955B (en) | Recommendation service calling method, medium, device and computing equipment | |
CN108170605A (en) | Submission method, client and the computer readable storage medium of bug information | |
CN112256354B (en) | Application starting method and device, storage medium and electronic equipment | |
CN111741046B (en) | Data reporting method, data acquisition method, device, equipment and medium | |
CN111124627B (en) | Method and device for determining call initiator of application program, terminal and storage medium | |
US20230259377A1 (en) | User input predictive action system and method for user interfaces | |
CN111680240B (en) | Page display method and device and electronic equipment | |
KR20130123581A (en) | Losses due to failure prediction method and server | |
US10698749B1 (en) | System and a method for automated resolution of configuration item issues | |
CN114827157A (en) | Cluster task processing method, device and system, electronic equipment and readable medium | |
CN113535029A (en) | Operation recording method, terminal, computer device and computer-readable storage medium | |
CN113821205A (en) | Method and device for controlling small program page parameters, medium and electronic equipment |
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 |