[go: up one dir, main page]

CN101221465A - Data buffer implementation method for reducing hard disk power consumption - Google Patents

Data buffer implementation method for reducing hard disk power consumption Download PDF

Info

Publication number
CN101221465A
CN101221465A CNA2008100193437A CN200810019343A CN101221465A CN 101221465 A CN101221465 A CN 101221465A CN A2008100193437 A CNA2008100193437 A CN A2008100193437A CN 200810019343 A CN200810019343 A CN 200810019343A CN 101221465 A CN101221465 A CN 101221465A
Authority
CN
China
Prior art keywords
buffer
data
buffer blocks
hard disk
blocks
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
Application number
CNA2008100193437A
Other languages
Chinese (zh)
Inventor
黄少珉
戚隆宁
胡晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Southeast University
Original Assignee
Southeast University
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 Southeast University filed Critical Southeast University
Priority to CNA2008100193437A priority Critical patent/CN101221465A/en
Publication of CN101221465A publication Critical patent/CN101221465A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Power Sources (AREA)

Abstract

用于降低硬盘功耗的数据缓冲区实现方法适用于计算机存储系统中,利用数据缓冲区对硬盘数据进行缓存,在多任务环境下通过缓冲区结构的创新设计降低硬盘平均功耗。该缓冲区包括分块的数据缓冲区、缓冲区管理模块,分块的数据缓冲区将数据传送给缓冲区管理模块,缓冲区管理模块通过硬件设备驱动模块将状态控制与数据访问命令传送给硬盘,硬盘再将数据传送给分块的数据缓冲区,实现用于降低硬盘功耗的缓冲区。一方面根据多任务的数据访问速率提出带来功耗最优的缓冲区分组大小的确定方法,另一方面提出考虑任务数据访问情况的数据块替换算法,进一步延长硬盘访问的空闲时间。

Figure 200810019343

The method for realizing the data buffer for reducing the power consumption of the hard disk is applicable to the computer storage system, and the hard disk data is cached by using the data buffer, and the average power consumption of the hard disk is reduced through the innovative design of the buffer structure in a multi-tasking environment. The buffer includes a block data buffer and a buffer management module. The block data buffer transmits data to the buffer management module, and the buffer management module transmits state control and data access commands to the hard disk through the hardware device driver module , and then the hard disk transmits the data to the block data buffer to realize the buffer for reducing the power consumption of the hard disk. On the one hand, according to the multi-task data access rate, a method to determine the buffer group size with optimal power consumption is proposed; on the other hand, a data block replacement algorithm considering task data access is proposed to further extend the idle time of hard disk access.

Figure 200810019343

Description

用于降低硬盘功耗的数据缓冲区实现方法 Data buffer implementation method for reducing hard disk power consumption

技术领域technical field

本发明适用于计算机存储系统中,利用数据缓冲区对硬盘数据进行缓存,在多任务环境下通过缓冲区结构的创新设计降低硬盘平均功耗。The invention is applicable to a computer storage system, uses a data buffer to buffer hard disk data, and reduces the average power consumption of the hard disk through the innovative design of the buffer structure in a multi-task environment.

背景技术Background technique

在计算机系统中,缓冲区(Buffer)是一个应用十分广泛的技术手段。缓冲区指用于存储速度不同步的设备或优先级不同的设备之间传输数据的区域。因此,传统的缓冲区是为提高性能而设计。In the computer system, the buffer (Buffer) is a very widely used technical means. A buffer refers to an area used to store data transferred between devices with asynchronous speeds or devices with different priorities. Therefore, traditional buffers are designed for performance.

在计算机系统中,硬盘设备的功耗较高。出于节约能量的考虑,一般来说,硬盘都具有多种功耗状态。当硬盘空闲时则可进入低功耗状态以节约能量。硬盘在进出低功耗状态时会产生能量损失,因此只有当硬盘的空闲时间较长时进入低功耗状态才能真正节约能量。In a computer system, the power consumption of a hard disk device is relatively high. In consideration of saving energy, generally speaking, a hard disk has multiple power consumption states. When the hard disk is idle, it can enter a low-power state to save energy. The hard disk will generate energy loss when entering and exiting the low power consumption state, so only entering the low power consumption state when the hard disk is idle for a long time can really save energy.

利用缓冲区可以对硬盘进行数据预读(Prefetch),即每次将大量数据从硬盘读取至缓冲区。因此,在每次预读之间硬盘都会产生较长的空闲时间,即使考虑缓冲区本身的功耗,在这段较长的时间内使硬盘进入低功耗状态也能节约相当可观的能量。这样一来,缓冲区技术便可被用以降低硬盘的平均功耗。Data prefetching (Prefetch) can be performed on the hard disk by using the buffer zone, that is, a large amount of data is read from the hard disk to the buffer zone each time. Therefore, the hard disk will generate a long idle time between each read-ahead. Even considering the power consumption of the buffer itself, putting the hard disk into a low power consumption state during this long period of time can save considerable energy. In this way, buffer technology can be used to reduce the average power consumption of the hard disk.

利用该技术降低硬盘功耗的前提是对数据进行顺序访问。然而在多任务环境中,实际系统的数据访问并不可能以单纯的顺序方式进行:①由于任务调度的影响,多任务的访问是交错进行的;②对单个任务而言,任务有可能对硬盘数据段进行随机访问:每次访问从数据段中某个随机的位置开始,并连续访问之后的一段数据。由于现有缓冲区技术并不保留各任务预读的内容,因此上述因素的存在使得缓冲区的内容将被频繁更替,造成大量的硬盘访问,从而大大缩短了空闲时间,使硬盘的功耗无法得到降低。The premise of using this technology to reduce the power consumption of the hard disk is to access the data sequentially. However, in a multi-tasking environment, the data access of the actual system cannot be performed in a purely sequential manner: ①Due to the influence of task scheduling, multi-task access is interleaved; ②For a single task, the task may affect the hard disk. The data segment performs random access: each access starts from a random position in the data segment, and continuously accesses the following segment of data. Since the existing buffer technology does not retain the pre-read content of each task, the existence of the above factors will cause the content of the buffer to be replaced frequently, resulting in a large number of hard disk accesses, thereby greatly shortening the idle time and reducing the power consumption of the hard disk. get lowered.

发明内容Contents of the invention

技术问题:本发明的目的是提供一种用于降低硬盘功耗的数据缓冲区设计方法。在多任务环境下通过对缓冲区进行分块,使各任务可以在由缓冲区块组成的不同分组中保留各自从硬盘预读的数据内容,使从硬盘读取的预读数据不会由于任务的切换而频繁换出,具有延长硬盘空闲时间,从而降低能耗的效果。Technical problem: The purpose of this invention is to provide a data buffer design method for reducing hard disk power consumption. In a multi-tasking environment, by dividing the buffer into blocks, each task can retain the data content pre-read from the hard disk in different groups composed of buffer blocks, so that the pre-read data read from the hard disk will not be due to tasks. Frequent switching out of the hard disk has the effect of prolonging the idle time of the hard disk and reducing energy consumption.

技术方案:为了在多任务环境下通过缓冲区降低硬盘的功耗,应使各任务预读的数据能够得以重用,以避免对硬盘的频繁访问。本发明将缓冲区划分为块,在运行时对缓冲区块进行分组,使各任务在不同的分组中保留各自的预读内容。按照数据访问的情况对缓冲区块进行状态标记,替换算法根据此标记选择合适的块进行替换。Technical solution: In order to reduce the power consumption of the hard disk through the buffer in a multi-task environment, the pre-read data of each task should be reused to avoid frequent access to the hard disk. The invention divides the buffer into blocks, and groups the buffer blocks during operation, so that each task retains its own pre-reading content in different groups. According to the status of data access, the status of the buffer block is marked, and the replacement algorithm selects the appropriate block to replace according to this mark.

本发明用于降低硬盘功耗的缓冲区实现方法具体为:缓冲区包括分块的数据缓冲区、缓冲区管理模块,分块的数据缓冲区将数据传送给缓冲区管理模块,缓冲区管理模块通过硬件设备驱动模块将状态控制与数据访问命令传送给硬盘,硬盘再将数据传送给分块的数据缓冲区,实现用于降低硬盘功耗的缓冲区。The present invention is used to reduce the hard disk power consumption buffer realization method specifically: the buffer comprises the data buffer of block, buffer management module, the data buffer of block transmits data to the buffer management module, the buffer management module The state control and data access commands are transmitted to the hard disk through the hardware device driver module, and the hard disk then transmits the data to the block data buffer to realize the buffer for reducing the power consumption of the hard disk.

