CN106773711A - The hybrid tasks scheduling method and model of a kind of railway locomotive operation steerable system - Google Patents

The hybrid tasks scheduling method and model of a kind of railway locomotive operation steerable system Download PDF

Info

Publication number
CN106773711A
CN106773711A CN201710025822.9A CN201710025822A CN106773711A CN 106773711 A CN106773711 A CN 106773711A CN 201710025822 A CN201710025822 A CN 201710025822A CN 106773711 A CN106773711 A CN 106773711A
Authority
CN
China
Prior art keywords
time
task
real
tasks
scheduling
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
Application number
CN201710025822.9A
Other languages
Chinese (zh)
Other versions
CN106773711B (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.)
Tsinghua University
Original Assignee
Tsinghua University
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 Tsinghua University filed Critical Tsinghua University
Priority to CN201710025822.9A priority Critical patent/CN106773711B/en
Publication of CN106773711A publication Critical patent/CN106773711A/en
Application granted granted Critical
Publication of CN106773711B publication Critical patent/CN106773711B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B13/00Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion
    • G05B13/02Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric
    • G05B13/04Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators
    • G05B13/042Adaptive control systems, i.e. systems automatically adjusting themselves to have a performance which is optimum according to some preassigned criterion electric involving the use of models or simulators in which a parameter or coefficient is automatically adjusted to optimise the performance

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Computation (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Feedback Control In General (AREA)

Abstract

本发明提供了一种铁路机车运行操纵系统的混合任务调度方法及模型。本发明的调度方法以一个帧周期作为基本调度单元,包括预处理;针对周期性实时任务基于表驱动的二级优先级规则进行调度序列排序;针对非周期性实时任务应用基于启发式搜索策略和模糊控制的方法进行排列;然后进行时间片的回收以及调度结果和反馈数据的采集工作,并判断剩余执行时间;如果周期时间未用完,则执行非实时任务。本发明的混合任务调度方法和模型能够极大地减小系统开销,又能够比较灵活地处理系统执行过程中的各种变化情况,并且可以降低系统不确定性对调度的影响。

The invention provides a mixed task scheduling method and model of a railway locomotive operation and control system. The scheduling method of the present invention takes a frame period as the basic scheduling unit, including preprocessing; for periodic real-time tasks, the scheduling sequence is sorted based on the table-driven secondary priority rules; for non-periodic real-time tasks, the heuristic search strategy and The method of fuzzy control is arranged; then the recovery of time slices and the collection of scheduling results and feedback data are carried out, and the remaining execution time is judged; if the cycle time is not used up, non-real-time tasks are executed. The hybrid task scheduling method and model of the present invention can greatly reduce system overhead, and can more flexibly deal with various changes in the system execution process, and can reduce the influence of system uncertainty on scheduling.

Description

一种铁路机车运行操纵系统的混合任务调度方法及模型A hybrid task scheduling method and model for railway locomotive operation and control system

技术领域technical field

本发明涉及铁路机车运行操纵系统领域,尤其涉及一种铁路机车运行操纵系统的混合任务调度方法及模型。The invention relates to the field of railway locomotive operation and control systems, in particular to a mixed task scheduling method and model of the railway locomotive operation and control system.

背景技术Background technique

铁路机车运行操纵系统是以列车节能操纵机理及运行模型为基础,集成了LKJ通信,机车牵引计算和运动学方程,优化计算,油耗计算,自适应控制,显示及其他一些辅助功能的嵌入式计算机系统。它能够对列车运行的动态过程进行模拟,根据LKJ输入参数感知列车、线路和环境等变化,计算出适用于机车的速度-距离曲线和档位-距离最优节能操纵策略,并在很短的时间间隔内给出优化控制。由于系统运行在实时控车的环境中,所以系统任务必须要实时、准确地得到完成。对于任务的合理调度,降低系统延迟对保障系统正常稳定运行有着至关重要的作用。The railway locomotive operation control system is based on the train energy-saving control mechanism and operation model, and integrates LKJ communication, locomotive traction calculation and kinematic equations, optimization calculation, fuel consumption calculation, adaptive control, display and other auxiliary functions. system. It can simulate the dynamic process of train operation, perceive the changes of train, line and environment according to the input parameters of LKJ, and calculate the speed-distance curve and gear-distance optimal energy-saving maneuvering strategy suitable for the locomotive, and in a very short time Optimal control is given within the time interval. Because the system runs in the environment of real-time vehicle control, the system tasks must be completed in real time and accurately. For the reasonable scheduling of tasks, reducing system latency plays a vital role in ensuring the normal and stable operation of the system.

铁路机车运行操纵系统是一个典型的复杂优化控制系统,其任务模型是由周期性实时任务、非周期性实时任务和非实时任务共同构成的混合任务集。虽然目前计算机和嵌入式开发技术发展快速,硬件设备的处理能力越来越强,但计算资源依旧是十分宝贵的,优化控制系统的实时任务调度问题一直是计算机领域研究的热点和难点。The railway locomotive operation and control system is a typical complex optimization control system, and its task model is a mixed task set composed of periodic real-time tasks, non-periodic real-time tasks and non-real-time tasks. Although the computer and embedded development technology are developing rapidly at present, and the processing ability of hardware equipment is getting stronger and stronger, computing resources are still very precious. The problem of optimizing real-time task scheduling of control systems has always been a hot and difficult point in the field of computer research.

现有的混合任务集的调度方法按照驱动方式的不同,可分为:表驱动、优先级驱动、搜索驱动等。Existing scheduling methods for mixed task sets can be classified into table-driven, priority-driven, search-driven, etc. according to different driving modes.

表驱动的实时调度方案是以静态调度表算法为基础的调度方案,在航天飞机软件系统、导弹导航系统等高精度系统中有着广泛应用。这种调度方案调度开销小,运行精度高,对于硬实时任务的调度具有强有力的保障。但是其缺点是不够灵活,仅能够完成对周期性任务的调度,且需要精确位在一个周期内每个任务的到达时间,就绪时间以及最坏执行时间。在铁路机车运行操纵系统的任务调度模型中同时存在着周期性和非周期性实时任务,非周期性任务是随机到达的,周期性任务也会随着系统状态变化而动态改变。所以这种调度方案无法胜任这种不确定的调度环境。The table-driven real-time scheduling scheme is a scheduling scheme based on the static scheduling table algorithm, which is widely used in high-precision systems such as space shuttle software systems and missile navigation systems. This scheduling scheme has low scheduling overhead and high operation precision, and has a strong guarantee for the scheduling of hard real-time tasks. But its disadvantage is that it is not flexible enough, and it can only complete the scheduling of periodic tasks, and it needs to accurately locate the arrival time, ready time and worst execution time of each task in a cycle. In the task scheduling model of railway locomotive operation and control system, there are both periodic and non-periodic real-time tasks. The non-periodic tasks arrive at random, and the periodic tasks will change dynamically with the system state. Therefore, this scheduling scheme is not suitable for this uncertain scheduling environment.

优先级驱动的实时调度方案又可细分为静态优先级调度和动态优先级调度。它是一种十分常见的调度方案,应用于经典的实时操作系统VxWorks,μC/OS中,调度方案具有较强的灵活性。但是其灵活性是建立在频繁任务切换的基础之上的,需要消耗大量系统资源。而铁路机车运行操纵系统中,控制任务的优先级要明显高于优化任务,周期性地完成控制过程是系统最根本的需求。如果采用优先级抢占的调度方案,会造成:第一,周期性控制任务由于优先级倒置等原因无法按时完成;第二,上下文的频繁切换导致资源利用率低,在高负载条件下系统不稳定。所以,基于优先级驱动的调度方案无法解决铁路机车运行操纵系统的调度问题。The priority-driven real-time scheduling scheme can be subdivided into static priority scheduling and dynamic priority scheduling. It is a very common scheduling scheme, which is applied in the classic real-time operating system VxWorks, μC/OS, and the scheduling scheme has strong flexibility. But its flexibility is based on frequent task switching, which consumes a lot of system resources. In the railway locomotive operation and control system, the priority of the control task is obviously higher than that of the optimization task, and the periodic completion of the control process is the most fundamental requirement of the system. If the priority preemption scheduling scheme is adopted, it will cause: first, periodic control tasks cannot be completed on time due to priority inversion and other reasons; second, frequent context switching leads to low resource utilization and system instability under high load conditions . Therefore, the priority-driven scheduling scheme cannot solve the scheduling problem of the railway locomotive operation and control system.

搜索驱动的实时调度方案常见的有近视算法和节约算法。该调度方案具有较强的灵活性,但是缺点是搜索过程的开销较大,对于铁路机车运行操纵系统来说,采用搜索的方式同时调度周期性任务和非周期性任务会大幅降低周期性任务调度的成功率,从而严重影响系统性能。Common search-driven real-time scheduling schemes include myopic algorithms and thrifty algorithms. This scheduling scheme has strong flexibility, but the disadvantage is that the search process has a large overhead. For the railway locomotive operation and control system, using the search method to simultaneously schedule periodic tasks and non-periodic tasks will greatly reduce the periodic task scheduling. success rate, which seriously affects system performance.

所以,目前现有各种调度方案都无法适应复杂优化控制系统当中的调度需求。设计出一个能够同时满足控制的实时性和优化的稳定性并能充分发挥处理器最大性能的调度方案至关重要。Therefore, the various scheduling schemes currently available cannot meet the scheduling requirements in the complex optimization control system. It is very important to design a scheduling scheme that can satisfy the real-time control and optimization stability at the same time and can give full play to the maximum performance of the processor.

发明内容Contents of the invention

本发明的目的是提供一种铁路机车运行操纵系统的混合任务调度方法及模型。铁路机车系统的任务集是由周期性任务、非周期性任务和非实时任务共同构成的混合任务集。其中周期性任务是整个控制过程的核心,具有最严格的时限约束,执行周期多样化,时序性强,资源共享与互斥情况多;非周期性任务是维护系统稳定,提高系统性能和系统优化的重要组成部分,具有随机到达,任务种类和形式丰富,优先级变化范围大的特点;非实时任务是系统维护和调试的保障,不具有实时处理的要求,但计算耗时最大。本发明考虑到不同类型任务的调度需求,能够清晰地描述任务本身的时间约束,任务间的时序约束和资源约束,准确地体现出实际场景中任务执行的特点,实现混合任务的合理调度。The purpose of the present invention is to provide a mixed task scheduling method and model of a railway locomotive operation and control system. The task set of the railway locomotive system is a mixed task set composed of periodic tasks, non-periodic tasks and non-real-time tasks. Among them, periodic tasks are the core of the entire control process, with the strictest time limit constraints, diversified execution cycles, strong timing, and many resource sharing and mutual exclusion situations; non-periodic tasks are to maintain system stability, improve system performance and system optimization An important part of the system, it has the characteristics of random arrival, rich types and forms of tasks, and a wide range of priority changes; non-real-time tasks are the guarantee for system maintenance and debugging, and do not have real-time processing requirements, but the calculation takes the most time. Considering the scheduling requirements of different types of tasks, the invention can clearly describe the time constraints of the tasks themselves, the timing constraints and resource constraints between tasks, accurately reflect the characteristics of task execution in actual scenarios, and realize the reasonable scheduling of mixed tasks.

本发明通过如下技术方案实现:The present invention realizes through following technical scheme:

一种铁路机车运行操纵系统的混合任务调度方法,其特征在于,所述混合任务包括:周期性实时任务、非周期性实时任务以及非实时任务;所述混合任务调度方法以一个帧周期作为基本调度单元,所述混合任务调度方法包括下述步骤:A mixed task scheduling method for a railway locomotive operation and control system, characterized in that the mixed task includes: periodic real-time tasks, non-periodic real-time tasks and non-real-time tasks; the mixed task scheduling method takes one frame period as a basic Scheduling unit, the hybrid task scheduling method includes the following steps:

(1)帧周期开始时,所述混合任务调度方法进行调度准备,所述调度准备至少包括任务切换和资源检查;(1) When the frame period starts, the hybrid task scheduling method performs scheduling preparation, and the scheduling preparation includes at least task switching and resource checking;

(2)针对周期性实时任务,应用基于表驱动的二级优先级规则进行调度序列排序,并按照该序列调度周期性实时任务;(2) For periodic real-time tasks, apply the table-driven two-level priority rule to sort the scheduling sequence, and schedule periodic real-time tasks according to the sequence;

(3)针对非周期性实时任务,应用基于启发式搜索策略和模糊控制的方法,对非周期性实时任务进行排列,并按照该序列调度非周期性实时任务;(3) For non-periodic real-time tasks, apply the method based on heuristic search strategy and fuzzy control to arrange non-periodic real-time tasks, and schedule non-periodic real-time tasks according to the sequence;

(4)对当前周期内未使用的时间片进行回收并且进行调度结果和反馈数据的采集,判断剩余执行时间;(4) Reclaim unused time slices in the current cycle and collect scheduling results and feedback data to determine the remaining execution time;

(5)如果当前周期时间未用完,则执行非实时任务;(5) If the current cycle time is not used up, execute the non-real-time task;

(6)在帧周期结束时,如果非周期性实时任务或非实时任务还未执行结束,则在下一帧周期开始时执行周期性实时任务,封存未执行完成的非周期性实时任务或非实时任务,确保周期性实时任务的实时性。(6) At the end of the frame period, if the execution of the non-periodic real-time task or non-real-time task has not ended, the periodic real-time task will be executed at the beginning of the next frame period, and the unfinished non-periodic real-time task or non-real-time task will be sealed. task, to ensure the real-time performance of periodic real-time tasks.

进一步地,所述的基于表驱动的二级优先级规则是针对周期性实时任务在机车运行操纵系统中的可预测性提出的一种非抢占调度方法,所述的二级优先级分为组优先级和实例优先级,在所述步骤(2)中先按组优先级排序,再按实例优先级排序,最终生成调度表。Further, the table-driven secondary priority rule is a non-preemptive scheduling method proposed for the predictability of periodic real-time tasks in the locomotive operation and control system, and the secondary priority is divided into groups Priorities and instance priorities are first sorted by group priorities in the step (2), and then by instance priorities to finally generate a scheduling table.

进一步地,所述的基于启发式搜索策略引入了模糊控制的方法,提出了一种新的估价函数:Further, the described heuristic-based search strategy introduces a method of fuzzy control, and proposes a new valuation function:

H(n,t)=h(n,t)*nst H(n,t)=h(n,t)*n st

nst=(nd-t)-(nc-e(n,t))n st =(n d -t)-(n c -e(n,t))

其中H(n,t)是估价函数,h(n,t)是非周期性实时任务n在时刻t的动态阈值系数,nst是非周期性实时任务n在时刻t的剩余空闲时间,nd是任务n的截止期,nc是最坏执行时间,e(n,t)是任务n在时刻t已经执行过的时间。where H(n,t) is the valuation function, h(n,t) is the dynamic threshold coefficient of aperiodic real-time task n at time t, n st is the remaining idle time of aperiodic real-time task n at time t, n d is The deadline of task n, n c is the worst execution time, e(n,t) is the time that task n has been executed at time t.

进一步地,在所述基于表驱动的二级优先级规则中,所述组优先级的设计规则为:先按照任务集中周期性实时任务的截止期由小到大的顺序,设置若干个任务组,然后根据任务间的时序约束,判定每个周期性任务的前驱任务并调整相应的任务组优先级;所述的实例优先级为任务组内部任务的排序规则,排序采用最小最坏执行时间规则。Further, in the table-based two-level priority rule, the design rule of the group priority is: first set several task groups according to the order of deadlines of periodic real-time tasks in the task set from small to large , and then according to the timing constraints between tasks, determine the predecessor tasks of each periodic task and adjust the corresponding task group priority; the instance priority is the sorting rule of the internal tasks of the task group, and the sorting adopts the minimum and worst execution time rule .

进一步地,在所述估价函数中,非周期性实时任务的完成率也作为模糊输入参数,输入参数与阈值系数对应关系表如下表所示:Further, in the evaluation function, the completion rate of non-periodic real-time tasks is also used as a fuzzy input parameter, and the corresponding relationship between input parameters and threshold coefficients is shown in the following table:

任务完成率定义如下:ncr(t)=e(n,t)/ncThe task completion rate is defined as follows: n cr (t)=e(n,t)/n c .

进一步地,在所述步骤(5)中,对于非实时任务,调度顺序按照FIFO规则进行调度。Further, in the step (5), for non-real-time tasks, the scheduling sequence is scheduled according to FIFO rules.

另一方面,本发明提供一种铁路机车运行操纵系统的混合任务调度模型,其特征在于,所述的调度模型分为两部分,分别为调度单元和执行单元,所述调度单元采用权利要求1-6中任意一项所述的方法对混合任务进行调度。On the other hand, the present invention provides a mixed task dispatching model of a railway locomotive operation and control system, which is characterized in that the dispatching model is divided into two parts, which are respectively a dispatching unit and an execution unit, and the dispatching unit adopts claim 1 The method described in any one of -6 schedules the mixed tasks.

进一步地,所述的调度单元包括任务收集器、实时调度器和任务整合单元,在机车运行操纵系统的运行过程中,不断有实时任务产生,所述任务收集器用于对所产生的任务进行集中处理,在每个时钟信号到来时,提交给实时调度器;所述实时调度器在下一个周期到来前,针对不同类型任务分别调用周期性实时任务调度算法和非周期性实时任务调度算法,对应生成周期性实时任务调度序列和非周期性实时任务调度序列;最后通过所述任务整合单元将两个序列合并生成一个统一调度序列,提交给所述任务执行单元;所述执行单元根据调度序列执行任务调度,并将调度结果和中间状态信息反馈给所述实时调度器,由所述实时调度器进行采集和保存。Further, the scheduling unit includes a task collector, a real-time scheduler and a task integration unit. During the operation of the locomotive operation and control system, real-time tasks are continuously generated, and the task collector is used to centralize the generated tasks Processing, when each clock signal arrives, it is submitted to the real-time scheduler; the real-time scheduler calls the periodic real-time task scheduling algorithm and the non-periodic real-time task scheduling algorithm respectively for different types of tasks before the arrival of the next cycle, and generates corresponding A periodic real-time task scheduling sequence and an aperiodic real-time task scheduling sequence; finally, the task integration unit combines the two sequences to generate a unified scheduling sequence, which is submitted to the task execution unit; the execution unit executes the task according to the scheduling sequence Scheduling, and feeding back the scheduling results and intermediate state information to the real-time scheduler, which collects and saves them.

本发明中所提到的动态阈值系数指的是本发明中通过模糊控制方法,在估价值乘以一个参数,这个参数是由模糊控制方法决定的,在不同的状态下会有不同的值,这里称它为动态阈值系数。The dynamic threshold coefficient mentioned in the present invention refers to that in the present invention, through the fuzzy control method, the estimated value is multiplied by a parameter. This parameter is determined by the fuzzy control method and has different values in different states. It is called dynamic threshold coefficient here.

采用上述技术方案的有益效果是:The beneficial effect of adopting the above-mentioned technical scheme is:

(1)本发明针对周期性实时任务设计的算法相比于优先级调度算法,能够极大地减小系统开销,包括任务切换的开销和处理器执行调度算法的开销;相比于静态表驱动的调度算法,该算法又能够比较灵活地处理系统执行过程中的各种变化情况。而且在系统稳定运行之后,本发明方法生成的调度表所需要的改动开销是非常小的。(1) Compared with the priority scheduling algorithm, the algorithm designed by the present invention for periodic real-time tasks can greatly reduce the system overhead, including the overhead of task switching and the overhead of the processor executing the scheduling algorithm; compared to the static table-driven Scheduling algorithm, which can more flexibly deal with various changes in the system execution process. Moreover, after the system runs stably, the modification overhead required by the scheduling table generated by the method of the present invention is very small.

(2)本发明采用了全新设计的一种估价函数,应用模糊控制方法对估价函数的参数就行模糊化,在保证最小化非周期性实时任务响应时间的基础上,主要有三点好处:第一,模糊的应用可以降低系统不确定性对调度的影响,在实际运行中,系统的状态是不可精确预知的,与调度模型中指定任务参数不同,任务的时间参数会在系统不同状态下有微小差别,而模糊技术能够减弱这种差别带来的影响;第二,模糊理论可以综合多因素对任务当前状态的累加影响,比如本发明设计中的任务空闲时间和完成率;第三,模糊阈值可以降低边缘条件下调度算法的抖动,如果是固定值的判断,在边界条件下系统很容易产生颠簸。(2) The present invention has adopted a kind of evaluation function of brand-new design, and application fuzzy control method is just fuzzy to the parameter of evaluation function, on the basis of guaranteeing to minimize aperiodic real-time task response time, mainly has three advantages: the first , the fuzzy application can reduce the impact of system uncertainty on scheduling. In actual operation, the state of the system cannot be precisely predicted. Different from the task parameters specified in the scheduling model, the time parameters of the task will vary slightly in different states of the system. difference, and fuzzy technology can weaken the impact of this difference; second, fuzzy theory can synthesize the cumulative impact of multiple factors on the current state of the task, such as task idle time and completion rate in the design of the present invention; third, fuzzy threshold It can reduce the jitter of the scheduling algorithm under marginal conditions. If the judgment is a fixed value, the system is prone to thrashing under boundary conditions.

附图说明Description of drawings

图1为本发明的铁路机车运行操纵系统的混合任务调度方法流程图;Fig. 1 is the flow chart of the hybrid task dispatching method of the railway locomotive operation control system of the present invention;

图2为本发明的调度方法在一个帧周期内的任务调度顺序图;Fig. 2 is a task scheduling sequence diagram within a frame period of the scheduling method of the present invention;

图3A和图3B为本发明在进行非周期性实时任务时,空闲时间和完成率隶属度函数的关系图;Fig. 3A and Fig. 3B are the relationship diagrams of idle time and completion rate membership function when the present invention is performing aperiodic real-time tasks;

图4为本发明的铁路机车运行操纵系统的混合任务调度模型示意图。Fig. 4 is a schematic diagram of a mixed task scheduling model of the railway locomotive operation and control system of the present invention.

具体实施方式detailed description

为使本发明更为清晰,下面结合附图对本发明进行详细地说明。In order to make the present invention clearer, the present invention will be described in detail below in conjunction with the accompanying drawings.

首先,为清晰描述铁路机车运行操纵系统中的各类任务集合,本发明定义任务模型如下:First of all, in order to clearly describe various task sets in the operation and control system of railway locomotives, the present invention defines task models as follows:

(1)周期性实时任务:周期性实时任务是具有固定周期的、循环执行的实时任务。可以将周期性实时任务表示成一个五元组:(1) Periodic real-time task: Periodic real-time task is a real-time task with fixed period and cyclic execution. Periodic real-time tasks can be expressed as a five-tuple:

p=(a,r,t,d,c)p=(a,r,t,d,c)

元组的元素分别为:周期性实时任务的到达时间、周期性实时任务的就绪时间、周期性实时任务的执行周期、周期性实时任务执行的截止期、周期性实时任务的单处理器上的最坏执行时间。The elements of the tuple are: the arrival time of the periodic real-time task, the ready time of the periodic real-time task, the execution period of the periodic real-time task, the deadline for the execution of the periodic real-time task, and the time period of the periodic real-time task on a single processor Worst execution time.

(2)非周期性实时任务:非周期性实时任务是到达时间随机的实时任务,同时它的执行时间是不确定的,可以将非周期性实时任务表示成一个四元组:(2) Aperiodic real-time task: Aperiodic real-time task is a real-time task with random arrival time, and its execution time is uncertain. Aperiodic real-time task can be expressed as a quadruple:

n=(a,r,d,c)n=(a,r,d,c)

元组的元素分别为:非周期性实时任务的到达时间、非周期性实时任务的就绪时间、非周期性实时任务执行的截止期、非周期性实时任务的单处理器上的最坏执行时间。The elements of the tuple are: the arrival time of the aperiodic real-time task, the ready time of the aperiodic real-time task, the deadline for the execution of the aperiodic real-time task, and the worst execution time of the aperiodic real-time task on a single processor .

(3)非实时任务:非实时任务是系统中除实时任务以外的其他任务,用一个四元组来表示:(3) Non-real-time tasks: Non-real-time tasks are tasks other than real-time tasks in the system, represented by a quadruple:

o=(a,r,s,l)o=(a,r,s,l)

元组的元素分别为:非实时任务的到达时间、非实时任务的就绪时间、非实时任务开始执行时间、非实时任务的延迟时间。The elements of the tuple are: the arrival time of the non-real-time task, the ready time of the non-real-time task, the start execution time of the non-real-time task, and the delay time of the non-real-time task.

本实施例提供一种铁路机车运行操纵系统的混合任务调度方法,具体实施流程如图1所示,其包括:This embodiment provides a mixed task scheduling method for a railway locomotive operation and control system. The specific implementation process is shown in Figure 1, which includes:

步骤S101,在帧周期开始时,调度方法进行准备工作,包括任务切换,资源检查等。Step S101, at the beginning of the frame period, the scheduling method performs preparatory work, including task switching, resource checking and so on.

本发明的调度方法以一个帧周期作为基本调度单元,其中帧周期为系统运行的基准周期,描述了系统周期分割的最小单元。周期性实时任务集中的任务周期以帧周期的倍数关系进行描述。The scheduling method of the present invention takes a frame cycle as a basic scheduling unit, wherein the frame cycle is a reference cycle of system operation, and describes the minimum unit of system cycle division. The task period in the periodic real-time task set is described by the multiple relationship of the frame period.

如图2所示,在一个帧周期开始时,调度方法需要进行上个周期结束时的任务切换工作,通常上个帧周期结束时可能正在执行的任务为非周期性实时任务或非实时任务,以上两种类型的任务在本发明的铁路机车运行操纵系统中优先级低于周期性实时任务。同时算法需要进行资源检查,确保上个周期的任务已经释放了相关资源。As shown in Figure 2, at the beginning of a frame period, the scheduling method needs to perform task switching at the end of the previous period. Usually, the tasks that may be executing at the end of the last frame period are aperiodic real-time tasks or non-real-time tasks. The above two types of tasks have a lower priority than periodic real-time tasks in the railway locomotive operation and control system of the present invention. At the same time, the algorithm needs to check resources to ensure that the tasks in the previous cycle have released related resources.

步骤S102,针对周期性实时任务,应用基于表驱动的二级优先级规则进行调度序列排序,并按照该序列调度周期性实时任务。Step S102, for the periodic real-time tasks, apply the table-driven two-level priority rule to sort the scheduling sequence, and schedule the periodic real-time tasks according to the sequence.

周期性实时任务是机车运行操纵系统混合任务中最重要的部分,通常承担着实时控制的功能,所以也应该分配较高的优先级。虽然机车运行操纵系统是一个复杂的优化控制系统,但是一旦系统的参数确定,则周期性实时任务的时间参数也是可预测的。同时,在不同的应用场景和环境下,系统的运行状态不同,周期性实时任务也会发生动态地变化。The periodic real-time task is the most important part of the mixed tasks of the locomotive operation and control system, and it usually undertakes the function of real-time control, so it should also be assigned a higher priority. Although the locomotive operation and control system is a complex optimal control system, once the system parameters are determined, the time parameters of periodic real-time tasks are also predictable. At the same time, in different application scenarios and environments, the operating status of the system is different, and the periodic real-time tasks will also change dynamically.

为了充分利用周期性实时任务在控制过程当中的可预测性,同时有针对性地处理该执行过程中的不确定性,本发明设计了一种基于表驱动的二级优先级规则的非抢占调度算法。该二级调度规则考察每个任务的截止期和任务间的时序约束关系。具体实施时,每个周期性实时任务具有两个优先级,分别为组优先级和实例优先级。在周期性实时任务的调度序列排列时,先按组优先级排序,再按实例优先级排序,最终生成调度序列。In order to make full use of the predictability of periodic real-time tasks in the control process, and at the same time deal with the uncertainty in the execution process in a targeted manner, the present invention designs a non-preemptive scheduling based on table-driven two-level priority rules algorithm. The second-level scheduling rule examines the deadline of each task and the relationship of timing constraints between tasks. During specific implementation, each periodic real-time task has two priorities, which are group priority and instance priority. When arranging the scheduling sequence of periodic real-time tasks, it is first sorted by group priority, then by instance priority, and finally generates a scheduling sequence.

具体生成规则如下:(1)为了充分利用处理器的利用率,首先按照任务集里截止期由小到大的顺序,设置若干个任务组。按照任务的周期,将每个周期性实时任务分配到任务组里,相同组的周期性任务具有相同的组优先级,即具有相同的重要程度;(2)根据任务间的时序约束,判定每个周期性任务的前驱任务。如果该任务的前驱任务的组优先级大于该任务,那么维持当前的两个任务的组优先级不变;否则,将该任务的前驱任务再分配到该任务的优先级组中;(3)对于组内任务的优先级顺序采用最小最坏执行时间作为判定标准,即最坏执行时间越小的任务具有越高的实例优先级。设置完全部任务的实例优先级后,再根据时序约束的关系,调整任务实例优先级顺序,让时序约束均能得到满足;(4)确定任务的执行顺序,先按照组优先级排序,然后对于组优先级相同的任务,按照实例优先级由高到低进行排序,最终生成周期性任务调度表。The specific generation rules are as follows: (1) In order to make full use of the utilization rate of the processor, first set up several task groups according to the order of deadlines in the task set from small to large. According to the period of the task, assign each periodic real-time task to the task group, and the periodic tasks in the same group have the same group priority, that is, have the same degree of importance; (2) According to the timing constraints between tasks, determine each The predecessor task of a periodic task. If the group priority of the predecessor task of the task is greater than the task, then keep the group priorities of the current two tasks unchanged; otherwise, reassign the predecessor task of the task to the priority group of the task; (3) For the priority order of tasks in the group, the smallest worst execution time is used as the criterion, that is, the task with the smaller worst execution time has a higher instance priority. After setting the instance priorities of all tasks, adjust the priority order of task instances according to the relationship of timing constraints, so that the timing constraints can be satisfied; (4) Determine the execution order of tasks, first sort according to the group priority, and then for Tasks with the same group priority are sorted according to the instance priority from high to low, and finally a periodic task schedule is generated.

二级优先级规则兼顾了计算开销和任务的截止期的动态变化特性。通过利用周期性实时任务的可预测性,在系统初始化阶段,可以对调度表的参数做一些预处理,比如优先级组的设定,调度表的预生成。在实际的系统设计过程中,由于周期性实时任务具有一定的局部时间特性,即在一段时间内,周期性实时任务集是稳定的。所以在调度表第一次生成后,以后的每次生成都可以在上一次生成的基础上进行修改,所需要的改动开销是很小的。The two-level priority rules take into account the dynamic characteristics of computational overhead and task deadlines. By utilizing the predictability of periodic real-time tasks, some preprocessing can be done on the parameters of the schedule during the system initialization phase, such as the setting of the priority group and the pre-generation of the schedule. In the actual system design process, because periodic real-time tasks have certain local time characteristics, that is, the set of periodic real-time tasks is stable within a period of time. Therefore, after the schedule table is generated for the first time, each subsequent generation can be modified on the basis of the previous generation, and the required modification cost is very small.

步骤S103,针对非周期性实时任务,应用基于启发式搜索策略和模糊控制的方法,对非周期性实时任务进行排列,并按照该序列调度任务。Step S103, for the non-periodic real-time tasks, apply the method based on heuristic search strategy and fuzzy control, arrange the non-periodic real-time tasks, and schedule the tasks according to the sequence.

非周期性实时任务的特点是随机到达,系统无法预测非周期性实时任务的到达时间。对于非周期性实时任务的调度目标是:在保证周期性实时任务调度满足截止期的前提下,最大化非周期性实时任务的完成成功率,同时让非周期性实时任务的响应时间最小。Aperiodic real-time tasks are characterized by random arrival, and the system cannot predict the arrival time of aperiodic real-time tasks. The scheduling goal of aperiodic real-time tasks is to maximize the completion success rate of aperiodic real-time tasks and minimize the response time of aperiodic real-time tasks on the premise of ensuring that the periodic real-time task scheduling meets the deadline.

综合系统调度目标及混合任务集的特点,非周期性实时任务调度问题可以看做是一种有约束的路径搜索问题,即在周期性实时任务剩余时间里合理地安排非周期性实时任务,让非周期性实时任务调度成功率和处理器的利用率都达到较理想的值。本发明设计了一种基于启发式搜索策略的非周期性实时任务调度算法,并运用模糊控制的思想,降低算法的不稳定性。Integrating the characteristics of system scheduling objectives and mixed task sets, the aperiodic real-time task scheduling problem can be regarded as a constrained path search problem, that is, to reasonably arrange aperiodic real-time tasks in the remaining time of periodic real-time tasks, so that The success rate of aperiodic real-time task scheduling and the utilization rate of the processor both reach ideal values. The invention designs an aperiodic real-time task scheduling algorithm based on a heuristic search strategy, and uses the idea of fuzzy control to reduce the instability of the algorithm.

启发式搜索策略过程为:对于由有序n元组组成的状态空间E,给定关于n元组中分量的一个约束集合D和最优目标函数C(x),通过对每个搜索位置进行评估,快速得到E中满足约束D中全部约束条件的一个n元组,该n元组就是启发式搜索问题的最优解。本发明中,该n元组对应非周期性实时任务的调度序列,满足约束结合D的要求的元组属于可调度序列,若该元组同时使得最优目标函数C(x)达到极值,则该元组为最优可调度序列。具体实施时,算法应用贪心方式,通过估价函数从任务集合中每次选出估价值最大的任务进行序列排序。可以证明,如果估价函数设计合理,满足单调性需求,同时任务集是可调度的,通过这种贪心方式取得的可调度节点一定是最优的可调度节点。The heuristic search strategy process is: for a state space E composed of ordered n-tuples, given a constraint set D and the optimal objective function C(x) about the components in the n-tuples, by performing Evaluation, quickly get an n-tuple in E that satisfies all the constraints in constraint D, and this n-tuple is the optimal solution to the heuristic search problem. In the present invention, the n-tuple corresponds to the scheduling sequence of non-periodic real-time tasks, and the tuple that meets the requirements of constraint combination D belongs to the schedulable sequence. If the tuple makes the optimal objective function C(x) reach the extreme value at the same time, Then the tuple is the optimal schedulable sequence. In the specific implementation, the algorithm adopts the greedy method, and selects the task with the highest estimated value from the task set through the evaluation function for sequence sorting. It can be proved that if the evaluation function is designed reasonably, satisfies the requirement of monotonicity, and the task set is schedulable, the schedulable nodes obtained by this greedy method must be the optimal schedulable nodes.

启发式搜索策略的关键是估价函数的设计,本发明引入模糊控制的思想,提出了一种新的估价函数设计方法。具体设计过程如下:The key of the heuristic search strategy is the design of the evaluation function. This invention introduces the idea of fuzzy control and proposes a new evaluation function design method. The specific design process is as follows:

(1)定义非周期性实时任务的空闲时间为:(1) Define the idle time of the aperiodic real-time task as:

nst=(nd-t)-(nc-e(n,t))n st =(n d -t)-(n c -e(n,t))

定义非周期性实时任务的完成率为:Define the completion rate of an aperiodic real-time task:

ncr(t)=e(n,t)/nc n cr (t)=e(n,t)/n c

其中,nst是非周期性实时任务n在时刻t的剩余空闲时间,nd是任务n的截止期,nc是最坏执行时间,e(n,t)是任务n在时刻t已经执行过的时间。Among them, n st is the remaining idle time of aperiodic real-time task n at time t, n d is the deadline of task n, n c is the worst execution time, e(n,t) is the task n has been executed at time t time.

如果一个非周期性实时任务的空闲时间越小,那么它越紧急,越应该优先调度;如果一个非周期性实时任务的完成率越高,那么它越需要多留在处理器中,去完成剩下的部分,需要优先得到调度。If the idle time of an aperiodic real-time task is smaller, it is more urgent and should be scheduled first; if the completion rate of an aperiodic real-time task is higher, then it needs to stay in the processor to complete the rest The part that needs to be scheduled first.

(2)本发明设计了一种模糊阈值规则,能够综合非周期性实时任务的空闲时间和完成率来判定其重要程度。非周期性实时任务的空闲时间和完成率隶属度函数如图3A和图3B所示。(2) The present invention designs a fuzzy threshold rule, which can determine the importance of non-periodic real-time tasks based on their idle time and completion rate. The membership functions of idle time and completion rate of aperiodic real-time tasks are shown in Figure 3A and Figure 3B.

分别用三个语言模糊集对应不同输入,空闲时间:短,中,长,以及完成率:低,中,高。为了避免在实时控制的过程中计算复杂,本发明采用具体的输出代表任务的模糊阈值系数,在实时计算的过程中,通过查表获得非周期性实时任务的模糊阈值的时间复杂度为O(1)。模糊输入的阈值系数对应关系表如下表所示:Three language fuzzy sets are used to correspond to different inputs, idle time: short, medium, long, and completion rate: low, medium, high. In order to avoid computing complexity in the process of real-time control, the present invention adopts the fuzzy threshold coefficient of specific output representative task, and in the process of real-time calculation, the time complexity of obtaining the fuzzy threshold of aperiodic real-time task by look-up table is O( 1). The corresponding relationship table of the threshold coefficient of the fuzzy input is shown in the following table:

上述关系表中第一行指明了非周期性实时任务空闲时间等级,即当前任务的紧急情况,第一列指明了非周期性实时任务的完成率,即当前任务需要继续完成的迫切程度。具体实施时先计算当前所有未调度的非周期实时任务在时刻t的空闲时间和完成率。根据空闲时间和完成率算出对应隶属度,然后再根据表中的对应关系,按比例求出动态阈值系数。The first row in the above relationship table indicates the idle time level of the aperiodic real-time task, that is, the urgency of the current task, and the first column indicates the completion rate of the aperiodic real-time task, that is, the urgency of the current task to continue to be completed. During specific implementation, the idle time and completion rate of all currently unscheduled aperiodic real-time tasks at time t are calculated. Calculate the corresponding membership degree according to the idle time and completion rate, and then calculate the dynamic threshold coefficient proportionally according to the corresponding relationship in the table.

(3)本发明定义估价函数如下:(3) The present invention defines the valuation function as follows:

H(n,t)=h(n,t)*nst H(n,t)=h(n,t)*n st

其中H(n,t)是非周期性实时任务在时刻t的估价函数,h(n,t)是非周期性实时任务n在时刻t的动态阈值,该值的计算方法按估价函数设计过程第(2)步中的表述进行计算。Among them, H(n,t) is the evaluation function of non-periodic real-time task at time t, h(n,t) is the dynamic threshold of non-periodic real-time task n at time t, the calculation method of this value is according to the evaluation function design process ( 2) The expression in the step is calculated.

通过以上步骤即可实现非周期性实时任务的调度序列排序,依照该序列可进行任务的调度过程。Through the above steps, the scheduling sequence of non-periodic real-time tasks can be realized, and the scheduling process of tasks can be performed according to the sequence.

步骤S104,后处理进行时间片的回收以及调度结果和反馈数据的采集工作,并判断剩余执行时间。Step S104, the post-processing is to recover time slices, collect scheduling results and feedback data, and determine the remaining execution time.

本发明的调度算法在一个帧周期内的任务调度顺序如图2所示。步骤S102和S103可完成混合任务集中周期性实时任务和非周期性实时任务的调度序列排序,并完成调度过程。接下来进行算法后处理过程进行帧周期内时间片的回收以及调度结果和反馈数据的收集工作,以上工作为充分利用帧周期内的时间资源,进一步进行非实时任务的调度作了准备。The task scheduling sequence of the scheduling algorithm of the present invention within a frame period is shown in FIG. 2 . Steps S102 and S103 can complete the scheduling sequence sorting of periodic real-time tasks and non-periodic real-time tasks in the mixed task set, and complete the scheduling process. Next, the post-processing of the algorithm is carried out to recover the time slices in the frame period and collect the scheduling results and feedback data. The above work is to make full use of the time resources in the frame period and make preparations for further scheduling of non-real-time tasks.

步骤S105,如果周期时间未用完,则执行非实时任务,其调度顺序按照FIFO规则进行调度。Step S105, if the cycle time is not used up, then execute the non-real-time tasks, and the scheduling order of them is scheduled according to the FIFO rule.

考察步骤S104后处理的结果,如果当前帧周期内仍有剩余的时间片,则从混合任务集中选择非实时性任务进行执行,选择的规则是FIFO规则。从而充分利用帧周期内的时间片资源。Considering the post-processing result of step S104, if there are still time slices left in the current frame period, select a non-real-time task from the mixed task set for execution, and the selected rule is the FIFO rule. In this way, time slice resources within the frame period are fully utilized.

如果当前混合任务集中无非实时任务,则进入空闲状态。If there is no non-real-time task in the current mixed task set, it will enter the idle state.

步骤S106,在帧周期结束时,如果非周期性实时任务或非实时任务还未执行结束,则会被下一帧周期的周期性实时任务抢占,确保周期性实时任务的实时性。Step S106, at the end of the frame period, if the aperiodic real-time task or the non-real-time task has not finished executing, it will be preempted by the periodic real-time task of the next frame period, so as to ensure the real-time performance of the periodic real-time task.

通过步骤S101至步骤S105即可实现系统中混合任务集的所有调度执行。在周期结束时,可能存在非周期性实时任务或非实时仍在执行的情况,此时该两种类型的任务优先级比周期性实时任务低,则会在下一个帧周期中被下一个帧周期内的帧周期实时任务所抢占,从而确保周期性实时任务的实时性。Through steps S101 to S105, all scheduled executions of mixed task sets in the system can be realized. At the end of the period, there may be non-periodic real-time tasks or non-real-time tasks that are still executing. At this time, the priority of these two types of tasks is lower than that of periodic real-time tasks, and they will be replaced by the next frame period in the next frame period. The real-time tasks within the frame period are preempted, thereby ensuring the real-time performance of the periodic real-time tasks.

以上S101至S106为一个帧周期内任务调度算法的执行步骤,在下一个帧周期内仍按照该算法顺序执行混合任务集的调度。The above S101 to S106 are the execution steps of the task scheduling algorithm in one frame period, and the scheduling of the mixed task set is still executed in accordance with the order of the algorithm in the next frame period.

本发明提出的铁路机车运行操作系统的混合任务调度模型如图4所示,包括任务调度单元和执行单元。调度单元包括任务收集器,实时调度器和任务整合单元。在系统运行过程中,不断有实时任务产生,其来源包括人机交互,外界信号,系统反馈等。任务初始化后,由任务收集器集中处理,在每个时钟信号到来时,提交给实时调度器;实时调度器在下一个周期到来前,整合这些任务,针对不同类型任务分别调用周期性实时任务调度算法和非周期性实时任务调度算法,对应生成周期性实时任务调度序列和非周期性实时任务调度序列;最后通过任务整合模块将两个序列合并生成一个统一调度序列,提交给任务执行单元。执行单元根据调度序列的指示,对任务进行调度,并将调度结果和一些中间状态反馈给实时调度器,由调度器进行采集和保存。The hybrid task scheduling model of the railway locomotive operating system proposed by the present invention is shown in Figure 4, including a task scheduling unit and an execution unit. The scheduling unit includes task collector, real-time scheduler and task integration unit. During the operation of the system, real-time tasks are continuously generated, and their sources include human-computer interaction, external signals, system feedback, etc. After the tasks are initialized, they are centrally processed by the task collector, and submitted to the real-time scheduler when each clock signal arrives; the real-time scheduler integrates these tasks before the arrival of the next cycle, and calls the periodic real-time task scheduling algorithm for different types of tasks respectively And aperiodic real-time task scheduling algorithm, correspondingly generate periodic real-time task scheduling sequence and aperiodic real-time task scheduling sequence; finally, combine the two sequences through the task integration module to generate a unified scheduling sequence, and submit it to the task execution unit. The execution unit schedules the tasks according to the instructions of the scheduling sequence, and feeds back the scheduling results and some intermediate states to the real-time scheduler, which collects and saves them.

由上述发明的技术方案可以看出,本发明针对周期性实时任务设计了一种基于表驱动的二级优先级规则的非抢占调度算法,具有较低的系统开销,同时兼顾了优先级调度的灵活性;针对非周期性实时任务设计了一种基于启发式搜索策略的非周期性实时任务调度算法,对任务集使用可行性分析,限制启发式搜索算法的递归深度,对启发式估价函数参数模糊化,降低调度时产生的抖动,该算法能够较好地处理非周期性实时任务调度;针对非实时任务,运用经典的FIFO规则,充分利用了系统的时间资源和计算资源,最大程度地保证了非实时任务被及时地调度执行。本发明设计的方法及模型能有效解决复杂铁路机车运行操纵系统的混合任务调度需求。It can be seen from the technical solution of the above invention that the present invention designs a non-preemptive scheduling algorithm based on table-driven two-level priority rules for periodic real-time tasks, which has low system overhead and takes into account the advantages of priority scheduling. Flexibility: A non-periodic real-time task scheduling algorithm based on a heuristic search strategy is designed for non-periodic real-time tasks, using feasibility analysis for task sets, limiting the recursion depth of the heuristic search algorithm, and adjusting the parameters of the heuristic evaluation function Fuzzification reduces the jitter generated during scheduling, and the algorithm can better handle non-periodic real-time task scheduling; for non-real-time tasks, the classic FIFO rule is used to make full use of the system's time resources and computing resources, ensuring maximum Non-real-time tasks are scheduled and executed in a timely manner. The method and model designed by the invention can effectively solve the mixed task scheduling requirements of the complex railway locomotive operation and control system.

虽然上面结合本发明的优选实施例对本发明的原理进行了详细的描述,本领域技术人员应该理解,上述实施例仅仅是对本发明的示意性实现方式的解释,并非对本发明包含范围的限定。实施例中的细节并不构成对本发明范围的限制,在不背离本发明的精神和范围的情况下,任何基于本发明技术方案的等效变换、简单替换等显而易见的改变,均落在本发明保护范围之内。Although the principle of the present invention has been described in detail above in conjunction with the preferred embodiments of the present invention, those skilled in the art should understand that the above embodiments are only explanations for the exemplary implementation of the present invention, and are not intended to limit the scope of the present invention. The details in the embodiments do not constitute a limitation to the scope of the present invention. Without departing from the spirit and scope of the present invention, any obvious changes such as equivalent transformations and simple replacements based on the technical solutions of the present invention fall within the scope of the present invention. within the scope of protection.

Claims (8)

1.一种铁路机车运行操纵系统的混合任务调度方法,其特征在于,所述混合任务包括:周期性实时任务、非周期性实时任务以及非实时任务;所述混合任务调度方法以一个帧周期作为基本调度单元,所述混合任务调度方法包括下述步骤:1. A mixed task scheduling method of a railway locomotive operation control system, characterized in that, said mixed task comprises: periodic real-time tasks, non-periodic real-time tasks and non-real-time tasks; said mixed task scheduling method uses a frame period As a basic scheduling unit, the hybrid task scheduling method includes the following steps: (1)帧周期开始时,所述混合任务调度方法进行调度准备,所述调度准备至少包括任务切换和资源检查;(1) When the frame period starts, the hybrid task scheduling method performs scheduling preparation, and the scheduling preparation includes at least task switching and resource checking; (2)针对周期性实时任务,应用基于表驱动的二级优先级规则进行调度序列排序,并按照该序列调度周期性实时任务;(2) For periodic real-time tasks, apply the table-driven two-level priority rule to sort the scheduling sequence, and schedule periodic real-time tasks according to the sequence; (3)针对非周期性实时任务,应用基于启发式搜索策略和模糊控制的方法,对非周期性实时任务进行排列,并按照该序列调度非周期性实时任务;(3) For non-periodic real-time tasks, apply the method based on heuristic search strategy and fuzzy control to arrange non-periodic real-time tasks, and schedule non-periodic real-time tasks according to the sequence; (4)对当前周期内未使用的时间片进行回收并且进行调度结果和反馈数据的采集,判断剩余执行时间;(4) Reclaim unused time slices in the current cycle and collect scheduling results and feedback data to determine the remaining execution time; (5)如果当前周期时间未用完,则执行非实时任务;(5) If the current cycle time is not used up, execute the non-real-time task; (6)在帧周期结束时,如果非周期性实时任务或非实时任务还未执行结束,则在下一帧周期开始时执行周期性实时任务,封存未执行完成的非周期性实时任务或非实时任务,确保周期性实时任务的实时性。(6) At the end of the frame period, if the execution of the non-periodic real-time task or non-real-time task has not ended, the periodic real-time task will be executed at the beginning of the next frame period, and the unfinished non-periodic real-time task or non-real-time task will be sealed. task, to ensure the real-time performance of periodic real-time tasks. 2.根据权利要求1所述的一种铁路机车运行操纵系统的混合任务调度方法,其特征在于,所述的基于表驱动的二级优先级规则是针对周期性实时任务在机车运行操纵系统中的可预测性提出的一种非抢占调度方法,所述的二级优先级分为组优先级和实例优先级,在所述步骤(2)中先按组优先级排序,再按实例优先级排序,最终生成调度表。2. The hybrid task scheduling method of a kind of railway locomotive operation and control system according to claim 1, characterized in that, said table-driven secondary priority rule is for periodic real-time tasks in the locomotive operation and control system A kind of non-preemptive scheduling method proposed by the predictability, described secondary priority is divided into group priority and instance priority, in described step (2) first sorts by group priority, then by instance priority Sort, and finally generate a schedule. 3.根据权利要求1所述的一种铁路机车运行操纵系统的混合任务调度方法,其特征在于,所述的基于启发式搜索策略引入了模糊控制的方法,提出了一种新的估价函数:3. the hybrid task scheduling method of a kind of railway locomotive operation and control system according to claim 1, is characterized in that, described based on heuristic search strategy has introduced the method for fuzzy control, has proposed a kind of new valuation function: H(n,t)=h(n,t)*nst H(n,t)=h(n,t)*n st nst=(nd-t)-(nc-e(n,t))n st =(n d -t)-(n c -e(n,t)) 其中H(n,t)是估价函数,h(n,t)是非周期性实时任务n在时刻t的动态阈值系数,nst是非周期性实时任务n在时刻t的剩余空闲时间,nd是任务n的截止期,nc是最坏执行时间,e(n,t)是任务n在时刻t已经执行过的时间。where H(n,t) is the valuation function, h(n,t) is the dynamic threshold coefficient of aperiodic real-time task n at time t, n st is the remaining idle time of aperiodic real-time task n at time t, n d is The deadline of task n, n c is the worst execution time, e(n,t) is the time that task n has been executed at time t. 4.根据权利要求2所述的一种铁路机车运行操纵系统的混合任务调度方法,其特征在于,在所述基于表驱动的二级优先级规则中,所述组优先级的设计规则为:先按照任务集中周期性实时任务的截止期由小到大的顺序,设置若干个任务组,然后根据任务间的时序约束,判定每个周期性任务的前驱任务并调整相应的任务组优先级;所述的实例优先级为任务组内部任务的排序规则,排序采用最小最坏执行时间规则。4. the hybrid task scheduling method of a kind of railway locomotive operation and control system according to claim 2, is characterized in that, in the described two-level priority rule based on table-driven, the design rule of described group priority is: First, set up several task groups according to the deadlines of periodic real-time tasks in the task set from small to large, and then determine the predecessor tasks of each periodic task and adjust the corresponding task group priority according to the timing constraints between tasks; The instance priority mentioned is the sorting rule of the internal tasks of the task group, and the sorting adopts the minimum and worst execution time rule. 5.根据权利要求3所述的一种铁路机车运行操纵系统的混合任务调度方法,其特征还在于,在所述估价函数中,非周期性实时任务的完成率也作为模糊输入参数,输入参数与阈值系数对应关系表如下表所示:5. the hybrid task scheduling method of a kind of railway locomotive operation and control system according to claim 3, it is also characterized in that, in the evaluation function, the completion rate of the aperiodic real-time task is also used as a fuzzy input parameter, and the input parameter The corresponding relationship with the threshold coefficient is shown in the following table: 任务完成率定义如下:ncr(t)=e(n,t)/ncThe task completion rate is defined as follows: n cr (t)=e(n,t)/n c . 6.根据权利要求1所述的一种铁路机车运行操纵系统的混合任务调度方法,其特征还在于,在所述步骤(5)中,对于非实时任务,调度顺序按照FIFO规则进行调度。6. The hybrid task scheduling method of a railway locomotive operation and control system according to claim 1, further characterized in that, in the step (5), for non-real-time tasks, the scheduling sequence is scheduled according to FIFO rules. 7.一种铁路机车运行操纵系统的混合任务调度模型,其特征在于,所述的调度模型分为两部分,分别为调度单元和执行单元,所述调度单元采用权利要求1-6中任意一项所述的方法对混合任务进行调度。7. A mixed task dispatching model of a railway locomotive operation control system, characterized in that, the dispatching model is divided into two parts, respectively a dispatching unit and an execution unit, and the dispatching unit adopts any one of claims 1-6 Mixed tasks are scheduled using the method described in this item. 8.根据权利要求7所述的一种铁路机车运行操纵系统的混合任务调度模型,其特征在于,所述的调度单元包括任务收集器、实时调度器和任务整合单元,在机车运行操纵系统的运行过程中,不断有实时任务产生,所述任务收集器用于对所产生的任务进行集中处理,在每个时钟信号到来时,提交给实时调度器;所述实时调度器在下一个周期到来前,针对不同类型任务分别调用周期性实时任务调度算法和非周期性实时任务调度算法,对应生成周期性实时任务调度序列和非周期性实时任务调度序列;最后通过所述任务整合单元将两个序列合并生成一个统一调度序列,提交给所述任务执行单元;所述执行单元根据调度序列执行任务调度,并将调度结果和中间状态信息反馈给所述实时调度器,由所述实时调度器进行采集和保存。8. The mixed task scheduling model of a kind of railway locomotive operation and control system according to claim 7, characterized in that, said dispatch unit comprises a task collector, a real-time scheduler and a task integration unit, in the locomotive operation and control system During the running process, real-time tasks are continuously generated, and the task collector is used to centrally process the generated tasks, and submit them to the real-time scheduler when each clock signal arrives; the real-time scheduler, before the arrival of the next cycle, For different types of tasks, the periodic real-time task scheduling algorithm and the non-periodic real-time task scheduling algorithm are called respectively, and the periodic real-time task scheduling sequence and the non-periodic real-time task scheduling sequence are correspondingly generated; finally, the two sequences are merged by the task integration unit Generate a unified scheduling sequence and submit it to the task execution unit; the execution unit executes task scheduling according to the scheduling sequence, and feeds back the scheduling result and intermediate state information to the real-time scheduler, and the real-time scheduler collects and save.
CN201710025822.9A 2017-01-13 2017-01-13 A kind of the hybrid tasks scheduling method and model of railway locomotive operation steerable system Active CN106773711B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710025822.9A CN106773711B (en) 2017-01-13 2017-01-13 A kind of the hybrid tasks scheduling method and model of railway locomotive operation steerable system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710025822.9A CN106773711B (en) 2017-01-13 2017-01-13 A kind of the hybrid tasks scheduling method and model of railway locomotive operation steerable system

Publications (2)

Publication Number Publication Date
CN106773711A true CN106773711A (en) 2017-05-31
CN106773711B CN106773711B (en) 2019-09-17

Family

ID=58946467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710025822.9A Active CN106773711B (en) 2017-01-13 2017-01-13 A kind of the hybrid tasks scheduling method and model of railway locomotive operation steerable system

Country Status (1)

Country Link
CN (1) CN106773711B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733473A (en) * 2018-05-11 2018-11-02 北京航天发射技术研究所 A kind of positioning based on VxWorks aims at the control method of integration apparatus task
CN110620735A (en) * 2019-09-09 2019-12-27 北京航天自动控制研究所 Dynamic load balancing telemetering method based on tabular configuration
CN111314801A (en) * 2020-02-13 2020-06-19 中国铁道科学研究院集团有限公司铁道建筑研究所 Data acquisition system and method supporting dynamic scheduling
WO2020252618A1 (en) * 2019-06-17 2020-12-24 Beijing Voyager Technology Co., Ltd. Systems and methods for controlling autonomous vehicle in real time
CN112214291A (en) * 2019-07-12 2021-01-12 杭州海康汽车技术有限公司 Task scheduling method and device
CN112368679A (en) * 2018-07-06 2021-02-12 苹果公司 System for scheduling threads for execution
CN113419834A (en) * 2021-07-02 2021-09-21 中国船舶重工集团公司第七二四研究所 Multitask time slot self-adaptive heterogeneous radar resource scheduling method
CN113495781A (en) * 2021-06-30 2021-10-12 东风商用车有限公司 Task scheduling method, device, equipment and readable storage medium
CN114661449A (en) * 2022-05-19 2022-06-24 四川傲势科技有限公司 Task scheduling method, embedded system and computer readable storage medium
CN115793623A (en) * 2023-02-08 2023-03-14 北京理工大学 Hardware-in-loop testing device and method for vehicle hybrid key system
CN116029646A (en) * 2023-02-15 2023-04-28 史达克智能科技(苏州)有限公司 Logistics equipment control system and method based on Internet of things
WO2023221949A1 (en) * 2022-05-18 2023-11-23 阿里云计算有限公司 Model scheduling method and device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070021998A1 (en) * 2005-06-27 2007-01-25 Road Ltd. Resource scheduling method and system
CN101484857A (en) * 2006-01-31 2009-07-15 通用电气公司 Method and apparatus for automatic selection of alternative routing through congested areas using congestion prediction metrics
CN101859347A (en) * 2010-05-26 2010-10-13 北京交通大学 A method for describing the operation process of high-speed train groups using intelligent hybrid model
US20130055276A1 (en) * 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus
CN103377078A (en) * 2012-04-11 2013-10-30 广州市地下铁道总公司 Real-time task scheduling method and system for vehicular ATP
CN105260497A (en) * 2015-08-07 2016-01-20 黑龙江大学 Semi-direct analogy method of real-time task schedulability test on the basis of linear linked list

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070021998A1 (en) * 2005-06-27 2007-01-25 Road Ltd. Resource scheduling method and system
CN101484857A (en) * 2006-01-31 2009-07-15 通用电气公司 Method and apparatus for automatic selection of alternative routing through congested areas using congestion prediction metrics
CN101859347A (en) * 2010-05-26 2010-10-13 北京交通大学 A method for describing the operation process of high-speed train groups using intelligent hybrid model
US20130055276A1 (en) * 2011-08-26 2013-02-28 Knu-Industry Cooperation Foundation Task scheduling method and apparatus
CN103377078A (en) * 2012-04-11 2013-10-30 广州市地下铁道总公司 Real-time task scheduling method and system for vehicular ATP
CN105260497A (en) * 2015-08-07 2016-01-20 黑龙江大学 Semi-direct analogy method of real-time task schedulability test on the basis of linear linked list

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
JIN HUANG 等: "An Energy一Efficient Train Control Framework for Smart Railway Transportation", 《IEEE TRANSACTIONS ON COMPUTERS》 *
JIN HUANG 等: "From Offline to Onboard System Solution for a Control Sequence Optimization Problem", 《2014 IEEE SYMPOSIUM ON COMPUTATIONAL INTELLIGENCE FOR ENGINEERING SOLUTIONS》 *
周继续 等: "地铁列车优化操纵与行车调度综合节能控制方法研究", 《HTTP://WWW.WANFANGDATA.COM.CN/DETAILS/DETAIL.DO?_TYPE=CONFERENCE&ID=8489578》 *
陈艳 等: "基于时间事件模型的实时系统仿真与时序分析", 《系统仿真学报》 *

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108733473A (en) * 2018-05-11 2018-11-02 北京航天发射技术研究所 A kind of positioning based on VxWorks aims at the control method of integration apparatus task
CN112368679A (en) * 2018-07-06 2021-02-12 苹果公司 System for scheduling threads for execution
WO2020252618A1 (en) * 2019-06-17 2020-12-24 Beijing Voyager Technology Co., Ltd. Systems and methods for controlling autonomous vehicle in real time
CN112262055B (en) * 2019-06-17 2023-11-17 北京航迹科技有限公司 System and method for controlling an autonomous vehicle in real time
CN112262055A (en) * 2019-06-17 2021-01-22 北京航迹科技有限公司 System and method for real-time control of autonomous vehicles
US10933884B2 (en) 2019-06-17 2021-03-02 Beijing Didi Infinity Technology And Development Co., Ltd. Systems and methods for controlling autonomous vehicle in real time
CN112214291A (en) * 2019-07-12 2021-01-12 杭州海康汽车技术有限公司 Task scheduling method and device
CN110620735A (en) * 2019-09-09 2019-12-27 北京航天自动控制研究所 Dynamic load balancing telemetering method based on tabular configuration
CN110620735B (en) * 2019-09-09 2023-02-28 北京航天自动控制研究所 Dynamic load balancing telemetering method based on tabular configuration
CN111314801A (en) * 2020-02-13 2020-06-19 中国铁道科学研究院集团有限公司铁道建筑研究所 Data acquisition system and method supporting dynamic scheduling
CN113495781A (en) * 2021-06-30 2021-10-12 东风商用车有限公司 Task scheduling method, device, equipment and readable storage medium
CN113495781B (en) * 2021-06-30 2023-03-03 东风商用车有限公司 Task scheduling method, device, equipment and readable storage medium
CN113419834A (en) * 2021-07-02 2021-09-21 中国船舶重工集团公司第七二四研究所 Multitask time slot self-adaptive heterogeneous radar resource scheduling method
CN113419834B (en) * 2021-07-02 2023-02-17 中国船舶重工集团公司第七二四研究所 Multitask time slot self-adaptive heterogeneous radar resource scheduling method
WO2023221949A1 (en) * 2022-05-18 2023-11-23 阿里云计算有限公司 Model scheduling method and device, and storage medium
CN114661449A (en) * 2022-05-19 2022-06-24 四川傲势科技有限公司 Task scheduling method, embedded system and computer readable storage medium
CN114661449B (en) * 2022-05-19 2022-08-19 四川傲势科技有限公司 Task scheduling method, embedded system and computer readable storage medium
CN115793623B (en) * 2023-02-08 2023-05-16 北京理工大学 Hardware-in-loop testing device and method for vehicle hybrid key system
CN115793623A (en) * 2023-02-08 2023-03-14 北京理工大学 Hardware-in-loop testing device and method for vehicle hybrid key system
CN116029646A (en) * 2023-02-15 2023-04-28 史达克智能科技(苏州)有限公司 Logistics equipment control system and method based on Internet of things
CN116029646B (en) * 2023-02-15 2024-08-20 史达克智能自动化装备(苏州)有限公司 Logistics equipment control system and method based on Internet of things

Also Published As

Publication number Publication date
CN106773711B (en) 2019-09-17

Similar Documents

Publication Publication Date Title
CN106773711B (en) A kind of the hybrid tasks scheduling method and model of railway locomotive operation steerable system
CN111427681A (en) Real-time task matching scheduling system and method based on resource monitoring in edge computing
CN108984292A (en) Mix critical system fixed priority periodic duty energy consumption optimization method
CN106802553A (en) A kind of railway locomotive operation control system hybrid tasks scheduling method based on intensified learning
CN103823706B (en) A kind of plant model analog simulation real-time scheduling method based on RTLinux
CN107728466A (en) One kind is applied to digital control system fixed priority reliability and perceives energy consumption optimization method
CN112486652B (en) Non-preemptive fixed priority hybrid critical task energy consumption optimal scheduling method
CN109918185B (en) Scheduling method based on virtual task fixed priority mixed key system
Wan et al. Fuzzy feedback scheduling algorithm based on central processing unit utilization for a software-based computer numerical control system
CN112000452A (en) Queuing theory-based real-time analysis method for automatic driving system
CN112905330B (en) Fixed priority hybrid key sporadic task energy consumption sensing method
Hu et al. Adaptive runtime shaping for mixed-criticality systems
CN109308216B (en) A real-time task scheduling method for single-core systems for imprecise computing
CN113946440A (en) Resource scheduling method in green cloud environment
CN102654843A (en) Non-preemptive type fault-tolerant scheduling method in embedded processor and embedded processor
Wan et al. Key technology of embedded system implementation for software-based CNC system
CN117632412A (en) Hybrid real-time task scheduling and two-level admission control method for space applications
Salmani et al. A fuzzy-based multi-criteria scheduler for uniform multiprocessor real-time systems
CN113504966A (en) GPU cluster scheduling strategy simulation method and GPU cluster simulator
Sabeghi et al. A fuzzy algorithm for scheduling soft periodic tasks in preemptive real-time systems
CN108874517A (en) The stand-by system availability of fixed priority divides energy consumption optimization method
He et al. Hybrid earliest deadline first/preemption threshold scheduling for real-time systems
Sabeghi et al. A fuzzy algorithm for real-time scheduling of soft periodic tasks
Devaraj et al. Exact task completion time aware real-time scheduling based on supervisory control theory of timed DES
Slimani et al. Hardware Fuzzy Scheduler for Real-Time Independent Tasks

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