CN101887384A - A method for determining the length of process time slice based on Markov model - Google Patents

A method for determining the length of process time slice based on Markov model Download PDF

Info

Publication number
CN101887384A
CN101887384A CN 201010215076 CN201010215076A CN101887384A CN 101887384 A CN101887384 A CN 101887384A CN 201010215076 CN201010215076 CN 201010215076 CN 201010215076 A CN201010215076 A CN 201010215076A CN 101887384 A CN101887384 A CN 101887384A
Authority
CN
China
Prior art keywords
markov model
time slice
length
timeslice
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
CN 201010215076
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.)
Sun Yat Sen University
Original Assignee
Sun Yat Sen 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 Sun Yat Sen University filed Critical Sun Yat Sen University
Priority to CN 201010215076 priority Critical patent/CN101887384A/en
Publication of CN101887384A publication Critical patent/CN101887384A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention discloses a Markov model-based process timeslice length determining method, which comprises the following steps of: mapping out parameters of a Markov model; applying the Markov model to the determination of a timeslice; and making corresponding parameter adjustment according to sleep time. By implementing the method, a system presets the parameters of the Markov model in a process, the current process timeslice is calculated according to the Markov model, and the parameters of the Markov model are adjusted according to the sleep time of the process, so the timeslice length can be timely adjusted and the process performance and the system overall optimization are improved.

Description

一种基于马尔科夫模型的进程时间片长度确定方法 A method for determining the length of process time slice based on Markov model

技术领域technical field

本发明涉及信息技术领域,具体涉及一种基于马尔科夫模型的进程时间片长度确定方法。The invention relates to the field of information technology, in particular to a method for determining the length of a process time slice based on a Markov model.

背景技术Background technique

调度程序是操作系统内核的重要组成部分,负责选定和分配需要运行的进程,可以看作是可运行态进程之间分配有限的处理器时间资源的内核子系统,调度程序是Linux、Windows之类的多任务操作系统的基础。只有通过调度程序的合理调度,系统资源才能最大限度地发挥作用,达到系统吞吐量与响应时间的统一。The scheduler is an important part of the operating system kernel. It is responsible for selecting and distributing the processes that need to be run. It can be regarded as a kernel subsystem that allocates limited processor time resources among runnable processes. The scheduler is a system between Linux and Windows. The basis of a class of multitasking operating systems. Only through the reasonable scheduling of the scheduler can the system resources play their role to the maximum and achieve the unity of system throughput and response time.

在进程调度中,进程时间片长度是一个重要的组成部分。进程时间片是分配各当前进程的处理器时间段。进程可以分为I/O消耗型和处理器消耗型,其中:I/O消耗型进程是指大部分时间用来提交I/O请求或者等待I/O请求的进程。此类型进程通常处于可运行状态,但运行时间较短,在等待更多的I/O请求时总会阻塞。处理器消耗型进程是指大部分时间用在执行代码上的进程,除非被抢占,通常一直不断地运行。进程类型的判定主要是依据休眠时间的长度。如果一个进程的大部分时间都在休眠,那么它就是I/O消耗型的。如果一个进程执行的时间比休眠的时间长,那它就是处理器消耗型的。大多数交互性较强的进程都是I/O消耗型的,提高这种进程的运行频率可以提高系统的响应速度。对I/O消耗型进程应该分配一些更短的时间片,提高运行的频率。处理器消耗型进程则把很多时间用于运行代码上,没有太多的I/O请求,对于处理器消耗型进程应该分配更长的时间片,降低运行频率。In process scheduling, the length of the process time slice is an important component. A process time slice is a segment of processor time allocated to each current process. Processes can be divided into I/O-consuming and processor-consuming processes, wherein: I/O-consuming processes refer to processes that spend most of their time submitting I/O requests or waiting for I/O requests. This type of process is usually in a runnable state, but the running time is short, and it will always block while waiting for more I/O requests. A processor-intensive process is one that spends most of its time executing code and typically runs continuously unless preempted. The determination of the process type is mainly based on the length of the sleep time. A process is I/O hungry if it spends most of its time sleeping. A process is processor-hungry if it takes longer to execute than sleep. Most interactive processes are I/O-consuming, and increasing the running frequency of such processes can improve the response speed of the system. Some shorter time slices should be allocated to I/O-consuming processes to increase the frequency of operation. Processor-consuming processes spend a lot of time running code without too many I/O requests. For processor-consuming processes, a longer time slice should be allocated to reduce the operating frequency.

