WO2013097119A1 - Method and device for realizing multilevel storage in file system - Google Patents

Method and device for realizing multilevel storage in file system Download PDF

Info

Publication number
WO2013097119A1
WO2013097119A1 PCT/CN2011/084830 CN2011084830W WO2013097119A1 WO 2013097119 A1 WO2013097119 A1 WO 2013097119A1 CN 2011084830 W CN2011084830 W CN 2011084830W WO 2013097119 A1 WO2013097119 A1 WO 2013097119A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
value
storage device
list
secondary storage
Prior art date
Application number
PCT/CN2011/084830
Other languages
French (fr)
Chinese (zh)
Inventor
陆海翔
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201180003291.4A priority Critical patent/CN103548004B/en
Priority to PCT/CN2011/084830 priority patent/WO2013097119A1/en
Publication of WO2013097119A1 publication Critical patent/WO2013097119A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/185Hierarchical storage management [HSM] systems, e.g. file migration or policies thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0647Migration mechanisms

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to a method and apparatus for implementing multi-level storage in a file system.
  • SSD Solid State Disk
  • SSDs also known as electronic hard disks or solid state electronic disks, consist of a control unit and a solid-state storage unit.
  • the functions, forms, and usage of the interface are the same as those of a magnetic media hard disk.
  • most SSDs are used in notebook computers.
  • most of the products have the same size as traditional notebook hard drives, and there are other sizes of products. Since there is no mechanical structure inside the SSD, the reading does not use the motor to rotate, so there is an advantage in shock resistance and noise.
  • the SSD chip can work in a wide temperature range (-40 to 85 ° C). Therefore, SSD is widely used in military, electric power, medical, aviation, vehicle, industrial control, video surveillance, network monitoring, network terminals, navigation equipment and other fields.
  • frequently accessed data is generally stored on a fast storage device, and infrequently accessed data is stored on a slow storage device, so that the overall performance of the system can be optimized by using less high-speed storage devices.
  • a multi-level storage system in the prior art is constructed by adding an SSD to a conventional mechanical HDD (Hard Disk).
  • the hard disk drive forms a hybrid storage pool, and the SSD is used as the second level cache in the system, and the frequently accessed data on the disk is automatically cached to the SSD. When the SSD is full, these are The cached data is eliminated according to the ARC algorithm.
  • the above-mentioned prior art has the disadvantage that the SSD is used as the secondary cache of the system, which improves the performance of the system as a whole, but the SSD only exists as a cache, and its storage space is wasted.
  • the above multi-level storage system is only suitable for systems with very concentrated hotspots, such as the 1/99 heat model system.
  • systems with low concentration of hotspots such as the 30/70 model (30% of the data provides 70% of the traffic)
  • 30% of the hottest data needs to be cached in the SSD, then the system needs additional SSD storage. Space accounts for 30% of the total storage capacity. This part of the storage space is not perceived by the application and cannot be reflected in the total storage capacity of the system. This is undoubtedly a huge waste.
  • Embodiments of the present invention provide a method and apparatus for implementing multi-level storage in a file system to implement multi-level storage of file-based values in a file system.
  • a method of implementing multi-level storage in a file system comprising:
  • the first storage device and the secondary storage device are respectively used in the file system to store files, and obtain the value of each file stored in the primary storage device and the secondary storage device;
  • a device for implementing multi-level storage in a file system comprising:
  • a file storage module configured to store a file by using a primary storage device and a secondary storage device respectively in the file system
  • a file value processing module configured to acquire values of respective files stored in the primary storage device and the secondary storage device, and establish and manage the first file according to an arrangement order of values of the files stored in the primary storage device a value sorting list, establishing and managing a second file value sorting list according to an arrangement order of values of the respective files stored in the secondary storage device;
  • the moving processing module is configured to perform file moving in the primary storage device and the secondary storage device according to the set moving policy according to the first file value sorting list and the second file value sorting list.
  • the embodiments of the present invention store files by using a primary storage device and a secondary storage device respectively in the file system, and based on the values of the respective files and according to the settings.
  • the moving policy performs file migration in the primary storage device and the secondary storage device, and can store high-value files on a high-performance storage medium (ie, a primary storage device), and store low-value files in a slow On the fast storage medium (ie, the secondary storage device), the system achieves the best overall performance.
  • FIG. 1 is a flowchart of a specific process of a method for implementing multi-level storage in a file system according to Embodiment 1 of the present invention
  • FIG. 2 is a schematic diagram of fields in metadata information of a file according to an embodiment of the present invention.
  • FIG. 3 is a flowchart of a specific process for implementing multi-level storage in a file system when determining the value of a file according to a recent access time of a file according to Embodiment 2 of the present invention
  • FIG. 4 is a specific structural diagram of an apparatus for implementing multi-level storage in a file system according to Embodiment 3 of the present invention.
  • This embodiment provides a method for implementing multi-level storage in a file system.
  • the specific processing flow of the method is as shown in FIG. 1 and includes the following processing steps:
  • Step 11 The first-level storage device and the secondary storage device are used to store files in the file system, and the values of the files stored in the primary storage device and the secondary storage device are obtained.
  • the SSD can be used as a primary storage device, and the mechanical disk is used as a secondary storage device.
  • the first-level storage device and the secondary storage device are used to store files, and constitute a multi-level overall storage space of the file system.
  • the embodiment of the present invention needs to calculate the value of each file stored in the first-level storage device and the secondary storage device, and the specific calculation method is as follows:
  • the set file value update interval (for example, 30 minutes), according to at least one of the latest access time of the file, the number of accesses in the set time period, the content of the file, and the system configuration information, according to the set algorithm
  • the value of each file stored in the primary storage device and the secondary storage device according to at least one of the latest access time of the file, the number of accesses in the set time period, the content of the file, and the system configuration information, according to the set algorithm The value of each file stored in the primary storage device and the secondary storage device.
  • the value of a file is determined based only on the most recent access time of the file, the value of the file with the most recent access time is the largest.
  • the latest access time of the file may be multiplied by the corresponding weight, plus the set time period.
  • the number of visits is multiplied by the corresponding weight to calculate the value of each file.
  • the system administrator can directly set the value of one or more files according to actual needs.
  • FIG. 2 A schematic diagram of the fields in the metadata information of a file provided by this embodiment is shown in FIG. 2.
  • the recorded information is used to calculate the value of the file, and the value information of the file, the sorting information, and the storage location information of the file are stored in an optional extension field in the metadata information.
  • the system updates the metadata information of the file, and uses the latest access time of the file recorded in the timestamp field in FIG. 2 to calculate the value of the file; or simultaneously utilizes the timestamp field in FIG.
  • the value of the file is calculated by at least one of the recent and historical access time, file length field, and file block number fields of the recorded file. Then, the original value of the file stored in the file value field in FIG. 2 is deleted, the value of the newly calculated file is stored in the file value field, and the sort information field is updated accordingly.
  • the storage file in the storage location field in FIG. 2 is information stored in the primary storage device or the secondary storage device, and the sorted information field in FIG. 2 stores the first file value sorted list that will be described below or The sorting of the second file value sorted list.
  • the sort information field, the storage location field, and the file value field in FIG. 2 above are extension fields in the metadata information.
  • the first-level storage device is a fast hard disk
  • the second-level storage device is a slow-speed hard disk
  • a file with a relatively high value is stored in the first-level storage device
  • a file with a relatively low value is stored in the mechanical hard disk.
  • the value of any of the files stored in the primary storage device above is greater than the value of all files stored in the mechanical hard disk.
  • Step 12 Establish and manage a first file value sorting list according to an arrangement order of values of the files stored in the primary storage device, and establish and manage according to the order of the values of the files stored in the secondary storage device.
  • the second file value sorted list is
  • the first file value sorted list is created by sorting each file stored in the primary storage device according to the value of the value from large to small. After updating the value of each file stored in the primary storage device according to the set file value update time interval, the first file value sorted list needs to be updated accordingly.
  • the respective files stored in the secondary storage device are sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list. After updating the value of each file stored in the secondary storage device according to the set file value update interval, the second file value sorted list needs to be updated accordingly.
  • the identifiers of the respective files are arranged in the first file value sorting list and the second file value sorting list.
  • Step 13 Perform file transfer on the primary storage device and the secondary storage device according to the set migration policy according to the first file value sorting list and the second file value sorting list.
  • Presetting a time interval for performing file transfer in the primary storage device and the secondary storage device, and starting timing of the time interval, after the time interval of the time interval ends, at the primary storage device And the file transfer processing is performed in the secondary storage device, and the process of the specific file transfer processing may be:
  • the one or more of the second file value sorted list Moving the file from the secondary storage device to the primary storage device, and then updating the first file value sorted list and the second file value sorted list;
  • the space utilization of the primary storage device exceeds a set threshold, moving one or more files ranked in the first file value sorting list from the primary storage device to the second In the level storage device, until the space utilization rate of the primary storage device does not exceed a set threshold, then the first file value sorted list and the second file value sorted list are updated.
  • the space utilization rate of the secondary storage device exceeds a set threshold, one or more files ranked in the second file value sorting list are stored from the secondary storage. The device is deleted until the space utilization rate of the secondary storage device does not exceed a set threshold, and then the second file value sorted list is updated.
  • the embodiment provides a specific processing flow of the method for implementing multi-level storage in the file system. As shown in FIG. 3, the following processing steps are included:
  • Step 31 A file in the file system is accessed, and the file may be a file stored in the primary storage device or the secondary storage device.
  • Step 32 Since the value of the file is determined only according to the latest access time of the file, the value of the file currently accessed is the highest, and the value of the file is set to the maximum.
  • Step 33 Determine whether the file is stored in the primary storage device, and if yes, perform step 34; otherwise, perform step 35.
  • Step 34 Arranging the identifier of the file in the forefront of the first file value sorting list in the primary storage device.
  • Step 35 Add the file to the moving file list of the secondary storage device, and after the time interval of the preset file moving time ends, the file in the moving list of the secondary storage device is from the second The level storage device is moved to the primary storage device.
  • the embodiment of the invention further provides an apparatus for implementing multi-level storage in a file system, and the specific structure thereof is as shown in FIG. 4, and includes the following modules:
  • the file storage module 41 is configured to store the file in the file system by using the primary storage device and the secondary storage device respectively.
  • the SSD can be used as the primary storage device
  • the mechanical disk is used as the secondary storage device.
  • the file value processing module 42 is configured to acquire the value of each file stored in the primary storage device and the secondary storage device, and establish and manage the first according to the order of the values of the files stored in the primary storage device. a file value sorting list, establishing and managing a second file value sorting list according to an arrangement order of values of the respective files stored in the secondary storage device;
  • the moving processing module 43 is configured to perform file moving in the primary storage device and the secondary storage device according to the set moving policy according to the first file value sorting list and the second file value sorting list.
  • the file value processing module 42 may include:
  • the file value calculation module 421 is configured to determine, according to the set file value update time interval, the one according to at least one of a recent access time of the file, a number of accesses in the set time period, a content of the file, and system configuration information. The value of each file stored in the level storage device and the secondary storage device.
  • the system updates the metadata information of the file, and uses the latest access time of the file recorded in the timestamp field in the metadata information of the file to calculate the value of the file;
  • the system updates the metadata information of the file, and uses the recent and historical access time of the file recorded in the timestamp field in the metadata information of the file, and the file length field,
  • the value of the file is calculated by at least one of the information recorded in the file block number field.
  • the file sorting list creating module 422 is configured to sort the files stored in the primary storage device according to the value of the value from the largest to the smallest, and establish a first file value sorting list according to the files stored in the primary storage device.
  • the update result of the value updates the first file value sorted list;
  • each of the files stored in the secondary storage device is sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list, according to the update result of the value of each file stored in the secondary storage device.
  • the second file value sorting list is updated.
  • the moving processing module 43 is further configured to preset a time interval for performing file moving in the primary storage device and the secondary storage device, and start timing of the time interval when the time is After the interval has expired,
  • one or more of the second file value sorted list are moved from the secondary storage device to the primary storage device;
  • the moving processing module 43 is further configured to preset a time interval for performing file moving in the primary storage device and the secondary storage device, and start timing of the time interval when the time is After the interval of the interval ends, if the space utilization rate of the primary storage device exceeds a set threshold, one or more files ranked in the first file value sorted list are sorted from the primary storage device. Moving to the secondary storage device until the space utilization of the primary storage device does not exceed a set threshold;
  • the storage medium may be a magnetic disk, an optical disk, or a read-only storage memory (Read-Only) Memory, ROM) or Random Access Memory (RAM).
  • the embodiment of the present invention stores files by using a primary storage device and a secondary storage device in a file system, and based on the value of each file and the set migration policy in the primary storage device and File transfer in the secondary storage device can store high-value files on high-performance storage media (ie, primary storage devices) and low-value files on slow storage media (ie, secondary storage devices). In order to achieve the best overall performance of the system.
  • the embodiment of the invention supports the unified management of the heterogeneous storage medium, and the overall storage space presented by the user is the sum of the storage spaces of the levels; the user does not have to distinguish the storage medium at all levels when using the file, and the file system provides unified management to the user. This eliminates the need for additional tiered storage management software and reduces complexity.
  • the embodiments of the present invention provide flexible policy configuration, which can flexibly control the frequency cycle of file migration and the algorithm followed by file migration.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided is a method for realizing multilevel storage in a file system. In a file system, a primary storage device and a secondary storage device are used to store files respectively to acquire the value of each file stored in the primary storage device and the secondary storage device; a first file value rank list is established and managed according to the order of the value of each file stored in the primary storage device, and a second file value rank list is established and managed according to the order of the value of each file stored in the secondary storage device; and file transfer is performed in the primary storage device and the secondary storage device according to a preset transfer policy in accordance with the first file value rank list and the second file value rank list. The embodiments of the present invention can store files with high value in a storage medium with higher performance and store files with low value in a slow storage medium, thus making the best of the overall performance of the system.

