CN110532100B - Method, device, terminal and storage medium for scheduling resources - Google Patents

Method, device, terminal and storage medium for scheduling resources Download PDF

Info

Publication number
CN110532100B
CN110532100B CN201910824338.1A CN201910824338A CN110532100B CN 110532100 B CN110532100 B CN 110532100B CN 201910824338 A CN201910824338 A CN 201910824338A CN 110532100 B CN110532100 B CN 110532100B
Authority
CN
China
Prior art keywords
resource
target
target task
interval
scheduling
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
CN201910824338.1A
Other languages
Chinese (zh)
Other versions
CN110532100A (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 CN201910824338.1A priority Critical patent/CN110532100B/en
Publication of CN110532100A publication Critical patent/CN110532100A/en
Application granted granted Critical
Publication of CN110532100B publication Critical patent/CN110532100B/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/5011Allocation 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/5016Allocation 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 the resource being the memory
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/20Processor architectures; Processor configuration, e.g. pipelining
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management

Abstract

The embodiment of the application discloses a method, a device, a terminal and a storage medium for scheduling resources, which belong to the technical field of computers. The target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the terminal renders the target frame. According to the method and the device, the running time of the target task is monitored in the process of rendering the target frame, so that the terminal can master the rendering time in real time in the rendering process of the target frame, corresponding resource increment is obtained before the pause and possibly in the pause, and resource scheduling is carried out, so that the effect of effectively avoiding the pause is realized.

Description

Method, device, terminal and storage medium for scheduling resources
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a method, a device, a terminal and a storage medium for scheduling resources.
Background
In the process that the terminal needs to display the image, the terminal renders the image data into an image frame and displays the rendered image frame on a screen to finish the image display work.
In some possible implementation manners, the terminal may not display the image frame in the screen in time due to untimely rendering of the image data, so as to form a frame loss. After the terminal loses a frame, the video or animation displayed by the terminal will generate a pause.
Disclosure of Invention
The embodiment of the application provides a method, a device, a terminal and a storage medium for scheduling resources. The technical scheme is as follows:
according to an aspect of the present application, there is provided a method of scheduling resources, the method including:
when a target frame is rendered, acquiring the running time of a target task, wherein the target task is used for rendering the target frame or is used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when a terminal renders the target frame;
determining a corresponding resource increment according to the running duration;
and scheduling the resources according to the resource increment.
According to another aspect of the present application, there is provided an apparatus for scheduling resources, the apparatus comprising:
the time length obtaining module is used for obtaining the running time length of a target task when a target frame is rendered, wherein the target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time length is the accumulated running time length of the target task when the target frame is rendered by a terminal;
the increment determining module is used for determining the corresponding resource increment according to the running duration;
and the resource scheduling module is used for scheduling the resources according to the resource increment.
According to another aspect of the present application, there is provided a terminal comprising a processor and a memory, the memory having stored therein at least one instruction, the instruction being loaded and executed by the processor to implement the method of scheduling resources as provided in the implementations of the present application.
According to another aspect of the present application, there is provided a computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to implement a method of scheduling resources as provided in the practice of the present application.
The beneficial effects brought by the technical scheme provided by the embodiment of the application can include:
according to the technical scheme, the running time of the target task can be obtained in the process of rendering the target frame, the corresponding resource increment is determined according to the running time, and when the target task is in a running state, the resource is scheduled according to the resource increment. The target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the terminal renders the target frame. According to the technical scheme, the running time of the target task is monitored in the process of rendering the target frame, the phenomenon that the target frame cannot be read when the target frame is read and is blocked is avoided, the terminal can master the rendering time in real time in the rendering process of the target frame, corresponding resource increment is obtained under the condition that the blocked running time is possibly caused, resource scheduling is carried out, the resource increment is increased in advance before the blockage occurs, and the blockage is effectively avoided.
Drawings
In order to more clearly describe the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments of the present application will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without creative efforts.
Fig. 1 is a block diagram of a terminal according to an exemplary embodiment of the present application;
FIG. 2 is a flowchart of a method for scheduling resources according to an exemplary embodiment of the present application;
FIG. 3 is a flowchart of a method for scheduling resources according to another exemplary embodiment of the present application;
FIG. 4 is a distribution graph and a fitted curve of a target task runtime provided based on the embodiment shown in FIG. 3;
FIG. 5 is a histogram and fitted curve of another target task runtime provided based on the embodiment shown in FIG. 3;
FIG. 6 is a flowchart of a portion of the steps provided based on the method of scheduling resources shown in FIG. 3;
FIG. 7 is a flowchart of a portion of the steps provided based on the method of scheduling resources shown in FIG. 3;
fig. 8 is a block diagram illustrating an apparatus for scheduling resources according to an exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
In the description of the present application, it is to be understood that the terms "first," "second," and the like are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In the description of the present application, it is to be noted that, unless otherwise explicitly specified or limited, the terms "connected" and "connected" are to be interpreted broadly, e.g., as being fixed or detachable or integrally connected; can be mechanically or electrically connected; may be directly connected or indirectly connected through an intermediate. The specific meaning of the above terms in the present application can be understood in a specific case by those of ordinary skill in the art. Further, in the description of the present application, "a plurality" means two or more unless otherwise specified. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
In order to make the solution shown in the embodiments of the present application easy to understand, several terms appearing in the embodiments of the present application will be described below.
Target frame: may be one image frame for display, which may belong to a target application. When the target application is running, the target application needs to display a picture in the screen, and the picture may include animation or video. When the target application needs to display the animation or the video in the screen, the terminal can continuously display a plurality of target frames, and the animation or the video is formed by continuously displaying the target frames. In one possible implementation, if the target application displays animation or video for a frame number of 60, the target application will continuously display 60 target frames in 1 second. Each frame of target frame needs to pass through a rendering process, and the target frame after passing through the rendering process is stored in a buffer queue. The terminal can read the rendered target frames from the buffer queue and display the target frames in the screen according to the read sequence.
And (3) target tasks: is a task for rendering the target frame, or is a task for supporting rendering the target frame.
In one possible implementation, the target task may belong to a target application, the target task being a task provided in the target application. Optionally, the target task may be one of a designated process, a thread, or a task, which is not limited in this embodiment.
Alternatively, the target task may be at least one of a logical thread, a rendering thread, a resource asynchronous loading thread, a system task closely associated with the rendering process, and a system task closely associated with the rendering process. Among the system tasks that are closely associated with the rendering process may be system servers and surfacefinders.
In another possible implementation, the target task is for rendering a target frame. When the target application only contains a logical thread, if the logical thread contains a function for rendering a target frame, the logical thread is the current target task. When a rendering thread is included in the target application, the rendering thread will be the target task.
In one possible implementation, the terminal is provided with the capability of identifying the target task. Alternatively, the terminal may store characteristics of the target task in advance, for example, an identifier of the target task, and the terminal determines the target task from the tasks included in the target application by recognizing the identifier of the target task. The terminal can identify the task in the target application when the target application runs, and determine the target task in the target application.
The operation time is as follows: the time length of accumulated running of the target task when the terminal renders the target frame is indicated. In a possible mode, when the terminal renders the target frame, whether the target task is in the running state or not is monitored, when the target task is in the running state, the terminal records the running time of the target task, and in the process of rendering the target frame, the accumulated running time of the target task when the terminal renders the target frame is recorded.
Resource increment: for indicating the incremental portion of the hardware resources specified in the terminal. It should be noted that the hardware resource specified in the terminal is a resource provided by a hardware component for indicating support for the target task. Alternatively, the hardware resources may include computing hardware resources, storage hardware resources, and I/O hardware resources.
In one aspect, for the computing hardware resources, the computing hardware resources may include a computing-capable chip such as a central processing unit CPU resource, a graphics processing unit GPU resource, or an embedded neural network processor NPU resource. It should be noted that, whether the CPU, the GPU or the NPU may integrate a plurality of cores, and the plurality of cores may further include a first core and a second core having different computing capabilities. For example, the computational power of the first core is greater than the computational power of the second core. In one possible naming, the first core may be referred to as a big core and the second core may be referred to as a little core. When a plurality of tasks need to use one core together, the terminal can realize the scheduling of computing hardware resources in a clock terminal mode and the like.
For example, when the resource increment includes computing hardware resources, the resource increment may be one of an increased length of time to use the processor, a more powerful core, or an additional added core.
On the other hand, for the storage hardware resources, the storage hardware resources generally include a memory and an external memory. In a possible implementation, the memory may be a random access memory RAM, and the terminal accesses the memory through a system bus. The terminal accesses the external memory through a standard I/O port.
For example, when the resource increment includes a storage hardware resource, the resource increment may be one of an increased memory capacity or an external memory capacity.
On the other hand, for I/O hardware resources, the I/O hardware resources include an I/O interface chip and an I/O interface control card. The I/O interface chip is mostly an integrated circuit and is used for inputting different commands and parameters through a CPU (Central processing Unit) and controlling relevant I/O circuits and peripheral equipment to perform corresponding operations. For example, common interface chips include a timer counter, an interrupt controller, a DMA (Direct Memory Access) controller, and a parallel interface. The I/O interface control card is formed by a plurality of integrated circuits according to certain logic, or is directly arranged on a mainboard with a CPU, or is inserted in a system bus slot as a plug-in.
For example, when the resource delta includes an I/O hardware resource, the resource delta can be an increase in the I/O frequency allowed to be invoked.
For example, the method for scheduling resources shown in the embodiment of the present application may be applied to a terminal, where the terminal has a display screen and a function of scheduling resources. The terminal may include a mobile phone, a tablet computer, a laptop computer, a desktop computer, a computer all-in-one machine, a server, a workstation, a television, a set-top box, smart glasses, a smart watch, a digital camera, an MP4 player terminal, an MP5 player terminal, a learning machine, a point-and-read machine, an electronic book, an electronic dictionary, a vehicle-mounted terminal, a Virtual Reality (VR) player terminal, an Augmented Reality (AR) player terminal, or the like.
Referring to fig. 1, fig. 1 is a block diagram of a terminal according to an exemplary embodiment of the present application, and as shown in fig. 1, the terminal includes a processor 120 and a memory 140, where the memory 140 stores at least one instruction, and the instruction is loaded and executed by the processor 120 to implement a method for scheduling resources according to various method embodiments of the present application. Optionally, the terminal 100 further comprises a display component 160, and the display component 160 is capable of displaying the rendered target frame.
In the present application, the terminal 100 is an electronic device having a function of rendering a target frame. When the terminal 100 renders the target frame, the terminal 100 can obtain a running time of a target task, wherein the target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is a time accumulated when the target task is executed when the terminal renders the target frame; and the terminal determines the corresponding resource increment according to the running time length and carries out resource scheduling according to the resource increment.
Processor 120 may include one or more processing cores. The processor 120 connects various parts within the overall terminal 100 using various interfaces and lines, and performs various functions of the terminal 100 and processes data by executing or executing instructions, programs, code sets, or instruction sets stored in the memory 140 and calling data stored in the memory 140. Optionally, the processor 120 may be implemented in at least one hardware form of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA). The processor 120 may integrate one or more of a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), a modem, and the like. Wherein, the CPU mainly processes an operating system, a user interface, an application program and the like; the GPU is used for rendering and drawing the content required to be displayed by the display screen; the modem is used to handle wireless communications. It is understood that the modem may not be integrated into the processor 120, but may be implemented by a single chip.
The Memory 140 may include a Random Access Memory (RAM) or a Read-Only Memory (Read-Only Memory). Optionally, the memory 140 includes a non-transitory computer-readable medium. The memory 140 may be used to store instructions, programs, code sets, or instruction sets. The memory 140 may include a stored program area and a stored data area, wherein the stored program area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like; the storage data area may store data and the like referred to in the following respective method embodiments.
The display module 160 may be a display screen, which may be an LED (Light Emitting Diode) display, a projection module, or an OLED (organic Light-Emitting Diode) display. It is noted that the terminal 100 may include a display component 160. In another possible approach, only the processor 120 and the memory 140 may be included in the terminal 100, and the display component 160 serves as a stand-alone device for receiving the target frame that is rendered by the terminal 100 and displaying the target frame. For example, the terminal 100 may be a computer device such as a television set-top box, a computer host, or a vehicle-mounted terminal, which is only exemplary and not limiting to the possible form and range of the terminal 100 in the present application.
Referring to fig. 2, fig. 2 is a flowchart of a method for scheduling resources according to an exemplary embodiment of the present application. The method for scheduling resources can be applied to the terminal shown above. In fig. 2, the method for scheduling resources includes:
step 210, when the target frame is rendered, acquiring the running time of the target task, wherein the target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the target frame is rendered at the terminal.
In the embodiment of the application, the terminal can run the target task. When the target task runs, the terminal can finish the rendering work of one target frame. If the frame rate of the target application displaying the target frame is determined, the frame length is also determined accordingly. For example, the frame rate of the target application is 50 frames, and the frame length of the target frame is 20 milliseconds. The terminal refreshes a frame of image into the display component every 20 milliseconds. If the next frame of target is not rendered completely after the display of the previous frame of target frame is completed by the terminal, the picture displayed by the terminal is blocked.
In the embodiment of the present application, the longest duration for rendering each frame of the target frame by the terminal may be the frame length. If the time length of the terminal for rendering the target frame is longer than the frame length, the terminal is stuck. Therefore, the method and the device for processing the target frame have the advantage that the running time of the target task can be obtained in real time in the process that the terminal starts to render the target frame. The target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the terminal renders the target frame.
Step 220, determining the corresponding resource increment according to the running time length.
In the embodiment of the application, after the terminal acquires the operation duration, the corresponding resource increment can be determined according to the operation duration. It should be noted that the resource increment indicated in the present application may be an increment of one hardware resource, or may be an increment of multiple hardware resources.
In a possible manner, if the resource increment is an increment of a hardware resource, the terminal can determine the resource increment corresponding to the operating duration according to a corresponding relationship between the operating duration and the resource increment calibrated in advance. For example, please see table one.
Watch 1
Length of operation (8ms,12ms] (12ms,16ms] (16ms,20ms] (20ms,+∞]
Resource increment Increase by 30 percent Increase by 60 percent Increase by 90 percent Increase by 100%
In the data shown in table one, the operation time length is divided into four time length intervals. The first duration interval is (0, 7 ms), the second duration interval is (7ms, 14 ms), the third duration interval is (14ms, 20 ms) and the fourth duration interval is (20ms, + ∞.) each duration interval corresponds to a resource increment, which can determine a specific resource increment with the resource amount used by the current target application as a base.
For example, in one possible approach, if the amount of resources is memory capacity, and the memory capacity occupied by the current target task is 200 MB. In this case, if the current running time of the target task is 9ms, the running time falls within the interval of (8ms, 12 ms), and the terminal determines that the resource increment of the target task is increased by 30%, that is, the resource increment is increased by 30% on the basis of 200MB of the memory capacity occupied by the current target task, and the memory capacity of 60MB is increased.
Optionally, in the implementation shown in table one, the processing case when the operation time length is not more than 8 milliseconds (i.e. 8ms) is not shown. In one possible embodiment of the present application, when the running time is less than the minimum threshold, the target task is considered to be in a normal working state, and no new resource increment is added to the target task.
It should be noted that the adjustment manner shown in the table is only an exemplary illustration that the application can provide corresponding resource increments for different running durations, and no limitation is made to specific values of the running durations and the resource increments in the application. In a possible mode, the terminal can also divide the running duration into smaller granularities, and the divided running durations correspond to different resource increments respectively.
And step 230, scheduling the resources according to the resource increment.
In the embodiment of the application, after the terminal obtains the resource increment, the terminal can perform resource scheduling according to the resource increment.
In a possible implementation manner, the terminal directly performs resource scheduling according to the resource increment. For example, when the originally occupied memory capacity of the target task is 200MB and the resource increment determined by the terminal is 60MB, the terminal newly increases the memory capacity of 60MB to allocate to the target task.
In another possible implementation manner, the terminal performs resource scheduling for the target thread according to the resource increment and the resource scheduling policy of the whole system. For example, when the originally occupied memory capacity of the target task is 200MB and the resource increment determined by the terminal is 60MB, the terminal schedules the target task by combining the memory capacity of 60MB that needs to be added with the resource scheduling policy of the whole system. Optionally, the resource scheduling policy of the whole system may set a weight for each resource according to the priority of the task currently applying for the resource. And the terminal newly schedules resources for the target task from the residual resources of the current system according to the weight of the resources. For example, the current system has a memory capacity of 150MB remaining, and the weight of the target task is 30%, then the memory capacity actually added by the target task according to the weight is 45 MB.
In summary, the method for scheduling resources provided in this embodiment can obtain the running time of the target task in the process of rendering the target frame, determine the corresponding resource increment according to the running time, and perform resource scheduling according to the resource increment when the target task is in a running state. The target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the terminal renders the target frame. According to the technical scheme, the running time of the target task is monitored in the process of rendering the target frame, the phenomenon that the target frame cannot be read when the target frame is read and is blocked is avoided, the terminal can master the rendering time in real time in the rendering process of the target frame, corresponding resource increment is obtained under the condition that the blocked running time is possibly caused, resource scheduling is carried out, the resource increment is increased in advance before the blockage occurs, and the blockage is effectively avoided.
Based on the scheme disclosed in the previous embodiment, the terminal can also actively calibrate the relationship between the operating duration and the resource increment according to the historical condition of the terminal itself operating the target task, determine the resource increment according to the calibrated relationship between the operating duration and the resource increment, and refer to the following embodiments according to the resource increment.
Referring to fig. 3, fig. 3 is a flowchart of a method for scheduling resources according to another exemplary embodiment of the present application. The method for scheduling resources can be applied to the terminal shown above. In fig. 3, the method for scheduling resources includes:
step 310, when the target frame is rendered, the running time of the target task is obtained.
In the embodiment of the present application, the execution process of step 310 is the same as the execution process of step 210, and is not described herein again.
In step 321, a first time interval in which the operation time is located is determined.
In the embodiment of the application, the terminal can determine the first time interval of the running time after obtaining the running time of the target task. It should be noted that the duration interval may be a predetermined duration interval, the terminal may compare the operation duration of the target task with the predetermined duration interval, and when the value of the operation duration belongs to one duration interval, the terminal may determine the duration interval including the operation duration as the first duration interval.
In the embodiment of the present application, after performing the completing step 321, the terminal may perform the step (a1), the step (a2), the step (a3), the step (a4), the step (a5) and the step (a6) to update or newly create the scheduling policy data. The terminal may perform step 322 after performing the completion step (a 6).
Wherein, the steps (a1) to (a6) are executed as follows:
and step (a1), determining the frame length of the target application when the target application runs, wherein the target application is the application to which the target frame belongs.
In the embodiment of the application, the terminal determines the frame length of a target application in running, wherein the target application is an application to which a target frame belongs. It should be noted that, in the practical application process of the present application, the terminal can identify the source of the image frame currently performing the rendering operation, that is, the terminal can obtain the identifier of the target application to which the image frame belongs. When the rendered image frame is determined to be a target frame in the target application through the identification of the application, a frame length at runtime of the target application is determined.
In one possible approach, a frame length is used to indicate the length of each frame, which is a unit duration/number of frames within a unit duration. For example, when the unit time length is 1 second and the number of frames within the unit time length is 50, the frame length is 20 milliseconds.
And (a2) dividing the frame length into n time length sections with equal length, wherein n is a positive integer.
In the embodiment of the application, the terminal divides the frame length into n time intervals with equal length, wherein n is a positive integer. N is a positive integer of not less than 2. Since a large amount of data needs to be counted in the subsequent steps, the duration interval needs to be divided into intervals with equal length, so that the data obtained through counting has a representative meaning. For example, when the frame length of the target application in which the target frame is located is 20 milliseconds, the target application will display 50 frames of the target frame in 1 second and 30000 frames of the target frame in 10 minutes.
And (a3) counting data of m completion durations of the target task distributed in a duration interval, wherein the completion durations are used for indicating the target task, the accumulated duration spent when one frame of image in the target application is processed, and m is a positive integer.
In the embodiment of the application, the terminal counts the data of m completion durations of the target task distributed in the duration interval. It should be noted that m completion time lengths refer to time lengths cumulatively spent by the target task processing when completing one frame of image in the target application, and m is also a positive integer.
In one possible implementation, when a target task renders a target frame, the target frame will correspond to a completion duration. See, for example, table two.
Watch two
Target frame Target frame g1 Target frame g2 Target frame g3 Target frame g4
Completion duration 12 milliseconds 10 milliseconds 13 ms 9ms
In the data shown in table two, when the terminal is rendering the target frame g1, the completion duration consumed by the target task accumulation is 12 milliseconds to complete the rendering work for the target frame g 1. When the terminal is rendering another target frame g2, the completion duration cumulatively consumed by the target task is 10 milliseconds to complete the rendering work for the target frame g 2. When the terminal is rendering another target frame g3, the completion duration cumulatively consumed by the target task is 13 milliseconds to complete the rendering work for the target frame g 3. When the terminal is rendering another target frame g4, the completion duration cumulatively consumed by the target task is 9 milliseconds to complete the rendering work for the target frame g 4.
If the duration interval includes (8ms, 12ms ] and (12ms, 16ms ], the terminal determines in this step that the completion durations of the target frame g1, the target frame g2, and the target frame g4 all fall within the duration interval (8ms, 12ms ], and determines that the completion duration of the target frame g3 falls within the duration interval (12ms, 16 ms).
It should be noted that the relationship between the target frames and the corresponding time lengths shown in table two is only an exemplary illustration. In the actual operation process, the time interval can be divided into smaller granularity. For example, if the frame length is 16.7 milliseconds, the duration interval may be 17 microseconds, which is the interval length of one duration interval, and the frame length of 16.7 milliseconds is divided.
Referring to fig. 4, fig. 4 is a distribution graph and a fitting curve of a target task running time provided based on the embodiment shown in fig. 3. Similarly, referring to fig. 5, fig. 5 is a distribution graph and a fitting curve of another target task running time provided based on the embodiment shown in fig. 3. In fig. 4 and 5, the ordinate is the probability of the operation time length of the target task, and the abscissa is the time length of the operation time length.
In the example shown in fig. 4, the time unit is milliseconds. The target task shown in fig. 4 is data obtained by counting the logical threads of the game application a as an example.
In the example shown in fig. 5, the time unit is milliseconds. The target task shown in fig. 5 is data obtained by counting the logical threads of the game application B as an example.
And (a4) acquiring a first number of completion durations corresponding to the ith duration interval, wherein i is an integer not less than 2 and not more than n.
In the embodiment of the application, the terminal can obtain the first number of the completion durations corresponding to the ith duration interval, wherein i is an integer not less than 2 and not more than n. In this step, the terminal obtains the number of the completion durations corresponding to each duration interval. For example, if the duration intervals are divided into (8ms, 12ms ], (12ms, 16ms ], (16ms, 20ms ], and (20ms, + ∞) in total and the counted number of target frames is 10000 frames, the terminal can count the first number falling within each duration interval in this step, as described in table three for details.
Watch III
Duration interval (8ms,12ms] (12ms,16ms] (16ms,20ms] (20ms,+∞]
First number of 3500 1000 500 120
Resource increment Increase by 30 percent Increase by 60 percent Increase by 90 percent Increase by 100%
As can be seen from the data shown in table three, when 3500 target frames are processed from the 10000 counted target frames, the operation duration of the target task is (8ms, 12 ms.) similarly, the total number of the first number corresponding to the four counted intervals in table three is 5120 frames, that is, the first number of the target frames corresponding to the operation duration in [0, 8ms ] is 4880 frames.
And (a5) when the proportion of the first number to the m completion time lengths is not less than a preset proportion threshold, respectively associating the ith time length interval to the nth time length interval with (n-i +1) resource increments.
In this embodiment of the application, the preset proportion threshold may be a value preset in the terminal, and when the proportion of the first number corresponding to a certain duration interval to m completion durations is not less than the preset proportion threshold, the terminal associates the ith duration interval to the nth duration interval with (n-i +1) resource increments respectively.
Taking the data shown in table three as an example, when the preset proportion threshold is 30%, the proportion of the first number 3500 corresponding to the duration interval (8ms, 12 ms) to 10000 exceeds the 30%, the terminal determines the duration intervals (8ms, 12 ms), (12ms, 16 ms), (16ms, 20 ms) and (20ms, + ∞) to be respectively associated with (n-i +1) resource increments, and the associated data can be referred to table four.
Watch four
Figure BDA0002188582350000121
In the embodiment supported by the data shown in table four, the ith duration interval is the 2 nd duration interval, the nth duration interval is the 5 th duration interval, and the (n-i +1) resource increments are 4 resource increments, which are four resource increments of 30%, 60%, 90% and 100% increase, respectively, shown in table four.
And (a6) storing the association relationship between the ith time interval and the nth time interval and the association relationship between the (n-i +1) resource increments to the scheduling policy data.
In the embodiment of the application, the terminal can respectively associate the ith time interval to the nth time interval with (n-i +1) resource increments, and store the association in the scheduling policy data.
It should be noted that, in this embodiment of the present application, a resource increment corresponding to an ith duration interval is smaller than a resource increment corresponding to an (i +1) th duration interval, the (i +1) th duration interval is a duration interval adjacent to the ith duration interval, and any one duration value in the (i +1) th duration interval is greater than any one duration value in the ith duration interval.
In one possible implementation, as the running time of the target task increases, the probability that the target frame fails to be rendered within the frame length increases, and the probability of occurrence of the stuck increases. Therefore, the resource increment corresponding to the ith duration interval and the (i +1) th duration interval will be gradually increased. For example, the resource increment corresponding to the 2 nd duration interval (i.e., duration interval (8ms, 12 ms)) is increased by 30%, the resource increment corresponding to the adjacent 3 rd duration interval (i.e., duration interval (12ms, 16 ms)) is increased by 60%, and the resource increment corresponding to the 2 nd duration interval will be smaller than the resource increment corresponding to the 3 rd duration interval.
Step 322, determining a resource increment corresponding to the first time interval according to the scheduling policy data.
In this embodiment of the present application, the scheduling policy data is used to indicate a correspondence between the resource increment and the first time interval. In case the terminal determines the first duration, the terminal can unambiguously determine the corresponding resource increment.
In another possible implementation manner of the embodiment of the present application, the terminal may implement the operation shown in step 321 by performing step (b1), and implement the operation shown in step 322 by performing step (b2), step (b3) and step (b 4).
And (b1), when the operation duration is not less than the left end point of the first duration interval and not less than the right end point of the first duration interval, determining that the duration interval in which the operation duration is located is the first duration interval.
In the embodiment of the present application, for example, when the operation duration is 10 milliseconds, 10 milliseconds are not less than 8 milliseconds at the left end point of the 2 nd duration interval and less than 12 milliseconds at the right end point of the 2 nd duration interval, the duration in which the operation duration is 10 milliseconds is determined to be the first duration interval (8ms, 12 ms).
And (b2) determining whether the first time interval corresponds to the resource increment according to the scheduling strategy data.
In the embodiment of the application, the terminal can determine whether the first time interval corresponds to the resource increment according to the drop-to-ground policy data.
In one possible approach, based on the scenario shown in step (b1), the terminal can determine whether the first duration interval (8ms, 12 ms) corresponds to a resource increment, if the first duration interval (8ms, 12 ms) corresponds to a resource increment increase of 30% based on the data shown in table four.
And (b3), when the first time interval corresponds to the resource increment, determining the resource increment.
In the embodiment shown in the present application, when the first time interval corresponds to a resource increment, the terminal can determine the resource increment.
And (b4), when the first time interval does not correspond to the resource increment, determining the resource increment as a null value.
In the embodiment shown in the present application, when the first time interval does not correspond to a resource increment, the resource increment is determined as control. In a possible implementation manner, referring to the data shown in table four, when the first duration interval is (0, 8ms), the duration interval does not correspond to the resource increment, and the terminal determines the resource increment as a null value.
In another possible implementation manner of the embodiment of the present application, the terminal may implement the operation shown in step 322 by performing step c.
And c, when the duration corresponding to the left endpoint of the first time duration interval is not less than the frame duration of the target frame, determining the maximum resource increment in the scheduling strategy data as the resource increment corresponding to the first time duration interval.
In the embodiment shown in the application, when the duration corresponding to the left endpoint of the first duration interval is not less than the frame duration of the target frame, the terminal determines the maximum resource increment in the scheduling policy data as the resource increment corresponding to the first duration interval.
In one possible approach, for example, the frame length is 16.7 milliseconds. In this scenario, the duration corresponding to the left end point of the first duration interval is not less than the frame length of the target frame, and the terminal determines the maximum resource increment (i.e., 100% increase) in the scheduling policy data as the resource increment corresponding to the first duration interval.
Step 323, determining the resource increment corresponding to the first time interval as the resource increment corresponding to the target task.
In one possible implementation manner of the embodiment of the present application, the terminal may implement the operation shown in step 323 by performing step (d1), step (d2) and step (d 3).
And (d1) acquiring the target application to which the target task belongs, wherein the target application is the application to which the target frame belongs.
In the embodiment of the application, the target application can call the target task to render the target frame or support the rendering work of the target frame when running. When the target task is called, the terminal can acquire a target application to which the target task belongs, and the target application is an application to which a target frame belongs.
And (d2) when the target application belongs to a first application calibrated in advance, determining a corresponding first resource increment according to a first strategy corresponding to the first application, wherein the first application is an application with the load not less than the preset load during the operation.
In the embodiment of the application, when the target application belongs to a pre-calibrated first application, the terminal determines a corresponding first resource increment according to a first policy corresponding to the first application. It should be noted that the first application is an application whose load at the time of operation is not less than the preset load. In one possible mode, the developer stores an identifier of an application with a load not less than a preset load in the terminal, and when the application runs, the terminal can recognize that the application is the first application according to the identifier.
And (d3), when the target application belongs to a second application calibrated in advance, determining a corresponding second resource increment according to a second strategy corresponding to the second application, wherein the second application is an application of which the load during running is smaller than the preset load.
In the embodiment of the application, the terminal can determine the application with the load smaller than the preset load in operation as the second application, and determine the corresponding second resource increment through the second policy. See table five for details.
Watch five
Figure BDA0002188582350000151
In the data shown in table five, the second policy includes a duration interval corresponding to the operation duration and a resource increment. According to the disclosure of the present application, when the target tasks in the first application and the second application correspond to the same duration interval, the first application with a heavier load can obtain more resource increments. For example, when the running duration of the target task in the first application and the running duration of the target task in the second application both belong to a duration interval (8ms, 12 ms), the target task in the first application can acquire a resource increment increased by 30%, and the target task in the second application can acquire a resource increment increased by 10%.
In a possible implementation manner of the embodiment of the present application, the terminal may implement the operation shown in step 323 by performing step (e1) and step (e 2).
And (e1) acquiring a running identifier of the target task, wherein the running identifier is used for indicating whether the target task is in a running state.
In a possible implementation manner of the present application, the terminal can also obtain an operation identifier of the target task. Alternatively, the running flag may be a flag bit. The target task can be operated or stopped operating within a frame length period according to the actual calling condition of the hardware resource.
For example, when the hardware resource is a CPU, the target task can operate when the CPU is owned by the time slice and stop operating when the CPU is not owned by the time slice. When the target task owns the time slice of the CPU, the running flag of the target task may be 1 or true, which indicates that the target task is in a running state. Accordingly, when the target task does not have a time slice with a CPU, the running identifier of the target task may be 0 or false.
And (e2) when the running identifier indicates that the target task is in a running state, scheduling the resource according to the resource increment.
And step 330, scheduling the resources according to the resource increment.
In the embodiment of the present application, the execution process of step 330 is the same as the execution process of step 230, and is not described herein again.
For example, in one possible implementation manner of the present application, a frame length is 20 milliseconds, and data shown in table four is taken as an example for explanation, after a target task starts to process a target frame, if the running duration of the target task reaches 8ms and the target task is not finished yet, the terminal increases by 30% according to the resource increment for the target task to run. After the resources are added, the target task is possible to complete the work quickly. And if the running time of the target task reaches 12ms and the target task is not finished, the terminal increases by 30% according to the resource increment for running the target task. Similarly, if the running time of the target task reaches 16ms and the target task is not finished, the terminal increases by 30% according to the resource increment for the target task to run. And then, if the running time of the target task reaches 20ms and the target task is not finished yet, which indicates that the terminal is stuck, the terminal increases by 10% according to the resource increment for the target task to run.
In summary, in this embodiment, according to the first time interval in which the running duration is determined, the resource increment corresponding to the first time interval is determined according to the scheduling policy data, and the resource increment corresponding to the first time interval is determined as the resource increment corresponding to the target task, so that when the target task renders the target frame or supports the rendering work of the target frame, the terminal can determine the corresponding resource increment through the first time interval in which the running duration is located, and schedule the terminal according to the resource increment, so that the terminal allocates resources to the terminal in advance before the terminal is stuck, and the possibility of the occurrence of the stuck is effectively reduced.
The method for scheduling resources provided by this embodiment can also count the running time of the target task for completing the processing of the target frame each time, and dynamically adjust the resource increment corresponding to the running time according to the statistical condition of the running time of the target task, so that this scheme can dynamically adapt to the running time of the target task which is easy to appear, so that this application can adapt to the actual running condition of the target task and provide the corresponding resource increment, so that the terminal can have the corresponding resource increment in real time to adapt to it, and the effect of preventing the stuck is improved.
The method for scheduling resources provided by this embodiment can also perform resource scheduling according to the resource increment when the target task is in the running state, and still keep the original resource running when the target task is not in the running state, so that the system can accurately schedule resources according to the resource increment when the target task is running, thereby reducing the energy consumption of the terminal and prolonging the standby time of the terminal while ensuring that the terminal is stuck.
Referring to fig. 6, fig. 6 is a flowchart of a part of steps provided based on the method for scheduling resources shown in fig. 3, in fig. 6, the terminal may perform steps 301 and 302 before performing the completion step 310, and then perform steps 310, 321, 322 and 323, and after performing the completion step 323, the terminal may also perform step 303. The execution process of steps 301 to 303 is as follows:
step 301, a first resource management group is created, where the first resource management group is used to schedule resources according to a predetermined first resource.
In this embodiment, the terminal may further create a first resource management group first, and perform resource scheduling through the resource management group. It should be noted that the resource management group may be cgroups (english: Control group, chinese: Control group), which is a subsystem in Linux that controls various system resources.
Step 302, a target task is placed in a first resource management group.
In the embodiment of the application, the terminal places the target task in the first resource management group. When there are a plurality of target tasks, the first resource management group may include a plurality of target tasks.
Step 303, when the target task is scheduled by the terminal according to the resource increment, scheduling the resource according to the first resource and the resource increment through the first resource management group.
In the embodiment of the application, when the target task is scheduled by the terminal according to the resource increment, the resource is scheduled according to the first resource and the resource increment through the first resource management group. It should be noted that the first resource is a resource that the first resource management group has permission to schedule.
For example, when the first resource is a CPU corelet, the first resource management group will not have authority to invoke a CPU corelet.
Referring to fig. 7, fig. 7 is a flowchart of a part of steps provided based on the method for scheduling resources shown in fig. 3, in fig. 7, the terminal may perform steps 304 and 305 before performing the completion step 310, and then perform steps 310, 321, 322 and 323, and after performing the completion step 323, the terminal may also perform step 306. The execution process of steps 304 to 306 is as follows:
step 304, a second resource management group is created, the second resource management group being used for scheduling resources according to a predetermined second resource, the second resource being a resource other than the key resource included in the first resource.
In the embodiment of the present application, the terminal is further capable of creating a second resource management group for scheduling resources according to a predetermined second resource, which is a resource other than the key resource included in the first resource. For example, when the key resources included in the first resource are a big core a and a big core B, the second resource may be a resource including a big core C, a big core D, and the remaining small cores in the terminal.
Step 305, placing the heavily loaded task in a second resource management group.
In the embodiment of the present application, the terminal places the heavy load task in the second resource management group, and it should be noted that the heavy load task is a task other than the target task.
Step 306, when the heavy load task runs, scheduling a second resource through a second resource management group.
In the embodiment of the application, when the heavy load task runs, the terminal can schedule the second resource for support through the second resource management group, so that the heavy load task runs normally.
In summary, based on the embodiments shown in fig. 6 and fig. 7, the terminal can set different resource management groups for tasks with different requirements, so that the resource management groups schedule corresponding resource increments according to the running duration of the tasks before the process of rendering the image, thereby implementing hardware resource scheduling in advance before the occurrence of the stuck event, preventing the stuck event, and performing hardware resource scheduling only when the target task runs, and improving the endurance time of the terminal on the premise of preventing the stuck event.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Referring to fig. 8, fig. 8 is a block diagram illustrating an apparatus for scheduling resources according to an exemplary embodiment of the present application. The means for scheduling resources may be implemented as all or part of the terminal in software, hardware, or a combination of both. The device includes:
a duration obtaining module 810, configured to obtain, when a target frame is rendered, a running duration of a target task, where the target task is used to render the target frame or is used to support rendering of the target frame, and the running duration is a duration of running accumulated by the target task when the target frame is rendered by a terminal;
an increment determining module 820, configured to determine a corresponding resource increment according to the operation duration;
and a resource scheduling module 830, configured to perform resource scheduling according to the resource increment.
In an optional embodiment, the duration obtaining module 810 is configured to determine a first duration interval in which the operation duration is located; determining a resource increment corresponding to the first time interval according to scheduling policy data, wherein the scheduling policy data is used for indicating a corresponding relation between the resource increment and the first time interval; and determining the resource increment corresponding to the first time interval as the resource increment corresponding to the target task. .
In an optional embodiment, the duration obtaining module 810 is configured to determine that a duration interval in which the operating duration is located is the first duration interval when the operating duration is not less than a left endpoint of the first duration interval; the determining, according to the scheduling policy data, the resource increment corresponding to the first time interval includes: determining whether the first time interval corresponds to the resource increment according to the scheduling strategy data; when the first time interval corresponds to the resource increment, determining the resource increment; and when the first time interval does not correspond to the resource increment, determining the resource increment as a null value.
In an optional embodiment, the apparatus further includes a frame length determining module, an interval dividing module, a data counting module, a number obtaining module, an association module, and a storage module.
A frame length determining module, configured to determine a frame length of a target application when the target application runs, where the target application is an application to which the target frame belongs;
the interval division module is used for dividing the frame length into n time length intervals with equal length, wherein n is a positive integer;
the data counting module is used for counting data of m completion durations of the target task distributed in the duration interval, the completion durations are used for indicating the target task and processing the accumulated duration spent on completing one frame of image in the target application, and m is a positive integer;
the number acquisition module is used for acquiring a first number of the completion time length corresponding to the ith time length interval, wherein i is an integer not less than 1 and not more than n;
the association module is used for associating the ith duration interval to the nth duration interval with (n-i +1) resource increments respectively when the proportion of the first number in the m completion durations is not less than a preset proportion threshold;
and the storage module is used for storing the association relationship between the ith time interval and the nth time interval and the association relationship between the (n-i +1) resource increments to the scheduling policy data.
In an optional embodiment, a resource increment corresponding to the ith duration interval related in the apparatus is smaller than a resource increment corresponding to an (i +1) th duration interval, where the (i +1) th duration interval is a duration interval adjacent to the ith duration interval, and any one of the (i +1) th duration intervals has a duration value larger than any one of the ith duration intervals.
In an optional embodiment, the increment determining module 820 is configured to determine, when a duration corresponding to a left endpoint of the first time interval is not less than a frame length of the target frame, a maximum resource increment in the scheduling policy data as the resource increment corresponding to the first time interval.
In an optional embodiment, the increment determining module 820 is configured to obtain a target application to which the target task belongs, where the target application is an application to which the target frame belongs; when the target application belongs to a first application calibrated in advance, determining a corresponding first resource increment according to a first strategy corresponding to the first application, wherein the load of the first application in operation is not less than the preset load; and when the target application belongs to a second application calibrated in advance, determining a corresponding second resource increment according to a second strategy corresponding to the second application, wherein the load of the second application in operation is smaller than the preset load.
In an optional embodiment, the resource scheduling module 830 is configured to obtain an operation identifier of the target task, where the operation identifier is used to indicate whether the target task is in an operation state; and when the running identifier indicates that the target task is in a running state, scheduling resources according to the resource increment.
In an alternative embodiment, the resource scheduling module 830 is configured to create a first resource management group, where the first resource management group is configured to schedule resources according to a predetermined first resource; placing the target task in the first resource management group; and when the target task is subjected to resource scheduling by the terminal according to the resource increment, performing resource scheduling according to the first resource and the resource increment through the first resource management group.
In an optional embodiment, the resource scheduling module 830 is configured to create a second resource management group, where the second resource management group is configured to schedule the resource according to a predetermined second resource, and the second resource is a resource other than a key resource included in the first resource; placing the heavily loaded task in the second resource management group; and when the heavy load task runs, scheduling the second resource through the second resource management group.
The present application further provides a computer-readable medium, which stores at least one instruction, where the at least one instruction is loaded and executed by the processor to implement the method for scheduling resources according to the above embodiments.
It should be noted that: in the method for scheduling resources according to the foregoing embodiment, only the division of the functional modules is described as an example, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the apparatus for scheduling resources and the method for scheduling resources provided by the foregoing embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and will not be described herein again.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only exemplary of the implementation of the present application and is not intended to limit the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the present application should be included in the protection scope of the present application.

