CN105988733A - Storage device, electronic device and data access method thereof - Google Patents
Storage device, electronic device and data access method thereof Download PDFInfo
- Publication number
- CN105988733A CN105988733A CN201510096180.2A CN201510096180A CN105988733A CN 105988733 A CN105988733 A CN 105988733A CN 201510096180 A CN201510096180 A CN 201510096180A CN 105988733 A CN105988733 A CN 105988733A
- Authority
- CN
- China
- Prior art keywords
- data
- storage device
- hard disk
- saving mode
- write
- Prior art date
- Legal status (The legal status 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 status listed.)
- Pending
Links
Landscapes
- Power Sources (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
Description
技术领域technical field
本发明是有关于一种数据存取方法及装置,且特别是有关于一种存储装置、电子装置及其数据存取方法。The present invention relates to a data access method and device, and in particular to a storage device, an electronic device and a data access method thereof.
背景技术Background technique
随着电子产品与网络愈来愈密切结合,未来的产品将以系统进入休息时,也能与网络保持连结作为目标。当外部装置要存取产品内的数据时,也不必叫醒整个系统。例如,微软公司先前所推动的连线暂停(Connected Standby,简称:CS)系统,即是在系统进入休眠状态,应用程序处于暂停(suspend)状态时,装置依旧与网络维持连线。As electronic products are more and more closely integrated with the network, future products will aim to maintain connection with the network even when the system is at rest. When an external device wants to access data in the product, it is not necessary to wake up the entire system. For example, the Connected Standby (CS) system previously promoted by Microsoft Corporation means that when the system enters a dormant state and the application program is in a suspended state, the device remains connected to the network.
然而,上述功能实与传统硬盘的运作方式互相抵触,因为要读取硬盘势必要将硬盘转起,使用者一定会听到马达转动的声音。再者,硬盘转起之后对震动的敏感度极高,若在转动时摇晃到硬盘,即有可能造成硬盘损坏。有鉴于此,有必要提供适当的数据存取方法,来避免硬盘在系统进入省电模式时转起。However, the above-mentioned functions are actually in conflict with the operation of traditional hard disks, because the hard disk must be rotated to read the hard disk, and the user will definitely hear the sound of the motor rotating. Furthermore, the hard disk is highly sensitive to vibration after spinning up. If the hard disk is shaken during rotation, it may cause damage to the hard disk. In view of this, it is necessary to provide an appropriate data access method to prevent the hard disk from spinning up when the system enters the power saving mode.
发明内容Contents of the invention
本发明提供一种存储装置、电子装置及其数据存取方法,通过在省电模式中利用存储器提供数据的读取及写入,可避免硬盘频繁地转起而造成损坏。The invention provides a storage device, an electronic device and a data access method thereof. By using the storage device to read and write data in the power-saving mode, the hard disk can be prevented from being damaged due to frequent rotation.
本发明的数据存取方法,适用于具有存储装置的电子装置,此存储装置具有硬盘及用以存储硬盘中部分数据的存储器装置。此方法是在电子装置进入省电模式时,启用存储装置的供电暂转(Power Up In Standby,简称:PUIS)模式,以在接收到对于存储装置的写入指令时,优先将写入指令所要写入的数据写入存储器装置;而在接收到对于存储装置的读取指令时,则优先从存储器装置读取读取指令所要读取的数据。The data access method of the present invention is suitable for an electronic device with a storage device, and the storage device has a hard disk and a memory device for storing part of the data in the hard disk. The method is to enable the power supply temporary transfer (Power Up In Standby, PUIS) mode of the storage device when the electronic device enters the power saving mode, so that when a write command for the storage device is received, priority will be given to the storage device required by the write command. The written data is written into the memory device; and when a read command for the storage device is received, the data to be read by the read command is preferentially read from the memory device.
本发明的数据存取方法,适用于具有存储器装置及存储装置的电子装置,其中存储器装置存储存储装置的部分数据。此方法是在电子装置进入省电模式时,启用高级电源管理(Advanced power management,简称:APM)模式,以拦截对于存储装置的写入指令及读取指令,而在接收到对于存储装置的写入指令时,优先将写入指令所要写入的数据写入存储器装置;在接收到对于存储装置的读取指令时,则优先从存储器装置读取读取指令所要读取的数据。The data access method of the present invention is applicable to an electronic device having a memory device and a storage device, wherein the memory device stores part of the data of the storage device. In this method, when the electronic device enters the power saving mode, the advanced power management (Advanced power management, referred to as: APM) mode is enabled to intercept the write command and the read command to the storage device, and when the write command to the storage device is received When a command is input, the data to be written by the write command is preferentially written into the memory device; when a read command to the storage device is received, the data to be read by the read command is preferentially read from the memory device.
本发明的存储装置,适于配置于电子装置,其包括硬盘、存储器装置及控制器。其中,存储器装置用以存储硬盘的部分数据。控制器耦接硬盘及存储器装置,用以接收电子装置进入省电模式的触发信号,以启用供电暂转模式,而在接收到电子装置的写入指令时,优先将写入指令所要写入的数据写入存储器装置;在接收到电子装置的读取指令时,优先从存储器装置读取读取指令所要读取的数据。The storage device of the present invention is suitable for being configured in an electronic device, which includes a hard disk, a memory device and a controller. Wherein, the memory device is used for storing part of data of the hard disk. The controller is coupled to the hard disk and the memory device, and is used to receive a trigger signal for the electronic device to enter the power saving mode to enable the power supply temporary mode, and when receiving a write command from the electronic device, it will prioritize the data to be written by the write command. Data is written into the memory device; when receiving a read command from the electronic device, the data to be read by the read command is preferentially read from the memory device.
本发明的电子装置包括存储装置、存储器装置及处理器。其中,存储器装置用以存储硬盘的部分数据。处理器耦接存储装置及存储器装置,用以接收电子装置进入省电模式的触发信号,以启用高级电源管理模式,拦截对于存储装置的写入指令及读取指令,而在接收到电子装置的写入指令时,优先将写入指令所要写入的数据写入存储器装置;在接收到电子装置的读取指令时,优先从存储器装置读取读取指令所要读取的数据。The electronic device of the present invention includes a storage device, a memory device and a processor. Wherein, the memory device is used for storing part of data of the hard disk. The processor is coupled to the storage device and the memory device, and is used to receive a trigger signal for the electronic device to enter the power saving mode, to enable the advanced power management mode, intercept write commands and read commands to the storage device, and receive the electronic device's When writing a command, the data to be written by the write command is preferentially written into the memory device; when receiving the read command from the electronic device, the data to be read by the read command is preferentially read from the memory device.
基于上述,本发明的存储装置、电子装置及其数据存取方法是在存储装置内配置存储器装置或是在电子装置中配置存储器装置来存储硬盘的部分数据。在系统进入省电模式后,每当接收到对于硬盘的读取或写入指令时,系统即会优先存取存储器装置。藉此,可避免硬盘在省电模式中频繁地转起而造成损坏。Based on the above, the storage device, the electronic device and the data access method thereof of the present invention configure a memory device in the storage device or configure a memory device in the electronic device to store part of the data of the hard disk. After the system enters the power saving mode, whenever a read or write command to the hard disk is received, the system will preferentially access the memory device. In this way, the hard disk can be prevented from being damaged due to frequent spin-ups in the power-saving mode.
为让本发明的上述特征和优点能更明显易懂,下文特举实施例,并配合附图作详细说明如下。In order to make the above-mentioned features and advantages of the present invention more comprehensible, the following specific embodiments are described in detail with reference to the accompanying drawings.
附图说明Description of drawings
图1是本发明一实施例所示出的存储装置的结构示意图;FIG. 1 is a schematic structural diagram of a storage device shown in an embodiment of the present invention;
图2是本发明一实施例所示出的数据存取方法的流程图;Fig. 2 is a flowchart of a data access method shown in an embodiment of the present invention;
图3是本发明一实施例所示出的数据存取方法的范例;FIG. 3 is an example of a data access method shown in an embodiment of the present invention;
图4是本发明一实施例所示出的电子装置的结构示意图;FIG. 4 is a schematic structural diagram of an electronic device shown in an embodiment of the present invention;
图5是本发明一实施例所示出的数据存取方法的流程图;Fig. 5 is a flowchart of a data access method shown in an embodiment of the present invention;
图6是本发明一实施例所示出的数据存取方法的范例。FIG. 6 is an example of a data access method shown in an embodiment of the present invention.
附图标记说明:Explanation of reference signs:
10、42:存储装置;10, 42: storage device;
12:硬盘;12: hard disk;
14、44:存储器装置;14, 44: memory device;
16:控制器;16: controller;
40:电子装置;40: electronic device;
46:处理器;46: processor;
S202~S206、S502~S506:步骤。S202~S206, S502~S506: steps.
具体实施方式detailed description
本发明在操作系统进入省电模式时,利用固态混合式硬盘(Solid StateHybrid Drive,简称:SSHD)本身既有的与非快闪存储器(NAND Flash)存储硬盘的部分数据并优先提供电子装置存取数据,搭配硬盘的供电暂转(Power Up In Standby,简称:PUIS)模式,即可达成无需转动硬盘也能提供数据存取功能。此外,针对使用传统硬盘(Hard Disk Drive,简称:HDD)的电子装置,本发明也通过在电子装置中额外配置存储器装置来存储硬盘的部分数据,并在操作系统进入省电模式时优先提供电子装置存取数据,同样无需转动硬盘即能提供数据存取功能。When the operating system enters the power-saving mode, the present invention uses the existing solid state hybrid drive (SSHD) itself and non-flash memory (NAND Flash) to store part of the data on the hard disk and provide priority for electronic devices to access Data, combined with the Power Up In Standby (PUIS) mode of the hard disk, can provide data access function without rotating the hard disk. In addition, for an electronic device using a traditional hard disk (Hard Disk Drive, HDD for short), the present invention also configures an additional memory device in the electronic device to store part of the data of the hard disk, and provides priority for electronic devices when the operating system enters the power saving mode. The device accesses data, and can also provide data access functions without rotating the hard disk.
图1是本发明一实施例所示出的存储装置的结构示意图。请参照图1,本实施例的存储装置10例如是配置于计算机、工作站、伺服器等电子装置(未示出)中或外接于电子装置的固态混合式硬盘(SSHD),其是由具有不同存取速度的两个或两个以上的存储媒体组合而成,例如图1所示的硬盘12及存储器装置14。存储装置10还包括控制器16,其耦接硬盘12、存储器装置14及电子装置,而可用以处理电子装置对于存储装置10的读取及写入指令。FIG. 1 is a schematic structural diagram of a storage device according to an embodiment of the present invention. Please refer to FIG. 1 , the storage device 10 of the present embodiment is, for example, a solid-state hybrid hard disk (SSHD) configured in electronic devices (not shown) such as computers, workstations, servers, or externally connected to electronic devices. Two or more storage media with high access speed are combined, such as the hard disk 12 and the memory device 14 shown in FIG. 1 . The storage device 10 further includes a controller 16 , which is coupled to the hard disk 12 , the memory device 14 and the electronic device, and can be used to process read and write commands from the electronic device to the storage device 10 .
硬盘(Hard Disk Drive,简称:HDD)12例如是使用磁盘为基础的非易失性存储媒体,由磁头利用电磁流改变极性方式,将数据写到磁盘上。存储器装置14例如是与非快闪存储器(NAND Flash memory)或其他非易失性(Non-volatile)存储器或使用上述元件的装置,其可通过控制器16的控制,存储硬盘12中的部分数据。The Hard Disk Drive (HDD for short) 12 is, for example, a disk-based non-volatile storage medium, and the magnetic head uses electromagnetic current to change polarity to write data to the disk. The memory device 14 is, for example, a non-flash memory (NAND Flash memory) or other non-volatile (Non-volatile) memory or a device using the above elements, which can store part of the data in the hard disk 12 through the control of the controller 16 .
控制器16例如是嵌入式控制器(Embedded Controller,简称:EC)或控制芯片(Control chip),其耦接硬盘12及存储器装置14,用以接收电子装置传送的信号及指令,而据以存取硬盘12及存储器装置14中的数据。The controller 16 is, for example, an embedded controller (Embedded Controller, referred to as: EC) or a control chip (Control chip), which is coupled to the hard disk 12 and the memory device 14, and is used to receive signals and instructions transmitted by the electronic device, and store them accordingly. The data in the hard disk 12 and the memory device 14 are fetched.
详言之,图2是本发明一实施例所示出的数据存取方法的流程图。请同时参照图1及图2,本实施例的方法适用于上述的存储装置10。以下即搭配图1中存储装置10的各项元件,说明本实施例方法的详细流程。In detail, FIG. 2 is a flowchart of a data access method according to an embodiment of the present invention. Please refer to FIG. 1 and FIG. 2 at the same time. The method of this embodiment is applicable to the above-mentioned storage device 10 . The detailed flow of the method of this embodiment will be described below in combination with various elements of the storage device 10 in FIG. 1 .
首先,控制器16接收电子装置的操作系统进入省电模式所产生的触发信号,而据以启用存储装置10的供电暂转模式(步骤S202)。其中,在供电暂转模式下,存储装置10会停止手上的工作,让硬盘12停止转动,且将硬盘12的存取规则切换为防止转动算法(Spinning Preventing Algorithm),以确保硬盘12不会在过电时马上转动。藉此,可确保电子装置在通过网络唤醒时,不会造成硬盘12转动,避免硬盘12因此损坏。上述的省电模式例如是休眠模式(Suspend to Disk,简称:S4),但本发明实施例不限于此。Firstly, the controller 16 receives a trigger signal generated by the operating system of the electronic device entering the power saving mode, thereby enabling the power supply suspending mode of the storage device 10 (step S202 ). Among them, in the power supply temporary rotation mode, the storage device 10 will stop the work at hand, make the hard disk 12 stop spinning, and switch the access rule of the hard disk 12 to prevent spinning algorithm (Spinning Preventing Algorithm), so as to ensure that the hard disk 12 will not Turn immediately when there is a power failure. In this way, it can be ensured that when the electronic device wakes up through the network, the hard disk 12 will not be caused to rotate, and the hard disk 12 will not be damaged accordingly. The aforementioned power saving mode is, for example, a sleep mode (Suspend to Disk, S4 for short), but the embodiment of the present invention is not limited thereto.
需说明的是,控制器16在启用存储装置10的供电暂转模式时,例如会将存储装置10中在省电模式下存取频率高于一门槛值的数据由硬盘12复制到存储器装置14,以便提供电子装置存取。同时,控制器也会将省电模式下存取频率低于门槛值的数据由存储器装置14复制到硬盘12后,将此数据自存储器装置14中删除,以空出存储器装置14的空间。It should be noted that, when the controller 16 activates the power supply temporary mode of the storage device 10, for example, the data in the storage device 10 whose access frequency is higher than a threshold in the power saving mode will be copied from the hard disk 12 to the storage device 14 to provide electronic device access. At the same time, the controller also copies the data whose access frequency is lower than the threshold in the power saving mode from the memory device 14 to the hard disk 12 , and then deletes the data from the memory device 14 to free up space in the memory device 14 .
在供电暂转模式下,控制器16在接收到电子装置对于存储装置10的写入指令时,会将写入指令所要写入的数据优先写入存储器装置14(步骤S204)。详言之,控制器16收到来自电子装置的写入指令时,会搭配供电暂转模式来做动,先将硬盘12上电,但不转起碟盘,然后将写入指令所要写入的数据摆入存储器装置14。其中,控制器16的固件会设计成尽量避免硬盘12转动,除非存储器装置14的空间不敷使用。也就是说,控制器16在接收到写入指令时,会先判断存储器装置14的剩余空间是否足以存放写入指令所要写入的数据,若剩余空间不足,控制器16才会转动硬盘12以将写入指令所要写入的数据写入。In the temporary power supply mode, when the controller 16 receives a write command from the electronic device to the storage device 10 , it will preferentially write the data to be written by the write command into the memory device 14 (step S204 ). To be more specific, when the controller 16 receives a write command from the electronic device, it will operate in conjunction with the power supply temporary mode. First, the hard disk 12 is powered on, but the disk is not turned on, and then the write command will be written. The data is placed into the memory device 14. Wherein, the firmware of the controller 16 is designed to prevent the hard disk 12 from rotating unless the space of the memory device 14 is insufficient. That is to say, when the controller 16 receives the write command, it will first judge whether the remaining space of the memory device 14 is enough to store the data to be written by the write command. If the remaining space is not enough, the controller 16 will rotate the hard disk 12 to Write the data to be written by the write command.
另一方面,在供电暂转模式下,控制器16在接收到电子装置对于存储装置10的读取指令时,会优先从存储器装置14读取读取指令所要读取的数据(步骤S206)。详言之,控制器16收到来自电子装置的读取指令时,会先判断存储器装置14是否存有读取指令所要读取的数据,若存储器装置14没有读取指令所要读取的数据,才会转动硬盘12以读取读取指令所要读取的数据。On the other hand, in the temporary power supply mode, when the controller 16 receives a read command from the electronic device to the storage device 10 , it will preferentially read the data to be read by the read command from the memory device 14 (step S206 ). In detail, when the controller 16 receives the read command from the electronic device, it will first determine whether the memory device 14 stores the data to be read by the read command. If the memory device 14 does not have the data to be read by the read command, Only then will the hard disk 12 be rotated to read the data to be read by the read command.
需说明的是,针对读取的部分,由于存储装置10无法预知电子装置需要存取的数据会在硬盘12或是存储器装置14中,但电子装置在省电模式下需要存取的数据大多集中在某些特定数据,故若能将这些特定数据先行复制到存储器装置14中,即能够有效减少硬盘12在省电模式下转起的次数。据此,在一实施例中,控制器16例如会在启用存储装置10的供电暂转模式时,执行一种学习算法,统计电子装置在省电模式下对于硬盘12中各笔数据的存取频率,以便在电子装置进入省电模式时,即先将存取频率高于门槛值的数据由硬盘12复制到存储器装置14,藉此提供电子装置在省电模式下存取使用。It should be noted that for the part of reading, because the storage device 10 cannot predict that the data that the electronic device needs to access will be in the hard disk 12 or the memory device 14, but most of the data that the electronic device needs to access in the power saving mode is concentrated For some specific data, if these specific data can be copied to the memory device 14 in advance, the number of spin-ups of the hard disk 12 in the power-saving mode can be effectively reduced. Accordingly, in one embodiment, the controller 16, for example, executes a learning algorithm when the power supply temporary mode of the storage device 10 is enabled, and counts the access of each data in the hard disk 12 by the electronic device in the power saving mode. Frequency, so that when the electronic device enters the power saving mode, the data whose access frequency is higher than the threshold value is first copied from the hard disk 12 to the memory device 14, thereby providing the electronic device with access in the power saving mode.
举例来说,图3是本发明一实施例所示出的数据存取方法的范例。请参照图3,本实施例在系统电源状态由正常运作模式进入省电模式时,启用供电暂转模式,从而停止硬盘转动,并执行防止转动的存取算法,尽量避免转动硬盘;而在系统电源状态离开省电模式时,则会离开供电暂转模式,从而恢复硬盘转动,并恢复到一般的存取算法。其中,在电子装置离开省电模式时,除了会将存储装置的供电暂转模式关闭外,还会转动硬盘以将供电暂转模式期间写入存储器装置的数据搬移至硬盘。For example, FIG. 3 is an example of a data access method shown in an embodiment of the present invention. Please refer to Fig. 3, when the present embodiment enters the power-saving mode from the normal operation mode in the system power state, the power supply temporary rotation mode is enabled, thereby stopping the rotation of the hard disk, and executing the access algorithm for preventing rotation, and avoiding the rotation of the hard disk as much as possible; and in the system When the power state leaves the power saving mode, it will leave the power supply temporary mode, thereby resuming the rotation of the hard disk and returning to the normal access algorithm. Wherein, when the electronic device leaves the power saving mode, in addition to turning off the power supply temporary mode of the storage device, the hard disk is rotated to transfer the data written in the memory device during the power supply temporary mode to the hard disk.
通过上述的数据存取方法,本实施例的存储装置即可在供电暂转模式下,利用存储器暂存数据并优先提供电子装置存取数据,从而减少硬盘转起的频率,避免硬盘损坏。Through the above data access method, the storage device of this embodiment can use the memory to temporarily store data and give priority to electronic devices to access data in the power supply temporary mode, thereby reducing the frequency of hard disk spin-up and avoiding hard disk damage.
需说明的是,上述实施例主要是针对本身同时具有存储器及硬盘的固态混合式硬盘所设计的数据存取方法,其可通过更改碟机的固件来控制存储器的存取。然而,对于传统硬盘而言,由于本身不具备存储器,故不能利用碟机的固件来控制存储器的存取。对此,本发明的一实施例在电子装置中额外装载一个存储器,并由电子装置的处理器直接管理存储器及硬盘之间的数据存取。以下则再举一实施例详细说明。It should be noted that the above-mentioned embodiments are mainly designed for the data access method of the solid-state hybrid hard disk which has both memory and hard disk. It can control the memory access by changing the firmware of the disk drive. However, for a traditional hard disk, since it does not have a memory, the firmware of the disk drive cannot be used to control the access of the memory. For this, an embodiment of the present invention loads an additional memory in the electronic device, and the processor of the electronic device directly manages the data access between the memory and the hard disk. Hereinafter, another embodiment will be given in detail.
图4是本发明一实施例所示出的电子装置的结构示意图。请参照图4,本实施例的电子装置40例如是计算机、工作站或伺服器,其中包括存储装置42、存储器装置44及处理器46,其功能分述如下。FIG. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. Referring to FIG. 4 , the electronic device 40 of this embodiment is, for example, a computer, a workstation or a server, and includes a storage device 42 , a memory device 44 and a processor 46 , and their functions are described below.
存储装置42例如是硬盘。存储器装置44例如是与非快闪存储器,或是包含与非快闪存储器的快取固态硬盘(Cache SSD)或嵌入式多媒体卡(Embedded MultiMediaCard,简称:eMMC),或其他种类的非易失性存储器或装置,本实施例不限制其种类。存储器装置44可通过处理器46的控制,存储存储装置42中的部分数据。The storage device 42 is, for example, a hard disk. The memory device 44 is, for example, an NAND flash memory, or a fast access solid-state hard disk (Cache SSD) or an embedded multimedia card (Embedded MultiMediaCard, referred to as: eMMC) including an NAND flash memory, or other types of non-volatile The type of memory or device is not limited in this embodiment. The memory device 44 can store part of the data in the storage device 42 under the control of the processor 46 .
处理器46例如是中央处理单元(Central Processing Unit,简称:CPU),或是其他可编程的一般用途或特殊用途的微处理器(Microprocessor)、数字信号处理器(Digital Signal Processor,简称:DSP)、可编程控制器、专用集成电路(Application Specific Integrated Circuits,简称:ASIC)、可编程逻辑装置(Programmable Logic Device,简称:PLD)或其他类似装置或这些装置的组合,其耦接存储装置42及存储器装置44,而用以处理电子装置40传送的信号及指令,而据以存取存储装置42及存储器装置44的数据。The processor 46 is, for example, a central processing unit (Central Processing Unit, referred to as: CPU), or other programmable general purpose or special purpose microprocessor (Microprocessor), digital signal processor (Digital Signal Processor, referred to as: DSP) , a programmable controller, an application specific integrated circuit (Application Specific Integrated Circuits, referred to as ASIC), a programmable logic device (Programmable Logic Device, referred to as: PLD) or other similar devices or a combination of these devices, which are coupled to the storage device 42 and The memory device 44 is used for processing signals and instructions sent by the electronic device 40 , and accessing data of the storage device 42 and the memory device 44 accordingly.
详言之,图5是本发明一实施例所示出的数据存取方法的流程图。请同时参照图4及图5,本实施例的方法适用于上述的电子装置40。以下即搭配图4中电子装置40的各项元件,说明本实施例方法的详细流程。In detail, FIG. 5 is a flowchart of a data access method according to an embodiment of the present invention. Please refer to FIG. 4 and FIG. 5 at the same time. The method of this embodiment is applicable to the above-mentioned electronic device 40 . The detailed process of the method of this embodiment will be described below in combination with various elements of the electronic device 40 in FIG. 4 .
首先,处理器46接收电子装置40的操作系统进入省电模式所产生的触发信号,而据以启用高级电源管理(Advanced power management,简称:APM)模式,以拦截电子装置40对于存储装置42的写入指令及读取指令(步骤S502)。其中,本实施例通过在高级配置与电源接口(Advanced Configurationand Power Interface,简称:ACPI)上实施一层过滤驱动程序(Filter driver),来拦截电子装置40对于存储装置42的存取指令,进而管理存储装置42及存储器装置44的数据存取。Firstly, the processor 46 receives the trigger signal generated by the operating system of the electronic device 40 entering the power saving mode, and accordingly activates the advanced power management (Advanced power management, APM) mode to intercept the electronic device 40 for the storage device 42 Write command and read command (step S502). Wherein, the present embodiment intercepts the access command of the electronic device 40 to the storage device 42 by implementing a layer of filter driver (Filter driver) on the Advanced Configuration and Power Interface (Advanced Configuration and Power Interface, ACPI for short), and then manages Data access of the storage device 42 and the memory device 44 .
其中,处理器46在接收到电子装置40对于存储装置42的写入指令时,即会将写入指令所要写入的数据优先写入存储器装置44(步骤S504)。详言之,处理器46收到来自电子装置40的写入指令时,例如会先判断存储器装置44的剩余空间是否足以存放写入指令所要写入的数据,若剩余空间不足,处理器46才会转动存储装置42以将写入指令所要写入的数据写入。Wherein, when the processor 46 receives the write instruction from the electronic device 40 to the storage device 42, it will preferentially write the data to be written by the write instruction into the storage device 44 (step S504). Specifically, when the processor 46 receives a write command from the electronic device 40, for example, it first judges whether the remaining space of the memory device 44 is sufficient to store the data to be written by the write command. The storage device 42 is rotated to write the data to be written by the write command.
另一方面,处理器46在接收到电子装置40对于存储装置42的读取指令时,也会优先从存储器装置44读取读取指令所要读取的数据(步骤S506)。详言之,处理器46收到来自电子装置40的读取指令时,例如会先判断存储器装置44中是否存有读取指令所要读取的数据,若存储器装置44没有读取指令所要读取的数据,才会转动存储装置42以读取读取指令所要读取的数据。On the other hand, when the processor 46 receives the read command from the electronic device 40 to the storage device 42, it also preferentially reads the data to be read by the read command from the memory device 44 (step S506). To be more specific, when the processor 46 receives the read command from the electronic device 40, for example, it will first determine whether the memory device 44 has the data to be read by the read command, if the memory device 44 does not have the data to be read by the read command, data, the storage device 42 will be rotated to read the data to be read by the read command.
类似于前述实施例,针对读取的部分,在一实施例中,处理器46例如会在启用高级电源管理模式时,执行一种学习算法,统计电子装置40在省电模式下对于存储装置42中各笔数据的存取频率,以便在电子装置40进入省电模式时,即先将存取频率高于门槛值的数据由存储装置42复制到存储器装置44,以提供电子装置40在省电模式下存取使用。Similar to the aforementioned embodiments, for the part of reading, in one embodiment, the processor 46, for example, executes a learning algorithm when the advanced power management mode is enabled, and counts the electronic device 40 in the power saving mode for the storage device 42 The access frequency of each piece of data, so that when the electronic device 40 enters the power saving mode, the data whose access frequency is higher than the threshold value is first copied from the storage device 42 to the memory device 44, so that the electronic device 40 can save power. mode for access.
举例来说,图6是本发明一实施例所示出的数据存取方法的范例。请参照图6,本实施例在系统电源状态由正常运作模式进入省电模式时,启用高级电源管理模式,以拦截对于硬盘的写入指令及读取指令,并由过滤驱动程序控制硬盘的数据存取,尽量避免转动硬盘;而在系统电源状态离开省电模式时,则会离开高级电源管理模式,从而恢复硬盘转动,并恢复到一般的存取算法。其中,在电子装置离开省电模式时,除了会将高级电源管理模式关闭外,还会转动硬盘以将高级电源管理模式期间写入存储器装置的数据搬移至硬盘。For example, FIG. 6 is an example of a data access method shown in an embodiment of the present invention. Please refer to FIG. 6. In this embodiment, when the system power state enters the power saving mode from the normal operation mode, the advanced power management mode is enabled to intercept the write command and the read command for the hard disk, and the data of the hard disk is controlled by the filter driver. For access, try to avoid rotating the hard disk; and when the system power state leaves the power saving mode, it will leave the advanced power management mode, thereby restoring the hard disk rotation, and returning to the general access algorithm. Wherein, when the electronic device leaves the power saving mode, in addition to turning off the advanced power management mode, the hard disk is rotated to move the data written in the memory device during the advanced power management mode to the hard disk.
通过上述的数据存取方法,本实施例的电子装置即可在高级电源管理模式下,利用过滤驱动程序拦截电子装置对于硬盘的存取指令,并优先从存储器存取数据。藉此,可有效减少硬盘转起的频率,避免硬盘损坏。Through the above data access method, the electronic device of this embodiment can use the filter driver to intercept the access command of the electronic device to the hard disk in the advanced power management mode, and preferentially access data from the memory. In this way, the spinning frequency of the hard disk can be effectively reduced to avoid damage to the hard disk.
综上所述,本发明的存储装置、电子装置及其数据存取方法利用在存储装置内配置存储器装置或是在电子装置中配置存储器装置来存储硬盘的部分数据,并搭配存储装置的供电暂转模式或是电子装置的高级电源管理模式,在接收到系统的存取指令时,都优先对存储器装置进行存取。藉此,可避免硬盘在省电模式中频繁地转起而造成损坏。To sum up, the storage device, electronic device and data access method of the present invention use a storage device in the storage device or a storage device in the electronic device to store part of the data of the hard disk, and cooperate with the power supply of the storage device to temporarily In the switching mode or the advanced power management mode of the electronic device, when receiving an access command from the system, the memory device is preferentially accessed. In this way, the hard disk can be prevented from being damaged due to frequent spin-ups in the power-saving mode.
最后应说明的是:以上各实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述各实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the present invention, rather than limiting them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: It is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the various embodiments of the present invention. scope.
Claims (10)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510096180.2A CN105988733A (en) | 2015-03-04 | 2015-03-04 | Storage device, electronic device and data access method thereof |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510096180.2A CN105988733A (en) | 2015-03-04 | 2015-03-04 | Storage device, electronic device and data access method thereof |
Publications (1)
Publication Number | Publication Date |
---|---|
CN105988733A true CN105988733A (en) | 2016-10-05 |
Family
ID=57039580
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510096180.2A Pending CN105988733A (en) | 2015-03-04 | 2015-03-04 | Storage device, electronic device and data access method thereof |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105988733A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108874110A (en) * | 2017-05-09 | 2018-11-23 | 群晖科技股份有限公司 | Method and device for destination power management through source data statistics |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050055591A1 (en) * | 2003-09-08 | 2005-03-10 | Samsung Electronic Co., Ltd. | Computer system and a control method thereof |
CN101256535A (en) * | 2007-03-01 | 2008-09-03 | 创惟科技股份有限公司 | Hard disk data read-write quick access device and method |
CN104007934A (en) * | 2013-02-26 | 2014-08-27 | 联想(北京)有限公司 | Terminal device and storage unit control method |
-
2015
- 2015-03-04 CN CN201510096180.2A patent/CN105988733A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20050055591A1 (en) * | 2003-09-08 | 2005-03-10 | Samsung Electronic Co., Ltd. | Computer system and a control method thereof |
CN101256535A (en) * | 2007-03-01 | 2008-09-03 | 创惟科技股份有限公司 | Hard disk data read-write quick access device and method |
CN104007934A (en) * | 2013-02-26 | 2014-08-27 | 联想(北京)有限公司 | Terminal device and storage unit control method |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108874110A (en) * | 2017-05-09 | 2018-11-23 | 群晖科技股份有限公司 | Method and device for destination power management through source data statistics |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
TWI472914B (en) | Hard disk drive,hard drive assembly and laptop computer with removable non-volatile semiconductor memory module,and hard disk controller integrated circuit for non-volatile semiconductor memory module removal detection | |
US8495321B2 (en) | Firehose dump of SRAM write cache data to non-volatile memory using a supercap | |
KR101736384B1 (en) | Nonvolatile Memory System | |
JP6334828B2 (en) | Solid state drive with self-refresh power saving mode | |
US9405356B1 (en) | Temperature compensation in data storage device | |
CN102646446B (en) | Hardware dynamic cache power management | |
US8868950B2 (en) | Reliability-aware disk power management | |
TWI712048B (en) | Storage device and its control method | |
US20140129759A1 (en) | Low power write journaling storage system | |
EP3142015A1 (en) | Low-power memory-access method and associated apparatus | |
TW201411334A (en) | Information processing apparatus and computer program product | |
BR112014009915B1 (en) | METHOD FOR ALLOCATION OF MEMORY, DEVICE AND NON TRANSIENT MACHINE-READABLE STORAGE MEANS | |
CN106415503A (en) | Hard power fail architecture | |
US11294442B2 (en) | Delay of power off to write data from volatile to non-volatile memory of a solid state drive | |
US10635154B2 (en) | Intelligent SAS phy power management | |
CN106200860B (en) | Hard disk power consumption and hard disk power consumption management service control method and device | |
WO2019041903A1 (en) | Nonvolatile memory based computing device and use method therefor | |
CN105988733A (en) | Storage device, electronic device and data access method thereof | |
US9778870B2 (en) | Power management for a distributed storage system accessible by a cluster in a virtualized computing environment | |
TWI548983B (en) | Storage apapratus, electronic apparatus and data accessing method thereof | |
US10795605B2 (en) | Storage device buffer in system memory space | |
US9990155B2 (en) | Storage control device, storage system and method of controlling a storage device | |
CN102290089B (en) | Storage device with multiple storage units and control method thereof | |
TW201314572A (en) | Electronic apparatus using NAND flash and memory management method thereof | |
TWI493563B (en) | Memory managing method and electronic apparatus using the same |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WD01 | Invention patent application deemed withdrawn after publication | ||
WD01 | Invention patent application deemed withdrawn after publication |
Application publication date: 20161005 |