CN110333942A - Electronic equipment and the task processing method executed by electronic equipment - Google Patents

Electronic equipment and the task processing method executed by electronic equipment Download PDF

Info

Publication number
CN110333942A
CN110333942A CN201910608471.3A CN201910608471A CN110333942A CN 110333942 A CN110333942 A CN 110333942A CN 201910608471 A CN201910608471 A CN 201910608471A CN 110333942 A CN110333942 A CN 110333942A
Authority
CN
China
Prior art keywords
task
duration
queue
time
task queue
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.)
Pending
Application number
CN201910608471.3A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN201910608471.3A priority Critical patent/CN110333942A/en
Publication of CN110333942A publication Critical patent/CN110333942A/en
Pending legal-status Critical Current

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/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • 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/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

Present disclose provides a kind of task processing methods executed by electronic equipment, comprising: initialization first task queue, first task queue includes N number of task, wherein N >=2;Obtain the m-th task in initialized first task queue, wherein 1≤M < N;During executing m-th task, determine whether the handling duration of m-th task has exceeded the first predetermined overtime duration for m-th task;If it is determined that the handling duration of m-th task has exceeded predetermined overtime duration, then the first predetermined overtime duration is adjusted to the first overtime duration after adjusting, and adjust the processing sequence of m-th task;And it obtains and handles the M+1 task in initialized first task queue.The disclosure additionally provides a kind of electronic equipment and a kind of computer readable storage medium.

Description