时间片的计算主要是依据进程的优先级,优先级主要是根据休眠时间调整的,并没有考虑到进程的历史时间片,因而可能出现时间片长度的骤变,导致各进程时间片的失衡,个别进程性能下降和系统总体表现不佳。The calculation of the time slice is mainly based on the priority of the process. The priority is mainly adjusted according to the sleep time, and the historical time slice of the process is not considered. Therefore, the length of the time slice may change suddenly, resulting in an imbalance of the time slice of each process. Degraded performance of individual processes and poor performance of the system as a whole.

发明内容Contents of the invention

本发明的实施例提供一种基于马尔科夫模型的进程时间片长度确定方法,能够提高时间片长度确定的有效性,从而提高进程效率与系统的整体性能表现。Embodiments of the present invention provide a method for determining the length of a process time slice based on a Markov model, which can improve the effectiveness of determining the length of a time slice, thereby improving process efficiency and overall performance of the system.

本发明的实施例提供一种基于马尔科夫模型的进程时间片长度确定方法,包括:Embodiments of the present invention provide a method for determining the length of a process time slice based on a Markov model, including:

拟定马尔科夫模型的参数;Formulate the parameters of the Markov model;

运用马尔科夫模型确定进程时间片的长度;Use the Markov model to determine the length of the process time slice;

根据进程休眠时间调整马尔科夫模型的参数。Adjust the parameters of the Markov model according to the process sleep time.

所述拟定马尔科夫模型的参数包括:The parameters of the proposed Markov model include:

确定马尔科夫模型的状态转移概率矩阵,以确定历史时间片对当前时间片长度的影响。Determine the state transition probability matrix of the Markov model to determine the impact of historical time slices on the length of the current time slice.

所将马尔科夫模型应用到时间片的确定包括:The determination of the Markov model to be applied to the time slice includes:

运用马尔科夫模型中的状态转移矩阵确定当前时间片长度。Use the state transition matrix in the Markov model to determine the length of the current time slice.

所述根据休眠时间做相应的参数调整包括:The corresponding parameter adjustment according to the sleep time includes:

根据进程休眠时间重新调整状态转移矩阵。Readjust the state transition matrix according to the process sleep time.

在本发明的实施例中,系统先预设进程马尔科夫模型的参数,根据马尔科夫模型计算当前进程时间片并根据进程休眠时间调整马尔科夫模型的参数。本发明实施例根据休眠时间调整,考虑到进程的历史时间片,能及时调整时间片长度,从而提高进程性能和系统总体优化性。In the embodiment of the present invention, the system first presets the parameters of the process Markov model, calculates the current process time slice according to the Markov model, and adjusts the parameters of the Markov model according to the process sleep time. According to the sleep time adjustment, the embodiments of the present invention can adjust the time slice length in time by considering the historical time slice of the process, thereby improving the process performance and overall system optimization.

附图说明Description of drawings

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.

图1为本发明实施例中的基于马尔科夫模型的进程时间片长度确定流程图。FIG. 1 is a flow chart of determining the length of a process time slice based on a Markov model in an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without creative efforts fall within the protection scope of the present invention.

图1示出的是基于马尔科夫模型的进程时间片长度确定流程图。FIG. 1 shows a flow chart of determining the length of a process time slice based on a Markov model.

①初始化历史时间片数组。其形式如下T={t0,t1,t2,t3...}。历史时间片数组在系统的进程维护表中添加,数组有最大长度,设为6。设定最大长度是为了动态地考虑历史时间片长度,而不是全部考虑,提供一定的灵活性。一般使用的历史时间片长度为3或4。适当的长度一方面能够提高确定出来的当前进程时间片长度的有效性,另一方面也要减少进程时间片长度的计算量,提高效率。同时,历史时间片数组的值设为进程初始化时分配的时间片长度,若设为0值,由状态转移矩阵计算,考虑历史时间片的情况下,下一时间片的长度计算将偏短。① Initialize the historical time slice array. Its form is as follows T={t 0 , t 1 , t 2 , t 3 . . . }. The historical time slice array is added in the process maintenance table of the system, and the array has a maximum length, which is set to 6. The purpose of setting the maximum length is to dynamically consider the length of the historical time slice, instead of considering all of them, so as to provide a certain degree of flexibility. The generally used historical time slice length is 3 or 4. An appropriate length can improve the effectiveness of the determined current process time slice length on the one hand, and reduce the calculation amount of the process time slice length on the other hand to improve efficiency. At the same time, the value of the historical time slice array is set to the time slice length allocated when the process is initialized. If it is set to 0, it is calculated by the state transition matrix. Considering the historical time slice, the calculation of the length of the next time slice will be too short.

