CN113434291A - Real-time scheduling optimization method based on channel - Google Patents

Real-time scheduling optimization method based on channel Download PDF

Info

Publication number
CN113434291A
CN113434291A CN202110710874.6A CN202110710874A CN113434291A CN 113434291 A CN113434291 A CN 113434291A CN 202110710874 A CN202110710874 A CN 202110710874A CN 113434291 A CN113434291 A CN 113434291A
Authority
CN
China
Prior art keywords
tasks
task
channel
scheduling
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110710874.6A
Other languages
Chinese (zh)
Inventor
洪薇
洪健
李京昆
刘文思
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hubei Yangzhong Jushi Information Technology Co ltd
Original Assignee
Hubei Yangzhong Jushi Information Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hubei Yangzhong Jushi Information Technology Co ltd filed Critical Hubei Yangzhong Jushi Information Technology Co ltd
Priority to CN202110710874.6A priority Critical patent/CN113434291A/en
Publication of CN113434291A publication Critical patent/CN113434291A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/5038Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the execution order of a plurality of tasks, e.g. taking priority or time dependency constraints into consideration

Abstract

The invention discloses a real-time scheduling optimization method based on a channel, which relates to the technical field of information scheduling and comprises the following steps: s1: and starting a scheduling system and adding a plurality of tasks to be scheduled. The invention adjusts the system task scheduling sequence in real time according to the execution time of various tasks, and finally the task which is executed faster in the scheduling process can be floated at the top of the channel and the task which is executed slower is settled at the bottom of the channel after the scheduling system starts to run, so that each round of tasks can lead most tasks to be executed successfully and return results as much as possible, thereby avoiding that the task with long part of execution time prolongs the execution time of each round of tasks, reducing the time of the scheduling system for executing the task round integrally, and successfully solving the problem that the scheduling system can lead the execution time of the whole task to be prolonged because the execution time of part of tasks is long.

Description

