WO2020073517A1 - 基于分布式存储系统的数据归档方法、装置、计算机设备 - Google Patents

基于分布式存储系统的数据归档方法、装置、计算机设备 Download PDF

Info

Publication number
WO2020073517A1
WO2020073517A1 PCT/CN2018/124395 CN2018124395W WO2020073517A1 WO 2020073517 A1 WO2020073517 A1 WO 2020073517A1 CN 2018124395 W CN2018124395 W CN 2018124395W WO 2020073517 A1 WO2020073517 A1 WO 2020073517A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
storage system
distributed storage
storage
accessed
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.)
Ceased
Application number
PCT/CN2018/124395
Other languages
English (en)
French (fr)
Inventor
管清政
王欣
汪洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Publication of WO2020073517A1 publication Critical patent/WO2020073517A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/182Distributed file systems

Definitions

  • the present application relates to the field of distributed storage technology, and in particular to a data archiving method, device, and computer equipment based on a distributed storage system.
  • this application proposes a data archiving method, device, and computer equipment based on a distributed storage system, aiming to solve the problem of data archiving of the existing distributed storage system that requires manual participation, resulting in waste of human resources .
  • the technical solution proposed in this application is: a data archiving method based on a distributed storage system, the method including: scanning files in the distributed storage system; judging whether the scanned files meet the archiving conditions of the data archiving strategy; if The scanned file meets the archiving conditions of the data archiving strategy, then record the storage path of the scanned file to obtain a first storage path; according to the first storage path, generate a directory list about the storage path; Read the directory list, and transfer the file corresponding to the first storage path in the distributed storage system to the archive memory for storage.
  • the present application also provides a data archiving device based on a distributed storage system.
  • the device includes:
  • Judgment module used to judge whether the scanned file meets the archiving conditions of the data archiving strategy
  • a recording module configured to record the storage path of the scanned file to obtain the first storage path if the scanned file meets the archiving conditions of the data archiving strategy
  • a generating module configured to generate a directory list about the storage path according to the first storage path
  • the archive module is used to read the directory list and transfer the files corresponding to the first storage path in the distributed storage system to the archive memory for storage.
  • the present application also provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the steps of any one of the above methods are implemented.
  • the present application also provides a computer non-volatile readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods described above are implemented.
  • the present application has the beneficial effect of scanning the files in the distributed storage system, and if the scanned files meet the archiving conditions of the data archiving strategy, the files that meet the archiving conditions of the data archiving strategy are transferred to the archive memory for storage , Aiming to solve the problem of data archiving of the existing distributed storage system, which requires manual participation, resulting in waste of human resources.
  • FIG. 1 is a flowchart of applying a data archiving method based on a distributed storage system provided by an embodiment of the present application
  • FIG. 2 is a functional block diagram of a data archiving device based on a distributed storage system provided by an embodiment of the present application
  • FIG. 3 is a schematic block diagram of a structure of a computer device provided by using an embodiment of the present application.
  • an embodiment of the present application proposes a data archiving method based on a distributed storage system.
  • the method includes the following steps:
  • Step S101 Scan files in the distributed storage system.
  • the files in the distributed storage system are scanned regularly, and the files in the distributed storage system are scanned according to the set time.
  • step S101 before step S101, it includes:
  • scanning of the files in the distributed storage system begins. In other words, the scan will only start when the archive command is received.
  • Step S102 Determine whether the scanned file meets the archiving conditions of the data archiving strategy.
  • step S102 it includes:
  • the file information determine whether the scanned file meets the archiving conditions of the data archiving strategy.
  • the scanned files can obtain a lot of file information, in order to improve the judgment efficiency, obtain the file information corresponding to the filing conditions of the data archiving strategy. After obtaining the file information, according to the file information, determine whether the scanned file meets the data archiving strategy Archive conditions.
  • the data archiving strategy includes a time condition archiving strategy or / and directory condition archiving strategy.
  • the time condition archiving strategy is that files before the specified time meet the archiving conditions
  • the directory condition archiving strategy is that the files under the specified directory meet the archiving conditions .
  • Step S103 If the scanned file meets the archiving condition, record the storage path of the scanned file to obtain the first storage path.
  • the judgment result it can be obtained whether the scanned file meets the archiving conditions of the data archiving strategy. If the scanned file does not meet the archiving conditions of the data archiving strategy, no archiving operation is necessary. If the scanned file conforms to the data archiving strategy For archiving conditions, when archiving is required, record the storage path of the scanned file to obtain the first storage path.
  • Step S104 Generate a directory list about the storage path according to the first storage path.
  • a directory list is generated according to the first storage path, and the directory list is about the storage path.
  • Step S105 Read the directory list, and transfer the file corresponding to the first storage path in the distributed storage system to the archive memory for storage.
  • the directory list is read to obtain the first storage path, and then the file corresponding to the first storage path in the distributed storage system is transferred to the archive memory for storage.
  • the archive memory is used to store files that meet the archiving conditions of the data archiving strategy.
  • step S105 it includes:
  • the files corresponding to the first storage path in the distributed storage system are cut into the archive storage one by one.
  • step S105 it includes:
  • the file corresponding to the first storage path in the distributed storage system is deleted.
  • step S105 it includes:
  • the request is allowed.
  • the transfer record After transferring the file corresponding to the first storage path in the distributed storage system to the archive storage, record the transfer record of the file transferred from the distributed storage system to the archive storage, the transfer record includes the transfer file, and the transfer file before transfer The storage path of the distributed storage system and the storage path of the transferred files in the archive storage after the transfer.
  • After completing the record transfer record after receiving the front-end API request to access the file, first determine the location of the file to be accessed to determine whether the file to be accessed is stored in the distributed storage system, if the file to be accessed is stored in the distribution In a distributed storage system, requests are allowed.
  • the step of receiving the front-end API request to access the file it includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, obtain a storage path of the file to be accessed in the distributed storage system;
  • the file to be accessed is not stored in the distributed storage system, you need to make another judgment to determine whether the file to be accessed is transferred from the distributed storage system to the archive storage. If the file to be accessed is not from the distributed storage system The file transferred from the storage system to the archive storage is rejected.
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, obtain the storage path of the file to be accessed in the distributed storage system, because the transfer record includes the transfer file, and the transfer file is in the distributed storage system before the transfer
  • the storage path of the file and the transfer file in the archive storage after the transfer find the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage, obtain the second storage path, in After obtaining the second storage path, the file in the second storage path is called back to the position before the transfer, that is, to the storage path of the file to be accessed in the distributed storage system.
  • the front end The API accesses files from the distributed storage system.
  • the file that has been recalled in the distributed storage system is transferred to the archive storage again for storage.
  • the file that has been recalled in the distributed storage system is transferred to the archive storage again for storage.
  • the method before the step of receiving the front-end API request to access the file, the method includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, the storage path of the file to be accessed in the distributed storage system is obtained;
  • the file to be accessed is not stored in the distributed storage system, you need to make another judgment to determine whether the file to be accessed is transferred from the distributed storage system to the archive storage. If the file to be accessed is not from the distributed storage system The file transferred from the storage system to the archive storage is rejected.
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage
  • obtain the storage path of the file to be accessed in the distributed storage system because the transfer record includes the transfer file, and the transfer file is in the distributed storage system before the transfer
  • the storage path of the file and the transfer file in the archive storage after the transfer find the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage, obtain the second storage path, in After obtaining the second storage path, configure the storage path of the file to be accessed in the distributed storage system to jump to the second storage path, that is, jump the storage path of the file to be accessed in the distributed storage system to archive
  • the front-end API accesses the file from the archive storage.
  • an embodiment of the present application provides a data archiving apparatus 1 based on a distributed storage system.
  • the apparatus 1 includes a scanning module 11, a judgment module 12, a recording module 13, a generating module 14, and an archiving module 15.
  • the scanning module 11 is used to scan files in the distributed storage system.
  • the files in the distributed storage system are scanned regularly, and the files in the distributed storage system are scanned according to the set time.
  • the device 1 includes:
  • the receiving module is used to receive the archive instruction of the files in the distributed storage system.
  • scanning of the files in the distributed storage system begins. In other words, the scan will only start when the archive command is received.
  • the judgment module 12 is used to judge whether the scanned file meets the archiving conditions of the data archiving strategy.
  • the judgment module 12 includes:
  • the first obtaining module is used to obtain file information corresponding to the archive conditions of the data archiving strategy according to the scanned files;
  • the first judgment module is used to judge whether the scanned file meets the archiving conditions of the data archiving strategy based on the file information.
  • the scanned files can obtain a lot of file information, in order to improve the judgment efficiency, obtain the file information corresponding to the filing conditions of the data archiving strategy. After obtaining the file information, according to the file information, determine whether the scanned file meets the data archiving strategy Archive conditions.
  • the data archiving strategy includes a time condition archiving strategy or / and directory condition archiving strategy.
  • the time condition archiving strategy is that files before the specified time meet the archiving conditions
  • the directory condition archiving strategy is that the files under the specified directory meet the archiving conditions .
  • the recording module 13 is configured to record the storage path of the scanned file to obtain the first storage path if the scanned file meets the archiving condition.
  • the judgment result it can be obtained whether the scanned file meets the archiving conditions of the data archiving strategy. If the scanned file does not meet the archiving conditions of the data archiving strategy, there is no need for archiving operations. For archiving conditions, when archiving is required, record the storage path of the scanned file to obtain the first storage path.
  • the generating module 14 is configured to generate a directory list about the storage path according to the first storage path.
  • a directory list is generated according to the first storage path, and the directory list is about the storage path.
  • the archive module 15 is used to read the directory list and transfer the files corresponding to the first storage path in the distributed storage system to the archive storage for storage.
  • the directory list is read to obtain the first storage path, and then the file corresponding to the first storage path in the distributed storage system is transferred to the archive memory for storage.
  • the archive memory is used to store files that meet the archiving conditions of the data archiving strategy.
  • the archiving module 15 includes:
  • a first reading module used to read the directory list
  • the first archive module is configured to cut files corresponding to the first storage path in the distributed storage system to the archive memory one by one according to the directory list.
  • the archiving module 15 includes:
  • a second reading module used to read the directory list
  • a second archive module configured to copy files corresponding to the first storage path in the distributed storage system to the archive storage one by one according to the directory list;
  • the first deletion module is used to delete files corresponding to the first storage path in the distributed storage system after the copy is completed.
  • the device 1 includes:
  • the first receiving module is used to receive the request of the front-end API to access the file
  • the second judgment module is used to judge whether the file to be accessed is stored in the distributed storage system
  • the first permission module is used to allow the request if the file to be accessed is stored in a distributed storage system.
  • the transfer record After transferring the file corresponding to the first storage path in the distributed storage system to the archive storage, record the transfer record of the file transferred from the distributed storage system to the archive storage, the transfer record includes the transfer file, and the transfer file before transfer The storage path of the distributed storage system and the storage path of the transferred files in the archive storage after the transfer.
  • After completing the record transfer record after receiving the front-end API request to access the file, first determine the location of the file to be accessed to determine whether the file to be accessed is stored in the distributed storage system, if the file to be accessed is stored in the distribution In a distributed storage system, requests are allowed.
  • the device 1 includes:
  • the first recording module is used to record the transfer records of the files transferred from the distributed storage system to the archive storage;
  • the third judgment module is used to judge whether the file to be accessed is a file transferred from the distributed storage system to the archive storage if the file to be accessed is not stored in the distributed storage system;
  • a second obtaining module configured to obtain the storage path of the file to be accessed in the distributed storage system if the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • a first searching module configured to search for the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage according to the transfer record, and obtain a second storage path;
  • a first callback module used to callback the file in the second storage path to the storage path of the file to be accessed in the distributed storage system
  • the second permission module is used to allow the request after completing the callback.
  • the file to be accessed is not stored in the distributed storage system, you need to make another judgment to determine whether the file to be accessed is transferred from the distributed storage system to the archive storage. If the file to be accessed is not from the distributed storage system The file transferred from the storage system to the archive storage is rejected.
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, obtain the storage path of the file to be accessed in the distributed storage system, because the transfer record includes the transfer file, and the transfer file is in the distributed storage system before the transfer
  • the storage path of the file and the transfer file in the archive storage after the transfer find the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage, obtain the second storage path, in After obtaining the second storage path, the file in the second storage path is called back to the position before the transfer, that is, to the storage path of the file to be accessed in the distributed storage system.
  • the front end The API accesses files from the distributed storage system.
  • Device 1 includes:
  • the third archiving module is used to transfer the file that has been recalled in the distributed storage system to the archive storage again after the file access by the front-end API ends.
  • the file that has been recalled in the distributed storage system is transferred to the archive storage again for storage.
  • the device 1 includes:
  • the second recording module is used to record the transfer records of the files transferred from the distributed storage system to the archive storage;
  • the fourth judgment module is used to judge whether the file to be accessed is a file transferred from the distributed storage system to the archive storage if the file to be accessed is not stored in the distributed storage system;
  • a third obtaining module configured to obtain the storage path of the file to be accessed in the distributed storage system if the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • a second search module configured to search for the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage according to the transfer record, and obtain a second storage path;
  • a first configuration module configured to configure the storage path of the file to be accessed in the distributed storage system to jump to the second storage path
  • the third permission module is used to allow the request after completing the configuration.
  • the file to be accessed is not stored in the distributed storage system, you need to make another judgment to determine whether the file to be accessed is transferred from the distributed storage system to the archive storage. If the file to be accessed is not from the distributed storage system The file transferred from the storage system to the archive storage is rejected.
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage
  • obtain the storage path of the file to be accessed in the distributed storage system because the transfer record includes the transfer file, and the transfer file is in the distributed storage system before the transfer
  • the storage path of the file and the transfer file in the archive storage after the transfer find the storage path of the file to be accessed in the distributed storage system corresponding to the storage path in the archive storage, obtain the second storage path, in After obtaining the second storage path, configure the storage path of the file to be accessed in the distributed storage system to jump to the second storage path, that is, jump the storage path of the file to be accessed in the distributed storage system to archive
  • the front-end API accesses the file from the archive storage.
  • a computer device is also provided in an embodiment of the present application.
  • the computer device may be a server, and its internal structure may be as shown in FIG.
  • the computer device includes a processor, memory, network interface, and database connected by a system bus. Among them, the processor designed by the computer is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the memory device provides an environment for operating systems and computer programs in non-volatile storage media.
  • the database of the computer device is used to store data such as models based on the data archiving method of the distributed storage system.
  • the network interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, a data archiving method based on a distributed storage system is realized.
  • the above processor executes the steps of the above data storage method based on the distributed storage system: scanning files in the distributed storage system; judging whether the scanned files meet the archiving conditions of the data archiving strategy; if the scanned files meet all The archive condition, record the storage path of the scanned file to obtain a first storage path; generate a directory list about the storage path according to the first storage path; read the directory list, and convert the first The storage path corresponds to the transfer of files in the distributed storage system to the archive storage.
  • the step of reading the file list and transferring the file corresponding to the first storage path in the distributed storage system to the archive storage includes:
  • the request is allowed.
  • the method before the step of receiving the front-end API request to access the file, the method includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, obtain a storage path of the file to be accessed in the distributed storage system;
  • the above step after allowing the request after completing the callback includes:
  • the file that has been recalled in the distributed storage system is transferred to the archive storage again for storage.
  • the method before the step of receiving the front-end API request to access the file, the method includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, the storage path of the file to be accessed in the distributed storage system is obtained;
  • the step of reading the directory list and transferring the file corresponding to the first storage path in the distributed storage system to the archive storage includes:
  • the file corresponding to the first storage path in the distributed storage system is deleted.
  • the above data archiving strategy includes a time condition archiving strategy or / and directory condition archiving strategy, the time condition archiving strategy is that files before the specified time meet the archiving conditions, and the directory condition archiving strategy is under the specified directory Of files are eligible for archiving.
  • the computer device of the embodiment of the present application scans the files in the distributed storage system. If the scanned files meet the archiving conditions of the data archiving strategy, the files that meet the archiving conditions of the data archiving strategy are transferred to the archive memory for storage To solve the problem of data archiving in the existing distributed storage system, manual participation is required, which leads to the problem of wasted human resources.
  • An embodiment of the present application further provides a computer non-volatile readable storage medium on which a computer program is stored.
  • a data archiving method based on a distributed storage system is implemented, specifically: scanning Files in a distributed storage system; determine whether the scanned files meet the archiving conditions of the data archiving strategy; if the scanned files meet the archiving conditions, record the storage path of the scanned files and obtain the first A storage path; generate a directory list about the storage path according to the first storage path; read the directory list, and transfer the files corresponding to the first storage path in the distributed storage system to the archive memory for storage.
  • the step of reading the file list and transferring the file corresponding to the first storage path in the distributed storage system to the archive storage includes:
  • the request is allowed.
  • the method before the step of receiving the front-end API request to access the file, the method includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, obtain a storage path of the file to be accessed in the distributed storage system;
  • the above step after allowing the request after completing the callback includes:
  • the file that has been recalled in the distributed storage system is transferred to the archive storage again for storage.
  • the method before the step of receiving the front-end API request to access the file, the method includes:
  • the step of determining whether the file to be accessed is stored in the distributed storage system, it includes:
  • the file to be accessed is not stored in the distributed storage system, it is determined whether the file to be accessed is a file transferred from the distributed storage system to the archive storage;
  • the file to be accessed is a file transferred from the distributed storage system to the archive storage, the storage path of the file to be accessed in the distributed storage system is obtained;
  • the step of reading the directory list and transferring the file corresponding to the first storage path in the distributed storage system to the archive storage includes:
  • the file corresponding to the first storage path in the distributed storage system is deleted.
  • the above data archiving strategy includes a time condition archiving strategy or / and directory condition archiving strategy, the time condition archiving strategy is that files before the specified time meet the archiving conditions, and the directory condition archiving strategy is under the specified directory Of files are eligible for archiving.
  • the storage medium of the embodiment of the present application scans the files in the distributed storage system, and if the scanned files meet the archiving conditions of the data archiving strategy, the files that meet the archiving conditions of the data archiving strategy are transferred to the archive storage for storage.

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