Description

在文件系统中实现多级存储的方法和装置  Method and apparatus for implementing multi-level storage in a file system
技术领域Technical field
本发明涉及电子技术领域,尤其涉及一种在文件系统中实现多级存储的方法和装置。The present invention relates to the field of electronic technologies, and in particular, to a method and apparatus for implementing multi-level storage in a file system.
发明背景Background of the invention
伴随着存储技术的发展,在磁带、机械磁盘等传统存储介质之外不断涌现出新的存储介质以及存储接口,这些新的存储介质和存储接口通常意味着更高的传输速率,其中,SSD(Solid State Disk,固态硬盘)就是一种典型技术。With the development of storage technology, new storage media and storage interfaces are emerging in addition to traditional storage media such as magnetic tapes and mechanical disks. These new storage media and storage interfaces usually mean higher transmission rates, among them, SSD ( Solid State Disk, a solid state drive, is a typical technology.
SSD也称作电子硬盘或者固态电子盘,它由控制单元和固态存储单元组成,其接口的功能、形式和使用方法与磁介质硬盘相同。目前SSD大部分应用在笔记本电脑上,为了和现有的笔记本相匹配,大多数产品外形尺寸与传统笔记本硬盘一致,也有其他规格尺寸的产品。由于SSD内部无机械结构,读取也不用马达旋转,所以抗震性和噪音方面都很有优势,另外SSD的芯片可以在很宽的温度范围(-40~85℃)内工作。因此,SSD目前广泛应用在军事、电力、医疗、航空、车载、工控、视频监控、网络监控、网络终端、导航设备等各个领域。SSDs, also known as electronic hard disks or solid state electronic disks, consist of a control unit and a solid-state storage unit. The functions, forms, and usage of the interface are the same as those of a magnetic media hard disk. At present, most SSDs are used in notebook computers. In order to match existing notebooks, most of the products have the same size as traditional notebook hard drives, and there are other sizes of products. Since there is no mechanical structure inside the SSD, the reading does not use the motor to rotate, so there is an advantage in shock resistance and noise. In addition, the SSD chip can work in a wide temperature range (-40 to 85 ° C). Therefore, SSD is widely used in military, electric power, medical, aviation, vehicle, industrial control, video surveillance, network monitoring, network terminals, navigation equipment and other fields.
随着SSD技术的不断成熟,用户开始使用SSD构建存储系统,出于性能、成本的综合考虑以及保护现有的投资,用户存在着使用新的存储介质和原有存储介质搭建混合存储系统的需求。将昂贵高速的SSD作为一级存储系统,将大容量、廉价的低速机械磁盘作为后端二级存储系统,最终达到高性能,大容量,低成本的整体最佳配置。With the maturity of SSD technology, users began to use SSD to build storage systems. For the sake of comprehensive consideration of performance and cost, and to protect existing investments, users have the need to build hybrid storage systems using new storage media and original storage media. . The expensive and high-speed SSD is used as the primary storage system, and the high-capacity, low-cost low-speed mechanical disk is used as the back-end secondary storage system, and finally achieves the overall optimal configuration of high performance, large capacity, and low cost.
在混合存储系统中,一般把经常访问的数据存放在快速存储设备上,不经常访问的数据存放在慢速存储设备上,因此使用较少的高速存储设备就可以使系统整体性能达到最优。In a hybrid storage system, frequently accessed data is generally stored on a fast storage device, and infrequently accessed data is stored on a slow storage device, so that the overall performance of the system can be optimized by using less high-speed storage devices.
现有技术中的一种多级存储系统的构建方案为:将SSD加入到传统机械HDD(Hard Disk Drive,硬盘驱动器)构成的存储系统中,形成一个混合存储池,将SSD作为系统中的第二级缓存,将磁盘上被频繁访问的数据自动缓存到SSD上,当SSD被写满之后,这些缓存数据根据ARC算法进行淘汰。 A multi-level storage system in the prior art is constructed by adding an SSD to a conventional mechanical HDD (Hard Disk). In the storage system formed by Drive, the hard disk drive forms a hybrid storage pool, and the SSD is used as the second level cache in the system, and the frequently accessed data on the disk is automatically cached to the SSD. When the SSD is full, these are The cached data is eliminated according to the ARC algorithm.
上述现有技术中的缺点为:将SSD作为系统的二级缓存,整体上提升了系统的性能,但是SSD仅仅作为缓存的作用存在,其存储空间被浪费了。上述多级存储系统只适用于热点分布非常集中的系统,如1/99的热度模型系统。但是对于热点分布集中程度较低的系统,如30/70模型(30%的数据提供70%的访问量),需要将30%的最热数据缓存在SSD中,那么系统需要额外配备的SSD存储空间就占到总存储容量的30%,这一部分存储空间对于应用来说是不感知的,不能体现在系统总存储容量中,无疑是一个巨大的浪费。The above-mentioned prior art has the disadvantage that the SSD is used as the secondary cache of the system, which improves the performance of the system as a whole, but the SSD only exists as a cache, and its storage space is wasted. The above multi-level storage system is only suitable for systems with very concentrated hotspots, such as the 1/99 heat model system. However, for systems with low concentration of hotspots, such as the 30/70 model (30% of the data provides 70% of the traffic), 30% of the hottest data needs to be cached in the SSD, then the system needs additional SSD storage. Space accounts for 30% of the total storage capacity. This part of the storage space is not perceived by the application and cannot be reflected in the total storage capacity of the system. This is undoubtedly a huge waste.
发明内容Summary of the invention
本发明的实施例提供了一种在文件系统中实现多级存储的方法和装置,以在文件系统中实现基于文件的价值的多级存储。Embodiments of the present invention provide a method and apparatus for implementing multi-level storage in a file system to implement multi-level storage of file-based values in a file system.
本发明的目的是通过以下技术方案实现的:The object of the invention is achieved by the following technical solutions:
一种在文件系统中实现多级存储的方法,包括:A method of implementing multi-level storage in a file system, comprising:
在文件系统中分别使用一级存储设备和二级存储设备来存储文件,获取所述一级存储设备和二级存储设备中存储的各个文件的价值;The first storage device and the secondary storage device are respectively used in the file system to store files, and obtain the value of each file stored in the primary storage device and the secondary storage device;
按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表;Establishing and managing a first file value sorting list according to an arrangement order of values of the respective files stored in the primary storage device, and establishing and managing the second file according to an arrangement order of values of the respective files stored in the secondary storage device a sorted list of values;
根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。And performing file transfer on the primary storage device and the secondary storage device according to the set migration policy according to the first file value sorting list and the second file value sorting list.
一种在文件系统中实现多级存储的装置,包括:A device for implementing multi-level storage in a file system, comprising:
文件存储模块,用于在文件系统中分别使用一级存储设备和二级存储设备来存储文件;a file storage module, configured to store a file by using a primary storage device and a secondary storage device respectively in the file system;
文件价值处理模块,用于获取所述一级存储设备和二级存储设备中存储的各个文件的价值,按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表;a file value processing module, configured to acquire values of respective files stored in the primary storage device and the secondary storage device, and establish and manage the first file according to an arrangement order of values of the files stored in the primary storage device a value sorting list, establishing and managing a second file value sorting list according to an arrangement order of values of the respective files stored in the secondary storage device;
搬移处理模块,用于根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。The moving processing module is configured to perform file moving in the primary storage device and the secondary storage device according to the set moving policy according to the first file value sorting list and the second file value sorting list.
由上述本发明的实施例提供的技术方案可以看出,本发明实施例通过在文件系统中分别使用一级存储设备和二级存储设备来存储文件,并基于各个文件的价值和按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移,可以实现将价值高的文件存放到性能高的存储介质(即一级存储设备)上,将价值低的文件存放在慢速存储介质(即二级存储设备)上,使系统达到整体性能最佳。It can be seen from the technical solutions provided by the foregoing embodiments of the present invention that the embodiments of the present invention store files by using a primary storage device and a secondary storage device respectively in the file system, and based on the values of the respective files and according to the settings. The moving policy performs file migration in the primary storage device and the secondary storage device, and can store high-value files on a high-performance storage medium (ie, a primary storage device), and store low-value files in a slow On the fast storage medium (ie, the secondary storage device), the system achieves the best overall performance.
附图简要说明BRIEF DESCRIPTION OF THE DRAWINGS
图1为本发明实施例一提供的一种在文件系统中实现多级存储的方法的具体处理流程图;1 is a flowchart of a specific process of a method for implementing multi-level storage in a file system according to Embodiment 1 of the present invention;
图2为本发明实施例提供的一种文件的元数据信息中的字段示意图;2 is a schematic diagram of fields in metadata information of a file according to an embodiment of the present invention;
图3为本发明实施例二提供的一种当只根据文件的最近访问时间来确定文件的价值时,在文件系统中实现多级存储的方法的具体处理流程图;FIG. 3 is a flowchart of a specific process for implementing multi-level storage in a file system when determining the value of a file according to a recent access time of a file according to Embodiment 2 of the present invention;
图4为本发明实施例三提供的一种在文件系统中实现多级存储的装置的具体结构图。4 is a specific structural diagram of an apparatus for implementing multi-level storage in a file system according to Embodiment 3 of the present invention.
实施本发明的方式Mode for carrying out the invention
下面将参考附图详细说明本发明实施例。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
实施例一Embodiment 1
该实施例提供了一种在文件系统中实现多级存储的方法,该方法的具体处理流程如图1所示,包括如下的处理步骤:This embodiment provides a method for implementing multi-level storage in a file system. The specific processing flow of the method is as shown in FIG. 1 and includes the following processing steps:
步骤11、在文件系统中分别使用一级存储设备和二级存储设备来存储文件,获取所述一级存储设备和二级存储设备中存储的各个文件的价值。Step 11: The first-level storage device and the secondary storage device are used to store files in the file system, and the values of the files stored in the primary storage device and the secondary storage device are obtained.
比如,可以将SSD作为一级存储设备,将机械磁盘作为二级存储设备,上述一级存储设备和二级存储设备都用于存储文件,构成了文件系统的多级整体存储空间。For example, the SSD can be used as a primary storage device, and the mechanical disk is used as a secondary storage device. The first-level storage device and the secondary storage device are used to store files, and constitute a multi-level overall storage space of the file system.
本发明实施例需要计算上述一级存储设备和二级存储设备中存储的各个文件的价值,具体计算方法如下:The embodiment of the present invention needs to calculate the value of each file stored in the first-level storage device and the secondary storage device, and the specific calculation method is as follows:
按照设定的文件价值更新时间间隔(比如30分钟),根据文件的最近访问时间、设定时间段内的访问次数、文件的内容、系统配置信息中的至少一项,按照设定的算法计算所述一级存储设备和二级存储设备中存储的各个文件的价值。According to the set file value update interval (for example, 30 minutes), according to at least one of the latest access time of the file, the number of accesses in the set time period, the content of the file, and the system configuration information, according to the set algorithm The value of each file stored in the primary storage device and the secondary storage device.
比如,当只根据文件的最近访问时间来确定文件的价值时,则访问时间最近的文件的价值最大。For example, when the value of a file is determined based only on the most recent access time of the file, the value of the file with the most recent access time is the largest.
又比如,当同时根据文件的最近访问时间、设定时间段内的访问次数来确定文件的价值时,可以将文件的最近访问时间乘以对应的权重之后,再加上设定时间段内的访问次数乘以对应的权重来计算各个文件的价值。For another example, when the value of the file is determined according to the recent access time of the file and the number of accesses in the set time period, the latest access time of the file may be multiplied by the corresponding weight, plus the set time period. The number of visits is multiplied by the corresponding weight to calculate the value of each file.
又比如,系统管理员可以根据实际需要来直接设定某个或者多个文件的价值。For example, the system administrator can directly set the value of one or more files according to actual needs.
该实施例提供的一种文件的元数据信息中的字段示意图如图2所示,在实际应用中,可以利用每个文件的元数据信息中的现有部分字段以及其他可选的扩展字段中记录的信息来计算文件的价值,并且将文件的价值信息、排序信息和文件的存储位置信息存储在元数据信息中的可选的扩展字段中。比如,在文件被访问后,系统对上述文件的元数据信息进行更新后,利用图2中时间戳字段中记录的文件的最近访问时间来计算文件的价值;或者同时利用图2中时间戳字段中记录的文件的最近和历史访问时间、文件长度字段、文件块数字段中记录的信息中的至少一项来计算文件的价值。然后,将图2中文件价值字段中存储的文件的原有价值删除,将刚计算出的文件的价值存储在文件价值字段中,并对排序信息字段进行相应的更新。A schematic diagram of the fields in the metadata information of a file provided by this embodiment is shown in FIG. 2. In an actual application, an existing partial field in the metadata information of each file and other optional extension fields may be utilized. The recorded information is used to calculate the value of the file, and the value information of the file, the sorting information, and the storage location information of the file are stored in an optional extension field in the metadata information. For example, after the file is accessed, the system updates the metadata information of the file, and uses the latest access time of the file recorded in the timestamp field in FIG. 2 to calculate the value of the file; or simultaneously utilizes the timestamp field in FIG. The value of the file is calculated by at least one of the recent and historical access time, file length field, and file block number fields of the recorded file. Then, the original value of the file stored in the file value field in FIG. 2 is deleted, the value of the newly calculated file is stored in the file value field, and the sort information field is updated accordingly.
上述图2中存储位置字段中存储文件是存储在所述一级存储设备或二级存储设备中的信息,上述图2中排序信息字段中存储文件在下面将描述的第一文件价值排序列表或者第二文件价值排序列表中的排序情况。上述图2中排序信息字段、存储位置字段和文件价值字段是元数据信息中的扩展字段。The storage file in the storage location field in FIG. 2 is information stored in the primary storage device or the secondary storage device, and the sorted information field in FIG. 2 stores the first file value sorted list that will be described below or The sorting of the second file value sorted list. The sort information field, the storage location field, and the file value field in FIG. 2 above are extension fields in the metadata information.
由于上述一级存储设备是快速硬盘,而上述二级存储设备是慢速硬盘,因此,在上述一级存储设备中存储价值比较高的文件,在上述机械硬盘中存储价值比较低的文件。在理想情况下,上述一级存储设备中存储的任何一个文件的价值都大于上述机械硬盘中存储的所有文件的价值。Since the first-level storage device is a fast hard disk, and the second-level storage device is a slow-speed hard disk, a file with a relatively high value is stored in the first-level storage device, and a file with a relatively low value is stored in the mechanical hard disk. Ideally, the value of any of the files stored in the primary storage device above is greater than the value of all files stored in the mechanical hard disk.
步骤12、按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表。Step 12: Establish and manage a first file value sorting list according to an arrangement order of values of the files stored in the primary storage device, and establish and manage according to the order of the values of the files stored in the secondary storage device. The second file value sorted list.
将所述一级存储设备中存储的各个文件按照价值的大小从大到小排序建立第一文件价值排序列表。当按照设定的文件价值更新时间间隔,对所述一级存储设备中存储的各个文件的价值进行更新后,则需要对所述第一文件价值排序列表进行相应的更新。The first file value sorted list is created by sorting each file stored in the primary storage device according to the value of the value from large to small. After updating the value of each file stored in the primary storage device according to the set file value update time interval, the first file value sorted list needs to be updated accordingly.
将所述二级存储设备中存储的各个文件按照价值的大小从大到小排序建立第二文件价值排序列表。当按照设定的文件价值更新时间间隔,对所述二级存储设备中存储的各个文件的价值进行更新后,则需要对所述第二文件价值排序列表进行相应的更新。The respective files stored in the secondary storage device are sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list. After updating the value of each file stored in the secondary storage device according to the set file value update interval, the second file value sorted list needs to be updated accordingly.
上述第一文件价值排序列表和第二文件价值排序列表中排列的是各个文件的标识。The identifiers of the respective files are arranged in the first file value sorting list and the second file value sorting list.
步骤13、根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。Step 13: Perform file transfer on the primary storage device and the secondary storage device according to the set migration policy according to the first file value sorting list and the second file value sorting list.
预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,则在所述一级存储设备和二级存储设备中进行文件搬移处理,具体文件搬移处理的过程可以为:Presetting a time interval for performing file transfer in the primary storage device and the secondary storage device, and starting timing of the time interval, after the time interval of the time interval ends, at the primary storage device And the file transfer processing is performed in the secondary storage device, and the process of the specific file transfer processing may be:
如果所述第二文件价值排序列表中的一个或者多个文件的价值超过了所述第一文件价值排序列表中至少一个文件的价值,将所述第二文件价值排序列表中的一个或者多个文件从二级存储设备中搬移到所述一级存储设备中,然后,对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新;或者And if the value of the one or more files in the second file value sorted list exceeds the value of the at least one file in the first file value sorted list, the one or more of the second file value sorted list Moving the file from the secondary storage device to the primary storage device, and then updating the first file value sorted list and the second file value sorted list; or
如果所述一级存储设备的空间利用率超过了设定的阈值,将所述第一文件价值排序列表中排列靠后的一个或者多个文件从所述一级存储设备中搬移到所述二级存储设备中,直到所述一级存储设备的空间利用率没有超过设定的阈值,然后,对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。If the space utilization of the primary storage device exceeds a set threshold, moving one or more files ranked in the first file value sorting list from the primary storage device to the second In the level storage device, until the space utilization rate of the primary storage device does not exceed a set threshold, then the first file value sorted list and the second file value sorted list are updated.
需要进一步说明的是,如果所述二级存储设备的空间利用率超过了设定的阈值,则将所述第二文件价值排序列表中排列靠后的一个或者多个文件从所述二级存储设备中删除,直到所述二级存储设备的空间利用率没有超过设定的阈值,然后,对所述第二文件价值排序列表进行更新。It should be further noted that, if the space utilization rate of the secondary storage device exceeds a set threshold, one or more files ranked in the second file value sorting list are stored from the secondary storage. The device is deleted until the space utilization rate of the secondary storage device does not exceed a set threshold, and then the second file value sorted list is updated.
实施例二Embodiment 2
当只根据文件的最近访问时间来确定文件的价值时,该实施例提供了一种在文件系统中实现多级存储的方法的具体处理流程如图3所示,包括如下的处理步骤:When the value of the file is determined only according to the latest access time of the file, the embodiment provides a specific processing flow of the method for implementing multi-level storage in the file system. As shown in FIG. 3, the following processing steps are included:
步骤31、文件系统中的某个文件被访问,上述文件可以为一级存储设备或者二级存储设备中存储的文件。Step 31: A file in the file system is accessed, and the file may be a file stored in the primary storage device or the secondary storage device.
步骤32、由于只根据文件的最近访问时间来确定文件的价值,当前被访问的上述文件的价值最高,将上述文件的价值设置为最大。Step 32: Since the value of the file is determined only according to the latest access time of the file, the value of the file currently accessed is the highest, and the value of the file is set to the maximum.
步骤33、判断上述文件是否存储在一级存储设备中,如果是,则执行步骤34;否则,执行步骤35。Step 33: Determine whether the file is stored in the primary storage device, and if yes, perform step 34; otherwise, perform step 35.
步骤34、将上述文件的标识排列在一级存储设备中的所述第一文件价值排序列表中的最前列。Step 34: Arranging the identifier of the file in the forefront of the first file value sorting list in the primary storage device.
步骤35、将上述文件加入到所述二级存储设备的搬移文件列表中,当预先设定的文件搬移的时间间隔的计时结束之后,将所述二级存储设备的搬移列表中的文件从二级存储设备中搬移到一级存储设备中。Step 35: Add the file to the moving file list of the secondary storage device, and after the time interval of the preset file moving time ends, the file in the moving list of the secondary storage device is from the second The level storage device is moved to the primary storage device.
实施例三Embodiment 3
本发明实施例还提供了一种在文件系统中实现多级存储的装置,其具体结构如图4所示,包括如下的模块:The embodiment of the invention further provides an apparatus for implementing multi-level storage in a file system, and the specific structure thereof is as shown in FIG. 4, and includes the following modules:
文件存储模块41,用于在文件系统中分别使用一级存储设备和二级存储设备来存储文件,比如,可以将SSD作为一级存储设备,将机械磁盘作为二级存储设备;The file storage module 41 is configured to store the file in the file system by using the primary storage device and the secondary storage device respectively. For example, the SSD can be used as the primary storage device, and the mechanical disk is used as the secondary storage device.
文件价值处理模块42,用于获取所述一级存储设备和二级存储设备中存储的各个文件的价值,按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表;The file value processing module 42 is configured to acquire the value of each file stored in the primary storage device and the secondary storage device, and establish and manage the first according to the order of the values of the files stored in the primary storage device. a file value sorting list, establishing and managing a second file value sorting list according to an arrangement order of values of the respective files stored in the secondary storage device;
搬移处理模块43,用于根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。The moving processing module 43 is configured to perform file moving in the primary storage device and the secondary storage device according to the set moving policy according to the first file value sorting list and the second file value sorting list.
具体的,所述的文件价值处理模块42可以包括:Specifically, the file value processing module 42 may include:
文件价值计算模块421,用于按照设定的文件价值更新时间间隔,根据文件的最近访问时间、设定时间段内的访问次数、文件的内容、系统配置信息中的至少一项确定所述一级存储设备和二级存储设备中存储的各个文件的价值。比如,在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近访问时间来计算所述文件的价值;或者,在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近和历史访问时间,以及文件长度字段、文件块数字段中记录的信息中的至少一项来计算文件的价值。The file value calculation module 421 is configured to determine, according to the set file value update time interval, the one according to at least one of a recent access time of the file, a number of accesses in the set time period, a content of the file, and system configuration information. The value of each file stored in the level storage device and the secondary storage device. For example, after the file is accessed, the system updates the metadata information of the file, and uses the latest access time of the file recorded in the timestamp field in the metadata information of the file to calculate the value of the file; Or, after the file is accessed, the system updates the metadata information of the file, and uses the recent and historical access time of the file recorded in the timestamp field in the metadata information of the file, and the file length field, The value of the file is calculated by at least one of the information recorded in the file block number field.
文件排序列表建立模块422,用于将所述一级存储设备中存储的各个文件按照价值的大小从大到小排序建立第一文件价值排序列表,根据所述一级存储设备中存储的各个文件的价值的更新结果对所述第一文件价值排序列表进行更新;The file sorting list creating module 422 is configured to sort the files stored in the primary storage device according to the value of the value from the largest to the smallest, and establish a first file value sorting list according to the files stored in the primary storage device. The update result of the value updates the first file value sorted list;
将所述二级存储设备中存储的各个文件按照价值的大小从大到小排序建立第二文件价值排序列表,根据所述二级存储设备中存储的各个文件的价值的更新结果对所述第二文件价值排序列表进行更新。And each of the files stored in the secondary storage device is sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list, according to the update result of the value of each file stored in the secondary storage device. The second file value sorting list is updated.
具体的,所述的搬移处理模块43:还用于预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,Specifically, the moving processing module 43 is further configured to preset a time interval for performing file moving in the primary storage device and the secondary storage device, and start timing of the time interval when the time is After the interval has expired,
如果所述第二文件价值排序列表中的一个或者多个文件的价值超过了所述第一文件价值排序列表中至少一个的文件的价值,将所述第二文件价值排序列表中的一个或者多个文件从二级存储设备中搬移到所述一级存储设备中;If the value of one or more files in the second file value sorted list exceeds the value of at least one of the first file value sorted lists, one or more of the second file value sorted list Files are moved from the secondary storage device to the primary storage device;
对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
具体的,所述的搬移处理模块43:还用于预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,如果所述一级存储设备的空间利用率超过了设定的阈值,将所述第一文件价值排序列表中排列靠后的一个或者多个文件从所述一级存储设备中搬移到所述二级存储设备中,直到所述一级存储设备的空间利用率没有超过设定的阈值;Specifically, the moving processing module 43 is further configured to preset a time interval for performing file moving in the primary storage device and the secondary storage device, and start timing of the time interval when the time is After the interval of the interval ends, if the space utilization rate of the primary storage device exceeds a set threshold, one or more files ranked in the first file value sorted list are sorted from the primary storage device. Moving to the secondary storage device until the space utilization of the primary storage device does not exceed a set threshold;
对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
应用本发明实施例的装置在文件系统中实现多级存储的具体过程与前述方法实施例类似,此处不再赘述。The specific process of implementing the multi-level storage in the file system by using the device in the embodiment of the present invention is similar to the foregoing method embodiment, and details are not described herein again.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the foregoing embodiments can be completed by a computer program to instruct related hardware, and the program can be stored in a computer readable storage medium. When executed, the flow of an embodiment of the methods as described above may be included. The storage medium may be a magnetic disk, an optical disk, or a read-only storage memory (Read-Only) Memory, ROM) or Random Access Memory (RAM).
综上所述,本发明实施例通过在文件系统中分别使用一级存储设备和二级存储设备来存储文件,并基于各个文件的价值和按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移,可以实现将价值高的文件存放到性能高的存储介质(即一级存储设备)上,将价值低的文件存放在慢速存储介质(即二级存储设备)上,使系统达到整体性能最佳。In summary, the embodiment of the present invention stores files by using a primary storage device and a secondary storage device in a file system, and based on the value of each file and the set migration policy in the primary storage device and File transfer in the secondary storage device can store high-value files on high-performance storage media (ie, primary storage devices) and low-value files on slow storage media (ie, secondary storage devices). In order to achieve the best overall performance of the system.
本发明实施例支持对异构存储介质的统一管理,对用户呈现的整体存储空间为各级存储的空间之和;用户使用时不必区分各级存储介质,由文件系统对用户提供统一的管理。从而避免了使用额外的分级存储管理软件,减少了复杂度。 The embodiment of the invention supports the unified management of the heterogeneous storage medium, and the overall storage space presented by the user is the sum of the storage spaces of the levels; the user does not have to distinguish the storage medium at all levels when using the file, and the file system provides unified management to the user. This eliminates the need for additional tiered storage management software and reduces complexity.
本发明实施例提供灵活的策略配置,可以灵活控制文件迁移的频度周期和文件迁移所遵循的算法。 The embodiments of the present invention provide flexible policy configuration, which can flexibly control the frequency cycle of file migration and the algorithm followed by file migration.
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any person skilled in the art can easily think of changes or within the technical scope disclosed by the present invention. Alternatives are intended to be covered by the scope of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims (12)

  1. 一种在文件系统中实现多级存储的方法,其特征在于,包括:A method for implementing multi-level storage in a file system, comprising:
    在文件系统中分别使用一级存储设备和二级存储设备来存储文件,获取所述一级存储设备和二级存储设备中存储的各个文件的价值;The first storage device and the secondary storage device are respectively used in the file system to store files, and obtain the value of each file stored in the primary storage device and the secondary storage device;
    按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表;Establishing and managing a first file value sorting list according to an arrangement order of values of the respective files stored in the primary storage device, and establishing and managing the second file according to an arrangement order of values of the respective files stored in the secondary storage device a sorted list of values;
    根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。And performing file transfer on the primary storage device and the secondary storage device according to the set migration policy according to the first file value sorting list and the second file value sorting list.
  2. 根据权利要求1所述的在文件系统中实现多级存储的方法,其特征在于,所述的获取所述一级存储设备和二级存储设备中存储的各个文件的价值,包括:The method for implementing the multi-level storage in the file system according to claim 1, wherein the obtaining the value of each file stored in the primary storage device and the secondary storage device comprises:
    在文件系统中按照设定的文件价值更新时间间隔,根据文件的最近访问时间、设定时间段内的访问次数、文件的内容、系统配置信息中的至少一项确定所述一级存储设备和二级存储设备中存储的各个文件的价值。Updating the time interval according to the set file value in the file system, and determining the primary storage device according to at least one of a recent access time of the file, a number of accesses in the set time period, a content of the file, and system configuration information. The value of each file stored in the secondary storage device.
  3. 根据权利要求2所述的在文件系统中实现多级存储的方法,其特征在于,所述的获取所述一级存储设备和二级存储设备中存储的各个文件的价值,包括:The method for implementing the multi-level storage in the file system according to claim 2, wherein the obtaining the value of each file stored in the primary storage device and the secondary storage device comprises:
    在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近访问时间来计算所述文件的价值;After the file is accessed, the system updates the metadata information of the file, and uses the latest access time of the file recorded in the timestamp field in the metadata information of the file to calculate the value of the file;
    或者,or,
    在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近和历史访问时间,以及文件长度字段、文件块数字段中记录的信息中的至少一项来计算文件的价值。After the file is accessed, the system updates the metadata information of the file, and uses the recent and historical access time of the file recorded in the timestamp field in the metadata information of the file, and the file length field and the file block. At least one of the information recorded in the digital segment calculates the value of the file.
  4. 根据权利要求3所述的在文件系统中实现多级存储的方法,其特征在于,所述的按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表,包括:The method for implementing multi-level storage in a file system according to claim 3, wherein said first file value ranking is established and managed according to an arrangement order of values of respective files stored in said primary storage device a list, the second file value sorting list is established and managed according to an arrangement order of values of the respective files stored in the secondary storage device, including:
    将所述一级存储设备中存储的各个文件按照价值的大小从大到小排序建立第一文件价值排序列表,根据所述一级存储设备中存储的各个文件的价值的更新结果对所述第一文件价值排序列表进行更新;And sorting, according to the size of the value, the first file value sorting list according to the value of the value stored in the first-level storage device, and the updating result according to the value of each file stored in the first-level storage device A file value sorting list is updated;
    将所述二级存储设备中存储的各个文件按照价值的大小从大到小排序建立第二文件价值排序列表,根据所述二级存储设备中存储的各个文件的价值的更新结果对所述第二文件价值排序列表进行更新。And each of the files stored in the secondary storage device is sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list, according to the update result of the value of each file stored in the secondary storage device. The second file value sorting list is updated.
  5. 根据权利要求1所述的在文件系统中实现多级存储的方法,其特征在于,所述的一级存储设备包括固态硬盘;所述的二级存储设备包括机械磁盘。The method for implementing multi-level storage in a file system according to claim 1, wherein the primary storage device comprises a solid state drive; and the secondary storage device comprises a mechanical disk.
  6. 根据权利要求1-5任一项所述的在文件系统中实现多级存储的方法,其特征在于,所述的根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移,包括:The method for implementing multi-level storage in a file system according to any one of claims 1 to 5, wherein said sorting list according to said first file value sorting list and said second file value are arranged according to The moving strategy performs file migration in the primary storage device and the secondary storage device, including:
    预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,Setting a time interval for performing file transfer in the primary storage device and the secondary storage device, and starting timing of the time interval, when the time interval of the time interval ends,
    如果所述第二文件价值排序列表中的一个或者多个文件的价值超过了所述第一文件价值排序列表中至少一个的文件的价值,将所述第二文件价值排序列表中的一个或者多个文件从二级存储设备中搬移到所述一级存储设备中;If the value of one or more files in the second file value sorted list exceeds the value of at least one of the first file value sorted lists, one or more of the second file value sorted list Files are moved from the secondary storage device to the primary storage device;
    对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
  7. 根据权利要求1-6任一项所述的在文件系统中实现多级存储的方法,其特征在于,所述的根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移,包括:The method for implementing multi-level storage in a file system according to any one of claims 1 to 6, wherein the sorting list according to the first file value sorting list and the second file value is set according to The moving strategy performs file migration in the primary storage device and the secondary storage device, including:
    预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,Setting a time interval for performing file transfer in the primary storage device and the secondary storage device, and starting timing of the time interval, when the time interval of the time interval ends,
    如果所述一级存储设备的空间利用率超过了设定的阈值,将所述第一文件价值排序列表中排列靠后的一个或者多个文件从所述一级存储设备中搬移到所述二级存储设备中,直到所述一级存储设备的空间利用率没有超过设定的阈值;If the space utilization of the primary storage device exceeds a set threshold, moving one or more files ranked in the first file value sorting list from the primary storage device to the second In the level storage device, until the space utilization rate of the primary storage device does not exceed a set threshold;
    对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
  8. 一种在文件系统中实现多级存储的装置,其特征在于,包括:An apparatus for implementing multi-level storage in a file system, comprising:
    文件存储模块,用于在文件系统中分别使用一级存储设备和二级存储设备来存储文件;a file storage module, configured to store a file by using a primary storage device and a secondary storage device respectively in the file system;
    文件价值处理模块,用于获取所述一级存储设备和二级存储设备中存储的各个文件的价值,按照所述一级存储设备中存储的各个文件的价值的排列顺序建立和管理第一文件价值排序列表,按照所述二级存储设备中存储的各个文件的价值的排列顺序建立和管理第二文件价值排序列表;a file value processing module, configured to acquire values of respective files stored in the primary storage device and the secondary storage device, and establish and manage the first file according to an arrangement order of values of the files stored in the primary storage device a value sorting list, establishing and managing a second file value sorting list according to an arrangement order of values of the respective files stored in the secondary storage device;
    搬移处理模块,用于根据所述第一文件价值排序列表和第二文件价值排序列表,按照设定的搬移策略在所述一级存储设备和二级存储设备中进行文件搬移。The moving processing module is configured to perform file moving in the primary storage device and the secondary storage device according to the set moving policy according to the first file value sorting list and the second file value sorting list.
  9. 根据权利要求8所述的在文件系统中实现多级存储的装置,其特征在于,所述的文件价值处理模块包括:The apparatus for implementing multi-level storage in a file system according to claim 8, wherein the file value processing module comprises:
    文件价值计算模块,用于按照设定的文件价值更新时间间隔,根据文件的最近访问时间、设定时间段内的访问次数、文件的内容、系统配置信息中的至少一项确定所述一级存储设备和二级存储设备中存储的各个文件的价值;a file value calculation module, configured to update the time interval according to the set file value, and determine the first level according to at least one of a recent access time of the file, a number of accesses in the set time period, a content of the file, and system configuration information. The value of each file stored in the storage device and the secondary storage device;
    文件排序列表建立模块,用于将所述一级存储设备中存储的各个文件按照价值的大小从大到小排序建立第一文件价值排序列表,根据所述一级存储设备中存储的各个文件的价值的更新结果对所述第一文件价值排序列表进行更新;a file sorting list establishing module, configured to sort, according to a value of a value, a first file value sorting list according to a value of the value stored in the first-level storage device, according to each file stored in the first-level storage device The update result of the value updates the first file value sorted list;
    将所述二级存储设备中存储的各个文件按照价值的大小从大到小排序建立第二文件价值排序列表,根据所述二级存储设备中存储的各个文件的价值的更新结果对所述第二文件价值排序列表进行更新。And each of the files stored in the secondary storage device is sorted according to the value of the value from the largest to the smallest to establish a second file value sorting list, according to the update result of the value of each file stored in the secondary storage device. The second file value sorting list is updated.
  10. 根据权利要求9所述的在文件系统中实现多级存储的装置,其特征在于:The apparatus for implementing multi-level storage in a file system according to claim 9, wherein:
    所述的文件价值计算模块,还用于在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近访问时间来计算所述文件的价值;The file value calculation module is further configured to: after the file is accessed, the system updates the metadata information of the file, and uses the latest access of the file recorded in the timestamp field in the metadata information of the file. Time to calculate the value of the document;
    或者,or,
    在文件被访问后,系统对所述文件的元数据信息进行更新后,利用所述文件的元数据信息中的时间戳字段中记录的文件的最近和历史访问时间、文件长度字段、文件块数字段中记录的信息中的至少一项来计算文件的价值。After the file is accessed, the system updates the metadata information of the file, and uses the recent and historical access time, the file length field, and the file block number of the file recorded in the timestamp field in the metadata information of the file. At least one of the information recorded in the segment calculates the value of the file.
  11. 根据权利要求8或9或10所述的在文件系统中实现多级存储的装置,其特征在于:Apparatus for implementing multi-level storage in a file system according to claim 8 or 9 or 10, wherein:
    所述的搬移处理模块,还用于预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,The moving processing module is further configured to preset a time interval for performing file transfer in the primary storage device and the secondary storage device, and start timing of the time interval, when the time interval ends after that,
    如果所述第二文件价值排序列表中的一个或者多个文件的价值超过了所述第一文件价值排序列表中至少一个的文件的价值,将所述第二文件价值排序列表中的一个或者多个文件从二级存储设备中搬移到所述一级存储设备中;If the value of one or more files in the second file value sorted list exceeds the value of at least one of the first file value sorted lists, one or more of the second file value sorted list Files are moved from the secondary storage device to the primary storage device;
    对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
  12. 根据权利要求8或9或10所述的在文件系统中实现多级存储的装置,其特征在于:Apparatus for implementing multi-level storage in a file system according to claim 8 or 9 or 10, wherein:
    所述的搬移处理模块,还用于预先设定在所述一级存储设备和二级存储设备中进行文件搬移的时间间隔,并开始所述时间间隔的计时,当所述时间间隔的计时结束之后,如果所述一级存储设备的空间利用率超过了设定的阈值,将所述第一文件价值排序列表中排列靠后的一个或者多个文件从所述一级存储设备中搬移到所述二级存储设备中,直到所述一级存储设备的空间利用率没有超过设定的阈值;The moving processing module is further configured to preset a time interval for performing file transfer in the primary storage device and the secondary storage device, and start timing of the time interval, when the time interval ends And then, if the space utilization rate of the primary storage device exceeds a set threshold, moving one or more files arranged in the first file value sorting list from the primary storage device to the In the secondary storage device, until the space utilization rate of the primary storage device does not exceed a set threshold;
    对所述第一文件价值排序列表和所述第二文件价值排序列表进行更新。Updating the first file value sorted list and the second file value sorted list.
