[go: up one dir, main page]

TW201419161A - Load prediction method and electronic apparatus - Google Patents

Load prediction method and electronic apparatus Download PDF

Info

Publication number
TW201419161A
TW201419161A TW101142674A TW101142674A TW201419161A TW 201419161 A TW201419161 A TW 201419161A TW 101142674 A TW101142674 A TW 101142674A TW 101142674 A TW101142674 A TW 101142674A TW 201419161 A TW201419161 A TW 201419161A
Authority
TW
Taiwan
Prior art keywords
time
module
predicted
time point
prediction
Prior art date
Application number
TW101142674A
Other languages
Chinese (zh)
Other versions
TWI492158B (en
Inventor
Bo-Wei Huang
Kun-Wei Wang
Wen-Chih Peng
Chung-Chih Li
Te-Yen Liu
Original Assignee
Inventec Corp
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 Inventec Corp filed Critical Inventec Corp
Priority to TW101142674A priority Critical patent/TWI492158B/en
Publication of TW201419161A publication Critical patent/TW201419161A/en
Application granted granted Critical
Publication of TWI492158B publication Critical patent/TWI492158B/en

Links

Landscapes

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

Abstract

一種負載預測方法與電子裝置。在負載預測方法中,分別在多個時間週期記錄電子裝置的多個資源負載記錄。在接收預測時間點時,計算預測時間點與目前時間點之間的時間差,其中預測時間點於時間軸上大於目前時間點。並且,判斷時間差是否小於門檻值。倘若時間差小於門檻值,依據資源負載記錄執行回歸分析預測程序。倘若時間差未小於門檻值,依據資源負載記錄執行群組分析預測程序。A load prediction method and an electronic device. In the load prediction method, a plurality of resource load records of an electronic device are recorded in a plurality of time periods, respectively. When the predicted time point is received, the time difference between the predicted time point and the current time point is calculated, wherein the predicted time point is greater than the current time point on the time axis. And, it is judged whether the time difference is smaller than the threshold value. If the time difference is less than the threshold, the regression analysis prediction procedure is performed based on the resource load record. If the time difference is not less than the threshold, the group analysis prediction process is performed according to the resource load record.

Description

負載預測方法與電子裝置 Load prediction method and electronic device

本發明是有關於一種資源管理技術,且特別是有關於一種負載預測方法與電子裝置。 The present invention relates to a resource management technique, and in particular to a load prediction method and an electronic device.

隨著計算機運算能力的進步,生活中無時無刻都在累積大量資訊,例如使用者消費行為資訊、路況資訊、感測資料等。面對如此大量的資料,運用雲端運算的能力來分析大量資料扮演著愈來愈重要的角色。許多提供運算能力的雲端服務提供者因應而生,例如著名的雲端服務提供者Amazon Elastic Compute Cloud(Amazon EC2)。Amazon EC2是一種網路服務,其主要功能是在雲端運算平台上提供各種規模的計算能力,提供開發人員一個便利的運算環境來執行大規模的運算。 With the advancement of computer computing power, a lot of information is accumulated in life, such as user consumption behavior information, road condition information, and sensing data. Faced with such a large amount of data, the ability to use cloud computing to analyze large amounts of data plays an increasingly important role. Many cloud service providers that provide computing power have emerged, such as the well-known cloud service provider Amazon Elastic Compute Cloud (Amazon EC2). Amazon EC2 is a web service whose main function is to provide computing power of various sizes on the cloud computing platform, providing developers with a convenient computing environment to perform large-scale computing.

然而,上述雲端運算平台的系統資源配置方式,實際上並不能完全符合使用者的需求,例如系統資源無法被充分運用等。因此為了提升使用者的滿意度以及雲端運算平台的整體運算效能,通常會在雲端運算平台中,建構動態資源管理機制,以有效地調配資源給所有使用者。 However, the system resource allocation method of the above cloud computing platform cannot actually meet the requirements of the user completely, for example, the system resources cannot be fully utilized. Therefore, in order to improve user satisfaction and the overall computing performance of the cloud computing platform, a dynamic resource management mechanism is usually constructed in the cloud computing platform to effectively allocate resources to all users.

目前的資源管理機制例如是透過負載預測(Load prediction)的方式來達成,其中常見的負載預測方法例如是回歸分析方法與類神經網路方法。回歸分析方法是根據歷史資料來找出最接近資料的多項式,但由於一般回歸分 析方法會使用多維資料來進行分析,且需要紀錄各種資料來增加準確度,因此需要耗費電腦系統較大的儲存空間與系統資源。此外,類神經網路(Artificial Neural Network,ANN)則會不斷修正預測模型,且必須根據已修正的預測模型來預測下一時間點上負載的預測值,因此亦不適合拿來進行長時間後的負載預測。 The current resource management mechanism is achieved, for example, by means of load prediction. Common load prediction methods are, for example, a regression analysis method and a neural network-like method. The regression analysis method is based on historical data to find the polynomial closest to the data, but due to the general regression score The analysis method uses multi-dimensional data for analysis, and needs to record various data to increase the accuracy, so it requires a large storage space and system resources of the computer system. In addition, the Artificial Neural Network (ANN) will continuously correct the prediction model, and must predict the predicted value of the load at the next time point based on the corrected prediction model, so it is not suitable for long-term use. Load forecasting.

承上述,如何有效地調配系統中的資源配置,儼然已成為製造者亟欲解決的問題之一。 In view of the above, how to effectively allocate the resource allocation in the system has become one of the problems that manufacturers are eager to solve.

本發明提供一種負載預測方法與電子裝置,其可有效地預測電子裝置的資源負載記錄,而提升電子裝置的工作效能。 The present invention provides a load prediction method and an electronic device, which can effectively predict a resource load record of an electronic device and improve the working performance of the electronic device.

本發明提出一種負載預測方法,適用於電子裝置。在負載預測方法中,分別在多個時間週期記錄電子裝置的多個資源負載記錄。接收預測時間點。計算預測時間點與目前時間點之間的時間差,其中預測時間點於時間軸上大於目前時間點。判斷時間差是否小於門檻值。倘若時間差小於門檻值,依據資源負載記錄執行回歸分析預測(Regression-based prediction)程序。倘若時間差未小於門檻值,依據資源負載記錄執行群組分析預測(Clustering-based prediction)程序。 The invention provides a load prediction method suitable for an electronic device. In the load prediction method, a plurality of resource load records of an electronic device are recorded in a plurality of time periods, respectively. Receive the predicted time point. A time difference between the predicted time point and the current time point is calculated, wherein the predicted time point is greater than the current time point on the time axis. Determine if the time difference is less than the threshold. If the time difference is less than the threshold, a regression-based prediction procedure is performed according to the resource load record. If the time difference is not less than the threshold value, a clustering-based prediction procedure is performed according to the resource load record.

在本發明之一實施例中,上述在依據所述資源負載記錄執行回歸分析預測程序的步驟中,包括針對所記錄的所 述資源負載記錄執行回歸分析演算法,以獲得預測模型,並且在預測模型中取出預測時間點所對應的預測值。 In an embodiment of the present invention, the step of performing a regression analysis prediction procedure according to the resource load record includes, for the recorded location The resource load record performs a regression analysis algorithm to obtain a prediction model, and the predicted value corresponding to the predicted time point is taken out in the prediction model.

在本發明之一實施例中,上述在依據資源負載記錄執行群組分析預測程序的步驟中,包括將每一所述時間週期劃分為多個時間區段,使得每一所述資源負載記錄劃分成多個資料片段。在所述時間區段中選擇預測時間點對應的其中一預測時間區段。對預測時間區段在所述時間週期內的所述資料片段進行群集分析,以將所述資料片段分群成多個群集。自所述群集中,選取筆數最多的其中之一群集。計算被選擇的群集所包括的資料片段的平均值,以作為預測時間點的預測值。 In an embodiment of the present invention, the step of performing a group analysis prediction program according to the resource load record includes dividing each of the time periods into a plurality of time segments, so that each of the resource load records is divided. Multiple pieces of data. One of the predicted time segments corresponding to the predicted time point is selected in the time segment. The data segments of the predicted time segment during the time period are clustered to group the data segments into a plurality of clusters. From the cluster, select one of the clusters with the largest number of pens. The average of the data segments included in the selected cluster is calculated as a predicted value for the predicted time point.

在本發明之一實施例中,上述在對每一所述時間區段在所述時間週期內的所述資料片段進行群集分析的步驟中,包括計算每一所述時間區段內的各資料片段之間的一相似度,並依據相似度進行群集分析。 In an embodiment of the present invention, the step of performing cluster analysis on the data segments in the time period for each of the time segments includes calculating each data in each of the time segments A similarity between the segments and cluster analysis based on similarity.

在本發明之一實施例中,上述在分別在所述時間週期記錄電子裝置的所述資源負載記錄的步驟中,包括在每一所述時間週期中,依據一取樣速率取得資源使用量。因此,每一筆資源負載記錄包括多個資源使用量。 In an embodiment of the present invention, the step of recording the resource load record of the electronic device in the time period, respectively, includes obtaining a resource usage amount according to a sampling rate in each of the time periods. Therefore, each resource load record includes multiple resource usage.

本發明提出一種電子裝置,其包括記錄模組、接收模組、時間計算模組、判斷模組、回歸分析模組以及群組分析模組。記錄模組分別在多個時間週期記錄電子裝置的多個資源負載記錄。接收模組接收預測時間點。時間計算模組用以計算預測時間點與目前時間點之間的時間差,其中 預測時間點於時間軸上大於目前時間點。判斷模組用以判斷時間差是否小於門檻值。回歸分析模組用以依據資源負載記錄執行回歸分析預測程序。群組分析模組用以依據資源負載記錄執行群組分析預測程序。其中,倘若判定時間差小於門檻值,判斷模組通知回歸分析模組執行回歸分析預測程序;倘若判定時間差未小於門檻值,判斷模組通知群組分析模組執行群組分析預測程序。 The invention provides an electronic device, which comprises a recording module, a receiving module, a time calculating module, a determining module, a regression analysis module and a group analysis module. The recording module records a plurality of resource load records of the electronic device in a plurality of time periods. The receiving module receives the predicted time point. The time calculation module is used to calculate the time difference between the predicted time point and the current time point, wherein The predicted time point is greater than the current time point on the time axis. The determining module is configured to determine whether the time difference is less than a threshold value. The regression analysis module is configured to perform a regression analysis prediction process based on the resource load record. The group analysis module is configured to perform a group analysis prediction process according to the resource load record. Wherein, if the determination time difference is less than the threshold value, the determining module notifies the regression analysis module to execute the regression analysis prediction program; if the determination time difference is not less than the threshold value, the determination module notifies the group analysis module to execute the group analysis prediction program.

在本發明之一實施例中,上述之回歸分析模組針對所記錄的所述資源負載記錄執行回歸分析演算法,以獲得預測模型,藉以在預測模型中取出預測時間點所對應的預測值。 In an embodiment of the present invention, the regression analysis module performs a regression analysis algorithm on the recorded resource load record to obtain a prediction model, so as to extract a prediction value corresponding to the prediction time point in the prediction model.

在本發明之一實施例中,上述之群組分析模組更包括劃分模組、預測模組、分群模組、選擇模組以及預測計算模組。劃分模組將每一所述時間週期劃分為多個時間區段,使得每一所述資源負載記錄劃分成多個資料片段。預測模組在所述時間區段中選擇預測時間點對應的其中一預測時間區段。分群模組耦接於劃分模組對預測時間區段在所述時間週期內的所述資料片段進行一群集分析,以將所述資料片段分群成多個群集。選擇模組自所述群集中,選取筆數最多的其中之一群集。預測計算模組計算被選擇的群集所包括的資料片段的平均值,以作為預測時間點的預測值。 In an embodiment of the present invention, the group analysis module further includes a division module, a prediction module, a grouping module, a selection module, and a prediction calculation module. The partitioning module divides each of the time periods into a plurality of time segments such that each of the resource load records is divided into a plurality of data segments. The prediction module selects one of the predicted time segments corresponding to the predicted time point in the time segment. The clustering module is coupled to the partitioning module to perform a cluster analysis on the data segments of the predicted time segment in the time period to group the data segments into a plurality of clusters. Select the module from the cluster and select one of the clusters with the largest number of segments. The predictive computing module calculates an average of the pieces of data included in the selected cluster as a predicted value for the predicted time point.

在本發明之一實施例中,上述之分群模組計算每一所述時間區段內的各資料片段之間的相似度,並依據相似度 進行群集分析。 In an embodiment of the present invention, the grouping module calculates the similarity between each piece of data in each of the time segments, and according to the similarity Perform a cluster analysis.

在本發明之一實施例中,上述之記錄模組在每一所述時間週期中,依據一取樣速率取得一資源使用量。 In an embodiment of the invention, the recording module obtains a resource usage amount according to a sampling rate in each of the time periods.

基於上述,本發明提出一種混合式的預測方法,結合回歸分析預測以及群組分析預測,讓兩種方法互相補足彼此的不足之處。在短時間的預測使用回歸分析預測,而在長時間的預測則使用群組分析預測,藉以提升預測精準度。 Based on the above, the present invention proposes a hybrid prediction method, combined with regression analysis prediction and group analysis prediction, so that the two methods complement each other's deficiencies. Regression analysis is used for short-term predictions, and group analysis predictions are used for long-term predictions to improve prediction accuracy.

為讓本發明之上述特徵和優點能更明顯易懂,下文特舉實施例,並配合所附圖式作詳細說明如下。 The above described features and advantages of the present invention will be more apparent from the following description.

本發明提供一種負載預測方法與電子裝置,其會依據預測時間點與目前時間點之間的時間差,來執行不同的預測程序,藉以有效地預測電子裝置在預測時間點時的資源負載記錄。為了使本發明之內容更容易明瞭,以下特舉諸實施例作為本發明確實能夠據以實施的範例。 The present invention provides a load prediction method and an electronic device that perform different prediction procedures according to a time difference between a predicted time point and a current time point, thereby effectively predicting a resource load record of the electronic device at a predicted time point. In order to make the content of the present invention easier to understand, the following examples are given as examples in which the present invention can be implemented.

第一實施例First embodiment

圖1是依照本發明第一實施例所繪示之負載預測方法的流程圖。本實施例中的負載預測方法,適用於電子裝置,其中電子裝置具有處理單元,而可利用處理單元執行儲存於儲存單元中的多個程式碼片段,藉以來實現下列負載預測方法的各步驟。 1 is a flow chart of a load prediction method according to a first embodiment of the present invention. The load prediction method in this embodiment is applicable to an electronic device, wherein the electronic device has a processing unit, and the processing unit can execute a plurality of code segments stored in the storage unit, thereby implementing the steps of the following load prediction method.

請參照圖1,於步驟S102中,處理單元分別在多個時 間週期記錄電子裝置的多個資源負載記錄。具體來說,例如處理單元以每隔d分鐘(d為正整數)作為取樣速率,以在多個時間點分別擷取一資源使用量。也就是說,每一筆資源負載記錄皆包括多筆資源使用量。舉例而言,假設時間週期為24小時,且假設處理單元以每隔2分鐘來取得每一筆資源負載記錄,則每一筆資源負載記錄包括720筆的資源使用量。 Referring to FIG. 1, in step S102, the processing unit is in multiple times. The inter-cycle records a plurality of resource load records of the electronic device. Specifically, for example, the processing unit takes a sampling rate every d minutes (d is a positive integer) to separately capture a resource usage amount at a plurality of time points. In other words, each resource load record includes multiple resource usage. For example, assuming a time period of 24 hours, and assuming that the processing unit fetches each resource load record every 2 minutes, each resource load record includes 720 pens of resource usage.

換言之,處理單元會依據取樣速率在每個時間週期內取得多筆資源使用量,並記錄為資源負載記錄。也就是說,每個時間週期皆具有對應的一筆資源負載記錄。假設時間週期為1天,則每天皆會記錄有一筆資源負載記錄,即當天的歷史記錄。 In other words, the processing unit obtains multiple resource usages in each time period according to the sampling rate and records them as resource load records. That is to say, each time period has a corresponding resource load record. Assuming a time period of one day, a resource load record, that is, the history of the day, is recorded every day.

之後,於步驟S104中,處理單元會接收預測時間點。在此,預測時間點於時間軸上大於目前時間點,亦即,預測時間點是發生在未來的時間點。並且,於步驟S106中,處理單元會計算預測時間點與目前時間點之間的時間差。具體來說,假設預測時間點為5月19日上午9點,而目前時間點為5月19日上午7點,則時間差即是2小時。 Thereafter, in step S104, the processing unit receives the predicted time point. Here, the predicted time point is greater than the current time point on the time axis, that is, the predicted time point is a point in time that occurs in the future. And, in step S106, the processing unit calculates a time difference between the predicted time point and the current time point. Specifically, assuming that the predicted time point is 9:00 am on May 19, and the current time point is 7:00 am on May 19, the time difference is 2 hours.

接著,於步驟S108中,處理單元會判斷時間差是否小於門檻值。其中,處理單元可依據使用者的設定來設定門檻值的大小。倘若預測時間點與目前時間點之間的時間差小於門檻值,執行步驟S110;倘若預測時間點與目前時間點之間的時間差未小於門檻值,執行步驟S112。 Next, in step S108, the processing unit determines whether the time difference is less than a threshold value. The processing unit can set the threshold value according to the user's setting. If the time difference between the predicted time point and the current time point is less than the threshold value, step S110 is performed; if the time difference between the predicted time point and the current time point is not less than the threshold value, step S112 is performed.

在步驟S110中,處理單元會依據所述資源負載記錄 執行回歸分析預測程序。詳細而言,在回歸分析預測程序中,處理單元利用所記錄的所述資源負載記錄來執行回歸分析(regression analysis)演算法,藉以獲得預測模型,進而處理單元可利用此預測模型來預測電子裝置在預測時間點的資源負載記錄。例如,利用統計學上的回歸分析演算法來獲得預測模組,即,找出一條最能夠代表所有資源使用量的函數(回歸估計式),而以此函數代表時間和資源使用量之間的關係。因此,將預測時間點與目前時間點帶入此預測模型(即回歸估計式)中,進而獲得預測時間點的之預測值,即所預測的資源使用量。 In step S110, the processing unit records according to the resource load Perform a regression analysis prediction program. In detail, in the regression analysis prediction program, the processing unit performs a regression analysis algorithm using the recorded resource load record to obtain a prediction model, and the processing unit can use the prediction model to predict the electronic device. Resource load record at the predicted time point. For example, a statistical regression analysis algorithm is used to obtain a prediction module, that is, to find a function (regression estimation formula) that best represents all resource usage, and this function represents between time and resource usage. relationship. Therefore, the predicted time point and the current time point are brought into the prediction model (ie, the regression estimation formula), thereby obtaining the predicted value of the predicted time point, that is, the predicted resource usage.

倘若時間差未小於門檻值,則如步驟S112所示,處理單元會依據所述資源負載記錄執行群組分析預測程序。具體來說,在群組分析預測程序中,處理單元會對預測時間點對應的預測時間區段的所述資源負載記錄進行群集分析,以將此預測時間區段中的所述資源負載記錄分成多個群集,並且在所述群集中,選取筆數最多的其中之一群集的平均值,以作為預測時間點的預測值。 If the time difference is not less than the threshold, then as shown in step S112, the processing unit performs a group analysis prediction procedure according to the resource load record. Specifically, in the group analysis prediction program, the processing unit performs cluster analysis on the resource load record of the predicted time segment corresponding to the predicted time point to divide the resource load record in the predicted time segment into Multiple clusters, and in the cluster, the average of one of the clusters with the largest number of segments is selected as the predicted value of the predicted time point.

基於上述,本實施例可利用電子裝置在多個時間週期所記錄的多個資源負載記錄,來預測電子裝置在預測時間點時的資源使用量。在本實施例中,依據預測時間點與目前時間點之間的時間差,在回歸分析預測程序與群組分析預測程序中選擇其一來預測電子裝置在預測時間點時的資源使用量。其中,當預測時間點接近目前時間點時(即,時間差小於門檻值),可透過回歸分析預測程序來預測資 源使用量。反之,當預測時間點不接近目前時間點時(即,時間差未小於門檻值),可透過群組分析預測程序來預測資源使用量。藉此,根據所記錄的資源負載記錄,可預測在不同應用需求與操作環境中的資源使用情況,進而有效地預測發生在未來時間點上的資源使用量的預測值,據以根據此預測值來調整電子裝置中的資源使用分配。因此,電子裝置可避免負載不均的情形,且可具有較高的工作效能。 Based on the above, the embodiment can use the plurality of resource load records recorded by the electronic device in a plurality of time periods to predict the resource usage of the electronic device at the predicted time point. In this embodiment, based on the time difference between the predicted time point and the current time point, one of the regression analysis prediction program and the group analysis prediction program is selected to predict the resource usage of the electronic device at the predicted time point. Wherein, when the predicted time point is close to the current time point (ie, the time difference is less than the threshold value), the regression analysis predictive program can be used to predict the capital. Source usage. Conversely, when the predicted time point is not close to the current time point (ie, the time difference is not less than the threshold), the resource usage can be predicted by the group analysis prediction program. Thereby, according to the recorded resource load record, the resource usage in different application requirements and the operating environment can be predicted, thereby effectively predicting the predicted value of the resource usage occurring at a future time point, according to which the predicted value is based To adjust the resource usage allocation in the electronic device. Therefore, the electronic device can avoid the situation of uneven load and can have higher work efficiency.

底下再舉一實施例來詳細說明上述群組分析預測程序。 An embodiment will be described below to explain the above-mentioned group analysis prediction program in detail.

第二實施例Second embodiment

圖2是依照本發明第二實施例所繪示之群組分析預測程序的流程圖。在本實施例中,電子裝置儲存有在多個時間週期所記錄的多個資源負載記錄,即,每個時間週期皆具有對應的一筆資源負載記錄。 2 is a flow chart of a group analysis prediction program according to a second embodiment of the present invention. In this embodiment, the electronic device stores a plurality of resource load records recorded in a plurality of time periods, that is, each time period has a corresponding one of the resource load records.

請參照圖2,在步驟S202中,處理單元會將每一時間週期劃分為多個時間區段,使得每一筆資源負載記錄劃分成多個資料片段。舉例來說,假設時間週期為一天,且處理單元將一天分成4個時間區段,則每一個時間區段的時間為6小時,即,將每一天的資源負載記錄劃分為0:00-6:00、6:00-12:00、12:00-18:00以及18:00-24:00等六個資料片段。以取樣速率為2分鐘為例,每一個資料片段中皆分別包括有180筆資源使用量。另外,在每個時間區 段會包括多個時間週期在該時間區段的資料片段。以10筆資源負載記錄而言,即10天的歷史記錄,在時間區段6:00-12:00會包括10筆資料片段,也就是這10天中在6:00-12:00的資料片段。其餘亦以此類推。 Referring to FIG. 2, in step S202, the processing unit divides each time period into a plurality of time segments, so that each resource load record is divided into a plurality of data segments. For example, if the time period is one day, and the processing unit divides the day into 4 time segments, the time of each time segment is 6 hours, that is, the resource load record of each day is divided into 0:00-6. Six pieces of data such as :00, 6:00-12:00, 12:00-18:00, and 18:00-24:00. Taking the sampling rate as 2 minutes as an example, each data segment includes 180 resource usages. Also, in each time zone The segment will include a plurality of data segments of the time period in the time segment. In terms of 10 resource load records, that is, 10 days of history, 10 pieces of data will be included in the time zone 6:00-12:00, that is, the data of 6:00-12:00 in these 10 days. Fragment. The rest is also like this.

接著,於步驟S204中,處理單元會在所述時間區段中選擇預測時間點對應的其中一預測時間區段。也就是說,處理單元會選擇包括此預測時間點的時間區段為預測時間區段。 Next, in step S204, the processing unit selects one of the predicted time segments corresponding to the predicted time point in the time segment. That is, the processing unit selects the time segment including this predicted time point as the predicted time segment.

之後,於步驟S206中,處理單元會對預測時間區段在上述時間週期內的資料片段進行群集分析,以將資料片段分群成多個群集。詳細而言,處理單元在進行群集分析時,可在每一個時間區段內的各資料片段中,計算在相同時間點所取得的資源負載記錄之間的距離總和,據以利用此距離總和計算出在每一所述時間區段內的各資料片段之間的一相似度,並將具有較大相似度的資料片段分成同一群集,其中處理單元利如是透過序列間編輯距離(Edit Distance on Real sequence,EDR)演算法、最長共同子序列(Longest Common Subsequence,LCS)演算法、實補償編輯距離(Edit distance with Real Penalty,ERP)演算法或動態時間校正(Dynamic Time Warping,DTW)演算法等,不限於上述,但本實施例之處理單元透過EDR演算法來計算相似度為較佳。 Then, in step S206, the processing unit performs cluster analysis on the data segments of the predicted time segment in the above time period to group the data segments into a plurality of clusters. In detail, when performing the cluster analysis, the processing unit may calculate the sum of the distances between the resource load records acquired at the same time point in each data segment in each time segment, and calculate the total distance using the distance. A similarity between each piece of data in each of the time segments, and a piece of data having a greater degree of similarity is divided into the same cluster, wherein the processing unit is like an inter-sequence editing distance (Edit Distance on Real) Sequence, EDR) algorithm, Longest Common Subsequence (LCS) algorithm, Edit distance with Real Penalty (ERP) algorithm or Dynamic Time Warping (DTW) algorithm, etc. The present invention is not limited to the above, but it is preferable that the processing unit of the embodiment calculates the similarity through the EDR algorithm.

