CN109558255A - A kind of method and Task Processing Unit of task processing - Google Patents

A kind of method and Task Processing Unit of task processing Download PDF

Info

Publication number
CN109558255A
CN109558255A CN201811525937.5A CN201811525937A CN109558255A CN 109558255 A CN109558255 A CN 109558255A CN 201811525937 A CN201811525937 A CN 201811525937A CN 109558255 A CN109558255 A CN 109558255A
Authority
CN
China
Prior art keywords
task
pending
pending task
queue
type
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
CN201811525937.5A
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.)
Guangdong Inspur Smart Computing Technology Co Ltd
Original Assignee
Guangdong Inspur Big Data Research Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Inspur Big Data Research Co Ltd filed Critical Guangdong Inspur Big Data Research Co Ltd
Priority to CN201811525937.5A priority Critical patent/CN109558255A/en
Publication of CN109558255A publication Critical patent/CN109558255A/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/54Interprogram communication
    • 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/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

This application discloses a kind of methods of task processing, comprising: receives pending task;The pending task is inserted into corresponding task queue according to the task type of the pending task, the task queue be it is pre-set, which is used to the pending task being put into corresponding thread pool, to execute the pending task;When meeting preset condition, the corresponding call back function of the pending task is called, to return to the implementing result of the pending task.The embodiment of the present application also provides corresponding Task Processing Unit.Technical scheme is due to being inserted into corresponding task queue for pending task according to the task type of pending task, so that corresponding thread pool executes the pending task, avoiding can be executed with the pending task of asynchronous operation by synchronous mode, and task execution efficiency is improved.

Description

