TWI736194B - Method for dividing disk and computer device - Google Patents
Method for dividing disk and computer device Download PDFInfo
- Publication number
- TWI736194B TWI736194B TW109110263A TW109110263A TWI736194B TW I736194 B TWI736194 B TW I736194B TW 109110263 A TW109110263 A TW 109110263A TW 109110263 A TW109110263 A TW 109110263A TW I736194 B TWI736194 B TW I736194B
- Authority
- TW
- Taiwan
- Prior art keywords
- space
- partition
- weight
- operating system
- data
- Prior art date
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
本發明是有關於一種磁碟管理技術,且特別是有關於一種分割磁碟的方法及電腦裝置。The present invention relates to a disk management technology, and particularly relates to a method and a computer device for dividing a disk.
一般而言,在安裝電腦裝置中的作業系統時,對於是否應在磁碟中切割資料分割區、記憶體延伸空間(例如Linux/Unix中的swap分割區(swap partition)、swap檔案(swap file)或Windows中的Pagefile),以及欲對上述分割區/延伸空間分配多少尺寸,都是由使用者自行決定。然而,由於上述決定基準過度受限於使用者的主觀認知,導致在完成作業系統的安裝後,可造成諸多問題發生,例如系統效能變慢、磁碟空間不夠用,或是在系統還原/重安裝之後無法保有原有重要文件等。Generally speaking, when installing the operating system in a computer device, whether the data partition, memory extension space (such as swap partition in Linux/Unix), swap file (swap file) should be cut on the disk ) Or Pagefile in Windows), as well as the size of the partition/extended space to be allocated, are all determined by the user. However, because the above decision criteria are excessively limited by the user’s subjective cognition, many problems may occur after the installation of the operating system is completed, such as slowing down of system performance, insufficient disk space, or restoring/resetting the system. The original important files etc. cannot be kept after installation.
有鑑於此,本發明提供一種分割磁碟的方法及電腦裝置,其可用於解決上述技術問題。In view of this, the present invention provides a method for dividing a magnetic disk and a computer device, which can be used to solve the above-mentioned technical problems.
本發明提供一種分割磁碟的方法,適於包括一磁碟的一電腦裝置,包括:監控磁碟的至少一磁碟分割區與至少一外部儲存體之間的多個第一互動行為,其中至少一磁碟分割區包括一作業系統分割區;依據前述第一互動行為調整作業系統分割區的一第一分割權重;以及在電腦裝置的一重安裝作業中,依據第一分割權重在磁碟的一可分配空間中切割一第一空間以作為作業系統分割區。The present invention provides a method for dividing a magnetic disk, suitable for a computer device including a magnetic disk, including: monitoring a plurality of first interaction behaviors between at least one disk partition of the magnetic disk and at least one external storage body, wherein At least one disk partition includes an operating system partition; adjusting a first partition weight of the operating system partition according to the aforementioned first interactive behavior; A first space is cut into an allocatable space to be used as an operating system partition.
本發明提供一種電腦裝置,包括磁碟及處理器。處理器耦接磁碟,並經配置以執行下列步驟:監控磁碟的至少一磁碟分割區與至少一外部儲存體之間的多個第一互動行為,其中至少一磁碟分割區包括一作業系統分割區;依據前述第一互動行為調整作業系統分割區的一第一分割權重;以及在電腦裝置的一重安裝作業中,依據第一分割權重在磁碟的一可分配空間中切割一第一空間以作為作業系統分割區。The invention provides a computer device including a magnetic disk and a processor. The processor is coupled to the disk and is configured to perform the following steps: monitoring a plurality of first interaction behaviors between at least one partition of the disk and at least one external storage, wherein at least one partition includes a Operating system partition; adjust a first partition weight of the operating system partition according to the aforementioned first interactive behavior; One space is used as a partition of the operating system.
基於上述,本發明可讓磁碟在重安裝作業時被更適當地分割為一或多個磁碟區。Based on the above, the present invention can allow the disk to be more appropriately divided into one or more volumes during the reinstallation operation.
請參照圖1,其是依據本發明之一實施例繪示的電腦裝置示意圖。在不同的實施例中,電腦裝置100例如是筆記型電腦、個人電腦、工作站、伺服器或其他類似的裝置,但可不限於此。如圖1所示,電腦裝置100包括磁碟102、處理器104及隨機存取記憶體106。在本發明的實施例中,磁碟102可包括一或多個磁碟分割區。舉例而言,在第一實施例中,磁碟102可僅包括作業系統分割區,而未有資料分割區,其中所述作業系統分割區即為用於安裝作業系統的分割區,例如常見於個人電腦中的C槽,而所述資料分割區即為未安裝有作業系統的分割區。在第二實施例中,磁碟102可包括作業系統分割區及資料分割區等磁碟分割區,但可不限於此。Please refer to FIG. 1, which is a schematic diagram of a computer device according to an embodiment of the present invention. In different embodiments, the
處理器104耦接於硬碟102及隨機存取記憶體106,並可為一般用途處理器、特殊用途處理器、傳統的處理器、數位訊號處理器、多個微處理器(microprocessor)、一個或多個結合數位訊號處理器核心的微處理器、控制器、微控制器、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式閘陣列電路(Field Programmable Gate Array,FPGA)、任何其他種類的積體電路、狀態機、基於進階精簡指令集機器(Advanced RISC Machine,ARM)的處理器以及類似品。The
在本發明的實施例中,處理器104可經配置以實現本發明提出的分割磁碟的方法。In an embodiment of the present invention, the
請參照圖2,其是依據本發明第一實施例繪示的分割磁碟方法流程圖。本實施例的方法可由圖1的電腦裝置100執行,以下即搭配圖1所示的元件說明圖2各步驟的細節。Please refer to FIG. 2, which is a flowchart of a method for dividing a disk according to the first embodiment of the present invention. The method of this embodiment can be executed by the
概略而言,在第一實施例中,假設磁碟102中僅有作業系統分割區,而未有資料分割區。在此情況下,處理器104可基於作業系統分割區的相關資料傳輸行為而得知作業系統分割區的尺寸是否有過大或過小的情形,並可在下一次電腦裝置100進行重安裝作業時相應地調整作業系統分割區的尺寸,從而令磁碟102的空間分配更為合理。Generally speaking, in the first embodiment, it is assumed that the
具體而言,在步驟S210中,處理器104可監控磁碟102的磁碟分割區(即,作業系統分割區)與外部儲存體之間的多個第一互動行為。在不同的實施例中,上述外部儲存體可以是一或多個雲端硬碟、隨身碟、外接式硬碟或其他類似的儲存位置,但可不限於此。Specifically, in step S210, the
此外,在本發明中所考慮的第一互動行為大致可包括(但不限於)以下三種:(1)資料發送行為:由磁碟分割區發送資料至外部儲存體的行為;(2)資料接收行為:由磁碟分割區接收來自外部儲存體的資料的行為;(3)外部程式執行行為:在外部儲存體上執行程式的行為。In addition, the first interactive behavior considered in the present invention can roughly include (but is not limited to) the following three types: (1) Data sending behavior: the behavior of sending data from a disk partition to external storage; (2) Data receiving Behavior: the behavior of receiving data from external storage from the disk partition; (3) External program execution behavior: the behavior of executing the program on the external storage.
在第一實施例中,處理器104可監控作業系統分割區與外部儲存體之間的資料發送行為、資料接收行為及外部程式執行行為。例如,處理器104可監控並記錄從作業系統分割區發送至外部儲存體的資料量、作業系統分割區從外部儲存體接收的資料量,以及電腦裝置100在外部儲存體上執行程式的執行次數等,但不限於此。In the first embodiment, the
接著,在步驟S220中,處理器104可依據前述第一互動行為調整作業系統分割區的第一分割權重。在第一實施例中,由於磁碟102係假設為僅具有作業系統分割區,故作業系統分割區對應的第一分割權重的初始值可假設為1,但可不限於此。Then, in step S220, the
在一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料接收行為時,處理器104可相應地增加上述第一分割權重。並且,處理器104增加第一分割權重的增加幅度可正相關於對應於資料接收行為的接收資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料接收行為,處理器104可依據此資料接收行為對應的接收資料量增加上述第一分割權重,且接收資料量越大,第一分割權重被增加的越多。In an embodiment, whenever the
在另一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料發送行為及外部程式執行行為時,處理器104可相應地降低上述第一分割權重。並且,處理器104降低第一分割權重的降低幅度可正相關於對應於資料發送行為的發送資料量以及外部程式執行行為的執行次數。亦即,若處理器104偵測到對應於作業系統分割區的資料發送行為,處理器104可依據此資料發送行為對應的發送資料量降低上述第一分割權重,且發送資料量越大,第一分割權重被降低的越多。另外,若處理器104偵測到電腦裝置100於外部儲存體上執行程式,處理器104可依據此程式在外部儲存體上的執行次數降低上述第一分割權重,且執行次數越多,第一分割權重被降低的越多。In another embodiment, whenever the
在第一實施例中,處理器104可基於一強化學習機制實現步驟S230的技術手段。舉例而言,上述強化學習模型可包括一狀態控制器(status controller)、一觀察代理程式(observation agent)及一強化學習模型,其中狀態控制器可用於偵測是否出現上述第一互動行為。In the first embodiment, the
在第一實施例中,每當狀態控制器偵測到上述第一互動行為之一時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰(punishment)信號,以相應地重新訓練所述強化學習模型增加/降低第一分割權重。另一方面,若狀態控制器未偵測到任何第一互動行為,可相應地通知觀察代理程式,以由觀察代理程式維持第一分割權重,但可不限於此。In the first embodiment, each time the state controller detects one of the above-mentioned first interaction behaviors, it can notify the observation agent accordingly, so that the observation agent sends a punishment signal to the reinforcement learning model to respond accordingly Retraining the reinforcement learning model increases/decreases the first segmentation weight. On the other hand, if the state controller does not detect any first interaction behavior, it can notify the observing agent accordingly, so that the observing agent maintains the first division weight, but it is not limited to this.
概略而言,上述第一分割權重有關於下一次電腦裝置100在進行重安裝作業時,應從磁碟102中切割多少空間作為作業系統分割區。應了解的是,為了讓作業系統分割區至少能足以安裝作業系統,上述強化學習模型可經設定有關聯於作業系統分割區的一第一偏權值(bias value),其中此第一偏權值可保證在每次重安裝作業時,作業系統分割區都至少具有第一偏權值所定義的尺寸。舉例而言,假設第一偏權值為10GB,則在每次重安裝作業時,作業系統分割區都將至少具有10GB的空間,但可不限於此。Roughly speaking, the above-mentioned first partition weight relates to how much space should be cut from the
之後,在步驟S230中,在電腦裝置100的重安裝作業中,處理器104可依據第一分割權重在磁碟102的可分配空間中切割第一空間以作為作業系統分割區。上述可分配空間例如是在磁碟102中排除用於儲存作業系統相關組態檔的保留空間後的空間,但可不限於此。舉例而言,在第一實施例中,若第一分割權重為0.4,則處理器104可切割上述可分配空間中的40%(即,第一空間)作為作業系統分割區。舉另一例而言,若第一分割權重為0.6,則處理器104可切割上述可分配空間中的60%(即,第一空間)作為作業系統分割區,但可不限於此。After that, in step S230, during the reinstallation operation of the
此外,由先前所提及的第一偏權值可知,上述第一空間應具有對應於第一偏權值的第一空間尺寸下限值(例如10GB),但可不限於此。In addition, it can be known from the aforementioned first partial weight that the first space should have a first space size lower limit (for example, 10 GB) corresponding to the first partial weight, but it may not be limited to this.
另外,在第一實施例中,在電腦裝置100的重安裝作業中,處理器104還可將上述可分配空間中的剩餘空間作為資料分割區。例如,若處理器104切割上述可分配空間中的40%作為第一空間,則處理器104可將上述可分配空間中剩餘的60%空間作為資料分割區,但可不限於此。In addition, in the first embodiment, during the reinstallation operation of the
藉此,在電腦裝置100完成上述重安裝作業之後,可讓磁碟102即具有更適配於相關資料傳輸行為的分割方式,從而避免出現系統效能變慢、磁碟空間不夠用等情形。In this way, after the
此外,在一些實施例中,電腦裝置100的磁碟102可能在製造完成時即經分割有作業系統分割區及資料分割區等磁碟分割區。在此情況下,本發明可基於各磁碟分割區與外部儲存體的資料傳輸行為以及磁碟分割區彼此之間的資料傳輸行為來調整作業系統分割區的第一分割權重及資料分割區的第二分割權重,並在電腦裝置100執行下一次重安裝作業時據以分割磁碟102。以下將輔以第二實施例作進一步說明。在第二實施例中,作業系統分割區的第一分割權重及資料分割區的第二分割權重個別的初始值可依據出廠時的設定而定。例如,若硬碟102的可分配空間在出廠時被設定為作業系統分割區及資料分割區各佔50%,則作業系統分割區的第一分割權重及資料分割區的第二分割權重個別的初始值可相應地設定為0.5,但可不限於此。In addition, in some embodiments, the
請參照圖3,其是依據本發明第二實施例繪示的分割磁碟方法流程圖。本實施例的方法可由圖1的電腦裝置100執行,以下即搭配圖1所示的元件說明圖3各步驟的細節。Please refer to FIG. 3, which is a flowchart of a method for dividing a disk according to a second embodiment of the present invention. The method of this embodiment can be executed by the
首先,在步驟S310中,處理器104可監控磁碟102的磁碟分割區與外部儲存體之間的多個第一互動行為。在第二實施例中,由於磁碟102係假設具有作業系統分割區及資料分割區等磁碟分割區,故處理器104可監控作業系統分割區與外部儲存體之間的第一互動行為,以及監控資料分割區與外部儲存體之間的第一互動行為。First, in step S310, the
舉例而言,處理器104可監控並記錄從作業系統分割區發送至外部儲存體的資料量(即,資料發送行為)、作業系統分割區從外部儲存體接收的資料量(即,資料接收行為)等第一互動行為,但不限於此。相似地,處理器104可監控並記錄從資料分割區發送至外部儲存體的資料量(即,資料發送行為)、資料分割區從外部儲存體接收的資料量(即,資料接收行為)等第一互動行為,但不限於此。For example, the
之後,在步驟S320中,處理器104可監控作業系統分割區與資料分割區之間的多個第二互動行為。在第二實施例中,上述第二互動行為包括(但不限於)以下兩種態樣:(1)第一資料傳輸行為:由作業系統分割區發送資料至資料分割區的行為;(2)第二資料傳輸行為:由作業系統分割區接收來自資料分割區的資料的行為。例如,處理器104可監控並記錄從作業系統分割區發送至資料分割區的資料量,以及作業系統分割區從資料分割區接收的資料量,但不限於此。After that, in step S320, the
接著,在步驟S330中,處理器104可依據前述第一互動行為及第二互動行為調整作業系統分割區的第一分割權重。Then, in step S330, the
在一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料接收行為或第二資料傳輸行為時,處理器104可相應地增加上述第一分割權重。並且,處理器104增加第一分割權重的增加幅度可正相關於對應於資料接收行為及第二資料傳輸行為的接收資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料接收行為或第二資料傳輸行為,處理器104可依據此資料接收行為或第二資料傳輸行為對應的接收資料量增加上述第一分割權重,且接收資料量越大,第一分割權重被增加的越多。In an embodiment, whenever the
在另一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料發送行為或第一資料傳輸行為時,處理器104可相應地降低上述第一分割權重。並且,處理器104降低第一分割權重的降低幅度可正相關於對應於資料發送行為或第一資料傳輸行為的發送資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料發送行為或第一資料傳輸行為,處理器104可依據此資料發送行為或第一資料傳輸行為對應的發送資料量降低上述第一分割權重,且發送資料量越大,第一分割權重被降低的越多。In another embodiment, whenever the
另外,在步驟S340中,處理器104可依據前述第一互動行為及第二互動行為調整資料分割區的第二分割權重。In addition, in step S340, the
在一實施例中,每當處理器104偵測到出現對應於資料分割區的資料接收行為或第一資料傳輸行為時,處理器104可相應地增加上述第二分割權重。並且,處理器104增加第二分割權重的增加幅度可正相關於對應於資料接收行為及第一資料傳輸行為的接收資料量。亦即,若處理器104偵測到對應於資料分割區的資料接收行為或第一資料傳輸行為,處理器104可依據此資料接收行為或第一資料傳輸行為對應的接收資料量增加上述第二分割權重,且接收資料量越大,第二分割權重被增加的越多。In one embodiment, whenever the
在另一實施例中,每當處理器104偵測到出現對應於資料分割區的資料發送行為或第二資料傳輸行為時,處理器104可相應地降低上述第二分割權重。並且,處理器104降低第二分割權重的降低幅度可正相關於對應於資料發送行為或第二資料傳輸行為的發送資料量。亦即,若處理器104偵測到對應於資料分割區的資料發送行為或第二資料傳輸行為,處理器104可依據此資料發送行為或第二資料傳輸行為對應的發送資料量降低上述第二分割權重,且發送資料量越大,第二分割權重被降低的越多。In another embodiment, whenever the
在第二實施例中,處理器104可基於強化學習機制實現步驟S330、S340的技術手段。舉例而言,上述強化學習模型可包括狀態控制器、觀察代理程式及強化學習模型,其中狀態控制器可用於偵測是否出現上述第一/第二互動行為。In the second embodiment, the
在第二實施例中,每當狀態控制器偵測到上述第一/第二互動行為之一時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰信號,以相應地重新訓練所述強化學習模型增加/降低第一/第二分割權重。另一方面,若狀態控制器未偵測到任何第一/第二互動行為,可相應地通知觀察代理程式,以由觀察代理程式維持第一/第二分割權重,但可不限於此。此外,第二實施例中的強化學習模型亦可設定有關聯於作業系統分割區的第一偏權值,以保證在每次重安裝作業時,作業系統分割區都至少具有第一偏權值所定義的尺寸,但可不限於此。In the second embodiment, each time the state controller detects one of the first/second interaction behaviors, it can notify the observation agent accordingly, so that the observation agent sends a penalty signal to the reinforcement learning model to respond accordingly Retraining the reinforcement learning model increases/decreases the first/second segmentation weight. On the other hand, if the state controller does not detect any first/second interaction behavior, it can notify the observing agent accordingly, so that the observing agent maintains the first/second split weight, but it is not limited to this. In addition, the reinforcement learning model in the second embodiment can also be set with a first partial weight associated with the operating system partition to ensure that the operating system partition has at least the first partial weight during each reinstallation operation. The size is defined, but not limited to this.
之後,在步驟S350中,在電腦裝置的重安裝作業中,處理器104可依據第一分割權重在磁碟102的可分配空間中切割第一空間以作為作業系統分割區,並依據第二分割權重在磁碟的可分配空間中切割第二空間以作為資料分割區。After that, in step S350, during the reinstallation operation of the computer device, the
舉例而言,假設第一、第二分割權重分別為0.4及0.6,則處理器104可在重安裝作業中將上述可分配空間中的40%空間作為作業系統分割區,並將上述可分配空間中剩餘的60%空間作為資料分割區,但可不限於此。For example, assuming that the first and second partition weights are 0.4 and 0.6, respectively, the
此外,在第二實施例中,由於第一/第二分割權重可隨著作業系統分割區及資料分割區的相關第一/第二互動行為而依據第二實施例中的相關教示(例如步驟S330、S340)而不斷更新,使得上述預設模型相應地被不斷優化,但可不限於此。In addition, in the second embodiment, since the first/second partition weights can follow the related first/second interaction behaviors of the copyright system partition and the data partition according to the relevant teachings in the second embodiment (for example, step S330, S340) and continuously update, so that the above-mentioned preset model is continuously optimized accordingly, but it is not limited to this.
藉此,在電腦裝置100完成上述重安裝作業之後,可讓磁碟102即具有更適配於相關資料傳輸行為的分割方式,從而避免出現系統效能變慢、磁碟空間不夠用等情形。In this way, after the
在一些實施例中,作業系統分割區中可經配置有關聯於隨機存取記憶體106的記憶體延伸空間(例如Linux/Unix中的swap分割區、swap檔案或Windows中的Pagefile)及自由空間(即可用於儲存其他資料的空間),而處理器104可基於以下記載的機制而在電腦裝置100執行重安裝作業時調整作業系統分割區被分割為記憶體延伸空間及自由空間的方式。以下將以第三實施例進行說明。In some embodiments, the operating system partition may be configured with memory extension space associated with the random access memory 106 (for example, swap partition in Linux/Unix, swap file, or Pagefile in Windows) and free space (That is, the space used to store other data), and the
在第三實施例中,處理器104可經配置以執行第一實施例中的步驟S210~S230,或是第二實施例中的步驟S310~S350。然而,在第三實施例中,在處理器104執行第一實施例的步驟S230之前,或是執行第二實施例的步驟S350之前,處理器104可判斷隨機存取記憶體106是否出現記憶體不足(out of memory)情形,以及判斷自由空間是否出現耗盡情形(例如剩餘空間小於5%)。若出現記憶體不足情形,此即代表記憶體延伸空間可能太小,則處理器104可增加對應於記憶體延伸空間的第一空間權重及第二空間尺寸下限值,並降低對應於自由空間的第二空間權重,反之則可不更動上述權重/數值,但不限於此。In the third embodiment, the
此外,若出現自由空間耗盡情形,此即代表記憶體延伸空間可能太大,則處理器104可降低對應於記憶體延伸空間的第一空間權重及第二空間尺寸下限值,並增加對應於自由空間的第二空間權重,反之則可不更動上述權重/數值,但不限於此。In addition, if the free space is exhausted, it means that the memory extension space may be too large, and the
在第三實施例中,上述第二空間尺寸下限值可理解為對應於記憶體延伸空間的第二偏權值,即為讓記憶體延伸空間能夠發揮作用的最小尺寸。In the third embodiment, the above-mentioned lower limit of the second space size can be understood as a second partial weight corresponding to the extended space of the memory, that is, the minimum size for the extended space of the memory to function.
在第三實施例中,處理器104可基於另一強化學習機制實現上述調整第一/第二空間權重及第二空間尺寸下限值的技術手段。舉例而言,上述強化學習模型可包括狀態控制器、觀察代理程式及強化學習模型,其中狀態控制器可用於偵測是否出現上述記憶體不足情形及自由空間耗盡情形。In the third embodiment, the
在第三實施例中,每當狀態控制器偵測到上述記憶體不足情形及/或自由空間耗盡情形時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰信號,以相應地重新訓練所述強化學習模型增加/降低第一、第二空間權重及第二空間尺寸下限值。另一方面,若狀態控制器未偵測到任何記憶體不足情形及/或自由空間耗盡情形,可相應地通知觀察代理程式,以由觀察代理程式維持第一、第二空間權重及第二空間尺寸下限值,但可不限於此。In the third embodiment, whenever the state controller detects the aforementioned memory shortage and/or free space exhaustion, it can notify the observation agent accordingly, so that the observation agent sends a penalty signal to the reinforcement learning model , To retrain the reinforcement learning model accordingly to increase/decrease the first and second space weights and the lower limit of the second space size. On the other hand, if the state controller does not detect any memory shortage and/or free space exhaustion, it can notify the observing agent accordingly, so that the observing agent maintains the first and second space weights and the second The lower limit of the space size, but not limited to this.
概略而言,上述第一空間權重有關於下一次電腦裝置100在進行重安裝作業時,應從作業系統分割區中切割多少空間作為記憶體延伸空間,而上述第二空間權重係有關於下一次電腦裝置100在進行重安裝作業時,應從作業系統分割區中切割多少空間作為自由空間,但可不限於此。應了解的是,為了讓記憶體延伸空間能夠發揮作用,上述強化學習模型可經設定有關聯於記憶體延伸空間的上述第二偏權值(即第二空間尺寸下限值),其中此第二偏權值可保證在每次重安裝作業時,記憶體延伸空間都至少具有第二偏權值所定義的尺寸。Roughly speaking, the above-mentioned first space weight relates to how much space should be cut from the operating system partition as the memory extension space during the next reinstallation operation of the
在處理器104經上述教示調整第一、第二空間權重及第二空間尺寸下限值之後,處理器104可在電腦裝置100下次進行重安裝時相應地調整分割作業系統分割區的方式。舉例而言,在處理器104於重安裝作業中將磁碟102分割為作業系統分割區及資料分割區之後,處理器104可再依據第一空間權重在作業系統分割區中切割第三空間作為記憶體延伸空間,並依據第二空間權重在作業系統分割區中切割第四空間作為自由空間。After the
舉例而言,假設第一、第二空間權重分別為0.1及0.9,則處理器104可在重安裝作業中將作業系統分割區中的10%空間作為記憶體延伸空間,並將作業系統分割區中剩餘的90%空間作為自由空間,但可不限於此。For example, assuming that the first and second space weights are 0.1 and 0.9, respectively, the
在一些實施例中,處理器104可判斷第一空間權重及第二空間權重的調整間隔是否低於第一門限值,或是第二空間尺寸下限值低於第二門限值。詳細而言,若第一空間權重及/或第二空間權重過於頻繁地被調整,或是第二空間尺寸下限值被調整地過小,即代表電腦裝置100時常出現記憶體不足情形及/或自由空間耗盡情形,而此意味著電腦裝置100本身的運作可能出現問題(例如作業系統檔案毀損、內部功能出狀況等)。在此情況下,處理器104可提供重新安裝建議訊息,以建議使用者藉由重新安裝電腦裝置100的作業系統來修正電腦裝置100本身的運作問題。In some embodiments, the
在不同的實施例中,上述第一門限值可由設計者依需求而定。例如,若第一門限值經設定為3天,則處理器104可判斷第一/第二空間權重的兩次調整之間的時間間隔是否低於3天,但可不限於此。另外,上述第二門限值亦可由設計者依需求而定為任意值,例如趨近於0的值,但可不限於此。In different embodiments, the above-mentioned first threshold may be determined by the designer according to requirements. For example, if the first threshold is set to 3 days, the
在第三實施例中,電腦裝置100在出廠時可預安裝有用於決定上述記憶體延伸空間的預設模型,而以上揭示的調整第一空間權重的手段可藉由調整此預設模型來進行。In the third embodiment, the
在一實施例中,上述預設模型可由一伺服器產生。具體而言,上述伺服器可從多台電腦裝置個別收集隨機存取記憶體的總尺寸及作業系統分割區中自由空間的尺寸。之後,伺服器可將所收集到的資訊饋入一神經網路,以將此神經網路訓練為上述預設模型。舉例而言,上述神經網路例如是一卷積神經網路,而其進行卷積運算的維度例如是NxC,其中N為所述多台電腦裝置的總數,而C為上述自由空間的尺寸,但可不限於此。在將上述神經網路訓練為預設模型之後,相關人員可在電腦裝置100出廠時將此預設模型安裝至電腦裝置100,以決定第一空間權重及第二空間權重的初始值。之後,處理器104可再依據先前的教示而調整第一空間權重及第二空間權重,但可不限於此。In one embodiment, the aforementioned predetermined model can be generated by a server. Specifically, the aforementioned server can separately collect the total size of the random access memory and the size of the free space in the partition of the operating system from multiple computer devices. After that, the server can feed the collected information into a neural network to train the neural network as the aforementioned preset model. For example, the aforementioned neural network is, for example, a convolutional neural network, and the dimension of its convolution operation is, for example, NxC, where N is the total number of the multiple computer devices, and C is the size of the aforementioned free space. But it is not limited to this. After training the aforementioned neural network as a preset model, relevant personnel can install the preset model to the
此外,在一些實施例中,由於不同作業系統對應的記憶體延伸空間有所不同,故處理器104在電腦裝置100的重安裝作業中設定記憶體延伸空間的尺寸的方式亦有所不同,以下將以第四實施例作說明。In addition, in some embodiments, since the memory extension space corresponding to different operating systems is different, the way the
請參照圖4,其是依據本發明第四實施例繪示的設定記憶體延伸空間尺寸的流程圖。本實施例的方法可由圖1的電腦裝置100執行,以下即搭配圖1所示的元件說明圖4各步驟的細節。Please refer to FIG. 4, which is a flow chart of setting the size of the extended space of the memory according to the fourth embodiment of the present invention. The method of this embodiment can be executed by the
首先,在步驟S410中,處理器104可判斷判斷是否可在電腦裝置100中取得對應於第一類延伸空間的全域唯一識別碼(Globally Unique Identifier,GUID)。在第四實施例中,上述第一類延伸空間例如是swap分割區,而若處理器104可在電腦裝置100中找到上述GUID,即代表電腦裝置100的作業系統屬於Linux/Unix,且電腦裝置100中本身即設置有swap分割區。First, in step S410, the
因此,在判定可在電腦裝置100中取得上述GUID之後,處理器104可接續執行步驟S420,以判定記憶體延伸空間屬於第一類延伸空間,並依據第一空間權重在作業系統分割區中切割第三空間作為第一類延伸空間。Therefore, after determining that the aforementioned GUID can be obtained in the
另一方面,若無法在電腦裝置100中取得上述GUID,則處理器104可接續執行步驟S430,以判斷是否可在電腦裝置100中找到第二類延伸空間。在第四實施例中,上述第二類延伸空間例如是swap檔案。On the other hand, if the aforementioned GUID cannot be obtained in the
在一實施例中,若處理器104判定可在電腦裝置100中找到第二類延伸空間,則可接續執行步驟S440,以判定記憶體延伸空間屬於第二類延伸空間,並依據第一空間權重在作業系統分割區中切割第三空間作為第二類延伸空間。In one embodiment, if the
另一方面,若處理器104判定無法在電腦裝置100找到上述GUID及上述第二類延伸空間,此即代表電腦裝置100的作業系統為Windows,故處理器104可接續執行步驟S450以判定記憶體延伸空間屬於第三類延伸空間(例如Windows中的Pagefile),並依據第一空間權重在作業系統分割區中切割第三空間作為第三類延伸空間。On the other hand, if the
此外,在不同的實施例中,本發明所提及的重安裝作業可泛指各式還原作業系統的操作,但可不限於此。In addition, in different embodiments, the reinstallation operation mentioned in the present invention can generally refer to various restoration operating system operations, but it may not be limited thereto.
綜上所述,本發明的方法及電腦裝置可依據磁碟中各磁碟分割區與外部儲存體之間的第一互動行為(例如接收資料、發送資料及在外部儲存體上執行程式等),以及磁碟分割區彼此之間的第二互動行為(例如接收資料、發送資料等)來調整各磁碟分割區對應的分割權重,從而讓電腦裝置在之後進行重安裝作業時能夠據以更適當地決定各磁碟分割區的尺寸。藉此,可讓各磁碟分割區的尺寸能夠更貼近使用者的使用行為、習慣,進而降低出現系統效能低落的機率。In summary, the method and computer device of the present invention can be based on the first interaction between each disk partition in the disk and the external storage (such as receiving data, sending data, and executing programs on the external storage, etc.) , And the second interaction between the disk partitions (such as receiving data, sending data, etc.) to adjust the partition weight corresponding to each disk partition, so that the computer device can be updated according to the subsequent reinstallation operations. Appropriately determine the size of each disk partition. In this way, the size of each disk partition can be closer to the user's usage behavior and habits, thereby reducing the probability of system performance degradation.
此外,本發明還可基於記憶體不足情形及/或自由空間耗盡情形調整作業系統分割區中記憶體延伸空間的第一空間權重及自由空間的第二空間權重。藉此,可讓作業系統分割區中記憶體延伸空間及自由空間的尺寸更貼近於使用者的使用行為、習慣,進而降低出現記憶體不足情形及/或自由空間耗盡情形的機率。In addition, the present invention can also adjust the first space weight of the memory extension space and the second space weight of the free space in the operating system partition based on the memory shortage situation and/or the free space exhaustion situation. In this way, the size of the extended memory space and free space in the operating system partition can be closer to the user's usage behavior and habits, thereby reducing the probability of insufficient memory and/or exhaustion of free space.
另外,針對不同作業系統中的記憶體延伸空間,本發明的方法亦可廣泛地用於設定不同作業系統中的記憶體延伸空間的尺寸,從而可擴大電腦裝置適合的客群/市場,例如家用、商用、電競玩家、設計者等。In addition, for the memory extension space in different operating systems, the method of the present invention can also be widely used to set the size of the memory extension space in different operating systems, so as to expand the suitable customer groups/markets for computer devices, such as home appliances. , Commercial, e-sports players, designers, etc.
雖然本發明已以實施例揭露如上,然其並非用以限定本發明,任何所屬技術領域中具有通常知識者,在不脫離本發明的精神和範圍內,當可作些許的更動與潤飾,故本發明的保護範圍當視後附的申請專利範圍所界定者為準。Although the present invention has been disclosed in the above embodiments, it is not intended to limit the present invention. Anyone with ordinary knowledge in the relevant technical field can make some changes and modifications without departing from the spirit and scope of the present invention. The protection scope of the present invention shall be subject to those defined by the attached patent application scope.
100:電腦裝置 102:磁碟 104:處理器 106:隨機存取記憶體 S210~S230, S310~S350, S410~S450:步驟 100: computer device 102: Disk 104: processor 106: random access memory S210~S230, S310~S350, S410~S450: steps
圖1是依據本發明之一實施例繪示的電腦裝置示意圖。 圖2是依據本發明第一實施例繪示的分割磁碟方法流程圖。 圖3是依據本發明第二實施例繪示的分割磁碟方法流程圖。 圖4是依據本發明第四實施例繪示的設定記憶體延伸空間尺寸的流程圖。 FIG. 1 is a schematic diagram of a computer device according to an embodiment of the present invention. FIG. 2 is a flowchart of a method for dividing a disk according to the first embodiment of the present invention. FIG. 3 is a flowchart of a method for dividing a disk according to a second embodiment of the present invention. FIG. 4 is a flowchart of setting the size of the extended space of the memory according to the fourth embodiment of the present invention.
S210~S230:步驟 S210~S230: steps
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109110263A TWI736194B (en) | 2020-03-26 | 2020-03-26 | Method for dividing disk and computer device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
TW109110263A TWI736194B (en) | 2020-03-26 | 2020-03-26 | Method for dividing disk and computer device |
Publications (2)
Publication Number | Publication Date |
---|---|
TWI736194B true TWI736194B (en) | 2021-08-11 |
TW202137198A TW202137198A (en) | 2021-10-01 |
Family
ID=78283193
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
TW109110263A TWI736194B (en) | 2020-03-26 | 2020-03-26 | Method for dividing disk and computer device |
Country Status (1)
Country | Link |
---|---|
TW (1) | TWI736194B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8171201B1 (en) * | 2008-10-07 | 2012-05-01 | Vizioncore, Inc. | Systems and methods for improving virtual machine performance |
US20130152047A1 (en) * | 2011-11-22 | 2013-06-13 | Solano Labs, Inc | System for distributed software quality improvement |
CN106663224A (en) * | 2014-06-30 | 2017-05-10 | 亚马逊科技公司 | Interactive interfaces for machine learning model evaluations |
TW201802709A (en) * | 2016-07-04 | 2018-01-16 | 姆西格瑪商業解決私人有限公司 | Guided analytics system and method |
-
2020
- 2020-03-26 TW TW109110263A patent/TWI736194B/en active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8171201B1 (en) * | 2008-10-07 | 2012-05-01 | Vizioncore, Inc. | Systems and methods for improving virtual machine performance |
US20130152047A1 (en) * | 2011-11-22 | 2013-06-13 | Solano Labs, Inc | System for distributed software quality improvement |
CN106663224A (en) * | 2014-06-30 | 2017-05-10 | 亚马逊科技公司 | Interactive interfaces for machine learning model evaluations |
TW201802709A (en) * | 2016-07-04 | 2018-01-16 | 姆西格瑪商業解決私人有限公司 | Guided analytics system and method |
Also Published As
Publication number | Publication date |
---|---|
TW202137198A (en) | 2021-10-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3367251B1 (en) | Storage system and solid state hard disk | |
EP2798499B1 (en) | Methods and apparatus to manage workload memory allocation | |
CN101131675B (en) | Apparatus and method for preventing write starvation in a partitioned cache of a storage controller | |
US20160216960A1 (en) | Managing update deployment | |
US9792142B2 (en) | Information processing device and resource allocation method | |
US8639818B1 (en) | System and method for reliable and timely task completion in a distributed computing environment | |
US10795587B2 (en) | Storage system and cluster configuration control method | |
CN107562383B (en) | Information processing method, storage device, and storage medium | |
WO2021174382A1 (en) | Message pulling method and device, and computer storage medium | |
CN110737924B (en) | Data protection method and equipment | |
US20120124295A1 (en) | Methods and structure for determining cache size in a storage system | |
CN105190574A (en) | Providing local cache coherency in a shared storage environment | |
US11797355B2 (en) | Resolving cluster computing task interference | |
CN111418187A (en) | Scalable statistics and analysis mechanism in cloud networks | |
CN115454322A (en) | Workload management using trained models | |
US10127083B2 (en) | System and method for managing workload performance on billed computer systems | |
US10282245B1 (en) | Root cause detection and monitoring for storage systems | |
TWI736194B (en) | Method for dividing disk and computer device | |
CN116089477B (en) | Distributed training method and system | |
US10223189B1 (en) | Root cause detection and monitoring for storage systems | |
US11093266B2 (en) | Using a generative model to facilitate simulation of potential policies for an infrastructure as a service system | |
WO2020057369A1 (en) | Query plan acquisition method, and data query method and apparatus | |
US11621882B1 (en) | Automated remedial actions for service level objective thresholds | |
US11650855B2 (en) | Cloud computing-based simulation apparatus and method for operating the same | |
CN113852515A (en) | Node state control method and system of digital twin network |