201017362 ; vw …VJ2 28437twfdoc/n 九、發明說明: 【發明所屬之技術領域】 本發明疋有關於—種即時系統之卫作排程,且特別是 =於-種即時系統之工作排程的頻率調整方法及使用此 方法的電腦程式產品。 【先前技術】 二般來說’中央處理器(Ce_ pr嶋_触,cpu) ^!iL(SChedUling) (Multi-task) ί 藉由中央處理器在不同工作(Task)之 = 作業系統可以讓電腦的輸出量提高。也就是說, 二另1VI有"―個广作在執行,以提高中央處理器的使用 Lr i’,處理器系統裡,—次只能執行一個工作, 以^個工作同時在執行,因此如果有多個工作的狀 ;;後再進作都必須等待中央處理器處理完當下的工 萌,個卫作執行之前,中央處理器處於間置狀 置睹。=碟式規劃’就能有效地利用中央處理器的間 中,杏宜元程式規劃是將多個工作同時存放在記憶體之 的控:權時候,作業系統就把中央處理器 當一個::走並且父給另-個工作。依上述方式進行,每 理另外要等待的時候’中央處理器就可以先行處 間限:外對系統(Real_timesystem)有著較嚴格的時 對於硬即時系統(hard real-time system)而言, ^ 28437twf.doc/n 201017362 所有工作更是必須要在所訂定的時間限伽完成, 嚴重的後果(例如:核能發電廠的核子反應爐監視 Ϊ統夕、另外,、對於廣泛應用於今曰生活且以電池為電源 七可攜式嵌人式純來說,㈣時符合即_統的期限要 的電求,以便於增加可攜式嵌入式系統 的使用時間,麵免產生嚴重的後果。因此,如何在最佳 1作排程下’達到降低十央處理器的使用頻率且符合 =系統對時序的要求’進而使得即時㈣較為省電,i且 =即時系統在計算排程的時間,將是—個重要的課題。 【發明内容】 本發酿供—_率娜方法及使用此綠的電腦程 ΐ產品,藉此減少工作排程的運算時間以及降低即時系統 中的處理器頻率以達到省電的作用。 … ❹ 本發明提出一種頻率調整方法,適用於即時系統之工 ^排程。此鮮娜方法包括下列步驟。首先,取得多個 工作’其中上述工作各自對應多個參數值 f數值,計算上述工作各自的最小時脈頻率。之 ^上=作各自的最小時脈辭缝上述I伽優先權順 异出上述工作的理想頻率。接著,依據上述工作的 先權順序先後,判斷優先胸序較先 ,率是否,優先權順序次之的第二筆工作的二 相、之後,虽第-筆工作的理想頻率大於第二筆的理 想頻率時,依據第二筆工作的最大執行時間,調整第二筆 工作的理想頻率。接著,將上述多個功的理想頻率各自 [)Z 28437twf.doc/n 201017362 對應至即時系統之處理器的實際頻率,以用^ 率執行上述多個工作。 這些實際頻 在本發明一實施例中,上述參數值包括 期以及時限。 仃時間、週 ❹ ❹ 在本發明一實施例中,上述計算出工作 步驟包括依據上述工作的優先權順序,士想頻率的 最優先的工作進行計算,且每一工作的序 =後於或等於其優先權順序之工作的最小時 在本發明一實施例中,上述在比較第—筆 頻率與第二筆1作的理想頻率的步驟 驟。首先’當[筆工作__率不Α於第 理想頻率時,將第—筆功的理想頻率置換為第 的理想頻率,並將第二筆卫作的理想辭置換為第^ 作的理想頻率,其中第三筆工作的優祕順序在第二筆工 作之後。接著’回到「比較優_順序較細第—筆 的理想頻率與優先權順序次之的第二筆1作的理想頻率 的步驟。 在本發明—實施例中,上述在利用上述實際頻率執行 上述工作的步驟包括下列步驟。當調降即時系統之處理器 的工作電壓與g卩時祕之處理㈣實際頻率時,先調降即 寺系統之處理器的實際頻率後,再調降即時系統之處理器 的工作電壓。當調升即時系統之處理器的工作電壓與即時 ^ 28437twf.doc/n 201017362 系統之處理器的實際頻率時,先調升即 工作電壓後,再調即時系統之處理器的升實際2理器的 本發明提出一種頻率调整方法帛 不, 作排程,且此,:二 個;數值計算第-筆工作的最小時脈4第4= 作的多個參數值計算第二筆卫作的最小時脈頻'率。 ;脈頻率的最大值作為第一筆工作的理以= 之;脈頻率作為第二筆工作的理想頻率。 理相猫ΐ第—筆工作的最大執行時間’調整第二筆工作的 心頻率。接著,將第一筆工作的理想頻 ==至即時系統之處理器的實際二 丈實際頻率執行第—筆工作與第二筆工作。 週期實施财’上述齡數值包括執行時間、 f本發明一實施例中’上述在利用上述實際頻率執行 時糸#工作與第二筆工作的步驟包括下列步驟。當調降即 率時,=處理器的工作電壓與即時系統之處理器的實際頻 時系结先調降即時系統之處理器的實際頻率後,再調降即 工作電ί處理器的工作電壓。當調升即時系統之處理器的 與即時系統之處理器的實際頻率時,先調升即時 c 28437twf.doc/n 201017362 系統之處理ϋ的工作t壓後,再調升㈣系統之處理器的 實際頻率。 本發明k出一種電腦程式產品,可經由電腦載入程式 執行下列步驟:首先,取得多個卫作,其中上述工作各自 對應多個參數值。接著,依據上述參數值,計算上述工作 各自的最小時脈頻率。之後,依據上述工作各自的最小時 脈頻率以及上述工作的優賴順序,計算出上述工作的理 想頻率。接著’依據上述工作的優先權順序先後,判斷優 $順序較先的第-筆工作_想頻率是歓於優先權順 -人之的第二筆工作的理想頻率。之後,當第—筆工作的 2頻率大於第二筆工作_想解時,依據第二筆工作 ,最大執行時間,調整第二筆工作的理想頻率。最後,將 4多個;Μ㈣理想頻率各自對應至即時祕之處理器的 貫際頻率,以利用上述實際頻率執行上述多個工作。 本發明提出—種電腦程式產品,可經由電腦載入程式 =列步驟:首先’依據第—筆工作的多個參數值計算 工作的最小時脈頻率。接著,依據第二筆工作的多 =參數值計算第二筆功的最小時脈頻率。之後,取第_ 2作的最小時脈頻率與第二筆卫作的最小時脈頻率的最 作為第-筆工作的理想頻率。接著,取第二筆工作 :時脈頻率作為第二筆工作的理想頻率。之後,當第一 ^工作的理想頻率大於第二筆工作的理想頻率依據第二 ^工作的最大執行時間,調整第二筆工作的理想頻率。 後’將第—筆工作的理想頻率與第二筆工作的理想頻率對 9 >«2 28437twf.doc/n 201017362 頻率,,上述實際頻率201017362 ; vw ...VJ2 28437twfdoc/n IX. Description of the invention: [Technical field of the invention] The present invention relates to the scheduling of a real-time system, and in particular to the frequency of the work schedule of the instant system Adjustment method and computer program product using this method. [Prior Art] In general, 'central processing unit (Ce_pr嶋_touch, cpu) ^!iL(SChedUling) (Multi-task) ί can be made by the central processing unit in the different work (task) = operating system The output of the computer has increased. That is to say, two other 1VI have "- a wide-ranging implementation, in order to improve the use of the central processor Lr i', in the processor system, - only one job can be executed, and ^ work is executed at the same time, therefore If there is more than one job; afterwards, the CPU must wait for the CPU to process the current job. Before the execution, the CPU is in the interim state. =Disc planning can effectively utilize the central processor. The apricot programming is to control multiple jobs at the same time in the memory: the operating system treats the central processor as one:: Go and the father gives another job. In the above way, every time you have to wait, 'the central processor can be the first limit: the external system (Real_timesystem) has stricter time for the hard real-time system (hard real-time system), ^ 28437twf .doc/n 201017362 All work must be completed within the time limit set, with serious consequences (eg nuclear reactor monitoring of nuclear power plants), in addition, for widespread use in today's life and The battery is power supply. The seven-portable embedded type is purely speaking. (4) It meets the requirements of the deadline, so as to increase the use time of the portable embedded system, so as to avoid serious consequences. Under the best 1 scheduling, 'to reduce the frequency of use of the ten-phase processor and meet the requirements of the system for timing', so that the instant (four) is more energy-efficient, and the real-time system in the calculation of the schedule time will be - [Inventive content] The present invention provides a method for using _ rate and using this green computer program to reduce the processing time of the work schedule and reduce the time in the real-time system. The frequency of the processor is used to achieve power saving. ❹ The present invention proposes a frequency adjustment method suitable for the scheduling of the real-time system. The method of the fresh method includes the following steps. First, multiple jobs are obtained. A plurality of parameter values f, the minimum clock frequency of each of the above operations is calculated. The upper frequency of each of the above-mentioned operations is the same as the ideal frequency of the above work. The order of powers is sequential, the priority is determined first, the rate is the first, the second order of the second work of the priority order is followed, and although the ideal frequency of the first pen work is greater than the ideal frequency of the second pen, according to the second The maximum execution time of the pen work, adjust the ideal frequency of the second work. Then, the ideal frequency of the above multiple works is corresponding to [] Z 28437twf.doc/n 201017362 to the actual frequency of the processor of the instant system, to use ^ The rate performs the above multiple tasks. These actual frequencies In an embodiment of the invention, the parameter values include a period and a time limit. In an embodiment of the present invention, the calculating the working step includes calculating the highest priority work of the frequency of the student according to the priority order of the above work, and the order of each work is after or equal to In the embodiment of the present invention, the minimum of the priority order is the step of comparing the first pen frequency with the ideal frequency of the second pen 1. First of all, when the [pen work __ rate is not at the ideal frequency, the ideal frequency of the first pen work is replaced with the ideal frequency, and the ideal word of the second pen stylus is replaced with the ideal frequency of the second work. The order of the third job is after the second job. Then, 'back to the step of comparing the ideal frequency of the better-sequentially finer pen to the ideal frequency of the second pen 1 with the lower priority order. In the present invention - the embodiment is performed at the actual frequency described above. The steps of the above work include the following steps: when the operating voltage of the processor of the real-time system is adjusted and the actual frequency of the processor (4) is processed, the actual frequency of the processor of the temple system is first adjusted, and then the real-time system is adjusted. The operating voltage of the processor. When the operating voltage of the processor of the real-time system is increased and the actual frequency of the processor of the system is immediately increased, the operating voltage is adjusted first, and then the processing of the real-time system is adjusted. The present invention proposes a frequency adjustment method, no, scheduling, and: two; numerical calculation of the minimum clock of the first pen operation 4 4 = calculation of a plurality of parameter values The minimum clock frequency of the second stroke is 'rate. The maximum value of the pulse frequency is taken as the first work = the pulse frequency is the ideal frequency for the second work. Maximum execution time 'Adjust the heart frequency of the second work. Then, the ideal frequency of the first work == to the actual two-figure actual frequency of the processor of the real-time system to perform the first pen work and the second pen work. The value includes the execution time, f. In the embodiment of the present invention, the steps of the above-mentioned operation and the second pen operation when using the above-mentioned actual frequency include the following steps. When the rate is adjusted, the operating voltage and the immediate state of the processor are The actual frequency of the processor of the system is first adjusted to reduce the actual frequency of the processor of the real-time system, and then the operating voltage of the processor is adjusted. When the processor of the real-time system is processed, the processing of the real-time system is performed. When the actual frequency of the device is raised, the current c 28437twf.doc/n 201017362 system processing t work t pressure, and then increase (four) the actual frequency of the processor of the system. The present invention is a computer program product The computer loading program performs the following steps: First, multiple guards are obtained, wherein the above work corresponds to a plurality of parameter values. Then, according to the above parameter values, the above work is calculated. The respective minimum clock frequencies. Then, according to the respective minimum clock frequency of the above work and the order of the above work, the ideal frequency of the above work is calculated. Then, according to the priority order of the above work, the judgment is better than the order of priority. The first-first work _ the desired frequency is the ideal frequency of the second work that occupies the priority shun-human. After that, when the second frequency of the first pen work is greater than the second work _ wants to solve, according to the second Pen work, maximum execution time, adjust the ideal frequency of the second work. Finally, more than 4; Μ (4) ideal frequencies each correspond to the inter-frequency of the instant secret processor to perform the above multiple tasks using the above-mentioned actual frequency. The invention proposes a computer program product, which can be loaded via a computer = column step: firstly, the minimum clock frequency of the work is calculated according to the plurality of parameter values of the first pen work. Then, the minimum clock frequency of the second pen work is calculated according to the multi-parameter value of the second pen work. Thereafter, the minimum clock frequency of the second clock and the minimum clock frequency of the second stroke are taken as the ideal frequency for the first pen operation. Next, take the second job: the clock frequency as the ideal frequency for the second job. Thereafter, when the ideal frequency of the first ^ work is greater than the ideal frequency of the second work, the ideal frequency of the second work is adjusted according to the maximum execution time of the second work. After the 'the ideal frequency of the first pen work and the ideal frequency of the second pen work 9 > «2 28437twf.doc / n 201017362 frequency, the above actual frequency
❷ 據上= 最:時脈頻率。之後’依 序,計算出上述4=,及上述工作的優先權順 整其他工作的理想率理:^率。讀’觸是否需要調 應至即時♦絲夕=頻ΐ。攻後,將上述工作的理想頻率對 i行上述二-理1"的實際頻率,以利用這些實際頻率 頻ί,LL。,,’可以有效地降低即時系統的處理器 行^工#能的作用。另外,本發明在最後只需進 可二==系統之處理器的實際頻率,故 細理想頻率便將其對應至及實際 :於箆-鲞°你實際頻率時’會減少發現第一筆工作頻率 =;口頻率的機會,還可以有效地減少工作 為讓本發明之上述特徵和優點能更明顯易懂,下文特 舉實施例,並配合所關式,料細說明如下。 【實施方式】 圖1繪不_為本發明一實施例之頻率調整方法的流程 圖。圖缚示為—種在各工作的鮮未機之前的工作 排程示似圖。® 2Β繪示為本發明一實施例之在各工作的 頻率調整之制各;η作排程的示意圖。本實關之頻率調 签方法適用於即時系統之工作排程,例如可關整如圖2Α 所示的工作排程。請參照圖1、圖2Α與圖2Β,首先,在 步驟sioi’取得多個工作(Task),其中每一個工作各自 201017362w2 28437twf.dcc/n 對應多個參數值。為了方便說明,在本實施例中,以取得 3個工作作為說明’且這3個工作分別以τ!、丁2、丁3表示 之。另外’上述參數值可以包括執行時間(Pr〇cess〇r cycle)、週期(peri〇d)以及時限(Deadline),分別以 Cj、Pi、A表示之,其中i為大於等於1的正整數。 在本實施例中,假設是以3個工作來做說明,且分別 以T!、Τ'2、丁3表示之。其中,工作T!對應的參數值q、 Pi、h為{5*f_ 1〇, 10} ·,工作τ2對應的參數值c2、p2、 D2為{2*fmax,15, 15};工作τ3對應的參數值q^ 為{l*fmax,30, 30}。另外,上述fmax為頻率最大值(亦即該3 工作利用處理器的最大使用頻率),而上述對應參數= 項的表示式Ci*fmax係指以fmax為頻率所需的執行時間為 Ci,並非指Ci乘以fmax。 在步驟S103中,依據參數值,計算上述工作各自的 最小時脈頻率εί,例如為最小能量時脈頻率 (Energy-Minimizing Clock Frequency )。在本實施例中, 上述工作各自的最小時脈頻率是取圖2A之中每一工作的 時限結束之前,每一次閒置(Idle)的末端時間與工作的 總執仃_比的最小健為每—卫作的最小時脈頻率。舉 例來說’工作Tl的時限為1G,而在此段時間内閒置 ,時f日!為1G’並且讀Τι所執行的時間為5,因此, 二的取小時脈頻率ει=πώι{5/10}=0 5 ;工作I的時 ,而在此段時間内閒置的末端時間為1〇, 執行的時間總共為7 (工作Tl+工作Τ2),因此,作工作^ 11 u2 28437twf.doc/n 201017362 的最小時脈頻率s2=min{7/l〇卜〇 7 ;工 T 而在此段時間内閒置的末端時間分別為ι〇3、的時限為3〇, 且工作A所執行的時間總共分別為 20以及3〇, 工作τ3)、15 (工作Tl*2+工作V2+工 沙工作τ2+ 作1^工作仍+工作τ3),因此,工作3Τ) = 20(工 頻率 ε3=ιηίη{8/1〇, iwo, 20/3〇卜〇 67。 3 的最小時脈 接著,在步驟S105中,依據上述工 =以及上述工作的優先權順序,計算出上 心頻率%。在本實施射,依據I作的優先 仿 由優先權順序最料仏作進行計算,且每—的= 頻率是取懿權猶餘或科其縣 = 小時脈頻率的最大值。 脚〈工作的戒 舉例來說,上述工作的優先權順序依序為工作、工 ί γ H進行計算工作Τι的理想頻率。 2鼻工作Tl的理想頻率νι時,則是取優先權順序後於 或專於工作T!的最小時脈頻率的最大值也就是 νι=πι&χ{ει,ε2, S3}=max{0.5, 〇 7, 〇 67卜〇 7 ;當計算工作 τ2 的理想頻率ν2時’則是取優先權順序後於或等於工作I 的最小時脈辭的最域,也就是V2=max{£2, s3}=max{〇 7, 0·67}=0.7 ;當計算工作A的理想頻率V3時,則是取優先 權順序後於或等於工作I #最小時脈頻率的最大值,也就 是 v3=max{s3}=max{〇 67}=〇.67。 之後’進入步驟S107,亦即依據上述工作的優先權順 序先後,比較優先權順序較先的第一筆工作的理想頻率是 12 28437twf.doc/n 201017362❷ According to the upper = most: clock frequency. After that, the above 4 = is calculated in order, and the priority of the above work is the ideal rate of other work: ^ rate. Whether the reading touch needs to be adjusted to the instant ♦ 夕 夕 = frequency. After the attack, the ideal frequency of the above work is plotted against the actual frequency of the above two-dimensional 1" to utilize these actual frequency frequencies, LL. ,, ' can effectively reduce the role of the processor of the real-time system. In addition, the present invention only needs to enter the actual frequency of the processor of the system=2, so the fine ideal frequency will correspond to the actual: when 箆-鲞° your actual frequency, the first work will be reduced. The frequency = the opportunity of the mouth frequency can also effectively reduce the work so that the above features and advantages of the present invention can be more clearly understood. The following specific embodiments, together with the closed type, are described below. [Embodiment] FIG. 1 is a flow chart showing a frequency adjustment method according to an embodiment of the present invention. The diagram is shown as a kind of work schedule diagram before the fresh machine of each job. ® 2 Β is a schematic diagram of the frequency adjustment of each work according to an embodiment of the present invention; η is a schematic diagram of scheduling. The actual frequency adjustment method is applicable to the work schedule of the real-time system. For example, the work schedule shown in Figure 2Α can be closed. Referring to Fig. 1, Fig. 2, and Fig. 2, first, a plurality of tasks (Task) are obtained in step sioi', wherein each of the jobs 201017362w2 28437twf.dcc/n corresponds to a plurality of parameter values. For convenience of explanation, in the present embodiment, three operations are taken as explanations' and these three operations are represented by τ!, D2, and D3, respectively. Further, the above parameter values may include an execution time (Pr〇cess〇r cycle), a period (peri〇d), and a time limit (Deadline), which are represented by Cj, Pi, and A, respectively, where i is a positive integer greater than or equal to 1. In the present embodiment, it is assumed that three jobs are used for explanation, and they are represented by T!, Τ'2, and D3, respectively. The parameter values q, Pi, and h corresponding to the work T! are {5*f_ 1〇, 10} ·, and the parameter values c2, p2, and D2 corresponding to the work τ2 are {2*fmax, 15, 15}; The corresponding parameter value q^ is {l*fmax, 30, 30}. In addition, the above fmax is the maximum frequency (that is, the maximum operating frequency of the processor), and the expression Ci*fmax of the corresponding parameter=term means that the execution time required for fmax is the frequency, which is not Refers to Ci multiplied by fmax. In step S103, the respective hourly pulse frequency εί of the above operation is calculated according to the parameter value, for example, the energy-Minimizing Clock Frequency. In this embodiment, the minimum clock frequency of each of the above operations is before the end of the time limit of each operation in FIG. 2A, and the minimum time of each end time of the idle (Idle) and the total duty ratio of the work is - The minimum clock frequency of the guard. For example, 'the working time Tl is 1G, and during this time, it is idle, when f is! 1G' and the time for reading Τι is 5, therefore, the hour frequency of the second is ει=πώι{5/ 10}=0 5 ; When working I, the end time of idle time is 1〇, and the total time of execution is 7 (working Tl+workΤ2), therefore, work ^ 11 u2 28437twf.doc/n The minimum clock frequency of 201017362 is s2=min{7/l〇〇7; the end time of the idle time during this period is ι〇3, the time limit is 3〇, and the total time of work A is executed. 20 and 3, respectively, work τ3), 15 (working Tl*2+ working V2+ work sand work τ2+ for 1^ work still + work τ3), therefore, work 3Τ) = 20 (work frequency ε3=ιηίη{8/ 1〇, iwo, 20/3〇 〇 67. The minimum clock of 3, then, in step S105, the upper center frequency % is calculated according to the above-mentioned work = and the priority order of the above work. The priority of I is calculated by the order of priority, and the frequency of each is the highest of the right or the county of the county. For example, the priority order of the above work is the ideal frequency for the work, the work ί γ H, and the ideal frequency of the calculation work 2 2 2 When the ideal frequency of the nose work T1 is νι, the priority order is taken. The maximum value of the minimum clock frequency after or exclusively for the work T! is also νι=πι&χ{ει,ε2, S3}=max{0.5, 〇7, 〇67 〇7; when calculating the ideal of working τ2 When the frequency ν2 is 'the most field of the minimum clock word after the priority order is equal to or equal to the work I, that is, V2=max{£2, s3}=max{〇7, 0·67}=0.7; When calculating the ideal frequency V3 of the working A, it is the maximum value of the minimum clock frequency after the priority sequence is equal to or equal to the working I #, that is, v3=max{s3}=max{〇67}=〇.67. 'Go to step S107, that is, according to the priority order of the above work, the ideal frequency of the first work comparing the priority order is 12 28437twf.doc/n 201017362
否大於優先權順序次之的第二筆工作的理想頻率。舉例來 說’將工作乃設為第一筆工作,而將工作τ2設為第二筆 工作。接著’比較第一筆工作的理想頻率(工作Τ〗的理想 頻率Vl)與第二筆工作理想頻率(工作Τ2的理想頻率ν2)。 由於工作Τ!的理想頻率Vl與工作丁2的理想頻率V2都為 0.7,亦即第一筆工作的理想頻率等於第二筆工作的理想頻 率,則進行步驟S109,將第一筆工作的理想頻率置換為第 二筆工作的理想頻率,並將第二筆工作的理想頻率置換為 第三筆工作的理想頻率’其中第三筆工作的優先權順序在 第二筆工作之後。亦即,將第一筆工作的理想頻率置換為 工作I的理想頻率V2,而將第二筆工作的理想頻率置換為 工作Τ3的理想頻率ν3。 接著,再回到步驟S107,判斷第一筆工作的理想頻率 是否大於第二筆工作的理想頻率,也就是判斷工作τ 2的理 想頻率V2是否大於工作丁3的理想頻率A。由於Τ2的理想 頻率Μ為0.7,而工作Τ;的理想頻率乃為〇 67,因此,^ 比較工作Τ2的理想頻率乃工作A的理想頻率%之後,發 現第一筆工作的理想頻率大於第二筆工作的理想頻率,亦 即工作h的理想頻率%大於工作A的理想頻^乃 進 入步騍S111,依據第二筆工作的最大執行時間,調整 筆工作的理想頻率。 一 (優 輋例术說’在工作“興丨2的理想頻率、與乃都β 的情況η Τ3的最大執行時間為卫作了3鱗^ ^ :先權先於工作τ3之工作的總執行時間除以優先權先 13 201017362w228437twf.doc/n 於工作ts之工作的理想頻率),亦即3〇_ (5*3+2 /〇.7=2.857。接著’求出工作L以最大頻率執行所需時 與經調整頻率後最大執行時間的比值,亦即1/2857=〇35曰, 此數值0.35即為工作A調整後的理想頻率%,。 之後’當調整完第二筆工作的理想頻率,亦即工作丁 的理想頻率後,進人步驟Sll3,也就是判斷所有工作的理3 想頻率是否已味完畢。在本實闕巾,由於卫作^已是No more than the ideal frequency of the second job with the second priority order. For example, the job is set to the first job, and the work τ2 is set to the second job. Then 'Compare the ideal frequency of the first work (the ideal frequency Vl of the work Τ) with the ideal frequency of the second work (the ideal frequency ν2 of the work Τ 2). Since the ideal frequency V1 of the working Τ! and the ideal frequency V2 of the working dicing 2 are both 0.7, that is, the ideal frequency of the first working is equal to the ideal frequency of the second working, proceeding to step S109, the ideal of the first working is performed. The frequency is replaced by the ideal frequency of the second work, and the ideal frequency of the second work is replaced by the ideal frequency of the third work', wherein the priority order of the third work is after the second work. That is, the ideal frequency of the first job is replaced by the ideal frequency V2 of the operation I, and the ideal frequency of the second operation is replaced by the ideal frequency ν3 of the operation Τ3. Next, returning to step S107, it is judged whether or not the ideal frequency of the first pen operation is greater than the ideal frequency of the second pen operation, that is, whether the ideal frequency V2 of the work τ 2 is greater than the ideal frequency A of the work D3. Since the ideal frequency Τ2 is 0.7, and the ideal frequency is 〇67, therefore, the ideal frequency of the comparison work Τ2 is the ideal frequency of the working A, and the ideal frequency of the first work is found to be greater than the second. The ideal frequency of the pen work, that is, the ideal frequency % of the work h is greater than the ideal frequency of the work A, and the process proceeds to step S111, and the ideal frequency of the pen work is adjusted according to the maximum execution time of the second work. One (excellent example says 'the ideal frequency of Xingyu 2 at work', and the maximum execution time of η Τ3 with Nadu β is 3 scales for Wei 3 ^ ^ : The total execution of the work before the work τ3 The time divided by the priority 13 201017362w228437twf.doc/n is the ideal frequency for the work of working ts), that is, 3〇_ (5*3+2 /〇.7=2.857. Then 'find the work L at the maximum frequency The ratio of the required execution time to the maximum execution time after the adjusted frequency, that is, 1/2857=〇35曰, this value is 0.35, which is the ideal frequency % after the adjustment of the work A. After that, 'the ideal for adjusting the second work After the frequency, that is, the ideal frequency of the work, enter step Sll3, that is, judge whether the frequency of all the work has been tasted. In this real scarf, because the Weizu ^ is already
最後-筆:L作,因此在步驟SU3中,會判斷出所有工作 已經比較完畢。 最後’在步驟S115,將Τι、Τ2以及Τ3的理想頻率各 自對應至即時系統之處理器的實際頻率,以利用上述實際 頻率執行以及A。在本實施例中,即時系統之處理 器的實際頻率例如是由時脈控制暫存器CLKC〇N所控 制’並且此時脈控制暫存器中之位元(bit) 〇至位元15, 即CLKCON[15:0],關係著時脈分割值。因此,即時系統 之處理器的實際頻率為原處理器之實際頻率的1 / (CLKC0N+1) ’故即時系統之處理器的實際頻率可能為處 理器之最大使用頻率的1 / (〇+1)、1 / (2〇+1)、1 / (2丨+1)、1 /(22+1)、…、1 / (215+ι) 〇 因此,將上述所計算出來之工作Τι、丁2以及τ3的理 想頻率Vl、V2以及%’對應至即時系統之處理器的實際頻 率。舉例來說’工作Tl的理想頻率Vi=〇 7是介於即時系 統之處理器的實際頻率1 /(〇+1)至1 /(2〇+1)之間,故工作 τι對應至即時系統之處理器的實際頻率則為1/(〇+1)=1, 14 J2 28437twf.doc/n 201017362 也就是將理想鮮制至大於或等於此理 率中的最小者;X作T2的理想頻率^^^^實際頻 統之處理器的實際頻率1/(0+1)至1/(2、疋;丨於即時系 τ2對應至即時系統之處理器的實際頻率工作 工作I的理想頻率心’=0.35是介於即 絲 卜1 ; 際頻率1 /(2°+1)至1 /(2%之間,故工^ =器的實 系統之處理器的實際頻率則為1/(2〇 3 -應至即時Finally - pen: L, so in step SU3, it will be judged that all work has been compared. Finally, in step S115, the ideal frequencies of Τι, Τ2, and Τ3 are each corresponding to the actual frequency of the processor of the instant system to perform and A using the actual frequency described above. In this embodiment, the actual frequency of the processor of the real-time system is controlled, for example, by the clock control register CLKC〇N, and the bit in the pulse control register is transferred to the bit 15, That is, CLKCON[15:0] is related to the clock split value. Therefore, the actual frequency of the processor of the real-time system is 1 / (CLKC0N+1) of the actual frequency of the original processor. Therefore, the actual frequency of the processor of the real-time system may be 1 / (〇+1) of the maximum operating frequency of the processor. ), 1 / (2〇+1), 1 / (2丨+1), 1 /(22+1),..., 1 / (215+ι) 〇 Therefore, the above calculated work is Τι, 丁2 and the ideal frequencies V1, V2 and %' of τ3 correspond to the actual frequency of the processor of the instant system. For example, the ideal frequency of work Tl Vi=〇7 is between the actual frequency of the processor of the instant system 1 / (〇 +1) to 1 / (2 〇 +1), so the work τι corresponds to the real-time system The actual frequency of the processor is 1/(〇+1)=1, 14 J2 28437twf.doc/n 201017362 is the smallest of the ideal fresh to greater than or equal to this rate; X is the ideal frequency of T2 ^^^^ The actual frequency of the processor of the actual frequency system is 1/(0+1) to 1/(2, 疋; 丨; the ideal frequency heart of the working frequency I corresponding to the actual frequency of the processor of the instant system τ2 '=0.35 is the difference between the frequency 1 / (2 ° +1) to 1 / (2%, so the actual frequency of the processor of the real system is 1 / (2) 〇3 - should be instant
實際頻率1小0.5分別執行卫作Ti A 後便利用 圖3八緣示為-種在各工作的頻率未謂整 對應至實際頻率的示意圖。冑3B緣示為本發明= 之在各工作的頻率調整之後的各工作對應至實 意圖。由圖3A與3B的比較後,可以看出本實:例在:: T!、T2以及τ3分賴應至實際醉後,卫作 理器原實際頻率的-半即可運作。如此—來,本實施例可 以在符合每—工作的條件下,降低即時系統之處理器的實 際頻率,進而達到節能的作用。 承接上述步驟S113,若是工作丁3並不為最後一筆工 作時,則會在步驟S113中判斷所有工作的理想頻率並未 比較完畢。接著,進入步驟S109中,也就是進行比較優 先權順序再次之的工作的理想頻率,例如工作丁3與T4的 理想頻率、工作Τ4與Τ5的理想頻率··.等,直到所有工作 的理想頻率都比較完畢,進入到步驟SU5後則結束此頻 率調整方法的流程。而再回到步驟sl〇9以及之後的運作 方式,則可以參照鈿述之說明,故在此不再贅述。 15 28437twf.doc/n 201017362 另外,上述實施例只需要在最後做一次各工作的理想 頻率對應至即時系統之處理器的實際頻率,故可以避免一 旦算出各工作的理想頻率便將其對應至及實際系統之處理 ㈣實際頻率時,會減少發現第—筆工作頻率大於第二筆 =頻率的機會,並且還可以有效地減少工作排程時 鼻時間。 ❹ 此外’若硬體可以支援調整即時系統之處理器的工作 ^壓^’可以在調變即時系統之處理器的實際頻率的同 率與理器的工作電壓,並且實際頻 Ζ,㈣調變方式為:⑴調降實際頻率與工作電 % ’先調降實際頻率後,再娜1 ,率與工作電壓時’先調升工作電壓後,再 的頻一種電腦程式產品,其係用以執行上述 1頻率調整方法,此電腦程式產品基本上是由多數個 斤ί成的,並且這些程式碼片段在载入電腦中並執 後,Ρ可完成上述頻率調整方法的步驟。 綜上所述,本發明藉由所取得 工作各自的最小時脈頻率。之後ϋ十f上述 作的優先權順序,計算出上述工作 率。i後,將上^工需要調整上述工作的理想頻 裔的實際頻率,以利用這些 ^糸統之處理 可以有效地降低即睥* 、耗仃上述工作。藉此’ 降低即H统的處理ϋ辭,進而達到節能的 2 01017362„2 湖7twf d()e/n 作用。另外,本發明在最後只需進行一次工作頻率對應至 即時系統之處理器的實際頻率,故可以避免—旦算出各工 作的理想頻率便將其對應至及實際系統之處理器的實際^ 率時,會減少發現第一筆工作頻率大於第二筆工作頻^的 機會,並且還可以有效地減少工作排程的運算時間。 雖然本發明已以實施例揭露如上,然其並非用以限定 本發明,任何所屬技術領域中具有通常知識者,在不脫二 本發明之精神和範圍内,當可作些許之更動與潤飾,因此 本發明之保護範圍當視後附之申請專利範圍所界定者為 準。 、 【圖式簡單說明】 圖1繪示為本發明一實施例之頻率調整方法的流 圖。 圖2Α繪示為一種在各工作的頻率未調整之前的工 排程不意圖。 圍 0Ό 认 _ . 一-The actual frequency is less than 0.5 and the convenience of the maintenance of Ti A is shown in Fig. 3. The eight edges are shown as a schematic diagram of the frequency at each work not corresponding to the actual frequency.胄3B is shown as the invention = the work after the frequency adjustment of each work corresponds to the actual intention. From the comparison of Figures 3A and 3B, it can be seen that the actual: in the following:: T!, T2 and τ3 depends on the actual drunk, the actual frequency of the original processor - half can be operated. In this way, the present embodiment can reduce the actual frequency of the processor of the real-time system under the condition of per-work, thereby achieving the effect of energy saving. In the above step S113, if the work 3 is not the last work, it is judged in step S113 that the ideal frequency of all the work is not compared. Next, proceeding to step S109, that is, performing an ideal frequency for comparing the work of the priority order again, for example, the ideal frequency of the work 3 and T4, the ideal frequency of the work Τ 4 and Τ 5, etc. until the ideal frequency of all the work After the comparison is completed, the process of the frequency adjustment method is terminated after proceeding to step SU5. Returning to the operation of the steps sl9 and later, the description of the description can be referred to, and therefore will not be described again. 15 28437twf.doc/n 201017362 In addition, the above embodiment only needs to perform the actual frequency of each work at the end to correspond to the actual frequency of the processor of the real-time system, so it can be avoided to match the ideal frequency of each work to the The actual system processing (4) the actual frequency will reduce the chance that the first pen working frequency is greater than the second pen = frequency, and can also effectively reduce the nose time during the work scheduling. ❹ In addition, 'If the hardware can support the operation of the processor of the real-time system ^^^ can adjust the actual frequency of the processor of the real-time system and the working voltage of the processor, and the actual frequency, (4) modulation mode To: (1) reduce the actual frequency and the working power % 'first adjust the actual frequency, then the first, the rate and the working voltage, 'first increase the working voltage, then the frequency is a computer program product, which is used to perform the above 1 frequency adjustment method, this computer program product is basically made up of a lot of money, and these code fragments are loaded into the computer and executed, then the steps of the above frequency adjustment method can be completed. In summary, the present invention achieves the respective minimum clock frequency of the operation. Then, in the order of priority described above, the above operation rate is calculated. After i, the actual frequency of the ideal frequency of the above work needs to be adjusted, so that the processing can be effectively reduced by using the processing of these systems. In this way, the process of reducing the processing of the H system can be achieved, and then the energy saving 2 01017362 „ 2 lake 7twf d() e/n function can be achieved. In addition, the present invention only needs to perform the working frequency corresponding to the processor of the instant system at the end. The actual frequency, so it can be avoided - once the ideal frequency of each job is calculated and the actual rate of the processor of the actual system is calculated, the chance of finding that the first working frequency is greater than the second working frequency is reduced, and The operation time of the work schedule can also be effectively reduced. Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention, and any person having ordinary skill in the art can not deviate from the spirit of the present invention. In the scope of the invention, the scope of the invention is defined by the scope of the appended claims. FIG. 1 illustrates an embodiment of the invention. Flow diagram of the frequency adjustment method. Figure 2Α is a schematic diagram of the work schedule before the frequency of each work is not adjusted.
sl〇i〜S115 :本發明—實補之鱗輕方法的各步 【主要元件符號說明】 、τ2、τ3:工作 17Sl〇i~S115: Each step of the method of the present invention - the scale of the light compensation method [Description of main component symbols], τ2, τ3: work 17