Electronic equipment and the task processing method executed by electronic equipment
Technical field
This disclosure relates to field of computer technology, more particularly to a kind of task processing method executed by electronic equipment and A kind of electronic equipment.
Background technique
Existing system is when handling multiple request tasks from applications, due to, without dependence, appointing between task Business interrupt processing realizes that breakpoint is continuous to be done.But since time-consuming differs greatly between different task, conventional method is reached according to task Sequencing handles task, neatly cannot adaptively be adjusted, and it is longer to may cause the task average latency, thus shadow Ring the subsequent processing timeliness of applications.Especially when treated between longer task first carry out, processing time shorter task After when executing, could start to execute after the completion of the time to be processed longer task executions such as processing time shorter task needs, So that the task average latency is longer.
Summary of the invention
An aspect of this disclosure provides a kind of task processing method executed by electronic equipment, comprising: initialization the One task queue, the first task queue include N number of task, wherein N >=2;It obtains in initialized first task queue M-th task, wherein 1≤M < N;During executing the m-th task, the processing of the m-th task is determined Whether duration has exceeded the first predetermined overtime duration for the m-th task;If it is determined that the processing of the m-th task Duration has exceeded the predetermined overtime duration, then the described first predetermined overtime duration is adjusted to the first overtime duration after adjusting, And adjust the processing sequence of the m-th task;And it obtains and handles the M+1 in initialized first task queue Task.
Optionally, the processing sequence of the adjustment m-th task, comprising: the m-th task is transferred to second In task queue, wherein the processing priority of second task queue is lower than the processing priority of the first task queue.
Optionally, the method also includes: be sky in response to the first task queue, obtain second task queue In l-th task, wherein 1≤L < K, and K be second task queue in task number;Executing the l-th During task, determines whether the handling duration of the l-th task has exceeded and make a reservation for for the second of the l-th task Overtime duration;If it is determined that the handling duration of the l-th task has exceeded the described second predetermined overtime duration, then by described the Two predetermined overtime durations are adjusted to the second overtime duration after adjustment, and the l-th task is transferred in third task queue, Wherein, the processing priority of the third task queue is lower than the processing priority in second task queue;And it obtains And handle the L+1 task in second task queue.
Optionally, described that the m-th task is transferred in the second task queue, comprising: to stop to handle the m-th Task;And the corresponding address of task portion untreated in the m-th task is transferred in second task queue.
Optionally, the method also includes the first overtime duration after the setting adjustment, which includes: according at task The sequencing of time is managed, the handling duration of each task in predetermined time window is counted;It is calculated according to statistical result described The median and variance of the handling duration of each task;And according to the median and the variance, the adjustment is calculated First overtime duration afterwards.
Optionally, after the adjustment is calculated after the first overtime duration, the method also includes: acquisition is set in advance Fixed maximum tolerance time-out duration;Whether the first overtime duration is greater than the maximum tolerance time-out duration after determining the adjustment; And if it is determined that the first overtime duration then surpasses the maximum tolerance greater than the maximum tolerance time-out duration after the adjustment Shi Shichang is as the after the adjustment first overtime duration.
Optionally, the initialization first task queue, comprising: according to N number of task receiving time it is successive suitable Sequence initializes the first task queue.
Another aspect of the disclosure provides a kind of electronic equipment, comprising: initialization module, it is first for initializing Business queue, the first task queue includes N number of task, wherein N >=2;First obtains module, initialized for obtaining M-th task in first task queue, wherein 1≤M < N;First determining module, for executing the m-th task In the process, when determining whether the handling duration of the m-th task has exceeded the first predetermined time-out for the m-th task It is long;The first adjustment module, for determining the case where handling duration of the m-th task has exceeded the predetermined overtime duration Under, the described first predetermined overtime duration is adjusted to the first overtime duration after adjusting, and the processing for adjusting the m-th task is suitable Sequence;And second obtain module, for obtaining and handling the M+1 task in initialized first task queue.
Another aspect of the present disclosure provides another electronic equipment, comprising: one or more processors;Memory is used In the one or more programs of storage, wherein when one or more of programs are executed by one or more of processors, make It obtains one or more of processors and realizes method as described above.
Another aspect of the present disclosure provides a kind of computer readable storage medium, is stored with computer executable instructions, Described instruction is when executed for realizing method as described above.
Another aspect of the present disclosure provides a kind of computer program, and the computer program, which includes that computer is executable, to be referred to It enables, described instruction is when executed for realizing method as described above.
Detailed description of the invention
In order to which the disclosure and its advantage is more fully understood, referring now to being described below in conjunction with attached drawing, in which:
Fig. 1 diagrammatically illustrates the schematic diagram applied to electronic equipment according to the embodiment of the present disclosure;
Fig. 2 diagrammatically illustrates the schematic diagram of the task processing sequence according to the embodiment of the present disclosure;
Fig. 3 diagrammatically illustrates the block diagram of the task scheduling apparatus according to the embodiment of the present disclosure;
Fig. 4 diagrammatically illustrates the process of the task processing method executed by electronic equipment according to the embodiment of the present disclosure Figure;
Fig. 5 diagrammatically illustrates the block diagram of the task execution device according to the embodiment of the present disclosure;
Fig. 6 diagrammatically illustrates the flow chart of the first overtime duration after the setting adjustment according to the embodiment of the present disclosure;
Fig. 7 diagrammatically illustrates the block diagram of the adaptive data analysis set-up according to the embodiment of the present disclosure;
Fig. 8 diagrammatically illustrates the flow chart of the system operational process according to the embodiment of the present disclosure;
Fig. 9 diagrammatically illustrates the block diagram of the electronic equipment according to another embodiment of the disclosure;And
Figure 10 diagrammatically illustrates the block diagram of the electronic equipment according to the another embodiment of the disclosure.
Specific embodiment
Hereinafter, will be described with reference to the accompanying drawings embodiment of the disclosure.However, it should be understood that these descriptions are only exemplary , and it is not intended to limit the scope of the present disclosure.In the following detailed description, to elaborate many specific thin convenient for explaining Section is to provide the comprehensive understanding to the embodiment of the present disclosure.It may be evident, however, that one or more embodiments are not having these specific thin It can also be carried out in the case where section.In addition, in the following description, descriptions of well-known structures and technologies are omitted, to avoid Unnecessarily obscure the concept of the disclosure.
Term as used herein is not intended to limit the disclosure just for the sake of description specific embodiment.It uses herein The terms "include", "comprise" etc. show the presence of the feature, step, operation and/or component, but it is not excluded that in the presence of Or add other one or more features, step, operation or component.
There are all terms (including technical and scientific term) as used herein those skilled in the art to be generally understood Meaning, unless otherwise defined.It should be noted that term used herein should be interpreted that with consistent with the context of this specification Meaning, without that should be explained with idealization or excessively mechanical mode.
It, in general should be according to this using statement as " at least one in A, B and C etc. " is similar to Field technical staff is generally understood the meaning of the statement to make an explanation (for example, " system at least one in A, B and C " Should include but is not limited to individually with A, individually with B, individually with C, with A and B, with A and C, have B and C, and/or System etc. with A, B, C).Using statement as " at least one in A, B or C etc. " is similar to, generally come Saying be generally understood the meaning of the statement according to those skilled in the art to make an explanation (for example, " having in A, B or C at least One system " should include but is not limited to individually with A, individually with B, individually with C, with A and B, have A and C, have B and C, and/or the system with A, B, C etc.).
Shown in the drawings of some block diagrams and/or flow chart.It should be understood that some sides in block diagram and/or flow chart Frame or combinations thereof can be realized by computer program instructions.These computer program instructions can be supplied to general purpose computer, The processor of special purpose computer or other programmable data processing units, so that these instructions are when executed by this processor can be with Creation is for realizing function/operation device illustrated in these block diagrams and/or flow chart.The technology of the disclosure can be hard The form of part and/or software (including firmware, microcode etc.) is realized.In addition, the technology of the disclosure, which can be taken, is stored with finger The form of computer program product on the computer readable storage medium of order, the computer program product is for instruction execution system System uses or instruction execution system is combined to use.
Embodiment of the disclosure provide it is a kind of by electronic equipment execute task processing method and the party can be applied The electronic equipment of method.This method includes initialization first task queue, and first task queue includes N number of task, wherein N >=2. Obtain the m-th task in initialized first task queue, wherein 1≤M < N.During executing m-th task, Determine whether the handling duration of m-th task has exceeded the first predetermined overtime duration for m-th task.If it is determined that M The handling duration of a task has exceeded predetermined overtime duration, then when the first predetermined overtime duration being adjusted to the first time-out after adjusting It is long, and adjust the processing sequence of m-th task.It obtains and handles the M+1 task in initialized first task queue.
Fig. 1 diagrammatically illustrates the scene figure applied to electronic equipment according to the embodiment of the present disclosure.It should be noted that Being only shown in Fig. 1 can be using the example of the scene of the embodiment of the present disclosure, to help skilled in the art to understand the disclosure Technology contents, but it is not meant to that the embodiment of the present disclosure may not be usable for other equipment, system, environment or scene.
As shown in Figure 1, the electronic equipment 100 for being able to carry out the task processing method of embodiment of the present disclosure offer may include Such as task reception device 101, task scheduling apparatus 102, task execution device 103 and adaptive data analysis set-up 104. Wherein, the function of each device is elaborated below in connection with specific embodiment in electronic equipment 100, and details are not described herein.
Fig. 2 diagrammatically illustrates the schematic diagram of the task processing sequence according to the embodiment of the present disclosure, and Fig. 3 is diagrammatically illustrated According to the block diagram of the task scheduling apparatus of the embodiment of the present disclosure.The disclosure is elaborated below in conjunction with Fig. 1 to Fig. 3.
Fig. 4 diagrammatically illustrates the process of the task processing method executed by electronic equipment according to the embodiment of the present disclosure Figure.
As shown in figure 4, this method includes operation S410~S450.
In operation S410, first task queue is initialized, first task queue includes N number of task, wherein N >=2.
With reference to Fig. 1, the electronic equipment 100 for being able to carry out the task processing method of embodiment of the present disclosure offer may include example Such as task reception device 101, task scheduling apparatus 102, task execution device 103 and adaptive data analysis set-up 104.Its In, task reception device 101 is used to receive the task from external application (may include one or more) and appoints The entrained data such as data file of business, and task is pushed to task scheduling apparatus 102.Task scheduling apparatus 102 be used for from Task is simultaneously sequentially inserted into first task queue according to the sequencing that task reaches by 101 reception task of task reception device.It answers The process that received task is sequentially inserted into first task queue is to initialize first by the understanding, task scheduling apparatus 102 The process of task queue.
With reference to Fig. 2, if there is totally 10 tasks need to handle A1~A10, external application can be totally 10 by A1~A10 Task is successively sent to task reception device 101, and task reception device 101 can be pushed to task after receiving these tasks A1~A10 can be sequentially inserted into first task queue Q1 after receiving these tasks by dispatching device 102, task scheduling apparatus 102, To initialize first task queue Q1.
It should be understood that in the embodiments of the present disclosure, first task queue is the storage address for storing task data, and There is no store tasks data.
Such as with reference to Fig. 3, in the embodiments of the present disclosure, task scheduling apparatus 102 may include such as task queue unit 201, task data storage unit 202, task adjustment unit 203 and task push unit 204.
Wherein, the task data such as the data in data file that task data storage unit 202 is used to store all tasks, Wherein, which can be realized using database or file system according to actual needs.Task queue list Member 201 is used for storage address of the task data of inter-related task in task data storage cell 202.
In operation S420, the m-th task in initialized first task queue is obtained, wherein 1≤M < N.
Determine whether the handling duration of m-th task has exceeded during executing m-th task in operation S430 Make a reservation for overtime duration for the first of m-th task.
In operation S440, if it is determined that the handling duration of m-th task has exceeded predetermined overtime duration, then makes a reservation for first Overtime duration is adjusted to the first overtime duration after adjustment, and adjusts the processing sequence of m-th task.
In operation S450, obtains and handle the M+1 task in initialized first task queue.
It should be noted that in the embodiments of the present disclosure, for all tasks in first task queue, first setting is unified The predetermined overtime duration of time-out time i.e. first, then be, for example, according to the practical executive condition of each task in task implementation procedure It is no to execute time-out to adjust the time-out time of certain tasks.
Such as referring back to Fig. 1, task scheduling apparatus 102 can be by the task in the queue after initializing first task queue Task execution device 103 is pushed to according to " first in first out " principle.Task execution device 103 receives task scheduling apparatus 102 and pushes away The sending of the task and according to the task in following logical process first task queue:
Such as A1 is first obtained and executes for first task queue Q1 referring back to Fig. 2, and during executing A1, It determines whether A1 executes time-out, if A1 execution has not timed out, A2 is obtained and execute again for first task queue Q1, if A1 Time-out is executed, then first stops to execute A1, then obtain for first task queue Q1 and execute A2.
Wherein, the processing logical AND A1 of A2 and A3~A9 in the queue is identical, and details are not described herein.
In addition, task scheduling apparatus 102 can be notified to adjust the excellent of A1 while stopping to execute a task such as A1 A1 for example is moved on in other positions such as the second task queue to wait and be executed again by first grade.
Also, if the task such as A1 in first task queue Q1 executes time-out for the first predetermined overtime duration, Show the too short of the not reasonable i.e. setting that the first predetermined overtime duration is arranged for A1, therefore A1 is executed again in order to prevent When remain unchanged time-out, task scheduling apparatus 102 can also be notified to be adjusted to the time-out time of A1 by the first predetermined overtime duration First overtime duration after whole.
It should be understood that in the embodiments of the present disclosure, the first overtime duration is ok after the first predetermined overtime duration and adjustment It obtains, such as can rule of thumb set in several ways, or can be calculated according to pre-defined algorithm.Due to task The processing time is difficult to estimate in advance, thus needs to be arranged the predetermined overtime duration of lesser initial time-out time i.e. first, so that appointing The processing time, shorter task first carried out in business queue, and the constantly time-out time and priority of adjust automatically overtime task. By the embodiment of the present disclosure, when can be adaptively adjusted the execution order of each task in task queue, such as first carry out processing Between shorter task, priority can be reduced for processing time longer task and executed.Also, pass through the embodiment of the present disclosure, It can also be adaptively adjusted the time-out time of certain tasks in task queue, when executing to prevent these tasks from reducing priority Again time out.Therefore, by the embodiment of the present disclosure, the average latency of task can be reduced, improve the interaction effect between application Rate.
As a kind of optional embodiment, the processing sequence of m-th task is adjusted, comprising: m-th task is transferred to the In two task queues, wherein the processing priority of the second task queue is lower than the processing priority of first task queue.
It in the embodiments of the present disclosure, can be in order for the task of time-out during handling first task queue It is fully transferred in the second task queue.It should be understood that the processing priority of the second task queue is lower than first task team The processing priority of column could handle the second task queue when first task queue is empty queue.Also, with first task It is different to be all uniformly set as the predetermined overtime duration of initial time-out time i.e. first for the time-out time of all tasks in queue, and second The time-out time of all tasks is not unified setting in task queue, but when handling first task queue for each What overtime task was readjusted, therefore, the time-out time of all tasks is possible identical in the task queue, it is also possible to different.
Such as referring back to Fig. 2, the technical solution provided using the embodiment of the present disclosure can be with if A1 executes time-out It transfers them in the second task queue Q2, specifically, needs to transfer them to the tail of the queue of Q2 when shifting A1.Wherein, second Task queue needs to handle when first task queue is empty queue.
Such as referring back to Fig. 3, the task adjustment unit 203 in task scheduling apparatus 102 is used for according to task time-out feelings Condition, the time-out time and priority of adjust automatically overtime task, and adjust automatically overtime task is in task queue unit 201 Position.It should be understood that task queue unit 201 may include multiple tasks queue such as first task queue and second herein Business queue.
It can drop priority processing for handling time longer task by the embodiment of the present disclosure and such as be shifted The task queue relatively low to priority is medium to be processed.
It can also include: in response to first task according to the method for the embodiment of the present disclosure as a kind of optional embodiment Queue is sky, obtains the l-th task in the second task queue, wherein 1≤L < K, and K is task in the second task queue Number;During executing l-th task, determine whether the handling duration of l-th task has exceeded for l-th task Second predetermined overtime duration;If it is determined that the handling duration of l-th task has exceeded the second predetermined overtime duration, then it is pre- by second Fixed time-out duration is adjusted to the second overtime duration after adjustment, and l-th task is transferred in third task queue, wherein the The processing priority of three task queues is lower than the processing priority in the second task queue;And it obtains and handles the second task team The L+1 task in column.
Such as referring back to Fig. 3, the task push unit 204 in task scheduling apparatus 102 is used for according to task queue Priority first reads task and execution in high-priority queue such as first task queue, is only in high-priority queue When empty queue, task and the execution in Low Priority Queuing such as the second task queue are just read.Regardless of being that high priority is appointed Business queue or low priority task queue, there is similar task to handle logic for they, and details are not described herein.
In addition, for example referring back to Fig. 2, for the A10 in first task queue, during executing A10, first Determine whether A10 executes time-out.If A10 execution has not timed out, terminate the task treatment progress of first task queue Q1, in turn Open the task treatment progress of the second task queue Q2.If A10 executes time-out, at the terminating first task queue Q1 of the task Reason process, and task of A10 being transferred to the tail of the queue of the second task queue Q2, while opening the second task queue Q2 handle into Journey.
As a kind of optional embodiment, m-th task is transferred in the second task queue, may include: at suspension Manage m-th task;And the corresponding address of task portion untreated in m-th task is transferred in the second task queue.
Fig. 5 diagrammatically illustrates the block diagram of the task execution device according to the embodiment of the present disclosure.With reference to Fig. 5, in the disclosure In embodiment, which at least may include such as task executing units 501, task time-out detection unit 502 With suspension of task processing unit 503.Wherein, task executing units 501 execute task, finishing service function for practical.Task Overtime detection unit 502 is used for the timing when task starts to execute, if reaching the time-out time of task in task execution time When detect task status be non-completion status, then notify 503 interrupt task of suspension of task processing unit.Suspension of task processing is single Member 503 is for after obtaining suspension of task notice, processing suspension of task to handle relevant data scrubbing and initialization etc., and notifies Task scheduling apparatus 102.
In the embodiments of the present disclosure, the first predetermined overtime duration can rule of thumb be set, and can also pass through pre-defined algorithm It is calculated.
In view of overtime interrupt number is too many, system consumption will increase, influence whole efficiency, the embodiment of the present disclosure is by changing Into being all adjusted rear time-out time by certain algorithm increase regular hour after every subtask time-out.
Specifically, Fig. 6 diagrammatically illustrates the process of the first overtime duration after the setting adjustment according to the embodiment of the present disclosure Figure, as shown in fig. 6, this method for example can also include the first overtime duration after setting adjustment, which for example may include:
The processing of each task in predetermined time window is counted according to the sequencing of task processing time in operation S610 Duration.
In operation S620, the median and variance of the handling duration of each task are calculated according to statistical result.
The first overtime duration after adjustment is calculated according to median and variance in operation S630.
In order to make it easy to understand, in the embodiments of the present disclosure, task expired times can be set as Nout(such as can be set For 5), and N is set by task queueoutA subqueue, corresponds respectively to NoutA priority, highest priority Nout(such as The priority of first task queue is 5) lowest priority 1.If the task in a subqueue handles time-out, automatically By this tasks interrupt, and this mobile task is to the subqueue tail of the queue of a low priority, while the time-out time of this task being set It is set to
T′out=(retry × r2)×Tout/priority。
Here retry is expired times, and priority is priority, r2The variance of time is handled for task.
Referring back to Fig. 5, in order to make it easy to understand, it is assumed that the expired times of task be 5, the priority queue of task Number is also 5.After task A1 calculates time-out, then A1 priority reduces by 1 grade, and the queue Q1 team head quilt for being 5 from priority It is moved to the queue Q2 tail of the queue that priority is 4.
For the ease of the handling duration of each task in statistics predetermined time window, it is preferable that Fig. 1 is referred to, if task The time is executed without departing from time-out time, then the execution time of the task can be registered in adaptive by task scheduling apparatus 102 In data analysis set-up 104.
Referring back to Fig. 1, adaptive data analysis set-up 104 is for statisticalling analyze task in task execution device 103 The actual treatment time, and parameter needed for adaptive scheduling (median of the handling duration including each task, variance is calculated And time-out time adjusted), and save system self-adaption and adjust necessary parameter.
With reference to Fig. 1 and Fig. 7, adaptive data analysis set-up 104 for example may include task processing time detail storage Unit 701, data statistics unit 702 and parameter storage unit 703.Task handles time detail storage unit 701 and is used for task The storage of time history detailed data is handled, for example can be the table of database.Data statistics unit 702 is used at according to task It manages the task in time detail storage unit 701 and handles time history detail, calculating task handles the median and variance of time, Adjustment for follow-up work time-out time.Parameter storage unit 703 is for the data analysis result parameter of storage system and its The service parameter that he is arranged, the time-out time T including taskout, maximum tolerance time-out time Ttol, expired times Nout, at task Manage time variance r2Etc. parameters.
Specifically, adaptive data analysis set-up 104 for example can analyze in the n days in the past task processing time of statistics Digit Tm, and by k × TmAs the initial time-out time (such as first predetermined overtime duration) of task, k is one big here In 1 parameter.In addition, adaptive data analysis set-up 104 for example can analyze the n days in the past task processing time of statistics and count Calculate the variance r of n days task processing time2.In addition, adaptive data analysis set-up 104 for example can appoint calculated result Initial time-out time k × T of businessmWith the variance r of task processing time2It is stored in parameter storage unit 703, while parameter is deposited Storage unit 703 can also for example save the time-out time T of taskout, maximum tolerance time-out time Ttol, expired times Nout, appoint The variance r of business processing time2Etc. parameters, and transmit relevant parameter to task scheduling apparatus 102.
By the embodiment of the present disclosure, using the median and variance of the history processing time of task as parameter, and according to Expired times adjust the priority and time-out time of overtime task, so that can reduce priority after task time-out and improve time-out Time.
As a kind of optional embodiment, after adjustment is calculated after the first overtime duration, method further include: obtain Preset maximum tolerance time-out duration;Whether the first overtime duration is greater than maximum tolerance time-out duration after determining adjustment;With And if it is determined that the first overtime duration is greater than maximum tolerance time-out duration after adjustment, then using maximum tolerance time-out duration as adjustment First overtime duration afterwards.
As a kind of optional embodiment, initialize first task queue, comprising: according to the receiving time of N number of task Sequencing initializes first task queue.
The disclosure is elaborated below with reference to attached drawing and in conjunction with specific embodiments.Such as in conjunction with Fig. 1, Fig. 3, Fig. 5, Fig. 7, figure 8, the system operational process of the disclosure is as described below.
In operation S810, task is arranged in the parameter storage unit 703 of adaptive data analysis set-up 104 in user Initial time-out time is Tout(initial value can be rule of thumb arranged), setting task handle the variance r of time2(initial value can root It is arranged according to experience), setting expired times are Nout, maximum tolerance time-out time T is settol, task subqueue is set and is most greatly enhanced Spend L.Task scheduling apparatus 102 reads the expired times N in parameter storage unit 703out, task queue unit 201 creates at most By NoutThe idle task queue of a sub- queue composition, the corresponding priority of each subqueue.
In operation S820, task reception device 101 persistently receives batch processing task and corresponding from outer application system The data file of business, and continue push task to task scheduling apparatus 102.
In operation S830, task scheduling apparatus 102 is continuously obtained task from task reception device 101, and task is corresponding Data file be saved in task data storage unit 202, obtain the address of corresponding task, and task address is inserted into task The subqueue of the highest priority of queue unit 201, the setting initial time-out time of task are Tout, and be arranged task status be " to It executes ".
In operation S840, the task push unit 204 of task scheduling apparatus 102 is by appointing on highest priority queue team head Business state is set to " in execution ", and pushes task to task execution device 103.
In operation S850, task execution device 103 obtains task, and task executing units 501 obtain number of tasks from task According to address, corresponding task data is read, starts execution task, whether the execution of 502 Detection task of task time-out detection unit surpasses When.If reaching time-out time, this task has not carried out completion in task executing units 501, then notifies suspension of task processing single Task here in member 503 notifies task scheduling apparatus 102 later, and otherwise registration is appointed in adaptive data analysis set-up 104 The processing time of business.
In operation S860, after task scheduling apparatus 102 obtains the notice of task execution time-out, task adjustment unit 203 will The priority of task turns down level-one, if former priority is P0, then the priority after turning down is
P1=P0- 1,
Time-out time is
T′out=(retry × r2)×Tout/ priority,
But no more than maximum tolerance time-out time Ttol, maximum tolerance time-out time T is taken if being more thantol
Task adjustment unit 203 in operation S870, task scheduling apparatus 102, overtime task is moved to next excellent The tail of the queue of first grade subqueue, and task status is set to " pending ".
In operation S880, adaptive data analysis set-up is written in the processing time of task by task execution device 103 In 104 task processing time detail storage unit 701.
In operation S890, the data statistics unit 702 of adaptive data analysis set-up 104 handles the time according to task Task processing time set in detail storage unit 701, calculates the median T of n days task processing timemWith variance r2.Data Statistic unit 702 is by k × TmIt is stored in parameter storage unit 703, as the initial time-out time T of taskout, the time will be handled Variance r2It is stored in parameter storage unit 703, appoints as 203 adjust automatically of task adjustment unit in task scheduling apparatus 102 Business is reruned the parameter of time-out time.Here k is a parameter greater than 1, for example can be 1.1.
A kind of adaptive task processing method provided according to the embodiment of the present disclosure, invention effect and advantage are summarized such as Under.
The task average latency that may cause the present disclosure overcomes traditional " first in first out " sequential processes is too long, with And the shortcomings that influencing interactive efficiency between applying, it is flat can to reduce task by the time-out time and priority of adjust automatically task The equal waiting time improves the interactive efficiency of application.
Influence of the disclosure to the task average latency for ease of description, is exemplified below.It is assumed that all tasks It is respectively provided with an identical initial time-out time Tout, can stop to execute after task time-out, and task restarts that realize breakpoint continuous It does.
Referring back to Fig. 2, than if any task A1, A2, A3 ... A10, if time-out time ToutIt is set as 30min, it is assumed that The time-consuming of A1 and A2 task is respectively 60min, 10min, and the follow-up work processing time is 1min, if provided by the prior art Scheme sequential processes, then waiting time such as table 1, it is seen that the average latency of task is 64.8min.
Table 1
Task It is time-consuming Waiting time
A1 60min 0
A2 10min 60
A3 1min 70
A4 1min 71
A5 1min 72
A6 1min 73
A7 1min 74
A8 1min 75
A9 1min 76
A10 1min 77
If initial time-out time, which is arranged, by technical solution provided by the present disclosure is set as 5min, expired times 5, variance It is 25.A1 is first carried out, and because time-out time only has 5min, so calculating time-out, calculating new time-out time using algorithm is 31.25min, priority 4.A2 starts to execute, and same A2 can calculate time-out, and new time-out time is 31.25min, priority It is 4.Next, A3 to A10 starts to execute, time-out time will not influence.A1 the 2nd time execution, because time-out time is 31.25min still can execute time-out, and calculating new time-out time using algorithm is 83.33min, priority 3.A2 the 2nd time It executes, because time-out time is 31.25min, A2 can smoothly execute completion.A1 the 3rd time execution, because time-out time is 83.33min, A1 can smoothly execute completion.
Table 2
Task It is time-consuming Waiting time Remarks
A3 1min 10min A1, A2 time-out
A4 1min 11min
A5 1min 12min
A6 1min 13min
A7 1min 14min
A8 1min 15min
A9 1min 16min
A10 1min 17min
A2 10min 49.25min A1 time-out
A1 60min 54.25min
The practical execution sequence of task is A1, A2, A3, A4 ... A10, A1, A2, A1 in summary, then the waiting time is such as Table 2, it is seen that the average latency of task is 21.15min, and the average latency waited more at random shortens 67%.
Fig. 9 diagrammatically illustrates the block diagram of the electronic equipment according to another embodiment of the disclosure.
As shown in figure 9, electronic equipment 900 includes that initialization module 910, first obtains module 920, the first determining module 930, the first adjustment module 940 and second obtains module 950.
Specifically, initialization module 910, for initializing first task queue, the first task queue includes N number of Business, wherein N >=2.
First obtains module 920, for obtaining the m-th task in initialized first task queue, wherein 1≤M < N.
First determining module 930, for determining the place of the m-th task during executing the m-th task Whether reason duration has exceeded the first predetermined overtime duration for the m-th task.
The first adjustment module 940, for when determining that the handling duration of the m-th task has exceeded the predetermined time-out In the case where length, the described first predetermined overtime duration is adjusted to the first overtime duration after adjusting, and adjust the m-th task Processing sequence.
Second obtains module 950, for obtaining and handling the M+1 task in initialized first task queue.
Any number of or in which any number of at least partly functions in module according to an embodiment of the present disclosure can be with It is realized in a module.Multiple modules can be split into according to any one or more in the module of the embodiment of the present disclosure To realize.Hardware electricity can be at least implemented partly as according to any one or more in the module of the embodiment of the present disclosure Road, such as field programmable gate array (FPGA), programmable logic array (PLA), system on chip, the system on substrate, encapsulation On system, specific integrated circuit (ASIC), or can be by carrying out any other reasonable side that is integrated or encapsulating to circuit The hardware or firmware of formula realizes, or with any one in three kinds of software, hardware and firmware implementations or with wherein any It is several appropriately combined to realize.Alternatively, can be at least by part according to one or more of module of the embodiment of the present disclosure Ground is embodied as computer program module, when the computer program module is run, can execute corresponding function.
For example, initialization module 910, first obtains module 920, the first determining module 930,940 and of the first adjustment module Any number of may be incorporated in a module in second acquisition module 950 is realized or any one module therein can To be split into multiple modules.Alternatively, at least partly function of one or more modules in these modules can be with other moulds At least partly function of block combines, and realizes in a module.In accordance with an embodiment of the present disclosure, initialization module 910, One obtains at least one of module 920, the first determining module 930, the first adjustment module 940 and second acquisition module 950 can To be at least implemented partly as hardware circuit, for example, field programmable gate array (FPGA), programmable logic array (PLA), The system in system, encapsulation, specific integrated circuit (ASIC) in system on chip, substrate, or can be by collecting to circuit At or the hardware such as any other rational method or firmware of encapsulation realize, or with software, hardware and three kinds of firmware realizations Any one in mode several appropriately combined is realized with wherein any.Alternatively, initialization module 910, first obtains mould Block 920, the first determining module 930, the first adjustment module 940 and second obtain at least one of module 950 can at least by It is implemented partly as computer program module, when the computer program module is run, corresponding function can be executed.
Figure 10 diagrammatically illustrates the block diagram of the electronic equipment according to the another embodiment of the disclosure.Electronics shown in Figure 10 is set A standby only example, should not function to the embodiment of the present disclosure and use scope bring any restrictions.
As shown in Figure 10, electronic equipment 1000 includes processor 1010, computer readable storage medium 1020.The electronics is set Standby 1000 can execute the method according to the embodiment of the present disclosure.
Specifically, processor 1010 for example may include general purpose microprocessor, instruction set processor and/or related chip group And/or special microprocessor (for example, specific integrated circuit (ASIC)), etc..Processor 1010 can also include for caching The onboard storage device of purposes.Processor 1010 can be the different movements for executing the method flow according to the embodiment of the present disclosure Single treatment unit either multiple processing units.
Computer readable storage medium 1020, such as can be non-volatile computer readable storage medium, specifically show Example includes but is not limited to: magnetic memory apparatus, such as tape or hard disk (HDD);Light storage device, such as CD (CD-ROM);Memory, Such as random access memory (RAM) or flash memory;Etc..
Computer readable storage medium 1020 may include computer program 1021, which may include Code/computer executable instructions executes processor 1010 and is implemented according to the disclosure The method or its any deformation of example.
Computer program 1021 can be configured to have the computer program code for example including computer program module.Example Such as, in the exemplary embodiment, the code in computer program 1021 may include one or more program modules, for example including 1021A, module 1021B ....It should be noted that the division mode and number of module are not fixed, those skilled in the art It can be combined according to the actual situation using suitable program module or program module, when these program modules are combined by processor When 1010 execution, processor 1010 is executed according to the method for the embodiment of the present disclosure or its any deformation.
In accordance with an embodiment of the present disclosure, initialization module 910, first obtains module 920, the first determining module 930, first At least one of adjustment module 940 and the second acquisition module 950 can be implemented as the computer program mould with reference to Figure 10 description Corresponding operating described above may be implemented when being executed by processor 1010 in block.
The disclosure additionally provides a kind of computer readable storage medium, which can be above-mentioned reality It applies included in equipment/device/system described in example;Be also possible to individualism, and without be incorporated the equipment/device/ In system.Above-mentioned computer readable storage medium carries one or more program, when said one or multiple program quilts When execution, the method according to the embodiment of the present disclosure is realized.
In accordance with an embodiment of the present disclosure, computer readable storage medium can be non-volatile computer-readable storage medium Matter, such as can include but is not limited to: portable computer diskette, hard disk, random access storage device (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), portable compact disc read-only memory (CD-ROM), light Memory device, magnetic memory device or above-mentioned any appropriate combination.In the disclosure, computer readable storage medium can With to be any include or the tangible medium of storage program, the program can be commanded execution system, device or device use or Person is in connection.
Flow chart and block diagram in attached drawing are illustrated according to the system of the various embodiments of the disclosure, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
It will be understood by those skilled in the art that the feature recorded in each embodiment and/or claim of the disclosure can To carry out multiple combinations and/or combination, even if such combination or combination are not expressly recited in the disclosure.Particularly, exist In the case where not departing from disclosure spirit or teaching, the feature recorded in each embodiment and/or claim of the disclosure can To carry out multiple combinations and/or combination.All these combinations and/or combination each fall within the scope of the present disclosure.
Although the disclosure, art technology has shown and described referring to the certain exemplary embodiments of the disclosure Personnel it should be understood that in the case where the spirit and scope of the present disclosure limited without departing substantially from the following claims and their equivalents, A variety of changes in form and details can be carried out to the disclosure.Therefore, the scope of the present disclosure should not necessarily be limited by above-described embodiment, But should be not only determined by appended claims, also it is defined by the equivalent of appended claims.