②拟定马尔科夫模型参数。在马尔科夫模型当中一个重要组成部分是转移概率矩阵,这也是在时间片计算中的重要部分。矩阵中的每一项表现为所对应的历史时间片对于当前时间片的影响,设定为数组形式如M={a0,a1,a2,a3...},其中M表示转移矩阵,为一维行向量,最大长度与历史时间片数组长度一致,设为6,计算过程中,其动态长度与历史时间片数组的动态长度一样,一般为3或4。在M当中,a0对应历史时间片数组的第一项,表示该历史时间片对于当前时间片计算的概率影响,其余依次类推。这样M中就包含了历史时间片数组元素对于当前时间片计算的影响,并且M中的元素应当满足约束条件:a0+a1+a2+a3+a4+a5=1。数值1表明当前时间片数组仅有历史时间片决定。当M的动态长度为4,而非总长度6时,a4,a5的值要设置为0,表明不将相对应的历史时间片纳入考虑。动态长度为3或其他值时依次类推。② Draw up the parameters of the Markov model. An important component in the Markov model is the transition probability matrix, which is also an important part in the calculation of time slices. Each item in the matrix represents the influence of the corresponding historical time slice on the current time slice, which is set in the form of an array such as M={a 0 , a 1 , a 2 , a 3 ...}, where M represents transfer The matrix is a one-dimensional row vector. The maximum length is the same as the length of the historical time slice array, which is set to 6. During the calculation process, its dynamic length is the same as that of the historical time slice array, generally 3 or 4. In M, a0 corresponds to the first item of the historical time slice array, indicating the probability influence of the historical time slice on the calculation of the current time slice, and so on. In this way, M contains the influence of elements of the historical time slice array on the calculation of the current time slice, and the elements in M should satisfy the constraint condition: a 0 +a 1 +a 2 +a 3 +a 4 +a 5 =1. A value of 1 indicates that the current time slice array is only determined by historical time slices. When the dynamic length of M is 4 instead of the total length 6, the values of a 4 and a 5 should be set to 0, indicating that the corresponding historical time slice is not taken into consideration. And so on when the dynamic length is 3 or other values.

③当前时间片的计算。在确定好M的模型后,可以计算当前时间片。当前时间片的计算不能太复杂,否则占用过多的CPU时间,反而导致系统性能的下降,适得其反。因而需要设计O(1)的计算方法。计算方法为③ Calculation of the current time slice. After the model of M is determined, the current time slice can be calculated. The calculation of the current time slice should not be too complicated, otherwise it will take up too much CPU time, which will lead to a decrease in system performance, which is counterproductive. Therefore, it is necessary to design a calculation method of O(1). The calculation method is

tt == ΣΣ ii == 00 ll aa ii tt ii

其中t表示当前的历史时间片。这种计算方法就将历史时间片对当前时间片的影响考虑进去。where t represents the current historical time slice. This calculation method takes into account the influence of the historical time slice on the current time slice.

④更新当前历史时间片数组。其操作方法为将历史时间片数组的元素依次右移,用计算出来的当前时间片替换数组中的第一项,并根据当前的动态数组长度将超出范围的元素设置为0。如历史时间片数组为T={t0,t1,t2,0,0,0},可以知道其动态长度为3,更新之后为T={t,t0,t1,0,0,0}。④Update the current historical time slice array. The operation method is to shift the elements of the historical time slice array to the right one by one, replace the first item in the array with the calculated current time slice, and set the out-of-range elements to 0 according to the current dynamic array length. For example, the historical time slice array is T={t 0 , t 1 , t 2 , 0, 0, 0}, it can be known that its dynamic length is 3, after updating it is T={t, t 0 , t 1 , 0 , 0 ,0}.