另外,上述群集分析例如是透過k均值聚類(K-means)分群法、空間聚演算法(Density-Based Spatial Clustering of Applications with Noise,DBScan)、或是透過階層式分群法(Hierarchical clustering),以將每一時間週期各時間區段中的資料片段分成多個群集。本實施例以k均值聚類(K-means)分群法為較佳,但本實施例並不限制群集分析的方法。 In addition, the above cluster analysis is, for example, a k-means clustering method and a spatial clustering algorithm (Density-Based Spatial Clustering of Applications with Noise, DBScan), or Hierarchical clustering, to divide the data segments in each time segment of each time period into multiple clusters. This embodiment is preferably a k-means clustering method, but this embodiment does not limit the method of cluster analysis.

接著,於步驟S208中,處理單元會自上述處理單元所分成的群集中,選取筆數最多的其中之一群集。並且,於步驟S210中,處理單元會計算被選擇的群集所包括的資料片段的平均值,以作為預測時間點的預測值。亦即,處理單元會將被選擇的群集所包括的資料片段中的資源負載記錄取平均,並求出此群集的平均值來做為預測時間點的資源負載記錄。 Next, in step S208, the processing unit selects one of the clusters with the largest number of segments from the cluster divided by the processing unit. Moreover, in step S210, the processing unit calculates an average value of the data segments included in the selected cluster as a predicted value of the predicted time point. That is, the processing unit averages the resource load records in the data segments included in the selected cluster, and finds the average of the clusters as the resource load record at the predicted time point.