A kind of method and Task Processing Unit of task processing
Technical field
This application involves field of computer technology, and in particular to a kind of method and Task Processing Unit of task processing.
Background technique
Traditional multithreading service model once has task to ask using the strategy of " creation immediately is destroyed immediately " Arrival is asked, is created that a new thread and by the thread execution task, after the completion of task execution, then destroys the thread.If appointing The execution time of business is shorter, and execution number is frequent, then threading service device will be in ceaselessly creation thread and a destruction The state of thread, this will cause a large amount of overhead.The appearance of Thread Pool Technology solves " creation immediately is destroyed immediately " Tactful bring overhead problem.
Within the storage system, some tasks can be handled by asynchronous operation, but be executed by the method for synchronization, Efficiency is lower.
Summary of the invention
The embodiment of the present application provides a kind of method of task processing, can will be wait hold according to the task type of pending task Row task is inserted into different task queues, so that different thread pools executes the pending task, provides a kind of asynchronous The processing mode of operation is avoided to be executed with the pending task of asynchronous operation by the method for synchronization, improves task execution effect Rate also reduces creation, destroying threads bring overhead.
In order to achieve the above objectives, the embodiment of the present application provides the following technical solutions:
The application first aspect provides a kind of method of task processing, and this method may include: to receive pending task;Root The pending task is inserted into corresponding task queue according to the task type of the pending task, the task queue is pre- First it is arranged, the task queue is used to the pending task being put into corresponding thread pool, to execute described pending Business;When meeting preset condition, the corresponding call back function of the pending task is called, to obtain holding for the pending task Row result.
Optionally, with reference to the above first aspect, in the first possible implementation, described according to described pending The pending task is inserted into corresponding task queue by the task type of business, comprising: when the task class of the pending task When type is emergency task, the pending task is inserted into the first task queue being pre-created, the first task queue is used In the pending task to be put into the first thread pond being pre-created.
Optionally, with reference to the above first aspect, in the second possible implementation, described according to described pending The pending task is inserted into corresponding task queue by the task type of business, comprising: when the task class of the pending task When type is non-emergent task, the pending task is inserted into the second task queue being pre-created, second task queue For the pending task to be put into the second thread pool being pre-created.
Optionally, with reference to the above first aspect, first aspect the first or second of possible implementation, at the third In possible implementation, the pending task is inserted into corresponding by the task type according to the pending task It is engaged in after queue, further includes: the timing since the pending task is inserted into corresponding task queue;It is described to work as the default item of satisfaction When part, the corresponding call back function of the pending task is called, comprising: when the pending task is inserted into corresponding task queue When duration afterwards reaches preset duration, the corresponding call back function of the pending task is called.
Optionally, with reference to the above first aspect, first aspect the first or second of possible implementation, at the 4th kind In possible implementation, the pending task is inserted into corresponding by the task type according to the pending task It is engaged in after queue, further includes: monitor the corresponding file of the pending task;It is described when meeting preset condition, described in calling The corresponding call back function of pending task, comprising: iostream occurs when listening to the corresponding file of the pending task When (input output stream, IO) event, the corresponding call back function of the pending task is called.
The application second aspect provides a kind of Task Processing Unit, the apparatus may include receiving unit, for receive to Execution task;Be inserted into unit, for according to the task type of the received pending task of the receiving unit will it is described to Execution task is inserted into corresponding task queue, the task queue be it is pre-set, the task queue be used for will it is described to Execution task is put into corresponding thread pool, to execute the pending task;Call unit, for working as the insertion unit for institute When stating pending task to be inserted into after corresponding task queue, and meeting preset condition, call the pending task corresponding Call back function, to obtain the implementing result of the pending task.
Optionally, in conjunction with above-mentioned second aspect, in the first possible implementation, the insertion unit includes: One insertion module, for the pending task being inserted into pre- when the task type of the pending task is emergency task The first task queue first created, the first task queue are used to the pending task being put into the First Line being pre-created Cheng Chi.
Optionally, in conjunction with above-mentioned second aspect, in the second possible implementation, the insertion unit includes: Two insertion modules, for when the task type of the pending task is non-emergent task, the pending task to be inserted into The second task queue being pre-created, second task queue are used to the pending task being put into second be pre-created Thread pool.
The application third aspect provides a kind of Task Processing Unit, which includes: processor and memory; The memory is for storing computer executed instructions, and when Task Processing Unit operation, which executes the memory and deposit The computer executed instructions of storage, so that the Task Processing Unit executes such as above-mentioned first aspect or first aspect, any one may The method of the task processing of implementation.
The application fourth aspect provides a kind of computer readable storage medium, is stored in the computer readable storage medium Instruction, when run on a computer, allowing computer to execute above-mentioned first aspect or first aspect, any one can The method for being able to achieve the task processing of mode.
The 5th aspect of the application provides a kind of computer program product comprising instruction, when run on a computer, The method for allowing computer to execute the task processing of above-mentioned first aspect or first aspect any one possible implementation.
The 6th aspect of the application provides a kind of chip system, which includes processor, for supporting task to handle Device realizes function involved in above-mentioned first aspect or first aspect any one possible implementation.In a kind of possibility Design in, chip system further includes memory, the memory for save the necessary program instruction of the Task Processing Unit and Data.The chip system, can be made of chip, also may include chip and other discrete devices.
From above-mentioned technical proposal it is found that the method for task provided by the embodiments of the present application processing can be according to pending task Task type pending task is inserted into different task queues so that different thread pools executes this pending Business, provides a kind of processing mode of asynchronous operation, avoids to execute with the pending task of asynchronous operation by the method for synchronization, Improve task execution efficiency.
Detailed description of the invention
Fig. 1 is method one embodiment schematic diagram that task is handled in the embodiment of the present application;
Fig. 2 is another embodiment schematic diagram of method that task is handled in the embodiment of the present application;
Fig. 3 is another embodiment schematic diagram of method that task is handled in the embodiment of the present application;
Fig. 4 is Task Processing Unit one embodiment schematic diagram in the embodiment of the present application;
Fig. 5 is another embodiment schematic diagram of Task Processing Unit in the embodiment of the present application.
Specific embodiment
With reference to the accompanying drawing, embodiments herein is described, it is clear that described embodiment is only the application The embodiment of a part, instead of all the embodiments.Those of ordinary skill in the art it is found that with figure Computational frame differentiation With the appearance of new opplication scene, technical solution provided by the embodiments of the present application is equally applicable for similar technical problem.
The embodiment of the present application provides a kind of method of task processing, can will be to according to the task type of pending task Execution task is inserted into different task queues, so that different thread pools executes the pending task, provides a kind of different The processing mode for walking operation is avoided to be executed with the pending task of asynchronous operation by the method for synchronization, improves task execution Efficiency.
The description and claims of this application and term " first " in above-mentioned attached drawing, " second " etc. are for distinguishing Similar object, without being used to describe a particular order or precedence order.It should be understood that the data used in this way are in appropriate feelings It can be interchanged under condition, so that the embodiments described herein can be real with the sequence other than the content for illustrating or describing herein It applies.In addition, term " includes " and " having " and their any deformation, it is intended that cover it is non-exclusive include, for example, packet The process, method, system, product or equipment for having contained series of steps or module those of be not necessarily limited to be clearly listed step or Module, but may include other steps being not clearly listed or intrinsic for these process, methods, product or equipment or Module.Occur in this application to step carry out name perhaps number be not meant to must according to name or number Indicated time/logic sequencing executes the step in method flow, and named or number process step can be with Execution order is changed according to the technical purpose to be realized, as long as identical or similar technical effect can be reached.This Shen Please appeared in module division, be a kind of division in logic, can have other division side when realizing in practical application Formula, such as multiple modules can be combined into or are integrated in another system, or some features can be ignored or not executed, separately Outside, shown or discussion mutual coupling, direct-coupling or communication connection can be through some interfaces, module Between indirect coupling or communication connection can be electrical or other similar form, be not construed as limiting in the application.Also, make It can be the separation that may not be physically for the module or submodule of separate part description, can be and may not be physics Module, or can be distributed in multiple circuit modules, some or all of modules can be selected according to the actual needs To realize the purpose of application scheme.
The application can be applied to the storage program of storage system, and each functional module for each storage program provides thread Pond service.Thread is the minimum unit that program executes stream.The thread of one standard is by Thread Id, current instruction pointer, register Set and storehouse composition.Thread is an entity in process, is the basic unit independently being dispatched and assigned by system due to line Mutual restriction between journey, causes thread to show discontinuity in operation, so thread also has three kinds of ready, obstruction and operation Basic status.Ready state refers to that thread has all conditions of operation, can run in logic, is waiting processor;Operation State refers to that thread occupies processor and is currently running;Blocked state refers to that thread is waiting an event (such as some semaphore), It not can be performed in logic.Thread pool is a kind of thread use pattern.Thread can excessively bring scheduling overhead, and then influence caching office Portion's property and overall performance.And thread pool maintains multiple threads, wait for supervision and management person distribution can asynchronous execution task.This The cost created when handling short-time duty with destroying threads is avoided, scheduling overhead is reduced.
The method that a kind of task processing provided by the embodiments of the present application is described below.
Fig. 1 is method one embodiment schematic diagram that task is handled in the embodiment of the present application.
As shown in Figure 1, method one embodiment that task is handled in the embodiment of the present application may include:
101, Task Processing Unit receives pending task.
In the present embodiment, pending task can be the task of each functional module of each storage program, at task Reason device can provide thread pool service for the task of each functional module of each storage program, that is, receive each storage program Each functional module the sending of the task, and execute the task.
102, pending task is inserted into corresponding task team according to the task type of pending task by Task Processing Unit Column.
In the present embodiment, there are many task type possibility of pending task, such as emergency task and non-emergent task, So first the task type of pending task is judged after Task Processing Unit receives pending task, it is different Task type have corresponding thread pool, which is pre-set, but Task Processing Unit is firstly the need of will be wait hold Row task is inserted into corresponding task queue, the task queue be it is pre-set, since the number of threads in thread pool is limited , task queue can be used for that pending task being put into corresponding thread pool in a certain order.
It should be noted that removing above-mentioned emergency task and non-emergent there are many task type of pending task is possible Other than business, task type is possible, and there are also other more detailed category divisions, so corresponding thread pool quantity may also have more, This is not limited here.
103, when meeting preset condition, the corresponding call back function of pending task is called.
In the present embodiment, due to task provided by the embodiments of the present application processing method be a kind of asynchronous operation processing Mode needs to be implemented the corresponding call back function of the pending task, to obtain the pending task so when meeting preset condition Implementing result so that thread pool, which can execute in task queue, is queued in other subsequent tasks of pending task.In one kind In specific embodiment, preset condition can be whether the duration that pending task enters after task queue meets preset duration, Or whether listens to the corresponding file of pending task and IO stream event occurs.When pending task enters the duration of task queue When reaching preset duration or when IO stream event occurs for the pending task corresponding file, that is, meet preset condition.
It should be noted that the duration that preset condition enters task queue except above-mentioned pending task reach preset duration or The corresponding file of pending task occurs to can also be other different conditions, specifically herein without limitation other than IO stream event.
In the present embodiment, pending task can be inserted by Task Processing Unit according to the task type of pending task A kind of processing of asynchronous operation is provided to different task queues so that different thread pools executes the pending task Mode is avoided to be executed with the pending task of asynchronous operation by the method for synchronization, improves task execution efficiency.
Since the task type of pending task can be divided into emergency task and non-emergent task, separately below to both Situation is illustrated:
One, the task type of pending task is emergency task.
Fig. 2 is another embodiment schematic diagram of method that task is handled in the embodiment of the present application.
As shown in Fig. 2, another embodiment of method that task is handled in the embodiment of the present application includes:
201, Task Processing Unit receives pending task.
Step 201 is similar with above-mentioned steps 101 in the present embodiment, and detailed description can be with reference to the phase in above-mentioned steps 101 Description is closed, details are not described herein again to this.
202, when the task type of pending task is emergency task, pending task is inserted into first be pre-created Task queue.
In the present embodiment, first task queue is corresponding with first thread pond, which is to be pre-created, and uses In the thread pool of processing emergency task, when not having idle thread in first thread pond, pending task is needed first It is lined up in business queue, idle thread is waited to execute.
203, when meeting preset condition, the corresponding call back function of pending task is called.
Step 201 is similar with above-mentioned steps 101 in the present embodiment, and detailed description can be with reference to the phase in above-mentioned steps 101 Description is closed, details are not described herein again to this.
In the present embodiment, it when Task Processing Unit judges the task type of pending task for emergency task, can incite somebody to action The pending task is inserted into first task queue, so as to execute this pending in first task queue corresponding first thread pond The number of threads of task, the first thread pond is more, so task execution efficiency is higher, is more suitable for carrying out an urgent task.
Two, the task type of pending task is non-emergent task.
Fig. 3 is another embodiment schematic diagram of method that task is handled in the embodiment of the present application.
As shown in figure 3, another embodiment of method that task is handled in the embodiment of the present application includes:
301, Task Processing Unit receives pending task.
Step 301 is similar with above-mentioned steps 101 in the present embodiment, and detailed description can be with reference to the phase in above-mentioned steps 101 Description is closed, details are not described herein again to this.
302, when the task type of pending task is non-emergent task, the insertion of pending task is pre-created the Two task queues.
In the present embodiment, the second task queue is corresponding with the second thread pool, which is to be pre-created, and uses In the thread pool for handling non-emergent task, when not having idle thread in the second thread pool, pending task is needed second It is lined up in task queue, idle thread is waited to execute.Compared with first thread pond, the number of threads of the second thread pool is less, institute Can be used for executing non-emergent task, when non-emergent task and emergency task being avoided to share the same thread pool, influence promptly to appoint The execution of business.
303, when meeting preset condition, the corresponding call back function of pending task is called.
Step 301 is similar with above-mentioned steps 101 in the present embodiment, and detailed description can be with reference to the phase in above-mentioned steps 101 Description is closed, details are not described herein again to this.
In the present embodiment, when Task Processing Unit judges the task type of pending task for non-emergent task, meeting The pending task is inserted into the second task queue, so that corresponding second thread pool of the second task queue is executed and is somebody's turn to do wait hold The number of threads of row task, second thread pool is less compared with first thread pond, is more suitable for executing non-emergent task, to keep away Exempt from the execution efficiency of influence emergency task.
The method of the task processing in the embodiment of the present application is described above, below in the embodiment of the present application Task Processing Unit is described.
Fig. 4 is Task Processing Unit one embodiment schematic diagram in the embodiment of the present application.
As shown in figure 4, Task Processing Unit one embodiment may include: in the embodiment of the present application
Receiving unit 401, for receiving pending task;
Be inserted into unit 402, for according to the task type of the received pending task of the receiving unit 401 by institute State pending task and be inserted into corresponding task queue, the task queue be it is pre-set, the task queue is used for institute It states pending task and is put into corresponding thread pool, to execute the pending task;
Call unit 403, for when the insertion unit 402 by the corresponding task queue of the pending task insertion it Afterwards, when and meeting preset condition, the corresponding call back function of the pending task is called, to obtain holding for the pending task Row result.
Optionally, insertion unit 402 can further include:
First insertion module 4021, for when the task type of the pending task is emergency task, will it is described to Execution task is inserted into the first task queue being pre-created, and the first task queue is pre- for the pending task to be put into The first thread pond first created.
Optionally, insertion unit 402 can further include:
Second insertion module 4022 will be described for when the task type of the pending task is non-emergent task Pending task is inserted into the second task queue being pre-created, and second task queue is for the pending task to be put into The second thread pool being pre-created.
Optionally, Task Processing Unit one embodiment can also include: in the embodiment of the present application
Timing unit 404, for the timing since the pending task is inserted into corresponding task queue;
Call unit 403 can further include:
First calling module 4031 reaches pre- for duration after the pending task is inserted into corresponding task queue If when duration, calling the corresponding call back function of the pending task.
Optionally, Task Processing Unit one embodiment can also include: in the embodiment of the present application
Monitoring unit 405, for monitoring the corresponding file of the pending task;
Call unit 403 can further include:
Second calling module 4032, for occurring when monitoring unit 405 listens to the corresponding file of the pending task When input and output IO flows event, the corresponding call back function of the pending task is called.
The Task Processing Unit in the embodiment of the present application is described from the angle of modular functionality entity above, below The Task Processing Unit in the embodiment of the present application is described from the angle of hardware handles.
Fig. 5 is another embodiment schematic diagram of Task Processing Unit in the embodiment of the present application.
As shown in figure 5, another embodiment of Task Processing Unit includes: in the embodiment of the present application
Processor 501, memory 502 and bus 503.
Wherein, processor 501 has control action to the operation of Task Processing Unit, and processor 501 can also be known as center Processing unit (central processing unit, CPU).Memory 502 may include that read-only memory and arbitrary access are deposited Reservoir, and instruction and data is provided to processor 501.The a part of of memory 502 can also include that non-volatile random accesses Memory (non-volatile random access memory, NVRAM).In specific application, Task Processing Unit it is each A component is coupled by bus system 503, and wherein bus system 503 can also include in addition to including data/address bus Power bus, control bus and status signal bus in addition etc..But for the sake of clear explanation, various buses are all designated as in figure Bus system 503.
Memory 502 stores following element, executable modules or data structures perhaps their subset or Their superset:
Operational order: including various operational orders, for realizing various operations;
Operating system: including various system programs, for realizing various basic businesses and the hardware based task of processing.
Wherein, pass through the operational order for calling memory 502 to store, processor 501, for executing in the embodiment of the present application The step of Task Processing Unit executes.
The method that above-mentioned the embodiment of the present application discloses can be applied in processor 501, or be realized by processor 501. Processor 501 may be a kind of IC chip, the processing capacity with signal.During realization, the above method it is each Step can be completed by the integrated logic circuit of the hardware in processor 501 or the instruction of software form.Above-mentioned processing Device 501 can be general processor, digital signal processor (digital signal processing, DSP), dedicated 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.It may be implemented or execute disclosed each method, step and the logic diagram in the embodiment of the present application.It is general Processor can be microprocessor or the processor is also possible to any conventional processor etc..In conjunction with the embodiment of the present application institute The step of disclosed method, can be embodied directly in hardware decoding processor and execute completion, or with the hardware in decoding processor And software module combination executes completion.Software module can be located at random access memory, and flash memory, read-only memory may be programmed read-only In the storage medium of this fields such as memory or electrically erasable programmable memory, register maturation.The storage medium is located at The step of memory 502, processor 501 reads the information in memory 502, completes the above method in conjunction with its hardware.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or any combination thereof real It is existing.When implemented in software, it can entirely or partly realize in the form of a computer program product.
The computer program product includes one or more computer instructions.Load and execute on computers the meter When calculation machine program instruction, entirely or partly generate according to process or function described in the embodiment of the present application.The computer can To be general purpose computer, special purpose computer, computer network or other programmable devices.The computer instruction can be deposited Storage in a computer-readable storage medium, or from a computer readable storage medium to another computer readable storage medium Transmission, for example, the computer instruction can pass through wired (example from a web-site, computer, server or data center Such as coaxial cable, optical fiber, Digital Subscriber Line (DSL)) or wireless (such as infrared, wireless, microwave) mode to another website Website, computer, server or data center are transmitted.The computer readable storage medium can be computer and can deposit Any usable medium of storage either includes that the data storages such as one or more usable mediums integrated server, data center are set It is standby.The usable medium can be magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or partly lead Body medium (such as solid state hard disk Solid State Disk (SSD)) etc..
Those of ordinary skill in the art will appreciate that all or part of the steps in the various methods of above-described embodiment is can It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage Medium may include: ROM, RAM, disk or CD etc..
Detailed Jie has been carried out to the method and Task Processing Unit of the processing of task provided by the embodiment of the present application above It continues, specific examples are used herein to illustrate the principle and implementation manner of the present application, and the explanation of above embodiments is only It is to be used to help understand the method for this application and its core ideas;At the same time, for those skilled in the art, according to this Shen Thought please, there will be changes in the specific implementation manner and application range, in conclusion the content of the present specification should not manage Solution is the limitation to the application.