⑤进程出现休眠,马尔科夫模型参数的更新。进程出现休眠表明,进程类型的转变,譬如休眠时间越长,表明进程偏向于I/O型。进程的休眠时间长短直接影响进程的优先级。马尔科夫模型的参数也要与进程的优先级改变保持一致,因而当优先级增大时,在满足约束条件之下,需要相应提高最近历史时间片对当前时间片的概率影响;优先级减少时,在满足约束条件之下,需要相应降低最近历史时间片对当前时间片的概率影响。譬如,当进程优先级提高时,M={a0,a1,a2,a3...},M中a0,a1的值需要相应提高,M中a2,a3的值需要相应降低,同时需要满足约束条件。这样就可以考虑到进程类型转变时,进程时间片长度不会大幅变化,保持进程性能的同时也保持系统整体表现⑤ The process appears dormant, and the Markov model parameters are updated. The dormancy of the process indicates that the process type changes, for example, the longer the dormancy time, it indicates that the process is biased towards I/O type. The sleep time of a process directly affects the priority of the process. The parameters of the Markov model should also be consistent with the change of the priority of the process. Therefore, when the priority increases, under the constraint conditions, it is necessary to increase the probability influence of the latest historical time slice on the current time slice; the priority decreases When , under the constraint conditions, it is necessary to reduce the probability influence of the recent historical time slice on the current time slice accordingly. For example, when the process priority increases, M={a 0 , a 1 , a 2 , a 3 ...}, the values of a 0 and a 1 in M need to be increased accordingly, and the values of a 2 and a 3 in M It needs to be reduced accordingly, and the constraints need to be met. In this way, it can be considered that when the process type changes, the length of the process time slice will not change significantly, and the overall performance of the system can be maintained while maintaining the process performance.

本领域普通技术人员可以理解上述实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing related hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: only Read memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), disk or CD, etc.

以上对本发明实施例所提供的一种较佳实施例而已,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本发明的限制。The above is only a preferred embodiment provided by the embodiment of the present invention, which has been introduced in detail. In this paper, specific examples are used to illustrate the principle and implementation of the present invention. The description of the above embodiment is only used to help understand the present invention. The method of the invention and its core idea; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation and scope of application. In summary, the content of this specification should not be understood To limit the present invention.

Claims (4)

1. the process timeslice length based on Markov model is determined method, it is characterized in that, comprising:
Draft the parameter of Markov model;
Markov model is applied to determining of timeslice;
Do corresponding parameter adjustment according to dormancy time.
2. method according to claim 1 is characterized in that, the described parameter of drafting Markov model comprises:
Determine the state transition probability matrix of Markov model, to determine of the influence of historical time sheet to the current time leaf length.
3. method according to claim 1 is characterized in that, with Markov model be applied to timeslice determine comprise:
State-transition matrix in the utilization Markov model is determined the current time leaf length.
4. method according to claim 1 is characterized in that, describedly does corresponding parameter adjustment according to dormancy time and comprises:
Readjust state-transition matrix according to the process dormancy time.
CN 201010215076 2010-06-30 2010-06-30 A method for determining the length of process time slice based on Markov model Pending CN101887384A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010215076 CN101887384A (en) 2010-06-30 2010-06-30 A method for determining the length of process time slice based on Markov model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010215076 CN101887384A (en) 2010-06-30 2010-06-30 A method for determining the length of process time slice based on Markov model

Publications (1)

Publication Number Publication Date
CN101887384A true CN101887384A (en) 2010-11-17

Family

ID=43073312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010215076 Pending CN101887384A (en) 2010-06-30 2010-06-30 A method for determining the length of process time slice based on Markov model

Country Status (1)