舉例來說,以30筆資源負載記錄,時間週期為1天,每天所劃分為6個時間區段(0:00-4:00、4:00-8:00、8:00-12:00、12:00-16:00、16:00-20:00、20:00-24:00)為例,假設預測時間點為3:00,則所選擇出的預測時間區段為0:00-4:00。據此,在30筆資源負載記錄中取出預測時間區段0:00-4:00的資料片段(30筆),對此30筆資料片段進行群集分析。假設獲得群集A、群集B及群集C,其分別包括10筆、15筆及5筆的資料片段。據此,取出具有15筆資料片段對應的群集C。之後,計算群集C的15筆資料片段的平均值。或者,僅計算群集C在預測時間點3:00的平均值作為預測值,基於上述,本實施例可利用電子裝置在多個時間週期 被記錄的多個資源負載記錄,來預測電子裝置在預測時間點時的資源負載記錄。特別是,當預測時間點不接近目前時間點時(即,時間差未小於門檻值),可透過群組分析預測程序來預測資源負載記錄,藉以在預測時間點對應的預測時間區段中,選取大部分所記錄的資源負載記錄的平均值以作為預測時間點的資源負載記錄之預測值。據此,可有效地預測資源負載記錄發生在未來時間點上的預測值,並可依據此預測值來調整電子裝置中的資源使用分配,而達到提升工作效能的目地。 For example, with 30 resource load records, the time period is 1 day, divided into 6 time segments each day (0:00-4:00, 4:00-8:00, 8:00-12:00) For example, 12:00-16:00, 16:00-20:00, 20:00-24:00), assuming that the predicted time point is 3:00, the selected predicted time zone is 0:00. -4:00. According to this, in the 30 resource load records, the data segments (30 pens) of the predicted time segment 0:00-4:00 are taken out, and 30 pieces of data segments are clustered. Assume that cluster A, cluster B, and cluster C are obtained, which include 10 segments, 15 pens, and 5 segments of data segments, respectively. According to this, the cluster C corresponding to 15 pieces of data is taken out. After that, the average of 15 data segments of cluster C is calculated. Alternatively, only the average value of the cluster C at the predicted time point 3:00 is calculated as the predicted value. Based on the above, the present embodiment can utilize the electronic device for a plurality of time periods. A plurality of resource load records are recorded to predict a resource load record of the electronic device at the predicted time point. In particular, when the predicted time point is not close to the current time point (ie, the time difference is not less than the threshold value), the resource load record may be predicted by the group analysis prediction program, thereby selecting the predicted time segment corresponding to the predicted time point. The average of most of the recorded resource load records is used as a predictor of the resource load record at the predicted time point. According to this, the predicted value of the resource load record occurring at a future time point can be effectively predicted, and the resource use allocation in the electronic device can be adjusted according to the predicted value, thereby achieving the purpose of improving the work efficiency.

針對上述負載預測方法,本發明亦提供對應的電子裝置,使得此方法可應用在個人電腦、筆記型電腦、平板電腦、個人數位助理(Personal Digital Assistant,PDA)、伺服器、手機等硬體裝置上,以下則再舉一實施例詳細說明。 For the above load prediction method, the present invention also provides a corresponding electronic device, so that the method can be applied to a personal device such as a personal computer, a notebook computer, a tablet computer, a personal digital assistant (PDA), a server, a mobile phone, and the like. In the following, an embodiment will be described in detail.

第三實施例Third embodiment

圖3是依照本發明第三實施例所繪示之電子裝置的方塊圖。請參照圖3,電子裝置300例如是個人電腦、筆記型電腦、平板電腦、個人數位助理(Personal Digital Assistant,PDA)、伺服器、手機等電子裝置等,本發明並不對電子裝置300的種類加以限制。 3 is a block diagram of an electronic device in accordance with a third embodiment of the present invention. Referring to FIG. 3, the electronic device 300 is, for example, a personal computer, a notebook computer, a tablet computer, a personal digital assistant (PDA), a server, a mobile phone, or the like. The present invention does not impose the type of the electronic device 300. limit.

請參照圖3中,電子裝置300包括記錄模組302、接收模組304、時間計算模組306、判斷模組308、回歸分析模組310以及群組分析模組312。上述各模組的功能分述 如下。 Referring to FIG. 3 , the electronic device 300 includes a recording module 302 , a receiving module 304 , a time computing module 306 , a determining module 308 , a regression analysis module 310 , and a group analysis module 312 . Functional description of each module above as follows.

記錄模組302用以記錄電子裝置300的多個資源負載記錄,即歷史記錄。上述資源負載記錄例如是中央處理單元(Central Processing Unit,CPU)的使用率、記憶體使用率、分頁檔(Page File,PF)使用量或網路使用量等,不限於上述。此外,記錄模組302可依據使用者所設定的記錄時間來記錄的電子裝置300的資源負載記錄,其中記錄時間例如是一週或數週的時間、一個或多個月的時間等等,本實施例不限制記錄時間的長度。也就是說,在上述記錄時間中,記錄模組302可依照電子裝置300在不同的應用需求與操作環境中的資源使用情況,而取得不同的資源負載記錄。 The recording module 302 is configured to record a plurality of resource load records, that is, history records, of the electronic device 300. The resource load record is, for example, a central processing unit (CPU) usage rate, a memory usage rate, a page file (PF) usage amount, or a network usage amount, and is not limited to the above. In addition, the recording module 302 can record the resource load of the electronic device 300 according to the recording time set by the user, wherein the recording time is, for example, one week or several weeks, one or more months, and the like. The example does not limit the length of the recording time. That is to say, in the above recording time, the recording module 302 can obtain different resource load records according to the resource usage of the electronic device 300 in different application requirements and the operating environment.

舉例來說,當電子裝置300進入進階組態與電源介面(Advanced Configuration and Power Interface,簡稱ACPI)的睡眠(Sleep)模式或休眠(Hibernate)模式時,由於電子裝置300會維持在較低效能的工作運作,因此記錄模組302可記錄到較低的資源使用量。另一方面,當電子裝置300進入正常工作模式時,例如,電子裝置300執行軟體、應用程式或其他執行程序的時候,由於電子裝置300會維持在較高效能的工作運作,因此記錄模組302可記錄到較高的資源使用量。 For example, when the electronic device 300 enters the Sleep Configuration mode or the Hibernate mode of the Advanced Configuration and Power Interface (ACPI), the electronic device 300 is maintained at a lower performance. The work is performed so that the recording module 302 can record lower resource usage. On the other hand, when the electronic device 300 enters the normal working mode, for example, when the electronic device 300 executes software, an application program, or other executing programs, since the electronic device 300 maintains a high-performance working operation, the recording module 302 Higher resource usage can be recorded.

接收模組304用以接收預測時間點,其中預測時間點在時間軸上大於目前時間點。也就是說,本實施例可預測電子裝置300在此預測時間點時的資源使用量。此外,接 收模組304可依據使用者所設定的時間點來做為預測時間點。 The receiving module 304 is configured to receive a predicted time point, wherein the predicted time point is greater than the current time point on the time axis. That is to say, the present embodiment can predict the resource usage of the electronic device 300 at this predicted time point. In addition, The receiving module 304 can be used as the predicted time point according to the time point set by the user.

時間計算模組306耦接於接收模組304。時間計算模組306用以計算預測時間點與目前時間點之間的時間差。舉例來說,時間計算模組306可將預測時間點與目前時間點相減,而取得時間差。 The time calculation module 306 is coupled to the receiving module 304. The time calculation module 306 is configured to calculate a time difference between the predicted time point and the current time point. For example, the time calculation module 306 can subtract the predicted time point from the current time point to obtain the time difference.

判斷模組308耦接於時間計算模組306。判斷模組308會比較時間計算模組306所求得的時間差與門檻值的大小,以判斷此時間差是否小於門檻值,其中判斷模組308可依據使用者所設定的門檻值的大小來進行判斷。 The determining module 308 is coupled to the time calculating module 306. The determining module 308 compares the time difference and the threshold value obtained by the time calculating module 306 to determine whether the time difference is smaller than the threshold value, wherein the determining module 308 can determine according to the threshold value set by the user. .

回歸分析模組310耦接於判斷模組308與記錄模組302。在本實施例中,回歸分析模組310會依據記錄模組302所記錄的資源負載記錄來執行回歸分析預測程序。具體來說,在回歸分析預測程序中,回歸分析模組310會針對記錄模組302在所述時間週期所記錄的資源負載記錄執行回歸分析演算法,以獲得一預測模型,藉以在此預測模型中取出預測時間點所對應的預測值。 The regression analysis module 310 is coupled to the determination module 308 and the recording module 302. In this embodiment, the regression analysis module 310 performs a regression analysis prediction process according to the resource load record recorded by the recording module 302. Specifically, in the regression analysis prediction process, the regression analysis module 310 performs a regression analysis algorithm on the resource load record recorded by the recording module 302 during the time period to obtain a prediction model, thereby predicting the model. The predicted value corresponding to the predicted time point is taken out.

群組分析模組312會依據資源負載記錄來執行群組分析預測程序。具體來說,在群組分析預測程序中,群組分析模組312會在預測時間點對應的預測時間區段中,選取大部分所述資源負載記錄的平均值以作為預測時間點的資源負載記錄之預測值。 The group analysis module 312 performs a group analysis prediction process based on the resource load record. Specifically, in the group analysis prediction program, the group analysis module 312 selects an average of most of the resource load records as the resource load of the predicted time point in the predicted time segment corresponding to the predicted time point. The predicted value of the record.

在此說明的是,本實施例之記錄模組302、接收模組304、時間計算模組306、判斷模組308、回歸分析模組310 以及群組分析模組312分別為由一個或數個邏輯閘組合而成的硬體電路來實作。 The recording module 302, the receiving module 304, the time calculating module 306, the determining module 308, and the regression analyzing module 310 of the embodiment are described herein. And the group analysis module 312 is implemented by a hardware circuit composed of one or several logic gates.

或者,在本發明另一實施例中,記錄模組302、接收模組304、時間計算模組306、判斷模組308、回歸分析模組310以及群組分析模組312可以是以電腦程式碼來實作。舉例來說,記錄模組302、接收模組304、時間計算模組306、判斷模組308、回歸分析模組310以及群組分析模組312例如是由程式語言所撰寫的程式碼片段來實作於應用程式、作業系統或驅動程式等,而這些程式碼片段儲存在儲存單元中,並藉由處理單元來執行之。 Alternatively, in another embodiment of the present invention, the recording module 302, the receiving module 304, the time calculating module 306, the determining module 308, the regression analyzing module 310, and the group analyzing module 312 may be computer code. Come on. For example, the recording module 302, the receiving module 304, the time calculating module 306, the determining module 308, the regression analyzing module 310, and the group analyzing module 312 are, for example, code fragments written by a programming language. For application, operating system or driver, etc., these code segments are stored in the storage unit and executed by the processing unit.

另外值得一提的是,在其他實施例中,電子裝置300還包括處理單元與儲存單元,而處理單元分別耦接至記錄模組302、接收模組304、時間計算模組306、判斷模組308、回歸分析模組310以及群組分析模組312,藉以驅動上述各模組,上述各模組透過處理單元的控制來協同完成上述功能。 In addition, in other embodiments, the electronic device 300 further includes a processing unit and a storage unit, and the processing unit is coupled to the recording module 302, the receiving module 304, the time computing module 306, and the determining module. 308. The regression analysis module 310 and the group analysis module 312 drive the modules, and the modules cooperate to complete the functions through the control of the processing unit.

進一步而言,上述處理單元為具備運算能力的硬體(例如晶片組、處理器等),用以控制電子裝置300的整體運作。處理單元例如是中央處理單元(Central Processing Unit,CPU),或是其他可程式化之微處理器(Microprocessor)、數位訊號處理器(Digital Signal Processor,DSP)、可程式化控制器、特殊應用積體電路(Application Specific Integrated Circuits,ASIC)、可程式化邏輯裝置(Programmable Logic Device,PLD)或其他類 似裝置。 Further, the processing unit is a hardware (for example, a chipset, a processor, or the like) having computing power for controlling the overall operation of the electronic device 300. The processing unit is, for example, a central processing unit (CPU), or other programmable microprocessor (Microprocessor), a digital signal processor (DSP), a programmable controller, and a special application product. Application Specific Integrated Circuits (ASICs), Programmable Logic Devices (PLDs), or other classes Like a device.

此外,上述儲存單元可以是內嵌式儲存單元或外接式儲存單元。內嵌式儲存單元可為隨機存取記憶體(Random Access Memory,RAM)、唯讀記憶體(Read-Only Memory,ROM)、快閃記憶體(Flash memory)、磁碟儲存裝置(Magnetic disk storage device)等。外接式儲存單元可為小型快閃(Compact Flash,CF)記憶卡、安全數位(Secure Digital,SD)記憶卡、微安全數位(Micro SD)記憶卡、記憶棒(Memory Stick,MS)等。在本實施例中,儲存單元可儲存一或多個用來執行負載預測方法的程式碼以及資料(例如,記錄模組302所記錄的所述資源負載記錄、門檻值等)等。 In addition, the above storage unit may be an in-line storage unit or an external storage unit. The embedded storage unit can be a random access memory (RAM), a read-only memory (ROM), a flash memory, a magnetic disk storage device (Magnetic disk storage). Device) and so on. The external storage unit can be a Compact Flash (CF) memory card, a Secure Digital (SD) memory card, a Micro SD memory card, a Memory Stick (MS), and the like. In this embodiment, the storage unit may store one or more code codes and materials used to execute the load prediction method (for example, the resource load record, threshold value, and the like recorded by the recording module 302).

為了使本領域的技術人員進一步了解本實施例之負載預測方法以及使用此方法的電子裝置,以下再舉例,針對群組分析模組312進行詳細的說明。 In order to enable those skilled in the art to further understand the load prediction method of the present embodiment and the electronic device using the same, the group analysis module 312 will be described in detail below by way of example.

圖4是依照本發明第三實施例所繪示之群組分析模組的方塊圖。請參照圖4,群組分析模組312包括劃分模組402、預測模組404、分群模組406、選擇模組408以及預測計算模組410。群組分析模組312中的各模組的功能分述如下。 4 is a block diagram of a group analysis module according to a third embodiment of the present invention. Referring to FIG. 4 , the group analysis module 312 includes a partitioning module 402 , a prediction module 404 , a grouping module 406 , a selection module 408 , and a prediction computing module 410 . The functions of each module in the group analysis module 312 are described as follows.

劃分模組402用以執行上述步驟S202,即,將每一時間週期劃分為多個時間區段,使得每一時間週期中的資源負載記錄劃分成多個資料片段。預測模組404會執行上述步驟S204,即,在時間週期中,選擇與預測時間點相符合 的時間區段。分群模組406用以執行上述步驟S206,即,群集分析的運算。選擇模組408用以執行上述步驟S208,即,在多個群集中選擇其中之一群集。預測計算模組410用以執行上述步驟S210,計算資源負載記錄的平均值。 The dividing module 402 is configured to perform the above step S202, that is, divide each time period into a plurality of time segments, so that the resource load record in each time period is divided into a plurality of data segments. The prediction module 404 performs the above step S204, that is, in the time period, the selection is consistent with the predicted time point. Time period. The grouping module 406 is configured to perform the above step S206, that is, the operation of the cluster analysis. The selection module 408 is configured to perform the above step S208, that is, select one of the clusters among the plurality of clusters. The prediction calculation module 410 is configured to perform the above step S210 to calculate an average value of the resource load records.

此外,劃分模組402、預測模組404、分群模組406、選擇模組408以及預測計算模組410亦可以是由程式語言所撰寫的程式碼或是為獨立的晶片。上述劃分模組402、預測模組404、分群模組406、選擇模組408以及預測計算模組410的詳細說明可參照圖2,在此不再詳述。 In addition, the partitioning module 402, the prediction module 404, the grouping module 406, the selection module 408, and the predictive computing module 410 may also be code written by a programming language or a separate chip. A detailed description of the partitioning module 402, the prediction module 404, the clustering module 406, the selection module 408, and the predictive computing module 410 can be referred to FIG. 2 and will not be described in detail herein.

第四實施例Fourth embodiment

為了使本領域的技術人員進一步了解本實施例之負載預測方法以及使用此方法的電子裝置,底下再舉一實施例說明,其中,仍搭配圖3的電子裝置300來進行說明。 In order to enable those skilled in the art to further understand the load prediction method of the present embodiment and the electronic device using the same, an embodiment will be described below, which will be described with reference to the electronic device 300 of FIG.

在本實施例中,假設記錄模組302以一天為一個時間週期,且每隔2分鐘記錄每一筆資源使用量,而記錄了5月1日到5月14日之間電子裝置300的14筆資源負載記錄。也就是說,記錄模組302在所記錄的14個時間週期中(底下以時間週期T1~T14表示),記錄了10080筆資源使用量。 In this embodiment, it is assumed that the recording module 302 records one resource time per day and records every resource usage every two minutes, and records 14 electronic devices 300 between May 1 and May 14. Resource load record. That is to say, the recording module 302 records 10080 resource usage amounts in the recorded 14 time periods (indicated by time periods T1 to T14).

在此,假設接收模組304所接收到的預測時間點為5月15日上午9點,而目前時間點為5月15日上午8點,且門檻值為2小時。接著,判斷模組308會判斷預測時間點(即5月15日上午9點)與目前時間點點(5月15日 上午8點)之間的時間差(即1小時)是否小於門檻值。由於判斷模組308的判斷結果為是,即預測時間點與目前時間點點之間的時間差是小於門檻值,因此,回歸分析模組310會依據5月1日到5月14日之間電子裝置300的10080筆資源使用量來執行回歸分析預測程序。 Here, it is assumed that the predicted time point received by the receiving module 304 is 9:00 am on May 15th, and the current time point is 8:00 am on May 15th, and the threshold value is 2 hours. Next, the determination module 308 will determine the predicted time point (ie, 9 am on May 15) and the current time point (May 15) The time difference (ie 1 hour) between 8 am) is less than the threshold. Since the judgment result of the judgment module 308 is YES, that is, the time difference between the predicted time point and the current time point is less than the threshold value, the regression analysis module 310 will be based on the electronic data from May 1 to May 14. The regression analysis prediction program is performed by 10080 resource usage of the device 300.

詳細而言,在回歸分析預測程序,回歸分析模組310會依據這10080筆資源使用量來執行回歸分析演算法,以獲得預測模型,其中此預測模型中可包括目前時間點(5月15日上午8點)到預測時間點(即5月15日上午9點)之間的各時間點(即每隔2分鐘)所對應的預測值。也就是說,回歸分析模組310可將預測時間點(即5月15日上午9點)帶入上述預測模型中,據以在此預測模型中取出預測時間點所對應的預測值來做為預測的資源使用量。 In detail, in the regression analysis prediction program, the regression analysis module 310 performs a regression analysis algorithm based on the 10080 resource usage amount to obtain a prediction model, wherein the prediction model may include the current time point (May 15th) The predicted value corresponding to each time point (ie, every 2 minutes) between the 8:00 am and the predicted time point (ie, 9:00 am on May 15). That is to say, the regression analysis module 310 can bring the prediction time point (ie, 9:00 am on May 15) into the above prediction model, and take the prediction value corresponding to the prediction time point as the prediction model in this prediction model as Forecasted resource usage.

在本實施例中,由於預測時間點接近目前時間點時(即,時間差小於門檻值),因此電子裝置300會透過回歸分析預測程序來預測資源使用量,藉以有效地預測資源使用量在未來時間點上的預測值。 In this embodiment, since the predicted time point is close to the current time point (ie, the time difference is less than the threshold value), the electronic device 300 predicts the resource usage amount through the regression analysis prediction program, thereby effectively predicting the resource usage amount in the future time. The predicted value at the point.

另一方面,承接於上述實施例,倘若接收模組304所接收到的預測時間點為5月15日上午10點,而目前時間點為5月15日上午6點,且門檻值為2小時。在此,判斷模組308會判斷預測時間點(即5月15日上午10點)與目前時間點點(5月15日上午6點)之間的時間差(即3小時)是否小於門檻值。由於判斷模組308的判斷結果為否,即預測時間點與目前時間點點之間的時間差未小於門 檻值,因此,群組分析模組312會依據5月1日到5月14日之間電子裝置300的10080筆資源使用量以執行群組分析預測程序。 On the other hand, in the above embodiment, if the receiving module 304 receives the predicted time point at 10:00 am on May 15, and the current time point is at 6 am on May 15, and the threshold is 2 hours. . Here, the determination module 308 determines whether the time difference (ie, 3 hours) between the predicted time point (ie, 10 am on May 15) and the current time point (6 am on May 15) is less than the threshold value. Since the judgment result of the judgment module 308 is no, that is, the time difference between the predicted time point and the current time point is not less than the door. Therefore, the group analysis module 312 performs the group analysis prediction process according to the 10080 resource usage of the electronic device 300 between May 1 and May 14.

詳細而言,在回歸分析預測程序中,劃分模組402會將時間週期T1~T14劃分為多個時間區段,使得時間週期T1~T14中的資源負載記錄劃分成多個資料片段。 In detail, in the regression analysis prediction program, the division module 402 divides the time periods T1 T T14 into a plurality of time segments, so that the resource load records in the time periods T1 T T14 are divided into a plurality of data segments.

需說明的是,在本實施例中,假設劃分模組402將時間週期T1~T14分別劃分為4個時間區段(底下以時間區段TS1~TS4表示)。亦即,以每一個時間週期(即,一天)會被劃分模組402劃分為4個時間區段,其中每一個區段的時間為6小時。更具體來說,在每一個時間週期中的午夜0點到早上6點之間為時間區段TS1,每一個時間週期中的早上6點到中午12點之間為時間區段TS2,每一個時間週期中的中午12點到晚上18點之間為時間區段S3,而每一個時間週期中的晚上18點到晚上12點之間為時間區段S4。 It should be noted that, in this embodiment, it is assumed that the dividing module 402 divides the time periods T1 T T14 into four time segments (hereinafter represented by time segments TS1 TS TS4 ). That is, each time period (i.e., one day) is divided into four time segments by the partitioning module 402, wherein each of the segments has a time of six hours. More specifically, the time zone TS1 is between 0:00 am and 6:00 am in each time period, and the time zone TS2 is between 6 am and 12 noon in each time period, each one The time zone S3 is between 12 noon and 18 pm in the time period, and the time zone S4 is between 18 pm and 12 pm in each time period.

接著,預測模組404會在時間區段TS1~TS4中選擇預測時間點對應的其中一預測時間區段。在此,由於預測時間點為5月15日上午10點係對應於每一時間週期的時間區段S2,因此預測模組404會選擇時間區段S2為預測時間區段(底下以預測時間區段Q表示)。 Next, the prediction module 404 selects one of the predicted time segments corresponding to the predicted time point in the time segments TS1 to TS4. Here, since the predicted time point is 10:00 am on May 15 and corresponds to the time zone S2 of each time period, the prediction module 404 selects the time zone S2 as the predicted time zone (below to predict the time zone) Paragraph Q indicates).