PCT/CN2011/084830 2011-12-28 2011-12-28 Method and device for realizing multilevel storage in file system WO2013097119A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201180003291.4A CN103548004B (en) 2011-12-28 2011-12-28 The method and apparatus of dynamic data attemper is realized in file system
PCT/CN2011/084830 WO2013097119A1 (en) 2011-12-28 2011-12-28 Method and device for realizing multilevel storage in file system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/084830 WO2013097119A1 (en) 2011-12-28 2011-12-28 Method and device for realizing multilevel storage in file system

Publications (1)

Publication Number Publication Date
WO2013097119A1 true WO2013097119A1 (en) 2013-07-04

Family

ID=48696205

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/084830 WO2013097119A1 (en) 2011-12-28 2011-12-28 Method and device for realizing multilevel storage in file system

Country Status (2)

Country Link
CN (1) CN103548004B (en)
WO (1) WO2013097119A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104537104A (en) * 2015-01-13 2015-04-22 百度在线网络技术(北京)有限公司 Software ranking method and system
CN105653591A (en) * 2015-12-22 2016-06-08 浙江中控研究院有限公司 Hierarchical storage and migration method of industrial real-time data

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107092564A (en) * 2017-04-21 2017-08-25 深信服科技股份有限公司 A kind of data processing method and device
CN107844271A (en) * 2017-10-27 2018-03-27 郑州云海信息技术有限公司 A kind of method, apparatus and computer-readable recording medium for being classified storage
CN111367469B (en) * 2020-02-16 2022-07-08 苏州浪潮智能科技有限公司 Method and system for migrating layered storage data
CN111917882B (en) * 2020-08-07 2023-04-07 湖南快乐阳光互动娱乐传媒有限公司 File caching method and device and electronic equipment
CN116257563B (en) * 2022-11-30 2023-11-21 荣耀终端有限公司 Data value evaluation method and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060015529A1 (en) * 2004-07-15 2006-01-19 Hitachi, Ltd. Method and apparatus of hierarchical storage management based on data value
CN101101563A (en) * 2007-07-23 2008-01-09 清华大学 Migration management based on massive data classified memory system
US20080154988A1 (en) * 2005-06-10 2008-06-26 Fujitsu Limited Hsm control program and method
CN102291450A (en) * 2011-08-08 2011-12-21 浪潮电子信息产业股份有限公司 Data online hierarchical storage method in cluster storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060015529A1 (en) * 2004-07-15 2006-01-19 Hitachi, Ltd. Method and apparatus of hierarchical storage management based on data value
US20080154988A1 (en) * 2005-06-10 2008-06-26 Fujitsu Limited Hsm control program and method
CN101101563A (en) * 2007-07-23 2008-01-09 清华大学 Migration management based on massive data classified memory system
CN102291450A (en) * 2011-08-08 2011-12-21 浪潮电子信息产业股份有限公司 Data online hierarchical storage method in cluster storage system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LV, SHUAI ET AL.: "Research on the Data Migration Strategy of Hierarchical Mass Storage System", COMPUTER ENGINEERING & SCIENCE, vol. 31, no. AL, 2009, pages 163 - 167 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104537104A (en) * 2015-01-13 2015-04-22 百度在线网络技术(北京)有限公司 Software ranking method and system
CN105653591A (en) * 2015-12-22 2016-06-08 浙江中控研究院有限公司 Hierarchical storage and migration method of industrial real-time data