Claims (10)

1. a kind of method of task processing characterized by comprising
Receive pending task;
The pending task is inserted into corresponding task queue, the task team according to the task type of the pending task Column be it is pre-set, the task queue is used to the pending task being put into corresponding thread pool, with execute it is described to Execution task;
When meeting preset condition, the corresponding call back function of the pending task is called, to obtain the pending task Implementing result.
2. the method according to claim 1, wherein the task type according to the pending task is by institute It states pending task and is inserted into corresponding task queue, comprising:
When the task type of the pending task is emergency task, the pending task is inserted into first be pre-created Task queue, the first task queue are used to the pending task being put into the first thread pond being pre-created.
3. the method according to claim 1, wherein the task type according to the pending task is by institute It states pending task and is inserted into corresponding task queue, comprising:
When the task type of the pending task is non-emergent task, the pending task insertion is pre-created the Two task queues, second task queue are used to the pending task being put into the second thread pool being pre-created.
4. method according to claim 1 to 3, which is characterized in that the task class according to the pending task The pending task is inserted into after corresponding task queue by type, further includes:
The timing since the pending task is inserted into corresponding task queue;
It is described when meeting preset condition, call the corresponding call back function of the pending task, comprising:
When the duration that the pending task is inserted into after corresponding task queue reaches preset duration, described pending is called It is engaged in corresponding call back function.
5. method according to claim 1 to 3, which is characterized in that the task class according to the pending task The pending task is inserted into after corresponding task queue by type, further includes:
Monitor the corresponding file of the pending task;
It is described when meeting preset condition, call the corresponding call back function of the pending task, comprising:
When listening to the corresponding file of the pending task input and output IO stream event occurring, the pending task is called Corresponding call back function.
6. a kind of Task Processing Unit characterized by comprising
Receiving unit, for receiving pending task;
Be inserted into unit, for according to the task type of the received pending task of the receiving unit by described pending Corresponding task queue is inserted into business, the task queue be it is pre-set, the task queue is used for described pending Business is put into corresponding thread pool, to execute the pending task;
Call unit is used for after the pending task is inserted into corresponding task queue by the insertion unit, and meets When preset condition, the corresponding call back function of the pending task is called, to obtain the implementing result of the pending task.
7. Task Processing Unit according to claim 6, which is characterized in that the insertion unit includes:
First insertion module, for when the task type of the pending task be emergency task when, by the pending task It is inserted into the first task queue that is pre-created, the first task queue, which is used to for the pending task being put into, to be pre-created First thread pond.
8. Task Processing Unit according to claim 6, which is characterized in that the insertion unit includes:
Second insertion module, for when the task type of the pending task be non-emergent task when, by described pending The second task queue that business insertion is pre-created, second task queue are pre-created for the pending task to be put into The second thread pool.
9. a kind of Task Processing Unit characterized by comprising
Memory and processor,
The memory is for storing computer operation instruction;
The processor is for calling the computer operation instruction, to execute appointing as described in any one of claims 1 to 5 The method for being engaged in handling.
10. a kind of computer readable storage medium, which is characterized in that including computer operation instruction, when the computer operation When instruction is run on computers, so that the computer executes the side of task processing as described in any one in claim 1-5 Method.
CN201811525937.5A 2018-12-13 2018-12-13 A kind of method and Task Processing Unit of task processing Pending CN109558255A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811525937.5A CN109558255A (en) 2018-12-13 2018-12-13 A kind of method and Task Processing Unit of task processing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811525937.5A CN109558255A (en) 2018-12-13 2018-12-13 A kind of method and Task Processing Unit of task processing