Claims (13)

1. A method for scheduling resources, the method comprising:
when a target frame is rendered, acquiring the current running time of a target task, wherein the target task is used for rendering the target frame or is used for supporting the rendering of the target frame, and the running time is the accumulated running time of the target task when the target frame is rendered by a terminal;
determining a first time interval in which the current running time of the target task is;
determining a resource increment corresponding to the target task according to scheduling policy data and the first time interval; the scheduling policy data is used for indicating a corresponding relation between the resource increment and the first time length interval, the scheduling policy data stores an association relation between an ith time length interval and an nth time length interval, which are respectively associated with n-i +1 resource increments, the n time length intervals are obtained by dividing the frame length corresponding to the target frame, n is a positive integer, and i is an integer not less than 1 and not more than n;
and performing resource scheduling on the target task according to the resource increment corresponding to the target task.
2. The method of claim 1, wherein the determining a resource increment corresponding to the target task according to the scheduling policy data and the first time interval comprises:
determining a resource increment corresponding to the first time interval according to the scheduling strategy data;
and determining the resource increment corresponding to the first time interval as the resource increment corresponding to the target task.
3. The method of claim 2, wherein the determining the first time interval in which the current running time of the target task is located comprises:
when the current running time of the target task is longer than the left end point of the first time length interval and is not longer than the right end point of the first time length interval, determining that the time length interval in which the current running time of the target task is located is the first time length interval;
the determining, according to the scheduling policy data, a resource increment corresponding to the first time interval includes:
determining whether the first time interval corresponds to the resource increment according to the scheduling strategy data;
when the resource increment corresponds to the first time interval, determining the resource increment corresponding to the first time interval;
and when the first time interval does not correspond to the resource increment, determining the resource increment corresponding to the first time interval as a null value.
4. The method according to claim 3, wherein before determining the resource increment corresponding to the target task according to the scheduling policy data and the first time interval, the method further comprises:
determining a frame length of a target application when running, wherein the target application is an application to which the target frame belongs;
dividing the frame length into n time length intervals with equal length;
counting data of m completion durations of the target task distributed in the duration interval, wherein the completion durations are used for indicating the target task and processing the accumulated duration spent on completing one frame of image in the target application, and m is a positive integer;
acquiring a first number of completion durations corresponding to the ith duration interval;
and when the proportion of the first number in the m completion time lengths is not less than a preset proportion threshold value, respectively associating the ith time length interval to the nth time length interval with n-i +1 resource increments.
5. The method according to claim 4, wherein the resource increment corresponding to the ith duration interval is smaller than the resource increment corresponding to the (i +1) th duration interval, the (i +1) th duration interval is a duration interval adjacent to the ith duration interval, and any one of the duration values in the (i +1) th duration interval is larger than any one of the duration values in the ith duration interval.
6. The method of claim 2, wherein the determining the resource increment corresponding to the first time interval according to the scheduling policy data comprises:
and when the duration corresponding to the left endpoint of the first time duration interval is not less than the frame length of the target frame, determining the maximum resource increment in the scheduling strategy data as the resource increment corresponding to the first time duration interval.
7. The method of any of claims 1 to 6, further comprising:
acquiring a target application to which the target task belongs, wherein the target application is an application to which the target frame belongs;
when the target application belongs to a first application calibrated in advance, determining a first resource increment corresponding to the first time interval according to a first strategy corresponding to the first application, wherein the first application is an application with a load not less than a preset load in operation;
and when the target application belongs to a second application calibrated in advance, determining a second resource increment corresponding to the first time interval according to a second strategy corresponding to the second application, wherein the load of the second application in operation is smaller than the preset load.
8. The method according to any one of claims 1 to 6, wherein the performing resource scheduling on the target task according to the resource increment corresponding to the target task includes:
acquiring an operation identifier of the target task, wherein the operation identifier is used for indicating whether the target task is in an operation state;
and when the running identifier indicates that the target task is in a running state, performing resource scheduling on the target task according to the resource increment corresponding to the target task.
9. The method according to any one of claims 1 to 6, wherein the performing resource scheduling on the target task according to the resource increment corresponding to the target task includes:
creating a first resource management group, wherein the first resource management group is used for scheduling resources according to a preset first resource;
placing the target task in the first resource management group;
and when the target task is subjected to resource scheduling by the terminal according to the resource increment corresponding to the target task, performing resource scheduling according to a first resource and the resource increment corresponding to the target task through the first resource management group, wherein the first resource is a resource which is subjected to permission scheduling by the first resource management group.
10. The method of claim 9, further comprising:
creating a second resource management group for scheduling the resources according to a predetermined second resource, the second resource being a resource other than a key resource included in the first resource;
placing the heavily loaded task in the second resource management group;
and when the heavy load task runs, scheduling the second resource through the second resource management group.
11. An apparatus for scheduling resources, the apparatus comprising:
the time length obtaining module is used for obtaining the current running time length of a target task when a target frame is rendered, wherein the target task is used for rendering the target frame or used for supporting the rendering of the target frame, and the running time length is the accumulated running time length of the target task when the target frame is rendered by a terminal;
the time length obtaining module is further configured to determine a first time length interval in which the current running time length of the target task is located;
an increment determining module, configured to determine, according to scheduling policy data and the first time interval, a resource increment corresponding to the target task; the scheduling policy data is used for indicating a corresponding relation between the resource increment and the first time length interval, the scheduling policy data stores an association relation between an ith time length interval and an nth time length interval, which are respectively associated with n-i +1 resource increments, the n time length intervals are obtained by dividing the frame length corresponding to the target frame, n is a positive integer, and i is an integer not less than 1 and not more than n;
and the resource scheduling module is used for scheduling the resources of the target task according to the resource increment corresponding to the target task.
12. A terminal, characterized in that the terminal comprises a processor, a memory connected to the processor, and program instructions stored on the memory, which when executed by the processor implement the method of scheduling resources according to any of claims 1 to 10.
13. A computer readable storage medium having stored thereon program instructions which, when executed by a processor, implement a method of scheduling resources according to any one of claims 1 to 10.
CN201910824338.1A 2019-09-02 2019-09-02 Method, device, terminal and storage medium for scheduling resources Active CN110532100B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910824338.1A CN110532100B (en) 2019-09-02 2019-09-02 Method, device, terminal and storage medium for scheduling resources

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910824338.1A CN110532100B (en) 2019-09-02 2019-09-02 Method, device, terminal and storage medium for scheduling resources

