CN109871266A - Task delay process method, apparatus, computer installation and storage medium - Google Patents
Task delay process method, apparatus, computer installation and storage medium Download PDFInfo
- Publication number
- CN109871266A CN109871266A CN201811536795.2A CN201811536795A CN109871266A CN 109871266 A CN109871266 A CN 109871266A CN 201811536795 A CN201811536795 A CN 201811536795A CN 109871266 A CN109871266 A CN 109871266A
- Authority
- CN
- China
- Prior art keywords
- task
- reserved resource
- delayed
- resource
- reserved
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 104
- 230000008569 process Effects 0.000 title claims abstract description 46
- 238000009434 installation Methods 0.000 title claims abstract description 33
- 230000003111 delayed effect Effects 0.000 claims description 62
- 238000004590 computer program Methods 0.000 claims description 20
- 230000006870 function Effects 0.000 description 15
- 238000012545 processing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 238000004891 communication Methods 0.000 description 5
- 230000002159 abnormal effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000007774 longterm Effects 0.000 description 4
- 238000013507 mapping Methods 0.000 description 4
- 230000006399 behavior Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000004422 calculation algorithm Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 235000013399 edible fruits Nutrition 0.000 description 2
- 238000012423 maintenance Methods 0.000 description 2
- 230000007246 mechanism Effects 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000036632 reaction speed Effects 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000005192 partition Methods 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Landscapes
- Debugging And Monitoring (AREA)
Abstract
The present invention provides a kind of task delay process method, it include: when receiving task requests, judge whether to generate that the task requests are corresponding to be returned the result within a preset time, when not generating that the task requests are corresponding to be returned the result in the preset time, obtains reserved resource;And the task is switched in the reserved resource and is executed, it is returned the result using the reserved resource generation task requests are corresponding.The present invention also provides a kind of task delay process device, computer installation and computer readable storage mediums.When task delay occurs in task implementation procedure for the present invention more than preset time, the task is continued to execute by switching to standby resources, can also effectively reduce the generation of major accident while improving user experience to reduce task delay.
Description
Technical field
The present invention relates to field of computer technology, and in particular to a kind of task delay process method and device, computer dress
It sets and computer readable storage medium.
Background technique
With the rapid development of computer technology, user requires increasingly the reaction speed of various softwares and application program
It is high.On the other hand, enterprise is in order to enable business flexibly to make a response rapidly under continually changing market condition, enterprise
Operation system software and application program be also required to the reaction speed of guarantee task, task delay is reduced, because once incumbent out
Business delay, gently then influences user experience, serious that major accident may occur, therefore, it is necessary to as much as possible reduce system
Task delay.
Summary of the invention
In view of the foregoing, it is necessary to propose a kind of task delay process method and device, computer installation and computer
Readable storage medium storing program for executing, to solve the case where task processing is delayed.
The first aspect of the application provides a kind of task delay process method, which comprises
When receiving task requests, judge whether to generate the corresponding return knot of the task requests within a preset time
Fruit determines that the task is delayed when not generating that the task requests are corresponding to be returned the result in the preset time;
When determining that the task is delayed, reserved resource is obtained;
Whether idle detect the reserved resource;
If detecting the reserved resource is in busy state, the task being currently delayed is lined up
It waits, and whether idle continues to detect the reserved resource;
If it is idle to detect the reserved resource, the task is switched in the reserved resource and is executed.
The task is switched in the reserved resource and is executed, generates the task requests pair using the reserved resource
That answers returns the result.
Preferably, the configuration method of the reserved resource includes: to receive the operational order for requesting reserved resource, wherein institute
Stating in the operational order of reserved resource includes the size for reserving resource, and the size of the reserved resource is according to past preset time
Resource maximum usage amount or average usage amount determine in all tasks inside executed;According to the behaviour for requesting reserved resource
Make the reserved resource that instruction reserves corresponding size.
Preferably, the method also includes: when determining that the task is delayed, generate task be delayed warning information,
And task delay warning information is sent to default personnel according to default advice method.
Preferably, the multiple tasks of preset value number are continued to exceed when same task delay number reaches preset times or
The warning information is sent when being delayed.
Preferably, when detecting while thering are multiple tasks to be delayed, the method also includes: by the multiple task
It is ranked up, wherein the sequence is ranked up or according to the multiple task according to the request time of the multiple task
Priority be ranked up;And the multiple task is successively executed according to the sequence using the reserved resource.
Preferably, successively executing the multiple task according to the sequence using the reserved resource includes: when execution institute
When stating a task in multiple tasks, judge whether the reserved resource still there are surplus resources;If there are surplus resources, institute is judged
State surplus resources whether execute enough it is next in the multiple task, if enough, being performed simultaneously next be delayed
Task, if not enough, according still further to the next task in the multiple task of the sequence execution after having executed current task.
It preferably, include more parts of reserved resources in the reserved resource, when the task quantity being delayed is greater than one,
By different reserved resources while to execute the task.
The second aspect of the application provides a kind of task delay process device, and described device includes:
Judgment module generates the task requests for judging whether when receiving task requests within a preset time
It is corresponding to return the result, when not generating that the task requests are corresponding to be returned the result in the preset time, determine described in
Task is delayed;
Reserved source obtaining module, for when determining that the task is delayed, obtaining reserved resource;
Switching module, it is whether idle for detecting the reserved resource;If detecting the reserved resource is in busy
Whether state then waits in line the currently task that is delayed, and continue to detect the reserved resource idle;If
It is idle to detect the reserved resource, then the task is switched in the reserved resource and is executed, utilize the reserved resource
Generate that the task requests are corresponding to be returned the result.
The third aspect of the application provides a kind of computer installation, and the computer installation includes processor, the processing
Device is for realizing foregoing task delay process method when executing the computer program stored in memory.
The fourth aspect of the application provides a kind of computer readable storage medium, is stored thereon with computer program, described
Foregoing task delay process method is realized when computer program is executed by processor.
The present invention occur in task implementation procedure task delay be more than preset time when, by switch to standby resources after
It is continuous to execute the task, the generation of major accident can be also effectively reduced while improving user experience to reduce task delay.
Task delay situation is generated into warning information simultaneously and notifies related personnel, facilitates related personnel to check in time and solves exception.
Detailed description of the invention
Fig. 1 is the application environment configuration diagram for the task delay process method that the embodiment of the present invention one provides.
Fig. 2 is task delay process method flow diagram provided by Embodiment 2 of the present invention.
Fig. 3 is the structural schematic diagram for the task delay process device that the embodiment of the present invention three provides.
Fig. 4 is the computer installation schematic diagram that the embodiment of the present invention four provides.
Specific embodiment
To better understand the objects, features and advantages of the present invention, with reference to the accompanying drawing and specific real
Applying example, the present invention will be described in detail.It should be noted that in the absence of conflict, embodiments herein and embodiment
In feature can be combined with each other.
In the following description, numerous specific details are set forth in order to facilitate a full understanding of the present invention, described embodiment is only
It is only a part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill
Personnel's every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Unless otherwise defined, all technical and scientific terms used herein and belong to technical field of the invention
The normally understood meaning of technical staff is identical.Term as used herein in the specification of the present invention is intended merely to description tool
The purpose of the embodiment of body, it is not intended that in the limitation present invention.
Embodiment one
As shown in fig.1, the application environment schematic diagram of the task delay process method provided for the embodiment of the present invention one.
Task delay process method in the present invention is applied to lead to including computer installation 1 and with the computer installation 1
It crosses in the hardware environment at least one user terminal 2 that network is attached.
In the present embodiment, the computer installation 1 can be the electronic equipments such as server, desktop computer, wherein described
Server can be single server, or the server zone collectively constituted by several function servers.The user
Terminal 2, which can be, is equipped with application software/application program and the electronic equipment with network connecting function, for example, the user
Terminal 2 can be the equipment such as smart phone, tablet computer, personal desktop computer, laptop.
In one embodiment, the computer installation 1 and user terminal 2 can pass through wired (such as USB
(Universal Serial Bus, universal serial bus) or wirelessly establish communication connection.The wireless mode can be with
It is any type of conventional wireless mechanics of communication, such as radio, Wireless Fidelity (Wireless Fidelity, WIFI), bee
Nest, satellite, broadcast etc..Wireless communication technique may include, but be not limited to, global system for mobile communications (Global System
For Mobile Communications, GSM), General Packet Radio Service (General Packet Radio Service,
GPRS), CDMA (Code Division Multiple Access, CDMA), wideband code division multiple access (W-CDMA),
CDMA2000, Long Term Evolution (Long-Term Evolution, LTE), senior long term evolution technology, time-division long term evolution
Technology (Time-Division LTE, TD-LTE), full micro-wave access global inter communication (Worldwide Interoperability
For Microwave Access, WiMAX), ZigBee protocol (ZigBee), bluetooth, TD SDMA (Time
Division Synchronous Code Division Multiple Access, TD-SCDMA), evolution data optimization
(Evolution-Data Optimized, EV-DO), Digital Enhanced Cordless Communications (Digital Enhanced Cordless
Telecommunications, DECT) and other.
In the present embodiment, the computer installation 1 is used to receive the task that at least one described user terminal 2 is sent and asks
It asks, and executes corresponding task according to the task requests, and task action result is returned at least one described user terminal
2.For example, the computer installation 1 and at least one described user terminal 2 constitute a report inquiring system, the meter
Calculation machine device 1 is used to receive the data inquiry request that the user terminal 2 is sent, and receives data inquiry request according to described
Corresponding data is inquired in the database and generates data sheet, and it is whole that the data sheet of the generation is then returned to the user
End 2.
Embodiment two
It please refers to shown in Fig. 2, is the flow chart for the task delay process method that second embodiment of the invention provides.According to not
With demand, the sequence of step can change in the flow chart, and certain steps can be omitted.
Step S1, when receiving task requests, judge whether to generate the task requests within a preset time corresponding
It returns the result.If not generating within a preset time, the task requests are corresponding to be returned the result, it is determined that the task is prolonged
When, step S2 is executed, the task requests are corresponding to be returned the result if generating within a preset time, continues to execute the step
S1。
For example, when the task delay process method is applied to the report generation system that server and user terminal form
When in system, the user terminal provides the data query page for user input data inquiry request, and the user terminal will be described
Data inquiry request is sent to the server, after the server receives the data inquiry request, according to the data
Inquiry request inquires database and generates report file according to query result, and the report file is then returned to user's end
End.So in the step S1, sentence after receiving the data inquiry request that the user terminal is sent in the server
Whether the server that breaks generates the report file in the preset time, if not generating report in the preset time
File, it is determined that report generation task is delayed.
The preset time can be configured by user as desired by being manually entered, for example, the preset time
It can be 3 seconds, 5 seconds, but not limited to this.
Step S2, reserved resource is obtained.
In the operating system for supporting Multi-task Concurrency, since task is completed by process or thread, because of task
Quantity can exceed that the quantity of CPU or core, so, multiple tasks may share the same CPU or core, this requires one kind
Hardware mechanisms can allow operating system to realize switching among different tasks, this is the hardware foundation of task schedule.In general, meter
The clock interrupt that calculation machine provides realizes task schedule, that is to say, that per at regular intervals, hardware system can be triggered in one
It is disconnected;Operating system intercepts and captures this interruption, suspends being currently executing for task according to certain algorithm, and select a new task,
To realize the switching of task;When arriving to next clock interrupt, it is further continued for such handoff procedure.Therefore, multiple tasks
It can be executed in turn in a CPU or core.In this way, the task in the step S1 does not return the result within a preset time
When, the resource for executing this task may be switched to other tasks, cause this task that can not continue to execute.Cause
This, the present invention in order to avoid this kind of situation, in systems configured in advance reserve resource, using the reserved resource as
Standby resources are for continuing to execute being delayed for task.
In one embodiment, the configuration method of the reserved resource are as follows:
1) operational order for requesting reserved resource is received;
2) reserved resource, the reserved resource accordingly is reserved according to the operational order for requesting reserved resource only to exist
Use when task is abnormal, in no abnormal task, the free time is as standby resources.
It wherein, include the size for requesting reserved resource in the operational order, operating system refers to receiving the operation
After order, according to the reserved resource of size for requesting reserved resource in the operational order.
In one embodiment, the method for determining the size of the reserved resource be may is that
1) the resource service condition in all tasks executed in statistics past preset time (such as 1 year);
2) resource maximum usage amount in all tasks executed in the preset time in the past is determined;
3) using the size of the resource maximum usage amount as the size of reserved resource.
In another embodiment, the calculation method of the size of the reserved resource be may is that
1) the resource service condition in all tasks executed in statistics past preset time;
2) average resource usage amount is calculated according to resource usage amount in all tasks executed in past preset time;
3) using the size of the average resource usage amount as the size of reserved resource.
In one embodiment, the reserved resource may include the resource of local computing resource, storage resource, I/O equipment
Deng.Computing resource can be CPU (Central Processing Unit, central processing unit), and storage resource can be memory
(RAM, random access storage device) etc..
In another embodiment, the reserved resource is special stand-by equipment, and the stand-by equipment can be special
Standby server, cloud server, other computers in computer cluster etc..
Step S3, whether idle the reserved resource is detected, if detecting the reserved resource is in busy state, example
When being carrying out the task that other are delayed such as the reserved resource, S4 is thened follow the steps, being currently delayed for task
Waited in line and whether idle continues to detect the reserved resource;If it is idle to detect the reserved resource, step is executed
The task is switched in the reserved resource and is executed by rapid S5, and it is corresponding to generate the task requests using the reserved resource
Return the result.
It is continued to execute, can effectively be subtracted by the way that being delayed in implementation procedure for task is switched to spare reserved resource
Few task delay or failure, accident caused by capable of also being effectively reduced while improving user experience because of task delay.
In the system for supporting Multi-task Concurrency, when multiple tasks are performed simultaneously, in fact it could happen that while having multiple tasks hair
The case where raw delay, occurs delay and all needs in task delay process method provided by the invention when detecting multiple tasks
When switching to the reserved resource, it can be solved described by following several embodiments.
In the first embodiment, when detecting multiple tasks and being delayed, perform the following operations:
1) the task requests time of the multiple being delayed for task is obtained;
2) the multiple being delayed for task is ranked up according to the task requests time, request time is earliest
Before coming most, request time coming the latest is last;
3) task is successively executed according to the sequence using the reserved resource.
In second of embodiment, when detecting multiple tasks and being delayed, perform the following operations:
1) priority of each being delayed for task is obtained;
In one embodiment, the priority is arranged in the task requests;
In another embodiment, the mapping table of a task and priority is previously stored in the system, it is described to reflect
It penetrates in relation table and is stored with task type or the corresponding priority of task names, by searching for described in mapping table determination
The corresponding priority of the task requests being delayed;
2) being delayed for the task is ranked up according to priority, before the task of highest priority is come most,
Priority is lower to be come more below;
3) task is successively executed according to the sequence using the reserved resource.
Wherein, in the first above-mentioned embodiment and second of embodiment, can also include the following steps:
When executing being delayed for the task in order by the reserved resource, whether the reserved resource is judged
Still there are surplus resources;
If there are surplus resources, judge whether the surplus resources execute next being delayed for task enough, if enough,
It is performed simultaneously next being delayed for task, if not enough, executing next be delayed again after having executed current task
Task.
It may include more parts of reserved resources in the reserved resource, when being delayed for task in the third embodiment
When quantity is greater than one, by different reserved resources while to execute the task.
In one embodiment, task delay process method provided by the invention can also include the following steps:
1) task delay warning information is generated according to being delayed for task;
2) task delay warning information is sent to default personnel according to default advice method, it is described default to notify
Worker tasks, which run, there is exception, and operation maintenance personnel is facilitated to solve exception in time.
The default advice method can include but is not limited to the instant messaging tools such as mail, short message, wechat, message notifying
Frame, popup web page etc., naturally it is also possible to be that above-mentioned several push modes combine.
In one embodiment, when same task delay number reaches preset times (such as 3 times) or continue to exceed default
The multiple tasks of value number (such as 3) send the warning information when being delayed.
Above-mentioned Fig. 2 describes task delay process method of the invention in detail, schemes below with reference to 3-4, described in realization
The functional module of the software service of task delay process method and the hardware device frame for realizing the task delay process method
Structure is introduced.
It should be understood that the embodiment is only purposes of discussion, do not limited by this structure in patent claim.
Embodiment three
Fig. 3 is the structure chart of task delay process device preferred embodiment of the present invention.
In some embodiments, the task delay process device 10 is run in computer installation.The computer dress
It sets by being connected to the network user terminal.The task delay process device 10 may include multiple being made of program code segments
Functional module.The program code of each program segment in the task delay process device 10 can store in computer installation
Memory in, and as performed by least one described processor, to realize task delay process function.
In the present embodiment, function of the task delay process device 10 according to performed by it can be divided into multiple
Functional module.As shown in fig.3, the functional module may include: judgment module 101, reserved source obtaining module 102, cut
Change the mold block 103 and cue module 104.The so-called module of the present invention refer to one kind can performed by least one processor and
The series of computation machine program segment of fixed function can be completed, storage is in memory.In the present embodiment, about each module
Function will be described in detail in subsequent embodiment.
The judgment module 101 is used for after receiving task requests, judges whether to generate described appoint within a preset time
Business request is corresponding to be returned the result, if judgment module 101 determines that not generating the task requests in the preset time corresponds to
Return the result, it is determined that the task is delayed.
For example, when the task delay process method is applied to the report generation system that server and user terminal form
When in system, the user terminal provides the data query page for user input data inquiry request, and the user terminal will be described
Data inquiry request is sent to the server, after the server receives the data inquiry request, according to the data
Inquiry request inquires database and generates report file according to query result, and the report file is then returned to user's end
End.The so described judgment module 101 after receiving the data inquiry request that the user terminal is sent, is sentenced in the server
Whether the server that breaks generates the report file in the preset time, if not generating report in the preset time
File, it is determined that report generation task is delayed.
The preset time can be configured by user as desired by being manually entered, for example, the preset time
It can be 30 seconds, 1 minute, but not limited to this.
The reserved source obtaining module 102 is used to not generate institute within a preset time in the judgment module 101 determination
When stating that task requests are corresponding to be returned the result, reserved resource is obtained.
In the operating system for supporting Multi-task Concurrency, since task is completed by process or thread, because of task
Quantity can exceed that the quantity of CPU or core, so, multiple tasks may share the same CPU or core, this requires one kind
Hardware mechanisms can allow operating system to realize switching among different tasks, this is the hardware foundation of task schedule.In general, meter
The clock interrupt that calculation machine provides realizes task schedule, that is to say, that per at regular intervals, hardware system can be triggered in one
It is disconnected;Operating system intercepts and captures this interruption, suspends being currently executing for task according to certain algorithm, and select a new task,
To realize the switching of task;When arriving to next clock interrupt, it is further continued for such handoff procedure.Therefore, multiple tasks
It can be executed in turn in a CPU or core.In this way, when not returned the result within a preset time for the task requests,
The resource for executing this task may be switched to other tasks, cause this task that can not continue to execute.Therefore, originally
In invention in order to avoid this kind of situation, configured in advance reserves resource in systems, using the reserved resource as spare
Resource is for continuing to execute being delayed for task.
In one embodiment, the configuration method of the reserved resource are as follows:
1) operational order for requesting reserved resource is received;
2) reserved resource, the reserved resource accordingly is reserved according to the operational order for requesting reserved resource only to exist
Use when task is abnormal, in no abnormal task, the free time is as standby resources.
It wherein, include the size for requesting reserved resource in the operational order, operating system refers to receiving the operation
After order, according to the reserved resource of size for requesting reserved resource in the operational order.
In one embodiment, the calculation method of the size of the reserved resource be may is that
1) the resource service condition in all tasks executed in statistics past preset time (such as 1 year);
2) resource maximum usage amount in all tasks executed in the preset time in the past is determined;
3) using the size of the resource maximum usage amount as the size of reserved resource.
In another embodiment, the calculation method of the size of the reserved resource be may is that
1) the resource service condition in all tasks executed in statistics past preset time;
2) average resource usage amount is calculated according to resource usage amount in all tasks executed in past preset time;
3) using the size of the average resource usage amount as the size of reserved resource.
In one embodiment, the reserved resource may include the resource of local computing resource, storage resource, I/O equipment
Deng.Computing resource can be CPU (Central Processing Unit, central processing unit), and storage resource can be memory
(RAM, random access storage device) etc..
In another embodiment, the reserved resource is special stand-by equipment, and the stand-by equipment can be special
Standby server, cloud server, other computers in computer cluster etc..
Whether the switching module 103 is idle for detecting the reserved resource;If detecting the reserved resource to be in
Busy state, such as when the reserved resource is carrying out the task that other are delayed, then times that will be currently delayed
Whether business is waited in line, and continue to detect the reserved resource idle;If it is idle to detect the reserved resource, by institute
The task of stating is switched in the reserved resource and is executed, and is generated the corresponding return of the task requests using the reserved resource and is tied
Fruit.
It is continued to execute, can effectively be subtracted by the way that being delayed in implementation procedure for task is switched to spare reserved resource
Few task delay or failure, accident caused by capable of also being effectively reduced while improving user experience because of task delay.
In the system for supporting Multi-task Concurrency, when multiple tasks are performed simultaneously, in fact it could happen that while having multiple tasks hair
The case where raw delay, occurs delay and all needs in task delay process method provided by the invention when detecting multiple tasks
When switching to the reserved resource, the switching module 103 can be solved by following several embodiments.
In the first embodiment, when detecting multiple tasks and being delayed, the switching module 103 executes following behaviour
Make:
1) the task requests time of the multiple being delayed for task is obtained;
2) the multiple being delayed for task is ranked up according to the task requests time, request time is earliest
Before coming most, request time coming the latest is last;
3) task is successively executed according to the sequence using the reserved resource.
In second of embodiment, when detecting multiple tasks and being delayed, the switching module 103 executes following behaviour
Make:
1) priority of each being delayed for task is obtained;
In one embodiment, the priority is arranged in the task requests;
In another embodiment, the mapping table of a task and priority is previously stored in the system, it is described to reflect
It penetrates in relation table and is stored with task type or the corresponding priority of task names, by searching for described in mapping table determination
The corresponding priority of the task requests being delayed;
2) being delayed for the task is ranked up according to priority, before the task of highest priority is come most,
Priority is lower to be come more below;
3) task is successively executed according to the sequence using the reserved resource.
Wherein, in the first above-mentioned embodiment and second of embodiment, the switching module 103 also executes as follows
Operation:
When executing being delayed for the task in order by the reserved resource, implementation judges the reserved resource
Whether surplus resources are still had;
If there are surplus resources, judge whether the surplus resources execute next being delayed for task enough, if enough,
It is performed simultaneously next being delayed for task, if not enough, executing next be delayed again after having executed current task
Task.
It may include more parts of reserved resources in the reserved resource, when being delayed for task in the third embodiment
When quantity is greater than one, by different reserved resources while to execute the task.
The cue module 104 is used to that it is pre- to generate task delay when the judgment module 101 determines that task is delayed
Alert information, and task delay warning information is sent to default personnel according to default advice method, it is described default to prompt
Worker tasks, which run, there is exception, and operation maintenance personnel is facilitated to solve exception in time.
The default advice method can include but is not limited to the instant messaging tools such as mail, short message, wechat, message notifying
Frame, popup web page etc., naturally it is also possible to be that above-mentioned several push modes combine.
In one embodiment, the cue module 104 is when same task delay number reaches preset times (such as 3 times)
Or it continues to exceed when the multiple tasks of preset value number (such as 3) are delayed and sends the warning information.
Example IV
Fig. 4 is the schematic diagram of computer installation preferred embodiment of the present invention.
The computer installation 1 includes memory 20, processor 30 and is stored in the memory 20 and can be in institute
State the computer program 40 run on processor 30, such as task delay process program.The processor 30 executes the calculating
The step in above-mentioned task delay process embodiment of the method, such as step S1~S3 shown in Fig. 2 are realized when machine program 40.Or
Person, the processor 30 realized when executing the computer program 40 each module in above-mentioned task delay process Installation practice/
The function of unit, such as the module 101-104 in Fig. 3.
Illustratively, the computer program 40 can be divided into one or more module/units, it is one or
Multiple module/units are stored in the memory 20, and are executed by the processor 30, to complete the present invention.Described one
A or multiple module/units can be the series of computation machine program instruction section that can complete specific function, and described instruction section is used
In implementation procedure of the description computer program 40 in the computer installation 1.For example, the computer program 40 can be with
Judgment module 101, reserved source obtaining module 102, switching module 103 and the cue module 104 being divided into Fig. 3.Each mould
Block concrete function is referring to embodiment three.
The computer installation 1 can be the calculating such as desktop PC, notebook, palm PC and cloud server and set
It is standby.It will be understood by those skilled in the art that the schematic diagram is only the example of computer installation 1, do not constitute to computer
The restriction of device 1 may include perhaps combining certain components or different components, example than illustrating more or fewer components
Such as described computer installation 1 can also include input-output equipment, network access equipment, bus.
Alleged processor 30 can be central processing unit (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), specific integrated circuit
(Application Specific Integrated Circuit, ASIC), ready-made programmable gate array (Field-
Programmable Gate Array, FPGA) either other programmable logic device, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor 30 is also possible to any conventional processing
Device etc., the processor 30 are the control centres of the computer installation 1, utilize various interfaces and the entire computer of connection
The various pieces of device 1.
The memory 20 can be used for storing the computer program 40 and/or module/unit, and the processor 30 passes through
Operation executes the computer program and/or module/unit being stored in the memory 20, and calls and be stored in memory
Data in 20 realize the various functions of the computer installation 1.The memory 20 can mainly include storing program area and deposit
Store up data field, wherein storing program area can application program needed for storage program area, at least one function (for example sound is broadcast
Playing function, image player function etc.) etc.;Storage data area, which can be stored, uses created data (ratio according to computer installation 1
Such as audio data, phone directory) etc..In addition, memory 20 may include high-speed random access memory, it can also include non-easy
The property lost memory, such as hard disk, memory, plug-in type hard disk, intelligent memory card (Smart Media Card, SMC), secure digital
(Secure Digital, SD) card, flash card (Flash Card), at least one disk memory, flush memory device or other
Volatile solid-state part.
If the integrated module/unit of the computer installation 1 is realized in the form of SFU software functional unit and as independence
Product when selling or using, can store in a computer readable storage medium.Based on this understanding, of the invention
It realizes all or part of the process in above-described embodiment method, can also instruct relevant hardware come complete by computer program
At the computer program can be stored in a computer readable storage medium, and the computer program is held by processor
When row, it can be achieved that the step of above-mentioned each embodiment of the method.Wherein, the computer program includes computer program code, institute
Stating computer program code can be source code form, object identification code form, executable file or certain intermediate forms etc..It is described
Computer-readable medium may include: any entity or device, recording medium, U that can carry the computer program code
Disk, mobile hard disk, magnetic disk, CD, computer storage, read-only memory (ROM, Read-Only Memory), arbitrary access
Memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium etc..It needs
It is bright, the content that the computer-readable medium includes can according in jurisdiction make laws and patent practice requirement into
Row increase and decrease appropriate, such as do not include electric load according to legislation and patent practice, computer-readable medium in certain jurisdictions
Wave signal and telecommunication signal.
In several embodiments provided by the present invention, it should be understood that arriving, disclosed computer installation and method can
To realize by another way.For example, computer installation embodiment described above is only schematical, for example, institute
The division of unit is stated, only a kind of logical function partition, there may be another division manner in actual implementation.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in same treatment unit
It is that each unit physically exists alone, can also be integrated in same unit with two or more units.Above-mentioned integrated list
Member both can take the form of hardware realization, can also realize in the form of hardware adds software function module.
It is obvious to a person skilled in the art that invention is not limited to the details of the above exemplary embodiments, Er Qie
In the case where without departing substantially from spirit or essential attributes of the invention, the present invention can be realized in other specific forms.Therefore, no matter
From the point of view of which point, the present embodiments are to be considered as illustrative and not restrictive, and the scope of the present invention is by appended power
Benefit requires rather than above description limits, it is intended that all by what is fallen within the meaning and scope of the equivalent elements of the claims
Variation is included in the present invention.Any reference signs in the claims should not be construed as limiting the involved claims.This
Outside, it is clear that one word of " comprising " does not exclude other units or steps, and odd number is not excluded for plural number.It is stated in computer installation claim
Multiple units or computer installation can also be implemented through software or hardware by the same unit or computer installation.The
One, the second equal words are used to indicate names, and are not indicated any particular order.
Finally it should be noted that the above examples are only used to illustrate the technical scheme of the present invention and are not limiting, although reference
Preferred embodiment describes the invention in detail, those skilled in the art should understand that, it can be to of the invention
Technical solution is modified or equivalent replacement, without departing from the spirit and scope of the technical solution of the present invention.
Claims (10)
1. a kind of task delay process method, which is characterized in that the described method includes:
When receiving task requests, judge whether to generate that the task requests are corresponding to be returned the result within a preset time, when
When not generating that the task requests are corresponding to be returned the result in the preset time, determine that the task is delayed;
When determining that the task is delayed, reserved resource is obtained;
Whether idle detect the reserved resource;
If detecting the reserved resource is in busy state, the task being currently delayed is lined up etc.
To, and whether idle continue to detect the reserved resource;
If it is idle to detect the reserved resource, the task is switched in the reserved resource and is executed, using described pre-
Staying resource to generate, the task requests are corresponding to be returned the result.
2. task delay process method as described in claim 1, which is characterized in that the configuration method packet of the reserved resource
It includes:
Receive the operational order for requesting reserved resource, wherein include the big of reserved resource in the operational order of the reserved resource
Small, the size of the reserved resource is according to resource maximum usage amount in all tasks executed in past preset time or to put down
What equal usage amount determined;
The reserved resource of corresponding size is reserved according to the operational order for requesting reserved resource.
3. task delay process method as described in claim 1, which is characterized in that the method also includes: described in determination
When task is delayed, task delay warning information is generated, and by task delay warning information according to default advice method
It is sent to default personnel.
4. task delay process method as claimed in claim 3, which is characterized in that when same task delay number reaches default
When number or continues to exceed when the multiple tasks of preset value number are delayed and send the warning information.
5. task delay process method as described in claim 1, which is characterized in that when detecting while having multiple tasks
When delay, the method also includes:
The multiple task is ranked up, wherein it is described sequence be ranked up according to the request time of the multiple task or
It is to be ranked up according to the priority of the multiple task;And
The multiple task is successively executed according to the sequence using the reserved resource.
6. task delay process method as claimed in claim 5, which is characterized in that using the reserved resource according to the row
Sequence successively executes the multiple task
When executing a task in the multiple task, judge whether the reserved resource still there are surplus resources;
If there are surplus resources, it is next in the multiple task to judge whether the surplus resources execute enough, if enough,
It is performed simultaneously next being delayed for task, if not enough, according still further to described in sequence execution after having executed current task
Next task in multiple tasks.
7. task delay process method as described in claim 1, which is characterized in that include more parts reserved in the reserved resource
Resource, when the task quantity being delayed is greater than one, by different reserved resources while to execute the task.
8. a kind of task delay process device, which is characterized in that described device includes:
Judgment module, for when receiving task requests, judging whether that generating the task requests within a preset time corresponds to
Return the result, when not generating that the task requests are corresponding to be returned the result in the preset time, determine the task
It is delayed;
Reserved source obtaining module, for when determining that the task is delayed, obtaining reserved resource;
Switching module, it is whether idle for detecting the reserved resource;If detecting the reserved resource is in busy state,
Then the currently task that is delayed is waited in line, and whether idle continues to detect the reserved resource;If detecting
It is idle to the reserved resource, then the task is switched in the reserved resource and executed, generated using the reserved resource
The task requests are corresponding to be returned the result.
9. a kind of computer installation, it is characterised in that: the computer installation includes processor, and the processor is deposited for executing
Such as task delay process method of any of claims 1-7 is realized when the computer program stored in reservoir.
10. a kind of computer readable storage medium, is stored thereon with computer program, it is characterised in that: the computer program
Such as task delay process method of any of claims 1-7 is realized when being executed by processor.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811536795.2A CN109871266B (en) | 2018-12-15 | 2018-12-15 | Task delay processing method and device, computer device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811536795.2A CN109871266B (en) | 2018-12-15 | 2018-12-15 | Task delay processing method and device, computer device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109871266A true CN109871266A (en) | 2019-06-11 |
CN109871266B CN109871266B (en) | 2024-05-14 |
Family
ID=66917086
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811536795.2A Active CN109871266B (en) | 2018-12-15 | 2018-12-15 | Task delay processing method and device, computer device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109871266B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765213A (en) * | 2020-12-31 | 2021-05-07 | 永辉云金科技有限公司 | Second-generation credit investigation automation query method, system and computer equipment |
CN113326074A (en) * | 2021-06-30 | 2021-08-31 | 中国平安人寿保险股份有限公司 | Delay event processing method and device, computer equipment and storage medium |
CN114116203A (en) * | 2021-10-29 | 2022-03-01 | 苏州浪潮智能科技有限公司 | Resource calling control method, resource calling control device and storage medium |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060212875A1 (en) * | 2005-03-16 | 2006-09-21 | International Business Machines Corporation | Method and system for task mapping to iteratively improve task assignment in a heterogeneous computing system |
WO2007043142A1 (en) * | 2005-10-05 | 2007-04-19 | Fujitsu Limited | Job management device and job management program |
CN103257900A (en) * | 2013-05-24 | 2013-08-21 | 杭州电子科技大学 | Real-time task set resource reservation method on multiprocessor for reducing CPU occupation |
US20140207740A1 (en) * | 2013-01-23 | 2014-07-24 | Microsoft Corporation | Isolating Resources and Performance in a Database Management System |
CN104780146A (en) * | 2014-01-13 | 2015-07-15 | 华为技术有限公司 | Resource manage method and device |
CN105718312A (en) * | 2016-01-20 | 2016-06-29 | 华南理工大学 | Multi-queue back-filling job scheduling method oriented to living organism gene sequencing calculation task |
US20160335013A1 (en) * | 2004-05-11 | 2016-11-17 | International Business Machines Corporation | Support of non-trivial scheduling policies along with topological properties |
-
2018
- 2018-12-15 CN CN201811536795.2A patent/CN109871266B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20160335013A1 (en) * | 2004-05-11 | 2016-11-17 | International Business Machines Corporation | Support of non-trivial scheduling policies along with topological properties |
US20060212875A1 (en) * | 2005-03-16 | 2006-09-21 | International Business Machines Corporation | Method and system for task mapping to iteratively improve task assignment in a heterogeneous computing system |
WO2007043142A1 (en) * | 2005-10-05 | 2007-04-19 | Fujitsu Limited | Job management device and job management program |
US20140207740A1 (en) * | 2013-01-23 | 2014-07-24 | Microsoft Corporation | Isolating Resources and Performance in a Database Management System |
CN103257900A (en) * | 2013-05-24 | 2013-08-21 | 杭州电子科技大学 | Real-time task set resource reservation method on multiprocessor for reducing CPU occupation |
CN104780146A (en) * | 2014-01-13 | 2015-07-15 | 华为技术有限公司 | Resource manage method and device |
CN105718312A (en) * | 2016-01-20 | 2016-06-29 | 华南理工大学 | Multi-queue back-filling job scheduling method oriented to living organism gene sequencing calculation task |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112765213A (en) * | 2020-12-31 | 2021-05-07 | 永辉云金科技有限公司 | Second-generation credit investigation automation query method, system and computer equipment |
CN113326074A (en) * | 2021-06-30 | 2021-08-31 | 中国平安人寿保险股份有限公司 | Delay event processing method and device, computer equipment and storage medium |
CN113326074B (en) * | 2021-06-30 | 2022-04-15 | 中国平安人寿保险股份有限公司 | Delay event processing method and device, computer equipment and storage medium |
CN114116203A (en) * | 2021-10-29 | 2022-03-01 | 苏州浪潮智能科技有限公司 | Resource calling control method, resource calling control device and storage medium |
CN114116203B (en) * | 2021-10-29 | 2024-01-09 | 苏州浪潮智能科技有限公司 | Resource call control method, resource call control device and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN109871266B (en) | 2024-05-14 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10789109B2 (en) | Information processing method and device and computer storage medium | |
CN112162865B (en) | Scheduling method and device of server and server | |
EP3355187A1 (en) | Loading method and device for terminal application (app) | |
WO2021159638A1 (en) | Method, apparatus and device for scheduling cluster queue resources, and storage medium | |
EP3110106A1 (en) | Disaster recovery data center configuration method and apparatus in cloud computing architecture | |
CN109840142A (en) | Thread control method, device, electronic equipment and storage medium based on cloud monitoring | |
CN109871266A (en) | Task delay process method, apparatus, computer installation and storage medium | |
CN110166524A (en) | Switching method, device, equipment and the storage medium of data center | |
CN111897637B (en) | Job scheduling method, device, host and storage medium | |
US20240160474A1 (en) | Multi-core processor task scheduling method, and device and storage medium | |
CN110262878B (en) | Timed task processing method, device, equipment and computer readable storage medium | |
CN110119307B (en) | Data processing request processing method and device, storage medium and electronic device | |
CN110347427A (en) | The optimization method and device of web page code | |
CN111371848A (en) | Request processing method, device, equipment and storage medium | |
CN110955501A (en) | Service request processing method and device, electronic equipment and readable medium | |
WO2023174037A1 (en) | Resource scheduling method, apparatus and system, device, medium, and program product | |
CN109840141A (en) | Thread control method, device, electronic equipment and storage medium based on cloud monitoring | |
CN114625533A (en) | Distributed task scheduling method and device, electronic equipment and storage medium | |
CN111240864A (en) | Asynchronous task processing method, device, equipment and computer readable storage medium | |
CN115658311A (en) | Resource scheduling method, device, equipment and medium | |
CN110912967A (en) | Service node scheduling method, device, equipment and storage medium | |
US10083201B2 (en) | System for maintaining consistency across a decentralized database cluster and method therefor | |
CN111209333B (en) | Data updating method, device, terminal and storage medium | |
CN113515366A (en) | Bus load balancing processing method and device and storage medium | |
CN115412610A (en) | Flow scheduling method and device under fault scene |
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 |