進一步而言,分群模組406會對預測時間區段Q在時間週期T1~T14中,記錄模組302所記錄的資料片段進行群集分析。在此,假設分群模組406依據K-means群集分 析將資料片段分成5個群集(底下以群集C1~C5表示),並假設群集C3具有筆數最多的資料片段,則選擇模組408會在群集C1~C5中選取群集C3。接著,預測計算模組410會計算群集C3所包括在時間週期T1~T14中的資料片段的平均值,以作為預測時間點(即5月15日上午9點)的預測值,據以將此預測值來做為預測的資源使用量。 Further, the grouping module 406 performs cluster analysis on the data segments recorded by the recording module 302 in the time period T1~T14 of the prediction time segment Q. Here, it is assumed that the grouping module 406 is divided according to the K-means cluster. The data segment is divided into 5 clusters (under the clusters C1 to C5), and if the cluster C3 has the largest number of data segments, the selection module 408 selects the cluster C3 among the clusters C1 to C5. Next, the prediction calculation module 410 calculates the average value of the data segments included in the time period T1~T14 of the cluster C3 as the predicted value of the predicted time point (ie, 9:00 am on May 15), according to which The predicted value is used as the predicted resource usage.

在本實施例中,由於預測時間點距離目前時間點較遠時(即,時間差未小於門檻值),因此電子裝置300會透過群組分析預測程序來預測資源使用量,藉以在預測時間點對應的預測時間區段中,選取大部分所記錄的資源使用量的平均值以作為預測時間點的資源使用量之預測值。如此一來,電子裝置300可有效地依據此預測值來預測在未來時間點上的資源使用量。 In this embodiment, since the predicted time point is far from the current time point (ie, the time difference is not less than the threshold value), the electronic device 300 predicts the resource usage amount through the group analysis and prediction program, thereby corresponding to the predicted time point. In the prediction time section, the average of most of the recorded resource usage is selected as the predicted value of the resource usage at the predicted time point. In this way, the electronic device 300 can effectively predict the resource usage amount at a future time point according to the predicted value.

綜上所述,本發明實施例之負載預測方法與電子裝置,電子裝置會利用在多個時間週期被記錄的多個資源負載記錄,來預測在預測時間點時的資源使用量。其中,當預測時間點與目前時間點之間的時間差小於門檻值時,電子裝置會透過回歸分析預測程序來預測資源使用量。然而,當預測時間點與目前時間點之間的時間未小於門檻值時,電子裝置會透過群組分析預測程序來預測資源使用量。藉此,電子裝置可根據所記錄的資源負載記錄,來預測在不同應用需求與操作環境中的資源使用情況,以計算出在資源使用量在預測時間點上的預測值。如此一來,電子裝置可據以根據此預測值來調整資源使用分配,以避免 電子裝置發生負載不均的情形,進而提升電子裝置的工作效能。 In summary, in the load prediction method and the electronic device of the embodiment of the present invention, the electronic device uses a plurality of resource load records recorded in a plurality of time periods to predict the resource usage amount at the predicted time point. Wherein, when the time difference between the predicted time point and the current time point is less than the threshold, the electronic device predicts the resource usage through the regression analysis prediction program. However, when the time between the predicted time point and the current time point is not less than the threshold, the electronic device predicts the resource usage through the group analysis prediction program. Thereby, the electronic device can predict the resource usage in different application requirements and the operating environment according to the recorded resource load record, to calculate the predicted value of the resource usage amount at the predicted time point. In this way, the electronic device can adjust the resource usage allocation according to the predicted value to avoid The electronic device is unevenly loaded, thereby improving the working efficiency of the electronic device.

雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明之精神和範圍內,當可作些許之更動與潤飾,故本發明之保護範圍當視後附之申請專利範圍所界定者為準。 Although the present invention has been disclosed in the above embodiments, it is not intended to limit the invention, and any one of ordinary skill in the art can make some modifications and refinements without departing from the spirit and scope of the invention. The scope of the invention is defined by the scope of the appended claims.

300‧‧‧電子裝置 300‧‧‧Electronic devices

302‧‧‧記錄模組 302‧‧‧recording module

304‧‧‧接收模組 304‧‧‧ receiving module

306‧‧‧時間計算模組 306‧‧‧Time calculation module

308‧‧‧判斷模組 308‧‧‧Judgement module

310‧‧‧回歸分析模組 310‧‧‧Regression Analysis Module

312‧‧‧群組分析模組 312‧‧‧Group Analysis Module

402‧‧‧劃分模組 402‧‧‧Division module

404‧‧‧預測模組 404‧‧‧ Prediction Module

406‧‧‧分群模組 406‧‧‧Group Module

408‧‧‧選擇模組 408‧‧‧Selection module

410‧‧‧預測計算模組 410‧‧‧Predictive Computing Module

S102~S112、S202~S210‧‧‧負載預測方法的各步驟 S102~S112, S202~S210‧‧‧ steps of load prediction method

圖1是依照本發明第一實施例所繪示之負載預測方法的流程圖。 1 is a flow chart of a load prediction method according to a first embodiment of the present invention.

圖2是依照本發明第二實施例所繪示之群組分析預測程序的流程圖。 2 is a flow chart of a group analysis prediction program according to a second embodiment of the present invention.

圖3是依照本發明第三實施例所繪示之電子裝置的方塊圖。 3 is a block diagram of an electronic device in accordance with a third embodiment of the present invention.

圖4是依照本發明第三實施例所繪示之群組分析模組的方塊圖。 4 is a block diagram of a group analysis module according to a third embodiment of the present invention.

S102~S112‧‧‧負載預測方法的各步驟 S102~S112‧‧‧Steps of load prediction method

Claims (10)

