CN106648874A - Processing method and device for batched task - Google Patents
Processing method and device for batched task Download PDFInfo
- Publication number
- CN106648874A CN106648874A CN201611259195.7A CN201611259195A CN106648874A CN 106648874 A CN106648874 A CN 106648874A CN 201611259195 A CN201611259195 A CN 201611259195A CN 106648874 A CN106648874 A CN 106648874A
- Authority
- CN
- China
- Prior art keywords
- requesting party
- tasks
- thread
- priority level
- batch
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/48—Program initiating; Program switching, e.g. by interrupt
- G06F9/4806—Task transfer initiation or dispatching
- G06F9/4843—Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
- G06F9/4881—Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/46—Multiprogramming arrangements
- G06F9/52—Program synchronisation; Mutual exclusion, e.g. by means of semaphores
Abstract
The invention provides a processing method and device for a batched task. The method comprises the steps that when the quantity of the batched task required by a requester to be processed exceeds the maximum task number of a single thread, a priority level corresponding to the requester is obtained, when the requester corresponds to a low priority level, one thread is started, and finally the started thread is utilized to conduct asynchronous processing on the processing request of the batched task, with the quantity exceeding the maximum task number of the single thread, of the requester, In this way, by conducting classification of high and low priority levels on requesters and under the condition that the quantity of the batched task required by the requester in the low priority level to be processed exceeds the maximum task number of the single thread, a scheme that only one thread is started to conduct asynchronous processing (namely non-real time processing) on the processing request of the batched task of the requester is designed for the requester in the low priority level, accordingly, the occupancy of thread resources can be effectively reduced when the batched task is processed, background thread resources are saved, and then the processing capacity of a system is improved.
Description
Technical field
The invention belongs to multitasking technique field, more particularly to a kind of processing method and processing device of batch tasks.
Background technology
In current financial field, the batch processing demand of multitask is usually present, for example, cash batch is examined in enterprise
In criticizing transaction, bank's associated processing system is commonly present the situation for needing to be processed the batch examination & approval task of multiple clients.
In the processing mode of prior art, for the batch tasks process demand of each client, system typically can be according to every
The task amount of the batch tasks of individual client request, is that each client accordingly starts single thread (task amount of client is without departing from list
During the maximum number of tasks of thread) or multiple threads when the maximum number of tasks of single thread (task amount of client beyond) carry out client crowd
The synchronization of amount task requests is (real-time) to be processed.However, system is conditional in the maximum thread that synchronization can be opened,
When the Thread Count having been turned on reaches the upper limit, then the delay process that client can be caused to ask, based on this, for the place of lift system
How reason ability, in the process scene of batch tasks, reduce processing thread resources occupancy when client asks, and saves backstage
Thread resources become particularly significant.
The content of the invention
In view of this, it is an object of the invention to provide a kind of processing method and processing device of batch tasks, it is intended to effectively drop
Thread resources occupancy when low batch tasks are processed, saves the thread resources on backstage, and then the disposal ability of lift system.
For this purpose, the present invention is disclosed directly below technical scheme:
A kind of processing method of batch tasks, including:
The batch tasks for obtaining requesting party process request, and the batch tasks process request includes that requesting party identifies and waits to locate
The mission bit stream of the batch tasks of reason, the mission bit stream includes the task amount of batch tasks;
Whether the task amount for determining the batch tasks exceeds the maximum number of tasks of single thread;
If it was exceeded, obtaining the corresponding priority level of the requesting party based on requesting party mark;Wherein, it is described excellent
First rank is the advance high priority for dividing and the one kind in low priority level;
When the corresponding priority level of the requesting party is low priority level, start a thread, and using the institute for starting
State batch tasks described in a thread asynchronous process and process request.
Said method, it is preferred that described that the corresponding priority level of the requesting party, bag are obtained based on requesting party mark
Include:
White list information in the configuration file that acquisition is pre-configured with, it is other comprising low priority in the white list information
The identification information of each possible requesting party;Wherein, the other requesting party of low priority is:Process to batch tasks process request
Actual effect requires relatively low requesting party;
Whether determine in the white list information comprising requesting party mark;
If comprising the corresponding priority level of the requesting party is low priority level;If not including, the requesting party couple
The priority level answered is high priority.
Said method, it is preferred that also include:
If the task amount of the batch tasks is without departing from the maximum number of tasks of single thread, start a thread, and profit
The batch tasks are processed with the one thread synchronization for starting process request.
Said method, it is preferred that also include:
When the corresponding priority level of the requesting party is high priority, according to the task amount and list of the batch tasks
The maximum number of tasks of thread, it is determined that the number of threads of the multithreading that need to start;
Start quantity be determined by number of threads multiple threads, and using described batch of the plurality of thread synchronization process
The process request of amount task.
Said method, it is preferred that also include:
The result processed batch tasks process request is read, the result is assembled into and is met
The response message of predetermined demand, and return the response message.
A kind of processing meanss of batch tasks, including:
First acquisition unit, the batch tasks for obtaining requesting party process request, and the batch tasks process request bag
The mission bit stream of requesting party's mark and pending batch tasks is included, the mission bit stream includes the task amount of batch tasks;
Determining unit, for determining whether the task amount of the batch tasks exceeds the maximum number of tasks of single thread;
Second acquisition unit, in maximum number of tasks of the task amount of the batch tasks beyond single thread, being based on
Requesting party's mark obtains the corresponding priority level of the requesting party;Wherein, the priority level is the advance Gao You for dividing
One kind in first rank and low priority level;
First processing units, for when the corresponding priority level of the requesting party is low priority level, starting a line
Journey, and process request using batch tasks described in the one thread asynchronous process for starting.
Said apparatus, it is preferred that the second acquisition unit, are further used for:
White list information in the configuration file that acquisition is pre-configured with, it is other comprising low priority in the white list information
The identification information of each possible requesting party;Wherein, the other requesting party of low priority is:Process to batch tasks process request
Actual effect requires relatively low requesting party;Whether determine in the white list information comprising requesting party mark;If comprising, institute
The corresponding priority level of requesting party is stated for low priority level;If not including, the corresponding priority level of the requesting party is Gao You
First rank.
Said apparatus, it is preferred that also include:
Second processing unit, in maximum number of tasks of the task amount of the batch tasks without departing from single thread, opening
A thread is moved, and the batch tasks are processed using the one thread synchronization for starting and process request.
Said apparatus, it is preferred that also include:
3rd processing unit, for when the corresponding priority level of the requesting party is high priority, according to described batch
The task amount of amount task and the maximum number of tasks of single thread, it is determined that the number of threads of the multithreading that need to start;Startup quantity is institute
It is determined that number of threads multiple threads, and process request using the plurality of thread synchronization process batch tasks.
Said apparatus, it is preferred that also include:
As a result the batch tasks are processed the result that request is processed by response unit for reading, will be described
Result is assembled into and meets the response message of predetermined demand, and returns the response message.
A kind of processing method and processing device of the batch tasks provided from above scheme, the present invention, asks in requesting party
When asking the task amount of the batch tasks of process to exceed the maximum number of tasks of single thread, the corresponding priority level of requesting party is obtained, and
In requesting party's correspondence low priority level, start a thread, a final thread using startup is come asynchronous process requesting party
Beyond single thread maximum number of tasks batch tasks process request.It can be seen that, the present invention is high and low preferential by carrying out to requesting party
Partition of the level, and ask the task amount for processing to exceed the situation of single thread maximum number of tasks in the other requesting party of low priority
Under, it is that a kind of low priority one thread of other only startup of requesting party's design carrys out asynchronous process (i.e. Non real-time processing) requesting party crowd
The scheme of amount task process request, can effectively reduce thread resources occupancy when batch tasks are processed, and save the thread on backstage
Resource, and then the disposal ability of lift system.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
The accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are only this
Inventive embodiment, for those of ordinary skill in the art, on the premise of not paying creative work, can be with basis
The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is the process flow figure of the batch tasks that the embodiment of the present invention one is provided;
Fig. 2 is the process flow figure of the batch tasks that the embodiment of the present invention two is provided;
Fig. 3 is the process flow figure of the batch tasks that the embodiment of the present invention three is provided;
Fig. 4 is the process flow figure of the batch tasks that the embodiment of the present invention four is provided;
Fig. 5 is being criticized using the present invention program realization in enterprise's cash in batches examination & approval transaction for the offer of the embodiment of the present invention four
The flow chart of amount examination & approval;
Fig. 6 is the processing device structure diagram of the batch tasks that the embodiment of the present invention five is provided.
Specific embodiment
For the sake of quoting and understanding, the technical term that hereinafter uses, write a Chinese character in simplified form or summary of abridging is explained as follows:
Batch is examined:Batch examines correspondence single examination & approval, refers in business flow processing, and operator can be to copending
Document carry out batch processing, backstage completes the batch review operation of copending document.
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
Embodiment one
The embodiment of the present invention one provides a kind of processing method of batch tasks, can be applicable to the batch tasks in the fields such as finance
In process, for example, in being particularly applicable to the process of enterprise's cash batch examination & approval transaction, with reference to Fig. 1, methods described can include
Following steps:
Step 101, the batch tasks process request for obtaining requesting party, the batch tasks process request includes that requesting party marks
Knowledge and the mission bit stream of pending batch tasks, the mission bit stream includes the task amount of batch tasks.
Wherein, exemplarily, for the processing procedure of enterprise's cash batch examination & approval transaction, the requesting party specifically may be used
To be the client of bank, and the process logic of the inventive method then specifically can perform realization on the backstage of bank's related system.
Based on this, this step can process request come real on banking system backstage by the batch tasks sent on receiving front-end
It is existing.The batch tasks process request for example can be client's proposition for task, the batch remittance task etc. of transferring accounts in batches
Process request, the mission bit stream comprising batch tasks in process request, such as task related data, general assignment amount are removed
Outside this, also identify including requesting party, requesting party's mark can be the relevant information for being capable of unique mark requesting party, for example
Can be requesting party's account, name or customer number etc..
Step 102, determine the task amount of the batch tasks whether beyond the maximum number of tasks of single thread.
After the batch tasks for obtaining requesting party process request, the batch tasks of requestor requests need to be turned with single process,
Now, need to first determine and process the Thread Count that requestor requests need to start, based on this, need to first determine whether that requesting party asks to process
Task amount whether beyond the maximum number of tasks of single thread.
Herein, it should be noted that the maximum number of tasks of the single thread, be single thread once can synchronization process (i.e.
Real-time processing) batch tasks maximum number of tasks, if primary distribution to single thread task amount exceed the maximum number of tasks,
Single thread cannot be guaranteed to the process synchronism of distributed task, be only capable of asynchronous process (Non real-time processing) to surpassing that it distributes
Go out the batch tasks of its maximum number of tasks.
Step 103, if it was exceeded, obtaining the corresponding priority level of the requesting party based on requesting party mark;Its
In, the priority level is the advance high priority for dividing and the one kind in low priority level.
In being different from prior art, when the task amount of the batch tasks of requestor requests process is appointed beyond the maximum of single thread
During business number, the process logic of batch tasks process is carried out for the corresponding multiple threads of its distribution without distinction to requesting party, this
Invention carries out the other division of different priorities to each possible requesting party (such as each client of bank) in advance, and will be different
Requesting party divides in advance high and low two kinds of different priority levels.
As a possible implementation, ageing requirement that specifically can be according to each possible requesting party to processing
To be pre-configured with corresponding priority level for it, the higher requesting party for processing ageing requirement, to avoid affecting visitor
Family experience, the priority level of such requesting party can be set to high priority, conversely, for process it is ageing require it is relatively low
Requesting party, then can be set to low priority level by its priority level.In other embodiments of the present invention, can be with according to other divisions
Divide according to the priority level to different requesting parties, for example, can be divided with significance level of foundation requesting party etc.,
When implementing the present invention, the partitioning standards of priority level specifically can be determined according to the actual requirements, and the present embodiment is not limited this
It is fixed.
On the basis of priority level division is carried out to each possible requesting party, the present invention is pre-configured with a configuration text
Part, concrete comprising the white list information for configuring in this document in advance in the configuration file, the white list information is for example concrete
Can be a white list list, all possible requesting party (the system institute that wherein white list list records system is safeguarded
The all clients for safeguarding) in be divided into the identification information of the other each requesting party of low priority.
Based on this, when requesting party asks the task amount of the batch tasks for processing beyond the maximum number of tasks of single thread,
Whether this step specifically can read to be included in the white list information in configuration file, and the white list information for judging to read and proposes this
Requesting party's mark of secondary request, such as includes, then would know that the requesting party for proposing this request is the other client of low priority;It is no
Then, if identified not comprising the requesting party in white list information, the requesting party for proposing this request is high priority visitor
Family.
Subsequently, according to the different step of the present invention the other requesting party of different priorities is patrolled using different process respectively
Volume.
Step 104, when the corresponding priority level of the requesting party is low priority level, start a thread, and utilize
Batch tasks process request described in the one thread asynchronous process for starting.
If the priority level that requesting party is determined in previous step is low priority, then it represents that requesting party's is ageing
Require relatively low, or the significance level of requesting party is relatively low etc., and based on this, the present invention is not opened for the other requesting party of low priority
Move multiple threads to process its batch tasks for exceeding single thread maximum number of tasks, but only start a thread and ask it place
The batch tasks of reason are processed, because the task amount of requestor requests is beyond the maximum number of tasks of single thread, so as to this kind of
In the case of, the request of requesting party described in the single thread asynchronous process for being started, i.e., by rationally reduce it is ageing require it is relatively low or
The thread resources of the relatively low low priority client of significance level take, and have reached the purpose for saving background thread resource.Saved
Thread resources, subsequently can be further used for requiring higher, or significance level higher high priority client to ageing
Request is processed.
A kind of processing method of the batch tasks provided from above scheme, the present invention, asks to process in requesting party
Batch tasks task amount beyond the maximum number of tasks of single thread when, obtain the corresponding priority level of requesting party, and in request
During side's correspondence low priority level, start a thread, it is final using thread the exceeding come asynchronous process requesting party for starting
The batch tasks of single thread maximum number of tasks process request.It can be seen that, the present invention is drawn by carrying out high and low priority level to requesting party
Point, and be low in the case where the other requesting party of low priority asks the task amount for processing to exceed single thread maximum number of tasks
A kind of requesting party's design one thread of only startup of priority level carrys out asynchronous process (i.e. Non real-time processing) requesting party's batch tasks
The scheme of request is processed, thread resources occupancy when batch tasks are processed can be effectively reduced, the thread resources on backstage are saved, is entered
And the disposal ability of lift system.
Embodiment two
In the present embodiment, the process flow figure of the batch tasks with reference to shown in Fig. 2, methods described can also include with
Lower step:
If the task amount of step 105, the batch tasks is without departing from the maximum number of tasks of single thread, start a line
Journey, and process the batch tasks process request using the one thread synchronization for starting.
Specifically, if requestor requests process batch tasks task amount without departing from single thread maximum number of tasks,
The batch tasks that a single thread can then be directly initiated to propose requesting party process request and process, due to appointing for being asked
Business amount without departing from single thread maximum number of tasks, so as to single thread can synchronization process this time ask.
Embodiment three
In the present embodiment, the process flow figure of the batch tasks with reference to shown in Fig. 3, methods described can also include with
Lower step:
Step 106, when the corresponding priority level of the requesting party be high priority when, according to the batch tasks appoint
The maximum number of tasks of business amount and single thread, it is determined that the number of threads of the multithreading that need to start;
Step 107, start quantity be determined by number of threads multiple threads, and using the plurality of thread synchronization at
Manage the batch tasks and process request.
If the priority level of requesting party is high priority, then it represents that the ageing requirement of requesting party is higher, or request
The significance level of side is higher etc., to avoid affecting customer experience, then using usual processing mode, asks to locate according to requesting party
The task amount of reason and the maximum number of tasks of single thread, it is determined that need for requesting party start multithreading number of threads, so as to
On the basis of this, startup meets the request that multiple threads of institute's quantification carry out synchronization process requesting party, and requesting party is effectively ensured please
Seek the ageing of process.
Example IV
In the present embodiment, the process flow figure of the batch tasks with reference to shown in Fig. 4, methods described can also include with
Lower step:
The result that step 108, reading are processed batch tasks process request, by the result group
Fill to meet the response message of predetermined demand, and return the response message.
It is a thread of its startup or the batch tasks processing procedure of multiple threads when the priority level according to requesting party
At the end of, backstage can read the batch tasks result of a corresponding thread or multiple threads, and assemble them into and meet
Predetermined demand, for example, meet predetermined format/represent the response message of form, and the response results are back into front end.
With reference to Fig. 5, Fig. 5 shows that one kind is examined in enterprise's cash batch examination & approval transaction using the present invention program realization batch
The flow chart criticized, wherein, this application scenarios of concluding the business are examined for enterprise's cash batch, when carrying out examining in batches, backstage needs
Batch request to sending on front end carries out batch and turns single and (refer to and sequentially carry out form to process using single in concrete thread
Task) operation, before carrying out batch and turning single operation, need to first determine a pending record (note in this batch tasks
Record one task of correspondence) count the maximum number of tasks for whether exceeding single thread;If without departing from, directly initiate main thread it is synchronous at
Reason client's request;If it was exceeded, obtaining the white list information in configuration file, and judge to send the client of transaction request on current
Whether it is client present in white list, if white list client, then only starts a thread, and immediately forward end is returned
" processing your request ", while in the client's request of rear end asynchronous process, subsequent clients can be checked in inquiry transaction
On the concrete disposition of approval request sent;If not white list client, then according to pending in the request sent on client
Record number determine the Thread Count N that need to start, and while start the approval request of N number of thread process client, when for above-mentioned each
When the thread or N number of thread process that the situation of kind is started is completed, backstage can forward end return result.
For above-mentioned application scenarios, the workflow examination and approval by the way that white list technology to be introduced enterprise's cash management system of the invention
In, i.e., the batch examination & approval for running into existing procedure examination & approval take the more problem of Thread Count, there is provided white list mechanism, for
Client's (can require relatively low client for ageing) in white list, to it specially treated is carried out, and only starts single thread
The request of the client in asynchronous process white list, can effectively save background thread resource.The present invention is based on the mechanism of white list
Workflow examination and approval process provides a new branch, can provide different treatment mechanisms to different clients, is not affecting application
In the case of processing main logic, by the configuration of white list, different levels, varigrained process can be provided for different user and patrolled
Volume, flexibility when improving system batch processing business, while also improving customer experience.
Embodiment five
The present embodiment five discloses a kind of processing meanss of batch tasks, the batch tasks processing meanss with reference to shown in Fig. 6
Structural representation, the device includes:
First acquisition unit 61, the batch tasks for obtaining requesting party process request, and the batch tasks process request
Including requesting party's mark and the mission bit stream of pending batch tasks, the mission bit stream includes the task amount of batch tasks;
Determining unit 62, for determining whether the task amount of the batch tasks exceeds the maximum number of tasks of single thread;Second obtains single
Unit 63, in maximum number of tasks of the task amount of the batch tasks beyond single thread, being obtained based on requesting party mark
Obtain the corresponding priority level of the requesting party;Wherein, the priority level is the advance high priority for dividing and low priority
One kind in not;First processing units 64, for when the corresponding priority level of the requesting party is low priority level, starting one
Individual thread, and process request using batch tasks described in the one thread asynchronous process for starting.
In an embodiment of the embodiment of the present invention, the second acquisition unit is further used for:Acquisition is pre-configured with
Configuration file in white list information, in the white list information comprising other each the possible requesting party of low priority mark
Knowledge information;Wherein, the other requesting party of low priority is:Relatively low request is required to the process actual effect of batch tasks process request
Side;Whether determine in the white list information comprising requesting party mark;If comprising the corresponding priority of the requesting party
Wei not low priority level;If not including, the corresponding priority level of the requesting party is high priority.
In an embodiment of the embodiment of the present invention, described device also includes:Second processing unit, at described batch
The task amount of amount task without departing from single thread maximum number of tasks when, start a thread, and using start one line
Batch tasks described in journey synchronization process process request.
In an embodiment of the embodiment of the present invention, described device also includes:3rd processing unit, for asking described
When the corresponding priority level in the side of asking is high priority, according to the task amount and the maximum task of single thread of the batch tasks
Number, it is determined that the number of threads of the multithreading that need to start;Start quantity be determined by number of threads multiple threads, and utilize institute
State multiple thread synchronizations and process the batch tasks process request.
In an embodiment of the embodiment of the present invention, described device also includes:As a result response unit, for reading to institute
State batch tasks and process the result that request is processed, the result is assembled into the response letter for meeting predetermined demand
Breath, and return the response message.
Herein, it should be noted that the description of the processing meanss of batch tasks that is related to of the present embodiment, with method above
Description is similar, and the beneficial effect with method is described, for the processing meanss of batch tasks of the invention are in the present embodiment
In the ins and outs that do not disclose, refer to the explanation of the inventive method embodiment, this enforcement does not remake to this and repeats.
Also, it should be noted that each embodiment in this specification is described by the way of progressive, each embodiment
What is stressed is all the difference with other embodiment, and identical similar part is mutually referring to i.e. between each embodiment
Can.
For convenience of description, describe system above or various modules are divided into function during device or unit is described respectively.
Certainly, the function of each unit can be realized in same or multiple softwares and/or hardware when the application is implemented.
As seen through the above description of the embodiments, those skilled in the art can be understood that the application can
Realize by the mode of software plus required general hardware platform.Based on such understanding, the technical scheme essence of the application
On prior art is contributed part in other words can be embodied in the form of software product, the computer software product
Can be stored in storage medium, such as ROM/RAM, magnetic disc, CD, including some instructions are used so that a computer equipment
(can be personal computer, server, either network equipment etc.) performs some of each embodiment of the application or embodiment
Method described in part.
Finally, in addition it is also necessary to explanation, herein, the relational terms of such as first, second, third and fourth or the like
It is used merely to make a distinction an entity or operation with another entity or operation, and not necessarily requires or imply these
There is any this actual relation or order between entity or operation.And, term " including ", "comprising" or its is any
Other variants are intended to including for nonexcludability, so that a series of process, method, article or equipment including key elements
Not only include those key elements, but also including other key elements being not expressly set out, or also include for this process, side
The intrinsic key element of method, article or equipment.In the absence of more restrictions, limited by sentence "including a ..."
Key element, it is not excluded that also there is other identical element in the process including the key element, method, article or equipment.
The above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of processing method of batch tasks, it is characterised in that include:
The batch tasks for obtaining requesting party process request, and the batch tasks process request includes that requesting party identifies and pending
The mission bit stream of batch tasks, the mission bit stream includes the task amount of batch tasks;
Whether the task amount for determining the batch tasks exceeds the maximum number of tasks of single thread;
If it was exceeded, obtaining the corresponding priority level of the requesting party based on requesting party mark;Wherein, the priority
One kind in the high priority that Wei do not divided in advance and low priority level;
When the corresponding priority level of the requesting party is low priority level, start a thread, and using described for starting
Batch tasks described in individual thread asynchronous process process request.
2. method according to claim 1, it is characterised in that described that the requesting party is obtained based on requesting party mark
Corresponding priority level, including:
White list information in the configuration file that is pre-configured with of acquisition, in the white list information comprising low priority it is other each
The identification information of possible requesting party;Wherein, the other requesting party of low priority is:Process actual effect to batch tasks process request
Property require relatively low requesting party;
Whether determine in the white list information comprising requesting party mark;
If comprising the corresponding priority level of the requesting party is low priority level;If not including, the requesting party is corresponding
Priority level is high priority.
3. method according to claim 1, it is characterised in that also include:
If the task amount of the batch tasks is without departing from the maximum number of tasks of single thread, start a thread, and utilization is opened
Dynamic one thread synchronization processes the batch tasks and processes request.
4. method according to claim 1, it is characterised in that also include:
When the corresponding priority level of the requesting party is high priority, according to the task amount and single thread of the batch tasks
Maximum number of tasks, it is determined that the number of threads of the multithreading that need to start;
Start quantity be determined by number of threads multiple threads, and appointed using the plurality of thread synchronization process batch
Business processes request.
5. the method according to any one of claim 1-4, it is characterised in that also include:
The result processed batch tasks process request is read, the result is assembled into and is met predetermined
The response message of demand, and return the response message.
6. a kind of processing meanss of batch tasks, it is characterised in that include:
First acquisition unit, the batch tasks for obtaining requesting party process request, and the batch tasks process request includes please
The mission bit stream of the side's of asking mark and pending batch tasks, the mission bit stream includes the task amount of batch tasks;
Determining unit, for determining whether the task amount of the batch tasks exceeds the maximum number of tasks of single thread;
Second acquisition unit, in maximum number of tasks of the task amount of the batch tasks beyond single thread, based on described
Requesting party's mark obtains the corresponding priority level of the requesting party;Wherein, the priority level is the advance high priority for dividing
One kind not and in low priority level;
First processing units, for when the corresponding priority level of the requesting party is low priority level, starting a thread, and
Request is processed using batch tasks described in the one thread asynchronous process for starting.
7. device according to claim 6, it is characterised in that the second acquisition unit, is further used for:
White list information in the configuration file that is pre-configured with of acquisition, in the white list information comprising low priority it is other each
The identification information of possible requesting party;Wherein, the other requesting party of low priority is:Process actual effect to batch tasks process request
Property require relatively low requesting party;Whether determine in the white list information comprising requesting party mark;If comprising described to ask
The corresponding priority level in the side of asking is low priority level;If not including, the corresponding priority level of the requesting party is high priority
Not.
8. device according to claim 6, it is characterised in that also include:
Second processing unit, in maximum number of tasks of the task amount of the batch tasks without departing from single thread, starting one
Individual thread, and process the batch tasks process request using the one thread synchronization for starting.
9. device according to claim 6, it is characterised in that also include:
3rd processing unit, for when the corresponding priority level of the requesting party is high priority, appointing according to the batch
The task amount of business and the maximum number of tasks of single thread, it is determined that the number of threads of the multithreading that need to start;Start quantity to be determined
Number of threads multiple threads, and process request using the plurality of thread synchronization process batch tasks.
10. the device according to any one of claim 6-9, it is characterised in that also include:
As a result the batch tasks are processed the result that request is processed, by the process by response unit for reading
As a result it is assembled into and meets the response message of predetermined demand, and returns the response message.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611259195.7A CN106648874B (en) | 2016-12-30 | 2016-12-30 | Processing method and device for batch tasks |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611259195.7A CN106648874B (en) | 2016-12-30 | 2016-12-30 | Processing method and device for batch tasks |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106648874A true CN106648874A (en) | 2017-05-10 |
CN106648874B CN106648874B (en) | 2020-05-22 |
Family
ID=58837454
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611259195.7A Active CN106648874B (en) | 2016-12-30 | 2016-12-30 | Processing method and device for batch tasks |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106648874B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108810557A (en) * | 2017-07-10 | 2018-11-13 | 北京视联动力国际信息技术有限公司 | A kind of method for processing video frequency, device, electronic equipment and storage medium |
CN112732417A (en) * | 2019-10-28 | 2021-04-30 | 北京京东振世信息技术有限公司 | Method and device for processing application request |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140013330A1 (en) * | 2012-07-06 | 2014-01-09 | Microsoft Corporation | Multiple core real-time task execution |
CN104407922A (en) * | 2014-10-29 | 2015-03-11 | 中国建设银行股份有限公司 | Asynchronous batch-processing dispatching method and system |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN105892996A (en) * | 2015-12-14 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | Assembly line work method and apparatus for batch data processing |
CN106020954A (en) * | 2016-05-13 | 2016-10-12 | 深圳市永兴元科技有限公司 | Thread management method and device |
CN106095554A (en) * | 2016-06-17 | 2016-11-09 | 中国银行股份有限公司 | The method and device of batch data process is carried out in the most online stage |
-
2016
- 2016-12-30 CN CN201611259195.7A patent/CN106648874B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140013330A1 (en) * | 2012-07-06 | 2014-01-09 | Microsoft Corporation | Multiple core real-time task execution |
CN104407922A (en) * | 2014-10-29 | 2015-03-11 | 中国建设银行股份有限公司 | Asynchronous batch-processing dispatching method and system |
CN105892996A (en) * | 2015-12-14 | 2016-08-24 | 乐视网信息技术(北京)股份有限公司 | Assembly line work method and apparatus for batch data processing |
CN105389209A (en) * | 2015-12-25 | 2016-03-09 | 中国建设银行股份有限公司 | Asynchronous batch task processing method and system |
CN106020954A (en) * | 2016-05-13 | 2016-10-12 | 深圳市永兴元科技有限公司 | Thread management method and device |
CN106095554A (en) * | 2016-06-17 | 2016-11-09 | 中国银行股份有限公司 | The method and device of batch data process is carried out in the most online stage |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108810557A (en) * | 2017-07-10 | 2018-11-13 | 北京视联动力国际信息技术有限公司 | A kind of method for processing video frequency, device, electronic equipment and storage medium |
CN112732417A (en) * | 2019-10-28 | 2021-04-30 | 北京京东振世信息技术有限公司 | Method and device for processing application request |
Also Published As
Publication number | Publication date |
---|---|
CN106648874B (en) | 2020-05-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
DE19580990C2 (en) | Method and device for executing delayed transactions | |
US8244888B2 (en) | Method and mechanism for implementing tagged session pools | |
KR101959153B1 (en) | System for efficient processing of transaction requests related to an account in a database | |
US20050240622A1 (en) | Multi-connection control system | |
KR102232866B1 (en) | Method for distributing functional element unit work of crowdsourcing based project for artificial intelligence training data generation | |
CN106294233A (en) | The transfer control method of a kind of direct memory access and device | |
KR102155889B1 (en) | Method for improving quality through secondary work on work results of other workers in a crowdsourcing based projects for artificial intelligence training data generation | |
CN106648874A (en) | Processing method and device for batched task | |
CN107147610B (en) | Resource processing method and device | |
CN110221914A (en) | Document handling method and device | |
US6754658B1 (en) | Database server processing system, method, program and program storage device | |
CN111767533A (en) | Offline mode user authorization method, device, electronic device and storage medium | |
CN106610865A (en) | Data locking and unlocking method and apparatus | |
CN112182606A (en) | Access request processing method and device, electronic equipment and readable storage medium | |
CN112053149A (en) | Method and device for preventing repeated payment, electronic equipment and readable storage medium | |
CN108170860A (en) | Data query method, apparatus, electronic equipment and computer readable storage medium | |
CN112363914A (en) | Parallel test resource configuration optimization method, computing device and storage medium | |
CN112188015A (en) | Method and device for processing customer service session request and electronic equipment | |
CN116226531A (en) | Intelligent recommendation method for financial products of small and micro enterprises and related products | |
CN114049005A (en) | Workflow task allocation and control method and device and electronic equipment | |
CN110033145B (en) | Financial sharing job order separating method and device, equipment and storage medium | |
CN111506872A (en) | Task allocation method and device based on load matrix analysis | |
CN110222016A (en) | A kind of document handling method and device | |
CN113792051B (en) | Data processing method, system, equipment and storage medium based on multi-mode lock | |
CN111428973A (en) | Virtual resource allocation method capable of effectively improving resource utilization rate |
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 |