Publications (2)

Publication Number Publication Date
CN110532100A CN110532100A (en) 2019-12-03
CN110532100B true CN110532100B (en) 2022-04-15

Family

ID=68666339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910824338.1A Active CN110532100B (en) 2019-09-02 2019-09-02 Method, device, terminal and storage medium for scheduling resources

Country Status (1)

Country Link
CN (1) CN110532100B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240817B (en) * 2020-01-06 2024-04-09 北京小米移动软件有限公司 Resource scheduling method, resource scheduling device and storage medium
CN111611516B (en) * 2020-04-11 2023-04-18 上海淇玥信息技术有限公司 Resource allocation method and device and electronic equipment
CN115237583A (en) * 2021-04-22 2022-10-25 华为技术有限公司 Computing resource scheduling method and device
CN113849384B (en) * 2021-08-27 2023-07-25 苏州浪潮智能科技有限公司 Method and device for determining test duration of background task of RAID (redundant array of independent disks) system
CN116932230B (en) * 2023-09-15 2023-12-08 湖南马栏山视频先进技术研究院有限公司 Video rendering method based on dynamic task scheduling

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109032793A (en) * 2018-07-11 2018-12-18 Oppo广东移动通信有限公司 Method, apparatus, terminal and the storage medium of resource distribution
CN109074303A (en) * 2017-06-27 2018-12-21 华为技术有限公司 A kind of Caton detection method and device
CN109471727A (en) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 A kind of task processing method, apparatus and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7075541B2 (en) * 2003-08-18 2006-07-11 Nvidia Corporation Adaptive load balancing in a multi-processor graphics processing system
US8199158B2 (en) * 2008-06-11 2012-06-12 Intel Corporation Performance allocation method and apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109074303A (en) * 2017-06-27 2018-12-21 华为技术有限公司 A kind of Caton detection method and device
CN109032793A (en) * 2018-07-11 2018-12-18 Oppo广东移动通信有限公司 Method, apparatus, terminal and the storage medium of resource distribution
CN109471727A (en) * 2018-10-29 2019-03-15 北京金山云网络技术有限公司 A kind of task processing method, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
分布式实时渲染中帧同步的实现;王海峰等;《微计算机应用》;20071031;第28卷(第10期);全文 *