Also Published As

Publication number Publication date
CN103548004A (en) 2014-01-29
CN103548004B (en) 2016-03-30

Similar Documents

Publication Publication Date Title
WO2013097119A1 (en) Method and device for realizing multilevel storage in file system
WO2020103506A1 (en) Hybrid storage-based data management system and method, terminal, and medium
US9880602B2 (en) Power characteristics in a system of disparate storage drives
WO2013117104A1 (en) Bt offline data download system and method, and computer storage medium
WO2013178155A1 (en) Storage method and apparatus for distributed file system
WO2012111905A2 (en) Distributed memory cluster control device and method using mapreduce
WO2016199955A1 (en) Code dispersion hash table-based map-reduce system and method
WO2011107046A2 (en) Memory access monitoring method and device
WO2014101445A1 (en) Data query method and system
WO2011131079A1 (en) Event processing method and system for distributed control system
CN111143242B (en) Cache prefetching method and device
CN106406759B (en) Data storage method and device
CN104054071A (en) Method for accessing storage device and storage device
US11743333B2 (en) Tiered queuing system
US9451024B2 (en) Self-organizing disk (SoD)
JP2014535226A (en) Forwarding database synchronization on network devices
WO2015102133A1 (en) Device for managing file and method for same
WO2023096118A1 (en) Data input and output method using storage node-based key-value store
CN111475108A (en) Distributed storage method, computer equipment and computer readable storage medium
CN102937997A (en) Data processing system
CN115438016A (en) Dynamic fragmentation method, system, medium and device in distributed object storage
WO2012149815A1 (en) Method and device for managing disk cache
WO2023029485A1 (en) Data processing method and apparatus, computer device, and computer-readable storage medium
WO2020153522A1 (en) Hybrid indexing device in heterogeneous storage based database management system
CN104391901B (en) A kind of memory cell network big data base frame platform and its file access method

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180003291.4

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11878844

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11878844

Country of ref document: EP

Kind code of ref document: A1