Country Link
CN (1) CN101887384A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117321A (en) * 2015-06-30 2015-12-02 浪潮(北京)电子信息产业有限公司 Process management method and process management terminal
CN107948230A (en) * 2016-10-13 2018-04-20 北京京东尚科信息技术有限公司 Determine the method and device of the cache-time from service end data
CN111858200A (en) * 2020-06-22 2020-10-30 银清科技有限公司 Throughput control method and device in system test and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851654A (en) * 2006-05-23 2006-10-25 浙江大学 Method for realizing process equal timeslice round robin scheduling for embedded SRAM operating system
US20070294695A1 (en) * 2006-06-19 2007-12-20 Craig Jensen Method, system, and apparatus for scheduling computer micro-jobs to execute at non-disruptive times
CN101246437A (en) * 2008-01-28 2008-08-20 中兴通讯股份有限公司 A balanced scheduling method for processes in embedded real-time systems
CN101556545A (en) * 2009-05-22 2009-10-14 北京星网锐捷网络技术有限公司 Method for realizing process support, device and multithreading system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851654A (en) * 2006-05-23 2006-10-25 浙江大学 Method for realizing process equal timeslice round robin scheduling for embedded SRAM operating system
US20070294695A1 (en) * 2006-06-19 2007-12-20 Craig Jensen Method, system, and apparatus for scheduling computer micro-jobs to execute at non-disruptive times
CN101473306A (en) * 2006-06-19 2009-07-01 帝斯科匹尔公司 Resource-based scheduler
CN101246437A (en) * 2008-01-28 2008-08-20 中兴通讯股份有限公司 A balanced scheduling method for processes in embedded real-time systems
CN101556545A (en) * 2009-05-22 2009-10-14 北京星网锐捷网络技术有限公司 Method for realizing process support, device and multithreading system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105117321A (en) * 2015-06-30 2015-12-02 浪潮(北京)电子信息产业有限公司 Process management method and process management terminal
CN105117321B (en) * 2015-06-30 2018-07-31 浪潮(北京)电子信息产业有限公司 A kind of process management method and management of process terminal
CN107948230A (en) * 2016-10-13 2018-04-20 北京京东尚科信息技术有限公司 Determine the method and device of the cache-time from service end data
CN107948230B (en) * 2016-10-13 2021-07-30 北京京东尚科信息技术有限公司 Method and device for determining cache time of data from server
CN111858200A (en) * 2020-06-22 2020-10-30 银清科技有限公司 Throughput control method and device in system test and electronic equipment
CN111858200B (en) * 2020-06-22 2023-10-20 银清科技有限公司 Throughput control method and device in system test and electronic equipment

Similar Documents

Publication Publication Date Title
US9904346B2 (en) Methods and apparatus to improve turbo performance for events handling
CN111767134A (en) A Multitasking Dynamic Resource Scheduling Method
US20190392300A1 (en) Systems and methods for data compression in neural networks
CN103823714B (en) Virtualization-based method and device for adjusting QoS (quality of service) of node memory of NUMA (non uniform memory access architecture)
US10157155B2 (en) Operating system-managed interrupt steering in multiprocessor systems
CN105677000B (en) The system and method for dynamic voltage frequency adjustment
CN106649139B (en) Data elimination method and device based on multiple caches
CN112231081B (en) PSO-AHP-based monotonic rate resource scheduling method and system in cloud environment
US11803224B2 (en) Power management method, multi-processing unit system and power management module
CN101470519A (en) Apparatus and method for controlling power management
CN109324891A (en) A kind of periodic duty low-power consumption scheduling method of ratio free time distribution
CN115211092A (en) Message pulling method and device and computer storage medium
WO2020248227A1 (en) Load prediction-based hadoop computing task speculative execution method
CN102135914A (en) Cloud computing system load predicting method capable of automatically adjusting parameters
CN103914346A (en) Group-based dual-priority task scheduling and energy saving method for real-time operating system
CN118863055A (en) A hybrid expert model reasoning method
CN114676761B (en) Pre-training model training processing method and device, electronic equipment and storage medium
CN101887384A (en) A method for determining the length of process time slice based on Markov model
CN110413400B (en) CPU frequency adjusting method and system
US10025372B2 (en) Techniques for managing system power using deferred graphics rendering
CN111240818A (en) Task scheduling energy-saving method under heterogeneous system environment of multiple same GPUs (graphic processing units)
CN111813553B (en) Task dynamic priority low-energy consumption method based on selectable factor period
KR20220163575A (en) Operation device of artificial neural network, operation method of artificial neural network and computer program stored in a recording medium to execute the method
US20240281637A1 (en) Method and apparatus for pruning neural network filters based on clustering
US20200211146A1 (en) Data processing systems

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20101117