Publications (1)

Publication Number Publication Date
CN109558255A true CN109558255A (en) 2019-04-02

Family

ID=65870068

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811525937.5A Pending CN109558255A (en) 2018-12-13 2018-12-13 A kind of method and Task Processing Unit of task processing

Country Status (1)

Country Link
CN (1) CN109558255A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134578A (en) * 2019-05-23 2019-08-16 浙江齐治科技股份有限公司 A kind of data processing method and device
CN110515710A (en) * 2019-08-06 2019-11-29 深圳市随手科技有限公司 Asynchronous task scheduling method, apparatus, computer equipment and storage medium
CN110928746A (en) * 2019-11-14 2020-03-27 杭州天宽科技有限公司 Configurable service processing system, method, device and storage medium
CN110990132A (en) * 2019-11-01 2020-04-10 浙江大搜车软件技术有限公司 Asynchronous task processing method and device, computer equipment and storage medium
CN111597019A (en) * 2020-04-22 2020-08-28 深圳中兴网信科技有限公司 Call request processing method, device, terminal and computer readable storage medium
CN111625329A (en) * 2020-05-18 2020-09-04 北京达佳互联信息技术有限公司 Task allocation method and device, electronic equipment, server and storage medium
CN111767125A (en) * 2020-06-15 2020-10-13 杭州数梦工场科技有限公司 Task execution method and device, electronic equipment and storage medium
CN112000454A (en) * 2020-08-27 2020-11-27 平安国际智慧城市科技股份有限公司 Multimedia data processing method and equipment
CN112256773A (en) * 2019-07-22 2021-01-22 沅圣科技股份有限公司 Enterprise management system docking method, electronic device and storage medium
CN112446697A (en) * 2020-11-12 2021-03-05 深圳海付移通科技有限公司 Account checking method and device, computer equipment and storage medium
CN112561326A (en) * 2020-12-15 2021-03-26 青岛海尔科技有限公司 Task execution method and device, storage medium and electronic device
CN114510336A (en) * 2022-04-14 2022-05-17 广州世炬网络科技有限公司 Single-thread resource scheduling method, device, equipment and storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN117524029A (en) * 2024-01-05 2024-02-06 武汉精立电子技术有限公司 Test signal generation system and panel detection equipment
CN112446697B (en) * 2020-11-12 2024-05-28 深圳海付移通科技有限公司 Account checking method, account checking device, computer equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103473129A (en) * 2013-09-18 2013-12-25 柳州市博源环科科技有限公司 Multi-task queue scheduling system with scalable number of threads and implementation method thereof
US20140201757A1 (en) * 2012-12-21 2014-07-17 International Business Machines Corporation Processor provisioning by a middleware processing system for a plurality of logical processor partitions
CN104917833A (en) * 2015-06-08 2015-09-16 北京集奥聚合网络技术有限公司 Asynchronous information processing method based on NIO request
CN106569891A (en) * 2016-11-09 2017-04-19 郑州云海信息技术有限公司 Method and device for carrying out task scheduling in storage system
CN106802826A (en) * 2016-12-23 2017-06-06 中国银联股份有限公司 A kind of method for processing business and device based on thread pool

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140201757A1 (en) * 2012-12-21 2014-07-17 International Business Machines Corporation Processor provisioning by a middleware processing system for a plurality of logical processor partitions
CN103473129A (en) * 2013-09-18 2013-12-25 柳州市博源环科科技有限公司 Multi-task queue scheduling system with scalable number of threads and implementation method thereof
CN104917833A (en) * 2015-06-08 2015-09-16 北京集奥聚合网络技术有限公司 Asynchronous information processing method based on NIO request
CN106569891A (en) * 2016-11-09 2017-04-19 郑州云海信息技术有限公司 Method and device for carrying out task scheduling in storage system
CN106802826A (en) * 2016-12-23 2017-06-06 中国银联股份有限公司 A kind of method for processing business and device based on thread pool

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘焕进: "《MATLAB N个实用技巧:MATLAB中文论坛精华总结》", 31 October 2016 *

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134578A (en) * 2019-05-23 2019-08-16 浙江齐治科技股份有限公司 A kind of data processing method and device
CN112256773A (en) * 2019-07-22 2021-01-22 沅圣科技股份有限公司 Enterprise management system docking method, electronic device and storage medium
CN110515710A (en) * 2019-08-06 2019-11-29 深圳市随手科技有限公司 Asynchronous task scheduling method, apparatus, computer equipment and storage medium
CN110990132A (en) * 2019-11-01 2020-04-10 浙江大搜车软件技术有限公司 Asynchronous task processing method and device, computer equipment and storage medium
CN110990132B (en) * 2019-11-01 2023-03-10 浙江大搜车软件技术有限公司 Asynchronous task processing method and device, computer equipment and storage medium
CN110928746A (en) * 2019-11-14 2020-03-27 杭州天宽科技有限公司 Configurable service processing system, method, device and storage medium
CN110928746B (en) * 2019-11-14 2023-10-24 杭州天宽科技有限公司 Configurable business processing system, method, device and storage medium
CN111597019A (en) * 2020-04-22 2020-08-28 深圳中兴网信科技有限公司 Call request processing method, device, terminal and computer readable storage medium
CN111625329A (en) * 2020-05-18 2020-09-04 北京达佳互联信息技术有限公司 Task allocation method and device, electronic equipment, server and storage medium
CN111767125A (en) * 2020-06-15 2020-10-13 杭州数梦工场科技有限公司 Task execution method and device, electronic equipment and storage medium
CN111767125B (en) * 2020-06-15 2023-07-25 杭州数梦工场科技有限公司 Task execution method, device, electronic equipment and storage medium
CN112000454A (en) * 2020-08-27 2020-11-27 平安国际智慧城市科技股份有限公司 Multimedia data processing method and equipment
CN112446697A (en) * 2020-11-12 2021-03-05 深圳海付移通科技有限公司 Account checking method and device, computer equipment and storage medium
CN112446697B (en) * 2020-11-12 2024-05-28 深圳海付移通科技有限公司 Account checking method, account checking device, computer equipment and storage medium
CN112561326A (en) * 2020-12-15 2021-03-26 青岛海尔科技有限公司 Task execution method and device, storage medium and electronic device
CN114510336A (en) * 2022-04-14 2022-05-17 广州世炬网络科技有限公司 Single-thread resource scheduling method, device, equipment and storage medium
CN115328670A (en) * 2022-06-27 2022-11-11 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN115328670B (en) * 2022-06-27 2023-11-17 光大环境科技(中国)有限公司 Asynchronous task processing method, system and server
CN117524029A (en) * 2024-01-05 2024-02-06 武汉精立电子技术有限公司 Test signal generation system and panel detection equipment