Real-time scheduling optimization method based on channel
Technical Field
The invention relates to an information scheduling method, in particular to a real-time scheduling optimization method based on a channel.
Background
At present, various data processing tasks in the information age have extremely high processing response capability and have extremely large data volume, but in the current traditional task scheduling system, the tasks need to be orderly and circularly scheduled, and each scheduling task is responded and executed according to a preset rule as soon as possible, the traditional task scheduling system traditionally sequences and executes the tasks one by one, and simultaneously schedules each round of tasks by utilizing a circular queue, when the scheduling system finishes the completion, the sequence of the tasks is immediately determined, in the whole scheduling process of the system, the execution sequence of the tasks does not change, namely, after the task with a smaller sequence number is executed in the scheduling process of each round of tasks, the task with a larger sequence number is executed, and the channel is a data type (chan) in Go language, and can be used in Gogouutine (coroutine, also called micro-thread, a more flexible concurrency program component) that are typically viewed as pipes for the communication by the gorutines, such communication between the gorutines does not require any explicit locking, the locks being managed internally by the channels themselves. The channel and the goroutine enable the go programming language to be concurrent, and the channel has the advantages that by providing atomic communication primitives, a complex locking mechanism under race conditions (race conditions) is avoided,
however, the prior art has a problem that, when there are a plurality of tasks with the same response level to be scheduled, if the processing time of part of tasks is long, the processing according to the traditional circular queue processing mode can prolong the running time of the whole task turn, the conventional mode has the defects that in each task scheduling, tasks with long execution time need to be waited for to be completed so as to continue to execute the following tasks, even if the later task is executed very fast, the task needs to wait for the previous task to be executed completely, so that the whole round time of the task is prolonged, and therefore in the process of task scheduling, the task scheduling and processing as fast as possible becomes a problem to be paid attention, and a simple and feasible method with high stability and no task omission or task repeated processing in each task processing is needed to process.
Disclosure of Invention
The invention aims to provide a real-time scheduling optimization method based on a channel, which aims to solve the problems that when the existing scheduling method proposed in the background art schedules a plurality of levels of same task responses, the processing time of part of tasks is longer and the running time of the whole task round is prolonged.
In order to achieve the purpose, the invention provides the following technical scheme: a method for channel-based real-time scheduling optimization, comprising the steps of:
s1: and starting a scheduling system and adding a plurality of tasks to be scheduled.
S2: a channel with a buffer size equal to the total number of tasks is established.
S3: on the basis of step S2, the tasks to be scheduled are put into the channel one by one.
S4: on the basis of step S3, the scheduling system concurrently reads the tasks in the channels and starts executing the tasks according to the task contents.
S5: on the basis of step S4, immediately after the execution of each task is completed, the task is replaced back to the channel established at S2, and the replacement operation is the same as the placement operation at S3.
S6: on the basis of step S5, the processes of S4 and S5 are repeated.
As a preferred embodiment of the present invention, the task traversal scheduled in S2 is independent of the sequence.
As a preferred embodiment of the present invention, in S4, only scheduling limitation of tasks is performed.
As a preferred embodiment of the present invention, the number of channels of the total number of tasks in S2 is the same as the number of tasks scheduled in S1.
As a preferred embodiment of the present invention, the replacing operation of S5 for replacing the task to S2 is the same as the placing operation of S3.
Compared with the prior art, the invention has the beneficial effects that:
the invention adjusts the system task scheduling sequence in real time according to the execution time of various tasks, and finally floats the task which is executed faster in the scheduling process at the top of the channel and sinks the task which is executed slower at the bottom of the channel after the scheduling system starts to run, so that each round of tasks can lead most of tasks to be executed successfully and return results as much as possible, thereby avoiding that the task which is long in part of execution time drags the execution time of each round of tasks, reducing the time of the scheduling system for executing the whole task round, successfully solving the problem that the execution time of the whole task is draged because the execution time of part of tasks is long in the scheduling system, namely, the task which is processed faster is executed as early as possible, the task which is processed slower is put at the last to be executed so as to reduce the time required by the whole task round, and improving the response speed of task execution, thereby solving the problem that when the existing scheduling method schedules a plurality of tasks with the same level, there are problems that the processing time of part of tasks is long and the running time of the whole task turn is prolonged.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to 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.
The invention provides a technical scheme for a real-time scheduling optimization method based on a channel, which comprises the following steps:
s1: and starting a scheduling system and adding a plurality of tasks to be scheduled.
S2: a channel with a buffer size equal to the total number of tasks is established.
S3: on the basis of step S2, the tasks to be scheduled are put into the channel one by one.
S4: on the basis of step S3, the scheduling system concurrently reads the tasks in the channels and starts executing the tasks according to the task contents.
S5: on the basis of step S4, immediately after the execution of each task is completed, the task is replaced back to the channel established at S2, and the replacement operation is the same as the placement operation at S3.
S6: on the basis of step S5, the processes of S4 and S5 are repeated, in order to realize that, in each task processing round, the fastest tasks processed in the previous round are always processed first, and the tasks with the slowest processing speed in the previous round are put back to the channel last and are executed latest in the next round, the task traversal scheduled in S2 is not related to the sequence, only the scheduling limitation of the tasks is performed in S4, the number of channels of the total number of tasks in S2 is the same as the number of tasks scheduled in S1, and the put-back operation of S5 for putting back the tasks in S2 is the same as the put-in operation of S3.
When the method is used, firstly, a scheduling system is started, a plurality of tasks to be scheduled are added, then a channel with the buffer size of the total number of the tasks is established, the tasks to be scheduled are placed into the channel one by one in the established channel with the buffer size of the total number of the tasks in a traversing mode, then the scheduling system is enabled to read the tasks in the channel concurrently, the tasks are executed according to the task content, after the execution of each task is completed, the tasks are immediately placed back into the channel with the buffer size of the total number of the tasks, and the purpose of quickly executing the tasks can be achieved by repeating the operation for a plurality of times in the using process.
In the present invention, unless otherwise explicitly specified or limited, for example, it may be fixedly attached, detachably attached, or integrated; can be mechanically or electrically connected; the terms may be directly connected or indirectly connected through an intermediate, and may be communication between two elements or interaction relationship between two elements, unless otherwise specifically limited, and the specific meaning of the terms in the present invention will be understood by those skilled in the art according to specific situations.
Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, the scope of which is defined in the appended claims and their equivalents.

Claims (5)

1. A method for channel-based real-time scheduling optimization, comprising: the method comprises the following steps:
s1: starting a scheduling system, and adding a plurality of tasks to be scheduled;
s2: establishing a channel with the buffering size of the total number of tasks;
s3: on the basis of the step S2, traversing the tasks to be scheduled one by one and putting the tasks into a channel;
s4: on the basis of the step S3, the scheduling system concurrently reads the tasks in the channels and starts to execute the tasks according to the task content;
s5: on the basis of step S4, immediately after the execution of each task is completed, the task is replaced to the channel established at S2;
s6: on the basis of step S5, the processes of S4 and S5 are repeated.
2. A method for channel-based real-time scheduling optimization according to claim 1, characterized in that: the task traversal scheduled in S2 is order independent.
3. A method for channel-based real-time scheduling optimization according to claim 1, characterized in that: in S4, only the scheduling definition of the task is performed.
4. A method for channel-based real-time scheduling optimization according to claim 1, characterized in that: the number of channels of the total number of tasks in S2 is the same as the number of tasks scheduled in S1.
5. A method for channel-based real-time scheduling optimization according to claim 1, characterized in that: the put back operation of the S5 put back task S2 is the same as the put operation of S3.
CN202110710874.6A 2021-06-25 2021-06-25 Real-time scheduling optimization method based on channel Pending CN113434291A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110710874.6A CN113434291A (en) 2021-06-25 2021-06-25 Real-time scheduling optimization method based on channel

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110710874.6A CN113434291A (en) 2021-06-25 2021-06-25 Real-time scheduling optimization method based on channel