所述的分块的数据缓冲区为:在存储器内开辟固定大小的区域作为数据缓冲区,大小为D字节;将数据缓冲区分为固定的块数N,每块的大小相等,为S字节,D=S×N;初始时各块中无数据,通过链表(清华大学出版社《C程序设计》,谭浩强著)L1相连,链表L1的每个结构体中具有两个成员,第一个存放缓冲区块编号1~N,第二个存放下一个缓冲区块在内存中的首地址。The data buffer of described block is: open up the zone of fixed size in memory as data buffer, size is D byte; Data buffer is divided into fixed block number N, and the size of every block is equal, is S word section, D=S×N; initially there is no data in each block, and it is connected through a linked list (Tsinghua University Press "C Programming", written by Tan Haoqiang) L1, and each structure of the linked list L1 has two members, the first One stores buffer block numbers 1 to N, and the second stores the first address of the next buffer block in memory.

缓冲区管理模块为:设有M个任务,任务通过调用硬盘驱动提供的接口函数FD获取所需数据;缓冲区管理模块给出与硬盘驱动接口函数FD具有同名、同参数与同返回值的函数FM,在任务代码中将硬盘接口函数FD替换为缓冲区管理模块提供的函数FM;函数FM实现如下:从任务对硬盘数据访问的请求首地址开始,从硬盘预读出长度为S×N/M字节数据,并通过替换算法R从所有缓冲区块中选择用于存放该数据的缓冲区块;将这些缓冲区块通过链表L2进行连接,连接后的缓冲区块称为分组,即将属于不同任务的缓冲区块各自通过链表L2进行连接;任务调用函数FM对硬盘进行数据读取时,若数据已存在于缓冲区块中,缓冲区管理模块通过链表L2在各缓冲区块中查找数据并送达发起请求的任务;当每次预读完毕后缓冲区管理模块向硬盘发出命令使其进入低功耗模式。The buffer management module is: there are M tasks, and the task obtains the required data by calling the interface function FD provided by the hard disk drive; the buffer management module provides a function with the same name, the same parameters and the same return value as the hard disk drive interface function FD FM, in the task code, replace the hard disk interface function FD with the function FM provided by the buffer management module; the function FM is implemented as follows: starting from the first address of the task’s request for hard disk data access, the length of the pre-read from the hard disk is S×N/ M bytes of data, and select the buffer block used to store the data from all buffer blocks through the replacement algorithm R; connect these buffer blocks through the linked list L2, and the connected buffer blocks are called groups, which will soon belong to The buffer blocks of different tasks are connected through the linked list L2; when the task calls the function FM to read data from the hard disk, if the data already exists in the buffer block, the buffer management module searches for the data in each buffer block through the linked list L2 And deliver the task of initiating the request; when each pre-reading is completed, the buffer management module sends a command to the hard disk to enter the low power consumption mode.

所述的替换算法R为:The replacement algorithm R is:

为缓冲区块1~N确定不同的状态,这些状态包括:缓冲区块空闲(BLK_IDLE),缓冲区块在用(BLK_INUSE),缓冲区块已用(BLK_USED),缓冲区块未用(BLK_UNUSE);缓冲区块空闲表示缓冲区块中尚未读入任何数据;缓冲区块在用表示缓冲区块中的数据正在被读取;缓冲区块已用表示缓冲区块中最后一个字节的数据已被读取;缓冲区块未用表示缓冲区块已存在于分组中但尚未被读取;替换算法通过链表L2顺序查询各分组中缓冲区块的状态,若存在状态为缓冲区块空闲的缓冲区块,则将数据读入该块;若不存在状态为缓冲区块空闲的缓冲区块,则查询是否存在状态为缓冲区块已用的缓冲区块,如存在则将数据读入该缓冲区块;若状态为缓冲区块已用的缓冲区块也不存在,则查询是否存在状态为缓冲区块未用的缓冲区块,如存在则将数据读入该缓冲区块;若缓冲区块空闲,缓冲区块已用,缓冲区块未用三种状态的缓冲区块都不存在,则将数据读入缓冲区块在用的缓冲区块。若在查询过程中发现具有状态一样的多个缓冲区块,则选择第一个查询到的。Determine different states for buffer blocks 1 to N, these states include: buffer block idle (BLK_IDLE), buffer block in use (BLK_INUSE), buffer block used (BLK_USED), buffer block unused (BLK_UNUSE) ; The buffer block is free, indicating that no data has been read in the buffer block; the buffer block is in use, indicating that the data in the buffer block is being read; the buffer block is used, indicating that the last byte of data in the buffer block has been is read; the buffer block is not used, which means that the buffer block already exists in the group but has not been read; the replacement algorithm sequentially queries the status of the buffer block in each group through the linked list L2, if there is a buffer whose state is that the buffer block is free block, then read the data into the block; if there is no buffer block whose status is buffer block free, then query whether there is a buffer block whose status is buffer block used, and if so, read the data into the buffer block; if the buffer block whose status is buffer block used does not exist, then query whether there is a buffer block whose status is buffer block unused, and if it exists, read the data into the buffer block; if the buffer block The block is free, the buffer block is used, and the buffer block is not used. The buffer block in the three states does not exist, and the data is read into the buffer block in use by the buffer block. If multiple buffer blocks with the same status are found during the query process, the first one found in the query is selected.

有益效果:本发明对缓冲区进行逻辑分组,以使各访问硬盘的任务能拥有各自的数据缓冲区。本发明无需增加任何硬件电路,计算与存储资源的开销极小,在多任务环境下大幅减少了对硬盘产生的数据访问请求,并延长了硬盘的空闲时间,使硬盘可以在更长的时间内进入低功耗状态以节约能量。实验结果表明,在多媒体播放应用环境下,硬盘数据访问的功耗得到了大幅降低。Beneficial effects: the invention logically groups the buffers so that each task accessing the hard disk can have its own data buffer. The present invention does not need to add any hardware circuit, and the overhead of computing and storage resources is extremely small. In a multi-tasking environment, the data access request to the hard disk is greatly reduced, and the idle time of the hard disk is extended, so that the hard disk can be used for a longer period of time. Enter a low-power state to save energy. Experimental results show that in the application environment of multimedia playback, the power consumption of hard disk data access has been greatly reduced.

附图说明Description of drawings

图1是本发明基于缓冲区动态分组的硬盘低功耗方案设计架构的基本结构图。图中实线箭头表示数据请求与控制命令,虚线箭头表示数据。缓冲区管理模块接收任务对硬盘产生的数据访问请求,通过硬盘设备驱动从硬盘将数据预读进缓冲区,并将任务所需数据提交给发起请求的任务;当每次预读结束后,缓冲区管理模块对数据缓冲区分组数据结构进行更新并通过硬盘设备驱动将硬盘置于低功耗状态。FIG. 1 is a basic structural diagram of the design architecture of the low power consumption scheme of the hard disk based on buffer dynamic grouping in the present invention. The solid line arrows in the figure indicate data requests and control commands, and the dotted line arrows indicate data. The buffer management module receives the data access request generated by the task to the hard disk, pre-reads the data from the hard disk into the buffer through the hard disk device driver, and submits the data required by the task to the task that initiated the request; when each pre-read is completed, the buffer The area management module updates the group data structure of the data buffer and puts the hard disk in a low power consumption state through the hard disk device driver.

图2是用于连接无数据的缓冲区块的链表L1的结构。链表L1的每个结构体中具有两个成员,第一个存放缓冲区块编号1~N,第二个存放下一个缓冲区块在内存中的首地址。该链表通过下一个缓冲区的首地址寻找下一个缓冲区块。FIG. 2 is a structure of a linked list L1 for linking buffer blocks without data. Each structure of the linked list L1 has two members, the first one stores buffer block numbers 1-N, and the second one stores the first address of the next buffer block in memory. The linked list searches for the next buffer block through the first address of the next buffer.

图3说明了用于连接缓冲区分组的链表L2。实线框代表缓冲区块(Block),其中的数字为Block编号;虚线框表示缓冲区组(Group),其中的各Block存储着地址连续的硬盘数据,每个组的数据属于同一个任务。各组中的缓冲区块通过与链表L1相同的链表结构相连,各组间通过链表L2相连。链表L2的每个结构体中具有两个成员,第一个存放组编号,第二个存放下个组中的第一个缓冲区块的首地址。Figure 3 illustrates the linked list L2 used to link buffer groups. The solid line frame represents the buffer block (Block), and the number in it is the block number; the dotted line frame represents the buffer group (Group), in which each block stores hard disk data with continuous addresses, and the data in each group belongs to the same task. The buffer blocks in each group are connected through the same linked list structure as the linked list L1, and each group is connected through the linked list L2. Each structure of the linked list L2 has two members, the first one stores the group number, and the second one stores the first address of the first buffer block in the next group.

图4为缓冲区管理模块的实现流程图。缓冲区管理模块为本发明的核心模块,图4描述了该模块的详细工作流程。Figure 4 is a flowchart of the implementation of the buffer management module. The buffer management module is the core module of the present invention, and Fig. 4 has described the detailed work flow of this module.

具体实施方式Detailed ways

该缓冲区包括分块的数据缓冲区、缓冲区管理模块,分块的数据缓冲区将数据传送给缓冲区管理模块,缓冲区管理模块通过硬件设备驱动模块将状态控制与数据访问命令传送给硬盘,硬盘再将数据传送给分块的数据缓冲区,实现用于降低硬盘功耗的缓冲区。The buffer includes a block data buffer and a buffer management module. The block data buffer transmits data to the buffer management module, and the buffer management module transmits state control and data access commands to the hard disk through the hardware device driver module , and then the hard disk transmits the data to the block data buffer to realize the buffer for reducing the power consumption of the hard disk.

缓冲区按照图3所示结构进行组织。缓冲区的块大小可根据系统实际情况确定,总块数M为各任务每次预读块数之和(各任务预读块数可根据任务情况确定)。如图3所示,实线箭头表示缓冲区的组结构通过链表实现,该链表为二级链表。各缓冲区组中第一个块的首地址通过第一级链表相连,每个组内的各块首地址通过第二级链表相连。The buffer is organized according to the structure shown in Figure 3. The block size of the buffer zone can be determined according to the actual situation of the system, and the total block number M is the sum of each pre-read block number of each task (the pre-read block number of each task can be determined according to the task situation). As shown in FIG. 3 , the solid arrow indicates that the group structure of the buffer is implemented through a linked list, which is a secondary linked list. The first address of the first block in each buffer group is connected through a first-level linked list, and the first addresses of each block in each group are connected through a second-level linked list.

缓冲区管理模块在应用层与驱动层之间实现。该模块向任务提供硬盘数据访问的接口函数,以屏蔽下层实现。通过该接口,任务告知缓冲区管理模块要访问数据的起始地址与长度,任务每次调用数据访问接口即产生数据请求。此时,缓冲区管理模块按照图4的流程运行。该模块通过调用硬盘设备驱动的接口函数完成数据操作与状态控制。该模块对数据块的查找通过遍历图3所示的二级链表完成。The buffer management module is implemented between the application layer and the driver layer. This module provides the interface function of hard disk data access to the task to shield the implementation of the lower layer. Through this interface, the task informs the buffer management module of the start address and length of the data to be accessed, and each time the task calls the data access interface, a data request is generated. At this time, the buffer management module operates according to the process shown in FIG. 4 . This module completes data operation and state control by calling the interface function of the hard disk device driver. The module searches for data blocks by traversing the secondary linked list shown in Figure 3.

所述的分块的数据缓冲区为:在存储器内开辟固定大小的区域作为数据缓冲区,大小为D字节;将数据缓冲区分为固定的块数N,每块的大小相等,为S字节,D=S×N;初始时各块中无数据,通过链表L1相连,链表L1的每个结构体中具有两个成员,第一个存放缓冲区块编号1~N,第二个存放下一个缓冲区块在内存中的首地址。The data buffer of described block is: open up the zone of fixed size in memory as data buffer, size is D byte; Data buffer is divided into fixed block number N, and the size of every block is equal, is S word section, D=S×N; there is no data in each block at the beginning, and they are connected through the linked list L1. Each structure of the linked list L1 has two members, the first one stores the buffer block numbers 1~N, and the second one stores The first address of the next buffer block in memory.

所述的缓冲区管理模块为:设有M个任务,任务通过调用硬盘驱动提供的接口函数FD获取所需数据;缓冲区管理模块给出与硬盘驱动接口函数FD具有同名、同参数与同返回值的函数FM,在任务代码中将硬盘接口函数FD替换为缓冲区管理模块提供的函数FM;函数FM实现如下:从任务对硬盘数据访问的请求首地址开始,从硬盘预读出长度为S×N/M字节数据,并通过替换算法R从所有缓冲区块中选择用于存放该数据的缓冲区块;将这些缓冲区块通过链表L2进行连接,连接后的缓冲区块称为分组,即将属于不同任务的缓冲区块各自通过链表L2进行连接;任务调用函数FM对硬盘进行数据读取时,若数据已存在于缓冲区块中,缓冲区管理模块通过链表L2在各缓冲区块中查找数据并送达发起请求的任务;当每次预读完毕后缓冲区管理模块向硬盘发出命令使其进入低功耗模式。Described buffer management module is: be provided with M task, task obtains required data by calling the interface function FD that hard disk drive provides; The function FM of the value, in the task code, replace the hard disk interface function FD with the function FM provided by the buffer management module; the function FM is implemented as follows: starting from the first address of the task’s request for hard disk data access, the length of the pre-read from the hard disk is S ×N/M bytes of data, and select the buffer block used to store the data from all buffer blocks through the replacement algorithm R; connect these buffer blocks through the linked list L2, and the connected buffer blocks are called grouping , that is, the buffer blocks belonging to different tasks are connected through the linked list L2; when the task calls the function FM to read data from the hard disk, if the data already exists in the buffer block, the buffer management module uses the linked list L2 in each buffer block The task of searching for data and sending it to the request; when each read-ahead is completed, the buffer management module sends a command to the hard disk to enter a low power consumption mode.

在替换算法中,将Block划分为不同的状态,这些状态包括:BLK_IDLE,BLK_INUSE,BLK_USED,BLK_UNUSE。BLK_IDLE表示Block中尚未读入任何数据;BLK_INUSE表示Block中的数据正在被使用,BLK_USED表示Block中最后一个字节的数据已被访问(表征对该Block访问完毕),二者关系密切:任何访问Block的任务都会将该Block状态设为BLK_INUSE并将SHARE_NUM值加1(SHARE_NUM表示访问该Block的任务数,初始值为0),当该任务访问完Block中的最后一个数据时将SHARE_NUM值减1并查看该值,若不为0(表明仍有任务在访问该Block)则维持BLK_INUSE状态不变,为0(表明之前访问该Block的任务都已访问完毕)则设置Block状态为BLK_USED;BLK_UNUSE表示Block已存在于Group中但尚未被任务访问。替换算法通过图3中的二级链表结构顺序查询各Group中Block的属性,按照BLK_IDLE,BLK_USED,BLK_UNUSE,BLK_INUSE的优先级(由高到低)选择Block用于替换,若多个Block状态一样则选择第一个搜索到的。由对状态含义的分析可知,状态为BLK_USED,BLK_UNUSE,BLK_INUSE的Block将来被使用的概率依次升高,因此该替换算法可以带来较少的Block更新次数。In the replacement algorithm, Block is divided into different states, these states include: BLK_IDLE, BLK_INUSE, BLK_USED, BLK_UNUSE. BLK_IDLE indicates that no data has been read in the Block; BLK_INUSE indicates that the data in the Block is being used, and BLK_USED indicates that the last byte of data in the Block has been accessed (indicating that the Block has been accessed), and the two are closely related: any access to the Block All tasks will set the Block state to BLK_INUSE and add 1 to the SHARE_NUM value (SHARE_NUM indicates the number of tasks accessing the Block, the initial value is 0), when the task finishes accessing the last data in the Block, reduce the SHARE_NUM value by 1 and Check the value, if it is not 0 (indicating that there are still tasks accessing the block), keep the BLK_INUSE state unchanged, and if it is 0 (indicating that all tasks that have accessed the block before have been accessed), set the block state to BLK_USED; BLK_UNUSE indicates that the block Already exists in the group but has not been accessed by the task. The replacement algorithm sequentially queries the attributes of Blocks in each Group through the secondary linked list structure in Figure 3, and selects Blocks for replacement according to the priorities of BLK_IDLE, BLK_USED, BLK_UNUSE, and BLK_INUSE (from high to low). If multiple Blocks are in the same state, then Select the first one found. From the analysis of the meaning of the state, it can be seen that the probability that the Block with the state of BLK_USED, BLK_UNUSE, and BLK_INUSE will be used in the future will increase in turn, so this replacement algorithm can bring fewer Block updates.

Claims (4)