Claims (10)

1. a kind of task processing method executed by electronic equipment, comprising:
First task queue is initialized, the first task queue includes N number of task, wherein N >=2;
Obtain the m-th task in initialized first task queue, wherein 1≤M < N;
During executing the m-th task, determine whether the handling duration of the m-th task has exceeded for described The predetermined overtime duration of the first of m-th task;
If it is determined that the handling duration of the m-th task has exceeded the predetermined overtime duration, then it is predetermined super by described first Shi Shichang is adjusted to the first overtime duration after adjustment, and adjusts the processing sequence of the m-th task;And
It obtains and handles the M+1 task in initialized first task queue.
2. according to the method described in claim 1, wherein, the processing sequence of the adjustment m-th task, comprising:
The m-th task is transferred in the second task queue, wherein the processing priority of second task queue is lower than The processing priority of the first task queue.
3. according to the method described in claim 2, wherein, the method also includes:
It is sky in response to the first task queue, obtains the l-th task in second task queue, wherein 1≤L < K, and K is the number of task in second task queue;
During executing the l-th task, determine whether the handling duration of the l-th task has exceeded for described The predetermined overtime duration of the second of l-th task;
If it is determined that the handling duration of the l-th task has exceeded the described second predetermined overtime duration, then it is pre- by described second Fixed time-out duration is adjusted to the second overtime duration after adjustment, and the l-th task is transferred in third task queue, In, the processing priority of the third task queue is lower than the processing priority in second task queue;And
It obtains and handles the L+1 task in second task queue.
4. described that the m-th task is transferred in the second task queue according to the method described in claim 2, wherein, packet It includes:
Stop to handle the m-th task;And
The corresponding address of task portion untreated in the m-th task is transferred in second task queue.
5. according to the method described in claim 1, wherein, the method also includes the first overtime duration after the adjustment is arranged, The operation includes:
According to the sequencing of task processing time, the handling duration of each task in predetermined time window is counted;
The median and variance of the handling duration of each task are calculated according to statistical result;And
According to the median and the variance, the first overtime duration after the adjustment is calculated.
6. described after the adjustment is calculated after the first overtime duration according to the method described in claim 5, wherein Method further include:
Obtain preset maximum tolerance time-out duration;
Whether the first overtime duration is greater than the maximum tolerance time-out duration after determining the adjustment;And
If it is determined that the first overtime duration is greater than the maximum tolerance time-out duration after the adjustment, then the maximum tolerance is surpassed Shi Shichang is as the after the adjustment first overtime duration.
7. according to the method described in claim 1, wherein, the initialization first task queue, comprising:
According to the sequencing of the receiving time of N number of task, the first task queue is initialized.
8. a kind of electronic equipment, comprising:
Initialization module, for initializing first task queue, the first task queue includes N number of task, wherein N >=2;
First obtains module, for obtaining the m-th task in initialized first task queue, wherein 1≤M < N;
First determining module, for determining the handling duration of the m-th task during executing the m-th task Whether first predetermined overtime duration for the m-th task has been exceeded;
The first adjustment module, for determining that the handling duration of the m-th task exceeded the feelings of the predetermined overtime duration Under condition, the described first predetermined overtime duration is adjusted to the first overtime duration after adjusting, and adjust the processing of the m-th task Sequentially;And
Second obtains module, for obtaining and handling the M+1 task in initialized first task queue.
9. a kind of electronic equipment, comprising:
One or more processors;
Memory, for storing one or more programs,
Wherein, when one or more of programs are executed by one or more of processors, so that one or more of Processor realizes method described in any one of claims 1 to 7.
10. a kind of computer readable storage medium, is stored with computer executable instructions, described instruction is used for reality when executed Method described in existing any one of claims 1 to 7.
CN201910608471.3A 2019-07-05 2019-07-05 Electronic equipment and the task processing method executed by electronic equipment Pending CN110333942A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910608471.3A CN110333942A (en) 2019-07-05 2019-07-05 Electronic equipment and the task processing method executed by electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910608471.3A CN110333942A (en) 2019-07-05 2019-07-05 Electronic equipment and the task processing method executed by electronic equipment

