Task processing method and device

A task processing and task technology, applied in the field of task processing, can solve the problems of unable to support the timeliness requirements of process tasks, resource exhaustion, and excessive task accumulation, etc.

Pending Publication Date: 2021-05-18
内蒙古蒙商消费金融股份有限公司
View PDF0 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] This application provides a task processing method and device to solve the problems in the prior art that errors are caused by repeated execution of tasks, too many tasks are accumulated in the thread pool, the resources in the pool are exhausted, and the timeliness requirements of process tasks cannot be supported.

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Task processing method and device
  • Task processing method and device
  • Task processing method and device

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0044] refer to figure 1 , shows a flow chart of the steps of a task processing method provided by an embodiment of the present application, as shown in figure 1 As shown, the task processing method may specifically include the following steps:

[0045] Step 101: Obtain the scanned pending tasks that need to be sent to the thread pool.

[0046] The embodiment of the present application may be applied to a scenario where scanned tasks that need to be sent to a thread pool are added to a task queue and the tasks in the task queue are processed.

[0047] Activiti workflow: Commonly used workflow components on the market, on the premise that the orderly work tasks have been serviced, use Activiti workflow components to connect these serviced steps in series or in parallel, execute them in a predetermined order, and Reach the end goal and get results.

[0048] Thread pool: thread is the control flow allocated by the operating system to execute the program. Due to the limited res...

Embodiment 2

[0069] refer to figure 2 , shows a flow chart of steps of another task processing method provided by the embodiment of the present application, as shown in figure 2 As shown, the task processing method may specifically include the following steps:

[0070] Step 201: Invoking a scanner preset in the Activiti workflow engine to scan the first task database to obtain pending tasks that need to be sent to the thread pool.

[0071] The embodiment of the present application may be applied to a scenario where scanned tasks that need to be sent to a thread pool are added to a task queue and the tasks in the task queue are processed.

[0072] Activiti workflow: Commonly used workflow components on the market, on the premise that the orderly work tasks have been serviced, use Activiti workflow components to connect these serviced steps in series or in parallel, execute them in a predetermined order, and Reach the end goal and get results.

[0073] In this embodiment, the first task...

Embodiment 3

[0103] refer to image 3 , which shows a schematic structural diagram of a task processing device provided by an embodiment of the present application, as shown in image 3 As shown, the task processing device 300 may specifically include the following modules:

[0104] A task to be processed acquisition module 310, configured to acquire the scanned tasks to be added to the thread pool;

[0105] A task to be processed adding module 320, configured to add the task to be processed to a preset task queue;

[0106] The target task obtaining module 330 is configured to call the target thread corresponding to the task processor from the thread pool to obtain the target task from the task queue when receiving the task processor to process the target task;

[0107] A target task execution module 340, configured to call the target thread to execute the target task.

[0108] The task processing device provided in the embodiment of the present application acquires the pending tasks th...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The embodiment of the invention provides a task processing method and device. The method comprises the steps of obtaining a to-be-processed task which is obtained through scanning and needs to be sent to a thread pool; adding the to-be-processed task to a preset task queue; under the condition that a task processor is received to process a target task, calling a target thread corresponding to the task processor from the thread pool to obtain the target task from the task queue; and calling the target thread to execute the target task. According to the embodiment of the invention, the scanned to-be-processed task is added to the task queue, and after the consumer receives the message, the to-be-processed task is inquired from the database and executed, so that the task scanned at a single node can be executed on a plurality of nodes, the pressure of the single node is shared, the overall execution efficiency of the process is improved, and meanwhile, the message of the task is stored in the task queue and is not stored in the thread pool, so that the memory resource consumption of the workflow application is also reduced.

Description

technical field [0001] The present application relates to the technical field of task processing, in particular to a task processing method and device. Background technique [0002] In a high-concurrency scenario, the workflow will receive many workflows that need to be processed. In order not to occupy the resources of the main thread, the execution mode of the process node is often set to asynchronous execution. In this scenario, the process node tasks executed asynchronously will be handed over to the thread pool. Due to too many tasks, the thread pool processing cannot meet the processing needs. Errors are generated due to repeated execution; sometimes too many tasks are accumulated in the thread pool, and the resources in the pool are exhausted, which cannot support the timeliness requirements of process tasks. Contents of the invention [0003] This application provides a task processing method and device to solve the problems in the prior art that errors are caused...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
IPC IPC(8): G06F9/50G06F9/54G06Q10/10
CPCG06F9/5038G06F9/546G06Q10/103
Inventor杨春雨何建芳姜辰
Owner内蒙古蒙商消费金融股份有限公司