Also Published As

Publication number Publication date
CN110532100A (en) 2019-12-03

Similar Documents

Publication Publication Date Title
CN110532100B (en) Method, device, terminal and storage medium for scheduling resources
US10628216B2 (en) I/O request scheduling method and apparatus by adjusting queue depth associated with storage device based on hige or low priority status
CN106569891B (en) Method and device for scheduling and executing tasks in storage system
US9898338B2 (en) Network computer system and method for dynamically changing execution sequence of application programs
Nguyen et al. Reducing smartphone application delay through read/write isolation
CN111737019B (en) Method and device for scheduling video memory resources and computer storage medium
CN107766160B (en) queue message processing method and terminal equipment
WO2020119029A1 (en) Distributed task scheduling method and system, and storage medium
CN109445941B (en) Method, device, terminal and storage medium for configuring processor performance
US10592107B2 (en) Virtual machine storage management queue
CN112486642A (en) Resource scheduling method and device, electronic equipment and computer readable storage medium
CN110795323A (en) Load statistical method, device, storage medium and electronic equipment
CN111597044A (en) Task scheduling method and device, storage medium and electronic equipment
US10042659B1 (en) Caching virtual contexts for sharing of physical instances of a hardware resource
CN111464331A (en) Control method and system for thread creation and terminal equipment
CN111274010A (en) Data control method and device, electronic equipment and storage medium
EP3188026B1 (en) Memory resource management method and apparatus
CN111831442A (en) Resource allocation method, device, storage medium and electronic equipment
US11360702B2 (en) Controller event queues
CN115756866A (en) Load balancing method, device and storage medium
TWI712890B (en) Method and apparatus for performing task-level cache management in electronic device
CN112799805A (en) Scheduling method and device based on terminal equipment, storage medium and terminal equipment
CN114157717A (en) Micro-service dynamic current limiting system and method
CN114661415A (en) Scheduling method and computer system
CN115048209A (en) CPU scheduling method, device, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant