TWI736194B - Method for dividing disk and computer device - Google Patents

Method for dividing disk and computer device Download PDF

Info

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
Application number
TW109110263A
Other languages
Chinese (zh)
Other versions
TW202137198A (en
Inventor
陳冠儒
Original Assignee
宏碁股份有限公司
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 宏碁股份有限公司 filed Critical 宏碁股份有限公司
Priority to TW109110263A priority Critical patent/TWI736194B/en
Application granted granted Critical
Publication of TWI736194B publication Critical patent/TWI736194B/en
Publication of TW202137198A publication Critical patent/TW202137198A/en

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a method for dividing a disk and a computer device. The method includes monitoring a plurality of first interaction behaviors between an operating system partition of the disk in the computer device and an external storage medium; adjusting a first partition weight of the operating system partition according to the first interactive behaviors; and in a reinstallation operation of the computer device, defining a first space in an allocable space of the disk according to the first partition weight as the operating system partition.

Description

分割磁碟的方法及電腦裝置Method for dividing magnetic disk and computer device

本發明是有關於一種磁碟管理技術,且特別是有關於一種分割磁碟的方法及電腦裝置。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 computer device 100 is, for example, a notebook computer, a personal computer, a workstation, a server, or other similar devices, but it is not limited to this. As shown in FIG. 1, the computer device 100 includes a magnetic disk 102, a processor 104 and a random access memory 106. In the embodiment of the present invention, the magnetic disk 102 may include one or more disk partitions. For example, in the first embodiment, the disk 102 may only include an operating system partition without a data partition. The operating system partition is the partition used to install the operating system, such as Slot C in the personal computer, and the data partition is the partition where the operating system is not installed. In the second embodiment, the disk 102 may include disk partitions such as an operating system partition and a data partition, but it is not limited thereto.

處理器104耦接於硬碟102及隨機存取記憶體106,並可為一般用途處理器、特殊用途處理器、傳統的處理器、數位訊號處理器、多個微處理器(microprocessor)、一個或多個結合數位訊號處理器核心的微處理器、控制器、微控制器、特殊應用積體電路(Application Specific Integrated Circuit,ASIC)、現場可程式閘陣列電路(Field Programmable Gate Array,FPGA)、任何其他種類的積體電路、狀態機、基於進階精簡指令集機器(Advanced RISC Machine,ARM)的處理器以及類似品。The processor 104 is coupled to the hard disk 102 and the random access memory 106, and can be a general purpose processor, a special purpose processor, a traditional processor, a digital signal processor, multiple microprocessors, one Or multiple microprocessors, controllers, microcontrollers, application specific integrated circuits (ASIC), field programmable gate array circuits (Field Programmable Gate Array, FPGA), combined with the core of the digital signal processor, Any other types of integrated circuits, state machines, processors based on Advanced RISC Machines (ARM), and similar products.

在本發明的實施例中,處理器104可經配置以實現本發明提出的分割磁碟的方法。In an embodiment of the present invention, the processor 104 may be configured to implement the method for partitioning a disk proposed by the present invention.

請參照圖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 computer device 100 shown in FIG.

概略而言,在第一實施例中,假設磁碟102中僅有作業系統分割區,而未有資料分割區。在此情況下,處理器104可基於作業系統分割區的相關資料傳輸行為而得知作業系統分割區的尺寸是否有過大或過小的情形,並可在下一次電腦裝置100進行重安裝作業時相應地調整作業系統分割區的尺寸,從而令磁碟102的空間分配更為合理。Generally speaking, in the first embodiment, it is assumed that the disk 102 has only an operating system partition, but no data partition. In this case, the processor 104 can know whether the size of the operating system partition is too large or too small based on the related data transmission behavior of the operating system partition, and can respond accordingly when the computer device 100 is reinstalled next time. The size of the partition of the operating system is adjusted to make the space allocation of the disk 102 more reasonable.

具體而言,在步驟S210中,處理器104可監控磁碟102的磁碟分割區(即,作業系統分割區)與外部儲存體之間的多個第一互動行為。在不同的實施例中,上述外部儲存體可以是一或多個雲端硬碟、隨身碟、外接式硬碟或其他類似的儲存位置,但可不限於此。Specifically, in step S210, the processor 104 may monitor a plurality of first interaction behaviors between the disk partition (ie, the operating system partition) of the disk 102 and the external storage. In different embodiments, the above-mentioned external storage may be one or more cloud drives, flash drives, external hard drives or other similar storage locations, but it is not limited to this.

此外,在本發明中所考慮的第一互動行為大致可包括(但不限於)以下三種:(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 processor 104 can monitor the data sending behavior, data receiving behavior, and external program execution behavior between the operating system partition and the external storage. For example, the processor 104 can monitor and record the amount of data sent from the operating system partition to the external storage, the amount of data received by the operating system partition from the external storage, and the number of times the computer device 100 executes programs on the external storage. Etc., but not limited to this.

接著,在步驟S220中,處理器104可依據前述第一互動行為調整作業系統分割區的第一分割權重。在第一實施例中,由於磁碟102係假設為僅具有作業系統分割區,故作業系統分割區對應的第一分割權重的初始值可假設為1,但可不限於此。Then, in step S220, the processor 104 may adjust the first partition weight of the partition of the operating system according to the aforementioned first interaction behavior. In the first embodiment, since the disk 102 is assumed to have only the operating system partition, the initial value of the first partition weight corresponding to the operating system partition may be assumed to be 1, but it is not limited to this.

在一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料接收行為時,處理器104可相應地增加上述第一分割權重。並且,處理器104增加第一分割權重的增加幅度可正相關於對應於資料接收行為的接收資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料接收行為,處理器104可依據此資料接收行為對應的接收資料量增加上述第一分割權重,且接收資料量越大,第一分割權重被增加的越多。In an embodiment, whenever the processor 104 detects that a data receiving behavior corresponding to the partition of the operating system occurs, the processor 104 may increase the aforementioned first partition weight accordingly. In addition, the increase range of the processor 104 increasing the first division weight may be positively correlated with the amount of received data corresponding to the data receiving behavior. That is, if the processor 104 detects the data receiving behavior corresponding to the partition of the operating system, the processor 104 may increase the first partition weight according to the received data volume corresponding to the data receiving behavior, and the larger the received data volume, the first The more a division weight is increased.

在另一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料發送行為及外部程式執行行為時,處理器104可相應地降低上述第一分割權重。並且,處理器104降低第一分割權重的降低幅度可正相關於對應於資料發送行為的發送資料量以及外部程式執行行為的執行次數。亦即,若處理器104偵測到對應於作業系統分割區的資料發送行為,處理器104可依據此資料發送行為對應的發送資料量降低上述第一分割權重,且發送資料量越大,第一分割權重被降低的越多。另外,若處理器104偵測到電腦裝置100於外部儲存體上執行程式,處理器104可依據此程式在外部儲存體上的執行次數降低上述第一分割權重,且執行次數越多,第一分割權重被降低的越多。In another embodiment, whenever the processor 104 detects that the data sending behavior and the external program execution behavior corresponding to the partition of the operating system occur, the processor 104 may reduce the aforementioned first partition weight accordingly. In addition, the reduction extent by which the processor 104 reduces the first division weight may be positively correlated with the amount of data sent corresponding to the data sending behavior and the number of executions of the external program execution behavior. That is, if the processor 104 detects a data sending behavior corresponding to the partition of the operating system, the processor 104 can reduce the first division weight according to the amount of sent data corresponding to the data sending behavior, and the larger the amount of sent data, the first The more the weight of a split is reduced. In addition, if the processor 104 detects that the computer device 100 is executing a program on the external storage, the processor 104 can reduce the aforementioned first division weight according to the number of executions of the program on the external storage, and the more the number of executions, the first The more the split weight is reduced.

在第一實施例中,處理器104可基於一強化學習機制實現步驟S230的技術手段。舉例而言,上述強化學習模型可包括一狀態控制器(status controller)、一觀察代理程式(observation agent)及一強化學習模型,其中狀態控制器可用於偵測是否出現上述第一互動行為。In the first embodiment, the processor 104 can implement the technical means of step S230 based on a reinforcement learning mechanism. For example, the aforementioned reinforcement learning model may include a status controller, an observation agent, and a reinforcement learning model, where the status controller can be used to detect whether the aforementioned first interactive behavior occurs.

在第一實施例中,每當狀態控制器偵測到上述第一互動行為之一時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰(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 disk 102 as the operating system partition during the next reinstallation operation of the computer device 100. It should be understood that, in order to enable the operating system partition to be at least sufficient to install the operating system, the above-mentioned reinforcement learning model may be set with a first bias value associated with the operating system partition, wherein the first bias value The value can ensure that the partition of the operating system has at least the size defined by the first partial weight during each reinstallation operation. For example, assuming that the first partial weight is 10GB, the operating system partition will have at least 10GB of space during each reinstallation operation, but it is not limited to this.

之後,在步驟S230中,在電腦裝置100的重安裝作業中,處理器104可依據第一分割權重在磁碟102的可分配空間中切割第一空間以作為作業系統分割區。上述可分配空間例如是在磁碟102中排除用於儲存作業系統相關組態檔的保留空間後的空間,但可不限於此。舉例而言,在第一實施例中,若第一分割權重為0.4,則處理器104可切割上述可分配空間中的40%(即,第一空間)作為作業系統分割區。舉另一例而言,若第一分割權重為0.6,則處理器104可切割上述可分配空間中的60%(即,第一空間)作為作業系統分割區,但可不限於此。After that, in step S230, during the reinstallation operation of the computer device 100, the processor 104 may cut the first space in the allocatable space of the disk 102 as the operating system partition according to the first partition weight. The above-mentioned allocable space is, for example, the space after excluding the reserved space for storing configuration files related to the operating system in the disk 102, but it is not limited to this. For example, in the first embodiment, if the first partition weight is 0.4, the processor 104 may cut 40% of the above-mentioned allocatable space (ie, the first space) as the operating system partition. For another example, if the first partition weight is 0.6, the processor 104 may cut 60% of the above-mentioned allocable space (ie, the first space) as the operating system partition, but it is not limited to this.

此外,由先前所提及的第一偏權值可知,上述第一空間應具有對應於第一偏權值的第一空間尺寸下限值(例如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 computer device 100, the processor 104 may also use the remaining space in the above-mentioned allocatable space as a data partition. For example, if the processor 104 cuts 40% of the allocable space as the first space, the processor 104 may use the remaining 60% of the allocatable space as the data partition, but it is not limited to this.

藉此,在電腦裝置100完成上述重安裝作業之後,可讓磁碟102即具有更適配於相關資料傳輸行為的分割方式,從而避免出現系統效能變慢、磁碟空間不夠用等情形。In this way, after the computer device 100 completes the above-mentioned reinstallation operation, the disk 102 can have a partitioning method that is more suitable for the related data transmission behavior, thereby avoiding the situation of slow system performance and insufficient disk space.

此外,在一些實施例中,電腦裝置100的磁碟102可能在製造完成時即經分割有作業系統分割區及資料分割區等磁碟分割區。在此情況下,本發明可基於各磁碟分割區與外部儲存體的資料傳輸行為以及磁碟分割區彼此之間的資料傳輸行為來調整作業系統分割區的第一分割權重及資料分割區的第二分割權重,並在電腦裝置100執行下一次重安裝作業時據以分割磁碟102。以下將輔以第二實施例作進一步說明。在第二實施例中,作業系統分割區的第一分割權重及資料分割區的第二分割權重個別的初始值可依據出廠時的設定而定。例如,若硬碟102的可分配空間在出廠時被設定為作業系統分割區及資料分割區各佔50%,則作業系統分割區的第一分割權重及資料分割區的第二分割權重個別的初始值可相應地設定為0.5,但可不限於此。In addition, in some embodiments, the disk 102 of the computer device 100 may be divided into disk partitions such as an operating system partition and a data partition when the manufacturing is completed. In this case, the present invention can adjust the first partition weight of the operating system partition and the weight of the data partition based on the data transfer behavior between each disk partition and the external storage and the data transfer behavior between the disk partitions. The second partition weight is used to partition the disk 102 when the computer device 100 executes the next reinstallation operation. The following will be supplemented by the second embodiment for further description. In the second embodiment, the respective initial values of the first partition weight of the operating system partition and the second partition weight of the data partition may be determined according to the factory settings. For example, if the allocatable space of the hard disk 102 is set to 50% of the operating system partition and the data partition at the factory, the first partition weight of the operating system partition and the second partition weight of the data partition will be separate. The initial value can be set to 0.5 accordingly, but may not be limited to this.

請參照圖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 computer device 100 shown in FIG.

首先,在步驟S310中,處理器104可監控磁碟102的磁碟分割區與外部儲存體之間的多個第一互動行為。在第二實施例中,由於磁碟102係假設具有作業系統分割區及資料分割區等磁碟分割區,故處理器104可監控作業系統分割區與外部儲存體之間的第一互動行為,以及監控資料分割區與外部儲存體之間的第一互動行為。First, in step S310, the processor 104 may monitor a plurality of first interaction behaviors between the disk partition of the disk 102 and the external storage. In the second embodiment, since the disk 102 is assumed to have disk partitions such as an operating system partition and a data partition, the processor 104 can monitor the first interaction between the operating system partition and the external storage. And to monitor the first interaction between the data partition and the external storage.

舉例而言,處理器104可監控並記錄從作業系統分割區發送至外部儲存體的資料量(即,資料發送行為)、作業系統分割區從外部儲存體接收的資料量(即,資料接收行為)等第一互動行為,但不限於此。相似地,處理器104可監控並記錄從資料分割區發送至外部儲存體的資料量(即,資料發送行為)、資料分割區從外部儲存體接收的資料量(即,資料接收行為)等第一互動行為,但不限於此。For example, the processor 104 may monitor and record the amount of data sent from the operating system partition to the external storage (ie, data sending behavior), and the amount of data received from the operating system partition from the external storage (ie, data receiving behavior). ) And other first interactive behaviors, but not limited to this. Similarly, the processor 104 can monitor and record the amount of data sent from the data partition to the external storage (ie, data sending behavior), the amount of data received by the data partition from the external storage (ie, data receiving behavior), etc. An interactive behavior, but not limited to this.

之後,在步驟S320中,處理器104可監控作業系統分割區與資料分割區之間的多個第二互動行為。在第二實施例中,上述第二互動行為包括(但不限於)以下兩種態樣:(1)第一資料傳輸行為:由作業系統分割區發送資料至資料分割區的行為;(2)第二資料傳輸行為:由作業系統分割區接收來自資料分割區的資料的行為。例如,處理器104可監控並記錄從作業系統分割區發送至資料分割區的資料量,以及作業系統分割區從資料分割區接收的資料量,但不限於此。After that, in step S320, the processor 104 may monitor multiple second interaction behaviors between the operating system partition and the data partition. In the second embodiment, the above-mentioned second interaction behavior includes (but is not limited to) the following two aspects: (1) The first data transmission behavior: the behavior of sending data from the operating system partition to the data partition; (2) The second data transmission behavior: the behavior of receiving data from the data partition by the operating system partition. For example, the processor 104 may monitor and record the amount of data sent from the operating system partition to the data partition, and the amount of data received by the operating system partition from the data partition, but it is not limited to this.

接著,在步驟S330中,處理器104可依據前述第一互動行為及第二互動行為調整作業系統分割區的第一分割權重。Then, in step S330, the processor 104 may adjust the first partition weight of the partition of the operating system according to the aforementioned first interaction behavior and the second interaction behavior.

在一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料接收行為或第二資料傳輸行為時,處理器104可相應地增加上述第一分割權重。並且,處理器104增加第一分割權重的增加幅度可正相關於對應於資料接收行為及第二資料傳輸行為的接收資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料接收行為或第二資料傳輸行為,處理器104可依據此資料接收行為或第二資料傳輸行為對應的接收資料量增加上述第一分割權重,且接收資料量越大,第一分割權重被增加的越多。In an embodiment, whenever the processor 104 detects that a data receiving behavior or a second data transmission behavior corresponding to the operating system partition occurs, the processor 104 may increase the aforementioned first partition weight accordingly. Moreover, the increase in the processor 104 increasing the first division weight may be positively correlated with the amount of received data corresponding to the data receiving behavior and the second data transmission behavior. That is, if the processor 104 detects the data receiving behavior or the second data transmission behavior corresponding to the partition of the operating system, the processor 104 may increase the above-mentioned first data volume according to the data reception behavior or the second data transmission behavior corresponding to the data reception behavior. One division weight, and the larger the amount of received data, the more the first division weight is increased.

在另一實施例中,每當處理器104偵測到出現對應於作業系統分割區的資料發送行為或第一資料傳輸行為時,處理器104可相應地降低上述第一分割權重。並且,處理器104降低第一分割權重的降低幅度可正相關於對應於資料發送行為或第一資料傳輸行為的發送資料量。亦即,若處理器104偵測到對應於作業系統分割區的資料發送行為或第一資料傳輸行為,處理器104可依據此資料發送行為或第一資料傳輸行為對應的發送資料量降低上述第一分割權重,且發送資料量越大,第一分割權重被降低的越多。In another embodiment, whenever the processor 104 detects that a data sending behavior or a first data transmission behavior corresponding to a partition of the operating system occurs, the processor 104 may reduce the aforementioned first partition weight accordingly. In addition, the reduction extent by which the processor 104 reduces the first division weight may be positively correlated with the amount of transmitted data corresponding to the data transmission behavior or the first data transmission behavior. That is, if the processor 104 detects the data transmission behavior or the first data transmission behavior corresponding to the partition of the operating system, the processor 104 may reduce the aforementioned first data transmission behavior according to the data transmission behavior or the first data transmission behavior corresponding to the data transmission volume. One division weight, and the larger the amount of sent data, the more the first division weight is reduced.

另外,在步驟S340中,處理器104可依據前述第一互動行為及第二互動行為調整資料分割區的第二分割權重。In addition, in step S340, the processor 104 may adjust the second partition weight of the data partition according to the aforementioned first interaction behavior and the second interaction behavior.

在一實施例中,每當處理器104偵測到出現對應於資料分割區的資料接收行為或第一資料傳輸行為時,處理器104可相應地增加上述第二分割權重。並且,處理器104增加第二分割權重的增加幅度可正相關於對應於資料接收行為及第一資料傳輸行為的接收資料量。亦即,若處理器104偵測到對應於資料分割區的資料接收行為或第一資料傳輸行為,處理器104可依據此資料接收行為或第一資料傳輸行為對應的接收資料量增加上述第二分割權重,且接收資料量越大,第二分割權重被增加的越多。In one embodiment, whenever the processor 104 detects that a data receiving behavior or a first data transmission behavior corresponding to the data partition occurs, the processor 104 may increase the second partition weight accordingly. In addition, the increase of the processor 104 to increase the second division weight may be positively correlated with the amount of received data corresponding to the data receiving behavior and the first data transmission behavior. That is, if the processor 104 detects the data receiving behavior or the first data transmission behavior corresponding to the data partition, the processor 104 may increase the second data volume corresponding to the data reception behavior or the first data transmission behavior. Split weight, and the larger the amount of received data, the more the second split weight is increased.

在另一實施例中,每當處理器104偵測到出現對應於資料分割區的資料發送行為或第二資料傳輸行為時,處理器104可相應地降低上述第二分割權重。並且,處理器104降低第二分割權重的降低幅度可正相關於對應於資料發送行為或第二資料傳輸行為的發送資料量。亦即,若處理器104偵測到對應於資料分割區的資料發送行為或第二資料傳輸行為,處理器104可依據此資料發送行為或第二資料傳輸行為對應的發送資料量降低上述第二分割權重,且發送資料量越大,第二分割權重被降低的越多。In another embodiment, whenever the processor 104 detects that a data sending behavior or a second data transmission behavior corresponding to the data partition occurs, the processor 104 may correspondingly reduce the second partition weight. In addition, the reduction extent by which the processor 104 reduces the second division weight may be positively correlated with the amount of transmitted data corresponding to the data transmission behavior or the second data transmission behavior. That is, if the processor 104 detects the data transmission behavior or the second data transmission behavior corresponding to the data partition, the processor 104 may reduce the second data transmission volume according to the data transmission behavior or the second data transmission behavior. Split weight, and the larger the amount of data sent, the more the second split weight is reduced.

在第二實施例中,處理器104可基於強化學習機制實現步驟S330、S340的技術手段。舉例而言,上述強化學習模型可包括狀態控制器、觀察代理程式及強化學習模型,其中狀態控制器可用於偵測是否出現上述第一/第二互動行為。In the second embodiment, the processor 104 can implement the technical means of steps S330 and S340 based on a reinforcement learning mechanism. For example, the aforementioned reinforcement learning model may include a state controller, an observation agent, and a reinforcement learning model, where the state controller can be used to detect whether the first/second interaction behaviors described above occur.

在第二實施例中,每當狀態控制器偵測到上述第一/第二互動行為之一時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰信號,以相應地重新訓練所述強化學習模型增加/降低第一/第二分割權重。另一方面,若狀態控制器未偵測到任何第一/第二互動行為,可相應地通知觀察代理程式,以由觀察代理程式維持第一/第二分割權重,但可不限於此。此外,第二實施例中的強化學習模型亦可設定有關聯於作業系統分割區的第一偏權值,以保證在每次重安裝作業時,作業系統分割區都至少具有第一偏權值所定義的尺寸,但可不限於此。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 processor 104 can cut the first space in the allocatable space of the disk 102 as the operating system partition according to the first partition weight, and use the second partition according to the second partition weight. The weight cuts the second space in the allocatable space of the disk as a data partition.

舉例而言,假設第一、第二分割權重分別為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 processor 104 can use 40% of the above-mentioned allocatable space as the operating system partition during the reinstallation operation, and use the above-mentioned allocatable space The remaining 60% of the space is used as a data partition, but it is not limited to this.

此外,在第二實施例中,由於第一/第二分割權重可隨著作業系統分割區及資料分割區的相關第一/第二互動行為而依據第二實施例中的相關教示(例如步驟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 computer device 100 completes the above-mentioned reinstallation operation, the disk 102 can have a partitioning method that is more suitable for the related data transmission behavior, thereby avoiding the situation of slow system performance and insufficient disk space.

在一些實施例中,作業系統分割區中可經配置有關聯於隨機存取記憶體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 processor 104 can adjust the way the operating system partition is divided into the extended memory space and the free space when the computer device 100 performs the reinstallation operation based on the mechanism described below. The third embodiment will be described below.

在第三實施例中,處理器104可經配置以執行第一實施例中的步驟S210~S230,或是第二實施例中的步驟S310~S350。然而,在第三實施例中,在處理器104執行第一實施例的步驟S230之前,或是執行第二實施例的步驟S350之前,處理器104可判斷隨機存取記憶體106是否出現記憶體不足(out of memory)情形,以及判斷自由空間是否出現耗盡情形(例如剩餘空間小於5%)。若出現記憶體不足情形,此即代表記憶體延伸空間可能太小,則處理器104可增加對應於記憶體延伸空間的第一空間權重及第二空間尺寸下限值,並降低對應於自由空間的第二空間權重,反之則可不更動上述權重/數值,但不限於此。In the third embodiment, the processor 104 may be configured to execute steps S210 to S230 in the first embodiment, or steps S310 to S350 in the second embodiment. However, in the third embodiment, before the processor 104 executes step S230 of the first embodiment, or before executes step S350 of the second embodiment, the processor 104 can determine whether the random access memory 106 has a memory Insufficient (out of memory) situation, and determine whether the free space is exhausted (for example, the remaining space is less than 5%). If there is insufficient memory, it means that the extended memory space may be too small, and the processor 104 can increase the weight of the first space corresponding to the extended space of the memory and the lower limit of the second space size, and reduce the corresponding free space. The second spatial weight of, and vice versa, the above weight/value may not be changed, but it is not limited to this.

此外,若出現自由空間耗盡情形,此即代表記憶體延伸空間可能太大,則處理器104可降低對應於記憶體延伸空間的第一空間權重及第二空間尺寸下限值,並增加對應於自由空間的第二空間權重,反之則可不更動上述權重/數值,但不限於此。In addition, if the free space is exhausted, it means that the memory extension space may be too large, and the processor 104 can reduce the first space weight and the second space size lower limit corresponding to the memory extension space, and increase the corresponding For the second space weight of the free space, the above weight/value may not be changed on the contrary, but it is not limited to this.

在第三實施例中,上述第二空間尺寸下限值可理解為對應於記憶體延伸空間的第二偏權值,即為讓記憶體延伸空間能夠發揮作用的最小尺寸。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 processor 104 can implement the above-mentioned technical means of adjusting the first/second space weight and the lower limit of the second space size based on another reinforcement learning mechanism. For example, the aforementioned reinforcement learning model may include a state controller, an observation agent, and a reinforcement learning model, where the state controller can be used to detect whether the aforementioned memory shortage situation and free space exhaustion situation occur.

在第三實施例中,每當狀態控制器偵測到上述記憶體不足情形及/或自由空間耗盡情形時,可相應地通知觀察代理程式,以由觀察代理程式向強化學習模型發出懲罰信號,以相應地重新訓練所述強化學習模型增加/降低第一、第二空間權重及第二空間尺寸下限值。另一方面,若狀態控制器未偵測到任何記憶體不足情形及/或自由空間耗盡情形,可相應地通知觀察代理程式,以由觀察代理程式維持第一、第二空間權重及第二空間尺寸下限值,但可不限於此。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 computer device 100, and the above-mentioned second space weight relates to the next time the computer device 100 is reinstalled. When the device 100 is performing a reinstallation operation, how much space should be cut from the operating system partition as a free space, but it is not limited to this. It should be understood that, in order to allow the extended memory space to function, the above-mentioned reinforcement learning model may be set with the second partial weight (ie, the lower limit of the second space size) associated with the extended memory space. The two-biased weight can ensure that the memory extension space has at least the size defined by the second-biased weight during each reinstallation operation.

在處理器104經上述教示調整第一、第二空間權重及第二空間尺寸下限值之後,處理器104可在電腦裝置100下次進行重安裝時相應地調整分割作業系統分割區的方式。舉例而言,在處理器104於重安裝作業中將磁碟102分割為作業系統分割區及資料分割區之後,處理器104可再依據第一空間權重在作業系統分割區中切割第三空間作為記憶體延伸空間,並依據第二空間權重在作業系統分割區中切割第四空間作為自由空間。After the processor 104 adjusts the first and second space weights and the lower limit of the second space size according to the above teaching, the processor 104 can adjust the way of dividing the operating system partition accordingly when the computer device 100 is reinstalled next time. For example, after the processor 104 divides the disk 102 into the operating system partition and the data partition during the reinstallation operation, the processor 104 may then cut the third space in the operating system partition according to the first space weight as The memory extends the space, and the fourth space is cut in the operating system partition as a free space according to the second space weight.

舉例而言,假設第一、第二空間權重分別為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 processor 104 can use 10% of the operating system partition as the memory extension space during the reinstallation operation, and divide the operating system partition The remaining 90% of the space is used as free space, but it is not limited to this.

在一些實施例中,處理器104可判斷第一空間權重及第二空間權重的調整間隔是否低於第一門限值,或是第二空間尺寸下限值低於第二門限值。詳細而言,若第一空間權重及/或第二空間權重過於頻繁地被調整,或是第二空間尺寸下限值被調整地過小,即代表電腦裝置100時常出現記憶體不足情形及/或自由空間耗盡情形,而此意味著電腦裝置100本身的運作可能出現問題(例如作業系統檔案毀損、內部功能出狀況等)。在此情況下,處理器104可提供重新安裝建議訊息,以建議使用者藉由重新安裝電腦裝置100的作業系統來修正電腦裝置100本身的運作問題。In some embodiments, the processor 104 may determine whether the adjustment interval of the first spatial weight and the second spatial weight is lower than the first threshold, or the lower limit of the second spatial size is lower than the second threshold. In detail, if the first space weight and/or the second space weight are adjusted too frequently, or the lower limit of the second space size is adjusted too small, it means that the computer device 100 often has insufficient memory and/or The free space is exhausted, which means that there may be problems with the operation of the computer device 100 itself (such as operating system file corruption, internal function failure, etc.). In this case, the processor 104 may provide a reinstallation suggestion message to advise the user to correct the operating problem of the computer device 100 itself by reinstalling the operating system of the computer device 100.

在不同的實施例中,上述第一門限值可由設計者依需求而定。例如,若第一門限值經設定為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 processor 104 may determine whether the time interval between two adjustments of the first/second spatial weight is less than 3 days, but it is not limited to this. In addition, the above-mentioned second threshold value can also be determined by the designer as an arbitrary value according to requirements, for example, a value close to 0, but it is not limited to this.

在第三實施例中,電腦裝置100在出廠時可預安裝有用於決定上述記憶體延伸空間的預設模型,而以上揭示的調整第一空間權重的手段可藉由調整此預設模型來進行。In the third embodiment, the computer device 100 may be pre-installed with a preset model for determining the memory extension space when it is shipped from the factory, and the method for adjusting the weight of the first space disclosed above may be performed by adjusting the preset model. .

在一實施例中,上述預設模型可由一伺服器產生。具體而言,上述伺服器可從多台電腦裝置個別收集隨機存取記憶體的總尺寸及作業系統分割區中自由空間的尺寸。之後,伺服器可將所收集到的資訊饋入一神經網路,以將此神經網路訓練為上述預設模型。舉例而言,上述神經網路例如是一卷積神經網路,而其進行卷積運算的維度例如是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 computer device 100 when the computer device 100 is shipped from the factory to determine the initial values of the first spatial weight and the second spatial weight. After that, the processor 104 can adjust the first spatial weight and the second spatial weight according to the previous teaching, but it is not limited to this.

此外,在一些實施例中,由於不同作業系統對應的記憶體延伸空間有所不同,故處理器104在電腦裝置100的重安裝作業中設定記憶體延伸空間的尺寸的方式亦有所不同,以下將以第四實施例作說明。In addition, in some embodiments, since the memory extension space corresponding to different operating systems is different, the way the processor 104 sets the size of the memory extension space during the reinstallation operation of the computer device 100 is also different, as follows: The fourth embodiment will be explained.

請參照圖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 computer device 100 in FIG. 1. The details of each step in FIG. 4 are described below with the components shown in FIG.

首先,在步驟S410中,處理器104可判斷判斷是否可在電腦裝置100中取得對應於第一類延伸空間的全域唯一識別碼(Globally Unique Identifier,GUID)。在第四實施例中,上述第一類延伸空間例如是swap分割區,而若處理器104可在電腦裝置100中找到上述GUID,即代表電腦裝置100的作業系統屬於Linux/Unix,且電腦裝置100中本身即設置有swap分割區。First, in step S410, the processor 104 can determine whether a globally unique identifier (GUID) corresponding to the first type of extended space can be obtained in the computer device 100. In the fourth embodiment, the first type of extended space is, for example, a swap partition, and if the processor 104 can find the GUID in the computer device 100, it means that the operating system of the computer device 100 belongs to Linux/Unix, and the computer device The swap partition is set in 100 itself.

因此,在判定可在電腦裝置100中取得上述GUID之後,處理器104可接續執行步驟S420,以判定記憶體延伸空間屬於第一類延伸空間,並依據第一空間權重在作業系統分割區中切割第三空間作為第一類延伸空間。Therefore, after determining that the aforementioned GUID can be obtained in the computer device 100, the processor 104 may continue to perform step S420 to determine that the memory extension space belongs to the first type of extension space, and cut in the operating system partition according to the first space weight The third space serves as the first type of extended space.

另一方面,若無法在電腦裝置100中取得上述GUID,則處理器104可接續執行步驟S430,以判斷是否可在電腦裝置100中找到第二類延伸空間。在第四實施例中,上述第二類延伸空間例如是swap檔案。On the other hand, if the aforementioned GUID cannot be obtained in the computer device 100, the processor 104 may continue to execute step S430 to determine whether the second type of extended space can be found in the computer device 100. In the fourth embodiment, the above-mentioned second type of extended space is, for example, a swap file.

在一實施例中,若處理器104判定可在電腦裝置100中找到第二類延伸空間,則可接續執行步驟S440,以判定記憶體延伸空間屬於第二類延伸空間,並依據第一空間權重在作業系統分割區中切割第三空間作為第二類延伸空間。In one embodiment, if the processor 104 determines that the second type of extended space can be found in the computer device 100, it may continue to perform step S440 to determine that the memory extended space belongs to the second type of extended space, and based on the first space weight The third space is cut in the operating system partition area as the second type of extended space.

另一方面,若處理器104判定無法在電腦裝置100找到上述GUID及上述第二類延伸空間,此即代表電腦裝置100的作業系統為Windows,故處理器104可接續執行步驟S450以判定記憶體延伸空間屬於第三類延伸空間(例如Windows中的Pagefile),並依據第一空間權重在作業系統分割區中切割第三空間作為第三類延伸空間。On the other hand, if the processor 104 determines that the GUID and the second type of extended space cannot be found in the computer device 100, it means that the operating system of the computer device 100 is Windows, so the processor 104 may continue to execute step S450 to determine the memory The extended space belongs to the third type of extended space (for example, Pagefile in Windows), and the third space is cut in the operating system partition as the third type of extended space according to the first space weight.

此外,在不同的實施例中,本發明所提及的重安裝作業可泛指各式還原作業系統的操作,但可不限於此。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)

一種分割磁碟的方法,適於包括一磁碟的一電腦裝置,包括:監控該磁碟的至少一磁碟分割區與至少一外部儲存體之間的多個第一互動行為,其中該至少一磁碟分割區包括一作業系統分割區;依據該些第一互動行為調整該作業系統分割區的一第一分割權重;以及在該電腦裝置的一重安裝作業中,依據該第一分割權重在該磁碟的一可分配空間中切割一第一空間以作為該作業系統分割區,其中該第一空間具有一第一空間尺寸下限值,其中該些第一互動行為包括由該至少一磁碟分割區發送資料至該至少一外部儲存體的一資料發送行為、由該至少一磁碟分割區接收來自該至少一外部儲存體的資料的一資料接收行為,以及在該至少一外部儲存體上執行程式的一外部程式執行行為。 A method for dividing a magnetic disk, suitable for a computer device including a magnetic disk, includes: 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 the at least A disk partition includes an operating system partition; a first partition weight of the operating system partition is adjusted according to the first interaction behaviors; and in a reinstallation operation of the computer device, the first partition weight is adjusted according to the first partition weight A first space is cut in an allocatable space of the disk to be used as the partitioning area of the operating system, wherein the first space has a first space size lower limit, and the first interactive behaviors include the use of the at least one magnetic disk A data sending behavior of sending data to the at least one external storage by a disk partition, a data receiving behavior of receiving data from the at least one external storage by the at least one disk partition, and a data receiving behavior of the at least one external storage An external program execution behavior of the upper execution program. 如請求項1所述的方法,其中依據該些第一互動行為調整該作業系統分割區的該第一分割權重的步驟包括:反應於判定該些第一互動行為中出現對應於該作業系統分割區的該資料發送行為及該外部程式執行行為,降低該第一分割權重;反應於判定該些第一互動行為中出現對應於該作業系統分割區的該資料接收行為,增加該第一分割權重; 其中該第一分割權重的一降低幅度正相關於對應於該資料發送行為的一發送資料量以及該外部程式執行行為的一執行次數,而該第一分割權重的一增加度正相關於對應於該資料接收行為的一接收資料量。 The method according to claim 1, wherein the step of adjusting the first partition weight of the operating system partition according to the first interactive behaviors includes: responding to determining that the first interactive behavior corresponds to the operating system partition The data sending behavior and the external program execution behavior of the area reduce the first partition weight; in response to determining that the data receiving behavior corresponding to the operating system partition occurs in the first interactive behaviors, the first partition weight is increased ; Wherein, a decrease in the first division weight is positively correlated with a transmission data volume corresponding to the data transmission behavior and a number of executions of the external program execution behavior, and an increase in the first division weight is positively correlated with A received data volume of the data receiving behavior. 如請求項1所述的方法,更包括:將該可分配空間中的剩餘空間作為一資料分割區。 The method according to claim 1, further comprising: using the remaining space in the allocatable space as a data partition. 如請求項1所述的方法,其中該至少一磁碟分割區更包括一資料分割區,且所述方法更包括:監控該作業系統分割區與該資料分割區之間的多個第二互動行為;依據該些第二互動行為調整該作業系統分割區的該第一分割權重;依據該些第一互動行為及該些第二互動行為調整該資料分割區的一第二分割權重;在該電腦裝置的該重安裝作業中,依據該第二分割權重在該磁碟的該可分配空間中切割一第二空間以作為該資料分割區;其中該些第二互動行為包括由該作業系統分割區發送資料至該資料分割區的一第一資料傳輸行為,以及由該作業系統分割區接收來自該資料分割區的資料的一第二資料傳輸行為。 The method according to claim 1, wherein the at least one disk partition further includes a data partition, and the method further includes: monitoring a plurality of second interactions between the operating system partition and the data partition Adjust the first partition weight of the operating system partition based on the second interactive behaviors; adjust a second partition weight of the data partition based on the first interactive behaviors and the second interactive behaviors; In the reinstallation operation of the computer device, a second space is cut in the allocatable space of the disk as the data partition according to the second partition weight; wherein the second interactive behaviors include partitioning by the operating system A first data transmission behavior of sending data to the data partition, and a second data transmission behavior of receiving data from the data partition by the operating system partition. 如請求項4所述的方法,其中依據該些第二互動行為調整該作業系統分割區的該第一分割權重的步驟包括: 反應於判定該些第二互動行為中出現該第一資料傳輸行為,降低該第一分割權重;反應於判定該些第二互動行為中出現該第二資料傳輸行為,增加該第一分割權重。 The method according to claim 4, wherein the step of adjusting the first partition weight of the operating system partition according to the second interactive behaviors includes: In response to determining that the first data transmission behavior occurs in the second interactive behaviors, the first division weight is reduced; in response to determining that the second data transmission behavior occurs in the second interaction behaviors, the first division weight is increased. 如請求項1所述的方法,其中該電腦裝置包括一隨機存取記憶體,該作業系統分割區包括一記憶體延伸空間及一自由空間,且所述方法更包括:反應於判定該隨機存取記憶體出現一記憶體不足情形,增加對應於該記憶體延伸空間的一第一空間權重及一第二空間尺寸下限值,並降低對應於該自由空間的一第二空間權重;反應於判定該自由空間出現一耗盡情形,降低對應於該記憶體延伸空間的該第一空間權重及該第二空間尺寸下限值,並增加對應於該自由空間的該第二空間權重;在該電腦裝置的該重安裝作業中,依據該第一空間權重在該作業系統分割區中切割一第三空間作為該記憶體延伸空間,並依據該第二空間權重在該作業系統分割區中切割一第四空間作為該自由空間。 The method of claim 1, wherein the computer device includes a random access memory, the operating system partition includes an extended memory space and a free space, and the method further includes: responding to determining the random access memory When a memory shortage occurs in the memory, a first space weight and a second space size lower limit corresponding to the extended space of the memory are increased, and a second space weight corresponding to the free space is decreased; Determine that the free space is exhausted, reduce the weight of the first space and the lower limit of the second space size corresponding to the extended space of the memory, and increase the weight of the second space corresponding to the free space; In the reinstallation operation of the computer device, a third space is cut in the operating system partition according to the first space weight as the memory extension space, and a third space is cut in the operating system partition according to the second space weight The fourth space serves as the free space. 如請求項6所述的方法,其中該記憶體延伸空間屬於一第一類延伸空間、一第二類延伸空間及一第三類延伸空間之一,而依據該第一空間權重在該作業系統分割區中切割該第三空間作為該記憶體延伸空間的步驟包括: 判斷是否可在該電腦裝置中取得對應於該第一類延伸空間的一全域唯一識別碼;反應於判定可在該電腦裝置中取得對應於該第一類延伸空間的該全域唯一識別碼,判定該記憶體延伸空間屬於該第一類延伸空間,並依據該第一空間權重在該作業系統分割區中切割該第三空間作為該第一類延伸空間。 The method according to claim 6, wherein the extended memory space belongs to one of a first type of extended space, a second type of extended space, and a third type of extended space, and the weight of the first space is assigned to the operating system The step of cutting the third space in the partition area as the extended space of the memory includes: Determine whether a global unique identification code corresponding to the first type of extended space can be obtained in the computer device; in response to the determination that the global unique identification code corresponding to the first type of extended space can be obtained in the computer device, determine The memory extension space belongs to the first type extension space, and the third space is cut in the operating system partition area as the first type extension space according to the first space weight. 如請求項7所述的方法,其中反應於判定無法在該電腦裝置中取得對應於該第一類延伸空間的該全域唯一識別碼,所述方法更包括:判斷是否可在該電腦裝置中找到該第二類延伸空間;反應於判定可在該電腦裝置中找到該第二類延伸空間,判定該記憶體延伸空間屬於該第二類延伸空間,並依據該第一空間權重在該作業系統分割區中切割該第三空間作為該第二類延伸空間。 The method according to claim 7, wherein in response to determining that the global unique identification code corresponding to the first type of extended space cannot be obtained in the computer device, the method further includes: determining whether it can be found in the computer device The second type of extended space; in response to determining that the second type of extended space can be found in the computer device, it is determined that the memory extended space belongs to the second type of extended space, and is divided in the operating system according to the weight of the first space The third space is cut in the area as the second type of extended space. 如請求項8所述的方法,其中反應於判定無法在該電腦裝置中找到該第二類延伸空間,所述方法更包括:判定該記憶體延伸空間屬於該第三類延伸空間,並依據該第一空間權重在該作業系統分割區中切割該第三空間作為該第三類延伸空間。 The method according to claim 8, wherein in response to determining that the second type of extended space cannot be found in the computer device, the method further includes: determining that the memory extended space belongs to the third type of extended space, and based on the The first space weight cuts the third space in the operating system partition area as the third type of extended space. 一種電腦裝置,包括:一磁碟;以及一處理器,其耦接該磁碟,並經配置以執行下列步驟:監控該磁碟的至少一磁碟分割區與至少一外部儲存體之間的 多個第一互動行為,其中該至少一磁碟分割區包括一作業系統分割區;依據該些第一互動行為調整該作業系統分割區的一第一分割權重;以及在該電腦裝置的一重安裝作業中,依據該第一分割權重在該磁碟的一可分配空間中切割一第一空間以作為該作業系統分割區,其中該些第一互動行為包括由該至少一磁碟分割區發送資料至該至少一外部儲存體的一資料發送行為、由該至少一磁碟分割區接收來自該至少一外部儲存體的資料的一資料接收行為,以及在該至少一外部儲存體上執行程式的一外部程式執行行為。 A computer device includes: a magnetic disk; and a processor, which is coupled to the magnetic disk, and is configured to perform the following steps: monitor the relationship between at least one partition of the magnetic disk and at least one external storage A plurality of first interactive behaviors, wherein the at least one disk partition includes an operating system partition; adjusting a first partition weight of the operating system partition according to the first interactive behaviors; and a reinstallation on the computer device In the operation, a first space is cut in an allocatable space of the disk as the operating system partition according to the first partition weight, wherein the first interactive actions include sending data from the at least one disk partition A data transmission behavior to the at least one external storage, a data reception behavior of receiving data from the at least one external storage by the at least one disk partition, and a data execution behavior of a program on the at least one external storage External program execution behavior.
TW109110263A 2020-03-26 2020-03-26 Method for dividing disk and computer device TWI736194B (en)

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)

* Cited by examiner, † Cited by third party
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

Patent Citations (4)

* Cited by examiner, † Cited by third party
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