一种基于分布式存储系统的数据归档方法、装置、计算机设备。扫描在分布式存储系统中的文件(S101);判断扫描到的文件是否符合数据归档策略的归档条件(S102);若所述扫描到的文件符合所述归档条件,则记录扫描到的文件的存储路径,获得第一存储路径(S103);根据所述第一存储路径,生成关于存储路径的目录列表(S104);读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存(S105)。

Description

基于分布式存储系统的数据归档方法、装置、计算机设备
本申请要求于2018年10月11日提交中国专利局、申请号为2018111857399,申请名称为“基于分布式存储系统的数据归档方法、装置、计算机设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及分布式存储技术领域,特别涉及一种基于分布式存储系统的数据归档方法、装置、计算机设备。
背景技术
随着互联网技术的发展和应用,在互联网的应用过程中会产生大量的数据。在互联网中需要将大量的数据进行存储。传统的存储技术中,当用户产生的数据较多时,会面临使用的存储设备的空间越来越大的情况,存储成本随着空间增大而变的越来越高。现有分布式存储系统的数据归档,一般需要人为干预,从一套分布式存储系统手工拷贝到归档存储器,然后人工删除归档后的数据,数据归档过程需要人工参与。
技术问题
针对现有技术不足,本申请提出一种基于分布式存储系统的数据归档方法、装置、计算机设备,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。
技术解决方案
本申请提出的技术方案是:一种基于分布式存储系统的数据归档方法,所述方法包括:扫描在分布式存储系统中的文件;判断扫描到的文件是否符合数据归档策略的归档条件;若所述扫描到的文件符合所述数据归档策略的归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;根据所述第一存储路径,生成关于存储路径的目录列表;读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
本申请还提供一种基于分布式存储系统的数据归档装置,所述装置包括:
扫描模块,用于扫描在分布式存储系统中的文件;
判断模块,用于判断扫描到的文件是否符合数据归档策略的归档条件;
记录模块,用于若所述扫描到的文件符合所述数据归档策略的归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;
生成模块,用于根据所述第一存储路径,生成关于存储路径的目录列表;
归档模块,用于读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
本申请还提供一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,所述处理器执行所述计算机程序时实现上述任一项所述的方法的步骤。
本申请还提供一种计算机非易失性可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述任一项所述的方法的步骤。
有益效果
根据上述的技术方案,本申请有益效果:扫描在分布式存储系统中的文件,若扫描到的文件符合数据归档策略的归档条件,将符合数据归档策略的归档条件的文件转移至归档存储器中储存,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。
附图说明
图1是应用本申请实施例提供的基于分布式存储系统的数据归档方法的流程图;
图2是应用本申请实施例提供的基于分布式存储系统的数据归档装置的功能模块图;
图3是应用本申请实施例提供的计算机设备的结构示意框图。
本发明的最佳实施方式
如图1所示,本申请实施例提出一种基于分布式存储系统的数据归档方法,所述方法包括以下步骤:
步骤S101、扫描在分布式存储系统中的文件。
对在分布式存储系统中的文件进行扫描,在本实施例中,定时扫描在分布式存储系统中的文件,按照设定的时间执行对在分布式存储系统中的文件进行扫描。
在一些实施例中,在步骤S101之前,包括:
接收对在分布式存储系统中的文件的归档指令。
在接收对在分布式存储系统中的文件的归档指令之后,开始扫描在分布式存储系统中的文件。也就是说,在接收到归档指令的情况下,才会开始执行扫描。
步骤S102、判断扫描到的文件是否符合数据归档策略的归档条件。
在扫描在分布式存储系统中的文件时,需要对扫描到的文件进行判断,判断扫描到的文件是否符合数据归档策略的归档条件。
在本实施例中,在步骤S102中,包括:
根据扫描到的文件,获取与数据归档策略的归档条件相应的文件信息;
根据文件信息,判断扫描到的文件是否符合数据归档策略的归档条件。
由于扫描到的文件可以获取很多的文件信息,为了提高判断效率,获取与数据归档策略的归档条件相应的文件信息,在获取文件信息之后,根据文件信息,判断扫描到的文件是否符合数据归档策略的归档条件。
在本实施例中,数据归档策略包括时间条件归档策略或/和目录条件归档策略,时间条件归档策略为在指定时间之前的文件符合归档条件,目录条件归档策略为指定目录下的文件符合归档条件。
步骤S103、若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径。
根据判断结果,可以获得扫描到的文件是否符合数据归档策略的归档条件,若扫描到的文件不符合数据归档策略的归档条件,则不需要进行归档操作,若扫描到的文件符合数据归档策略的归档条件,需要进行归档操作,则记录扫描到的文件的存储路径,获得第一存储路径。
步骤S104、根据所述第一存储路径,生成关于存储路径的目录列表。
在获得第一存储路径之后,根据第一存储路径生成目录列表,目录列表是关于存储路径的。通过读取目录列表,可以获得符合数据归档策略的归档条件的文件对应的存储路径。
步骤S105、读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
在生成目录列表之后,读取目录列表,获得第一存储路径,然后将第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。归档存储器是用于储存符合数据归档策略的归档条件的文件。
在本实施例中,在步骤S105中,包括:
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中。
读取目录列表,获得第一存储路径,根据目录列表,按照列表的顺序逐个将第一存储路径对应在分布式存储系统中的文件进行剪切,之后粘贴到归档存储器中,从而释放分布式存储系统的储存空间。
在一些实施例中,在步骤S105中,包括:
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
读取目录列表,获得第一存储路径,根据目录列表,按照列表的顺序逐个将第一存储路径对应在分布式存储系统中的文件进行复制,之后粘贴到归档存储器中,在完成复制之后,删除第一存储路径对应在分布式存储系统中的文件,从而释放分布式存储系统的储存空间。
在本实施例中,在步骤S105之后,包括:
接收到前端API访问文件的请求;
判断待访问的文件是否储存在分布式存储系统中;
若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
将第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存之后,记录从分布式存储系统转移至归档存储器的文件的转移记录,转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径。在完成记录转移记录之后,接收到前端API访问文件的请求,要先对待访问的文件所在位置进行判断,判断待访问的文件是否储存在分布式存储系统中,若待访问的文件是储存在分布式存储系统中,则允许请求。
上述的API的全称为Application Programming Interface,中文名为应用程序编程接口。
在本实施例中,在所述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
对应地,在判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
在完成回调之后,允许所述请求。
若待访问的文件不是储存在分布式存储系统中,则还需要再次进行判断,判断待访问的文件是否为从分布式存储系统转移至归档存储器的文件,若待访问的文件不是为从分布式存储系统转移至归档存储器的文件,则拒绝请求。若待访问的文件为从分布式存储系统转移至归档存储器的文件,获取待访问的文件在分布式存储系统中的存储路径,由于转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径,根据转移记录,查找待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径,在获得第二存储路径之后,将第二存储路径中的文件回调至其转移之前的位置,也就是回调至待访问的文件在分布式存储系统中的存储路径,在完成回调之后,允许请求,前端API从分布式存储系统中访问文件。
在所述在完成回调之后,允许所述请求的步骤之后,包括:
在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在前端API访问文件结束之后,为了释放分布式存储系统的储存空间,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在一些实施例中,在所述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
对应地,在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
在完成配置之后,允许所述请求。
若待访问的文件不是储存在分布式存储系统中,则还需要再次进行判断,判断待访问的文件是否为从分布式存储系统转移至归档存储器的文件,若待访问的文件不是为从分布式存储系统转移至归档存储器的文件,则拒绝请求。若待访问的文件为从分布式存储系统转移至归档存储器的文件,获取待访问的文件在分布式存储系统中的存储路径,由于转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径,根据转移记录,查找待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径,在获得第二存储路径之后,配置待访问的文件在分布式存储系统中的存储路径跳转至第二存储路径,也就是,将待访问的文件在分布式存储系统中的存储路径跳转至归档存储器的存储路径中,在完成配置之后,允许请求,前端API从归档存储器中访问文件。
综上所述,扫描在分布式存储系统中的文件,若扫描到的文件符合数据归档策略的归档条件,将符合数据归档策略的归档条件的文件转移至归档存储器中储存,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。
如图2所示,本申请实施例提出一种基于分布式存储系统的数据归档装置1,装置1包括扫描模块11、判断模块12、记录模块13、生成模块14和归档模块15。
扫描模块11,用于扫描在分布式存储系统中的文件。
对在分布式存储系统中的文件进行扫描,在本实施例中,定时扫描在分布式存储系统中的文件,按照设定的时间执行对在分布式存储系统中的文件进行扫描。
在一些实施例中,装置1包括:
接收模块,用于接收对在分布式存储系统中的文件的归档指令。
在接收对在分布式存储系统中的文件的归档指令之后,开始扫描在分布式存储系统中的文件。也就是说,在接收到归档指令的情况下,才会开始执行扫描。
判断模块12,用于判断扫描到的文件是否符合数据归档策略的归档条件。
在扫描在分布式存储系统中的文件时,需要对扫描到的文件进行判断,判断扫描到的文件是否符合数据归档策略的归档条件。
在本实施例中,判断模块12包括:
第一获取模块,用于根据扫描到的文件,获取与数据归档策略的归档条件相应的文件信息;
第一判断模块,用于根据文件信息,判断扫描到的文件是否符合数据归档策略的归档条件。
由于扫描到的文件可以获取很多的文件信息,为了提高判断效率,获取与数据归档策略的归档条件相应的文件信息,在获取文件信息之后,根据文件信息,判断扫描到的文件是否符合数据归档策略的归档条件。
在本实施例中,数据归档策略包括时间条件归档策略或/和目录条件归档策略,时间条件归档策略为在指定时间之前的文件符合归档条件,目录条件归档策略为指定目录下的文件符合归档条件。
记录模块13,用于若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径。
根据判断结果,可以获得扫描到的文件是否符合数据归档策略的归档条件,若扫描到的文件不符合数据归档策略的归档条件,则不需要进行归档操作,若扫描到的文件符合数据归档策略的归档条件,需要进行归档操作,则记录扫描到的文件的存储路径,获得第一存储路径。
生成模块14,用于根据所述第一存储路径,生成关于存储路径的目录列表。
在获得第一存储路径之后,根据第一存储路径生成目录列表,目录列表是关于存储路径的。通过读取目录列表,可以获得符合数据归档策略的归档条件的文件对应的存储路径。
归档模块15,用于读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
在生成目录列表之后,读取目录列表,获得第一存储路径,然后将第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。归档存储器是用于储存符合数据归档策略的归档条件的文件。
在本实施例中,归档模块15包括:
第一读取模块,用于读取所述目录列表;
第一归档模块,用于根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中。
读取目录列表,获得第一存储路径,根据目录列表,按照列表的顺序逐个将第一存储路径对应在分布式存储系统中的文件进行剪切,之后粘贴到归档存储器中,从而释放分布式存储系统的储存空间。
在一些实施例中,归档模块15包括:
第二读取模块,用于读取所述目录列表;
第二归档模块,用于根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
第一删除模块,用于在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
读取目录列表,获得第一存储路径,根据目录列表,按照列表的顺序逐个将第一存储路径对应在分布式存储系统中的文件进行复制,之后粘贴到归档存储器中,在完成复制之后,删除第一存储路径对应在分布式存储系统中的文件,从而释放分布式存储系统的储存空间。
在本实施例中,装置1包括:
第一接收模块,用于接收到前端API访问文件的请求;
第二判断模块,用于判断待访问的文件是否储存在分布式存储系统中;
第一允许模块,用于若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
将第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存之后,记录从分布式存储系统转移至归档存储器的文件的转移记录,转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径。在完成记录转移记录之后,接收到前端API访问文件的请求,要先对待访问的文件所在位置进行判断,判断待访问的文件是否储存在分布式存储系统中,若待访问的文件是储存在分布式存储系统中,则允许请求。
上述的API的全称为Application Programming Interface,中文名为应用程序编程接口。
在本实施例中,装置1包括:
第一记录模块,用于记录从分布式存储系统转移至归档存储器的文件的转移记录;
第三判断模块,用于若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
第二获取模块,用于若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
第一查找模块,用于根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
第一回调模块,用于将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
第二允许模块,用于在完成回调之后,允许所述请求。
若待访问的文件不是储存在分布式存储系统中,则还需要再次进行判断,判断待访问的文件是否为从分布式存储系统转移至归档存储器的文件,若待访问的文件不是为从分布式存储系统转移至归档存储器的文件,则拒绝请求。若待访问的文件为从分布式存储系统转移至归档存储器的文件,获取待访问的文件在分布式存储系统中的存储路径,由于转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径,根据转移记录,查找待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径,在获得第二存储路径之后,将第二存储路径中的文件回调至其转移之前的位置,也就是回调至待访问的文件在分布式存储系统中的存储路径,在完成回调之后,允许请求,前端API从分布式存储系统中访问文件。
装置1包括:
第三归档模块,用于在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在前端API访问文件结束之后,为了释放分布式存储系统的储存空间,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在一些实施例中,装置1包括:
第二记录模块,用于记录从分布式存储系统转移至归档存储器的文件的转移记录;
第四判断模块,用于若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
第三获取模块,用于若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
第二查找模块,用于根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
第一配置模块,用于配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
第三允许模块,用于在完成配置之后,允许所述请求。
若待访问的文件不是储存在分布式存储系统中,则还需要再次进行判断,判断待访问的文件是否为从分布式存储系统转移至归档存储器的文件,若待访问的文件不是为从分布式存储系统转移至归档存储器的文件,则拒绝请求。若待访问的文件为从分布式存储系统转移至归档存储器的文件,获取待访问的文件在分布式存储系统中的存储路径,由于转移记录包括转移文件、转移文件在转移之前在分布式存储系统的存储路径、转移文件在转移之后在归档存储器的存储路径,根据转移记录,查找待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径,在获得第二存储路径之后,配置待访问的文件在分布式存储系统中的存储路径跳转至第二存储路径,也就是,将待访问的文件在分布式存储系统中的存储路径跳转至归档存储器的存储路径中,在完成配置之后,允许请求,前端API从归档存储器中访问文件。
综上所述,扫描在分布式存储系统中的文件,若扫描到的文件符合数据归档策略的归档条件,将符合数据归档策略的归档条件的文件转移至归档存储器中储存,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。
如图3所示,本申请实施例中还提供一种计算机设备,该计算机设备可以是服务器,其内部结构可以如图3所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口和数据库。其中,该计算机设计的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储基于分布式存储系统的数据归档方法的模型等数据。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种基于分布式存储系统的数据归档方法。
上述处理器执行上述基于分布式存储系统的数据归档方法的步骤:扫描在分布式存储系统中的文件;判断扫描到的文件是否符合数据归档策略的归档条件;若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;根据所述第一存储路径,生成关于存储路径的目录列表;读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
在一个实施例中,上述读取所述文件列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤之后,包括:
接收到前端API访问文件的请求;
判断待访问的文件是否储存在分布式存储系统中;
若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
在一个实施例中,上述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
在完成回调之后,允许所述请求。
在一个实施例中,上述在完成回调之后,允许所述请求的步骤之后,包括:
在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在一个实施例中,上述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
在完成配置之后,允许所述请求。
在一个实施例中,上述读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤中,包括:
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中;或者
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
在一个实施例中,上述数据归档策略包括时间条件归档策略或/和目录条件归档策略,所述时间条件归档策略为在指定时间之前的文件符合归档条件,所述目录条件归档策略为指定目录下的文件符合归档条件。
本申请实施例的计算机设备,扫描在分布式存储系统中的文件,若扫描到的文件符合数据归档策略的归档条件,将符合数据归档策略的归档条件的文件转移至归档存储器中储存,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。
本申请一实施例还提供一种计算机非易失性可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现一种基于分布式存储系统的数据归档方法,具体为:扫描在分布式存储系统中的文件;判断扫描到的文件是否符合数据归档策略的归档条件;若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;根据所述第一存储路径,生成关于存储路径的目录列表;读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
在一个实施例中,上述读取所述文件列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤之后,包括:
接收到前端API访问文件的请求;
判断待访问的文件是否储存在分布式存储系统中;
若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
在一个实施例中,上述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
在完成回调之后,允许所述请求。
在一个实施例中,上述在完成回调之后,允许所述请求的步骤之后,包括:
在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
在一个实施例中,上述接收到前端API访问文件的请求的步骤之前,包括:
记录从分布式存储系统转移至归档存储器的文件的转移记录;
在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
在完成配置之后,允许所述请求。
在一个实施例中,上述读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤中,包括:
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中;或者
读取所述目录列表;
根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
在一个实施例中,上述数据归档策略包括时间条件归档策略或/和目录条件归档策略,所述时间条件归档策略为在指定时间之前的文件符合归档条件,所述目录条件归档策略为指定目录下的文件符合归档条件。
本申请实施例的存储介质,扫描在分布式存储系统中的文件,若扫描到的文件符合数据归档策略的归档条件,将符合数据归档策略的归档条件的文件转移至归档存储器中储存,旨在解决现有的分布式存储系统的数据归档,需要人工参与,导致人力资源浪费的问题。