一種負載預測方法,適用於一電子裝置,該方法包括:分別在多個時間週期記錄該電子裝置的多個資源負載記錄;接收一預測時間點;計算該預測時間點與一目前時間點之間的一時間差,其中該預測時間點於一時間軸上大於該目前時間點;判斷該時間差是否小於一門檻值;倘若該時間差小於該門檻值,依據該些資源負載記錄執行一回歸分析預測程序;以及倘若該時間差未小於該門檻值,依據該些資源負載記錄執行一群組分析預測程序。 A load prediction method is applicable to an electronic device, the method comprising: recording a plurality of resource load records of the electronic device in a plurality of time periods; receiving a predicted time point; calculating the predicted time point and a current time point a time difference, wherein the predicted time point is greater than the current time point on a time axis; determining whether the time difference is less than a threshold; if the time difference is less than the threshold, performing a regression analysis prediction process according to the resource load records; And if the time difference is not less than the threshold, a group analysis prediction process is performed according to the resource load records. 如申請專利範圍第1項所述之負載預測方法,其中依據該些資源負載記錄執行該回歸分析預測程序的步驟包括:針對所記錄的該些資源負載記錄執行一回歸分析演算法,以獲得一預測模型;以及在該預測模型中取出該預測時間點所對應的一預測值。 The load prediction method according to claim 1, wherein the step of performing the regression analysis prediction program according to the resource load records comprises: performing a regression analysis algorithm on the recorded resource load records to obtain a a prediction model; and extracting a predicted value corresponding to the predicted time point in the prediction model. 如申請專利範圍第1項所述之負載預測方法,其中依據該些資源負載記錄執行該群組分析預測程序的步驟包括:將每一該些時間週期劃分為多個時間區段,使得每一 該些資源負載記錄劃分成多個資料片段;在該些時間區段中選擇該預測時間點對應的其中一預測時間區段;對該預測時間區段在該些時間週期內的該些資料片段進行一群集分析,以將該些資料片段分群成多個群集;自該些群集中,選取筆數最多的其中之一群集;以及計算該被選擇的群集所包括的該些資料片段的平均值,以作為該預測時間點的預測值。 The load prediction method according to claim 1, wherein the step of executing the group analysis prediction program according to the resource load records comprises: dividing each of the time periods into a plurality of time segments, such that each Separating the resource load records into a plurality of data segments; selecting, in the time segments, one of the predicted time segments corresponding to the predicted time points; and the data segments of the predicted time segments in the time periods Performing a cluster analysis to group the pieces of data into a plurality of clusters; from among the clusters, selecting one of the clusters with the largest number of segments; and calculating an average of the pieces of data included in the selected cluster , as the predicted value of the predicted time point. 如申請專利範圍第3項所述之負載預測方法,其中在對每一該些時間區段在該些時間週期內的該些資料片段進行該群集分析的步驟包括:計算每一該些時間區段內的各該資料片段之間的一相似度,並依據該相似度進行該群集分析。 The load prediction method of claim 3, wherein the step of performing the cluster analysis on the pieces of data in the time periods for each of the time segments comprises: calculating each of the time zones A similarity between each of the pieces of data within the segment, and the cluster analysis is performed based on the similarity. 如申請專利範圍第1項所述之負載預測方法,其中在分別在該些時間週期記錄該電子裝置的該些資源負載記錄包括:在每一該些時間週期中,依據一取樣速率取得多個資源使用量,其中每一該些資源負載記錄包括在每一該些時間週期中所獲得的該些資源使用量。 The load forecasting method of claim 1, wherein recording the resource load records of the electronic device during the time periods respectively comprises: obtaining, according to a sampling rate, each of the time periods Resource usage, wherein each of the resource load records includes the amount of resource usage obtained during each of the time periods. 一種電子裝置,包括:一記錄模組,分別在多個時間週期記錄該電子裝置的多個資源負載記錄;一接收模組,接收一預測時間點;一時間計算模組,計算該預測時間點與一目前時間點 之間的一時間差,其中該預測時間點於一時間軸上大於該目前時間點;一回歸分析模組,依據該些資源負載記錄執行一回歸分析預測程序;一群組分析模組,依據該些資源負載記錄執行一群組分析預測程序;以及一判斷模組,判斷該時間差是否小於一門檻值,倘若判定該時間差小於該門檻值,該判斷模組通知該回歸分析模組執行該回歸分析預測程序;倘若該判定時間差未小於該門檻值,該判斷模組通知該群組分析模組執行該群組分析預測程序。 An electronic device comprising: a recording module for recording a plurality of resource load records of the electronic device in a plurality of time periods; a receiving module receiving a predicted time point; and a time calculating module calculating the predicted time point With a current time a time difference, wherein the predicted time point is greater than the current time point on a time axis; a regression analysis module performs a regression analysis prediction process according to the resource load records; a group analysis module, according to the The resource load record performs a group analysis and prediction process; and a determination module determines whether the time difference is less than a threshold value, and if the time difference is determined to be less than the threshold value, the determining module notifies the regression analysis module to perform the regression analysis The prediction program; if the determination time difference is not less than the threshold, the determining module notifies the group analysis module to execute the group analysis prediction program. 如申請專利範圍第6項所述之電子裝置,其中該回歸分析模組針對所記錄的該些資源負載記錄執行一回歸分析演算法,以獲得一預測模型,藉以在該預測模型中取出該預測時間點所對應的一預測值,其中該些資源負載記錄為該記錄模組分別在該些時間週期所記錄。 The electronic device of claim 6, wherein the regression analysis module performs a regression analysis algorithm on the recorded resource load records to obtain a prediction model, wherein the prediction is taken out in the prediction model. A predicted value corresponding to the time point, wherein the resource load records are recorded by the recording module during the time periods respectively. 如申請專利範圍第6項所述之電子裝置,其中該群組分析模組更包括:一劃分模組,將每一該些時間週期劃分為多個時間區段,使得每一該些資源負載記錄劃分成多個資料片段;一預測模組,在該些時間區段中選擇該預測時間點對應的其中一預測時間區段;一分群模組,對該預測時間區段在該些時間週期內的該些資料片段進行一群集分析,以將該些資料片段分群成 多個群集;一選擇模組,自該些群集中,選取筆數最多的其中之一群集;以及一預測計算模組,計算該被選擇的群集所包括的該些資料片段的平均值,以作為該預測時間點的預測值。 The electronic device of claim 6, wherein the group analysis module further comprises: a dividing module, dividing each of the time periods into a plurality of time segments, so that each of the resource loads The recording is divided into a plurality of data segments; a prediction module selects one of the predicted time segments corresponding to the predicted time point in the time segments; a segmentation module, wherein the predicted time segment is in the time periods The data segments within the cluster are subjected to a cluster analysis to group the data segments into a plurality of clusters; a selection module from which one of the clusters having the largest number of clusters is selected; and a predictive computing module that calculates an average value of the pieces of data included in the selected cluster to As the predicted value of the predicted time point. 如申請專利範圍第8項所述之電子裝置,其中該分群模組計算每一該些時間區段內的各該資料片段之間的一相似度,並依據該相似度進行該群集分析。 The electronic device of claim 8, wherein the grouping module calculates a similarity between each of the pieces of data in each of the time segments, and performs the cluster analysis according to the similarity. 如申請專利範圍第6項所述之電子裝置,其中該記錄模組在每一該些時間週期中,依據一取樣速率取得多個資源使用量,其中每一該些資源負載記錄包括在每一該些時間週期中所獲得的該些資源使用量。 The electronic device of claim 6, wherein the recording module acquires a plurality of resource usages according to a sampling rate during each of the time periods, wherein each of the resource load records is included in each The amount of resource usage obtained during these time periods.
TW101142674A 2012-11-15 2012-11-15 Load prediction method and electronic device TWI492158B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101142674A TWI492158B (en) 2012-11-15 2012-11-15 Load prediction method and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101142674A TWI492158B (en) 2012-11-15 2012-11-15 Load prediction method and electronic device

Publications (2)

Publication Number Publication Date
TW201419161A true TW201419161A (en) 2014-05-16
TWI492158B TWI492158B (en) 2015-07-11

Family

ID=51294375

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101142674A TWI492158B (en) 2012-11-15 2012-11-15 Load prediction method and electronic device

Country Status (1)

Country Link
TW (1) TWI492158B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9961675B1 (en) 2017-05-25 2018-05-01 At&T Intellectual Property I, L.P. Multi-layer control plane automatic resource allocation system
US10509682B2 (en) 2017-05-24 2019-12-17 At&T Intellectual Property I, L.P. De-allocation elasticity application system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002041714A (en) * 2000-07-21 2002-02-08 Hitachi Ltd Power demand forecasting service method and system
JP5618501B2 (en) * 2009-07-14 2014-11-05 株式会社東芝 Demand prediction device, program and recording medium
JP5606114B2 (en) * 2010-03-19 2014-10-15 株式会社東芝 Power generation amount prediction device, prediction method, and prediction program

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10509682B2 (en) 2017-05-24 2019-12-17 At&T Intellectual Property I, L.P. De-allocation elasticity application system
US9961675B1 (en) 2017-05-25 2018-05-01 At&T Intellectual Property I, L.P. Multi-layer control plane automatic resource allocation system

Also Published As

Publication number Publication date
TWI492158B (en) 2015-07-11

Similar Documents

Publication Publication Date Title
US11113647B2 (en) Automatic demand-driven resource scaling for relational database-as-a-service
JP7195334B2 (en) Resource scheduling method and terminal device
US10579494B2 (en) Methods and systems for machine-learning-based resource prediction for resource allocation and anomaly detection
US8805764B1 (en) Battery drain analysis and prediction for wireless devices
US10521244B2 (en) Information handling system configuration parameter history management
CN109597685B (en) Task allocation method, device and server
EP4068090A1 (en) Container scheduling method and apparatus, and non-volatile computer-readable storage medium
US10817046B2 (en) Power saving through automated power scheduling of virtual machines
US20100318827A1 (en) Energy use profiling for workload transfer
CN103425564B (en) A kind of smartphone software uses Forecasting Methodology
CN110163417A (en) Traffic prediction method, device and equipment
US10423201B2 (en) Method and apparatus for demand estimation for energy management of client systems
CN116827950A (en) Cloud resource processing method, device, equipment and storage medium
US20140122403A1 (en) Loading prediction method and electronic device using the same
TWI492158B (en) Load prediction method and electronic device
Kim et al. Smartphone analysis and optimization based on user activity recognition
TWI547879B (en) Load prediction method and electronic device
CN116627342A (en) Method, device, equipment and medium for predicting remaining service life of solid-state hard disk
Hamzaoui et al. An experimental methodology for modeling the energy consumption of mobile devices
Draa et al. Machine learning for improving mobile user satisfaction
CN103795558A (en) Load prediction method and electronic device
CN119759544B (en) Resource scheduling method, device and computer equipment for power range simulation system
Quan et al. Towards self-adaptive mpsoc systems with adaptivity throttling
Xia et al. A heuristic adaptive threshold algorithm on IaaS clouds
CN120471378A (en) Method, device and computer equipment for predicting and identifying store meal data

Legal Events

Date Code Title Description
MM4A Annulment or lapse of patent due to non-payment of fees