CN106648874B - Processing method and device for batch tasks - Google Patents

Processing method and device for batch tasks Download PDF

Info

Publication number
CN106648874B
CN106648874B CN201611259195.7A CN201611259195A CN106648874B CN 106648874 B CN106648874 B CN 106648874B CN 201611259195 A CN201611259195 A CN 201611259195A CN 106648874 B CN106648874 B CN 106648874B
Authority
CN
China
Prior art keywords
task
batch
priority level
processing
requester
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.)
Active
Application number
CN201611259195.7A
Other languages
Chinese (zh)
Other versions
CN106648874A (en
Inventor
戈笑珊
彭渺
邹鹏
刘俊伍
于磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN201611259195.7A priority Critical patent/CN106648874B/en
Publication of CN106648874A publication Critical patent/CN106648874A/en
Application granted granted Critical
Publication of CN106648874B publication Critical patent/CN106648874B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • G06F9/4881Scheduling strategies for dispatcher, e.g. round robin, multi-level priority queues
    • 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/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for processing batch tasks, wherein the method comprises the steps of obtaining a priority level corresponding to a requester when the task quantity of the batch tasks requested to be processed by the requester exceeds the maximum task quantity of a single thread, starting a thread when the requester corresponds to a low priority level, and finally asynchronously processing the batch task processing request exceeding the maximum task quantity of the single thread of the requester by utilizing the started thread. Therefore, the invention designs a scheme for asynchronously processing (i.e. non-real-time processing) the batch task processing request of the requester by starting only one thread for the requester with the low priority level by dividing the requester with the high and low priority levels and under the condition that the task amount requested to be processed by the requester with the low priority level exceeds the maximum task number of a single thread, so that the occupation amount of thread resources during batch task processing can be effectively reduced, the thread resources of a background are saved, and the processing capability of a system is further improved.

Description

Processing method and device for batch tasks
Technical Field
The invention belongs to the technical field of multitasking, and particularly relates to a method and a device for processing batch tasks.
Background
In the current financial field, there is often a requirement for multitasking batch processing, for example, in enterprise cash batch approval transactions, there are often situations where a bank-related processing system needs to process batch approval tasks for multiple customers.
In the processing mode in the prior art, for the batch task processing requirements of each client, a system generally starts a single thread (when the task quantity of the client does not exceed the maximum task quantity of a single thread) or multiple threads (when the task quantity of the client exceeds the maximum task quantity of the single thread) for each client correspondingly according to the task quantity of the batch task requested by each client to perform synchronous (real-time) processing on the batch task requests of the clients. However, the maximum number of threads that the system can be started at the same time is limited, and when the number of threads that have been started reaches the upper limit, the delay processing of the client request may be caused.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for processing batch tasks, and aims to effectively reduce the occupation of thread resources during batch task processing, save background thread resources, and further improve the processing capability of the system.
Therefore, the invention discloses the following technical scheme:
a method of processing a batch of tasks, comprising:
the method comprises the steps of obtaining a batch task processing request of a requester, wherein the batch task processing request comprises a requester identifier and task information of batch tasks to be processed, and the task information comprises the task amount of the batch tasks;
determining whether the task quantity of the batch tasks exceeds the maximum task number of a single thread;
if the priority level exceeds the preset priority level, acquiring the corresponding priority level of the requester based on the requester identifier; the priority level is one of a high priority level and a low priority level which are divided in advance;
and when the priority level corresponding to the requester is a low priority level, starting a thread, and asynchronously processing the batch task processing request by using the started thread.
Preferably, the obtaining of the priority level corresponding to the requester based on the requester identifier includes:
acquiring white list information in a pre-configured configuration file, wherein the white list information comprises identification information of each possible requesting party with a low priority level; the low-priority requester is as follows: the requester has low requirement on processing effectiveness of the batch task processing request;
determining whether the white list information contains the requester identifier;
if yes, the priority level corresponding to the request party is a low priority level; and if not, the priority level corresponding to the requester is a high priority level.
The above method, preferably, further comprises:
and if the task quantity of the batch tasks does not exceed the maximum task number of the single thread, starting a thread, and synchronously processing the batch task processing request by utilizing the started thread.
The above method, preferably, further comprises:
when the priority level corresponding to the requester is a high priority level, determining the number of the threads of multiple threads to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread;
and starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing requests by utilizing the threads.
The above method, preferably, further comprises:
and reading a processing result for processing the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
A batch task processing apparatus, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a batch task processing request of a requester, the batch task processing request comprises a requester identifier and task information of batch tasks to be processed, and the task information comprises the task amount of the batch tasks;
the determining unit is used for determining whether the task quantity of the batch tasks exceeds the maximum task quantity of a single thread;
the second obtaining unit is used for obtaining the priority level corresponding to the requester based on the requester identifier when the task quantity of the batch tasks exceeds the maximum task number of a single thread; the priority level is one of a high priority level and a low priority level which are divided in advance;
and the first processing unit is used for starting a thread when the priority level corresponding to the requester is a low priority level, and asynchronously processing the batch task processing request by utilizing the started thread.
The above apparatus, preferably, the second obtaining unit is further configured to:
acquiring white list information in a pre-configured configuration file, wherein the white list information comprises identification information of each possible requesting party with a low priority level; the low-priority requester is as follows: the requester has low requirement on processing effectiveness of the batch task processing request; determining whether the white list information contains the requester identifier; if yes, the priority level corresponding to the request party is a low priority level; and if not, the priority level corresponding to the requester is a high priority level.
The above apparatus, preferably, further comprises:
and the second processing unit is used for starting a thread when the task quantity of the batch tasks does not exceed the maximum task number of the single thread, and synchronously processing the batch task processing request by utilizing the started thread.
The above apparatus, preferably, further comprises:
the third processing unit is used for determining the number of the threads of multiple threads needing to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread when the priority level corresponding to the requester is a high priority level; and starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing requests by utilizing the threads.
The above apparatus, preferably, further comprises:
and the result response unit is used for reading the processing result of the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
According to the above scheme, when the task quantity of the batch tasks requested to be processed by the requester exceeds the maximum task number of the single thread, the priority level corresponding to the requester is obtained, and when the requester corresponds to the low priority level, one thread is started, and finally the started thread is utilized to asynchronously process the batch task processing request exceeding the maximum task number of the single thread of the requester. Therefore, the invention designs a scheme for asynchronously processing (i.e. non-real-time processing) the batch task processing request of the requester by starting only one thread for the requester with the low priority level by dividing the requester with the high and low priority levels and under the condition that the task amount requested to be processed by the requester with the low priority level exceeds the maximum task number of a single thread, so that the occupation amount of thread resources during batch task processing can be effectively reduced, the thread resources of a background are saved, and the processing capability of a system is further improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
FIG. 1 is a flowchart of a method for processing batch tasks according to an embodiment of the present invention;
FIG. 2 is a flowchart of a method for processing batch tasks according to a second embodiment of the present invention;
FIG. 3 is a flowchart of a method for processing batch tasks according to a third embodiment of the present invention;
FIG. 4 is a flowchart of a method for processing batch tasks according to a fourth embodiment of the present invention;
FIG. 5 is a flow chart of batch approval implemented by the present invention in an enterprise cash batch approval transaction according to the fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of a batch task processing device according to a fifth embodiment of the present invention.
Detailed Description
For the sake of reference and clarity, the technical terms, abbreviations or abbreviations used hereinafter are to be interpreted in summary as follows:
batch approval: the batch approval corresponds to single-pen approval, which means that in the process of business process, an operator can perform batch processing on documents to be approved and a background finishes the batch approval operation of the documents to be approved.
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
An embodiment of the present invention provides a method for processing a batch task, which may be applied to batch task processing in the fields of finance, for example, specifically to processing an enterprise cash batch approval transaction, and with reference to fig. 1, the method may include the following steps:
step 101, obtaining a batch task processing request of a requester, wherein the batch task processing request comprises a requester identifier and task information of a batch task to be processed, and the task information comprises a task amount of the batch task.
For example, for the processing process of the enterprise cash batch approval transaction, the requesting party may specifically be a customer of a bank, and the processing logic of the method of the present invention may specifically be implemented in a background of a system related to the bank.
Based on this, the step can be realized by receiving the batch task processing request sent by the front end in the background of the bank system. The batch task processing request may be, for example, a processing request for a batch transfer task, a batch remittance task, or the like, which is made by a customer, and includes task information of the batch task, such as task-related data, a total task amount, or the like, and a requester identifier, which may be related information capable of uniquely identifying the requester, such as an account, a name, a customer number, or the like.
And 102, determining whether the task quantity of the batch tasks exceeds the maximum task quantity of a single thread.
After a batch task processing request of a requester is obtained, the batch task requested by the requester needs to be converted into a single task, at this time, the number of threads required to be started by the request of the requester needs to be determined first, and based on the number of threads, whether the task amount requested to be processed by the requester exceeds the maximum task number of the single thread needs to be judged first.
Here, the maximum number of tasks of the single thread is the maximum number of tasks of the batch tasks that can be synchronously processed (i.e., processed in real time) by the single thread at a time, and if the number of tasks allocated to the single thread at a time exceeds the maximum number of tasks, the single thread cannot guarantee the processing synchronism of the allocated tasks, and only the batch tasks that exceed the maximum number of tasks and are allocated to the single thread can be asynchronously processed (non-real time processing).
103, if the priority level exceeds the preset priority level, acquiring the corresponding priority level of the requester based on the requester identifier; wherein the priority level is one of a high priority level and a low priority level which are divided in advance.
Different from the prior art, when the task quantity of the batch tasks requested to be processed by the requester exceeds the maximum task number of a single thread, the requester is allocated with corresponding processing logic for performing the batch task processing of a plurality of threads without distinguishing, the invention divides each possible requester (such as each client of a bank) into different priority levels in advance, and divides different requesters into two different priority levels of high priority level and low priority level in advance.
As a possible implementation manner, the corresponding priority level may be configured in advance according to the timeliness requirement of each possible requester on the processing, and for a requester with a higher timeliness requirement on the processing, in order to avoid affecting the customer experience, the priority level of such a requester may be set to be a high priority level, whereas for a requester with a lower timeliness requirement on the processing, the priority level may be set to be a low priority level. In other embodiments of the present invention, the priority levels of different requesters may be further divided according to other dividing bases, for example, the priority levels may be further divided according to importance levels of the requesters, and the dividing bases of the priority levels may be determined according to actual requirements when the present invention is implemented, which is not limited in this embodiment.
On the basis of performing priority classification on each possible requesting party, the invention configures a configuration file in advance, where the configuration file specifically includes white list information configured in advance in the file, and the white list information may specifically be, for example, a white list, where the white list records identification information of each requesting party classified as a low priority level among all possible requesting parties (all clients maintained by the system) maintained by the system.
Based on this, when the task quantity of the batch tasks requested to be processed by the requesting party exceeds the maximum task number of the single thread, the step can specifically read the white list information in the configuration file, and judge whether the read white list information contains the requesting party identifier for making the request, if so, the requesting party for making the request is known to be a client with a low priority level; otherwise, if the white list information does not contain the request party identification, the request party making the request is the high-priority client.
Subsequently, different processing logics are respectively adopted for the requesters with different priority levels according to different steps of the invention.
And 104, when the priority level corresponding to the requester is a low priority level, starting a thread, and asynchronously processing the batch task processing request by using the started thread.
If the priority level of the requester is determined to be low priority level in the last step, the requirement on timeliness of the requester is low, or the importance degree of the requester is low, and the like, based on the method, the multiple threads are not started for the requester with low priority level to process the batch tasks exceeding the maximum task number of the single thread, but only one thread is started to process the batch tasks requested to be processed, and as the task amount requested by the requester exceeds the maximum task number of the single thread, under the condition, the started single thread asynchronously processes the request of the requester, namely, the occupation of thread resources of the low-priority client with low timeliness requirement or low importance degree is reasonably reduced, and the purpose of saving background thread resources is achieved. The saved thread resource can be further used for processing the request of the high-priority client with higher timeliness requirement or higher importance degree in the follow-up process.
According to the above scheme, when the task quantity of the batch tasks requested to be processed by the requester exceeds the maximum task number of the single thread, the method for processing the batch tasks obtains the priority level corresponding to the requester, starts a thread when the requester corresponds to the low priority level, and finally asynchronously processes the batch task processing request exceeding the maximum task number of the single thread of the requester by using the started thread. Therefore, the invention designs a scheme for asynchronously processing (i.e. non-real-time processing) the batch task processing request of the requester by starting only one thread for the requester with the low priority level by dividing the requester with the high and low priority levels and under the condition that the task amount requested to be processed by the requester with the low priority level exceeds the maximum task number of a single thread, so that the occupation amount of thread resources during batch task processing can be effectively reduced, the thread resources of a background are saved, and the processing capability of a system is further improved.
Example two
In this embodiment, referring to a flowchart of a batch task processing method shown in fig. 2, the method may further include the following steps:
and 105, if the task quantity of the batch tasks does not exceed the maximum task number of the single thread, starting a thread, and synchronously processing the batch task processing request by utilizing the started thread.
Specifically, if the task quantity of the batch tasks requested to be processed by the requester does not exceed the maximum task number of the single thread, the single thread can be directly started to process the batch task processing request provided by the requester, and the single thread can synchronously process the request because the requested task quantity does not exceed the maximum task number of the single thread.
EXAMPLE III
In this embodiment, referring to a flowchart of a batch task processing method shown in fig. 3, the method may further include the following steps:
106, when the priority level corresponding to the requester is a high priority level, determining the number of the threads of multiple threads to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread;
and step 107, starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing request by utilizing the plurality of threads.
If the priority level of the requester is high, the requirement on timeliness of the requester is high, or the importance degree of the requester is high, and the like, in order to avoid influencing customer experience, a conventional processing mode is adopted, the number of threads of multiple threads which need to be started for the requester is determined according to the task amount requested to be processed by the requester and the maximum task number of a single thread, and therefore on the basis, the multiple threads meeting the determined number are started to synchronously process the request of the requester, and the timeliness of request processing of the requester is effectively guaranteed.
Example four
In this embodiment, referring to a flowchart of a batch task processing method shown in fig. 4, the method may further include the following steps:
and 108, reading a processing result of processing the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
When the batch task processing process of the thread or the threads started for the requester is finished according to the priority level of the requester, the background reads the batch task processing result of the corresponding thread or the threads, assembles the batch task processing result into response information which meets a preset requirement, such as a preset format/display form, and returns the response result to the front end.
Referring to fig. 5, fig. 5 is a flowchart illustrating a process for implementing batch approval in an enterprise cash batch approval transaction according to the present invention, where, for an application scenario of the enterprise cash batch approval transaction, when performing batch approval, a background needs to perform a batch change operation (which means that a single-batch sequential execution form is adopted to process tasks) on a batch request sent from a front end, and before performing the batch change operation, it needs to first determine whether the number of records to be audited (one record corresponds to one task) in the batch task at this time exceeds the maximum number of tasks of a single thread; if not, directly starting the main thread to synchronously process the client request; if the answer is positive, acquiring white list information in the configuration file, judging whether a client currently sending the transaction request is a client existing in a white list, if the answer is positive, starting only one thread, immediately returning ' a request for processing you ' to a front end ', and asynchronously processing the client request at a back end, wherein a subsequent client can check the specific processing condition of the sent approval request in the inquiry transaction; if the client is not the white list client, the number N of threads needing to be started is determined according to the number of records to be processed in the request sent by the client, the examination and approval requests of the client are processed by the N threads, and when the processing of one thread or the N threads started according to various conditions is completed, the background returns the processing result to the front end.
For the application scenario, the white list technology is introduced into the process approval of the enterprise cash management system, namely, a white list mechanism is provided for solving the problem that batch approval occupies a large number of threads in the existing process approval, customers (which can be customers with low timeliness requirements) in the white list are specially processed, only a single thread is started to asynchronously process the requests of the customers in the white list, and background thread resources can be effectively saved. The mechanism based on the white list provides a new branch for process approval processing, different processing mechanisms can be provided for different customers, processing logics with different levels and different granularities can be provided for different customers through the configuration of the white list under the condition that the main logic of application processing is not influenced, the flexibility of a system in batch processing of services is improved, and meanwhile, the customer experience is also improved.
EXAMPLE five
In this embodiment, a fifth apparatus for processing batch tasks is disclosed, which, with reference to the schematic structural diagram of the batch task processing apparatus shown in fig. 6, includes:
the system comprises a first obtaining unit 61, a second obtaining unit, a first processing unit and a second processing unit, wherein the first obtaining unit is used for obtaining a batch task processing request of a requester, the batch task processing request comprises a requester identifier and task information of batch tasks to be processed, and the task information comprises a task amount of the batch tasks; a determining unit 62, configured to determine whether the task amount of the batch tasks exceeds a maximum task number of a single thread; a second obtaining unit 63, configured to obtain, based on the requestor identifier, a priority level corresponding to the requestor when a task amount of the batch tasks exceeds a maximum task number of a single thread; the priority level is one of a high priority level and a low priority level which are divided in advance; the first processing unit 64 is configured to start a thread when the priority level corresponding to the requestor is a low priority level, and asynchronously process the batch task processing request by using the started thread.
In an implementation manner of the embodiment of the present invention, the second obtaining unit is further configured to: acquiring white list information in a pre-configured configuration file, wherein the white list information comprises identification information of each possible requesting party with a low priority level; the low-priority requester is as follows: the requester has low requirement on processing effectiveness of the batch task processing request; determining whether the white list information contains the requester identifier; if yes, the priority level corresponding to the request party is a low priority level; and if not, the priority level corresponding to the requester is a high priority level.
In an implementation manner of the embodiment of the present invention, the apparatus further includes: and the second processing unit is used for starting a thread when the task quantity of the batch tasks does not exceed the maximum task number of the single thread, and synchronously processing the batch task processing request by utilizing the started thread.
In an implementation manner of the embodiment of the present invention, the apparatus further includes: the third processing unit is used for determining the number of the threads of multiple threads needing to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread when the priority level corresponding to the requester is a high priority level; and starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing requests by utilizing the threads.
In an implementation manner of the embodiment of the present invention, the apparatus further includes: and the result response unit is used for reading the processing result of the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
It should be noted that, the description of the batch task processing device related to the present embodiment is similar to the description of the method above, and the advantageous effects of the method are described, for the technical details of the batch task processing device of the present invention that are not disclosed in the present embodiment, please refer to the description of the method embodiment of the present invention, which will not be repeated herein.
It should be further noted that the various embodiments in this specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the various embodiments may be referred to each other.
For convenience of description, the above system or apparatus is described as being divided into various modules or units by function, respectively. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
From the above description of the embodiments, it is clear to those skilled in the art that the present application can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present application may be essentially or partially implemented in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments of the present application.
Finally, it is further noted that, herein, relational terms such as first, second, third, fourth, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for processing a batch of tasks, comprising:
the method comprises the steps of obtaining a batch task processing request of a requester, wherein the batch task processing request comprises a requester identifier and task information of batch tasks to be processed, and the task information comprises the task amount of the batch tasks;
determining whether the task quantity of the batch tasks exceeds the maximum task number of a single thread;
if the priority level exceeds the preset priority level, acquiring the corresponding priority level of the requester based on the requester identifier; the priority level is one of a high priority level and a low priority level which are divided in advance;
and when the priority level corresponding to the requester is a low priority level, starting a thread, and asynchronously processing the batch task processing request by using the started thread.
2. The method of claim 1, wherein obtaining the priority level corresponding to the requestor based on the requestor identifier comprises:
acquiring white list information in a pre-configured configuration file, wherein the white list information comprises identification information of each possible requesting party with a low priority level; the low-priority requester is as follows: the requester has low requirement on processing effectiveness of the batch task processing request;
determining whether the white list information contains the requester identifier;
if yes, the priority level corresponding to the request party is a low priority level; and if not, the priority level corresponding to the requester is a high priority level.
3. The method of claim 1, further comprising:
and if the task quantity of the batch tasks does not exceed the maximum task number of the single thread, starting a thread, and synchronously processing the batch task processing request by utilizing the started thread.
4. The method of claim 1, further comprising:
when the priority level corresponding to the requester is a high priority level, determining the number of the threads of multiple threads to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread;
and starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing requests by utilizing the threads.
5. The method according to any one of claims 1-4, further comprising:
and reading a processing result for processing the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
6. An apparatus for processing a batch of tasks, comprising:
the system comprises a first acquisition unit, a second acquisition unit and a processing unit, wherein the first acquisition unit is used for acquiring a batch task processing request of a requester, the batch task processing request comprises a requester identifier and task information of batch tasks to be processed, and the task information comprises the task amount of the batch tasks;
the determining unit is used for determining whether the task quantity of the batch tasks exceeds the maximum task quantity of a single thread;
the second obtaining unit is used for obtaining the priority level corresponding to the requester based on the requester identifier when the task quantity of the batch tasks exceeds the maximum task number of a single thread; the priority level is one of a high priority level and a low priority level which are divided in advance;
and the first processing unit is used for starting a thread when the priority level corresponding to the requester is a low priority level, and asynchronously processing the batch task processing request by utilizing the started thread.
7. The apparatus of claim 6, wherein the second obtaining unit is further configured to:
acquiring white list information in a pre-configured configuration file, wherein the white list information comprises identification information of each possible requesting party with a low priority level; the low-priority requester is as follows: the requester has low requirement on processing effectiveness of the batch task processing request; determining whether the white list information contains the requester identifier; if yes, the priority level corresponding to the request party is a low priority level; and if not, the priority level corresponding to the requester is a high priority level.
8. The apparatus of claim 6, further comprising:
and the second processing unit is used for starting a thread when the task quantity of the batch tasks does not exceed the maximum task number of the single thread, and synchronously processing the batch task processing request by utilizing the started thread.
9. The apparatus of claim 6, further comprising:
the third processing unit is used for determining the number of the threads of multiple threads needing to be started according to the task quantity of the batch tasks and the maximum task quantity of the single thread when the priority level corresponding to the requester is a high priority level; and starting a plurality of threads with the determined number of threads, and synchronously processing the batch task processing requests by utilizing the threads.
10. The apparatus of any one of claims 6-9, further comprising:
and the result response unit is used for reading the processing result of the batch task processing request, assembling the processing result into response information meeting the preset requirement, and returning the response information.
CN201611259195.7A 2016-12-30 2016-12-30 Processing method and device for batch tasks Active CN106648874B (en)

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 CN106648874A (en) 2017-05-10
CN106648874B true 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)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
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
CN112732417B (en) * 2019-10-28 2024-09-20 北京京东振世信息技术有限公司 Method and device for processing application request

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9286116B2 (en) * 2012-07-06 2016-03-15 Microsoft Technology Licensing, Llc Multiple core real-time task execution

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN106648874A (en) 2017-05-10