Claims (20)

  1. 一种基于分布式存储系统的数据归档方法,其特征在于,所述方法包括:
    扫描在分布式存储系统中的文件;
    判断扫描到的文件是否符合数据归档策略的归档条件;
    若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;
    根据所述第一存储路径,生成关于存储路径的目录列表;
    读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
  2. 根据权利要求1所述的基于分布式存储系统的数据归档方法,其特征在于,在所述读取所述文件列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤之后,包括:
    接收到前端API访问文件的请求;
    判断待访问的文件是否储存在分布式存储系统中;
    若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
  3. 根据权利要求2所述的基于分布式存储系统的数据归档方法,其特征在于,在所述接收到前端API访问文件的请求的步骤之前,包括:
    记录从分布式存储系统转移至归档存储器的文件的转移记录;
    在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
    若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
    若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
    根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
    将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
    在完成回调之后,允许所述请求。
  4. 根据权利要求3所述的基于分布式存储系统的数据归档方法,其特征在于,在所述在完成回调之后,允许所述请求的步骤之后,包括:
    在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
  5. 根据权利要求2所述的基于分布式存储系统的数据归档方法,其特征在于,在所述接收到前端API访问文件的请求的步骤之前,包括:
    记录从分布式存储系统转移至归档存储器的文件的转移记录;
    在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
    若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
    若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
    根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
    配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
    在完成配置之后,允许所述请求。
  6. 根据权利要求1所述的基于分布式存储系统的数据归档方法,其特征在于,在所述读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤中,包括:
    读取所述目录列表;
    根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中;或者
    读取所述目录列表;
    根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
    在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
  7. 根据权利要求1所述的基于分布式存储系统的数据归档方法,其特征在于,所述数据归档策略包括时间条件归档策略或/和目录条件归档策略,所述时间条件归档策略为在指定时间之前的文件符合归档条件,所述目录条件归档策略为指定目录下的文件符合归档条件。
  8. 一种基于分布式存储系统的数据归档装置,其特征在于,所述装置包括:
    扫描模块,用于扫描在分布式存储系统中的文件;
    判断模块,用于判断扫描到的文件是否符合数据归档策略的归档条件;
    记录模块,用于若所述扫描到的文件符合所述数据归档策略的归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;
    生成模块,用于根据所述第一存储路径,生成关于存储路径的目录列表;
    归档模块,用于读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
  9. 根据权利要求8所述的基于分布式存储系统的数据归档装置,其特征在于,所述装置包括:
    第一接收模块,用于接收到前端API访问文件的请求;
    第二判断模块,用于判断待访问的文件是否储存在分布式存储系统中;
    第一允许模块,用于若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
  10. 根据权利要求9所述的基于分布式存储系统的数据归档装置,其特征在于,所述装置包括:
    第一记录模块,用于记录从分布式存储系统转移至归档存储器的文件的转移记录;
    第三判断模块,用于若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
    第二获取模块,用于若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
    第一查找模块,用于根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
    第一回调模块,用于将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
    第二允许模块,用于在完成回调之后,允许所述请求。
  11. 根据权利要求10所述的基于分布式存储系统的数据归档装置,其特征在于,所述装置包括:
    第三归档模块,用于在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
  12. 根据权利要求9所述的基于分布式存储系统的数据归档装置,其特征在于,所述装置包括:
    第二记录模块,用于记录从分布式存储系统转移至归档存储器的文件的转移记录;
    第四判断模块,用于若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
    第三获取模块,用于若待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
    第二查找模块,用于根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
    第一配置模块,用于配置所述待访问的文件在分布式存储系统中的存储路径跳转至所述第二存储路径;
    第三允许模块,用于在完成配置之后,允许所述请求。
  13. 根据权利要求8所述的基于分布式存储系统的数据归档装置,其特征在于,所述归档模块包括:
    第一读取模块,用于读取所述目录列表;
    第一归档模块,用于根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件剪切到归档存储器中;或者
    第二读取模块,用于读取所述目录列表;
    第二归档模块,用于根据所述目录列表,逐个将所述第一存储路径对应在分布式存储系统中的文件复制到归档存储器中;
    在完成复制之后,删除所述第一存储路径对应在分布式存储系统中的文件。
  14. 根据权利要求8所述的基于分布式存储系统的数据归档装置,其特征在于,所述数据归档策略包括时间条件归档策略或/和目录条件归档策略,所述时间条件归档策略为在指定时间之前的文件符合归档条件,所述目录条件归档策略为指定目录下的文件符合归档条件。
  15. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现基于分布式存储系统的数据归档方法,所述方法包括:
    扫描在分布式存储系统中的文件;
    判断扫描到的文件是否符合数据归档策略的归档条件;
    若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;
    根据所述第一存储路径,生成关于存储路径的目录列表;
    读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
  16. 根据权利要求15所述的计算机设备,其特征在于,在所述读取所述文件列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤之后,包括:
    接收到前端API访问文件的请求;
    判断待访问的文件是否储存在分布式存储系统中;
    若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
  17. 根据权利要求16所述的计算机设备,其特征在于,在所述接收到前端API访问文件的请求的步骤之前,包括:
    记录从分布式存储系统转移至归档存储器的文件的转移记录;
    在所述判断待访问的文件是否储存在分布式存储系统中的步骤之后,包括:
    若所述待访问的文件不是储存在分布式存储系统中,则判断所述待访问的文件是否为从分布式存储系统转移至归档存储器的文件;
    若所述待访问的文件为从分布式存储系统转移至归档存储器的文件,则获取所述待访问的文件在分布式存储系统中的存储路径;
    根据所述转移记录,查找所述待访问的文件在分布式存储系统中的存储路径对应在归档存储器中的存储路径,获得第二存储路径;
    将所述第二存储路径中的文件回调至所述待访问的文件在分布式存储系统中的存储路径;
    在完成回调之后,允许所述请求。
  18. 根据权利要求17所述的计算机设备,其特征在于,在所述在完成回调之后,允许所述请求的步骤之后,包括:
    在所述前端API访问文件结束之后,将已回调在分布式存储系统中的文件再次转移至归档存储器中储存。
  19. 一种计算机非易失性可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现基于分布式存储系统的数据归档方法,所述方法包括:
    扫描在分布式存储系统中的文件;
    判断扫描到的文件是否符合数据归档策略的归档条件;
    若所述扫描到的文件符合所述归档条件,则记录所述扫描到的文件的存储路径,获得第一存储路径;
    根据所述第一存储路径,生成关于存储路径的目录列表;
    读取所述目录列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存。
  20. 根据权利要求19所述的计算机非易失性可读存储介质,其特征在于,在所述读取所述文件列表,将所述第一存储路径对应在分布式存储系统中的文件转移至归档存储器中储存的步骤之后,包括:
    接收到前端API访问文件的请求;
    判断待访问的文件是否储存在分布式存储系统中;
    若所述待访问的文件是储存在分布式存储系统中,则允许所述请求。
PCT/CN2018/124395 2018-10-11 2018-12-27 基于分布式存储系统的数据归档方法、装置、计算机设备 Ceased WO2020073517A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811185739.9A CN109542858A (zh) 2018-10-11 2018-10-11 基于分布式存储系统的数据归档方法、装置、计算机设备
CN201811185739.9 2018-10-11

Publications (1)

Publication Number Publication Date
WO2020073517A1 true WO2020073517A1 (zh) 2020-04-16

Family

ID=65843648

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124395 Ceased WO2020073517A1 (zh) 2018-10-11 2018-12-27 基于分布式存储系统的数据归档方法、装置、计算机设备

Country Status (2)

Country Link
CN (1) CN109542858A (zh)
WO (1) WO2020073517A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120785901A (zh) * 2025-07-16 2025-10-14 厦门链友融人工智能应用科技有限公司 一种跨平台共享数据同步优化系统

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110457255B (zh) * 2019-07-05 2023-11-21 中国平安人寿保险股份有限公司 数据归档的方法、服务器及计算机可读存储介质
CN111614730B (zh) * 2020-04-28 2022-07-19 北京金山云网络技术有限公司 云存储系统的文件处理方法、装置及电子设备
CN114064566B (zh) * 2021-10-20 2025-05-30 郑州云海信息技术有限公司 一种文件归档方法、系统、存储介质及设备
CN114780514A (zh) * 2022-03-31 2022-07-22 工银科技有限公司 版本合并中合并数据库脚本的方法、装置、设备及介质
CN116737663A (zh) * 2023-06-29 2023-09-12 中国银行股份有限公司 一种文件归档方法、装置、设备及可读存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103294794A (zh) * 2013-05-23 2013-09-11 上海爱数软件有限公司 一种在线归档和访问文件的系统
CN103593351A (zh) * 2012-08-15 2014-02-19 中国银联股份有限公司 一种电子文件归档方法和系统
CN104199926A (zh) * 2014-09-01 2014-12-10 北京联创信安科技有限公司 文件归档实现方法和装置以及文件访问方法和装置
CN104572751A (zh) * 2013-10-24 2015-04-29 携程计算机技术(上海)有限公司 呼叫中心录音文件的压缩存储方法及系统

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103036956B (zh) * 2012-11-30 2016-03-30 航天恒星科技有限公司 一种分布式组态化海量数据归档系统及实现方法
US10198445B2 (en) * 2014-06-30 2019-02-05 Google Llc Automated archiving of user generated media files
CN106648967A (zh) * 2016-10-14 2017-05-10 曙光信息产业(北京)有限公司 一种扫描文件的方法和系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103593351A (zh) * 2012-08-15 2014-02-19 中国银联股份有限公司 一种电子文件归档方法和系统
CN103294794A (zh) * 2013-05-23 2013-09-11 上海爱数软件有限公司 一种在线归档和访问文件的系统
CN104572751A (zh) * 2013-10-24 2015-04-29 携程计算机技术(上海)有限公司 呼叫中心录音文件的压缩存储方法及系统
CN104199926A (zh) * 2014-09-01 2014-12-10 北京联创信安科技有限公司 文件归档实现方法和装置以及文件访问方法和装置

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN120785901A (zh) * 2025-07-16 2025-10-14 厦门链友融人工智能应用科技有限公司 一种跨平台共享数据同步优化系统