Publications (1)

Publication Number Publication Date
CN113434291A true CN113434291A (en) 2021-09-24

Family

ID=77754349

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110710874.6A Pending CN113434291A (en) 2021-06-25 2021-06-25 Real-time scheduling optimization method based on channel

Country Status (1)

Country Link
CN (1) CN113434291A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050240924A1 (en) * 2004-04-02 2005-10-27 Emulex Design & Manufacturing Corporation Prerequisite-based scheduler
US20140101663A1 (en) * 2012-10-04 2014-04-10 Lawrence J. Dickson Method and apparatus implemented in processors for real-time scheduling and task organization based on response time order of magnitude
CN106940671A (en) * 2016-01-05 2017-07-11 阿里巴巴集团控股有限公司 The monitoring method of mission thread operation, apparatus and system in a kind of cluster
CN107729139A (en) * 2017-09-18 2018-02-23 北京京东尚科信息技术有限公司 A kind of method and apparatus for concurrently obtaining resource
CN108845878A (en) * 2018-05-08 2018-11-20 南京理工大学 The big data processing method and processing device calculated based on serverless backup
CN111506413A (en) * 2020-07-02 2020-08-07 上海有孚智数云创数字科技有限公司 Intelligent task scheduling method and system based on business efficiency optimization
CN111614377A (en) * 2020-04-24 2020-09-01 江苏方天电力技术有限公司 Acquisition multi-task scheduling method and system based on HPLC concurrent channel

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050240924A1 (en) * 2004-04-02 2005-10-27 Emulex Design & Manufacturing Corporation Prerequisite-based scheduler
US20140101663A1 (en) * 2012-10-04 2014-04-10 Lawrence J. Dickson Method and apparatus implemented in processors for real-time scheduling and task organization based on response time order of magnitude
CN106940671A (en) * 2016-01-05 2017-07-11 阿里巴巴集团控股有限公司 The monitoring method of mission thread operation, apparatus and system in a kind of cluster
CN107729139A (en) * 2017-09-18 2018-02-23 北京京东尚科信息技术有限公司 A kind of method and apparatus for concurrently obtaining resource
CN108845878A (en) * 2018-05-08 2018-11-20 南京理工大学 The big data processing method and processing device calculated based on serverless backup
CN111614377A (en) * 2020-04-24 2020-09-01 江苏方天电力技术有限公司 Acquisition multi-task scheduling method and system based on HPLC concurrent channel
CN111506413A (en) * 2020-07-02 2020-08-07 上海有孚智数云创数字科技有限公司 Intelligent task scheduling method and system based on business efficiency optimization

Similar Documents

Publication Publication Date Title
DE102014011332B4 (en) PRIORITIZE INSTRUCTIONS BASED ON TYPE
CN103729480B (en) Method for rapidly finding and scheduling multiple ready tasks of multi-kernel real-time operating system
US9652243B2 (en) Predicting out-of-order instruction level parallelism of threads in a multi-threaded processor
US10545892B2 (en) Multi-thread processor and its interrupt processing method
EP2425329B1 (en) Method and apparatus for scheduling the issue of instructions in a multithreaded microprocessor
US20150227389A1 (en) Interleave-scheduling of correlated tasks and backfill-scheduling of depender tasks into a slot of dependee tasks
CN110851246A (en) Batch task processing method, device and system and storage medium
CN110389842A (en) A kind of dynamic resource allocation method, device, storage medium and equipment
CN111176831A (en) Dynamic thread mapping optimization method and device based on multithread shared memory communication
CN113434291A (en) Real-time scheduling optimization method based on channel
US20130117757A1 (en) Method and apparatus for scheduling application programs
Naik et al. A review of adaptive approaches to MapReduce scheduling in heterogeneous environments
CN115269226A (en) Multithreading multistage parallel communication method based on atomic message and shared cache
CN115576671A (en) Single-thread multi-task execution method, device, equipment and medium
JP2002099435A (en) Control method of multi-task and information processor
CN115033374A (en) Task-to-thread matching method of multi-core programmable controller
CN113177632A (en) Model training method, device and equipment based on pipeline parallelism
CN109597815B (en) Data state updating method, device, equipment and medium
US20230367633A1 (en) Gpu and gpu method
CN110716801B (en) Multi-task scheduling method with multiple competitive agents
CN115145233B (en) Multi-stage small-granularity movement scheduling control method, device and equipment for robot
US20080181254A1 (en) Data transmission method
US20220300887A1 (en) Dynamic scheduling system with performance-based access
US20230367630A1 (en) Stream multipleprocessor, gpu, and related method
JPH06295246A (en) Instruction scheduling system

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