Similar Documents

Publication Publication Date Title
US11272059B2 (en) Exclusive agent pool allocation method, electronic device, and computer readable storage medium
US9436739B2 (en) Dynamic priority-based query scheduling
US7716193B2 (en) Ensuring timely servicing of desired transactions in a database server
CN110728455B (en) Service processing method, service processing device, storage medium and electronic equipment
CN107679740A (en) Business personnel's screening and activating method, electronic installation and computer-readable recording medium
CN103368986A (en) Information recommendation method and information recommendation device
CN110659137B (en) Processing resource allocation method and system for offline tasks
WO2019200767A1 (en) Agent task allocation method and apparatus, computer device and storage medium
CN108897729B (en) Transaction template sharing method and device, electronic equipment and storage medium
CN106648874B (en) Processing method and device for batch tasks
WO2019024475A1 (en) Breakpoint list distribution method and apparatus, and server and medium
US8290995B1 (en) Model and method of an N-tier quality-of-service (QOS)
US20190327303A1 (en) Method, device and computer program product for scheduling multi-cloud system
CN117707737A (en) Task scheduling optimization method, device, equipment and storage medium thereof
CN107194712B (en) Method and device for recording change information of shared account and method and system for supplementing account of internal account
JP3844933B2 (en) Database server processing method
CN108920278B (en) Resource allocation method and device
US20230153317A1 (en) Method for scheduling offloading snippets based on large amount of dbms task computation
CN109375998B (en) Processing method in high-concurrency request environment
CN116881003A (en) Resource allocation method, device, service equipment and storage medium
CN109992614B (en) Data acquisition method, device and server
CN112199401B (en) Data request processing method, device, server, system and storage medium
CN114217790A (en) Interface scheduling method and device, electronic equipment and medium
CN108683551B (en) Pipeline type flow control method and device
US11989181B2 (en) Optimal query scheduling for resource utilization optimization

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