CN110532100A - Dispatch method, apparatus, terminal and the storage medium of resource - Google Patents

Dispatch method, apparatus, terminal and the storage medium of resource Download PDF

Info

Publication number
CN110532100A
CN110532100A CN201910824338.1A CN201910824338A CN110532100A CN 110532100 A CN110532100 A CN 110532100A CN 201910824338 A CN201910824338 A CN 201910824338A CN 110532100 A CN110532100 A CN 110532100A
Authority
CN
China
Prior art keywords
resource
duration
increment
goal task
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.)
Granted
Application number
CN201910824338.1A
Other languages
Chinese (zh)
Other versions
CN110532100B (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

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 present application discloses a kind of method, apparatus, terminal and storage medium for dispatching resource, belong to field of computer technology, the method of scheduling resource provided in this embodiment, it can be during post-processing object frame, the operation duration for obtaining goal task determines corresponding resource increment according to the operation duration, when goal task is in operating status, scheduling of resource is carried out according to resource increment.Wherein, goal task is for rendering the target frame or for supporting to render the target frame, and operation duration is the duration that goal task adds up operation in terminal post-processing object frame.Since the application monitors the operation duration of goal task during post-processing object frame, it enables the terminal to grasp rendering duration situation in real time in the render process of target frame, when preceding and possible Caton occurs for Caton, obtain corresponding resource increment, and scheduling of resource is carried out, realize the effect for efficiently avoiding Caton.

Description

Dispatch method, apparatus, terminal and the storage medium of resource
Technical field
The invention relates to field of computer technology, in particular to a kind of method, apparatus for dispatching resource, terminal and Storage medium.
Background technique
During terminal needs to show image, image data is rendered into picture frame by terminal, and by the figure after rendering As frame is displayed on the screen, to complete the display work of image.
In some possible implementations, terminal is possible to because rendered image data not in time, causes terminal can not Picture frame is displayed on the screen in time, forms frame losing.After terminal frame losing, the video or animation that terminal is shown will generate card .
Summary of the invention
The embodiment of the present application provides a kind of method, apparatus, terminal and storage medium for dispatching resource.The technical solution It is as follows:
According to the one side content of the application, a kind of method for dispatching resource is provided, which comprises
When post-processing object frame, the operation duration of goal task is obtained, the goal task is for rendering the target frame Or for supporting to render the target frame, the operation duration is that the goal task is accumulative when terminal renders the target frame The duration of operation;
According to the operation duration, corresponding resource increment is determined;
Scheduling of resource is carried out according to the resource increment.
According to the another aspect content of the application, a kind of device for dispatching resource is provided, described device includes:
Duration obtains module, and for when post-processing object frame, obtaining the operation duration of goal task, the goal task is used In rendering the target frame or rendering the target frame for support, the operation duration is that the goal task is rendered in terminal Add up the duration of operation when the target frame;
Increment determining module, for determining corresponding resource increment according to the operation duration;
Scheduling of resource module, for carrying out scheduling of resource according to the resource increment.
According to the another aspect content of the application, a kind of terminal is provided, the terminal includes processor and memory, institute It states and is stored at least one instruction in memory, described instruction is loaded by the processor and executed to realize that the application such as is implemented The method of the scheduling resource of offer.
According to the another aspect content of the application, a kind of computer readable storage medium is provided, in the storage medium It is stored at least one instruction, described instruction is loaded by processor and executed to realize that the application such as implements the scheduling resource provided Method.
Technical solution bring beneficial effect provided by the embodiments of the present application may include:
The technical program can obtain the operation duration of goal task during post-processing object frame, according to the operation Duration determines corresponding resource increment, when goal task is in operating status, carries out scheduling of resource according to resource increment.Its In, goal task is for rendering the target frame or for supporting to render the target frame, and operation duration is goal task at end Add up the duration of operation when holding post-processing object frame.Due to technical solution provided by the present application during post-processing object frame to mesh The operation duration of mark task is monitored, and is avoided terminal in the prior art and is being read after the completion of target frame is rendered The phenomenon that just discovery target frame can not read, cause Caton when the target frame, enables the terminal to the render process in target frame In in real time grasp rendering duration situation obtain corresponding resource increment in the case where may cause the operation duration of Caton, and Scheduling of resource is carried out, realizes and increases resource increment in advance before Caton generation, efficiently avoid Caton.
Detailed description of the invention
It, below will be to institute in the embodiment of the present application description in order to more clearly introduce the technical solution in the embodiment of the present application Attached drawing to be used is needed to be briefly described, it should be apparent that, the accompanying drawings in the following description is only some implementations of the application Example, for those of ordinary skill in the art, without creative efforts, can also obtain according to these attached drawings Obtain other attached drawings.
Fig. 1 is a kind of structural block diagram for terminal that one exemplary embodiment of the application provides;
Fig. 2 is a kind of flow chart of the method for scheduling resource that one exemplary embodiment of the application provides;
Fig. 3 is a kind of method flow diagram for scheduling resource that another exemplary embodiment of the application provides;
Fig. 4 is distribution map and the matched curve of a kind of goal task runing time provided based on embodiment illustrated in fig. 3;
Fig. 5 is distribution map and the matched curve of another goal task runing time provided based on embodiment illustrated in fig. 3;
Fig. 6 is the flow chart for the part steps that the method based on scheduling resource shown in Fig. 3 provides;
Fig. 7 is the flow chart for the part steps that the method based on scheduling resource shown in Fig. 3 provides;
Fig. 8 is the structural block diagram of the device for the scheduling resource that one exemplary embodiment of the application provides.
Specific embodiment
To keep the purposes, technical schemes and advantages of the application clearer, below in conjunction with attached drawing to the application embodiment party Formula is described in further detail.
In the following description when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different attached drawings indicate same or similar Element.Embodiment described in following exemplary embodiment does not represent all embodiment party consistent with the application Formula.On the contrary, they are only the device and side consistent with some aspects as detailed in the attached claim, the application The example of method.
In the description of the present application, it is to be understood that term " first ", " second " etc. are used for description purposes only, without It can be interpreted as indication or suggestion relative importance.In the description of the present application, it should be noted that unless otherwise specific regulation And restriction, term " connected ", " connection " shall be understood in a broad sense, for example, it may be being fixedly connected, may be a detachable connection, Or it is integrally connected;It can be mechanical connection, be also possible to be electrically connected;It can be directly connected, intermediary can also be passed through It is indirectly connected.For the ordinary skill in the art, the tool of above-mentioned term in this application can be understood with concrete condition Body meaning.In addition, unless otherwise indicated, " multiple " refer to two or more in the description of the present application."and/or" is retouched The incidence relation of affiliated partner is stated, indicates may exist three kinds of relationships, for example, A and/or B, can indicate: individualism A, together When there are A and B, these three situations of individualism B.Character "/" typicallys represent the relationship that forward-backward correlation object is a kind of "or".
For scheme shown in the embodiment of the present application it can be readily appreciated that below to several nouns occurred in the embodiment of the present application into Row is introduced.
Target frame: can be a picture frame for display, which may belong to target application.Work as target application At runtime, target application needs show picture in screen, may include animation or video in picture.When target application needs When showing animation or video in screen, terminal can continuously display multiple target frames, by the side for continuously displaying target frame Formula forms animation or video.In one possible implementation, if target application shows that the frame number of animation or video is 60, Then target application will continuously display 60 frame target frames in 1 second.Each frame target frame needs to first pass through rendering process, by rendering Target frame after process will be stored in buffering queue.Terminal can from buffering queue read by rendering after target frame, And the target frame is displayed on the screen according to the sequence of reading.
Goal task: being the task for post-processing object frame, alternatively, being the task for supporting post-processing object frame.
In a kind of possible embodiment, goal task may belong to target application, which is target application One task of middle offer.Optionally, goal task can be one in specified process, thread or task, the application Embodiment is without limitation.
Optionally, goal task can be logic thread, rendering thread, the asynchronous load thread of resource, close with render process Cut associated system task, and at least one of with the system task of render process close association.Wherein, close with render process Cutting associated system task can be system server and surfaceflinger.
In alternatively possible embodiment, goal task is for post-processing object frame.When target application only includes When logic thread, if the logic thread includes the function for post-processing object frame, logic thread is current goal task.When When including rendering thread in target application, which will be used as goal task.
In a kind of possible embodiment, terminal has the ability of identification goal task.Optionally, terminal can be preparatory Save the feature of goal task, such as the mark of goal task, terminal is by the mark of identification goal task from target application packet Goal task is determined in containing for task.Terminal can target application run when, the task in the target application is identified, Determine the goal task in the target application.
Operation duration: refer to that goal task adds up the duration of operation in terminal post-processing object frame.In a kind of possible mode In, whether terminal is in operating status by monitoring objective task in post-processing object frame, when goal task is in operating status When, terminal will record the duration of goal task operation, and during target frame is rendered, goal task renders mesh in terminal The duration of accumulative operation will be all recorded when marking frame.
Resource increment: it is used to indicate the incremental portion for the hardware resource specified in terminal.It should be noted that terminal middle finger Fixed hardware resource is to be used to indicate to provide resource provided by the hardware component of support for goal task.Optionally, hardware provides Source may include computing hardware resource, storage hardware resource and I/O hardware resource.
On the one hand, for computing hardware resource, computing hardware resource may include central processor CPU resource, figure Shape processor GPU resource or embedded neural network processor NPU resource etc. have the chip of computing capability.It needs to illustrate It is, either CPU, GPU or NPU that can integrate multiple cores, can also includes that computing capability has area in multiple cores Other first core and the second core.For example, the computing capability of the first core is better than the computing capability of the second core.One kind can In the naming method of energy, the first core can be referred to as big core, and the second core can be referred to as small nut.It is needed jointly in multiple tasks When using a core, terminal can realize the scheduling of computing hardware resource by modes such as clock terminals.
For example, when resource increment includes computing hardware resource, which can be increased using processor One of the stronger core of duration, processing capacity or additional increased core.
On the other hand, for storage hardware resource, storage hardware resource generally includes memory and external memory.One kind can In the implementation of energy, memory can be random access storage device RAM, and terminal is to access memory by system bus.Terminal It is that external memory is accessed by the port I/O of standard.
For example, the resource increment can be increased memory size or outer when resource increment includes storage hardware resource Deposit one of capacity.
On the other hand, for I/O hardware resource, I/O hardware resource includes I/O interface chip and I/O Interface Controller Card.Wherein, I/O interface chip is mostly integrated circuit, and for inputting different order and parameter by CPU, control is related I/O circuit and be provided as corresponding operation outside.For example, common interface chip such as timer conter, interrupt control unit, DMA (English Text: Direct Memory Access, Chinese: direct memory access) controller and parallel interface etc..I/O interface control card by Several integrated circuits become a component by certain logical groups, are perhaps directly arranged with CPU on mainboard or as one A plug-in unit is plugged in system bus slot.
For example, the resource increment can be the I/O frequency for increasing and allowing to call when resource increment includes I/O hardware resource Rate.
Illustratively, the method that resource is dispatched shown in the embodiment of the present application, can be using in the terminal, which has Display screen and the function of having scheduling resource.Terminal may include mobile phone, tablet computer, laptop computer, desktop computer, computer All-in-one machine, server, work station, TV, set-top box, smart glasses, smart watches, digital camera, MP4 playback terminal, MP5 are broadcast Terminal, learning machine, point reader, electric paper book, electronic dictionary, car-mounted terminal, virtual reality (Virtual Reality, VR) is put to broadcast Put terminal or augmented reality (Augmented Reality, AR) playback terminal etc..
Referring to FIG. 1, Fig. 1 is the structural block diagram for the terminal that one exemplary embodiment of the application provides, as shown in Figure 1, The terminal includes processor 120 and memory 140, at least one instruction is stored in the memory 140, described instruction is by institute The method for stating the scheduling resource that processor 120 is loaded and executed with realization as described in each embodiment of the method for the application.Optionally, Terminal 100 further includes display component 160, and display component 160 can show the target frame after rendering.
In this application, terminal 100 is the electronic equipment for having the function of post-processing object frame.When 100 post-processing object of terminal When frame, terminal 100 can obtain the operation duration of goal task, which is for post-processing object frame or for supporting wash with watercolours Target frame is contaminated, operation duration is the duration that goal task adds up operation in terminal post-processing object frame;When terminal will be according to operation It is long, it determines corresponding resource increment, scheduling of resource is carried out according to resource increment.
Processor 120 may include one or more processing core.Processor 120 utilizes various interfaces and connection Various pieces in entire terminal 100, by running or executing the instruction being stored in memory 140, program, code set or refer to Collection is enabled, and calls the data being stored in memory 140, executes the various functions and processing data of terminal 100.Optionally, Processor 120 can use Digital Signal Processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), programmable logic array (Programmable Logic Array, PLA) at least one of example, in hardware realize.Processor 120 can integrating central processor (Central Processing Unit, CPU), in image processor (Graphics Processing Unit, GPU) and modem etc. One or more of combinations.Wherein, the main processing operation system of CPU, user interface and application program etc.;GPU is for being responsible for The rendering and drafting of content to be shown needed for display screen;Modem is for handling wireless communication.On it is understood that Stating modem can not also be integrated into processor 120, be realized separately through chip piece.
Memory 140 may include random access memory (Random Access Memory, RAM), also may include read-only Memory (Read-Only Memory).Optionally, which includes non-transient computer-readable medium (non- transitory computer-readable storage medium).Memory 140 can be used for store instruction, program, generation Code, code set or instruction set.Memory 140 may include storing program area and storage data area, wherein storing program area can store Instruction for realizing operating system, the instruction at least one function (such as touch function, sound-playing function, image Playing function etc.), for realizing instruction of following each embodiments of the method etc.;It is real that storage data area can store following each method Apply the data etc. being related in example.
Display component 160, can be display screen, the display screen can be LED (English: Light Emitting Diode, Chinese: light emitting diode) display, projecting subassembly or OLED (English: OrganicLight-Emitting Diode, Chinese: Organic Electricity laser display) display.It should be noted that may include display component 160 in terminal 100.Alternatively possible Mode in, can only include processor 120 and memory 140 in terminal 100, display component 160 connects as independent equipment It receives terminal 100 and completes the target frame of rendering, and show the target frame.For example, terminal 100 can be TV set-top box, computer master Exemplary illustration is only done at the computer equipments such as machine or car-mounted terminal, this place, not to the possible form stroke of terminal 100 in the application It limits.
Referring to FIG. 2, Fig. 2 is the flow chart of the method for the scheduling resource that one exemplary embodiment of the application provides.It should The method of scheduling resource can be applied in the terminal shown in above-mentioned.In Fig. 2, the method for dispatching resource includes:
Step 210, when post-processing object frame, the operation duration of goal task is obtained, goal task is used for post-processing object frame Or for supporting post-processing object frame, operation duration is the duration that goal task adds up operation in terminal post-processing object frame.
It in the embodiment of the present application, can be with operational objective task in terminal.In goal task operation, terminal can be completed The rendering work of one target frame.If frame length also determines immediately when the frame per second of the target application of displaying target frame determines.Example Such as, the frame per second of target application is 50 frames, then the frame length of target frame is 20 milliseconds.20 milliseconds of the every mistake of terminal, by a frame image refreshing Into display component.If terminal is after the completion of previous frame target frame is shown, next frame target does not render finish yet, then terminal is shown Picture Caton can occur.
In the embodiment of the present application, the longest duration that terminal renders each frame target frame can be frame length.If terminal renders When the duration of target frame is longer than frame length, Caton can then occur for terminal.Therefore, the application devises a kind of scheme, can be in terminal During starting post-processing object frame, the operation duration of goal task is obtained in real time.Wherein, goal task is for post-processing object Frame or for supporting post-processing object frame, operation duration is the duration that goal task accumulates operation in terminal post-processing object frame.
Step 220, according to operation duration, corresponding resource increment is determined.
In the embodiment of the present application, terminal can determine corresponding money according to operation duration after getting operation duration Source increment.It should be noted that resource increment indicated by the application can be a kind of increment of hardware resource, it is also possible to more The increment of kind hardware resource.
In a kind of possible mode, if resource increment is a kind of increment of hardware resource, terminal can be according to preparatory The operation duration of calibration and the corresponding relationship of resource increment, determine the corresponding resource increment of operation duration.For example, referring to table One.
Table one
Operation duration (8ms, 12ms] (12ms, 16ms] (16ms, 20ms] (20ms ,+∞]
Resource increment Increase by 30% Increase by 60% Increase by 90% Increase by 100%
In the data shown in table one, operation duration is divided into four duration sections.First duration section be (0, 7ms], second duration section be (7ms, 14ms], third duration section be (14ms, 20ms] and the 4th duration section Be (20ms ,+∞].Each duration section is corresponding with a resource increment, which can be with current goal application Used stock number is radix, determines specific resource increment.
For example, if stock number is memory size, and the memory that current goal task occupies holds in a kind of possible mode Amount is 200MB.In this case, if the current operation duration of goal task is 9ms, the operation duration fall in (8ms, 12ms] In section, the resource increment of terminal check goal task is increase by 30%, namely the memory size occupied in current goal task Increase by 30% on the basis of 200MB, increases 60MB memory size.In the data shown in table one, operation duration and resource increment Between relationship can be what developer demarcated in advance, be also possible to terminal according to the statistical data of operation duration, Jin Ershi When safeguard and calibration.
Optionally, in the implementation shown in table one, place of the operation duration no more than 8 milliseconds (i.e. 8ms) when is not shown Manage situation.In a kind of possible embodiment of the application, when length is less than lowest threshold when running, it is believed that at goal task In normal working condition, new resource increment is not increased at this time for goal task.
It should be noted that the adjustment mode shown in table one is merely illustrative the application when can be for different operations It is long that corresponding resource increment is provided, the specific value of operation duration in the application and resource increment is not defined.One In the possible mode of kind, operation duration cutting can also be smaller granularity by terminal, and the operation duration after cutting respectively corresponds to Different resource increments.
Step 230, scheduling of resource is carried out according to resource increment.
In the embodiment of the present application, terminal can carry out scheduling of resource according to resource increment after getting resource increment.
In one possible implementation, terminal will directly carry out scheduling of resource according to resource increment.For example, working as target The memory size that task occupies originally is 200MB, and the resource increment that terminal determines is 60MB memory size, then terminal newly increases 60MB memory size distributes to goal task.
In alternatively possible implementation, terminal will be according to the scheduling of resource plan of resource increment combination system entirety Slightly, scheduling of resource is carried out for subject thread.For example, when the memory size that goal task occupies originally is 200MB, what terminal determined Resource increment is 60MB memory size, then goal task is needed the money of the memory size combination system entirety of newly-increased 60MB by terminal Source scheduling strategy is scheduled.Optionally, the resource dispatching strategy of system entirety can be according to the task of present application resource Weight is arranged for each resource in priority.Terminal is that goal task is new from current system surplus resources according to the weight of resource Dispatch resource.For example, current system residue 150MB memory size, the weight of goal task is 30%, then goal task is according to power The newly-increased memory size that stresses practicability is 45MB.
In conclusion the method for scheduling resource provided in this embodiment, can obtain mesh during post-processing object frame The operation duration of mark task determines corresponding resource increment according to the operation duration, when goal task is in operating status, Scheduling of resource is carried out according to resource increment.Wherein, goal task is for rendering the target frame or for supporting to render the mesh Frame is marked, operation duration is the duration that goal task adds up operation in terminal post-processing object frame.Due to technology provided by the present application Scheme monitors the operation duration of goal task during post-processing object frame, avoids terminal in the prior art and exists After the completion of target frame is rendered, the phenomenon that target frame can not read, cause Caton is just found when reading the target frame, so that Terminal can grasp in real time rendering duration situation in the render process of target frame, in the feelings for the operation duration that may cause Caton Under condition, corresponding resource increment is obtained, and carry out scheduling of resource, realizes and increase resource increment in advance before Caton generation, Efficiently avoid Caton.
Based on scheme disclosed in upper one embodiment, terminal can also pass through the history of terminal self-operating goal task Situation actively demarcates the relationship of operation duration and resource increment, and according between calibrated operation duration and resource increment Relationship determines resource increment, according to the resource increment, please refers to following examples.
Fig. 3 is referred to, Fig. 3 is the method flow diagram for the scheduling resource that another exemplary embodiment of the application provides.It should The method of scheduling resource can be applied in the terminal shown in above-mentioned.In Fig. 3, the method for the scheduling resource includes:
Step 310, when post-processing object frame, the operation duration of goal task is obtained.
In the embodiment of the present application, the implementation procedure of step 310 and the implementation procedure of step 210 are identical, no longer superfluous herein It states.
Step 321, the first duration section where operation duration is determined.
In the embodiment of the present application, terminal can determine the operation duration after the operation duration for obtaining goal task The first duration section at place.It should be noted that the duration section can be predetermined duration section, terminal can be incited somebody to action The operation duration of goal task and predetermined duration section are compared, and long numerical value belongs to a duration area when running Between it is middle when, terminal can by this include operation duration duration section be determined as the first duration section.
In the embodiment of the present application, terminal can execute step (a1), step (a2), step after executing completion step 321 Suddenly (a3), step (a4), step (a5) and step (a6), to update or create scheduling strategy data.Terminal is executing completion After step (a6), step 322 can be executed.
Wherein, the implementation procedure of step (a1) to step (a6) is as follows:
Step (a1) determines frame length when target application operation, and target application is application belonging to target frame.
In the embodiment of the present application, terminal determines frame length when target application is run, which is belonging to target frame Application.It should be noted that terminal can identify the figure for currently carrying out rendering work in the actual application of the application As the source of frame namely terminal can obtain the mark of target application belonging to the picture frame.It is determined when by the mark of application When the picture frame being rendered is the target frame in target application, frame length when target application operation is determined.
In a kind of possible mode, frame length is used to indicate the length of each frame, in frame length=unit time/unit time Frame number.For example, when the frame number in unit time is 50, frame length is 20 milliseconds when unit time is 1 second.
Frame length, is divided into the duration section of n equal length by step (a2), and n is positive integer.
In the embodiment of the present application, frame length is divided into the duration section of n equal length by terminal, and n is positive integer.It needs Bright, n is the positive integer not less than 2.Since subsequent step needs count a large amount of data, it is therefore desirable to by duration Section is divided into the section of equal length, so that the data that statistics obtains represent meaning.For example, when the target where target frame is answered When frame length is 20 milliseconds, target application will show the target frame of 50 frames in 1 second, will show 30000 frames at 10 minutes Target frame.
Step (a3), m for counting goal task complete the data that duration is distributed in duration section, complete duration for referring to Show goal task, the accumulative duration spent when the frame image in target application is completed in processing, and m is positive integer.
In the embodiment of the present application, the data that terminal completes m that counts goal task duration and be distributed in duration section. It should be noted that m is completed duration and refers to accumulative when the frame image in target application is completed in goal task processing spend Duration, m is also positive integer.
In one possible implementation, when goal task renders a target frame, which will be one corresponding Complete duration.For example, referring to table two.
Table two
Target frame Target frame g1 Target frame g2 Target frame g3 Target frame g4
Complete duration 12 milliseconds 10 milliseconds 13 milliseconds 9 milliseconds
In the data shown in table two, when the completion duration that terminal is in post-processing object frame g1, and goal task accumulation consumes It is 12 milliseconds, to complete to be directed to the rendering work of target frame g1.When terminal is when rendering another target frame g2, goal task is accumulated The completion duration of consumption is 10 milliseconds, to complete to be directed to the rendering work of target frame g2.When terminal is rendering another target frame g3 When, the completion duration of goal task accumulation consumption is 13 milliseconds, to complete to be directed to the rendering work of target frame g3.When terminal is in wash with watercolours When contaminating another target frame g4, the completion duration of goal task accumulation consumption is 9 milliseconds, to complete to be directed to the rendering work of target frame g4 Make.
If duration section include (8ms, 12ms] and (12ms, 16ms], then terminal determining target frame g1, mesh in this step Mark frame g2 and target frame g4 completion duration each fall within duration section (8ms, 12ms], determine that the completion duration of target frame g3 is fallen into Duration section (12ms, 16ms].
It should be noted that target frame shown in table two is merely illustrative with the relationship of corresponding duration.In practical behaviour During work, duration section can be divided into smaller particle size.For example, duration section can be with if frame length is 16.7 milliseconds 17 microseconds are the siding-to-siding block length in a duration section, are divided to 16.7 milliseconds of frame length.
Referring to figure 4., Fig. 4 be based on embodiment illustrated in fig. 3 provide a kind of goal task runing time distribution map and Matched curve.Similar, referring to figure 5., Fig. 5 is another goal task runing time provided based on embodiment illustrated in fig. 3 Distribution map and matched curve.In figures 4 and 5, ordinate is the probability of the operation duration of goal task, and abscissa is operation The time span of duration.
In the example depicted in fig. 4, which is millisecond.It should be noted that goal task shown in Fig. 4 be with The data of statistics acquisition are carried out for the logic thread of game class application A.
In the example depicted in fig. 5, which is millisecond.It should be noted that goal task shown in fig. 5 be with The data of statistics acquisition are carried out for the logic thread of game class application B.
Step (a4), obtains corresponding the first number for completing duration in the i-th duration section, and i is no less than 2 and no more than n Integer.
In the embodiment of the present application, terminal can obtain corresponding the first number for completing duration in the i-th duration section, In, i is no less than 2 and is not more than the integer of n.In this step, when terminal will acquire the corresponding completion in each duration section Long number.For example, if duration section be divided into (8ms, 12ms], (12ms, 16ms], (16ms, 20ms] and (20ms ,+∞], And the sum of the target frame counted is 10000 frames.Then terminal can be counted and be fallen in each duration section in this step First number, details can be found in table three.
Table three
Duration section (8ms, 12ms] (12ms, 16ms] (16ms, 20ms] (20ms ,+∞]
First number 3500 1000 500 120
Resource increment Increase by 30% Increase by 60% Increase by 90% Increase by 100%
The data as shown in table three it is found that in the 10000 frame target frames counted, have the target frame of 3500 frames it is processed when, The operation duration of goal task be in (8ms, 12ms].Similar, corresponding first number in four sections counted in table three Sum be 5120 frames, that is, the first number of the corresponding target frame of operation duration in [0,8ms] is 4880 frames.
Step (a5), when the first number accounts for the ratio of m completion duration not less than preset ratio threshold value, by the i-th duration Section to the n-th duration section is associated with (n-i+1) a resource increment respectively.
In the embodiment of the present application, preset ratio threshold value can be the numerical value being previously set in the terminal, when some duration When corresponding first number in section accounts for the ratio of m completion duration not less than preset ratio threshold value, terminal by the i-th duration section extremely N-th duration section is associated with (n-i+1) a resource increment respectively.
With data instance shown in table three, when preset ratio threshold value is 30%, duration section (8ms, 12ms] corresponding the One number 3500 account for 10000 ratio be more than this 30%, terminal by duration section (8ms, 12ms], (12ms, 16ms], (16ms, 20ms] and (20ms ,+∞] it is determined as being associated with (n-i+1) a resource increment respectively, the data after association can be found in table Four.
Table four
In the embodiment that the data shown in table four are supported, the i-th duration section is the 2nd duration section, and the n-th duration section is the 5 duration sections, (n-i+1) a resource increment are 4 resource increments, are increase by 30% shown in table four respectively, increase by 60%, increase Add 90% and increases by 100% 4 resource increment.
Step (a6), by the i-th duration section to the n-th duration section respectively with (n-i+1) a associated association of resource increment Relationship is saved to scheduling strategy data.
In the embodiment of the present application, terminal can by the i-th duration section to the n-th duration section respectively with (n-i+1) a money The associated incidence relation of source increment, and above-mentioned incidence relation is stored in scheduling strategy data.
It should be noted that in the embodiment of the present application, the corresponding resource increment in the i-th duration section is less than i+1 duration The corresponding resource increment in section, i+1 duration section are the adjacent duration sections in the i-th duration section, and in i+1 duration section Any one duration value is greater than any one duration value in the i-th duration section.
In one possible implementation, with the growth of the operation duration of goal task, target frame fails in frame length Time in rendering complete a possibility that increase, the probability for Caton occur also increases.Therefore, the i-th duration section and i+1 The corresponding resource increment in duration section will be stepped up.For example, the 2nd duration section (namely duration section (8ms, 12ms]) it is corresponding Resource increment be increase by 30%, the 3rd duration section adjacent thereto (namely duration section (12ms, 16ms]) corresponding resource Increment is increase by 60%, and the corresponding resource increment in the 2nd duration section will resource increment corresponding less than the 3rd duration section.
Step 322, according to scheduling strategy data, the corresponding resource increment in the first duration section is determined.
In the embodiment of the present application, scheduling strategy data are used to indicate resource increment and the corresponding of the first duration section is closed System.In the case where terminal determines the first duration, terminal can unambiguously determine corresponding resource increment.
In the alternatively possible implementation of the embodiment of the present application, terminal can be by executing step (b1) Lai Shixian It is operated shown in step 321, by being operated shown in execution step (b2), step (b3) and step (b4) Lai Shixian step 322.
Step (b1), length is not less than the left end point in the first duration section and is not less than the right side in the first duration section when running When endpoint, the duration section where determining operation duration is the first duration section.
In the embodiment of the present application, for example, when length is 10 milliseconds when running, 10 milliseconds not less than the 2nd duration section 8 milliseconds of left end point, when less than 12 milliseconds of right endpoint of the 2nd duration section, determine that operation duration is the duration area where 10 milliseconds Between be the first duration section (8ms, 12ms].
Step (b2) determines whether the first duration section is corresponding with resource increment according to scheduling strategy data.
In the embodiment of the present application, terminal can determine whether the first duration section is corresponding with according to policy data is fallen on the ground Resource increment.
In a kind of possible mode, based on scene shown in step (b1), terminal can determine the first duration section (8ms, 12ms] whether it is corresponding with resource increment.If based on data shown in table four, and the first duration section (8ms, 12ms] it is corresponding There is resource increment to increase by 30%.
Step (b3) determines resource increment when the first duration section is corresponding with resource increment.
In the application illustrated embodiment, when the first duration section is corresponding with resource increment, terminal can determine that resource increases Amount.
Resource increment is determined as null value when the first duration section not corresponding resource increment by step (b4).
In the application illustrated embodiment, when the first duration section not corresponding resource increment, resource increment is determined as Control.In one possible implementation, data shown in table four are referred to, when the first duration section is (0,8ms] when, this when The resource increment is not determined as null value by corresponding resource increment, terminal in long section.
In the alternatively possible implementation of the embodiment of the present application, terminal can realize step by executing step c It is operated shown in rapid 322.
Step c, when the corresponding duration of left end point in the first duration section, not less than target frame frame length when, plan will be dispatched Slightly maximum resource increment is determined as the corresponding resource increment in the first duration section in data.
In the application illustrated embodiment, terminal is not less than target in the corresponding duration of left end point in the first duration section When the frame length of frame, resource increment maximum in scheduling strategy data is determined as the corresponding resource increment in the first duration section.
In a kind of possible mode, such as frame length is 16.7 milliseconds.When the first duration section is (20ms ,+∞], this when The corresponding duration of the left end point in long section is 20 milliseconds.In this scene, the corresponding duration of left end point in the first duration section Not less than the frame length of target frame, resource increment maximum in scheduling strategy data (increasing by 100%) is determined as first by terminal The corresponding resource increment in duration section.
Step 323, the corresponding resource increment in the first duration section is determined as the corresponding resource increment of goal task.
In a kind of possible implementation of the embodiment of the present application, terminal can be by executing step (d1), step (d2) and shown in step (d3) Lai Shixian step 323 it operates.
Step (d1) obtains target application belonging to goal task, and target application is application belonging to target frame.
In the embodiment of the present application, target application at runtime, can invocation target task come post-processing object frame or use In the rendering work for supporting target frame.When goal task is called, terminal can obtain target belonging to the goal task and answer With the target application is application belonging to target frame.
Step (d2), when target application belongs to first demarcated in advance in application, applying corresponding first plan according to first Slightly determine corresponding first resource increment, application of load when the first application is operation not less than default load.
In the embodiment of the present application, when target application belongs to first demarcated in advance in application, terminal first applies this Corresponding first strategy determines corresponding first resource increment.It should be noted that load when the first application is operation is not small In the application of default load.In a kind of possible mode, mark of the developer by load not less than the application of default load It saves in the terminal, when the application operation, terminal can identify that the application is the first application according to mark.
Step (d3), when target application belongs to second demarcated in advance in application, applying corresponding second plan according to second Slightly determine corresponding Secondary resource increment, load when the second application is operation is less than the application of default load.
In the embodiment of the present application, the application that load when running is less than default load can be determined as second and answered by terminal With, and corresponding Secondary resource increment is determined by the second strategy.Details can be found in table five.
Table five
In the data shown in table five, the second strategy includes the corresponding duration section of operation duration and resource increment.Root According to present disclosure it is found that first applies with the goal task in the second application at the identical duration section of correspondence, First application of heavier loads can obtain more resource increment.For example, when the operation of the goal task in the first application The operation duration of goal task long and in the second application, belong to duration section (8ms, 12ms], the target in the first application Task can get the resource increment of increase by 30%, and the goal task in the second application can get the resource of increase by 10% Increment.
In a kind of possible implementation of the embodiment of the present application, terminal can be by executing step (e1) and step (e2) it is operated shown in Lai Shixian step 323.
Step (e1), obtains the operation mark of goal task, and operation mark is used to indicate whether goal task is in operation State.
In a kind of possible implementation of the application, terminal can also obtain the operation mark of goal task.It is optional Ground, operation mark can be a marker.Goal task can be within a frame length period according to the reality of hardware resource Situation is called to be run or out of service.
For example, when hardware resource is CPU, goal task can the work in the timeslice for possessing CPU, do not possessing It stops working when the timeslice of CPU.When goal task possesses the timeslice of CPU, the operation of goal task mark can be 1 or It is in operating status to be used to indicate goal task by true.Correspondingly, when goal task does not possess the timeslice of CPU, target The operation mark of task can be 0 or false.
Step (e2) carries out resource tune according to resource increment when operation, which identifies, indicates that goal task is in operating status Degree.
Step 330, scheduling of resource is carried out according to resource increment.
In the embodiment of the present application, the implementation procedure of step 330 and the implementation procedure of step 230 are identical, no longer superfluous herein It states.
For example, being data instance shown in 20 milliseconds and table four with frame length in the possible implementation of the application Be illustrated, when goal task start for a target frame start to process after, if the operation duration of goal task reach 8ms and The goal task remains unfulfilled work, then terminal is to increase by 30% to run for goal task according to resource increment.After increasing resource, Goal task is possible to quickly complete work.If the operation duration of goal task reaches 12ms and the goal task remains unfulfilled work Make, then terminal is to be further added by 30% to run for goal task according to resource increment.Similarly, if the operation duration of goal task reaches The 16ms and goal task remains unfulfilled work, then terminal is further added by 30% according to resource increment and runs for goal task.Hereafter, If the operation duration of goal task reaches 20ms and the goal task remains unfulfilled work, illustrate that terminal has occurred and that Caton, then Terminal is further added by 10% according to resource increment and runs for goal task.
In conclusion the present embodiment can be according to the first duration section where determining operation duration, according to scheduling strategy Data determine the corresponding resource increment in the first duration section, and the corresponding resource increment in the first duration section is determined as target and is appointed It is engaged in corresponding resource increment, when enabling the terminal in goal task post-processing object frame or support the rendering work of target frame, By the first duration section where operation duration, that is, can determine corresponding resource increment, enable terminal according to the resource increment into Row scheduling significantly reduces a possibility that Caton occurs so that terminal is terminal distribution resource before Caton occurs in advance.
The method of scheduling resource provided in this embodiment, additionally it is possible to count goal task for completion each time for target The operation duration of frame processing, according to the statistical conditions of the operation duration of goal task, dynamic adjusts the corresponding resource of operation duration Increment enables this programme dynamically adapting goal task to be easier to the operation duration occurred, so that the application can adapt to mesh The situation of mark task actual motion simultaneously provides corresponding resource increment, and more corresponding resource increment can be had therewith by enabling terminal in real time It adapts to, improves the effect of prevention Caton.
The method of scheduling resource provided in this embodiment, additionally it is possible to when goal task is in operating status, according to resource Increment carries out scheduling of resource, still keeps original resource to run when goal task is not at operating status, enables the system to Resource is accurately dispatched according to resource increment when goal task is run, while guaranteeing reduces terminal Caton risk, is reduced The energy consumption of terminal, extends the standby time of terminal.
Referring to FIG. 6, Fig. 6 is the flow chart for the part steps that the method based on scheduling resource shown in Fig. 3 provides, scheming In 6, terminal can execute including step 301 and step 302 before executing completion step 310, then execute step 310, step Rapid 321, step 322 and step 323, after executing completion step 323, terminal can also execute step 303.Wherein, step 301 are described below to the implementation procedure of step 303:
Step 301, first resource management group is created, first resource management group is provided for dispatching according to scheduled first resource Source.
In the embodiment of the present application, terminal can also first create first resource management group, be carried out by the resource management group Scheduling of resource.It should be noted that the resource management group can be cgroups (English: Control group, Chinese: control Group), which is the subsystem that various system resources are controlled in Linux.
Step 302, goal task is placed in first resource management group.
In the embodiment of the present application, goal task is placed in first resource management group by terminal.When goal task have it is more When a, first resource management group may include multiple goal tasks.
Step 303, when goal task carries out scheduling of resource according to resource increment by terminal, group is managed by first resource Scheduling of resource is carried out according to first resource and resource increment.
In the embodiment of the present application, when goal task carries out scheduling of resource according to resource increment by terminal, pass through first Resource management group carries out scheduling of resource according to first resource and resource increment.It should be noted that first resource is first resource Management group has permission the resource of scheduling.
For example, first resource management group will call the big core of CPU without permission when first resource is CPU small nut.
Referring to FIG. 7, Fig. 7 is the flow chart for the part steps that the method based on scheduling resource shown in Fig. 3 provides, scheming In 7, terminal can execute including step 304 and step 305 before executing completion step 310, then execute step 310, step Rapid 321, step 322 and step 323, after executing completion step 323, terminal can also execute step 306.Wherein, step 304 are described below to the implementation procedure of step 306:
Step 304, Secondary resource management group is created, Secondary resource management group is provided for dispatching according to scheduled Secondary resource Source, Secondary resource are the resource in addition to the keystone resources for including in first resource.
In the embodiment of the present application, terminal can also create Secondary resource management group, the Secondary resource management for according to Scheduled Secondary resource dispatches resource, and Secondary resource is the resource in addition to the keystone resources for including in first resource.For example, working as The keystone resources for including in first resource are big core A and big core B, and Secondary resource can be including big core C, big core D and terminal In remaining small nut.
Step 305, heavy duty task is placed in Secondary resource management group.
In the embodiment of the present application, heavy duty task is placed in Secondary resource management group by terminal, it should be noted that The heavy duty task is the task except goal task.
Step 306, when heavy duty task run, group scheduling Secondary resource is managed by Secondary resource.
In the embodiment of the present application, when heavy duty task run, terminal can manage group scheduling the by Secondary resource Two resources are supported, so that heavy duty task operates normally.
In conclusion being based on Fig. 6 and embodiment shown in Fig. 7, terminal can be arranged different for the task of different demands Resource management group is scheduled accordingly so that resource management group crosses Cheng Qian in rendering image according to the operation duration of task Resource increment realizes before Caton generation, forward scheduling hardware resource, prevents Caton, and can be when goal task is run The scheduling for just carrying out hardware resource, improves the cruise duration of terminal under the premise of preventing Caton.
Following is the application Installation practice, can be used for executing the application embodiment of the method.It is real for the application device Undisclosed details in example is applied, the application embodiment of the method is please referred to.
Referring to FIG. 8, Fig. 8 is the structural block diagram of the device for the scheduling resource that one exemplary embodiment of the application provides. The device of the scheduling resource can by software, hardware or both be implemented in combination with as terminal all or part of.It should Device includes:
Duration obtains module 810, and for when post-processing object frame, obtaining the operation duration of goal task, the target is appointed For rendering the target frame or for supporting to render the target frame, the operation duration is the goal task in terminal for business Render the duration of accumulative operation when the target frame;
Increment determining module 820, for determining corresponding resource increment according to the operation duration;
Scheduling of resource module 830, for carrying out scheduling of resource according to the resource increment.
In an alternative embodiment, the duration obtains module 810, for determining the where the operation duration One duration section;According to scheduling strategy data, the corresponding resource increment in first duration section, the scheduling strategy number are determined According to the corresponding relationship for being used to indicate the resource increment and first duration section;By the corresponding money in first duration section Source increment is determined as the corresponding resource increment of the goal task.
In an alternative embodiment, the duration obtains module 810, for when the operation duration is not less than described When the left end point in the first duration section, the duration section where determining the operation duration is first duration section;It is described According to scheduling strategy data, the corresponding resource increment in first duration section is determined, comprising: according to the scheduling strategy number According to determining whether first duration section is corresponding with the resource increment;When first duration section is corresponding with the money When the increment of source, the resource increment is determined;When first duration section does not correspond to the resource increment, the resource is increased Amount is determined as null value.
In an alternative embodiment, described device further includes frame length determining module, interval division module, data statistics Module, number obtain module, relating module and preserving module.
Frame length determining module, for determining frame length when target application operation, the target application is the target frame institute The application of category;
Interval division module, for the frame length to be divided into the duration section of n equal length, n is positive integer;
Data statistics module, for counting m of the goal task number completed duration and be distributed in the duration section According to the completion duration is used to indicate the goal task, and accumulative flower when the frame image in the target application is completed in processing The duration taken, m are positive integer;
Number obtain module, for obtains the i-th duration section it is corresponding completion duration the first number, i be no less than 1 and Integer no more than n;
Relating module, for accounting for the ratio of the m completion duration when first number not less than preset ratio threshold value When, i-th duration section to the n-th duration section is associated with (n-i+1) a described resource increment respectively;
Preserving module, for increasing i-th duration section to the n-th duration section with (n-i+1) a described resource respectively Associated incidence relation is measured, is saved to the scheduling strategy data.
In an alternative embodiment, the corresponding resource increment in i-th duration section involved in described device is small In the corresponding resource increment in i+1 duration section, i+1 duration section is the adjacent duration area in i-th duration section Between, and any one duration value is greater than any one duration value in i-th duration section in i+1 duration section.
In an alternative embodiment, the increment determining module 820, for working as the left end in first duration section The corresponding duration of point, not less than the target frame frame length when, resource increment maximum in the scheduling strategy data is determined For the corresponding resource increment in first duration section.
In an alternative embodiment, the increment determining module 820, for obtaining mesh belonging to the goal task Mark application, the target application is application belonging to the target frame;It is answered when the target application belongs to first demarcated in advance Used time determines corresponding first resource increment according to corresponding first strategy of first application, and first application is operation When load not less than default load application;When the target application belongs to second demarcated in advance in application, according to described Corresponding second strategy of second application determines corresponding Secondary resource increment, and load when second application is operation is less than pre- If the application of load.
In an alternative embodiment, the scheduling of resource module 830, for obtaining the operation mark of the goal task Know, whether the operation mark is used to indicate the goal task in operating status;When operation mark indicates the mesh When mark task is in operating status, scheduling of resource is carried out according to the resource increment.
In an alternative embodiment, the scheduling of resource module 830, it is described for creating first resource management group First resource management group is for dispatching resource according to scheduled first resource;The goal task is placed on the first resource In management group;When the goal task carries out scheduling of resource according to the resource increment by the terminal, pass through described first Resource management group carries out scheduling of resource according to the first resource and the resource increment.
In an alternative embodiment, the scheduling of resource module 830, it is described for creating Secondary resource management group For Secondary resource management group for dispatching the resource according to scheduled Secondary resource, the Secondary resource is except the first resource In include keystone resources except resource;Heavy duty task is placed in the Secondary resource management group;When the heavy burden When carrying task run, Secondary resource described in group scheduling is managed by the Secondary resource.
The embodiment of the present application also provides a kind of computer-readable medium, which has at least one Instruction, at least one instruction are loaded as the processor and are executed to realize scheduling resource described in as above each embodiment Method.
It should be understood that it is provided by the above embodiment scheduling resource device execute scheduling resource method when, only The example of the division of the above functional modules, in practical application, can according to need and by above-mentioned function distribution by Different functional modules is completed, i.e., the internal structure of equipment is divided into different functional modules, described above complete to complete Portion or partial function.In addition, the device of scheduling resource provided by the above embodiment and the embodiment of the method for scheduling resource belong to Same design, specific implementation process are detailed in embodiment of the method, and which is not described herein again.
Above-mentioned the embodiment of the present application serial number is for illustration only, does not represent the advantages or disadvantages of the embodiments.
Those of ordinary skill in the art will appreciate that realizing that all or part of the steps of above-described embodiment can pass through hardware It completes, relevant hardware can also be instructed to complete by program, the program can store in a kind of computer-readable In storage medium, storage medium mentioned above can be read-only memory, disk or CD etc..
The foregoing is merely the exemplary embodiments that can be realized of the application, not to limit the application, it is all Within spirit herein and principle, any modification, equivalent replacement, improvement and so on should be included in the protection of the application Within the scope of.