Similar Documents

Publication Publication Date Title
CN109558255A (en) A kind of method and Task Processing Unit of task processing
CN103778016B (en) Multiline procedure processor
US9454408B2 (en) Managing network utility of applications on cloud data centers
US20170180220A1 (en) Techniques to Generate Workload Performance Fingerprints for Cloud Infrastructure Elements
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
US8108571B1 (en) Multithreaded DMA controller
EP2908252B1 (en) Inter-core communication apparatus and method
CN107851039A (en) System and method for resource management
CN106897132A (en) The method and device of a kind of server task scheduling
CN107526645B (en) A kind of communication optimization method and system
CN108563493A (en) A kind of event-driven method, device, equipment and readable storage medium storing program for executing
CN104580396A (en) Task scheduling method, node and system
CN105337896A (en) Message processing method and device
WO2022068697A1 (en) Task scheduling method and apparatus
CN106502767B (en) A kind of process management method and its device
CN110046038A (en) A kind of task processing method and device based on thread pool
US20120284720A1 (en) Hardware assisted scheduling in computer system
WO2019134304A1 (en) Task processing method and apparatus, electronic terminal, and readable storage medium
CN109783232A (en) Video data handling procedure, device and storage medium
CN107491346A (en) A kind of task processing method of application, apparatus and system
WO2016105732A1 (en) Techniques to generate a graph model for cloud infrastructure elements
CN104516478B (en) Plant capacity is throttled
CN107368367A (en) Processing method, device and the electronic equipment of resource allocation
CN104391656A (en) IO (input/ output) resource allocation method and device of storage device and storage device
CN112162852A (en) Multi-architecture CPU node management method, device and related components

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: 20190402