CN107741880B - Processor control method and related product - Google Patents

Processor control method and related product Download PDF

Info

Publication number
CN107741880B
CN107741880B CN201711032475.9A CN201711032475A CN107741880B CN 107741880 B CN107741880 B CN 107741880B CN 201711032475 A CN201711032475 A CN 201711032475A CN 107741880 B CN107741880 B CN 107741880B
Authority
CN
China
Prior art keywords
processor
applications
processor resource
resource
application
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711032475.9A
Other languages
Chinese (zh)
Other versions
CN107741880A (en
Inventor
林志泳
刘美
莫瑞宏
张俊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201711032475.9A priority Critical patent/CN107741880B/en
Publication of CN107741880A publication Critical patent/CN107741880A/en
Application granted granted Critical
Publication of CN107741880B publication Critical patent/CN107741880B/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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load

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)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the application discloses a processor control method and a related product, wherein the method comprises the following steps: acquiring a first processor resource required by a current frame and a first idle processor resource of a processor; when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background; releasing the second processor resource to obtain a second idle processor resource; and carrying out resource allocation on the current frame according to the second idle processor resource. By the method and the device, the utilization rate of the processor and the fluency of the picture can be improved.

Description

Processor control method and related product
Technical Field
The application relates to the technical field of mobile terminals, and mainly relates to a processor control method and a related product.
Background
With the continuous development of mobile terminal technology, mobile terminals such as mobile phones, computers, tablets and the like are more and more popularized, and a game scene is an important user scene in the mobile terminals. If the user does not have sufficient processor resources while using the game, the user will experience a bad experience such as a stuck. Therefore, how to ensure the game to smoothly progress under the existing conditions is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The embodiment of the application provides a processor control method and a related product, which can improve the utilization rate of a processor and the fluency of pictures.
In a first aspect, an embodiment of the present application provides a processor control method, including:
acquiring a first processor resource required by a current frame and a first idle processor resource of a processor;
when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
releasing the second processor resource to obtain a second idle processor resource;
and carrying out resource allocation on the current frame according to the second idle processor resource.
In a second aspect, an embodiment of the present application provides a processor control apparatus, including:
the device comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring a first processor resource required by a current frame and a first idle processor resource of a processor; when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
a releasing unit, configured to release the second processor resource to obtain a second idle processor resource;
and the configuration unit is used for carrying out resource configuration on the current frame according to the second idle processor resource.
In a third aspect, an embodiment of the present application provides a mobile terminal, including a processor, configured to obtain a first processor resource required by a current frame and a first idle processor resource of the processor; when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background; releasing the second processor resource to obtain a second idle processor resource; and carrying out resource allocation on the current frame according to the second idle processor resource.
In a fourth aspect, an embodiment of the present application provides another processor control method, which is applied to a mobile terminal including a processor, where:
the processor acquires a first processor resource required by a current frame and a first idle processor resource of the processor;
the processor acquires a second processor resource occupied by the background when the first idle processor resource is smaller than the first processor resource;
the processor releases the second processor resource to obtain a second idle processor resource;
and the processor performs resource allocation on the current frame according to the second idle processor resource.
In a fifth aspect, an embodiment of the present application provides another mobile terminal, including a processor, a memory, a communication interface, and one or more programs, where the one or more programs are stored in the memory and configured to be executed by the processor, and the program includes instructions for performing the following steps:
acquiring a first processor resource required by a current frame and a first idle processor resource of a processor;
when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
releasing the second processor resource to obtain a second idle processor resource;
and carrying out resource allocation on the current frame according to the second idle processor resource.
In a sixth aspect, the present application provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, where the computer program makes a computer perform some or all of the steps as described in the first aspect of the present application.
In a seventh aspect, this application embodiment provides a computer program product, where the computer program product comprises a non-transitory computer-readable storage medium storing a computer program, the computer program being operable to cause a computer to perform some or all of the steps as described in the first aspect of this application embodiment. The computer program product may be a software installation package.
The embodiment of the application has the following beneficial effects:
after the processor control method and the related product are adopted, when the first idle processor resource of the processor is smaller than the first processor resource required by the current frame, the second processor resource occupied by the background is obtained, the second processor resource is released to obtain the second idle processor resource, and the resource allocation is carried out on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described 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.
Wherein:
fig. 1 is a schematic flowchart of a processor control method according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a processor control device according to an embodiment of the present disclosure;
fig. 2A is a schematic structural diagram of a releasing unit according to an embodiment of the present disclosure;
fig. 2B is a schematic structural diagram of a determining module according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a mobile terminal according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another processor control method according to an embodiment of the present disclosure;
fig. 5 is a schematic structural diagram of another mobile terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions of the present application better understood, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," and the like in the description and claims of the present application and in the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the terms "include" and "have," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus.
Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment can be included in at least one embodiment of the application. The appearances of the phrase in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutually exclusive of other embodiments. It is explicitly and implicitly understood by one skilled in the art that the embodiments described herein can be combined with other embodiments.
The Mobile terminal according to the embodiment of the present application may include various handheld devices, vehicle-mounted devices, wearable devices, computing devices or other processing devices connected to a wireless modem, and various forms of User Equipment (UE), Mobile Stations (MS), terminal devices (terminal device), and the like. For convenience of description, the above-mentioned devices are collectively referred to as a mobile terminal. The following describes embodiments of the present application in detail.
The processor according to the embodiment of the present disclosure may include a Central Processing Unit (CPU) or a Graphics Processing Unit (GPU), and the corresponding processor resources are CPU resources and GPU resources.
The embodiment of the application provides a processor control method and a related product, which can improve the utilization rate of a processor and the fluency of pictures. Embodiments of the present application will be described below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a processor control method according to an embodiment of the present application, where as shown in fig. 1, the processor control method includes:
101: a first processor resource required by a current frame and a first idle processor resource of a processor are acquired.
The realization principle of the game picture on the mobile terminal is the same as that of a movie, the picture is refreshed by using a fixed frame rate in unit time, the picture is rendered once every time the picture is refreshed, the processor resources required by each frame are different, and the first processor resource is the processor resource corresponding to the current frame. The first idle processor resource is a resource that the processor is unoccupied by any application at the current time.
Optionally, the acquiring the first processor resource required by the current frame includes: judging whether the current frame receives a picture rendering request; and if so, acquiring the first processor resource corresponding to the picture rendering request.
The main functions of a game can be divided into logic processing and screen rendering, where the logic processing refers to processing that has no direct relation with screen rendering, such as receiving and sending network message packets, capturing and processing mouse events, and the like, the logic processing is only data operation in a memory, and occupies a small amount of processor resources, and the screen rendering occupies a large amount of processor resources.
Separating the frame rates of logic processing and picture rendering, and acquiring a first processor resource corresponding to a picture rendering request when the current frame receives the picture rendering request; otherwise, the originally configured processor resources are used, so that the utilization rate of the processor can be effectively reduced, and the power consumption of the processor and the mobile terminal is saved.
102: and when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by the background.
In the embodiment of the application, when the first idle processor resource is smaller than the first processor resource, the second processor resource occupied by the background is acquired. And if the first idle processor resource is greater than or equal to the first processor resource, directly performing resource allocation on the current frame according to the first idle processor resource.
The resource allocation of the current frame according to the first idle processor resource is not limited, and any first processor resource can be selected from the first idle processor resource and allocated to the current frame; the first idle processor resource can also be classified, any first processor resource is selected from the idle processor resources of the game to be allocated to the current frame, and when the idle processor resource of the game is smaller than the first processor resource, the first processor resource is selected from the idle processor resource with lower priority and the idle processor resource of the game to be allocated to the current frame.
103: and releasing the second processor resource to obtain a second idle processor resource.
In this embodiment of the present application, the specific method for releasing the resource of the second processor resource is not limited, and the resource may be released according to the priority of the background application, that is, the application with a lower priority is released first until the second idle processor resource is greater than the first processor resource; processor resources of each application in the background application can also be released, namely, each application releases the processor resources with the same size or releases the resources according to the size of the priority; and resource release can be carried out in time intervals, namely, the background application runs in a specified time interval, and is closed at other times, namely, processor resources are not occupied, and the like.
When the background operation includes K applications, the releasing operation is performed on the second processor resource to obtain a second idle processor resource, including: acquiring applications of which occupied processor resources are larger than a first threshold value in the K applications to obtain N applications; acquiring the priority of each application in the N applications to obtain N priorities; determining processor resources to be released corresponding to the N applications according to the N priorities; and releasing the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
Wherein K is an integer greater than 1; n is a positive integer less than or equal to K; the first threshold may be a minimum processor resource occupation preset by a user, a minimum processor resource required by the application when the application is in a background, or a minimum temperature value at which a temperature of a specified hardware module is tested in advance to affect the operating conditions of the specified hardware module, the processor, or other modules in the mobile terminal.
That is to say, N applications whose occupied processor resources are greater than the first threshold are selected from the K applications running in the background, and the processor resources of the N applications are released. And the processor resources of the applications except the N applications in the K applications are less than or equal to the first threshold, if all the processor resources are released, the second idle processor resources are not greatly influenced, namely, the effectiveness of resource release is improved, and the normal operation of the applications except the N applications in the K applications is ensured.
For example, assume that K applications running in the background are an instant chat application, a web shopping application, a reading application, and a financing application. Wherein, the processor resource (the average percentage of the processor used by the process in the designated time period) occupied by the instant chat application is 3.04, the processor resource occupied by the network shopping application is 1.58, the processor resource occupied by the reading application is 1.25, and the processor resource occupied by the financing application is 0.42. If the first threshold is 0.5, the N applications are an instant chat application, an online shopping application and a reading application, namely the priorities of the instant chat application, the online shopping application and the reading application are obtained, and the processor resources are released according to the priorities of the applications.
Optionally, when the priority includes multiple dimensions, the obtaining the priority of each application of the N applications, and obtaining multiple priorities includes: obtaining an evaluation value corresponding to each dimension in the plurality of dimensions and the target application to obtain a plurality of evaluation values; and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
The target application is any one of K applications, namely the acquisition method of the priority of each application in the K applications is consistent with the acquisition method of the priority of the target application; the multiple dimensions of the priority can include the frequency of the user using the application, the importance of instant messages, the do-not-disturb mode, occupied memory resources, network resources, processor resources, and the like; each dimension in the multiple dimensions corresponds to a preset weight, and the preset weight can be determined according to the game application or the relevance of the application. By carrying out weighted calculation on the evaluation value and the preset weight of each dimension in the multiple dimensions, the priority corresponding to the application can be obtained, and the accuracy of the priority is improved, so that the accuracy of releasing the processor resources according to the priority is improved.
For example, assume that the N applications are an instant chat application, a web shopping application, and a reading application; the priority comprises the frequency of the application used by the user, the importance of the instant message and the occupied processor resource, and the preset weights corresponding to the frequency of the application used by the user, the importance of the instant message and the occupied processor resource are respectively as follows: 0.2, 0.3, 0.5. When the evaluation value corresponding to each dimension of the three dimensions in the instant chat application is: 60. 50, 80, in the online shopping application, the evaluation value corresponding to each dimension of the three dimensions is as follows: 60. 60 and 80, in the reading application, the evaluation value corresponding to each dimension of the three dimensions is as follows: 50. 50 and 70, the numerical values corresponding to the priorities of the instant chat application, the online shopping application and the reading application are respectively as follows: 67. 70 and 60.
Optionally, the determining, according to the N priorities, processor resources to be released corresponding to the N applications includes: acquiring applications with the priority less than or equal to a second threshold value in the N applications to obtain a plurality of applications; determining processor resources to be released of each application in the plurality of applications as processor resources occupied by the application; acquiring L applications with the priority greater than the second threshold value in the N applications; obtaining a difference between the first idle processor resource and the first processor resource to obtain a third processor resource; and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
The second threshold may be a priority corresponding to an application in the do-not-disturb mode set by the user, or may also be a priority corresponding to a usage rate of an application included in the mobile terminal being lower than a certain threshold (e.g., 30%); l is a positive integer less than or equal to N, and the priority of each application in the L applications is greater than a second threshold; the third processor resource is a difference between the first idle processor resource and the first processor resource.
And for the application with the priority smaller than the second threshold value in the N applications, limiting the resource occupancy rate by adopting a mode of directly closing the application, namely the processor resource to be released of the application is the processor resource occupied by the application. And the remaining processor resources to be released corresponding to the L applications with the priority greater than or equal to the second threshold are determined according to the priority. By adopting different limiting modes for the applications according to the priority, the practicability of the mobile terminal can be improved, and the missing of messages caused by closing background applications or certain functions in the applications can be avoided.
When the L applications include a plurality of functions, the priority of each function in the plurality of functions is obtained to obtain a plurality of priorities; determining a plurality of functions to be shut down according to the plurality of priorities and the third processor resource; and closing the plurality of functions to be closed.
That is to say, by comprehensively considering the priorities of the functions included in the L applications, the function to be closed is determined according to the priorities, the entire application is not directly closed, and the same function in all the applications is not closed, that is, the function is closed according to the use condition of the function in the actual application, so that the use rate of the processor is reduced, the heat generation of the designated hardware module is reduced, and the performance of the processor in the game scene is improved.
The function to be closed can be determined by the priority, the processor resource occupied by the function and the third processor resource, or the function corresponding to the minimum priority can be closed in sequence, and the size of the second idle processor resource is acquired until the function is not closed again when the second idle processor resource is larger than the first processor resource.
For example, assume that the values corresponding to the priorities of the N applications, i.e., the instant chat application, the online shopping application, and the reading application, are respectively: 67. 70, 60, if the second threshold is 60, the processor resource to be released of the reading application is the processor resource occupied by the reading application. If the instant chat application comprises a chat information receiving (sending) function, a pushing function and an associated mailbox function; the online shopping application comprises a search function, a push function and a payment function. Acquiring the priority of functions in the instant chat application and the online shopping application, and sequentially comprising the following steps from small to big: and closing the payment function of the online shopping application, the search function of the online shopping application, the push function of the instant chat application, the push function of the online shopping application, the associated mailbox function of the instant chat application and the chat information receiving (sending) function of the instant chat application, wherein the second idle processor resource is larger than the first processor resource, and the release of the processor resources of the instant chat application and the online shopping application is stopped.
Optionally, when the game application is finished, the closing function is opened, so that the situation that the user cannot use the function is avoided, and the practicability and flexibility of the mobile terminal are improved.
104: and carrying out resource allocation on the current frame according to the second idle processor resource.
It can be understood that, when the first idle processor resource of the processor is smaller than the first processor resource required by the current frame, the second processor resource occupied by the background is acquired, the second processor resource is released to obtain the second idle processor resource, and the resource allocation is performed on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Referring to fig. 2, in accordance with the embodiment shown in fig. 1, fig. 2 is a processor control device according to an embodiment of the present application, including:
an obtaining unit 201, configured to obtain a first processor resource required by a current frame and a first idle processor resource of a processor; and when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by the background.
A releasing unit 202, configured to release the second processor resource to obtain a second idle processor resource.
A configuring unit 203, configured to perform resource configuration on the current frame according to the second idle processor resource.
In one possible example, the background run includes K applications, where K is an integer greater than 1, and as shown in fig. 2A, the releasing unit 202 includes:
a first obtaining module 2021, configured to obtain an application, of which an occupied processor resource is greater than a first threshold, from the K applications, to obtain N applications, where N is a positive integer less than or equal to K;
a second obtaining module 2022, configured to obtain a priority of each application of the N applications, to obtain N priorities;
a determining module 2023, configured to determine, according to the N priorities, to-be-released processor resources corresponding to the N applications;
a releasing module 2024, configured to release the processor resource to be released corresponding to each application of the N applications, so as to obtain the second idle processor resource.
In a possible example, the priority includes multiple dimensions, and the second obtaining module 2022 is specifically configured to obtain an evaluation value corresponding to a target application in each of the multiple dimensions, to obtain multiple evaluation values, where the target application is any application of the K applications; and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
In one possible example, as shown in fig. 2B, the determining module 2023 includes:
a first obtaining subunit 20231, configured to obtain an application, of the N applications, of which the priority is smaller than or equal to a second threshold, to obtain multiple applications; acquiring L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N;
a second obtaining subunit 20232, configured to obtain a difference between the first idle processor resource and the first processor resource, to obtain a third processor resource;
a determining subunit 20233, configured to determine a processor resource to be released of each of the plurality of applications as a processor resource occupied by the application; and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
In one possible example, the apparatus 200 further comprises:
a determining unit 204, configured to determine whether the current frame receives a screen rendering request; when the determining unit determines that the first processor resource corresponds to the screen rendering request, the obtaining unit 201 obtains the first processor resource corresponding to the screen rendering request.
It can be seen that, in the embodiment of the present application, when a first idle processor resource of a processor is smaller than a first processor resource required by a current frame, a second processor resource occupied by a background is obtained, a release operation is performed on the second processor resource to obtain a second idle processor resource, and a resource configuration is performed on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Referring to fig. 3, fig. 3 is a schematic structural diagram of a mobile terminal 300 according to an embodiment of the present disclosure. The mobile terminal 300 includes: a processor 310 and a memory 320, the processor 310 being coupled to the memory 320 by a bus 330. Based on the mobile terminal 300 described in fig. 3, the following operations may be performed:
in this embodiment, the processor 310 is configured to obtain a first processor resource required by the current frame and a first idle processor resource of the processor; when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background; releasing the second processor resource to obtain a second idle processor resource; and carrying out resource allocation on the current frame according to the second idle processor resource.
In one possible example, the background run includes K applications, the K being an integer greater than 1; the memory 320 is used for storing a first threshold value. In the context of the processor 310, the processor 310 is specifically configured for
In one possible example, the background run includes K applications, the K being an integer greater than 1; the memory 320 is used for storing a first threshold value. In the aspect that the processor 310 releases the second processor resource to obtain a second idle processor resource, the processor 310 is specifically configured to obtain an application in which the occupied processor resource of the K applications is greater than the first threshold, so as to obtain N applications, where N is a positive integer less than or equal to K; acquiring the priority of each application in the N applications to obtain N priorities; determining processor resources to be released corresponding to the N applications according to the N priorities; and releasing the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
In one possible example, the priority comprises a plurality of dimensions; the memory 320 is configured to store a preset weight corresponding to each of the plurality of dimensions. In the aspect that the processor 310 obtains the priority of each application of the N applications to obtain multiple priorities, the processor 310 is specifically configured to obtain an evaluation value corresponding to a target application of each dimension of the multiple dimensions to obtain multiple evaluation values, and the target application is any application of the K applications; and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
In one possible example, the memory 320 is used to store a second threshold. In the aspect that the processor 310 determines processor resources to be released corresponding to the N applications according to the N priorities, the processor 310 is specifically configured to obtain applications with priorities less than or equal to the second threshold value among the N applications, so as to obtain multiple applications; determining processor resources to be released of each application in the plurality of applications as processor resources occupied by the application; acquiring L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N; obtaining a difference between the first idle processor resource and the first processor resource to obtain a third processor resource; and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
In one possible example, in terms of the processor 310 obtaining the first processor resource required by the current frame, the processor 310 is specifically configured to determine whether the current frame receives a picture rendering request; and if so, acquiring the first processor resource corresponding to the picture rendering request.
In the mobile terminal shown in fig. 3, when the first idle processor resource of the processor 310 is smaller than the first processor resource required by the current frame, the processor 310 obtains the second processor resource occupied by the background, performs a release operation on the second processor resource to obtain the second idle processor resource, and performs resource allocation on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Referring to fig. 4, in accordance with the embodiment of fig. 3, fig. 4 is a flowchart illustrating another processor control method according to an embodiment of the present application, which is applied to the mobile terminal described in fig. 3. Wherein:
401: the processor acquires a first processor resource required by the current frame and a first idle processor resource of the processor.
402: and when the first idle processor resource is smaller than the first processor resource, the processor acquires a second processor resource occupied by the background.
403: and the processor releases the second processor resource to obtain a second idle processor resource.
404: and the processor performs resource allocation on the current frame according to the second idle processor resource.
In one possible example, the background run includes K applications, the K being an integer greater than 1; the memory stores a first threshold; the processor performs a release operation on the second processor resource to obtain a second idle processor resource, including: the processor acquires applications, occupied by processor resources in the K applications, of which the processor resources are larger than the first threshold value, and obtains N applications, wherein N is a positive integer smaller than or equal to K; the processor acquires the priority of each application in the N applications to obtain N priorities; the processor determines processor resources to be released corresponding to the N applications according to the N priorities; and the processor releases the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
In one possible example, the priority includes a plurality of dimensions, and the memory stores a preset weight corresponding to each of the plurality of dimensions; the processor obtains the priority of each application in the N applications to obtain a plurality of priorities, and the method comprises the following steps: the processor acquires an evaluation value corresponding to a target application in each dimension to obtain a plurality of evaluation values, wherein the target application is any one of the K applications; and the processor acquires the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
In one possible example, the memory stores a second threshold, and the processor determines, according to the N priorities, to-be-released processor resources corresponding to the N applications, including: the processor acquires applications with the priority less than or equal to the second threshold value in the N applications to obtain a plurality of applications; the processor determines processor resources to be released of each application in the plurality of applications as processor resources occupied by the application; the processor acquires L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N; the processor obtains the difference between the first idle processor resource and the first processor resource to obtain a third processor resource; and the processor determines processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
In one possible example, before the processor acquires the first processor resource required for the current frame, the method further comprises: the processor judges whether the current frame receives a picture rendering request; and if so, acquiring the first processor resource corresponding to the picture rendering request.
As shown in fig. 4, in the processor control method, when a first idle processor resource of a processor is smaller than a first processor resource required by a current frame, the processor acquires a second processor resource occupied by a background, performs a release operation on the second processor resource to obtain a second idle processor resource, and performs resource allocation on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Referring to fig. 5, fig. 5 is a schematic structural diagram of another mobile terminal according to an embodiment of the present disclosure, consistent with the embodiments of fig. 1, fig. 2, fig. 3, and fig. 4. As shown in fig. 5, the mobile terminal 500 includes a processor 510, a memory 520, a communication interface 530, and one or more programs 540, wherein the one or more programs 540 are stored in the memory 520 and configured to be executed by the processor 510, the programs 540 including instructions for performing the steps of:
acquiring a first processor resource required by a current frame and a first idle processor resource of a processor;
when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
releasing the second processor resource to obtain a second idle processor resource;
and carrying out resource allocation on the current frame according to the second idle processor resource.
In one possible example, the background run includes K applications, the K being an integer greater than 1; in the aspect of the releasing the second processor resource to obtain a second idle processor resource, the program 540 is specifically configured to execute the following instructions:
acquiring applications of which occupied processor resources are larger than a first threshold value in the K applications to obtain N applications, wherein N is a positive integer smaller than or equal to K;
acquiring the priority of each application in the N applications to obtain N priorities;
determining processor resources to be released corresponding to the N applications according to the N priorities;
and releasing the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
In one possible example, the priority includes multiple dimensions, and in terms of obtaining the priority of each of the N applications and obtaining multiple priorities, the program 540 is specifically configured to execute the following steps:
obtaining an evaluation value corresponding to a target application in each dimension to obtain a plurality of evaluation values, wherein the target application is any one of the K applications;
and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
In one possible example, in the aspect of determining the to-be-released processor resources corresponding to the N applications according to the N priorities, the program 540 is specifically configured to execute the following steps:
acquiring applications with the priority less than or equal to a second threshold value in the N applications to obtain a plurality of applications;
determining processor resources to be released of each application in the plurality of applications as processor resources occupied by the application;
acquiring L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N;
obtaining a difference between the first idle processor resource and the first processor resource to obtain a third processor resource;
and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
In one possible example, before the acquiring the first processor resource required by the current frame, the program 540 is further configured to execute the following steps:
judging whether the current frame receives a picture rendering request;
and if so, acquiring the first processor resource corresponding to the picture rendering request.
It can be seen that, in the embodiment of the present application, when a first idle processor resource of a processor is smaller than a first processor resource required by a current frame, a second processor resource occupied by a background is obtained, a release operation is performed on the second processor resource to obtain a second idle processor resource, and a resource configuration is performed on the current frame according to the second idle processor resource. That is to say, the processor resources allocated to the game application are dynamically adjusted by taking the frame as a unit, and when the idle resources in the processor are not enough to be allocated to the current frame in the game application, part of the processor resources occupied by the background are released, so that the processor resources required by the current frame are met, the occupied resources of the processor can be effectively reduced, and the fluency of the game picture and the utilization rate of the processor are improved.
Embodiments of the present application also provide a computer storage medium, where the computer storage medium stores a computer program for causing a computer to execute some or all of the steps of any one of the methods as described in the method embodiments, and the computer includes a mobile terminal.
Embodiments of the application also provide a computer program product comprising a non-transitory computer readable storage medium storing a computer program operable to cause a computer to perform some or all of the steps of any of the methods as recited in the method embodiments. The computer program product may be a software installation package and the computer comprises a mobile terminal.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some interfaces, devices or units, and may be an electric or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware or a form of software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable memory. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a memory, and including several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned memory comprises: various media capable of storing program codes, such as a usb disk, a Read-Only memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
The foregoing detailed description of the embodiments of the present application has been presented to illustrate the principles and implementations of the present application, and the above description of the embodiments is only provided to help understand the method and the core concept of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A processor control method, comprising:
if the current frame receives a picture rendering request, acquiring a first processor resource required by the current frame and a first idle processor resource of a processor; the processing resources required for different frames are different; if the current frame does not receive the picture rendering request, using the configured processor resource;
when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
releasing the second processor resource to obtain a second idle processor resource;
and carrying out resource allocation on the current frame according to the second idle processor resource.
2. The method of claim 1, wherein the background run comprises K applications, wherein K is an integer greater than 1;
the releasing the second processor resource to obtain a second idle processor resource includes:
acquiring applications of which occupied processor resources are larger than a first threshold value in the K applications to obtain N applications, wherein N is a positive integer smaller than or equal to K;
acquiring the priority of each application in the N applications to obtain N priorities;
determining processor resources to be released corresponding to the N applications according to the N priorities;
and releasing the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
3. The method of claim 2, wherein the priority comprises a plurality of dimensions, and wherein obtaining the priority for each of the N applications results in a plurality of priorities, comprising:
obtaining an evaluation value corresponding to a target application in each dimension to obtain a plurality of evaluation values, wherein the target application is any one of the K applications;
and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
4. The method according to claim 2 or 3, wherein said determining the pending release processor resources corresponding to the N applications according to the N priorities comprises:
acquiring applications with the priority less than or equal to a second threshold value in the N applications to obtain a plurality of applications;
determining processor resources to be released of each application in the plurality of applications as processor resources occupied by the application;
acquiring L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N;
obtaining a difference between the first idle processor resource and the first processor resource to obtain a third processor resource;
and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
5. A processor control apparatus, comprising:
the judging unit is used for judging whether the current frame receives a picture rendering request;
the acquiring unit is used for acquiring a first processor resource required by the current frame and a first idle processor resource of the processor when the judging unit judges that the current frame is the current frame; the processing resources required for different frames are different; if the current frame does not receive the picture rendering request, using the configured processor resource; when the first idle processor resource is smaller than the first processor resource, acquiring a second processor resource occupied by a background;
a releasing unit, configured to release the second processor resource to obtain a second idle processor resource;
and the configuration unit is used for carrying out resource configuration on the current frame according to the second idle processor resource.
6. The apparatus of claim 5, wherein the background run comprises K applications, and wherein K is an integer greater than 1, and wherein the releasing unit comprises:
a first obtaining module, configured to obtain an application in which processor resources occupied by the K applications are greater than a first threshold, to obtain N applications, where N is a positive integer less than or equal to K;
a second obtaining module, configured to obtain a priority of each application of the N applications, so as to obtain N priorities;
a determining module, configured to determine, according to the N priorities, to-be-released processor resources corresponding to the N applications;
and the releasing module is used for releasing the processor resource to be released corresponding to each application in the N applications to obtain the second idle processor resource.
7. The apparatus according to claim 6, wherein the priority includes multiple dimensions, and the second obtaining module is specifically configured to obtain an evaluation value corresponding to a target application in each of the multiple dimensions, so as to obtain multiple evaluation values, where the target application is any one of the K applications; and acquiring the priority corresponding to the target application according to the evaluation value corresponding to each dimension in the dimensions and a preset weight.
8. The apparatus of claim 6 or 7, wherein the determining module comprises:
the first obtaining subunit is configured to obtain an application with a priority less than or equal to a second threshold from the N applications, so as to obtain multiple applications; acquiring L applications with the priority greater than the second threshold value in the N applications, wherein L is a positive integer less than or equal to N;
a second obtaining subunit, configured to obtain a difference between the first idle processor resource and the first processor resource, to obtain a third processor resource;
a determining subunit, configured to determine, for each application in the multiple applications, processor resources to be released as processor resources occupied by the application; and determining the processor resources to be released corresponding to the L applications according to the third processor resources and the priorities of the L applications.
9. A mobile terminal comprising a processor, memory, a communications interface, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the processor, the programs comprising instructions for performing the steps of the method of any of claims 1-4.
10. A computer-readable storage medium for storing a computer program, wherein the computer program causes a computer to perform the method according to any one of claims 1-4.
CN201711032475.9A 2017-10-26 2017-10-26 Processor control method and related product Active CN107741880B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711032475.9A CN107741880B (en) 2017-10-26 2017-10-26 Processor control method and related product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711032475.9A CN107741880B (en) 2017-10-26 2017-10-26 Processor control method and related product

