Unlock instant, AI-driven research and patent intelligence for your innovation.

A java single thread pool based task scheduling optimization implementation method

A technology for task scheduling and implementation methods, applied in the directions of multi-program device, program control design, program startup/switching, etc., which can solve problems such as system resource waste, wrong task execution sequence, and equipment operation problems, so as to reduce resource consumption , the effect of improving efficiency

Active Publication Date: 2022-04-15
TOEC TECH
View PDF10 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0002] With the development of communication and computer technology, many equipment control software systems now have more and more requirements for concurrent execution of tasks, and at the same time require the realization of serialization between tasks of the same equipment. Now the most used method is to use queues in time, which will be different The sub-tasks in the task are placed in different queues, but too many devices connected to the software system control need to create a lot of device task processing queues, and tasks still need to be taken out of the device queues and added to the thread pool when processing instructions Execute tasks, but because the number of CPU cores in the system is fixed, doing so will not improve efficiency, but will cause serious waste of system resources
And when using the queue, the task serialization of the same device cannot be well controlled, and the tasks of different devices are parallel, and sometimes the execution order of the tasks of the same device is wrong, causing problems in the operation of the device

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
  • A java single thread pool based task scheduling optimization implementation method
  • A java single thread pool based task scheduling optimization implementation method

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0018] The present invention will be further described below in conjunction with the accompanying drawings.

[0019] Based on the newSingleThreadExecutor single thread pool task scheduling optimization method in the Java language, the self-contained queue in the single thread pool is used to realize the serial processing of tasks in the same thread pool, and the task scheduling is implemented on the upper level of the single thread pool. The scheduling method is realized by using the following three classes: single thread pool task processing class, task distribution control class and device thread task processing class.

[0020] 1. Create a single-threaded pool task processing class. The single-threaded pool task processing class includes a newSingleThreadExecutor single-threaded pool and a MAP named sequenceMap; create two methods in the class, one method is used to submit threads to the single-threaded pool Task, a method used to record the task number of the thread task su...

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 invention discloses a JAVA single-thread pool-based task scheduling optimization implementation method. The method uses the single-thread pool technology in the java language to realize task scheduling optimization. First create a certain number of single-threaded pools, each single-threaded pool is used to process tasks of different devices, and its task scheduling method is implemented according to the single-threaded pool task processing class, task distribution control class and task distribution control class. The method utilizes the built-in queue in the single-thread pool to implement serial processing of tasks in the same thread pool, and implements task scheduling at the upper level of the single-thread pool, thereby improving efficiency and saving resources.

Description

technical field [0001] The invention relates to the field of equipment control application software, in particular to a JAVA single thread pool-based task scheduling optimization implementation method. It uses the single-thread pool technology in the java language to realize task scheduling optimization. Background technique [0002] With the development of communication and computer technology, many equipment control software systems now have more and more requirements for concurrent execution of tasks, and at the same time require the realization of serialization between tasks of the same equipment. Now the most used method is to use queues in time, which will be different The sub-tasks in the task are placed in different queues, but too many devices connected to the software system control need to create a lot of device task processing queues, and tasks still need to be taken out of the device queues and added to the thread pool when processing instructions Execute tasks...

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
Patent Type & Authority Patents(China)
IPC IPC(8): G06F9/48G06F9/50
CPCG06F9/4843G06F9/4806G06F9/5005G06F2209/5018G06F2209/5011
Inventor 宋慧鹏贾伟涛张晓峰石艳梅
Owner TOEC TECH