Claims (13)

1. a method of scheduling resource, which is characterized in that the described method includes:
When post-processing object frame, the operation duration of goal task is obtained, the goal task is for rendering the target frame or use In supporting the rendering target frame, the operation duration, which is that the goal task is accumulative when terminal renders the target frame, to be run Duration;
According to the operation duration, corresponding resource increment is determined;
Scheduling of resource is carried out according to the resource increment.
2. determining corresponding resource the method according to claim 1, wherein described according to the operation duration Increment, comprising:
Determine the first duration section where the operation duration;
According to scheduling strategy data, the corresponding resource increment in first duration section is determined, the scheduling strategy data are used for Indicate the corresponding relationship of the resource increment and first duration section;
The corresponding resource increment in first duration section is determined as the corresponding resource increment of the goal task.
3. according to the method described in claim 2, it is characterized in that, the first duration area where the determination operation duration Between, comprising:
When the operation duration is greater than the left end point in first duration section and is not less than the right end in first duration section When point, the duration section where determining the operation duration is first duration section;
It is described according to scheduling strategy data, determine the corresponding resource increment in first duration section, comprising:
According to the scheduling strategy data, determine whether first duration section is corresponding with the resource increment;
When first duration section is corresponding with the resource increment, the resource increment is determined;
When first duration section does not correspond to the resource increment, the resource increment is determined as null value.
4. according to the method described in claim 3, it is characterized in that, determining described first according to scheduling strategy data described Before the corresponding resource increment in duration section, the method also includes:
Determine frame length when target application operation, the target application is application belonging to the target frame;
The frame length is divided into the duration section of n equal length, n is positive integer;
M for counting the goal task completes the data that duration is distributed in the duration section, and the completion duration is for referring to Show the goal task, the accumulative duration spent when the frame image in the target application is completed in processing, and m is positive integer;
Corresponding the first number for completing duration in the i-th duration section is obtained, i is no less than 1 and is not more than the integer of n;
When first number accounts for the ratio of the m completion duration not less than preset ratio threshold value, by i-th duration area Between be associated with respectively with (n-i+1) a described resource increment to the n-th duration section;
By i-th duration section to the n-th duration section respectively with (n-i+1) a associated incidence relation of resource increment, It saves to the scheduling strategy data.
5. according to the method described in claim 4, it is characterized in that, the corresponding resource increment in i-th duration section is less than i-th The corresponding resource increment in+1 duration section, i+1 duration section are the adjacent duration sections in i-th duration section, and Any one duration value is greater than any one duration value in i-th duration section in i+1 duration section.
6. according to the method described in claim 2, it is characterized in that, described according to scheduling strategy data, when determining described first The corresponding resource increment in long section, comprising:
When the corresponding duration of left end point in first duration section, not less than the target frame frame length when, by the scheduling Maximum resource increment is determined as the corresponding resource increment in first duration section in policy data.
7. method according to any one of claims 1 to 6, which is characterized in that it is described according to the operation duration, it determines and corresponds to Resource increment, comprising:
Target application belonging to the goal task is obtained, the target application is application belonging to the target frame;
When the target application belongs to first demarcated in advance in application, being determined according to corresponding first strategy of first application Corresponding first resource increment, load when first application is operation is not less than the application for presetting load;
When the target application belongs to second demarcated in advance in application, being determined according to corresponding second strategy of second application Corresponding Secondary resource increment, load when second application is operation are less than the application of default load.
8. method according to any one of claims 1 to 6, which is characterized in that described to carry out resource according to the resource increment Scheduling, comprising:
The operation mark of the goal task is obtained, the operation mark is used to indicate whether the goal task is in operation shape State;
When operation mark indicates that the goal task is in operating status, resource tune is carried out according to the resource increment Degree.
9. method according to any one of claims 1 to 6, which is characterized in that described to carry out resource according to the resource increment Scheduling, comprising:
First resource management group is created, the first resource management group is for dispatching resource according to scheduled first resource;
The goal task is placed in the first resource management group;
When the goal task carries out scheduling of resource according to the resource increment by the terminal, pass through the first resource pipe Reason group carries out scheduling of resource according to first resource and the resource increment, and the first resource is that the first resource management group has The resource of permission scheduling.
10. according to the method described in claim 9, it is characterized in that, the method also includes:
Create Secondary resource management group, the Secondary resource management group for dispatching the resource according to scheduled Secondary resource, The Secondary resource is the resource in addition to the keystone resources for including in the first resource;
Heavy duty task is placed in the Secondary resource management group;
When the heavy duty task run, Secondary resource described in group scheduling is managed by the Secondary resource.
11. a kind of device for dispatching resource, which is characterized in that described device includes:
Duration obtains module, and for when post-processing object frame, obtaining the operation duration of goal task, the goal task is used for wash with watercolours It contaminates the target frame or for supporting to render the target frame, the operation duration is described in the goal task is rendered in terminal Add up the duration of operation when target frame;
Increment determining module, for determining corresponding resource increment according to the operation duration;
Scheduling of resource module, for carrying out scheduling of resource according to the resource increment.
12. a kind of terminal, which is characterized in that the terminal includes processor and the memory that is connected with the processor, and The program instruction being stored on the memory, the processor realize such as claims 1 to 10 when executing described program instruction The method of any scheduling resource.
13. a kind of computer readable storage medium, program instruction is stored in the storage medium, which is characterized in that the journey The scheduling resource as described in claims 1 to 10 is any is realized in sequence instruction method when being executed by processor.
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 true CN110532100A (en) 2019-12-03
CN110532100B 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)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240817A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 Resource scheduling method, resource scheduling apparatus, and storage medium
CN111611516A (en) * 2020-04-11 2020-09-01 上海淇玥信息技术有限公司 Resource allocation method and device and electronic equipment
CN113849384A (en) * 2021-08-27 2021-12-28 苏州浪潮智能科技有限公司 RAID system background task test duration determination method and device
WO2022222721A1 (en) * 2021-04-22 2022-10-27 华为技术有限公司 Computational resource scheduling method and apparatus
CN116932230A (en) * 2023-09-15 2023-10-24 湖南马栏山视频先进技术研究院有限公司 Video rendering method based on dynamic task scheduling

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100271375A1 (en) * 2003-08-18 2010-10-28 Nvidia Corporation Adaptive load balancing in a multi processor graphics processing system
US20120223954A1 (en) * 2008-06-11 2012-09-06 Eric Samson Performance allocation method and apparatus
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

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100271375A1 (en) * 2003-08-18 2010-10-28 Nvidia Corporation Adaptive load balancing in a multi processor graphics processing system
US20120223954A1 (en) * 2008-06-11 2012-09-06 Eric Samson Performance allocation method and apparatus
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
王海峰等: "分布式实时渲染中帧同步的实现", 《微计算机应用》 *

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111240817A (en) * 2020-01-06 2020-06-05 北京小米移动软件有限公司 Resource scheduling method, resource scheduling apparatus, and storage medium
CN111240817B (en) * 2020-01-06 2024-04-09 北京小米移动软件有限公司 Resource scheduling method, resource scheduling device and storage medium
CN111611516A (en) * 2020-04-11 2020-09-01 上海淇玥信息技术有限公司 Resource allocation method and device and electronic equipment
CN111611516B (en) * 2020-04-11 2023-04-18 上海淇玥信息技术有限公司 Resource allocation method and device and electronic equipment
WO2022222721A1 (en) * 2021-04-22 2022-10-27 华为技术有限公司 Computational resource scheduling method and apparatus
CN113849384A (en) * 2021-08-27 2021-12-28 苏州浪潮智能科技有限公司 RAID system background task test duration determination 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
CN116932230A (en) * 2023-09-15 2023-10-24 湖南马栏山视频先进技术研究院有限公司 Video rendering method based on dynamic task scheduling
CN116932230B (en) * 2023-09-15 2023-12-08 湖南马栏山视频先进技术研究院有限公司 Video rendering method based on dynamic task scheduling