Publications (2)

Publication Number Publication Date
CN107741880A CN107741880A (en) 2018-02-27
CN107741880B true CN107741880B (en) 2021-04-23

Family

ID=61233080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711032475.9A Active CN107741880B (en) 2017-10-26 2017-10-26 Processor control method and related product

Country Status (1)

Country Link
CN (1) CN107741880B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645955A (en) * 2013-12-16 2014-03-19 百度在线网络技术(北京)有限公司 Running management method and device for application program
CN106407010A (en) * 2016-09-06 2017-02-15 北京珠穆朗玛移动通信有限公司 Internal memory management method and mobile terminal
CN106559579A (en) * 2016-11-30 2017-04-05 努比亚技术有限公司 Mobile terminal and CPU/GPU scheduling parameter update methods

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8024737B2 (en) * 2006-04-24 2011-09-20 Hewlett-Packard Development Company, L.P. Method and a system that enables the calculation of resource requirements for a composite application
US10095597B2 (en) * 2016-01-13 2018-10-09 International Business Machines Corporation Managing a set of wear-leveling data using a set of thread events

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103645955A (en) * 2013-12-16 2014-03-19 百度在线网络技术(北京)有限公司 Running management method and device for application program
CN106407010A (en) * 2016-09-06 2017-02-15 北京珠穆朗玛移动通信有限公司 Internal memory management method and mobile terminal
CN106559579A (en) * 2016-11-30 2017-04-05 努比亚技术有限公司 Mobile terminal and CPU/GPU scheduling parameter update methods

Also Published As

Publication number Publication date
CN107741880A (en) 2018-02-27

Similar Documents

Publication Publication Date Title
CN108763012B (en) Card pause information acquisition method and device and terminal
CN109152095B (en) Wireless network connection method for terminal
CN107861813B (en) Processor control method and related product
CN110932994B (en) Data traffic processing method and device, electronic equipment and storage medium
US10601891B2 (en) Cloud streaming service system and cloud streaming service method for utilizing an optimal GPU for video decoding based on resource conditions, and apparatus for the same
CN111045816B (en) Performance optimization method and related device
CN108829510B (en) Thread binding processing method and device
WO2014094310A1 (en) Resource scheduling method and device
CN111708642B (en) Processor performance optimization method and device in VR system and VR equipment
CN106569917B (en) Data backup method and mobile terminal
CN111124668A (en) Memory release method and device, storage medium and terminal
CN105511876B (en) A kind of processing method and processing device of pushed information
CN107832127B (en) Application control method and related product
CN107659509B (en) Application flow use control method and device, readable storage medium and terminal equipment
CN109509139B (en) Vertex data processing method, device and equipment
EP2960803A1 (en) Data sharing system
CN107741880B (en) Processor control method and related product
CN112231077B (en) Application scheduling method and electronic equipment
CN105630493A (en) Method and device for regulating sleep time of mobile terminal
CN109067864B (en) Notification message pushing method and device and electronic equipment
CN110771113B (en) Brushing amount terminal detection method and device
CN112822000B (en) Control method of intelligent LED display screen based on 5g control system and intelligent LED display screen
CN106060825B (en) Client identification card copying reminding method and server
CN106375700A (en) Video transmission method and mobile terminal
CN115696356A (en) Cell capacity adjusting method, cell capacity adjusting 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
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant