CN102929801B - A kind of method and apparatus for disk addressing - Google Patents
A kind of method and apparatus for disk addressing Download PDFInfo
- Publication number
- CN102929801B CN102929801B CN201210413126.2A CN201210413126A CN102929801B CN 102929801 B CN102929801 B CN 102929801B CN 201210413126 A CN201210413126 A CN 201210413126A CN 102929801 B CN102929801 B CN 102929801B
- Authority
- CN
- China
- Prior art keywords
- interface
- queue
- operation request
- request message
- requested
- 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.)
- Expired - Fee Related
Links
Landscapes
- Signal Processing For Digital Recording And Reproducing (AREA)
Abstract
本发明实施例提供了一种用于磁盘寻址的方法和装置,能够解决对磁盘进行操作时,消耗的寻址时间较大的问题。该方法包括:所述装置接收对所述磁盘进行随机读写的操作请求消息的第一队列后,确定读操作请求消息请求的I/O接口位置的第一范围,然后将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列;将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,并将所述第三队列的写操作请求消息请求的数据写入缓存中;最后根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。本发明适用于计算机领域。
Embodiments of the present invention provide a method and device for addressing a disk, which can solve the problem of large addressing time consumed when operating a disk. The method includes: after the device receives the first queue of operation request messages for randomly reading and writing the disk, determine the first range of the I/O interface position requested by the read operation request message, and then set the I/O interface The I/O interface requested by the write operation request message whose position belongs to the first range is first sorted with the I/O interface requested by all the read operation request message to obtain the second queue of the operation request message; The write operation request message whose position does not belong to the first range is determined as the third queue, and the data requested by the write operation request message of the third queue is written into the cache; finally, according to the operation request message of the second queue , performing the requested operations on the disk in sequence. The present invention is applicable to the computer field.
Description
技术领域 technical field
本发明涉及计算机技术领域,尤其涉及一种用于磁盘寻址的方法和装置。The invention relates to the field of computer technology, in particular to a method and device for disk addressing.
背景技术 Background technique
在采用机械硬盘介质存储数据的时候,经常遇到数据读写位置随机的情况,从而导致在读写过程中,大部分的时间浪费在磁盘介质的寻址过程中。尤其在一次请求中,需要寻址的读写I/O接口对应的内存较小,使所请求的数据分布在多个I/O接口对应的内存中,基于读写位置的随机性,这种性能损耗更加严重,导致在磁盘寻址的时间浪费严重。When using mechanical hard disk media to store data, it is often encountered that the data read and write positions are random, resulting in most of the time wasted in the disk media addressing process during the read and write process. Especially in a request, the memory corresponding to the read-write I/O interface that needs to be addressed is small, so that the requested data is distributed in the memory corresponding to multiple I/O interfaces. Based on the randomness of the read-write position, this The performance loss is more serious, resulting in a serious waste of disk addressing time.
现有技术中,提出了如下两种减小磁盘寻址时间的方法:In the prior art, the following two methods for reducing disk seek time are proposed:
1)采用高速缓冲寄存器Cache对偏离当前磁头较大的数据进行缓存。再次读写数据的时候,根据Cache中是否存储该数据来判断是否要读写Cache,如果Cache中有,则不需要从磁盘读取,直接在Cache中读取,如果Cache中没有,再从磁盘中读取。该方法不需要全部读写都通过在磁盘中寻址实现,在一定程度上节省了磁盘寻址的时间。1) Use the high-speed buffer register Cache to cache the data that deviates greatly from the current head. When reading and writing data again, judge whether to read and write the Cache according to whether the data is stored in the Cache. If it exists in the Cache, it does not need to read from the disk, and read it directly from the Cache. If it does not exist in the Cache, read it from the disk. read in. This method does not require all reads and writes to be implemented by addressing in the disk, which saves the time for disk addressing to a certain extent.
2)采用Linux电梯解决方法。在I/O调度过程中,该方法在处理磁盘中的读写I/O接口的消息请求时,选择最优方案将所述消息请求合并排序后进行处理,某些不在最优方案中的消息请求会被暂时挂起,当有一个新的I/O接口的请求加入到消息请求队列时,首先检查磁盘中每个挂起的消息请求是否可以合并到新消息请求队列中,如果可以,结合磁头的当前位置,合并后的新的消息请求队列选择最优顺序进行读写I/O接口的操作。如果合并失败,则会把所述挂起的消息请求插入到合适的位置。该方法可以通过一定的排序完成读写I/O接口的消息请求,在一定程度上节省磁盘寻址的时间。2) Adopt the Linux elevator solution. In the I/O scheduling process, when the method processes the message requests of the read-write I/O interface in the disk, it selects the optimal plan to merge and sort the message requests and then process them. Some messages that are not in the optimal plan The request will be temporarily suspended. When a new I/O interface request is added to the message request queue, first check whether each suspended message request in the disk can be merged into the new message request queue. If so, combine The current position of the magnetic head, the merged new message request queue selects the optimal sequence to read and write I/O interface operations. If the merge fails, the pending message request will be inserted in place. This method can complete the message request of reading and writing the I/O interface through a certain sort, and save the disk addressing time to a certain extent.
但是在上述解决磁盘寻址的时间浪费的两种方法中,还存在以下问题:However, in the above two methods for solving the time waste of disk addressing, there are still the following problems:
采用高速缓冲寄存器Cache对数据进行缓存时,当Cache中存储空间已满,需要将Cache中缓存的数据写入到磁盘中。若将Cache中缓存的数据保存到磁盘中时,由于没有考虑Cache中数据在磁盘中的位置与当前请求的I/O接口的位置的关系,仍然随机的将缓存中的数据写入磁盘中,这样还是使得磁盘进行操作时,消耗的寻址时间较大。When the cache register Cache is used to cache data, when the storage space in the Cache is full, the data cached in the Cache needs to be written to the disk. If the data cached in the Cache is saved to the disk, the data in the cache is still randomly written to the disk because the relationship between the location of the data in the Cache on the disk and the location of the currently requested I/O interface is not considered. This still causes the disk to operate, and consumes a large seek time.
采用Linux电梯解决方法时,某些读写I/O接口的消息请求由于排序的原因,可能会被挂起许久才被执行,由于I/O接口的消息请求滞留时间过长,被处理时会被直接插入队尾。此时由于所述挂起的请求的加入,仍然使得对磁盘进行操作时,消耗的寻址时间较大。When using the Linux elevator solution, some message requests for reading and writing I/O interfaces may be suspended for a long time due to sorting reasons before being executed. Inserted directly at the end of the queue. At this time, due to the addition of the pending request, it still consumes a relatively large seek time when operating on the disk.
发明内容 Contents of the invention
本发明的实施例提供一种用于磁盘寻址的方法和装置,能够解决对磁盘进行操作时,消耗的寻址时间较大的问题。Embodiments of the present invention provide a method and device for disk addressing, which can solve the problem of large addressing time consumed when operating a disk.
为达到上述目的,本发明的实施例采用如下技术方案:In order to achieve the above object, embodiments of the present invention adopt the following technical solutions:
第一方面,提供了一种用于磁盘寻址的方法,该方法包括:In a first aspect, a method for disk addressing is provided, the method comprising:
接收对所述磁盘进行随机读写的操作请求消息的第一队列,所述每个操作请求消息中携带有对所述磁盘进行操作请求时对应的I/O接口;A first queue for receiving operation request messages for random reading and writing of the disk, where each operation request message carries an I/O interface corresponding to an operation request for the disk;
确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围;Determining a first range of I/O interface locations requested by the read operation request message, the first range being the two read operation request message requests whose locations of the requested I/O interfaces in the first queue are farthest away The range determined by the I/O interface;
将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列;Performing a first sorting on the I/O interfaces requested by the write operation request message whose position of the I/O interface belongs to the first range and all the I/O interfaces requested by the read operation request message to obtain the second queue of the operation request message;
将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,将所述第三队列的写操作请求消息请求的数据写入缓存中;Determining the write operation request message whose position of the I/O interface does not belong to the first range as a third queue, and writing the data requested by the write operation request message of the third queue into the cache;
根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。According to the operation request message of the second queue, perform the requested operation on the disk in sequence.
在第一种可能的实现方式中,根据第一方面,在获得所述操作请求消息的第二队列后,该方法还包括:In a first possible implementation manner, according to the first aspect, after obtaining the second queue of the operation request message, the method further includes:
确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口;Determine whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range;
若有所述第一I/O接口,按照所述第一排序,在所述第二队列中插入对所述第一I/O接口对应的数据进行写操作的写操作请求消息;If there is the first I/O interface, according to the first sorting, insert a write operation request message for writing data corresponding to the first I/O interface into the second queue;
或or
将属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列之前,还包括:Performing a first sorting on the I/O interfaces requested by the write operation request messages belonging to the first scope and all the I/O interfaces requested by the read operation request messages, and before obtaining the second queue of the operation request messages, further includes:
确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口;Determine whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range;
若有所述第一I/O接口,将对所述第一I/O接口对应的数据进行写操作的写操作请求消息插入到所述磁盘的第一队列中。If there is the first I/O interface, inserting a write operation request message for performing a write operation on data corresponding to the first I/O interface into the first queue of the disk.
在第二种可能的实现方式中,根据第一方面或第一种可能的实现方式,在将所述第三队列的写操作请求消息请求的数据写入缓存中前,该方法还包括:In the second possible implementation manner, according to the first aspect or the first possible implementation manner, before writing the data requested by the write operation request message of the third queue into the cache, the method further includes:
检查所述缓存中的存储空间是否已满;Check whether the storage space in the cache is full;
若所述缓存中的存储空间已满,确定第二I/O接口,所述第二I/O接口为所述第三队列中请求的I/O接口和所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口;If the storage space in the cache is full, determine the second I/O interface, the second I/O interface is the I/O interface requested in the third queue and the I/O interface corresponding to the cached data The position in the O interface is closest to the I/O interface of the second queue;
若所述缓存中存在所述第二I/O接口,按照所述第一排序,在所述第二队列中插入对所述第二I/O接口对应的数据进行写操作的写操作请求消息;If the second I/O interface exists in the cache, according to the first sorting, insert a write operation request message for writing data corresponding to the second I/O interface into the second queue ;
若所述第三队列中存在所述第二I/O接口,按照所述第一排序,将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中。If the second I/O interface exists in the third queue, according to the first sorting, insert the write operation request message corresponding to the second I/O interface of the third queue into the second queue middle.
在第三种可能的实现方式中,根据第一方面或第一种可能的实现方式或第二种可能的实现方式,所述第一排序具体为:In the third possible implementation manner, according to the first aspect or the first possible implementation manner or the second possible implementation manner, the first sorting is specifically:
以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,按照I/O接口的排序对应的获取所述操作请求消息的排序。The position of the I/O interface where the current magnetic head is located is the first previous I/O interface, and the I/O interface closest to the position of the previous I/O interface is determined as the next I/O interface, according to the I/O interface The sorting corresponds to the sorting of obtaining the operation request messages.
在第四种可能的实现方式中,根据第三种可能的实现方式,将所述第三队列的写操作请求消息请求的数据写入缓存中前,该方法还包括:In the fourth possible implementation, according to the third possible implementation, before writing the data requested by the write operation request message of the third queue into the cache, the method further includes:
检查所述第一队列中是否全为写操作请求消息;Check whether the first queue is full of write operation request messages;
若所述第一队列中全为写操作请求消息,则确定第三I/O接口和第四I/O接口,所述第三I/O接口为与上一I/O接口的距离小于第一预设范围的I/O接口,所述第四I/O接口为与所述第三I/O接口的任一I/O接口的距离大于第一预设范围的I/O接口,所述第四I/O接口对应的写操作请求消息确定为第三队列;If the first queue is full of write operation request messages, then determine the third I/O interface and the fourth I/O interface, and the third I/O interface is less than the distance from the previous I/O interface. A preset range of I/O interfaces, the fourth I/O interface is an I/O interface whose distance from any I/O interface of the third I/O interface is greater than the first preset range, so The write operation request message corresponding to the fourth I/O interface is determined as the third queue;
在获得操作请求消息的第二队列后,还包括:After getting the second queue of operation request messages, also include:
根据所述第一排序,将所述第三I/O接口对应的写操作请求消息插入到所述第二队列。Inserting the write operation request message corresponding to the third I/O interface into the second queue according to the first sorting.
在第五种可能的实现方式中,根据第一方面或第一种可能的实现方式至第四种可能的实现方式,接收对所述磁盘进行随机读写的操作请求消息的第一队列后,还包括:In the fifth possible implementation, according to the first aspect or the first possible implementation to the fourth possible implementation, after receiving the first queue of operation request messages for performing random read and write on the disk, Also includes:
统计所述第一队列请求的I/O接口分别对应的磁盘区域的I/O接口的请求频率,判断所述磁盘区域是否为偏僻区域;Counting the request frequency of the I/O interface of the disk area corresponding to the I/O interface of the first queue request respectively, and judging whether the disk area is a remote area;
根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作之后,还包括:According to the operation request message of the second queue, after sequentially performing the requested operations on the disk, the method further includes:
若所述第一队列的读操作请求消息请求的I/O接口中存在偏僻区域的第五I/O接口,将所述读操作请求消息请求第五I/O接口读取的数据写入到所述缓存中。If there is a fifth I/O interface in a remote area in the I/O interface requested by the read operation request message of the first queue, write the data read by the fifth I/O interface requested by the read operation request message into in the cache.
第二方面,提供了一种用于磁盘寻址的装置,所述装置包括接收单元、确定单元和处理单元;In a second aspect, a device for disk addressing is provided, and the device includes a receiving unit, a determining unit, and a processing unit;
所述接收单元,用于接收对所述磁盘进行随机读写的操作请求消息的第一队列,所述每个操作请求消息中携带有对所述磁盘进行操作请求时对应的I/O接口;The receiving unit is configured to receive a first queue of operation request messages for randomly reading and writing to the disk, and each operation request message carries an I/O interface corresponding to an operation request for the disk;
所述确定单元,用于确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围;The determining unit is configured to determine a first range of I/O interface locations requested by the read operation request message, the first range being the location of the requested I/O interface in the first queue with the farthest distance The range determined by the I/O interface requested by the two read operation request messages;
所述处理单元,用于将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列;The processing unit is configured to first sort the I/O interfaces requested by the write operation request messages whose I/O interface positions belong to the first range and the I/O interfaces requested by all the read operation request messages, to obtain the operation The second queue of request messages;
所述确定单元,还用于将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,所述处理单元,还用于将所述第三队列的写操作请求消息请求的数据写入缓存中;The determining unit is further configured to determine the write operation request message whose position of the I/O interface does not belong to the first range as the third queue, and the processing unit is further configured to assign the write operation request message of the third queue to the third queue. The data requested by the request message is written into the cache;
所述处理单元,还用于根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。The processing unit is further configured to sequentially perform the requested operations on the disk according to the operation request messages of the second queue.
在第一种可能的实现方式中,结合第二方面,所述确定单元,还用于在获得所述操作请求消息的第二队列后,确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口;In a first possible implementation manner, in combination with the second aspect, the determining unit is further configured to, after obtaining the second queue of the operation request message, determine whether the position of the I/O interface corresponding to the data in the cache is There is a first I/O interface belonging to the first range;
所述处理单元,还用于若有所述第一I/O接口,按照所述第一排序,在所述第二队列中插入对所述第一I/O接口对应的数据进行写操作的写操作请求消息;The processing unit is further configured to, if there is the first I/O interface, according to the first sorting, insert into the second queue the data corresponding to the first I/O interface to perform the write operation Write operation request message;
或or
所述确定单元,还用于将属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列之前,确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口;The determining unit is further configured to first sort the I/O interfaces requested by the write operation request message and all the I/O interfaces requested by the read operation request message belonging to the first range, and obtain the second I/O interface of the operation request message. Before the queue, determine whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range;
所述处理单元,还用于若有所述第一I/O接口,将对所述第一I/O接口对应的数据进行写操作的写操作请求消息插入到所述磁盘的第一队列中。The processing unit is further configured to, if there is the first I/O interface, insert a write operation request message for writing data corresponding to the first I/O interface into the first queue of the disk .
在第二种可能的实现方式中,根据第二方面或第一种可能的实现方式,所述装置还包括检查单元,In a second possible implementation manner, according to the second aspect or the first possible implementation manner, the device further includes an inspection unit,
所述检查单元,用于在将所述第三队列的写操作请求消息请求的数据写入缓存中前,检查所述缓存中的存储空间是否已满;The checking unit is configured to check whether the storage space in the cache is full before writing the data requested by the write operation request message of the third queue into the cache;
所述确定单元,还用于若所述缓存中的存储空间已满,确定第二I/O接口,所述第二I/O接口为所述第三队列中请求的I/O接口和所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口;The determining unit is further configured to determine a second I/O interface if the storage space in the cache is full, and the second I/O interface is the I/O interface requested in the third queue and the requested I/O interface. The position in the I/O interface corresponding to the data of the cache is closest to the I/O interface of the second queue;
所述处理单元,还用于若所述缓存中存在所述第二I/O接口,按照所述第一排序,在所述第二队列中插入对所述第二I/O接口对应的数据进行写操作的写操作请求消息;The processing unit is further configured to insert data corresponding to the second I/O interface into the second queue according to the first sorting if the second I/O interface exists in the cache A write operation request message for a write operation;
所述处理单元,还用于若所述第三队列中存在所述第二I/O接口,按照所述第一排序,将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中。The processing unit is further configured to: if the second I/O interface exists in the third queue, according to the first sorting, the write operation request corresponding to the second I/O interface of the third queue A message is inserted into said second queue.
在第三种可能的实现方式中,根据第二方面或第一种可能的实现方式或第二种可能的实现方式,所述第一排序具体为:In the third possible implementation manner, according to the second aspect or the first possible implementation manner or the second possible implementation manner, the first sorting is specifically:
以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,按照I/O接口的排序对应的获取所述操作请求消息的排序。The position of the I/O interface where the current magnetic head is located is the first previous I/O interface, and the I/O interface closest to the position of the previous I/O interface is determined as the next I/O interface, according to the I/O interface The sorting corresponds to the sorting of obtaining the operation request messages.
在第四种可能的实现方式中,根据第三种可能的实现方式,In the fourth possible implementation, according to the third possible implementation,
所述检查单元,用于将所述第三队列的写操作请求消息请求的数据写入缓存中前,检查所述第一队列中是否全为写操作请求消息;The checking unit is configured to check whether the first queue is full of write operation request messages before writing the data requested by the write operation request message of the third queue into the cache;
所述确定单元,还用于若所述第一队列中全为写操作请求消息,则确定第三I/O接口和第四I/O接口,所述第三I/O接口为与上一I/O接口的距离小于第一预设范围的I/O接口,所述第四I/O接口为与所述第三I/O接口的任一I/O接口的距离大于第一预设范围的I/O接口,所述第四I/O接口对应的写操作请求消息确定为第三队列;The determining unit is further configured to determine a third I/O interface and a fourth I/O interface if all of the first queue contains write operation request messages, and the third I/O interface is the same as the last I/O interface. The distance of the I/O interface is less than the I/O interface of the first preset range, and the distance between the fourth I/O interface and any I/O interface of the third I/O interface is greater than the first preset range of I/O interfaces, the write operation request message corresponding to the fourth I/O interface is determined as the third queue;
所述处理单元,还用于在获得操作请求消息的第二队列后,根据所述第一排序,将所述第三I/O接口对应的写操作请求消息插入到所述第二队列。The processing unit is further configured to, after obtaining the second queue of operation request messages, insert the write operation request message corresponding to the third I/O interface into the second queue according to the first sorting.
在第五种可能的实现方式中,根据第二方面或第一种可能的实现方式至第四种可能的实现方式,所述装置还包括统计单元,In a fifth possible implementation manner, according to the second aspect or the first possible implementation manner to the fourth possible implementation manner, the device further includes a statistical unit,
所述统计单元,用于在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,统计所述第一队列请求的I/O接口分别对应的磁盘区域的I/O接口的请求频率,判断所述磁盘区域是否为偏僻区域;The statistical unit is configured to, after receiving the first queue of operation request messages for randomly reading and writing the disk, count the I/O interfaces of the disk regions respectively corresponding to the I/O interfaces requested by the first queue Request frequency, judging whether the disk area is a remote area;
所述处理单元,还用于在根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作之后,若所述第一队列的读操作请求消息请求的I/O接口中存在偏僻区域的第五I/O接口,将所述读操作请求消息请求第五I/O接口读取的数据写入到所述缓存中。The processing unit is further configured to, after sequentially performing the requested operations on the disk according to the operation request message of the second queue, if the I/O interface requested by the read operation request message of the first queue There is a fifth I/O interface in a remote area, and the data read by the fifth I/O interface requested by the read operation request message is written into the cache.
本发明实施例提供了一种用于磁盘寻址的方法和装置,该方法在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,根据所述每个操作请求消息中携带的对所述磁盘进行操作请求时对应的I/O接口,确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围,进而将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列,将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,将所述第三队列的写操作请求消息请求的数据写入缓存中,最后根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。The embodiment of the present invention provides a method and device for disk addressing. After receiving the first queue of operation request messages for random reading and writing of the disk, the method according to the information carried in each operation request message The corresponding I/O interface when performing an operation request on the disk, determine the first range of the I/O interface position requested by the read operation request message, and the first range is the I of the request in the first queue The position of the /O interface is the range determined by the I/O interfaces requested by the two read operation request messages farthest away, and then the position of the I/O interface belongs to the I/O interface requested by the write operation request message of the first range Perform first sorting with the I/O interfaces requested by all read operation request messages, obtain the second queue of operation request messages, and determine the write operation request messages whose positions of the I/O interface do not belong to the first range as the third queue , writing the data requested by the write operation request message of the third queue into the cache, and finally performing the requested operation on the disk in sequence according to the operation request message of the second queue.
首先,第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,将所述第三队列中的写操作请求消息请求的数据直接写入到缓存中,可以节省磁盘寻址的时间,同时也避免了当所述操作请求消息请求的I/O接口距离第一范围较远时,将所述操作请求消息在磁盘中长期挂起,再次接收到所述操作请求消息时,被插入队尾所带来的消耗的寻址时间较大的问题。First, the position of the I/O interface requested by the write operation request message in the third queue is not within the first range, and the data requested by the write operation request message in the third queue is directly written into the cache, which can save disk The addressing time also avoids that when the I/O interface requested by the operation request message is far away from the first range, the operation request message is suspended in the disk for a long time, and the operation request message is received again When it is inserted into the tail of the queue, it consumes a lot of addressing time.
另外,所述写入缓存中的数据被再次请求时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, when the data written in the cache is requested again, it can be directly read from the cache without addressing in the disk, and also saves disk addressing time.
再者,所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,也节省磁盘寻址的时间。Furthermore, the second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requests are sequentially performed according to the sort order of the requested I/O interfaces Instead of performing the requested operation randomly after receiving the first queue, it also saves disk seek time.
附图说明 Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. Those skilled in the art can also obtain other drawings based on these drawings without creative work.
图1为本发明实施例提供的一种用于磁盘寻址的方法流程示意图;FIG. 1 is a schematic flowchart of a method for disk addressing provided by an embodiment of the present invention;
图2为本发明实施例提供的另一种用于磁盘寻址的方法流程示意图;FIG. 2 is a schematic flowchart of another method for disk addressing provided by an embodiment of the present invention;
图3为利用本发明实施例提供的另一种用于磁盘寻址的方法对接收到的第一队列请求的I/O接口处理的示意图;3 is a schematic diagram of processing the I/O interface of the received first queue request by using another method for disk addressing provided by an embodiment of the present invention;
图4为本发明实施例提供的一种用于磁盘寻址的装置结构示意图;FIG. 4 is a schematic structural diagram of a device for disk addressing provided by an embodiment of the present invention;
图5为本发明实施例提供的另一种用于磁盘寻址的装置结构示意图;FIG. 5 is a schematic structural diagram of another device for disk addressing provided by an embodiment of the present invention;
图6为本发明实施例提供的又一种用于磁盘寻址的装置结构示意图。FIG. 6 is a schematic structural diagram of another device for disk addressing provided by an embodiment of the present invention.
具体实施方式 detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
实施例一、Embodiment one,
本发明实施例提供了一种用于磁盘寻址的方法,具体如图1所示,该方法包括:An embodiment of the present invention provides a method for disk addressing, specifically as shown in FIG. 1, the method includes:
101、接收对所述磁盘进行随机读写的操作请求消息的第一队列,所述每个操作请求消息中携带有对所述磁盘进行操作请求时对应的I/O接口。101. A first queue for receiving operation request messages for performing random reads and writes on the disk, where each operation request message carries an I/O interface corresponding to an operation request on the disk.
通常,磁盘由许多扇区组成,一个或多个扇区对应一个I/O接口,对所述磁盘进行随机读写的操作时,实质是通过所述I/O接口,完成从磁盘读数据或向磁盘写数据的动作。所以对所述磁盘进行随机读写的操作请求消息中,每个操作请求消息都携带了对所述磁盘进行操作请求时对应的I/O接口。Generally, a disk is composed of many sectors, and one or more sectors correspond to an I/O interface. When performing random read and write operations on the disk, the essence is to read data from the disk or read data from the disk through the I/O interface. The action of writing data to disk. Therefore, in the operation request messages for performing random reading and writing on the disk, each operation request message carries the corresponding I/O interface when performing an operation request on the disk.
102、确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围。102. Determine a first range of I/O interface locations requested by the read operation request message, where the first range is the two read operation requests in the first queue whose I/O interface locations are farthest from each other The scope determined by the I/O interface of the message request.
确定读操作请求消息请求的I/O接口位置的第一范围,当所述第一队列全为读操作请求消息时,所述第一范围内包含所述第一队列中的全部请求消息请求的I/O接口;当所述第一队列全为写操作请求消息时,所述第一范围内为空;当所述第一队列中既包含读操作请求消息,又包含写操作请求消息,则所述第一范围内也可能包含写操作请求消息请求的I/O接口。Determine the first range of I/O interface positions requested by the read operation request message, and when the first queue is full of read operation request messages, the first range includes all the request message requests in the first queue I/O interface; when the first queue is all write operation request messages, the first range is empty; when the first queue contains both read operation request messages and write operation request messages, then The first range may also include the I/O interface requested by the write operation request message.
103、将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列。103. First sort the I/O interfaces requested by the write operation request messages whose I/O interface positions belong to the first range and all the I/O interfaces requested by the read operation request messages, and obtain the second I/O interfaces requested by the operation request messages. queue.
为了减小磁盘寻址的时间,在确定了第一队列中I/O接口位置的第一范围后,可以对第一队列的操作请求消息进行分离。其中将所述I/O接口的位置在第一范围内的读写操作请求消息作为一个队列;将所述I/O接口的位置在第一范围外的写操作请求消息作为一个队列。In order to reduce disk addressing time, after the first range of I/O interface positions in the first queue is determined, the operation request messages of the first queue may be separated. Wherein, the read and write operation request messages whose positions of the I/O interfaces are within the first range are used as a queue; the write operation request messages whose positions of the I/O interfaces are outside the first range are used as a queue.
然后对I/O接口的位置属于所述第一范围的读写操作请求消息请求的I/O接口进行第一排序,其中所述第一排序可以按照I/O接口的位置从大到小的顺序排,也可以为按照从小到大的顺序排,也可以以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,依此对第一范围内的所有操作请求消息请求的I/O接口进行排序,然后按照I/O接口的排序对应的获取所述操作请求消息的排序,获得所述操作请求消息的第二队列。具体的,本发明实施例对此不作具体限定。Then the I/O interface requested by the read and write operation request message whose position of the I/O interface belongs to the first range is first sorted, wherein the first sorting can be performed according to the position of the I/O interface from large to small Arranged in order, it can also be arranged in order from small to large, or the position of the I/O interface where the current head is located can be the first and last I/O interface, and the I/O interface closest to the position of the previous I/O interface can be The O interface is determined to be the next I/O interface, and accordingly the I/O interfaces requested by all operation request messages in the first range are sorted, and then the order of the operation request messages is obtained according to the order of the I/O interfaces. , to obtain the second queue of the operation request message. Specifically, this embodiment of the present invention does not specifically limit it.
104、将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,将所述第三队列的写操作请求消息请求的数据写入缓存中。104. Determine the write operation request message whose location of the I/O interface does not belong to the first range as the third queue, and write the data requested by the write operation request message of the third queue into the cache.
在第二队列中包括了第一队列中的所有读操作请求消息和I/O接口的位置在第一范围内的所有写操作请求消息,那么I/O接口的位置不属于所述第一范围的所有写操作请求消息确定为所述第三队列。If the second queue includes all read operation request messages in the first queue and all write operation request messages whose I/O interface positions are within the first range, then the I/O interface positions do not belong to the first range All write operation request messages are determined as the third queue.
由于第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,表明第三队列请求的I/O接口的位置距离第二队列较远,为了节省磁盘寻址的时间,所述第三队列中的写操作请求消息请求的数据可以直接写入到缓存中。Since the location of the I/O interface requested by the write operation request message in the third queue is not within the first range, it indicates that the location of the I/O interface requested by the third queue is far from the second queue, in order to save disk addressing time , the data requested by the write operation request message in the third queue may be directly written into the cache.
另外,所述写入缓存中的数据可用于当再次出现所述缓存中的数据对应的I/O接口的读操作请求消息时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, the data in the write cache can be used to directly read in the cache when the read operation request message of the I/O interface corresponding to the data in the cache reappears, without searching for the data in the disk. address, and also save disk seek time.
这里需要说明的是,获取第二队列与获取第三队列在时间上没有绝对的先后顺序,也可以先执行步骤104,再执行步骤103。本发明实施例对此不作限定。It should be noted here that there is no absolute sequence in terms of time for acquiring the second queue and acquiring the third queue, and step 104 may be performed first, and then step 103 may be performed. This embodiment of the present invention does not limit it.
另外需要说明的是,所述缓存为永久性缓存。In addition, it should be noted that the cache is a permanent cache.
105、根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。105. Perform the requested operation on the disk in sequence according to the operation request message in the second queue.
所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,节省磁盘寻址的时间。The second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requested operations are performed sequentially according to the sort order of the requested I/O interfaces, Instead of performing the requested operation randomly after receiving the first queue, the disk addressing time is saved.
相应的,需要说明的是,步骤105也可以在步骤103获取第二队列后执行,本发明实施例对此也不作具体限定。Correspondingly, it should be noted that step 105 may also be executed after acquiring the second queue in step 103, which is not specifically limited in this embodiment of the present invention.
本发明实施例提供了一种用于磁盘寻址的方法,该方法在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,根据所述每个操作请求消息中携带的对所述磁盘进行操作请求时对应的I/O接口,确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围,进而将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列,将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,将所述第三队列的写操作请求消息请求的数据写入缓存中,最后根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。An embodiment of the present invention provides a method for disk addressing. After receiving the first queue of operation request messages for randomly reading and writing to the disk, the method uses the address information carried in each operation request message to The corresponding I/O interface when the disk performs an operation request determines the first range of the I/O interface position requested by the read operation request message, and the first range is the requested I/O in the first queue The position of the interface is the range determined by the I/O interface requested by the two read operation request messages farthest away, and then the I/O interface requested by the write operation request message whose position of the I/O interface belongs to the first range and all The I/O interface requested by the read operation request message is first sorted to obtain the second queue of the operation request message, and the write operation request message whose position of the I/O interface does not belong to the first range is determined as the third queue, and the The data requested by the write operation request message of the third queue is written into the cache, and finally, according to the operation request message of the second queue, the requested operations are sequentially performed on the disk.
基于本发明实施例提供的技术方案,首先,第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,将所述第三队列中的写操作请求消息请求的数据直接写入到缓存中,可以节省磁盘寻址的时间,同时也避免了当所述操作请求消息请求的I/O接口距离第一范围较远时,将所述操作请求消息在磁盘中长期挂起,再次接收到所述操作请求消息时,被插入队尾所带来的消耗的寻址时间较大的问题。Based on the technical solution provided by the embodiment of the present invention, first, the position of the I/O interface requested by the write operation request message in the third queue is not within the first range, and the data requested by the write operation request message in the third queue Writing directly into the cache can save disk addressing time, and also avoids long-term hanging of the operation request message in the disk when the I/O interface requested by the operation request message is far from the first range. From the beginning, when the operation request message is received again, the problem of the consumed addressing time caused by being inserted into the tail of the queue is relatively large.
另外,所述写入缓存中的数据被再次请求时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, when the data written in the cache is requested again, it can be directly read from the cache without addressing in the disk, and also saves disk addressing time.
再者,所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,也节省磁盘寻址的时间。Furthermore, the second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requests are sequentially performed according to the sort order of the requested I/O interfaces Instead of performing the requested operation randomly after receiving the first queue, it also saves disk seek time.
实施例二、Embodiment two,
本发明实施例提供了一种用于磁盘寻址的方法,具体如图2所示,该方法包括:An embodiment of the present invention provides a method for disk addressing, specifically as shown in Figure 2, the method includes:
201、接收对所述磁盘进行随机读写的操作请求消息的第一队列,所述每个操作请求消息中携带有对所述磁盘进行操作请求时对应的I/O接口。201. A first queue that receives operation request messages for random reading and writing of the disk, where each operation request message carries an I/O interface corresponding to the operation request for the disk.
通常,磁盘由许多扇区组成,一个或多个扇区对应一个I/O接口,对所述磁盘进行随机读写的操作时,实质是通过所述I/O接口,完成从磁盘读数据或向磁盘写数据的动作。所以对所述磁盘进行随机读写的操作请求消息中,每个操作请求消息都携带了对所述磁盘进行操作请求时对应的I/O接口。Generally, a disk is composed of many sectors, and one or more sectors correspond to an I/O interface. When performing random read and write operations on the disk, the essence is to read data from the disk or read data from the disk through the I/O interface. The action of writing data to disk. Therefore, in the operation request messages for performing random reading and writing on the disk, each operation request message carries the corresponding I/O interface when performing an operation request on the disk.
举例来说,如图3所示,假设接收到的第一队列的操作请求消息请求的I/O接口分别为:For example, as shown in Figure 3, it is assumed that the I/O interfaces requested by the received operation request message of the first queue are respectively:
读I/O接口1,写I/O接口15,读I/O接口6,读I/O接口9,写I/O接口7,写I/O接口12。每个椭圆的小单元表示的为读操作请求的I/O接口,每个矩形的小单元表示的为写操作请求的I/O接口。Read I/O port 1, write I/O port 15, read I/O port 6, read I/O port 9, write I/O port 7, and write I/O port 12. Each elliptical small unit represents an I/O interface requested by a read operation, and each rectangular small unit represents an I/O interface requested by a write operation.
202、确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围。202. Determine a first range of I/O interface locations requested by the read operation request message, where the first range is the two read operation requests in the first queue whose I/O interface locations are farthest from each other The scope determined by the I/O interface of the message request.
确定读操作请求消息请求的I/O接口位置的第一范围,当所述第一队列全为读操作请求消息时,所述第一范围内包含所述第一队列中的全部请求消息请求的I/O接口;当所述第一队列全为写操作请求消息时,所述第一范围内为空;当所述第一队列中既包含读操作请求消息,又包含写操作请求消息,则所述第一范围内也可能包含写操作请求消息请求的I/O接口。Determine the first range of I/O interface positions requested by the read operation request message, and when the first queue is full of read operation request messages, the first range includes all the request message requests in the first queue I/O interface; when the first queue is all write operation request messages, the first range is empty; when the first queue contains both read operation request messages and write operation request messages, then The first range may also include the I/O interface requested by the write operation request message.
具体如图3所示,第一队列中,I/O接口1与I/O接口9之间的位置最远,所以接收到的第一队列的第一范围应该是I/O接口1至I/O接口9之间的I/O接口。Specifically as shown in Figure 3, in the first queue, the position between I/O interface 1 and I/O interface 9 is the farthest, so the first range of the first queue received should be I/O interface 1 to I I/O interface between /O interface 9.
203、将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列。203. First sort the I/O interfaces requested by the write operation request messages whose I/O interface positions belong to the first range and all the I/O interfaces requested by the read operation request messages, and obtain the second I/O interfaces requested by the operation request messages. queue.
为了减小磁盘寻址的时间,在确定了第一队列中I/O接口位置的第一范围后,可以对第一队列的操作请求消息进行分离。其中将所述I/O接口的位置在第一范围内的读写操作请求消息作为一个队列;将所述I/O接口的位置在第一范围外的写操作请求消息作为一个队列。In order to reduce disk addressing time, after the first range of I/O interface positions in the first queue is determined, the operation request messages of the first queue may be separated. Wherein, the read and write operation request messages whose positions of the I/O interfaces are within the first range are used as a queue; the write operation request messages whose positions of the I/O interfaces are outside the first range are used as a queue.
然后对I/O接口的位置属于所述第一范围的读写操作请求消息请求的I/O接口进行第一排序,其中所述第一排序可以按照I/O接口的位置从大到小的顺序排,也可以为按照从小到大的顺序排,也可以以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,依此对第一范围内的所有操作请求消息请求的I/O接口进行排序,然后按照I/O接口的排序对应的获取所述操作请求消息的排序,获得所述操作请求消息的第二队列。具体的,本发明实施例对此不作具体限定。Then the I/O interface requested by the read and write operation request message whose position of the I/O interface belongs to the first range is first sorted, wherein the first sorting can be performed according to the position of the I/O interface from large to small Arranged in order, it can also be arranged in order from small to large, or the position of the I/O interface where the current head is located can be the first and last I/O interface, and the I/O interface closest to the position of the previous I/O interface can be The O interface is determined to be the next I/O interface, and accordingly the I/O interfaces requested by all operation request messages in the first range are sorted, and then the order of the operation request messages is obtained according to the order of the I/O interfaces. , to obtain the second queue of the operation request message. Specifically, this embodiment of the present invention does not specifically limit it.
具体如图3所示,写操作请求消息请求的I/O接口7在第一范围内,将其和所有读操作请求消息请求的I/O接口I/O接口1,I/O接口6,I/O接口9一起进行第一排序,假设在第一范围中,离当前磁头所在的I/O接口5最近的为I/O接口6,此时I/O接口6为当前磁头所在的I/O接口5的下一I/O接口,然后I/O接口6作为上一I/O接口,距离I/O接口6最近的为I/O接口7,按此方式,下一I/O接口依次为I/O接口9,I/O接口1。最终获得的第二队列如图3所示为:Specifically as shown in Figure 3, the I/O interface 7 requested by the write operation request message is within the first range, and it is combined with the I/O interface I/O interface 1 and the I/O interface 6 requested by all read operation request messages. The I/O interface 9 carries out the first sorting together, assuming that in the first range, the I/O interface 6 is the closest to the I/O interface 5 where the current magnetic head is located, and now the I/O interface 6 is the I/O interface where the current magnetic head is located The next I/O interface of /O interface 5, then I/O interface 6 is used as the previous I/O interface, and the closest to I/O interface 6 is I/O interface 7. In this way, the next I/O The interfaces are I/O interface 9 and I/O interface 1 in turn. The finally obtained second queue is shown in Figure 3 as follows:
读I/O接口6,写I/O接口7,读I/O接口9,读I/O接口1。Read I/O port 6, write I/O port 7, read I/O port 9, and read I/O port 1.
当然,所述第一排序也可以有其它的方式,可以按照上述的排序方式,也可以为按照从小到大的顺序排,使排序结果为:I/O1,I/O6,I/O7,I/O9,还可以有其它的方式,这里不作具体限定。Of course, the first sorting method can also have other methods, which can be arranged according to the above-mentioned sorting method, or in ascending order, so that the sorting result is: I/O1, I/O6, I/O7, I/O1 /O9, there can also be other ways, which are not specifically limited here.
204、确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口。204. Determine whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range.
具体如图3中,假设缓存中的数据对应的I/O接口为I/O接口3,I/O接口10,I/O接口18。Specifically, as shown in FIG. 3 , it is assumed that the I/O interfaces corresponding to the data in the cache are I/O interface 3 , I/O interface 10 , and I/O interface 18 .
此时I/O接口3在第一范围内,所以缓存中有属于第一范围的I/O接口,I/O接口3为第一I/O接口。At this time, the I/O interface 3 is within the first range, so there are I/O interfaces belonging to the first range in the cache, and the I/O interface 3 is the first I/O interface.
若有所述第一I/O接口,执行步骤205;若无所述第一I/O接口,执行步骤206。If there is the first I/O interface, perform step 205; if there is no first I/O interface, perform step 206.
205、若有所述第一I/O接口,按照所述第一排序,在所述第二队列中插入对所述第一I/O接口对应的数据进行写操作的写操作请求消息。205. If there is the first I/O interface, according to the first sorting, insert a write operation request message for writing data corresponding to the first I/O interface into the second queue.
如果有所述第一I/O接口,可以将所述第一I/O接口对应的数据进行写操作的写请求消息插入到所述第二队列中,一方面可以在不浪费多余寻址时间的前提下,将所述缓存中第一I/O接口对应的数据写入所述第一I/O接口;另一方面,可以给缓存节省出空间,用来缓存其它的数据。If there is the first I/O interface, a write request message for writing data corresponding to the first I/O interface can be inserted into the second queue, on the one hand, without wasting redundant addressing time On the premise that the data corresponding to the first I/O interface in the cache is written into the first I/O interface; on the other hand, space can be saved for the cache to cache other data.
具体如图3所示,因为步骤204中确定出I/O接口3为属于第一范围的I/O接口,此时将I/O接口3对应的数据的写操作请求消息插入到第二队列中,图3得到的第二队列为:Specifically as shown in Figure 3, because it is determined in step 204 that the I/O interface 3 is an I/O interface belonging to the first range, at this time, the write operation request message of the data corresponding to the I/O interface 3 is inserted into the second queue , the second queue obtained in Figure 3 is:
读I/O接口6,写I/O接口7,读I/O接口9,写I/O接口3,读I/O接口1。Read I/O port 6, write I/O port 7, read I/O port 9, write I/O port 3, and read I/O port 1.
206、将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列。206. Determine the write operation request messages whose I/O interface locations do not belong to the first range as the third queue.
在第二队列中包括了第一队列中的所有读操作请求消息和I/O接口的位置在第一范围内的所有写操作请求消息,那么I/O接口的位置不属于所述第一范围的所有写操作请求消息确定为所述第三队列。If the second queue includes all read operation request messages in the first queue and all write operation request messages whose I/O interface positions are within the first range, then the I/O interface positions do not belong to the first range All write operation request messages are determined as the third queue.
由于第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,为了节省磁盘寻址的时间,所述第三队列中的写操作请求消息请求的数据可以直接写入到缓存中。Since the position of the I/O interface requested by the write operation request message in the third queue is not within the first range, in order to save disk addressing time, the data requested by the write operation request message in the third queue can be directly written into the cache.
另外,所述写入缓存中的数据可用于当再次出现所述缓存中的数据对应的I/O接口的读操作请求消息时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, the data in the write cache can be used to directly read in the cache when the read operation request message of the I/O interface corresponding to the data in the cache reappears, without searching for the data in the disk. address, and also save disk seek time.
具体如图3所示,I/O接口的位置不属于所述第一范围的写操作请求消息对应的I/O接口为写I/O接口15,写I/O接口12,则将I/O接口15和I/O接口12的写操作请求消息确定为第三队列。Specifically as shown in Figure 3, the position of the I/O interface does not belong to the I/O interface corresponding to the write operation request message of the first range is to write the I/O interface 15, and write the I/O interface 12, then the I/O The write operation request messages of the O interface 15 and the I/O interface 12 are determined as the third queue.
这里需要说明的是,获取第二队列与获取第三队列在时间上没有绝对的先后顺序,也可以先执行步骤206,再执行步骤203;也可以执行步骤203后,接着执行206,只不过步骤203一定先于步骤204执行,而当步骤206早于步骤204执行时,在步骤204判断为否的情况下,要接着执行步骤207。What needs to be explained here is that there is no absolute sequence in terms of time for acquiring the second queue and acquiring the third queue. You can also execute step 206 first, and then execute step 203; you can also execute step 203 and then execute 206. Step 203 must be executed before step 204, and when step 206 is executed earlier than step 204, if step 204 judges No, step 207 will be executed next.
207、检查所述缓存中的存储空间是否已满。207. Check whether the storage space in the cache is full.
在所述缓存的存储空间已满的前提下时,此时所述第三队列的写操作请求消息请求的数据是不能直接写入缓存中的。所以在将所述第三队列的写操作请求消息请求的数据写入缓存中前,首先需要先检查所述缓存中的存储空间是否已满。On the premise that the storage space of the cache is full, the data requested by the write operation request message of the third queue cannot be directly written into the cache at this time. Therefore, before writing the data requested by the write operation request message of the third queue into the cache, it is first necessary to check whether the storage space in the cache is full.
具体如图3所示,假设缓存最初存储I/O接口3,I/O接口10,I/O接口18对应的数据时,缓存的存储空间刚好已满。在将I/O接口3对应的数据进行写操作的写操作请求消息插入到所述第二队列后,则表明缓存中预留出了空间。而虽然缓存中有了一定的存储空间,但第三队列中包括了两个写操作请求消息,分别对应I/O接口15和I/O接口12,假设每个操作请求消息请求的数据所占用的空间大小一样,此时缓存空间不够,因此若缓存中空闲的存储空间小于所述第三队列的写操作请求消息请求的数据对应的存储空间时,此时认为缓存空间已满。Specifically as shown in FIG. 3 , it is assumed that when the cache initially stores the data corresponding to the I/O interface 3 , the I/O interface 10 , and the I/O interface 18 , the storage space of the cache is just full. After the write operation request message for writing data corresponding to the I/O interface 3 is inserted into the second queue, it indicates that space is reserved in the cache. And although there is a certain storage space in the cache, two write operation request messages are included in the third queue, corresponding to I/O interface 15 and I/O interface 12 respectively, assuming that the data requested by each operation request message occupies At this time, the cache space is not enough, so if the free storage space in the cache is smaller than the storage space corresponding to the data requested by the write operation request message of the third queue, the cache space is considered to be full at this time.
若所述缓存中的存储空间已满,则执行步骤208;若所述缓存中的存储空间未满,则执行步骤211。If the storage space in the cache is full, execute step 208; if the storage space in the cache is not full, execute step 211.
208、若所述缓存中的存储空间已满,确定第二I/O接口,所述第二I/O接口为所述第三队列中请求的I/O接口和所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口。208. If the storage space in the cache is full, determine a second I/O interface, where the second I/O interface corresponds to the I/O interface requested in the third queue and the cached data The position in the I/O interface is closest to the I/O interface of the second queue.
为了能够及时处理第三队列中的写操作请求消息,并尽可能减小磁盘寻址的时间,在缓存空间已满的情况下,需要确定出第三队列中请求的I/O接口和缓存中的数据对应的I/O接口中最接近第二队列请求的I/O接口的I/O接口,即第二I/O接口。然后将对其第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中。In order to be able to process the write operation request message in the third queue in time and reduce the time of disk addressing as much as possible, when the cache space is full, it is necessary to determine the I/O interface requested in the third queue and the I/O interface in the cache. Among the I/O interfaces corresponding to the data, the I/O interface closest to the I/O interface requested by the second queue is the second I/O interface. Then insert a write operation request message for writing data corresponding to the second I/O interface into the second queue.
具体如图3所示,第三队列中的写请求消息对应的I/O接口有I/O接口12和I/O接口15,缓存中的数据对应的I/O接口还有I/O接口10,I/O接口18,第二队列为读I/O接口6,写I/O接口7,读I/O接口9,写I/O接口3,读I/O接口1。Specifically, as shown in Figure 3, the I/O interfaces corresponding to the write request messages in the third queue include I/O interface 12 and I/O interface 15, and the I/O interfaces corresponding to the data in the cache also have I/O interfaces 10. I/O interface 18, the second queue is reading I/O interface 6, writing I/O interface 7, reading I/O interface 9, writing I/O interface 3, and reading I/O interface 1.
此时,依次比较第三队列请求的I/O接口和缓存中的数据对应的I/O接口,找出距离第二队列请求的I/O接口最近的I/O接口。显然,第三队列中请求的I/O接口和缓存中的数据对应的I/O接口中最接近第二队列请求的I/O接口为I/O接口10,因此确定所述第二I/O接口可以为I/O接口10,此时缓存中有足够的存储空间可以写入第三队列请求的数据。At this time, the I/O interface requested by the third queue is sequentially compared with the I/O interface corresponding to the data in the cache, and the I/O interface closest to the I/O interface requested by the second queue is found. Obviously, the I/O interface closest to the second queue request among the I/O interface requested in the third queue and the I/O interface corresponding to the data in the cache is I/O interface 10, so it is determined that the second I/O interface The O interface may be the I/O interface 10, and at this time, there is enough storage space in the cache to write the data requested by the third queue.
当然,若第三队列中包含有多个写操作请求消息,而存储空间已满时,在第三队列中和缓存中确定出最接近第二队列的第一个第二I/O接口后,还可以从第三队列中和缓存中剩余的请求的I/O接口中以此重新再挑选第二个第二I/O接口,直至缓存中有足够的空间写入第三队列请求的数据。在这样的情况下,多个第二I/O接口有可能同时存在于所述第三队列中和所述缓存中,则需分别将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中,将对所述缓存中的第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中,然后得到所述第二队列和所述第三队列。Certainly, if multiple write operation request messages are included in the third queue, and when the storage space is full, after determining the first second I/O interface closest to the second queue in the third queue and the cache, The second second I/O interface can also be reselected from the remaining requested I/O interfaces in the third queue and cache until there is enough space in the cache to write the data requested by the third queue. In such a case, multiple second I/O interfaces may exist in the third queue and in the cache at the same time, and then the write corresponding to the second I/O interface of the third queue needs to be respectively Inserting an operation request message into the second queue, inserting a write operation request message for performing a write operation on data corresponding to the second I/O interface in the cache into the second queue, and then obtaining the first the second queue and the third queue.
209、若所述缓存中存在所述第二I/O接口,按照所述第一排序,在所述第二队列中插入对所述第二I/O接口对应的数据进行写操作的写操作请求消息。209. If the second I/O interface exists in the cache, according to the first sorting, insert a write operation for writing data corresponding to the second I/O interface into the second queue request message.
若所述缓存中存在所述第二I/O接口,说明所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口,此时为了节省磁盘寻址时间,将对所述第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中。If the second I/O interface exists in the cache, it means that the position of the I/O interface corresponding to the data in the cache is closest to the I/O interface of the second queue. At this time, in order to save disk seek time, Inserting a write operation request message for performing a write operation on data corresponding to the second I/O interface into the second queue.
另外,将缓存中所述第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中后,缓存中留出了存储空间,也可以将所述第三队列的写操作请求消息请求的数据写入缓存中。In addition, after the write operation request message for writing data corresponding to the second I/O interface in the cache is inserted into the second queue, storage space is reserved in the cache, and the third queue can also be The data requested by the write operation request message is written into the cache.
具体如图3中,第二I/O接口中,I/O接口10为缓存中的数据对应的I/O接口,因此按照所述第一排序,在所述第二队列中插入对所述I/O接口10对应的缓存中的数据进行写操作的写操作请求消息。Specifically as shown in Figure 3, in the second I/O interface, the I/O interface 10 is the I/O interface corresponding to the data in the cache, so according to the first sorting, insert the pair of the A write operation request message for writing data in the cache corresponding to the I/O interface 10 .
210、若所述第三队列中存在所述第二I/O接口,按照所述第一排序,将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中。210. If the second I/O interface exists in the third queue, according to the first sorting, insert the write operation request message corresponding to the second I/O interface of the third queue into the first queue In the second queue.
当所述第二I/O接口在所述第三队列中时,说明所述第三队列中所述写操作请求消息请求的I/O接口的位置离所述第二队列最近,此时为了节省磁盘寻址的时间,按照第一排序,将所述第三队列的写操作请求消息插入到所述第二队列中。When the second I/O interface is in the third queue, it indicates that the position of the I/O interface requested by the write operation request message in the third queue is the closest to the second queue. To save disk addressing time, insert the write operation request messages of the third queue into the second queue according to the first sorting.
211、将所述第三队列的写操作请求消息请求的数据写入缓存中。211. Write the data requested by the write operation request message of the third queue into the cache.
具体如图3所示,第三队列的写操作请求消息请求的I/O接口为I/O接口12和I/O接口15,因此将所述第三队列中I/O接口12和I/O接口15的写操作请求消息请求的数据写入缓存中。Specifically as shown in Figure 3, the I/O interface requested by the write operation request message of the third queue is I/O interface 12 and I/O interface 15, so the I/O interface 12 and I/O interface 12 in the third queue will be The data requested by the write operation request message of the O interface 15 is written into the cache.
需要说明的是,这里的缓存为永久性缓存。It should be noted that the cache here is a permanent cache.
212、根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。212. According to the operation request message of the second queue, perform the requested operation on the disk in sequence.
如图3所示,经过上述流程,最后得到的第二队列为:As shown in Figure 3, after the above process, the final second queue is:
读I/O6,写I/O7,读I/O9,写I/O10,写I/O3,读I/O1,根据所述第二队列对所述磁盘依次进行所述请求的操作。Read I/O6, write I/O7, read I/O9, write I/O10, write I/O3, read I/O1, and perform the requested operations on the disk in sequence according to the second queue.
所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,节省磁盘寻址的时间。The second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requested operations are performed sequentially according to the sort order of the requested I/O interfaces, Instead of performing the requested operation randomly after receiving the first queue, the disk addressing time is saved.
需要说明的是,上述实施例中在执行完步骤203,获得所述第二队列之后,才确定缓存中是否有第一I/O接口,确定是否需要将缓存中数据写入到磁盘中。可选的,在获得第二队列之前,也是可以提前确定缓存中是否有第一I/O接口,确定是否需要将缓存中数据写入到磁盘中。具体的过程包括:确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口;若有所述第一I/O接口,将对所述第一I/O接口对应的数据进行写操作的写操作请求消息插入到所述磁盘的第一队列中。然后经过第一排序,获得第二队列。It should be noted that, in the above embodiment, after step 203 is executed and the second queue is obtained, it is determined whether there is a first I/O interface in the cache and whether the data in the cache needs to be written to the disk. Optionally, before obtaining the second queue, it may also be determined in advance whether there is a first I/O interface in the cache, and whether the data in the cache needs to be written to the disk. The specific process includes: determining whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range; A write operation request message for writing data corresponding to an I/O interface is inserted into the first queue of the disk. Then after the first sorting, the second queue is obtained.
两个方案最终得到的第二队列一样,因此对于先排序,后插入第二队列还是先插入第一队列,后排序,本发明实施例对此不做具体限定。The second queue finally obtained by the two schemes is the same. Therefore, the embodiment of the present invention does not specifically limit whether to sort first and then insert into the second queue or to first insert into the first queue and then sort.
若第一队列中包含的操作请求消息全为写操作请求消息时,此时第二队列应该为空,第三队列和第一队列中包含的写操作请求消息相同,为了避免将第一队列中的所有写操作请求请求的数据写入到缓存中,可选的,将所述第三队列的写操作请求消息请求的数据写入缓存中前,该方法还包括:If the operation request messages contained in the first queue are all write operation request messages, the second queue should be empty at this time, and the write operation request messages contained in the third queue and the first queue are the same. All the data requested by the write operation request is written into the cache. Optionally, before writing the data requested by the write operation request message of the third queue into the cache, the method further includes:
检查所述第一队列中是否全为写操作请求消息;Check whether the first queue is full of write operation request messages;
若所述第一队列中全为写操作请求消息,则确定第三I/O接口和第四I/O接口,所述第三I/O接口为与上一I/O接口的距离小于第一预设范围的I/O接口,所述第四I/O接口为与所述第三I/O接口的任一I/O接口的距离大于第一预设范围的I/O接口,所述第四I/O接口对应的写操作请求消息确定为第三队列。If the first queue is full of write operation request messages, then determine the third I/O interface and the fourth I/O interface, and the third I/O interface is less than the distance from the previous I/O interface. A preset range of I/O interfaces, the fourth I/O interface is an I/O interface whose distance from any I/O interface of the third I/O interface is greater than the first preset range, so The write operation request message corresponding to the fourth I/O interface is determined as the third queue.
假设接收到的第一队列的操作请求消息请求的I/O接口分别为:Assume that the I/O interfaces requested by the received operation request messages of the first queue are:
写I/O接口11,写I/O接口12,写I/O接口14,写I/O接口1,写I/O接口2,写I/O接口3,写I/O接口29。而当前磁头位置为I/O接口10所在的位置,第一预设范围为小于等于两个I/O接口的距离的范围;与当前磁头所在的位置I/O接口10的位置小于等于两个I/O接口的距离的I/O接口为依次为I/O接口11,I/O接口12,与I/O接口12的位置小于等于两个I/O接口的距离的I/O接口为I/O接口14,I/O14作为上一I/O接口时,剩余的I/O接口中,不存在与I/O接口14的距离小于等于两个I/O接口的距离的I/O接口,所以确定:Write I/O port 11, Write I/O port 12, Write I/O port 14, Write I/O port 1, Write I/O port 2, Write I/O port 3, Write I/O port 29. And the current magnetic head position is the position at I/O interface 10, and the first preset range is the scope that is less than or equal to the distance of two I/O interfaces; The I/O interface of the distance of the I/O interface is followed by I/O interface 11, I/O interface 12, and the I/O interface with the position of I/O interface 12 being less than or equal to the distance of two I/O interfaces is I/O interface 14, when I/O14 is used as the previous I/O interface, among the remaining I/O interfaces, there is no I/O whose distance from I/O interface 14 is less than or equal to the distance between two I/O interfaces interface, so make sure:
第三I/O接口为I/O接口11,I/O接口12,I/O接口14。The third I/O interface is an I/O interface 11 , an I/O interface 12 , and an I/O interface 14 .
I/O接口1,I/O接口2,I/O接口3,I/O接口29为与所述第三I/O接口的任一I/O接口的距离大于第一预设范围的I/O接口,所以确定:第四I/O接口为I/O接口1,I/O接口2,I/O接口3,I/O接口29。The I/O interface 1, the I/O interface 2, the I/O interface 3, and the I/O interface 29 are those whose distance from any I/O interface of the third I/O interface is greater than the first preset range. /O interface, so it is determined that: the fourth I/O interface is I/O interface 1, I/O interface 2, I/O interface 3, and I/O interface 29.
将所述第四I/O接口对应的写操作请求消息确定为第三队列,则第三队列为:写I/O接口1,写I/O接口2,写I/O接口3,写I/O接口29。The write request message corresponding to the fourth I/O interface is determined as the third queue, then the third queue is: write I/O interface 1, write I/O interface 2, write I/O interface 3, write I /O interface 29.
然后根据所述第一排序,将所述第三I/O接口对应的写操作请求消息插入到所述第二队列,再根据所述第二队列的操作请求消息,将所述第二队列请求的I/O接口对应的数据依次写入磁盘中。Then according to the first sorting, insert the write operation request message corresponding to the third I/O interface into the second queue, and then insert the second queue request message according to the operation request message of the second queue The data corresponding to the I/O interface is written to the disk in sequence.
可选的,接收对所述磁盘进行随机读写的操作请求消息的第一队列后,还包括:Optionally, after receiving the first queue of operation request messages for performing random read and write operations on the disk, the method further includes:
统计所述第一队列请求的I/O接口分别对应的磁盘区域的I/O接口的请求频率,判断所述磁盘区域是否为偏僻区域;Counting the request frequency of the I/O interface of the disk area corresponding to the I/O interface of the first queue request respectively, and judging whether the disk area is a remote area;
根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作之后,还包括:According to the operation request message of the second queue, after sequentially performing the requested operations on the disk, the method further includes:
若所述第一队列的读操作请求消息请求的I/O接口中存在偏僻区域的第五I/O接口,将所述读操作请求消息请求第五I/O接口读取的数据写入到所述缓存中。If there is a fifth I/O interface in a remote area in the I/O interface requested by the read operation request message of the first queue, write the data read by the fifth I/O interface requested by the read operation request message into in the cache.
由于在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,先进行偏僻区域的判断,如果某些读操作请求消息对应的I/O接口处于偏僻区域,即存在第五I/O接口,则将所述读操作请求消息请求第五I/O接口读取的数据写入到所述缓存中。这样,在下次出现第五I/O接口的读操作请求消息时,可以直接从缓存中读取,节省了磁盘寻址的时间。After receiving the first queue of operation request messages for random reading and writing of the disk, the remote area is first judged, if the I/O interface corresponding to some read operation request messages is in a remote area, there is a fifth I I/O interface, then write the data read by the fifth I/O interface requested by the read operation request message into the cache. In this way, when the read operation request message of the fifth I/O interface appears next time, it can be directly read from the cache, saving disk addressing time.
本发明实施例提供了一种用于磁盘寻址的方法,该方法在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,根据所述每个操作请求消息中携带的对所述磁盘进行操作请求时对应的I/O接口,确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围,进而将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列,将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,将所述第三队列的写操作请求消息请求的数据写入缓存中,最后根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。An embodiment of the present invention provides a method for disk addressing. After receiving the first queue of operation request messages for randomly reading and writing to the disk, the method uses the address information carried in each operation request message to The corresponding I/O interface when the disk performs an operation request determines the first range of the I/O interface position requested by the read operation request message, and the first range is the requested I/O in the first queue The position of the interface is the range determined by the I/O interface requested by the two read operation request messages farthest away, and then the I/O interface requested by the write operation request message whose position of the I/O interface belongs to the first range and all The I/O interface requested by the read operation request message is first sorted to obtain the second queue of the operation request message, and the write operation request message whose position of the I/O interface does not belong to the first range is determined as the third queue, and the The data requested by the write operation request message of the third queue is written into the cache, and finally, according to the operation request message of the second queue, the requested operations are sequentially performed on the disk.
基于本发明实施例提供的技术方案,首先,第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,将所述第三队列中的写操作请求消息请求的数据直接写入到缓存中,可以节省磁盘寻址的时间,同时也避免了当所述操作请求消息请求的I/O接口距离第一范围较远时,将所述操作请求消息在磁盘中长期挂起,再次接收到所述操作请求消息时,被插入队尾所带来的消耗的寻址时间较大的问题。Based on the technical solution provided by the embodiment of the present invention, first, the position of the I/O interface requested by the write operation request message in the third queue is not within the first range, and the data requested by the write operation request message in the third queue Writing directly into the cache can save disk addressing time, and also avoids long-term hanging of the operation request message in the disk when the I/O interface requested by the operation request message is far from the first range. From the beginning, when the operation request message is received again, the problem of the consumed addressing time caused by being inserted into the tail of the queue is relatively large.
另外,所述写入缓存中的数据被再次请求时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, when the data written in the cache is requested again, it can be directly read from the cache without addressing in the disk, and also saves disk addressing time.
再者,所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,也节省磁盘寻址的时间。Furthermore, the second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requests are sequentially performed according to the sort order of the requested I/O interfaces Instead of performing the requested operation randomly after receiving the first queue, it also saves disk seek time.
实施例三、Embodiment three,
本发明实施例提供了一种用于磁盘寻址的装置40,具体如图4所示,所述用于磁盘寻址的装置40包括:接收单元41、确定单元42和处理单元43。An embodiment of the present invention provides a device 40 for disk addressing, specifically as shown in FIG. 4 , the device 40 for disk addressing includes: a receiving unit 41 , a determining unit 42 and a processing unit 43 .
所述接收单元41,用于接收对所述磁盘进行随机读写的操作请求消息的第一队列,所述每个操作请求消息中携带有对所述磁盘进行操作请求时对应的I/O接口。The receiving unit 41 is configured to receive a first queue of operation request messages for randomly reading and writing the disk, and each operation request message carries an I/O interface corresponding to an operation request for the disk .
通常,磁盘由许多扇区组成,一个或多个扇区对应一个I/O接口,对所述磁盘进行随机读写的操作时,实质是通过所述I/O接口,完成从磁盘读数据或向磁盘写数据的动作。所以对所述磁盘进行随机读写的操作请求消息中,每个操作请求消息都携带了对所述磁盘进行操作请求时对应的I/O接口。Generally, a disk is composed of many sectors, and one or more sectors correspond to an I/O interface. When performing random read and write operations on the disk, the essence is to read data from the disk or read data from the disk through the I/O interface. The action of writing data to disk. Therefore, in the operation request messages for performing random reading and writing on the disk, each operation request message carries the corresponding I/O interface when performing an operation request on the disk.
所述确定单元42,用于确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围。The determining unit 42 is configured to determine a first range of the location of the I/O interface requested by the read operation request message, the first range being that the location of the requested I/O interface in the first queue is the farthest The range determined by the I/O interface requested by the two read operation request messages.
确定第一范围后,当所述第一队列全为读操作请求消息时,所述第一范围内包含所述第一队列中的全部请求消息请求的I/O接口;当所述第一队列全为写操作请求消息时,所述第一范围内为空;当所述第一队列中既包含读操作请求消息,又包含写操作请求消息,则所述第一范围内也可能包含写操作请求消息请求的I/O接口。After determining the first range, when the first queue is all read operation request messages, the first range contains the I/O interfaces requested by all the request messages in the first queue; when the first queue When all are write operation request messages, the first range is empty; when the first queue contains both read operation request messages and write operation request messages, the first range may also contain write operations The I/O interface requested by the request message.
所述处理单元43,用于将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列。The processing unit 43 is configured to first sort the I/O interfaces requested by the write operation request messages whose I/O interface positions belong to the first range and all the I/O interfaces requested by the read operation request messages, to obtain Second queue for operation request messages.
为了减小磁盘寻址的时间,在确定了第一队列中I/O接口位置的第一范围后,可以对第一队列的操作请求消息进行分离。其中将所述I/O接口的位置在第一范围内的读写操作请求消息作为一个队列;将所述I/O接口的位置在第一范围外的写操作请求消息作为一个队列。In order to reduce disk addressing time, after the first range of I/O interface positions in the first queue is determined, the operation request messages of the first queue may be separated. Wherein, the read and write operation request messages whose positions of the I/O interfaces are within the first range are used as a queue; the write operation request messages whose positions of the I/O interfaces are outside the first range are used as a queue.
然后对I/O接口的位置属于所述第一范围的读写操作请求消息请求的I/O接口进行第一排序,其中所述第一排序可以按照I/O接口的位置从大到小的顺序排,也可以为按照从小到大的顺序排,也可以以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,依此对第一范围内的所有操作请求消息请求的I/O接口进行排序,然后按照I/O接口的排序对应的获取所述操作请求消息的排序,获得所述操作请求消息的第二队列。具体的,本发明实施例对此不作具体限定。Then the I/O interface requested by the read and write operation request message whose position of the I/O interface belongs to the first range is first sorted, wherein the first sorting can be performed according to the position of the I/O interface from large to small Arranged in order, it can also be arranged in order from small to large, or the position of the I/O interface where the current head is located can be the first and last I/O interface, and the I/O interface closest to the position of the previous I/O interface can be The O interface is determined to be the next I/O interface, and accordingly the I/O interfaces requested by all operation request messages in the first range are sorted, and then the order of the operation request messages is obtained according to the order of the I/O interfaces. , to obtain the second queue of the operation request message. Specifically, this embodiment of the present invention does not specifically limit it.
所述确定单元42,还用于将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列。The determining unit 42 is further configured to determine the write operation request messages whose I/O interface locations do not belong to the first range as the third queue.
在第二队列中包括了第一队列中的所有读操作请求消息和I/O接口的位置在第一范围内的所有写操作请求消息,那么I/O接口的位置不属于所述第一范围的所有写操作请求消息确定为所述第三队列。If the second queue includes all read operation request messages in the first queue and all write operation request messages whose I/O interface positions are within the first range, then the I/O interface positions do not belong to the first range All write operation request messages are determined as the third queue.
由于第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,表明第三队列请求的I/O接口的位置距离第二队列较远,为了节省磁盘寻址的时间,所述第三队列中的写操作请求消息请求的数据可以直接写入到缓存中。Since the location of the I/O interface requested by the write operation request message in the third queue is not within the first range, it indicates that the location of the I/O interface requested by the third queue is far from the second queue, in order to save disk addressing time , the data requested by the write operation request message in the third queue may be directly written into the cache.
另外,所述写入缓存中的数据可用于当再次出现所述缓存中的数据对应的I/O接口的读操作请求消息时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, the data in the write cache can be used to directly read in the cache when the read operation request message of the I/O interface corresponding to the data in the cache reappears, without searching for the data in the disk. address, and also save disk seek time.
所述处理单元43,还用于将所述第三队列的写操作请求消息请求的数据写入缓存中。The processing unit 43 is further configured to write the data requested by the write operation request message of the third queue into the cache.
所述处理单元43,还用于根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。The processing unit 43 is further configured to sequentially perform the requested operation on the disk according to the operation request message in the second queue.
所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,节省磁盘寻址的时间。The second queue is a sorted queue, so that when the second queue performs the requested operation on the disk, the requested operations are performed sequentially according to the sort order of the requested I/O interfaces, Instead of performing the requested operation randomly after receiving the first queue, the disk addressing time is saved.
需要说明的是,所述缓存为永久性缓存。It should be noted that the cache is a permanent cache.
可选的,optional,
所述确定单元42,还用于在获得所述操作请求消息的第二队列后,确定所述缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口。The determining unit 42 is further configured to determine whether the position of the I/O interface corresponding to the data in the cache has a first I/O interface belonging to the first range after obtaining the second queue of the operation request message. O interface.
所述处理单元43,还用于若有所述第一I/O接口,按照所述第一排序,在所述第二队列中插入对所述第一I/O接口对应的数据进行写操作的写操作请求消息。The processing unit 43 is further configured to, if there is the first I/O interface, according to the first sorting, insert the data corresponding to the first I/O interface into the second queue to perform a write operation The write operation request message.
若有所述第一I/O接口,可以将所述第一I/O接口对应的数据进行写操作的写请求消息插入到所述第二队列中,一方面可以在不浪费寻址时间的前提下,将所述缓存中第一I/O接口对应的数据写入所述第一I/O接口;另一方面,可以给缓存节省出空间,用来缓存其它的数据。If there is the first I/O interface, a write request message for writing data corresponding to the first I/O interface can be inserted into the second queue, on the one hand, without wasting the addressing time On the premise, the data corresponding to the first I/O interface in the cache is written into the first I/O interface; on the other hand, space can be saved for the cache to cache other data.
可选的,所述确定单元42,还用于在将属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列之前,确定缓存中的数据对应的I/O接口的位置是否有属于所述第一范围的第一I/O接口。Optionally, the determining unit 42 is further configured to first sort the I/O interfaces requested by the write operation request message and all the I/O interfaces requested by the read operation request message belonging to the first range, to obtain Before operating the second queue of the request message, it is determined whether there is a first I/O interface belonging to the first range at the position of the I/O interface corresponding to the data in the cache.
所述处理单元43,还用于若有所述第一I/O接口,将对所述第一I/O接口对应的数据进行写操作的写操作请求消息插入到所述磁盘的第一队列中。The processing unit 43 is further configured to, if there is the first I/O interface, insert a write operation request message for writing data corresponding to the first I/O interface into the first queue of the disk middle.
可选的,如图5所示,所述用于磁盘寻址的装置40还包括检查单元44。Optionally, as shown in FIG. 5 , the device 40 for disk addressing further includes a checking unit 44 .
所述检查单元44,用于在将所述第三队列的写操作请求消息请求的数据写入缓存中前,检查所述缓存中的存储空间是否已满。The checking unit 44 is configured to check whether the storage space in the cache is full before writing the data requested by the write operation request message of the third queue into the cache.
在所述缓存的存储空间已满的前提下时,此时所述第三队列的写操作请求消息请求的数据是不能直接写入缓存中的。所以在将所述第三队列的写操作请求消息请求的数据写入缓存中前,所述检查单元44首先需要先检查所述缓存中的存储空间是否已满。On the premise that the storage space of the cache is full, the data requested by the write operation request message of the third queue cannot be directly written into the cache at this time. Therefore, before writing the data requested by the write operation request message of the third queue into the cache, the check unit 44 first needs to check whether the storage space in the cache is full.
所述确定单元42,还用于若所述缓存中的存储空间已满,确定第二I/O接口,所述第二I/O接口为所述第三队列中请求的I/O接口和所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口。The determining unit 42 is further configured to determine a second I/O interface if the storage space in the cache is full, and the second I/O interface is the I/O interface requested in the third queue and The position of the I/O interface corresponding to the cached data is closest to the I/O interface of the second queue.
为了能够及时处理第三队列中的写操作请求消息,并尽可能减小磁盘寻址的时间,在缓存空间已满的情况下,需要确定出第三队列中请求的I/O接口和缓存中的数据对应的I/O接口中最接近第二队列请求的I/O接口的I/O接口,即第二I/O接口。然后将对其第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中。In order to be able to process the write operation request message in the third queue in time and reduce the time of disk addressing as much as possible, when the cache space is full, it is necessary to determine the I/O interface requested in the third queue and the I/O interface in the cache. Among the I/O interfaces corresponding to the data, the I/O interface closest to the I/O interface requested by the second queue is the second I/O interface. Then insert a write operation request message for writing data corresponding to the second I/O interface into the second queue.
所述处理单元43,还用于若所述缓存中存在所述第二I/O接口,按照所述第一排序,在所述第二队列中插入对所述第二I/O接口对应的数据进行写操作的写操作请求消息,在根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作后,将所述第三队列的写请求消息请求的数据写入缓存中。The processing unit 43 is further configured to, if the second I/O interface exists in the cache, according to the first sorting, insert the corresponding to the second I/O interface into the second queue A write operation request message for data write operation, after performing the requested operations on the disk in sequence according to the operation request message of the second queue, write the data requested by the write request message of the third queue into in cache.
若所述缓存中存在所述第二I/O接口,说明所述缓存的数据对应的I/O接口中的位置最接近第二队列的I/O接口,此时为了节省磁盘寻址时间,将对所述第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中。If the second I/O interface exists in the cache, it means that the position of the I/O interface corresponding to the data in the cache is closest to the I/O interface of the second queue. At this time, in order to save disk seek time, Inserting a write operation request message for performing a write operation on data corresponding to the second I/O interface into the second queue.
另外,将缓存中所述第二I/O接口对应的数据进行写操作的写操作请求消息插入到所述第二队列中后,缓存中留出了存储空间,也可以将所述第三队列的写操作请求消息请求的数据写入缓存中。In addition, after the write operation request message for writing data corresponding to the second I/O interface in the cache is inserted into the second queue, storage space is reserved in the cache, and the third queue can also be The data requested by the write operation request message is written into the cache.
需要说明的是,所述缓存为永久性缓存。It should be noted that the cache is a permanent cache.
所述处理单元43,还用于若所述第三队列中存在所述第二I/O接口,按照第二队列的排序,将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中。The processing unit 43 is further configured to, if the second I/O interface exists in the third queue, perform the write operation corresponding to the second I/O interface of the third queue according to the order of the second queue. A request message is inserted into said second queue.
当所述第二I/O接口在所述第三队列中时,说明所述第三队列中所述写操作请求消息请求的I/O接口的位置离所述第二队列最近,此时为了节省磁盘寻址的时间,所述处理单元43,按照第一排序,将所述第三队列的第二I/O接口对应的写操作请求消息插入到所述第二队列中。When the second I/O interface is in the third queue, it indicates that the position of the I/O interface requested by the write operation request message in the third queue is the closest to the second queue. To save disk addressing time, the processing unit 43 inserts the write operation request message corresponding to the second I/O interface of the third queue into the second queue according to the first sorting.
可选的,optional,
所述第一排序为:The first sort is:
以当前磁头所在I/O接口的位置为第一上一I/O接口,将距离上一I/O接口的位置最近的I/O接口确定为下一I/O接口,按照I/O接口的排序对应的获取所述操作请求消息的排序。The position of the I/O interface where the current magnetic head is located is the first previous I/O interface, and the I/O interface closest to the position of the previous I/O interface is determined as the next I/O interface, according to the I/O interface The sorting corresponds to the sorting of obtaining the operation request messages.
可选的,optional,
所述检查单元44,还用于将所述第三队列的写操作请求消息请求的数据写入缓存中前,检查所述第一队列中是否全为写操作请求消息。The checking unit 44 is further configured to check whether the first queue is full of write operation request messages before writing the data requested by the write operation request messages in the third queue into the cache.
所述确定单元42,还用于若所述第一队列中全为写操作请求消息,则确定第三I/O接口和第四I/O接口,所述第三I/O接口为与上一I/O接口的距离小于第一预设范围的I/O接口,所述第四I/O接口为与上一I/O接口的距离大于第一预设范围的I/O接口,以当前磁头所在I/O接口的位置为第一上一I/O接口,所述第四I/O接口对应的写操作请求消息确定为第三队列。The determining unit 42 is further configured to determine a third I/O interface and a fourth I/O interface if the first queue is full of write operation request messages, and the third I/O interface is connected to the above The distance of an I/O interface is less than the I/O interface of the first preset range, and the fourth I/O interface is an I/O interface whose distance from the previous I/O interface is greater than the first preset range, and The current position of the I/O interface where the magnetic head is located is the first and last I/O interface, and the write operation request message corresponding to the fourth I/O interface is determined to be the third queue.
所述处理单元43,还用于在获得操作请求消息的第二队列后,根据所述第一排序,将所述第三I/O接口对应的写操作请求消息插入到所述第二队列。The processing unit 43 is further configured to, after obtaining the second queue of operation request messages, insert the write operation request message corresponding to the third I/O interface into the second queue according to the first sorting.
可选的,如图6所示,所述用于磁盘寻址的装置40还包括统计单元45。Optionally, as shown in FIG. 6 , the device 40 for disk addressing further includes a statistics unit 45 .
所述统计单元45,用于在接收对所述磁盘进行随机读写的操作请求消息的第一队列后,统计所述第一队列请求的I/O接口分别对应的磁盘区域的I/O接口的请求频率,判断所述磁盘区域是否为偏僻区域。The statistical unit 45 is configured to count the I/O interfaces of the disk regions corresponding to the I/O interfaces requested by the first queue after receiving the first queue of operation request messages for random reading and writing of the disk request frequency, and determine whether the disk area is a remote area.
所述处理单元43,还用于在根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作之后,若所述第一队列的读操作请求消息请求的I/O接口中存在偏僻区域的第五I/O接口,将所述读操作请求消息请求第五I/O接口读取的数据写入到所述缓存中。The processing unit 43 is further configured to, after sequentially performing the requested operations on the disk according to the operation request message of the second queue, if the I/O requested by the read operation request message of the first queue There is a fifth I/O interface in a remote area among the interfaces, and the data read by the fifth I/O interface requested by the read operation request message is written into the cache.
需要说明的是,所述缓存为永久性缓存。It should be noted that the cache is a permanent cache.
所述用于磁盘寻址的装置40的详细寻址过程可参见实施例二所述的描述,本实施例对此不再赘述。For the detailed addressing process of the device 40 for addressing the disk, refer to the description in Embodiment 2, which will not be repeated in this embodiment.
本发明实施例提供了一种用于磁盘寻址的装置,该装置包括接收单元、确定单元、处理单元。其中在所述接收单元接收对所述磁盘进行随机读写的操作请求消息的第一队列后,所述确定单元用于根据所述每个操作请求消息中携带的对所述磁盘进行操作请求时对应的I/O接口,确定读操作请求消息请求的I/O接口位置的第一范围,所述第一范围为所述第一队列中所述请求的I/O接口的位置距离最远的两个读操作请求消息请求的I/O接口确定的范围,进而所述处理单元将I/O接口的位置属于所述第一范围的写操作请求消息请求的I/O接口与所有读操作请求消息请求的I/O接口进行第一排序,获得操作请求消息的第二队列,所述确定单元还将I/O接口的位置不属于所述第一范围的写操作请求消息确定为第三队列,所述处理单元将所述第三队列的写操作请求消息请求的数据写入缓存中,最后根据所述第二队列的操作请求消息,对所述磁盘依次进行所述请求的操作。An embodiment of the present invention provides a device for disk addressing, which includes a receiving unit, a determining unit, and a processing unit. Wherein, after the receiving unit receives the first queue of operation request messages for randomly reading and writing the disk, the determining unit is configured to perform an operation request on the disk according to the operation request carried in each operation request message For the corresponding I/O interface, determine the first range of the position of the I/O interface requested by the read operation request message, and the first range is the farthest from the position of the requested I/O interface in the first queue The range determined by the I/O interface requested by the two read operation request messages, and then the processing unit combines the I/O interface requested by the write operation request message whose position of the I/O interface belongs to the first range with all read operation requests The I/O interface of the message request is first sorted to obtain the second queue of the operation request message, and the determination unit also determines the write operation request message whose position of the I/O interface does not belong to the first range as the third queue The processing unit writes the data requested by the write operation request message of the third queue into the cache, and finally performs the requested operation on the disk in sequence according to the operation request message of the second queue.
基于本发明实施例提供的用于磁盘寻址的装置,首先,第三队列中的写操作请求消息请求的I/O接口的位置不在第一范围内,将所述第三队列中的写操作请求消息请求的数据直接写入到缓存中,可以节省磁盘寻址的时间,同时也避免了当所述操作请求消息请求的I/O接口距离第一范围较远时,将所述操作请求消息在磁盘中长期挂起,再次接收到所述操作请求消息时,被插入队尾所带来的消耗的寻址时间较大的问题。Based on the device for disk addressing provided by the embodiment of the present invention, first, the position of the I/O interface requested by the write operation request message in the third queue is not within the first range, and the write operation in the third queue The data requested by the request message is directly written into the cache, which can save disk addressing time, and also avoids the operation request message when the I/O interface requested by the operation request message is far away from the first range. Suspended in the disk for a long time, when the operation request message is received again, it is inserted into the tail of the queue and consumes a large problem of seeking time.
另外,所述写入缓存中的数据被再次请求时,可以直接在所述缓存中读取,不需要在磁盘中寻址,也节省磁盘寻址的时间。In addition, when the data written in the cache is requested again, it can be directly read from the cache without addressing in the disk, and also saves disk addressing time.
再者,所述第二队列为经过排序后的队列,这样按照所述第二队列在对所述磁盘进行所述请求的操作时,按照请求的I/O接口的排序顺序依次进行所述请求的操作,而不是在接收到第一队列后,随机进行所述请求的操作,也节省磁盘寻址的时间。Furthermore, the second queue is a sorted queue, so that when the second queue performs the operation of the request on the disk, the requests are performed sequentially according to the sort order of the requested I/O interface Instead of performing the requested operation randomly after receiving the first queue, it also saves the time of disk addressing.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for realizing the above-mentioned method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.
Claims (12)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210413126.2A CN102929801B (en) | 2012-10-25 | 2012-10-25 | A kind of method and apparatus for disk addressing |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210413126.2A CN102929801B (en) | 2012-10-25 | 2012-10-25 | A kind of method and apparatus for disk addressing |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102929801A CN102929801A (en) | 2013-02-13 |
| CN102929801B true CN102929801B (en) | 2016-06-22 |
Family
ID=47644603
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210413126.2A Expired - Fee Related CN102929801B (en) | 2012-10-25 | 2012-10-25 | A kind of method and apparatus for disk addressing |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102929801B (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108268381B (en) * | 2017-12-15 | 2021-12-24 | 中国航空工业集团公司西安飞行自动控制研究所 | Method for safely realizing fast addressing of data |
| CN119065609A (en) * | 2024-08-29 | 2024-12-03 | 无锡众星微系统技术有限公司 | Request delivery method, device and computer readable storage medium |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5608891A (en) * | 1992-10-06 | 1997-03-04 | Mitsubishi Denki Kabushiki Kaisha | Recording system having a redundant array of storage devices and having read and write circuits with memory buffers |
| CN1519736A (en) * | 2003-01-24 | 2004-08-11 | 华为技术有限公司 | a disk storage system |
| CN101299181A (en) * | 2008-07-08 | 2008-11-05 | 杭州华三通信技术有限公司 | Method and device for performing I/O request buffer memory based on magnetic disc and SAN memory apparatus |
| CN101494636A (en) * | 2008-01-23 | 2009-07-29 | 中兴通讯股份有限公司 | Method and apparatus for ordering data based on rapid IO interconnection technology |
| CN102073605A (en) * | 2010-12-27 | 2011-05-25 | 深圳市创新科信息技术有限公司 | A method to bypass the Bio layer to access the storage interface of the disk drive |
-
2012
- 2012-10-25 CN CN201210413126.2A patent/CN102929801B/en not_active Expired - Fee Related
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US5608891A (en) * | 1992-10-06 | 1997-03-04 | Mitsubishi Denki Kabushiki Kaisha | Recording system having a redundant array of storage devices and having read and write circuits with memory buffers |
| CN1519736A (en) * | 2003-01-24 | 2004-08-11 | 华为技术有限公司 | a disk storage system |
| CN101494636A (en) * | 2008-01-23 | 2009-07-29 | 中兴通讯股份有限公司 | Method and apparatus for ordering data based on rapid IO interconnection technology |
| CN101299181A (en) * | 2008-07-08 | 2008-11-05 | 杭州华三通信技术有限公司 | Method and device for performing I/O request buffer memory based on magnetic disc and SAN memory apparatus |
| CN102073605A (en) * | 2010-12-27 | 2011-05-25 | 深圳市创新科信息技术有限公司 | A method to bypass the Bio layer to access the storage interface of the disk drive |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102929801A (en) | 2013-02-13 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10114578B2 (en) | Solid state disk and data moving method | |
| KR101744126B1 (en) | Techniques for cooperative execution between asymmetric processor cores | |
| US20150253992A1 (en) | Memory system and control method | |
| US20240264751A1 (en) | Method and apparatus for processing abnormal power failure of solid state disk, and electronic device and medium | |
| KR102517685B1 (en) | Memory block recovery method and device | |
| US10310770B2 (en) | Nonvolatile memory device, and storage apparatus having nonvolatile memory device | |
| CN109542636B (en) | Data updating method and device | |
| US8996788B2 (en) | Configurable flash interface | |
| US20150261444A1 (en) | Memory system and information processing device | |
| US9846626B2 (en) | Method and apparatus for computer memory management by monitoring frequency of process access | |
| US10789170B2 (en) | Storage management method, electronic device and computer readable medium | |
| CN103413569B (en) | One reads and one writes static RAM | |
| US9378130B2 (en) | Data writing method, and memory controller and memory storage apparatus using the same | |
| CN115712394A (en) | Data reading and writing method and device, computer equipment and readable storage medium | |
| CN105095104A (en) | Method and device for data caching processing | |
| CN102053913A (en) | Memory device and data access method of memory device | |
| CN102929801B (en) | A kind of method and apparatus for disk addressing | |
| US7680992B1 (en) | Read-modify-write memory with low latency for critical requests | |
| CN103870204B (en) | Data write-in and read method, cache controllers in a kind of cache | |
| CN103176753A (en) | Storage device and data management method of storage device | |
| CN104281545A (en) | Data reading method and data reading equipment | |
| CN111124959B (en) | Hardware unloading method for processing NVMe protocol management command | |
| CN111176566B (en) | eMMC read-write control method supporting queue command and storage medium | |
| CN118819424A (en) | A data processing method, device, equipment and medium | |
| CN113760781A (en) | Data processing method and device, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant | ||
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20191217 Address after: Room 302, No. 8319, Yanshan Road, Bengbu City, Anhui Province Patentee after: Bengbu Lichao Information Technology Co.,Ltd. Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd. |
|
| TR01 | Transfer of patent right | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20201020 Address after: No.24, building 1, 2 and 3, citizen square, Jinsha Town, Tongzhou District, Nantong City, Jiangsu Province 226300 Patentee after: Nantong Jinhui Computer Technology Development Co.,Ltd. Address before: Room 302, No. 8319, Yanshan Road, Bengbu City, Anhui Province Patentee before: Bengbu Lichao Information Technology Co.,Ltd. |
|
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20160622 |