Publications (1)

Publication Number Publication Date
CN110333942A true CN110333942A (en) 2019-10-15

Family

ID=68143266

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910608471.3A Pending CN110333942A (en) 2019-07-05 2019-07-05 Electronic equipment and the task processing method executed by electronic equipment

Country Status (1)

Country Link
CN (1) CN110333942A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112506640A (en) * 2021-02-07 2021-03-16 浙江地芯引力科技有限公司 Multiprocessor architecture for encryption operation chip and allocation method
CN112508449A (en) * 2020-12-21 2021-03-16 北京元心科技有限公司 Task execution method and device, electronic equipment and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246437A (en) * 2008-01-28 2008-08-20 中兴通讯股份有限公司 Built-in real-time system course equalization scheduling method
US8868855B2 (en) * 2011-02-28 2014-10-21 Hewlett-Packard Development Company, L.P. Request management system and method for dynamically managing prioritized requests
CN104462447A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Access timeout data processing method and device
CN104915253A (en) * 2014-03-12 2015-09-16 中国移动通信集团河北有限公司 Work scheduling method and work processor
CN106095554A (en) * 2016-06-17 2016-11-09 中国银行股份有限公司 The method and device of batch data process is carried out in the most online stage
CN106919459A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal
CN107077278A (en) * 2017-01-10 2017-08-18 深圳怡化电脑股份有限公司 A kind of self-aided terminal method for processing business and system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101246437A (en) * 2008-01-28 2008-08-20 中兴通讯股份有限公司 Built-in real-time system course equalization scheduling method
US8868855B2 (en) * 2011-02-28 2014-10-21 Hewlett-Packard Development Company, L.P. Request management system and method for dynamically managing prioritized requests
CN104915253A (en) * 2014-03-12 2015-09-16 中国移动通信集团河北有限公司 Work scheduling method and work processor
CN104462447A (en) * 2014-12-15 2015-03-25 北京国双科技有限公司 Access timeout data processing method and device
CN106095554A (en) * 2016-06-17 2016-11-09 中国银行股份有限公司 The method and device of batch data process is carried out in the most online stage
CN107077278A (en) * 2017-01-10 2017-08-18 深圳怡化电脑股份有限公司 A kind of self-aided terminal method for processing business and system
CN106919459A (en) * 2017-03-10 2017-07-04 广东欧珀移动通信有限公司 A kind of management method of broadcast recipients, device and terminal

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112508449A (en) * 2020-12-21 2021-03-16 北京元心科技有限公司 Task execution method and device, electronic equipment and computer readable storage medium
CN112508449B (en) * 2020-12-21 2023-06-30 北京元心科技有限公司 Task execution method, device, electronic equipment and computer readable storage medium
CN112506640A (en) * 2021-02-07 2021-03-16 浙江地芯引力科技有限公司 Multiprocessor architecture for encryption operation chip and allocation method
CN112506640B (en) * 2021-02-07 2021-05-18 浙江地芯引力科技有限公司 Multiprocessor architecture for encryption operation chip and allocation method