Also Published As

Publication number Publication date
CN110532100B (en) 2022-04-15

Similar Documents

Publication Publication Date Title
CN110532100A (en) Dispatch method, apparatus, terminal and the storage medium of resource
CN108776934B (en) Distributed data calculation method and device, computer equipment and readable storage medium
US20190258514A1 (en) I/O Request Scheduling Method and Apparatus
US20130152097A1 (en) Resource Health Based Scheduling of Workload Tasks
EP3748470A1 (en) Resource scheduling method and terminal device
CN110308980A (en) Batch processing method, device, equipment and the storage medium of data
CN106557369A (en) A kind of management method and system of multithreading
CN103503412B (en) For the method and device of scheduling resource
CN111506434B (en) Task processing method and device and computer readable storage medium
CN107729137A (en) Server, the method and storage medium of the decryption of block chain sign test
CN110138688A (en) Dynamic adjusts method, apparatus, equipment and the readable storage medium storing program for executing of business interface
DE112012005223T5 (en) Energy management of the display controller
CN109117280A (en) The method that is communicated between electronic device and its limiting process, storage medium
US10037225B2 (en) Method and system for scheduling computing
CN106528065A (en) Thread obtaining method and device
CN110647366A (en) Method, device, terminal and storage medium for processing card pause
CN113285886A (en) Bandwidth allocation method and device, electronic equipment and readable storage medium
CN108681481A (en) The processing method and processing device of service request
CN109800261A (en) Dynamic control method, device and the relevant device of double data library connection pool
CN109117279A (en) The method that is communicated between electronic device and its limiting process, storage medium
CN111464331A (en) Control method and system for thread creation and terminal equipment
EP3667495A1 (en) Task scheduling method, apparatus and device, and storage medium
CN114153614A (en) Memory management method and device, electronic equipment and automatic driving vehicle
CN106815062A (en) A kind of business pipelined data processing method and processing device
CN109670932B (en) Credit data accounting method, apparatus, system and computer 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