TWI493563B - Memory managing method and electronic apparatus using the same - Google Patents

Memory managing method and electronic apparatus using the same Download PDF

Info

Publication number
TWI493563B
TWI493563B TW101100674A TW101100674A TWI493563B TW I493563 B TWI493563 B TW I493563B TW 101100674 A TW101100674 A TW 101100674A TW 101100674 A TW101100674 A TW 101100674A TW I493563 B TWI493563 B TW I493563B
Authority
TW
Taiwan
Prior art keywords
memory
data
module
blocks
block
Prior art date
Application number
TW101100674A
Other languages
Chinese (zh)
Other versions
TW201329995A (en
Inventor
Ching Ho Tsai
Yin Hsong Hsu
Original Assignee
Acer Inc
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 Acer Inc filed Critical Acer Inc
Priority to TW101100674A priority Critical patent/TWI493563B/en
Publication of TW201329995A publication Critical patent/TW201329995A/en
Application granted granted Critical
Publication of TWI493563B publication Critical patent/TWI493563B/en

Links

Landscapes

  • Techniques For Improving Reliability Of Storages (AREA)
  • Power Sources (AREA)

Description

記憶體管理方法及應用該方法之電子裝置Memory management method and electronic device using the same

本發明係關於一種記憶體管理方法,特別是一種可關閉記憶體模組之未使用部分以達到省電效果之記憶體管理方法。The present invention relates to a memory management method, and more particularly to a memory management method capable of turning off an unused portion of a memory module to achieve a power saving effect.

現今許多電子裝置為了達到省電效果,在裝置本身處於閒置狀態或休眠模式下,裝置之部分元件會被關閉或停止供電,以減少多餘之電量消耗,例如顯示螢幕、硬碟、處理器等。然而就記憶體來說,一旦將其停止供電,記憶體內部暫存之動態資料將會遺失,將使裝置系統發生錯誤;因此若需要關閉記憶體,必須先將原先儲存於記憶體內部之資料寫入硬碟,待記憶體恢復供電後,再將資料自硬碟重新寫入記憶體。In order to achieve power saving effect, many electronic devices in the present invention are in an idle state or a sleep mode, and some components of the device are turned off or stopped to reduce unnecessary power consumption, such as displaying a screen, a hard disk, a processor, and the like. However, as far as the memory is concerned, once the power is stopped, the dynamic data temporarily stored in the memory will be lost, which will cause an error in the device system. Therefore, if the memory needs to be turned off, the data originally stored in the memory must be stored first. Write to the hard disk, and then restore the data from the hard disk to the memory after the memory is restored.

習知技術如中華民國專利第I343519號公告,其針對記憶體中之已存資料進行壓縮,以便縮減記憶體所使用空間,並將未使用之部分記憶體模組予以斷電,藉此達到減少裝置耗電量之效果。然而此設計必須針對記憶體中之資料進行壓縮及解壓縮,如此將增加額外之系統運算處理及耗電量,反而可能會增加系統負荷而無法達到預期之節能省電效果。Conventional technology, such as the Republic of China Patent No. I343519, which compresses the stored data in the memory to reduce the space used by the memory and power off some of the unused memory modules. The effect of the device's power consumption. However, this design must compress and decompress the data in the memory, which will increase the additional system processing and power consumption, but may increase the system load and fail to achieve the expected energy saving effect.

本發明之主要目的係在提供一種可關閉記憶體模組之未使用部分以達到省電效果之記憶體管理方法。The main object of the present invention is to provide a memory management method capable of turning off an unused portion of a memory module to achieve a power saving effect.

為達到上述之目的,本發明之記憶體管理方法係應用於電子裝置,電子裝置包括形成複數記憶體區塊之至少一記憶體模組、控制模組及電源模組。該方法包括以下步驟:藉由控制模組接收一執行指令;依據執行指令重新排列儲存於記憶體模組中之至少一資料,以將至少一資料集中儲存於單一記憶體區塊或多個連續記憶體區塊中;以及通知電源模組停止供電給複數記憶體區塊中未使用之其他記憶體區塊。To achieve the above objective, the memory management method of the present invention is applied to an electronic device, and the electronic device includes at least one memory module, a control module, and a power module for forming a plurality of memory blocks. The method includes the following steps: receiving, by the control module, an execution instruction; rearranging at least one data stored in the memory module according to the execution instruction, to store the at least one data in a single memory block or a plurality of consecutive In the memory block; and informing the power module to stop supplying power to other memory blocks not used in the plurality of memory blocks.

此外本發明亦提供應用前述記憶體管理方法之電子裝置。電子裝置包括至少一記憶體模組、控制模組、處理模組及電源模組。至少一記憶體模組包括複數記憶體區塊,用以儲存至少一資料,各資料係以複數資料區塊形式儲存於複數記憶體區塊中;控制模組用以接收一執行指令以重新排列儲存於該至少一記憶體模組中之該至少一資料,以將該至少一資料集中儲存於單一該記憶體區塊或多個連續之該記憶體區塊中;電源模組用以供電給複數記憶體區塊;處理模組用以發出執行指令,並於控制模組完成至少一資料之重新排列後,通知電源模組停止供電給複數記憶體區塊中未使用之其他記憶體區塊。Furthermore, the present invention also provides an electronic device to which the aforementioned memory management method is applied. The electronic device includes at least one memory module, a control module, a processing module, and a power module. At least one memory module includes a plurality of memory blocks for storing at least one data, each data is stored in a plurality of data blocks in a plurality of data blocks; and the control module is configured to receive an execution instruction to rearrange Storing the at least one data in the at least one memory module to store the at least one data in a single memory block or a plurality of consecutive memory blocks; a plurality of memory blocks; the processing module is configured to issue an execution instruction, and after the control module completes at least one data rearrangement, notifying the power module to stop supplying power to other memory blocks not used in the plurality of memory blocks .

藉由本發明之設計,在電子裝置處於閒置或休眠狀態下,可針對記憶體模組所儲存之資料重新排列並集中於部分記憶體區塊內,以將記憶體模組中未使用之其他記憶體區塊進行斷電,達到節能省電之效果,以減少多餘之電量消耗。With the design of the present invention, when the electronic device is in an idle or dormant state, the data stored in the memory module can be rearranged and concentrated in a part of the memory block to use other memories not used in the memory module. The body block is powered off to achieve energy saving and power saving to reduce excess power consumption.

為能讓 貴審查委員能更瞭解本發明之技術內容,特舉出較佳實施例說明如下。In order to enable the reviewing committee to better understand the technical contents of the present invention, the preferred embodiments are described below.

請參考圖1係本發明之電子裝置1之第一實施例之示意圖。在本發明之各實施例中,電子裝置係為可攜式電腦或桌上型電腦等電腦裝置,但依據應用類型不同,電子裝置亦可為其他可供設置記憶體模組之電子裝置,不以本實施例為限。Please refer to FIG. 1 , which is a schematic diagram of a first embodiment of an electronic device 1 of the present invention. In various embodiments of the present invention, the electronic device is a portable computer or a desktop computer, but the electronic device may be another electronic device that can be configured with a memory module, depending on the type of application. This embodiment is limited.

如圖1所示,本發明之電子裝置1包括至少一記憶體模組10、控制模組20、處理模組30及電源模組40,處理模組30係與各模組彼此電性連接,且藉由電源模組40供應各模組所需電源。在本實施例中,至少一記憶體模組10係為單一記憶體模組,其包括複數記憶體區塊11至18,用以儲存至少一資料,任一資料係以複數資料區塊所構成。此處記憶體模組10可視為一記憶體裝置,而各個記憶體區塊11至18則為記憶體裝置上之各個記憶體晶片,但記憶體裝置上所設置之記憶體區塊數量與劃分方式不以本實施例為限。例如可將相鄰之連續多個記憶體晶片視為同一個記憶體區塊,或於記憶體裝置上設置容量及體積更小之記憶體晶片,以增加記憶體區塊之數量等,端視設計需求不同而改變。As shown in FIG. 1 , the electronic device 1 of the present invention includes at least one memory module 10 , a control module 20 , a processing module 30 , and a power module 40 . The processing module 30 is electrically connected to each module. And the power supply required by each module is supplied by the power module 40. In this embodiment, at least one memory module 10 is a single memory module, which includes a plurality of memory blocks 11 to 18 for storing at least one data, and any data is formed by a plurality of data blocks. . Here, the memory module 10 can be regarded as a memory device, and each of the memory blocks 11 to 18 is a memory chip on the memory device, but the number and division of the memory blocks set on the memory device The method is not limited to this embodiment. For example, a plurality of adjacent memory chips may be regarded as the same memory block, or a memory chip having a smaller capacity and a smaller volume may be disposed on the memory device to increase the number of memory blocks, etc. Design needs vary from design to application.

控制模組20用以接收執行指令以針對至少一記憶體模組10內所儲存之至少一資料進行資料搬移,在本發明之各實施例中,控制模組20可為在作業系統下執行之應用程式,或是儲存有該應用程式之硬體元件,例如基本輸入輸出系統晶片(BIOS)或唯讀記憶體(ROM)等,但不以本實施例為限。The control module 20 is configured to receive an execution command to perform data transfer on at least one of the data stored in the at least one memory module 10. In each embodiment of the present invention, the control module 20 can be executed under the operating system. An application, or a hardware component that stores the application, such as a basic input/output system chip (BIOS) or a read-only memory (ROM), but is not limited to this embodiment.

處理模組30用以發出執行指令至控制模組20,並通知電源模組40是否對至少一記憶體模組10之記憶體區塊11至18正常供電。在本實施例中,處理模組30可包括中央處理器及/或儲存於硬碟等儲存裝置內之作業系統;中央處理器可先載入作業系統,而當作業系統偵測到已閒置一定時間或切換至休眠狀態後,即可發出前述之執行指令通知控制模組20,以令控制模組20對應執行至少一記憶體模組10之資料重新排列之動作。The processing module 30 is configured to issue an execution command to the control module 20, and notify the power module 40 whether the memory blocks 11 to 18 of the at least one memory module 10 are normally powered. In this embodiment, the processing module 30 may include a central processing unit and/or an operating system stored in a storage device such as a hard disk; the central processing unit may first load the operating system, and when the operating system detects that it is idle, After the time is switched to the sleep state, the execution instruction notification control module 20 can be issued to enable the control module 20 to perform the action of rearranging the data of at least one memory module 10.

而電源供應模組40用以供應各模組所需之電源,且藉由各開關51至58來控制對應至少一記憶體模組10之各記憶體區塊11至18之供電。當儲存於至少一記憶體模組10中之所有資料在完成重新排列後,控制模組20即可通知處理模組30,以命令電源供應模組40對於未使用之記憶體區塊執行停止供電。The power supply module 40 is configured to supply power required by each module, and controls the power supply of each of the memory blocks 11 to 18 corresponding to the at least one memory module 10 by the switches 51 to 58. After all the data stored in the at least one memory module 10 is rearranged, the control module 20 can notify the processing module 30 to instruct the power supply module 40 to stop powering the unused memory blocks. .

為了確保記憶體模組10內所儲存資料可被正確讀取,系統會於記憶體模組10內產生一對應資料(mapping table),此對應資料用以記錄任一資料之各資料區塊所對應之虛擬記憶體位址及實際儲存於對應記憶體區塊11至18內之實體記憶體位址。因此,藉由此對應資料,可供控制模組20辨識出目前使用中之記憶體區塊,並於各資料區塊產生搬動後,系統會修改以更新對應資料,以避免產生資料讀取錯誤之情況。In order to ensure that the data stored in the memory module 10 can be correctly read, the system generates a mapping table in the memory module 10, and the corresponding data is used to record each data block of any data. The corresponding virtual memory address and the physical memory address actually stored in the corresponding memory blocks 11 to 18. Therefore, by using the corresponding data, the control module 20 can identify the memory block currently in use, and after the data block is moved, the system will modify to update the corresponding data to avoid data reading. The wrong situation.

請一併參考圖2(a)、(b)。圖2(a)係本發明之電子裝置1之第一實施例之記憶體模組10進行資料重新排列前之示意圖;圖2(b)係本發明之電子裝置1之第一實施例之記憶體模組10進行資料重新排列後之示意圖。Please refer to Figure 2 (a), (b) together. 2(a) is a schematic view of the memory module 10 of the first embodiment of the electronic device 1 of the present invention before data rearrangement; FIG. 2(b) is a memory of the first embodiment of the electronic device 1 of the present invention. The body module 10 performs a schematic diagram of rearranging the data.

如圖2(a)所示,在一般情況下,當任一資料之複數資料區塊儲存於複數記憶體區塊11至18中時,為了提高資料存取速度,裝置系統會將該資料之複數資料區塊分散儲存於各個記憶體區塊11至18。在本實施例中,假設該資料為1個二進位之位元組,其係由「01100111」等8個位元所組成,各個位元可視為一資料區塊。因此,該位元組被儲存於記憶體模組10時,會將該位元組之各個位元分別儲存於各個記憶體區塊11至18中。As shown in FIG. 2(a), in general, when a plurality of data blocks of any data are stored in the plurality of memory blocks 11 to 18, in order to increase the data access speed, the device system will The plurality of data blocks are dispersedly stored in the respective memory blocks 11 to 18. In this embodiment, it is assumed that the data is a binary bit group, which is composed of 8 bits such as "01100111", and each bit can be regarded as a data block. Therefore, when the byte is stored in the memory module 10, each bit of the byte is stored in each of the memory blocks 11 to 18.

如圖1及圖2(b)所示,當控制模組20接受到前述執行指令時,即依據執行指令重新排列儲存於記憶體模組10中之該位元組資料,以針對該資料進行其資料區塊於不同記憶體區塊11至18間之搬移。在本實施例中,控制模組20係將原本分散儲存於各記憶體區塊11至18之各個位元,經資料重新排列後,將原本儲存於記憶體區塊15至18之位元集中儲存於多個連續之記憶體區塊11至14中,如圖2(b)所示;控制模組20亦同時針對前述對應資料進行更新,以反映出目前各資料區塊所對應之實際儲存位置。藉此,使得前述記憶體區塊15至18所儲存資料已被清空,而處於未被使用之狀態,亦即於複數記憶體區塊11至18中形成未使用之其他記憶體區塊15至18。As shown in FIG. 1 and FIG. 2(b), when the control module 20 receives the execution command, the byte data stored in the memory module 10 is rearranged according to the execution command to perform the data for the data. The data block is moved between different memory blocks 11 to 18. In this embodiment, the control module 20 stores the original bits in the memory blocks 11 to 18, and rearranges the data to store the bits originally stored in the memory blocks 15 to 18. Stored in a plurality of consecutive memory blocks 11 to 14, as shown in FIG. 2(b); the control module 20 also updates the corresponding data to reflect the actual storage corresponding to each data block. position. Thereby, the data stored in the memory blocks 15 to 18 is emptied, and is in an unused state, that is, the unused memory blocks 15 are formed in the plurality of memory blocks 11 to 18 to 18.

前述控制模組20針對有關連續記憶體區塊之判斷,可透過讀取一記憶體連結資訊而得知,此記憶體連結資訊可定義各記憶體區塊11至18之間的實體連接關係,以供判斷哪些記憶體區塊彼此為相鄰之連續記憶體區塊。而此記憶體連結資訊可儲存於不會因斷電而導致資料消失之硬體裝置內,例如BIOS、ROM或硬碟裝置內,但不以本實施例為限。The foregoing control module 20 can determine the contiguous memory block by reading a memory link information, and the memory link information can define the physical connection relationship between the memory blocks 11 to 18. For determining which memory blocks are adjacent to each other, contiguous memory blocks. The memory connection information can be stored in a hardware device that does not cause the data to disappear due to power failure, such as a BIOS, a ROM, or a hard disk device, but is not limited to this embodiment.

控制模組20在完成前述資料重新排列,空出了未被使用之記憶體區塊15至18後,即可通知處理模組30,而處理模組30將命令電源模組40對於這些未被使用之記憶體區塊15至18執行停止供電之動作,因此電源模組40會對應關閉開關55至58,以中斷對記憶體區塊15至18之供電。藉此設計可達到針對記憶體模組10執行部分供電部分斷電之效果,以節省不必要之電量消耗。After the control module 20 completes the foregoing data rearrangement and vacates the unused memory blocks 15 to 18, the processing module 30 can be notified, and the processing module 30 will command the power module 40 to The memory blocks 15 to 18 used perform the action of stopping the power supply, so the power module 40 correspondingly turns off the switches 55 to 58 to interrupt the supply of the memory blocks 15 to 18. The design can achieve the effect of powering off part of the power supply part of the memory module 10 to save unnecessary power consumption.

請參考圖3係本發明之電子裝置1a之第二實施例之示意圖。如圖3所示,在本實施例中,本發明之電子裝置10包括二個記憶體模組10a、10b,每一個記憶體模組10a、10b可為一記憶體裝置,且各個記憶體裝置整體可視為單一記憶體區塊11a或11b,使得二個記憶體模組10a、10b形成各別不同之二個記憶體區塊11a、11b,但記憶體模組10a、10b所設置數量與其包括之記憶體區塊11a、11b之數量不以本實施例為限。例如電子裝置1a可增設更多之記憶體裝置,或是將各個記憶體裝置劃分為二個以上之記憶體區塊等,端視設計需求不同而改變。Please refer to FIG. 3, which is a schematic diagram of a second embodiment of the electronic device 1a of the present invention. As shown in FIG. 3, in the embodiment, the electronic device 10 of the present invention includes two memory modules 10a, 10b, each of the memory modules 10a, 10b can be a memory device, and each memory device The whole can be regarded as a single memory block 11a or 11b, so that the two memory modules 10a, 10b form two different memory blocks 11a, 11b, but the number of the memory modules 10a, 10b is set to be included The number of memory blocks 11a, 11b is not limited to this embodiment. For example, the electronic device 1a may add more memory devices, or divide each memory device into two or more memory blocks, etc., depending on the design requirements.

如圖3所示,在本實施例中,在電子裝置1a設置有多個記憶體模組10a、10b之情況下,當任一資料之複數資料區塊欲儲存於記憶體模組10a、10b中時,為了提高資料存取速度,裝置系統會將該資料之複數資料區塊分散為二部分,分別儲存於各個記憶體區塊11a、11b中。As shown in FIG. 3, in the embodiment, when the electronic device 1a is provided with a plurality of memory modules 10a, 10b, when the plurality of data blocks of any data are to be stored in the memory modules 10a, 10b In order to improve the data access speed, the device system will divide the plurality of data blocks of the data into two parts and store them in the respective memory blocks 11a and 11b.

而當控制模組20接受到前述執行指令時,即依據執行指令重新排列儲存於記憶體模組10a、10b中之該資料,將原本儲存於記憶體區塊11b之資料區塊集中儲存於單一記憶體區塊11a中;控制模組20亦同時針對前述對應資料進行更新,以反映出目前各資料區塊所對應之實際儲存位置。藉此,使得前述記憶體區塊11b所儲存資料已被清空,亦即記憶體模組10b本身處於未被使用之狀態。When the control module 20 receives the execution command, the data stored in the memory module 10a, 10b is rearranged according to the execution command, and the data blocks originally stored in the memory block 11b are collectively stored in a single unit. In the memory block 11a, the control module 20 also updates the corresponding data to reflect the actual storage location corresponding to each data block. Thereby, the data stored in the memory block 11b has been emptied, that is, the memory module 10b itself is in an unused state.

在空出了未被使用之記憶體區塊11b後,控制模組20即可通知處理模組30,以命令電源模組40對應關閉開關50b,以中斷對記憶體區塊11b之供電。藉此設計可達到針對不同記憶體模組10執行部分供電部分斷電之效果,以節省不必要之電量消耗。After the unused memory block 11b is vacated, the control module 20 can notify the processing module 30 to instruct the power module 40 to close the switch 50b to interrupt the power supply to the memory block 11b. The design can achieve the effect of powering off part of the power supply part for different memory modules 10 to save unnecessary power consumption.

請參考圖4係本發明之記憶體管理方法之一實施例之流程圖。須注意的是,以下雖以圖1所示之電子裝置1為例說明本發明之記憶體管理方法,但本發明並不以適用於電子裝置1為限,如前述電子裝置1a或任何其他具類似架構之電子裝置亦可適用本發明之方法。如圖2所示,本發明之記憶體管理方法包括步驟S401至步驟S404。以下將詳細說明該方法之各個步驟。Please refer to FIG. 4, which is a flowchart of an embodiment of a memory management method of the present invention. It should be noted that the memory management method of the present invention is described below by taking the electronic device 1 shown in FIG. 1 as an example, but the present invention is not limited to the electronic device 1, such as the foregoing electronic device 1a or any other device. Electronic devices of similar architecture may also be adapted to the method of the present invention. As shown in FIG. 2, the memory management method of the present invention includes steps S401 to S404. The various steps of the method are described in detail below.

步驟S401:接收執行指令。Step S401: Receive an execution instruction.

電子裝置1之處理模組30在載入作業系統後,當系統經閒置一定時間或切換至休眠狀態後,處理模組30即會發出執行指令通知控制模組20,而控制模組20於接收執行指令後即準備進行針對記憶體模組10之節能省電操作。After the processing module 30 of the electronic device 1 is loaded into the operating system, after the system is idle for a certain period of time or switched to the sleep state, the processing module 30 issues an execution command notification control module 20, and the control module 20 receives After the execution of the command, the energy-saving operation for the memory module 10 is prepared.

步驟S402:依據執行指令重新排列儲存於至少一記憶體模組10中之至少一資料,以將至少一資料集中儲存於單一記憶體區塊或多個連續記憶體區塊中。Step S402: Rearrange at least one data stored in the at least one memory module 10 according to the execution instruction to store the at least one data in a single memory block or a plurality of contiguous memory blocks.

在控制模組20接收到執行指令後,即可依據執行指令於至少一記憶體模組之各記憶體區塊間重新排列所儲存中之至少一資料,以將該資料經搬移後集中某些記憶體區塊內,例如前述第一實施例中將資料集中於同一記憶體模組10之連續記憶體區塊中(如連續之記憶體區塊11至14),或如前述第二實施例中將資料集中於多個記憶體模組10a、10b之其中至少一者(如記憶體區塊11a),使得這些記憶體模組得以空出其他未使用之記憶體區塊。需注意的是,在進行資料重新排列之同時,控制模組20亦會同步更新儲存於至少一記憶體模組中之對應資料,以確保資料經搬移後所儲存之實體記憶體位址與虛擬記憶體位址之相關對應,避免資料存取時產生錯誤。After the control module 20 receives the execution instruction, the at least one stored data may be rearranged among the memory blocks of the at least one memory module according to the execution instruction, so that the data is moved and concentrated. In the memory block, for example, in the foregoing first embodiment, the data is concentrated in the contiguous memory block of the same memory module 10 (such as continuous memory blocks 11 to 14), or as in the foregoing second embodiment. The middleware data is concentrated on at least one of the plurality of memory modules 10a, 10b (such as the memory block 11a), so that the memory modules can free other unused memory blocks. It should be noted that, while the data is rearranged, the control module 20 also synchronously updates the corresponding data stored in the at least one memory module to ensure the physical memory address and virtual memory stored after the data is moved. Correspondence of body addresses to avoid errors when accessing data.

步驟S403:停止供電給複數記憶體區塊中未使用之其他記憶體區塊。Step S403: Stop supplying power to other memory blocks that are not used in the plurality of memory blocks.

在完成至少一記憶體模組之資料重新排列,並空出未被使用之記憶體區塊後,控制模組20即可通知處理模組30,以命令電源模組40停止供電給這些未被使用之記憶體區塊;因此電源模組40會關閉對應這些記憶體區塊之供電開關,以針對不同記憶體區塊或記憶體模組達到不同之供電效果。After the data of at least one memory module is rearranged and the unused memory blocks are vacated, the control module 20 can notify the processing module 30 to command the power module 40 to stop supplying power to the unpowered modules. The memory block is used; therefore, the power module 40 turns off the power switch corresponding to the memory blocks to achieve different power supply effects for different memory blocks or memory modules.

此外,於步驟S402前更可包括步驟S404:清除至少一記憶體模組中之所有快取資料(cache)。In addition, before step S402, step S404 may be further included: clearing all cache data in at least one memory module.

在控制模組20針對至少一記憶體模組10進行資料重新排列前,可先通知處理模組30執行至少一記憶體模組中之所有快取資料之清除動作,以減少後續需要搬移排列之資料量。由於電子裝置1在系統執行過程中,會運用記憶體模組暫存大量之快取資料,這些快取資料通常都是可被刪除省略的,因此藉由處理模組30先針對至少一記憶體模組10進行快取資料之清除動作,有助於提升後續資料重新排列之處理速度及減少資源消耗。Before the control module 20 performs data rearrangement on the at least one memory module 10, the processing module 30 may be notified to perform the clearing operation of all the cached data in the at least one memory module to reduce the subsequent need to move the array. The amount of data. Since the electronic device 1 temporarily stores a large amount of cache data by using the memory module during the execution of the system, the cache data can be deleted and deleted. Therefore, the processing module 30 first targets at least one memory. The module 10 performs the clearing operation of the cache data, which helps to improve the processing speed of subsequent data rearrangement and reduce resource consumption.

而在系統自閒置或休眠狀態回復為一般狀態時,處理模組30會通知電源模組40,開啟對應開關以重新恢復對記憶體模組10未使用之記憶體區塊之供電,讓各記憶體模組10回復初始狀態以供系統使用。When the system returns to the normal state from the idle state or the dormant state, the processing module 30 notifies the power module 40 to turn on the corresponding switch to restore the power supply to the memory block not used by the memory module 10, so that each memory is restored. The body module 10 returns to the initial state for use by the system.

請參考圖5係本發明之記憶體管理方法之另一實施例之流程圖。如圖5所示,在本實施例中,本發明之記憶體管理方法包括步驟S501至步驟S506,其中步驟S501至S502與前述步驟S401至S402內容相同,在此不多加贅述。以下將詳細說明該方法中之步驟S503至S506。Please refer to FIG. 5, which is a flowchart of another embodiment of the memory management method of the present invention. As shown in FIG. 5, in the embodiment, the memory management method of the present invention includes steps S501 to S506, wherein steps S501 to S502 are the same as the foregoing steps S401 to S402, and are not described here. Steps S503 to S506 in the method will be described in detail below.

步驟S503:接收中斷指令。Step S503: Receive an interrupt instruction.

於執行步驟S502之過程中,若系統已跳離閒置或休眠狀態,表示使用者可能需要立即使用電子裝置1,此時處理模組30會發出中斷指令至控制模組20。During the execution of step S502, if the system has jumped away from the idle or hibernation state, indicating that the user may need to use the electronic device 1 immediately, the processing module 30 will issue an interrupt command to the control module 20.

步驟S504:判斷目前搬移中之資料之目標資料區塊是否已移入目標記憶體區塊並已更新對應資料。Step S504: It is determined whether the target data block of the currently moved data has been moved into the target memory block and the corresponding data has been updated.

在資料搬移過程中,該資料之複數資料區塊會依照所設定之不同搬移規則而逐一進行搬移。當控制模組20接收中斷指令後,隨即判斷目前於至少一記憶體模組中正在搬移之資料之一目標資料區塊,是否已經依照原本重新排列之規劃而移入一目標記憶體區塊中,並且檢查所儲存之對應資料是否已因應此目標資料區塊之搬移而更新。若前述二個條件均已被滿足,則續行步驟S506;若前述二個條件有任一個未被滿足,則續行步驟S505。During the data transfer process, the multiple data blocks of the data will be moved one by one according to the different moving rules set. After the control module 20 receives the interrupt instruction, it immediately determines whether the target data block of the data currently being moved in the at least one memory module has been moved into a target memory block according to the original rearrangement plan. And check whether the stored corresponding data has been updated in response to the removal of the target data block. If both of the foregoing conditions have been met, then step S506 is continued; if any of the above two conditions is not satisfied, then step S505 is continued.

步驟S505:等待目標資料區塊移入及對應資料更新完成。Step S505: Waiting for the target data block to move in and the corresponding data update is completed.

經前述步驟S504判斷前述任一個條件未被滿足時,控制模組20會繼續執行目前目標資料區塊之移入操作及相關對應資料之更新操作。而在目標資料區塊移入及對應資料更新均完成後,再續行步驟S506。When it is determined by the foregoing step S504 that any of the foregoing conditions is not satisfied, the control module 20 continues to perform the current target data block moving operation and the related corresponding data update operation. After the target data block is moved in and the corresponding data update is completed, the process proceeds to step S506.

步驟S506:中斷至少一資料之重新排列。Step S506: interrupting the rearrangement of at least one data.

當前述目標資料區塊移入及對應資料更新均完成後,控制模組20判斷目前之資料重新排列操作可暫且告一段落,因此可因應前述中斷指令,中斷至少一資料之重新排列,並把對至少一記憶體模組之控制權限交還給處理模組30。藉此,在使用者接續操作電子裝置而進行相關資料存取時,資料不會發生存取錯誤等問題。After the target data block moves in and the corresponding data update is completed, the control module 20 determines that the current data rearrangement operation can be temporarily terminated, so that at least one data rearrangement can be interrupted according to the foregoing interrupt instruction, and at least The control authority of a memory module is returned to the processing module 30. Thereby, when the user continues to operate the electronic device and accesses the related data, the data does not have an access error or the like.

藉由本發明之設計,在系統閒置或休眠等狀態下,可將記憶體模組所儲存之資料集中於部份記憶體區塊內,並針對未被使用之其他記憶體區塊執行斷電,以節省該些記憶體區塊不必要之電量消耗,相較於前案無需額外進行資料壓縮與解壓縮之程序,更能加快執行效率並達到有效節能。According to the design of the present invention, the data stored in the memory module can be concentrated in a part of the memory block in a state where the system is idle or in a sleep state, and power is cut off for other memory blocks that are not used. In order to save unnecessary power consumption of the memory blocks, it is not necessary to additionally perform data compression and decompression procedures, which can speed up execution efficiency and achieve effective energy saving.

綜上所陳,本發明無論就目的、手段及功效,在在均顯示其迥異於習知技術之特徵,為一大突破,懇請貴審查委員明察,早日賜准專利,俾嘉惠社會,實感德便。惟須注意,上述實施例僅為例示性說明本發明之原理及其功效,而非用於限制本發明之範圍。任何熟於此項技藝之人士均可在不違背本發明之技術原理及精神下,對實施例作修改與變化。本發明之權利保護範圍應如後述之申請專利範圍所述。In summary, the present invention is a breakthrough in terms of its purpose, means and efficacy, and it is different from the characteristics of the prior art. It is a great breakthrough for the reviewer to ask for an early patent, and to benefit the society. Debian. It is to be noted that the above-described embodiments are merely illustrative of the principles of the invention and its advantages, and are not intended to limit the scope of the invention. Modifications and variations of the embodiments can be made by those skilled in the art without departing from the spirit and scope of the invention. The scope of protection of the present invention should be as described in the scope of the patent application to be described later.

1、1a...電子裝置1, 1a. . . Electronic device

10、10a、10b...記憶體模組10, 10a, 10b. . . Memory module

11、11a、11b、12、13、14、15、16、17、18...記憶體區塊11, 11a, 11b, 12, 13, 14, 15, 16, 17, 18. . . Memory block

20...控制模組20. . . Control module

30...處理模組30. . . Processing module

40...電源模組40. . . Power module

50a、50b、51、52、53、54、55、56、57、58...開關50a, 50b, 51, 52, 53, 54, 55, 56, 57, 58. . . switch

圖1係本發明之電子裝置之第一實施例之系統方塊圖。1 is a system block diagram of a first embodiment of an electronic device of the present invention.

圖2(a)係本發明之電子裝置之第一實施例之記憶體模組進行資料重新排列前之示意圖。2(a) is a schematic view showing the memory module of the first embodiment of the electronic device of the present invention before data rearrangement.

圖2(b)係本發明之電子裝置之第一實施例之記憶體模組進行資料重新排列後之示意圖。FIG. 2(b) is a schematic diagram showing the rearrangement of data by the memory module of the first embodiment of the electronic device of the present invention.

圖3係本發明之電子裝置之第二實施例之系統方塊圖。3 is a system block diagram of a second embodiment of the electronic device of the present invention.

圖4係本發明之記憶體管理方法之一實施例之流程圖。4 is a flow chart of an embodiment of a memory management method of the present invention.

圖5係本發明之記憶體管理方法之另一實施例之流程圖。Figure 5 is a flow chart showing another embodiment of the memory management method of the present invention.

Claims (8)

一種記憶體管理方法,係應用於一電子裝置,該電子裝置包括形成複數記憶體區塊之至少一記憶體模組,該方法包括以下步驟:接收一執行指令;依據該執行指令重新排列儲存於該至少一記憶體模組中之至少一資料,以將該至少一資料集中儲存於單一該記憶體區塊或多個連續之該記憶體區塊,且同步更新儲存於該至少一記憶體模組內之一對應資料,該對應資料為記錄該至少一資料之各資料區塊所對應之一虛擬記憶體位址及儲存於該複數記憶體區塊內之一實體記憶體位址;以及停止供電給該複數記憶體區塊中未使用之其他該記憶體區塊。 A memory management method is applied to an electronic device, the electronic device comprising at least one memory module forming a plurality of memory blocks, the method comprising the steps of: receiving an execution instruction; rearranging and storing according to the execution instruction Storing at least one of the at least one memory module in a single memory block or a plurality of consecutive memory blocks, and simultaneously updating the memory in the at least one memory module One of the group corresponding data, the corresponding data is a virtual memory address corresponding to each data block of the at least one data record and one physical memory address stored in the plurality of memory blocks; and the power supply is stopped. The other memory block that is not used in the plurality of memory blocks. 如申請專利範圍第1項所述之記憶體管理方法,更包括以下步驟:於重新排列儲存於該至少一記憶體模組中之該至少一資料前,清除該至少一記憶體模組中之所有快取資料(cache)。 The memory management method of claim 1, further comprising the steps of: clearing the at least one memory module before rearranging the at least one data stored in the at least one memory module All cached data (cache). 如申請專利範圍第1項所述之記憶體管理方法,更包括以下步驟:接收一中斷指令;判斷目前所搬移該資料之一目標資料區塊是否已移入一目標記憶體區塊並已更新該對應資料;以及 當目前所搬移之該資料之任一該目標資料區塊已移入該目標記憶體區塊並已對應更新該對應資料後,中斷該至少一資料之重新排列。 The memory management method of claim 1, further comprising the steps of: receiving an interrupt instruction; determining whether a target data block of the currently moved data has been moved into a target memory block and has been updated. Corresponding information; When any of the target data blocks of the currently moved data has been moved into the target memory block and the corresponding data has been updated correspondingly, the rearrangement of the at least one data is interrupted. 如申請專利範圍第1項所述之記憶體管理方法,其中該至少一記憶體模組為一單一記憶體模組,且該單一記憶體模組包括該複數記憶體區塊。 The memory management method of claim 1, wherein the at least one memory module is a single memory module, and the single memory module comprises the plurality of memory blocks. 一種電子裝置,包括:至少一記憶體模組,包括複數記憶體區塊,用以儲存至少一資料,各該資料係以複數資料區塊形式儲存於該複數記憶體區塊中;一控制模組,用以接收一執行指令以重新排列儲存於該至少一記憶體模組中之該至少一資料,以將該至少一資料集中儲存於單一該記憶體區塊或多個連續之該記憶體區塊,且該控制模組同步更新儲存於該至少一記憶體模組內之一對應資料,該對應資料為記錄該至少一資料之各資料區塊所對應之一虛擬記憶體位址及儲存於該複數記憶體區塊內之一實體記憶體位址;一電源模組,用以供電給該複數記憶體區塊;以及一處理模組,用以發出該執行指令,並於該控制模組完成該至少一資料之重新排列後,通知該電源模組停止供電給該複數記憶體區塊中未使用之其他該記憶體區塊。 An electronic device comprising: at least one memory module, comprising a plurality of memory blocks for storing at least one data, each of the data being stored in the plurality of memory blocks in a plurality of data blocks; a control module a group, configured to receive an execution command to rearrange the at least one data stored in the at least one memory module to store the at least one data in a single memory block or a plurality of consecutive memory blocks a block, and the control module synchronously updates one of the corresponding data stored in the at least one memory module, wherein the corresponding data is a virtual memory address corresponding to each data block of the at least one data record and is stored in the block a physical memory address in the plurality of memory blocks; a power module for supplying power to the plurality of memory blocks; and a processing module for issuing the execution command and completing the control module After the at least one data is rearranged, the power module is notified to stop supplying power to the other memory blocks that are not used in the plurality of memory blocks. 如申請專利範圍第5項所述之電子裝置,其中於該控制模組重新排列儲存於該至少一記憶體模組中之該至少一資料前,該處理模組清除該至少一記憶體模組中之所有快取資料。 The electronic device of claim 5, wherein the processing module clears the at least one memory module before the control module rearranges the at least one data stored in the at least one memory module All cached data in the middle. 如申請專利範圍第5項所述之電子裝置,其中當該控制模組於重新排列該至少一資料之過程中接收一中斷指令時,若該控制模組判斷目前所搬移該資料之任一目標資料區塊已移入一目標記憶體區塊並已更新該對應資料,則中斷該至少一資料之重新排列。 The electronic device of claim 5, wherein when the control module receives an interrupt instruction during the rearrangement of the at least one data, if the control module determines any target of the current data being moved After the data block has been moved into a target memory block and the corresponding data has been updated, the rearrangement of the at least one data is interrupted. 如申請專利範圍第5項所述之電子裝置,其中該至少一記憶體模組為一單一記憶體模組,且該單一記憶體模組包括該複數記憶體區塊。 The electronic device of claim 5, wherein the at least one memory module is a single memory module, and the single memory module comprises the plurality of memory blocks.
TW101100674A 2012-01-06 2012-01-06 Memory managing method and electronic apparatus using the same TWI493563B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW101100674A TWI493563B (en) 2012-01-06 2012-01-06 Memory managing method and electronic apparatus using the same

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW101100674A TWI493563B (en) 2012-01-06 2012-01-06 Memory managing method and electronic apparatus using the same

Publications (2)

Publication Number Publication Date
TW201329995A TW201329995A (en) 2013-07-16
TWI493563B true TWI493563B (en) 2015-07-21

Family

ID=49225810

Family Applications (1)

Application Number Title Priority Date Filing Date
TW101100674A TWI493563B (en) 2012-01-06 2012-01-06 Memory managing method and electronic apparatus using the same

Country Status (1)

Country Link
TW (1) TWI493563B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201533657A (en) * 2014-02-18 2015-09-01 Toshiba Kk Information processing system and storage device
TWI730332B (en) 2019-05-27 2021-06-11 瑞昱半導體股份有限公司 Processing system and control method thereof

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061448A1 (en) * 2001-09-27 2003-03-27 International Business Machines Corporation Selectively powering portions of system memory in a network server to conserve energy
US20040236908A1 (en) * 2003-05-22 2004-11-25 Katsuyoshi Suzuki Disk array apparatus and method for controlling the same
US20090225618A1 (en) * 2008-03-05 2009-09-10 Inventec Corporation Power management module for memory module
US20100250980A1 (en) * 2009-03-30 2010-09-30 Mediatek Inc. Methods for reducing power consumption and devices using the same
US20110138387A1 (en) * 2008-08-13 2011-06-09 Hewlett-Packard Development Company, L.P. Dynamic Utilization of Power-Down Modes in Multi-Core Memory Modules
TWI343519B (en) * 2006-06-08 2011-06-11 Intel Corp Power consumption reduction through compression of portion of data in memory
US8037322B2 (en) * 2007-03-13 2011-10-11 Fujitsu Limited Power consumption reduction device for data backup

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030061448A1 (en) * 2001-09-27 2003-03-27 International Business Machines Corporation Selectively powering portions of system memory in a network server to conserve energy
US20040236908A1 (en) * 2003-05-22 2004-11-25 Katsuyoshi Suzuki Disk array apparatus and method for controlling the same
TWI343519B (en) * 2006-06-08 2011-06-11 Intel Corp Power consumption reduction through compression of portion of data in memory
US8037322B2 (en) * 2007-03-13 2011-10-11 Fujitsu Limited Power consumption reduction device for data backup
US20090225618A1 (en) * 2008-03-05 2009-09-10 Inventec Corporation Power management module for memory module
US20110138387A1 (en) * 2008-08-13 2011-06-09 Hewlett-Packard Development Company, L.P. Dynamic Utilization of Power-Down Modes in Multi-Core Memory Modules
US20100250980A1 (en) * 2009-03-30 2010-09-30 Mediatek Inc. Methods for reducing power consumption and devices using the same

Also Published As

Publication number Publication date
TW201329995A (en) 2013-07-16

Similar Documents

Publication Publication Date Title
JP6817273B2 (en) Devices and methods for providing cache transfer by a non-volatile high capacity memory system
US9817596B2 (en) Non-volatile memory systems and methods of managing power of the same
US10795823B2 (en) Dynamic partial power down of memory-side cache in a 2-level memory hierarchy
JP4461187B1 (en) Nonvolatile semiconductor memory drive device, information processing device, and storage area management method in nonvolatile semiconductor memory drive device
US20160217069A1 (en) Host Controlled Hybrid Storage Device
JP2007183961A (en) Hard disk drive cache memory and playback device
CN105630405B (en) A kind of storage system and the reading/writing method using the storage system
WO2005069148A2 (en) Memory management method and related system
CN105934747B (en) Hybrid memory module and system and method for operating the same
TWI224728B (en) Method and related apparatus for maintaining stored data of a dynamic random access memory
US10146483B2 (en) Memory system
JP2011095916A (en) Electronic apparatus
TWI553549B (en) Processor including multiple dissimilar processor cores
JP4155545B2 (en) Computer system and data transfer control method
US10466917B2 (en) Indirection structure prefetch based on prior state information
US20150234448A1 (en) Information processing system and storage device
TWI493563B (en) Memory managing method and electronic apparatus using the same
CN104808950A (en) Mode-dependent access to embedded storage element
US20070094454A1 (en) Program memory source switching for high speed and/or low power program execution in a digital processor
WO2019041903A1 (en) Nonvolatile memory based computing device and use method therefor
US20180335827A1 (en) Apparatus and method to control power-supply to a memory based on data-access states of individual memory blocks included therein
JP2011018237A (en) Disk array device and method for controlling the same
TWI704454B (en) Mapping table management method applied to solid state storage device
TWI529529B (en) Embedded device, ramdisk of embedded device and method of accessing ramdisk of embedded device
CN116126127A (en) Power supply method, hard disk and computing device