1. buffer zone implementation method that is used to reduce hard disk power consumption, it is characterized in that this buffer zone comprises data buffer, the buffer management module of piecemeal, the data buffer of piecemeal sends data to the buffer management module, the buffer management module sends State Control and data access command to hard disk by the hardware device drivers module, hard disk sends data to the data buffer of piecemeal again, realizes being used to reduce the buffer zone of hard disk power consumption.
2. the buffer zone implementation method that is used to reduce hard disk power consumption according to claim 1, the data buffer that it is characterized by described piecemeal is: the zone of opening up fixed size in storer is as the data buffer, and size is the D byte; Data buffering is divided into fixing piece count N, every equal and opposite in direction is S byte, D=S * N; No datat in each piece links to each other by chained list L1 when initial, has two members in each structure of chained list L1, and first deposits buffer blocks numbering 1~N, deposits the first address of next buffer blocks in internal memory for second.
3. the buffer zone implementation method that is used to reduce hard disk power consumption according to claim 1 is characterized by described buffer management module and is: be provided with M task, task is obtained desired data by the interface function FD that calls hard drive and provide; The buffer management module provides with hard disk drive interface function F D to be had of the same name, same parameter and with the function F M of rreturn value, in task code hard-disk interface function F D is replaced with the function F M that the buffer management module provides; Function F M is achieved as follows: from the request first address of task to the hard disc data visit, reading length in advance from hard disk is S * N/M byte data, and selects to be used to deposit the buffer blocks of these data from all buffer blocks by replacement algorithm R; These buffer blocks are connected by chained list L2, and the buffer blocks after the connection is called grouping, and the buffer blocks that is about to belong to different task connects by chained list L2 separately; When task call function F M carried out data read to hard disk, if data have been present in the buffer blocks, the buffer management module was searched data and is sent to the initiation tasks requested by chained list L2 in each buffer blocks; When run through in advance at every turn finish after the buffer management module give an order to hard disk and make it enter low-power consumption mode.
4. the buffer zone implementation method that is used to reduce hard disk power consumption according to claim 1 is characterized by described replacement algorithm R and is:
For buffer blocks 1~N determines different states, these states comprise: the buffer blocks free time, buffer blocks is in usefulness, and buffer blocks is usefulness, and buffer blocks is not used; Do not read in any data as yet in the idle expression of the buffer blocks buffer blocks; Buffer blocks represents that in usefulness the data in the buffer blocks are read; Buffer blocks is with representing that the data of last byte are read in the buffer blocks; Buffer blocks is with representing that buffer blocks has been present in the grouping but is not read as yet; Replace the state of algorithm,, then data are read in this piece if existence is the buffer blocks of buffer blocks free time by buffer blocks in each grouping of chained list L2 sequential query; If existence is not the buffer blocks of buffer blocks free time, inquire about then whether existence is the buffer blocks buffer blocks of usefulness, then data are read in this buffer blocks as existing; If state be buffer blocks the buffer blocks of usefulness do not exist yet, inquire about then whether existence is the not buffer blocks of usefulness of buffer blocks, then data are read in this buffer blocks as existing; If the buffer blocks free time, buffer blocks is usefulness, and buffer blocks does not exist with the buffer blocks of three kinds of states, then data is read in the buffer blocks of buffer blocks in usefulness.If in query script, find to have the same a plurality of buffer blocks of state, then select first to inquire.
CNA2008100193437A 2008-01-04 2008-01-04 Data buffer implementation method for reducing hard disk power consumption Pending CN101221465A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNA2008100193437A CN101221465A (en) 2008-01-04 2008-01-04 Data buffer implementation method for reducing hard disk power consumption

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNA2008100193437A CN101221465A (en) 2008-01-04 2008-01-04 Data buffer implementation method for reducing hard disk power consumption

Publications (1)

Publication Number Publication Date
CN101221465A true CN101221465A (en) 2008-07-16

Family

ID=39631338

Family Applications (1)

Application Number Title Priority Date Filing Date
CNA2008100193437A Pending CN101221465A (en) 2008-01-04 2008-01-04 Data buffer implementation method for reducing hard disk power consumption

Country Status (1)

Country Link
CN (1) CN101221465A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925160A (en) * 2009-06-11 2010-12-22 上海易狄欧电子科技有限公司 Wireless data transceiving method and system
CN102156529A (en) * 2010-02-11 2011-08-17 仁宝电脑工业股份有限公司 Hard Disk Power Saving Method and Hard Disk Power Saving Device
CN101714099B (en) * 2009-12-16 2012-12-05 金蝶软件(中国)有限公司 Processing method, device and data processing system of rowset data
CN103577158A (en) * 2012-07-18 2014-02-12 阿里巴巴集团控股有限公司 Data processing method and device
CN109614349A (en) * 2018-12-11 2019-04-12 杭州阿姆科技有限公司 A kind of buffer memory management method based on binding mechanism
CN111813326A (en) * 2019-04-12 2020-10-23 建兴储存科技(广州)有限公司 Solid-state memory device with multiple data stream writing and related writing method thereof
CN112379833A (en) * 2020-11-12 2021-02-19 阿米华晟数据科技(江苏)有限公司 File caching device, file caching method, idle space recycling method and fault recovery method
WO2023060943A1 (en) * 2021-10-14 2023-04-20 华为技术有限公司 Traffic control method and apparatus

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101925160A (en) * 2009-06-11 2010-12-22 上海易狄欧电子科技有限公司 Wireless data transceiving method and system
CN101714099B (en) * 2009-12-16 2012-12-05 金蝶软件(中国)有限公司 Processing method, device and data processing system of rowset data
CN102156529A (en) * 2010-02-11 2011-08-17 仁宝电脑工业股份有限公司 Hard Disk Power Saving Method and Hard Disk Power Saving Device
CN103577158A (en) * 2012-07-18 2014-02-12 阿里巴巴集团控股有限公司 Data processing method and device
CN103577158B (en) * 2012-07-18 2017-03-01 阿里巴巴集团控股有限公司 Data processing method and device
CN109614349A (en) * 2018-12-11 2019-04-12 杭州阿姆科技有限公司 A kind of buffer memory management method based on binding mechanism
CN109614349B (en) * 2018-12-11 2023-04-11 杭州阿姆科技有限公司 Cache management method based on binding mechanism
CN111813326A (en) * 2019-04-12 2020-10-23 建兴储存科技(广州)有限公司 Solid-state memory device with multiple data stream writing and related writing method thereof
CN111813326B (en) * 2019-04-12 2024-04-19 建兴储存科技(广州)有限公司 Solid-state storage device with multi-data stream writing function and related writing method thereof
CN112379833A (en) * 2020-11-12 2021-02-19 阿米华晟数据科技(江苏)有限公司 File caching device, file caching method, idle space recycling method and fault recovery method
WO2023060943A1 (en) * 2021-10-14 2023-04-20 华为技术有限公司 Traffic control method and apparatus

Similar Documents

Publication Publication Date Title
CN101221465A (en) Data buffer implementation method for reducing hard disk power consumption
CN105786717B (en) The DRAM-NVM stratification isomery memory pool access method and system of software-hardware synergism management
CN102156753B (en) Data page caching method for file system of solid-state hard disc
CN104794064B (en) A kind of buffer memory management method based on region temperature
CN103226521B (en) Multimode data prefetching device and management method thereof
CN110134514A (en) Scalable in-memory object storage system based on heterogeneous memory
CN104166634A (en) Management method of mapping table caches in solid-state disk system
CN103345451B (en) Data buffering method in multi-core processor
WO2013071882A1 (en) Storage system and management method used for metadata of cluster file system
CN105892947A (en) SSD and HDD hybrid caching management method and system of energy-saving storage system
CN104834607A (en) Method for improving distributed cache hit rate and reducing solid state disk wear
CN103049396B (en) The method of writing with a brush dipped in Chinese ink of data and device
CN106681668A (en) Hybrid storage system and storage method based on solid state disk caching
CN115168248B (en) Cache memory supporting SIMT architecture and corresponding processor
CN103399824A (en) Method and device for holding cache miss states of caches in processor of computer
CN108153682B (en) Method for mapping addresses of flash translation layer by utilizing internal parallelism of flash memory
CN106844740A (en) Data pre-head method based on memory object caching system
CN100549945C (en) In the embedded system based on the implementation method of the instruction buffer of SPM
CN115562592A (en) A hybrid cache method of memory and disk based on cloud object storage
US20170329710A1 (en) Logical memory buffers for a media controller
CN106909323A (en) The caching of page method of framework is hosted suitable for DRAM/PRAM mixing and mixing hosts architecture system
CN117312188A (en) Hybrid SSD data cache prefetch system and method
CN105955711A (en) Buffering method supporting non-blocking miss processing
CN101853218B (en) Method and system for reading redundant array of inexpensive disks (RAID)
CN102779017B (en) The control method of data buffer area in a kind of solid-state disk

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C02 Deemed withdrawal of patent application after publication (patent law 2001)
WD01 Invention patent application deemed withdrawn after publication

Open date: 20080716