Also Published As

Publication number Publication date
CN109542858A (zh) 2019-03-29

Similar Documents

Publication Publication Date Title
WO2020073517A1 (zh) 基于分布式存储系统的数据归档方法、装置、计算机设备
CN110502507B (zh) 一种分布式数据库的管理系统、方法、设备和存储介质
CN108460045B (zh) 一种快照的处理方法及分布式块存储系统
CN104618482B (zh) 访问云数据的方法、服务器、传统存储设备、系统
CN111881116A (zh) 数据迁移方法、数据迁移系统、计算机系统和存储介质
CN107689976B (zh) 一种文件传输方法及装置
CN112395264B (zh) 分布式存储系统中逻辑目标与卷之间映射的处理方法
CN106302609B (zh) 一种访问方法及装置
US10620871B1 (en) Storage scheme for a distributed storage system
CN102073739A (zh) 带有快照功能的分布式文件系统中的数据读与数据写方法
CN110471906A (zh) 数据库切换方法、装置及设备
US20070288835A1 (en) Apparatus, computer readable medium, data signal, and method for document management
WO2021128892A1 (zh) 一种批量创建文件的方法、装置、设备及存储介质
US20170286442A1 (en) File system support for file-level ghosting
US20230101774A1 (en) Techniques for performing clipboard-to-file paste operations
WO2021098260A1 (zh) 一种数据删除方法、系统、设备及计算机可读存储介质
CN103197987A (zh) 一种数据备份的方法、数据恢复的方法及系统
CN112162949B (zh) 一种文件管理方法、系统、电子设备及存储介质
CN114138558A (zh) 一种对象存储方法、装置、电子设备和存储介质
CN114564442B (zh) 内存映射在超大文件中保存海量碎片文件的方法及介质
US7974953B1 (en) System and method for deletion of writeable PPIS
US20160062841A1 (en) Database and data accessing method thereof
CN113704087B (zh) 一种跨域传输设备的文件业务测试方法、装置及电子设备
WO2023077283A1 (zh) 文件管理方法、装置及电子设备
CN110209343B (zh) 数据存储方法、装置、服务器及存储介质

Legal Events

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

Ref document number: 18936513

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: 18936513

Country of ref document: EP

Kind code of ref document: A1