Similar Documents

Publication Publication Date Title
US9645849B2 (en) Scheduling homogeneous and heterogeneous workloads with runtime elasticity in a parallel processing environment
US10740674B2 (en) Layer-based operations scheduling to optimise memory for CNN applications
Rajput et al. A priority based round robin CPU scheduling algorithm for real time systems
US20110161978A1 (en) Job allocation method and apparatus for a multi-core system
US9477521B2 (en) Method and system for scheduling repetitive tasks in O(1)
CN109669768A (en) A kind of resource allocation and method for scheduling task towards side cloud combination framework
US20130212594A1 (en) Method of optimizing performance of hierarchical multi-core processor and multi-core processor system for performing the method
WO2019183861A1 (en) Method, device, and machine readable storage medium for task processing
CN110333942A (en) Electronic equipment and the task processing method executed by electronic equipment
US20110161965A1 (en) Job allocation method and apparatus for a multi-core processor
CN105549910B (en) A kind of I O scheduling method and device
CN111104211A (en) Task dependency based computation offload method, system, device and medium
US11029968B1 (en) Operating system with a single kernel stack per processor
CN106569891A (en) Method and device for carrying out task scheduling in storage system
CN110069341A (en) What binding function configured on demand has the dispatching method of dependence task in edge calculations
CN109814985A (en) A kind of method for scheduling task and scheduler calculate equipment, system
US20130219395A1 (en) Batch scheduler management of tasks
CN109308212A (en) A kind of task processing method, task processor and task processing equipment
CN104820616B (en) A kind of method and device of task scheduling
CN111158875B (en) Multi-module-based multi-task processing method, device and system
US10031776B2 (en) Workflow job distribution in a data processing system with agent time window constraints
US11392388B2 (en) System and method for dynamic determination of a number of parallel threads for a request
CN110659119B (en) Picture processing method, device and system
CN116782249A (en) Edge computing unloading and resource allocation method and system with user dependency relationship
Sun et al. Real-time scheduling upon a host-centric acceleration architecture with data offloading

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20191015