WO2024082773A1 - 一种迁移文件系统的方法和相关设备 - Google Patents

一种迁移文件系统的方法和相关设备 Download PDF

Info

Publication number
WO2024082773A1
WO2024082773A1 PCT/CN2023/110766 CN2023110766W WO2024082773A1 WO 2024082773 A1 WO2024082773 A1 WO 2024082773A1 CN 2023110766 W CN2023110766 W CN 2023110766W WO 2024082773 A1 WO2024082773 A1 WO 2024082773A1
Authority
WO
WIPO (PCT)
Prior art keywords
storage device
information
data
request information
source
Prior art date
Application number
PCT/CN2023/110766
Other languages
English (en)
French (fr)
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 华为技术有限公司
Publication of WO2024082773A1 publication Critical patent/WO2024082773A1/zh

Links

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/11File system administration, e.g. details of archiving or snapshots
    • 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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • 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/17Details of further file system functions
    • G06F16/176Support for shared access to files; File sharing support
    • 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/182Distributed file systems
    • 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

Definitions

  • Embodiments of the present application relate to the field of memory, and more specifically, to a method for migrating a file system, a storage device, a storage equipment, a chip system, and a storage medium.
  • NAS network attached storage
  • NAS technology can separate storage devices from servers, allowing storage devices to be used for centralized data management and allowing servers to access data in storage devices through network connections, thereby reducing storage costs.
  • NAS storage devices include a large amount of data, which can be provided to servers for access in the form of file systems.
  • NAS storage devices cannot meet current storage needs or the purpose of NAS storage devices needs to be readjusted, the file system in the NAS storage device needs to be migrated. Migrating the file system in a NAS storage device takes a lot of time and interrupts the user's computing device's access to the file system in the NAS storage device, causing inconvenience to the user.
  • the file system in the NAS storage device can be migrated through a migration tool (such as a migration server or migration software).
  • the migration tool can connect the source storage device and the target storage device, so that the file system in the source storage device can be read out and written into the target storage device.
  • it is necessary to scan the file system in the source storage device and the target storage device multiple times, so as to determine the new data written by the computing device during each migration of the file system, that is, the incremental data, and then write the incremental data into the target storage device.
  • the source storage device can provide the computing device with a source file system shared based on multiple different protocols so that the computing device can access the files in the source file system, and the source storage device also stores metadata or attributes based on different protocols. Therefore, when migrating the source file system shared based on different protocols, it is necessary to use multiple tools supporting different protocols to scan the file system in the source storage device multiple times, so that the files, metadata and attributes in the source storage device can be completely migrated to the target storage system. Therefore, this method requires technical support from multiple different migration tools, resulting in a more complicated process of migrating the file system and a higher migration cost.
  • the embodiments of the present application provide a method, storage device, storage equipment, chip system and storage medium for migrating a file system, which can directly implement the migration of the file system through a target storage device without using multiple migration tools supporting different protocols, thereby reducing the cost of migrating the file system.
  • a method for migrating a file system includes: a target storage device sends first request information and second request information to a source storage device; the target storage device receives first response information and second response information from the source storage device; the target storage device decodes the first response information according to a first sharing protocol, obtains and stores first data; the target storage device decodes the second response information according to a second sharing protocol, obtains and stores second data.
  • the first request information is information encoded according to the first sharing protocol, and the first request information is used to obtain the first data in the source storage device.
  • the second request information is information encoded according to the second sharing protocol, and the second request information is used to obtain the second data in the source storage device.
  • the first sharing protocol and the second sharing protocol are different protocols among multiple sharing protocols. Any sharing protocol among the multiple sharing protocols is used to access the data in the source storage device.
  • the first response information is information encoded according to the first sharing protocol, and the second response information is information encoded according to the second sharing protocol.
  • the first response information includes the first data, and the second response information includes the second data.
  • the target storage device can migrate data in the source storage device based on a plurality of different protocols. Therefore, in the process of migrating the source file system in the source storage device, it is not necessary to use a plurality of migration tools supporting different protocols, thereby effectively Reduce the cost of migrating the file system.
  • the embodiment of the present application can also avoid the problem that when the source file system supports multiple protocols at the same time, the metadata based on other protocols in the source file system cannot be migrated using only a migration tool that supports one protocol, thereby ensuring that the data, metadata, and attributes in the source file system are completely migrated to the target file system.
  • the target storage device can also directly decode and store the first data and the second data after obtaining the first response information and the second response information from the source storage device, that is, the first data and the second data can be migrated in parallel, thereby shortening the time to migrate the source file system.
  • the multiple sharing protocols include multiple ones of the network file system protocol NFS, the service information block protocol SMB, or the simple storage service protocol S3.
  • the target storage device can support multiple different protocols, so that the source file system in the source storage device can be migrated according to multiple different protocols without using additional migration tools that support different protocols, thereby reducing the cost of migrating the file system.
  • the target storage device determines multiple migration tasks based on structural information of the source file system in the source storage device; the target storage device determines first request information based on the first migration task; and the target storage device determines second request information based on the second migration task.
  • Each of the multiple migration tasks is used to migrate some files in the source file system to the target storage device.
  • the first migration task is any one of the multiple migration tasks, and the first migration task is used to migrate the first data to the target storage device.
  • the second migration task is a task different from the first migration task among the multiple migration tasks, and the second migration task is used to migrate the second data to the target storage device.
  • the target storage device can determine multiple files or data to be migrated, namely, first data and second data, based on the structural information of the source file system, thereby determining multiple migration tasks.
  • the target storage device can also determine corresponding request information based on the files or data to be migrated in each migration task, thereby completing the migration task.
  • the target storage device receives third request information from the computing device; and the target storage device sends third response information to the computing device based on the third request information.
  • the third request information is request information encoded according to the third sharing protocol, and the third request information is used to obtain or update third data, and the third data belongs to the target storage device and/or the source storage device.
  • the third sharing protocol is any one of multiple sharing protocols.
  • the third response information is request information encoded according to the third sharing protocol, and the third response information includes the third data or update information of the third data.
  • the target storage device can receive access requests from the computing device and respond to the access requests of the computing device while migrating the source file system. That is, the target storage device can continuously provide online storage services for the computing device and can migrate the source file system in the background, thereby satisfying the migration and storage needs of the user at the same time.
  • the target storage device when the third request information is used to update third data, decodes the third request information according to the third sharing protocol to determine the decoded third request information; when the third data exists in the target storage device, the target storage device updates the third data according to the decoded third request information; when the third data does not exist in the target storage device, the target storage device sets the priority of the third migration task to high, and the third migration task is used to migrate the third data to the target storage device.
  • the target storage device can determine whether the third data exists in the target storage device when receiving the update request from the computing device.
  • the target storage device can also prioritize the migration of the third data when the third data does not exist in the target storage device, thereby facilitating the subsequent reading or updating of the third data, thereby shortening the time to respond to the request of the computing device.
  • the target storage device records the decoded third request information; after completing the third migration task, the target storage device updates the third data in the target storage device according to the recorded decoded third request information.
  • the target storage device can record the third request information and, after completing the third migration task, that is, after the third data exists in the target storage device, synchronously update the third data in the source storage device and the target storage device, thereby ensuring the consistency of files or data in the source storage device and the target storage device.
  • the target storage device sends third request information to the source storage device; the target storage device receives fourth response information from the source storage device; the target storage device decodes the fourth response information according to the third sharing protocol and determines the decoded fourth response information; the target storage device sends third response information to the computing device based on the decoded fourth response information.
  • the fourth response information is response information encoded according to the third sharing protocol, and the fourth response information includes the third data or source storage Update information of the third data in the device.
  • the target storage device can obtain response information from the source storage device after the source storage device reads or updates the third data, thereby determining the third data in the source storage device or the update status of the third data.
  • the target storage device can also send third response information to the computing device based on the third data in the source storage device or the update status of the third data, so that the computing device can obtain the third data or the update status of the third data in the source storage device and/or the target storage device.
  • the target storage device determines permission information of the target file system in the target storage device based on permission information of the source file system in the source storage device, and the permission information of the target file system is the same as the permission information in the source file system.
  • the target file system can retain the permission information of the source file system, thereby protecting the security of files or data in the source file system and/or the target file system, thereby making it less prone to errors when the computing device accesses the target file system.
  • a method for migrating a file system includes: a source storage device receives first request information and second request information from a target storage device; the source storage device determines first response information according to the first request information; the source storage device determines second response information according to the second request information; and the source storage device sends the first response information and the second response information to the target storage device.
  • the first request information is information encoded according to the first sharing protocol, and the first request information is used to obtain the first data in the source storage device.
  • the second request information is information encoded according to the second sharing protocol, and the second request information is used to obtain the second data in the source storage device.
  • the first sharing protocol and the second sharing protocol are different protocols among multiple sharing protocols. Any sharing protocol among the multiple sharing protocols is used to access the data in the source storage device.
  • the first response information is information encoded according to the first sharing protocol, and the second response information is information encoded according to the second sharing protocol.
  • the first response information includes the first data, and the second response information includes the second data.
  • the target storage device can migrate the data in the source storage device based on a variety of different protocols. Therefore, in the process of migrating the source file system in the source storage device, there is no need to use multiple migration tools that support different protocols, thereby effectively reducing the cost of migrating the file system.
  • the embodiment of the present application can also avoid the problem that when the source file system supports multiple protocols at the same time, only using a migration tool that supports one protocol cannot migrate metadata based on other protocols in the source file system, thereby ensuring that the data, metadata, attributes, etc. in the source file system are completely migrated to the target file system.
  • the target storage device can also directly obtain the first response information and the second response information from the source storage device without forwarding through the migration tool, thereby reducing the number of times the migration tool encodes and decodes the first response information and the second response information, and shortening the time to migrate the source file system.
  • the multiple sharing protocols include multiple ones of the network file system protocol NFS, the service information block protocol SMB, or the simple storage service protocol S3.
  • the target storage device and the source storage device can support multiple different protocols, so that the target storage device can migrate the source file system in the source storage device according to the multiple different protocols without using additional migration tools that support different protocols, thereby reducing the cost of migrating the file system.
  • the source storage device decodes the first request information according to the first sharing protocol to determine the decoded first request information, and the decoded first request information is used to obtain the first data; the source storage device determines the first data according to the decoded first request information; the source storage device encodes the first data according to the first sharing protocol to determine the first response information.
  • the target storage device can access the data in the source storage device based on the first sharing protocol, so that the data shared in the source storage device based on the first sharing protocol can be migrated to the target storage device.
  • the target storage device can also access the data in the source storage device based on the second sharing protocol, so that the data shared in the source storage device based on the second sharing protocol can be migrated to the target storage device. That is, in an embodiment of the present application, when the source storage device shares data based on multiple sharing protocols, the complete migration of data in the source storage device can be achieved.
  • the source storage device receives third request information from the target storage device; the source storage device determines third data or update information of the third data based on the third request information; the source storage device encodes the third data or the update information of the third data based on the third sharing protocol and determines fourth response information; and the source storage device sends the fourth response information to the target storage device.
  • the third request information is request information encoded according to the third sharing protocol, and the third request information is used to obtain or update the third data.
  • the third data belongs to the source storage device.
  • the third sharing protocol is any one of the multiple sharing protocols.
  • the fourth response information includes the third data or update information of the third data.
  • the source storage device may send a response message to the target storage device.
  • the target storage device can determine the third data or the update status of the third data in the source storage device, and then provide feedback to the computing device.
  • the source storage device sends configuration information to the target storage device, the configuration information is configuration information of the source file system in the source storage device, and the configuration information includes structural information and/or permission information of the source file system.
  • the source storage device can send the structure information of the source file system to the target storage device, so that the target storage device can reasonably use the structure information to determine at least one migration task, thereby shortening the migration time.
  • the source storage device can also send the permission information of the source file system to the target storage device, so that the target storage device can retain the permission information of the source file system, and further can include the security of the source file system.
  • an embodiment of the present application provides a storage device, which includes a unit for implementing the first aspect or any possible implementation of the first aspect, or the storage device includes a unit for implementing the second aspect or any possible implementation of the second aspect.
  • an embodiment of the present application provides a storage device, which includes a processor, which is used to couple with a memory, read and execute instructions and/or program codes in the memory to execute the first aspect or any possible implementation of the first aspect, or to execute the second aspect or any possible implementation of the second aspect.
  • an embodiment of the present application provides a chip system, which includes a logic circuit, which is used to couple with an input/output interface and transmit data through the input/output interface to execute the first aspect or any possible implementation of the first aspect, or to execute the second aspect or any possible implementation of the second aspect.
  • an embodiment of the present application provides a storage medium storing a program code.
  • the storage medium runs on a storage device, the storage device executes the first aspect or any possible implementation of the first aspect, or the storage device executes the second aspect or any possible implementation of the second aspect.
  • an embodiment of the present application provides a program product, which includes: a program code, which, when running on a storage device, enables the storage device to execute the first aspect or any possible implementation of the first aspect, or enables the storage device to execute the second aspect or any possible implementation of the second aspect.
  • an embodiment of the present application provides a migration system, which includes: a target storage device such as the first aspect or any possible implementation of the first aspect, and a source storage device such as the second aspect or any possible implementation of the second aspect.
  • FIG. 1 is a schematic system architecture diagram of a file system migration system 100 .
  • FIG. 2 is a schematic structural diagram of a storage device 200 according to an embodiment of the present application.
  • FIG3 is a schematic flow chart of a method for migrating a file system according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of executing multiple migration tasks in parallel according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a method for migrating a file system according to another embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of a storage device 600 according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of a storage device 700 according to an embodiment of the present application.
  • the technical solution of the embodiment of the present application can migrate the file system in the storage device supporting various protocols.
  • the file system in the storage device supporting the network file system (NFS) can be migrated, or the file system in the storage device supporting the server message block (SMB) can be migrated, or the file system in the storage device supporting the simple storage service protocol (S3) can be migrated, or the file system in the storage device supporting other private protocols can be migrated, etc.
  • the embodiment of the present application is not limited to this.
  • the technical solution of the embodiment of the present application can migrate file systems in various types of source storage devices.
  • the source storage device can be a storage device of a different product type from the target storage device, or the source storage device can be a storage device of the same product type as the target storage device.
  • the embodiment of the present application is not limited to this.
  • the source storage device in the embodiment of the present application may be a physical storage server, or may be a cloud storage server in the cloud, etc.
  • the application embodiment does not limit this.
  • the target storage device in the embodiment of the present application can be various types of storage devices, such as a physical storage server, or a cloud storage server in the cloud, etc., and the embodiment of the present application does not limit this.
  • the target storage device in the embodiment of the present application can be physically connected to the source storage device, or can be remotely connected through a network, etc., and the embodiment of the present application does not limit this.
  • Fig. 1 is a schematic system architecture diagram of a file system migration system 100.
  • Fig. 1 includes a target storage device 110, a source storage device 120 and a computing device 130.
  • the system 100 may include multiple source storage devices 120 and/or multiple computing devices 130, that is, the target storage device 110 may migrate the file system of each source storage device 120 in one or more source storage devices 120, and the target storage device 110 may also be connected to one or more computing devices 130.
  • the target storage device 110 may migrate the file system of each source storage device 120 in one or more source storage devices 120, and the target storage device 110 may also be connected to one or more computing devices 130. The following description is made by taking the system 100 including one source storage device 120 and one computing device 130 as an example.
  • the target storage device 110 can be connected to the source storage device 120, so that the source file system in the source storage device 120 can be migrated.
  • the target storage device 110 can establish a connection with the source storage device 120, and can obtain the configuration information of the source file system in the source storage device 120.
  • the configuration information may include the structural information of the source file system, and the configuration information may also include at least one of the following: permission information, user information, or sharing information of the source file system.
  • the target storage device 110 may also create a target file system in the target storage device 110 according to the configuration information of the source file system.
  • the configuration information of the target file system is the same as the configuration information of the source file system.
  • the target storage device 110 may also start to migrate the source file system in the source storage device 120 after creating the target file system.
  • the target storage device 110 may determine at least one migration task according to the structural information of the source file system. Each migration task in the at least one migration task is used to migrate part of the files in the source file system to the target storage device 110.
  • the target storage device 110 may also execute one or more migration tasks in the at least one migration task in parallel.
  • the target storage device 110 may also determine a first sharing protocol and a second sharing protocol from among multiple sharing protocols, wherein the first sharing protocol is any one of the multiple sharing protocols, and the second sharing protocol is a sharing protocol different from the first sharing protocol from among the multiple sharing protocols.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols. Any one of the multiple sharing protocols is used to access data in the source storage device.
  • the private protocol may be a protocol defined by the user.
  • the target storage device 110 may determine the first sharing protocol based on the first migration task.
  • the first migration task is any one of the at least one migration task, and the first migration task is used to migrate the first data in the source file system to the target storage device.
  • the first data is data shared by the source storage device 120 based on the first sharing protocol.
  • the target storage device 110 may determine the second sharing protocol based on the second migration task.
  • the second migration task is a migration task different from the first migration task from among the at least one migration task, and the second migration task is used to migrate the second data in the source file system to the target storage device.
  • the second data is data shared by the source storage device 120 based on the second sharing protocol.
  • the target storage device 110 may also determine first request information according to the first sharing protocol, wherein the first request information is request information encoded according to the first sharing protocol, that is, the specific format of the first request information is the same as the information format specified by the first sharing protocol. The first request information is used to obtain the first data in the source storage device 120.
  • the target storage device 110 may also determine second request information according to the second sharing protocol, wherein the second request information is request information encoded according to the second sharing protocol, that is, the specific format of the second request information is the same as the information format specified by the second sharing protocol. The second request information is used to obtain the second data in the source storage device 120.
  • the target storage device 110 may also send the first request information and the second request information to the source storage device 120.
  • the target storage device 110 may also receive first response information and second response information from the source storage device 120.
  • the first response information is response information encoded according to the first sharing protocol, and the first response information includes the first data.
  • the second response information is response information encoded according to the second sharing protocol, and the second response information includes the second data.
  • the target storage device 110 may also decode the first response information according to the first sharing protocol, thereby obtaining and storing the first data.
  • the target storage device 110 may also decode the second response information according to the second sharing protocol, thereby obtaining and storing the second data.
  • the target storage device 110 can also be connected to the computing device 130, so that the third request information from the computing device 130 can be received online.
  • the third request information is request information encoded according to the third sharing protocol, that is, the format of the third request information is the same as the format specified by the third sharing protocol.
  • the third sharing protocol is any one of the multiple sharing protocols.
  • the third sharing protocol can be the same as the first sharing protocol and/or the second sharing protocol, or it can be different.
  • the embodiment of the present application does not limit this.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols.
  • the private protocol can be a user-defined protocol.
  • the third request information is used to obtain or update third data, and the third data belongs to the target storage device 110 and/or the source storage device 120, that is, the third data is the data in the target storage device 110 and/or the source storage device 120.
  • the target storage device 110 can perform migration. While completing the task, the target storage device 110 receives the user's access or update request, thereby continuously providing storage services for the user.
  • the target storage device 110 may send a first indication message to the source storage device 120, and the first indication message is used to indicate that the source storage device 120 is disconnected from the computing device 130.
  • the first indication message may also include the network address of the target storage device 110.
  • the target storage device 110 may establish a connection with the computing device 130 after the computing device 130 is disconnected from the source storage device 120. After establishing a connection with the computing device 130, the target storage device 110 may receive a third request message from the computing device 130. After receiving the third request message, the target storage device 110 may decode the third request message according to the third sharing protocol to determine the decoded third request message. The decoded third request message is used to obtain or update the third data.
  • the target storage device 110 can determine whether the third data exists in the target storage device 110, that is, determine whether the third data has been migrated from the source file system to the target file system. If the third data exists in the target storage device 110, the target storage device 110 can update the third data according to the decoded third request information. If the third data does not exist in the target storage device 110, the target storage device 110 can set the priority of the third migration task to high, that is, the target storage device 110 can preferentially execute the third migration task.
  • the third migration task is a migration task to which the third data belongs, that is, the third migration task is used to migrate the third data in the source storage device to the target storage device.
  • the target storage device 110 can also record the third request information or the decoded third request information. The target storage device 110 can also update the third data according to the recorded third request information or the decoded third request information after the third migration task is executed.
  • the target storage device 110 may also send the third request information to the source storage device 120, and may receive fourth response information from the source storage device.
  • the fourth response information is response information encoded according to the third sharing protocol, that is, the specific format of the fourth response information is consistent with the information format specified by the third sharing protocol.
  • the fourth response information includes update information of the third data in the source storage device 120, and the update information may be, for example, that the third data in the source storage device 120 has been successfully updated, or that the third data in the source storage device 120 has not been successfully updated.
  • the target storage device 110 may also decode the fourth response information according to the third sharing protocol to obtain update information of the third data in the source storage device 120.
  • the target storage device 110 may send the third response information to the computing device according to the fourth response information and/or the update status of the third data in the target storage device 110.
  • the third response information is response information encoded according to the third sharing protocol, that is, the specific format of the third response information is consistent with the information format specified by the third sharing protocol.
  • the third response information includes update information of the third data, and the update information of the third data may be, for example, that the third data has been successfully updated, or that the third data has not been successfully updated.
  • the target storage device 110 may also delete the recorded third request information or the decoded third request information before sending the third response information.
  • the target storage device 110 can determine whether the third data exists in the target storage device 110, that is, determine whether the third data has been successfully migrated to the target file system. If the third data exists in the target storage device 110, the target storage device 110 can directly send a third response information to the computing device 130.
  • the third response information is a response information encoded according to the third sharing protocol, and the third response information includes the third data. If the third data does not exist in the target storage device 110, the target storage device 110 can send the third request information to the source storage device 120.
  • the target storage device 110 can also receive a fourth response information from the source storage device 120.
  • the fourth response information is a response information encoded according to the third sharing protocol, and the fourth response information includes the third data.
  • the target storage device 110 can also set the priority of the third migration task to high, that is, the target storage device 110 can give priority to executing the third migration task.
  • the third migration task is a migration task to which the third data belongs.
  • the target storage device 110 can determine whether the third data exists in the target storage device 110 and directly send the third request information to the source storage device 120. That is, regardless of whether the third data exists in the target storage device 110, the target storage device 110 can directly forward the third request information to the source storage device 120, thereby obtaining the fourth response information from the source storage device 120.
  • the target storage device 110 can also send the third response information to the computing device 130.
  • the target storage device 110 can also delete the recorded third request information or the decoded third request information before sending the third response information.
  • the source storage device 120 includes a source file system, and the source storage device 120 can be connected to the computing device 130 and the target storage device 110. After the source storage device 120 establishes a connection with the target storage device 110, the configuration information of the source file system can be passed to the target storage device 110.
  • the configuration information includes the structure information of the source file system, and the configuration information can also include at least one of the following: permission information, user information or sharing information of the source file system.
  • the source storage device 120 can also receive first indication information from the target storage device 110, and disconnect from the computing device 130 according to the first indication information.
  • the first indication information is used to indicate that the source storage device 120 is disconnected from the computing device 130.
  • the source storage device 120 can also send second indication information to the computing device 130 before disconnecting from the computing device 130.
  • the second indication information includes the network address of the target storage device 110.
  • the source storage device 120 may also receive first request information and second request information from the target storage device 110 after establishing a connection with the target storage device 110.
  • the first request information is information encoded according to the first sharing protocol, and the first request information is used to obtain the first data in the source storage device 120.
  • the second request information is information encoded according to the second sharing protocol, and the second request information is used to obtain the second data in the source storage device 120.
  • the first sharing protocol and the second sharing protocol are different protocols among a plurality of sharing protocols.
  • the plurality of sharing protocols include multiple of NFS, SMB, S3, or private protocols, and the private protocol may be a protocol defined by the user.
  • the source storage device 120 may also determine first response information according to the first request information.
  • the first response information is information encoded according to the first sharing protocol, and the first response information includes the first data.
  • the source storage device 120 may also determine second response information according to the second request information.
  • the second response information is information encoded according to the second sharing protocol, and the second response information includes the second data.
  • the source storage device 120 may decode the first request information according to the first sharing protocol to determine the decoded first request information.
  • the decoded first request information is used to obtain the first data.
  • the source storage device 120 may also determine the first data according to the decoded first request information.
  • the source storage device 120 may also encode the first data according to the first sharing protocol to determine the first response information.
  • the specific implementation method of the source storage device 120 determining the second response information is similar to that of determining the first response information, which will not be repeated here.
  • the source storage device 120 may also send the first response information and the second response information to the target storage device 110.
  • the source storage device 120 may also receive a third request information from the target computing device, the third request information being used to obtain or update the third data, the third data belonging to the source storage device 120.
  • the third request information is request information encoded according to a third sharing protocol, and the third sharing protocol is any one of a plurality of sharing protocols.
  • the source storage device 120 may decode the third request information according to the third sharing protocol to determine the decoded third request information.
  • the source storage device 120 may also read or update the third data in the source storage device 120 according to the decoded third request information, thereby determining the third data or the update information of the third data.
  • the source storage device 120 may also encode the third data or the update information of the third data according to the third sharing protocol, thereby determining the fourth response information, that is, the fourth response information is the response information encoded according to the third sharing protocol, and the fourth response information includes the third data or the update information of the third data.
  • the update information of the third data may be, for example, that the third data in the source storage device 120 has been successfully updated, or that the third data in the source storage device 120 has not been successfully updated, etc.
  • the source storage device 120 may also send the fourth response information to the target storage device 110.
  • the computing device 130 may be connected to the target storage device 110 or the source storage device 120, so as to access the target file system or the source file system.
  • the computing device 130 may receive second indication information from the source storage device 120 when connected to the source storage device 120, so as to disconnect from the source storage device 120.
  • the second indication information is used to instruct the computing device 130 to disconnect from the source storage device 120.
  • the computing device 130 may also establish a connection with the target storage device 110 after disconnecting from the source storage device 120.
  • the computing device 130 may access the source file system or the target file system through the target storage device 110.
  • the source file system is a file system in the source storage device 120
  • the target file system is a file system in the target storage device 110.
  • the computing device 130 may also send a third request information to the target storage device 110.
  • the third request information is used to obtain or update third data.
  • the third data is data in the source file system and/or the target file system.
  • the computing device 130 may also receive third response information from the target storage device 110 , where the third response information includes third data or update information of the third data.
  • the target storage device 110 in FIG. 1 can transmit data with the source storage device 120 and/or the computing device 130 based on a variety of different protocols. Therefore, in the migration process of the source file system in the source storage device 120, there is no need to use multiple migration tools that support different protocols, thereby effectively reducing the cost of migrating the file system.
  • the embodiment of the present application can avoid the problem that when the source file system supports multiple protocols at the same time, only a migration tool that supports one protocol cannot migrate metadata based on other protocols in the source file system, thereby ensuring that the data, metadata, and attributes in the source file system are completely migrated to the target file system.
  • the target storage device 110 can also directly store the data read from the source storage device 120 after decoding, without the need for the information to be encoded and decoded again by the migration tool before the target storage device 110 can receive the encoded information, and the target storage device 110 needs to be decoded again before the acquired data can be stored, thereby shortening the migration time.
  • the target file system in the target storage device 110 in FIG. 1 can also retain the permission information of the source file system, effectively protecting the security of the files in the source file system and/or the target file system.
  • the target storage device 110 does not need to migrate the incremental data, but can directly establish a connection with the computing device 130 in a shorter time, thereby shortening the service interruption time.
  • the target storage device 110 can also ensure the consistency of the data in the source file system and the target file system by recording the third request information from the computing device 130 and synchronously updating the third data in the source file system and the target file system.
  • FIG2 is a schematic structural diagram of a storage device 200 provided according to an embodiment of the present application.
  • the storage device 200 includes a first communication module 210, a migration module 220, an input output (IO) module 230, a target file system module 240, a second communication module 250, and a configuration module 260.
  • the storage device 200 in FIG2 is similar to the target storage device 110 in FIG1.
  • the first communication module 210 can be used to communicate with a computing device, for example, to receive a third request message from the computing device, or to send a third response message to the computing device.
  • the computing device can be the computing device 130 in FIG. 1.
  • the third request message is a request message encoded according to a third sharing protocol, and the third request message is used to obtain or update third data.
  • the third sharing protocol is any one of a plurality of sharing protocols, and the plurality of sharing protocols include multiple of NFS, SMB, S3, or private protocols. Any one of the plurality of sharing protocols is used to access data in a source storage device.
  • the private protocol can be a user-defined protocol.
  • the third data can be data in the storage device 200 or data in the source storage device.
  • the source storage device can be the source storage device 120 in FIG. 1.
  • the first communication module 210 can decode the third request message according to the third sharing protocol to determine the decoded third request message.
  • the first communication module 210 can also send the decoded third request message to the IO module 230, and can receive the third data or update information of the third data from the IO module.
  • the first communication module 210 may also determine third response information according to the third sharing protocol, where the third response information is response information encoded according to the third sharing protocol.
  • the third response information includes third data or update information of the third data.
  • the first communication module 210 may also send the third response information to the computing device.
  • the migration module 220 can be used to execute at least one migration task, each of which is used to migrate some files in the source storage device to the storage device 200.
  • Each migration task may include a scanning task and a copying task.
  • the migration module 220 may determine at least one scanning task, each of which may be used to scan some files or data in the source file system.
  • Each scanning task may include one or more scanning threads.
  • the migration module 220 may traverse some or all files contained in the source file system by a distributed crawler method, thereby completing each scanning task.
  • the migration module 220 may also determine at least one copying task, each of which may be used to copy some files or data in the source file system.
  • Each copying task may include one or more copying threads.
  • the at least one scanning task may correspond to the at least one copying task one by one. That is, the migration module 220 may send a first request message to the source storage device through the second communication module 250 according to the first scanning task, and the first request message is used to obtain the first data.
  • the first data is the file or data to be scanned in the first scanning task, for example, it may be the directory of the file to be scanned, the content of the file to be scanned, etc.
  • the first scanning task is any scanning task in the at least one scanning task.
  • the migration module 220 may also write the acquired first data into the target file system module 240 through the IO module 230 according to the first replication task.
  • the first replication task is a replication task corresponding to the first scanning task.
  • the migration module 220 can execute one or more migration tasks in the at least one migration task in parallel.
  • the migration module 220 can also control the number of migration tasks executed in parallel according to the actual operation capacity of the storage device 200, so as to avoid affecting the normal operation of the storage device 200.
  • the source file system may include at least one storage node, each storage node can be regarded as a storage space in the source file system, and each storage node may include at least one level directory and/or at least one file. Each level directory in the at least one level directory may include some files in the at least one file.
  • the migration module 220 can divide the directory in each storage node into multiple child nodes according to the at least one storage node included in the source file system, and assign a migration task to each child node.
  • the migration module 220 can also determine a target scan queue, which includes the migration tasks of each child node in at least one child node of each storage node.
  • the IO module 230 can be used to provide a lock mechanism, so as to avoid read and write errors when the storage device 200 responds to the third request information of the computing device while executing the migration task.
  • the IO module 230 can provide a mutex lock when the migration module 220 executes the replication task, so as to avoid multiple threads performing read and write operations on the same object at the same time, thereby causing read and write errors.
  • the IO module 230 can also provide a mutex lock when responding to the third request information of the computing device (for example, updating the third data), so as to avoid at least one thread of the migration task and the thread updating the third data performing read and write operations on the same object at the same time, thereby causing read and write errors.
  • the IO module 230 may also receive the first data and the second data from the source storage device through the second communication module 250, and may write the first data and the second data into the target file system module 240.
  • the IO module 230 may also receive the decoded third request information from the first communication module.
  • the IO module 230 may also record the decoded third request information.
  • the decoded third request information may be used to read or update the third data.
  • the IO module 230 can send the decoded third request information to the second communication module 250 upon receiving the decoded third request information, so that the second communication module 250 can send the third request information to the source storage device.
  • the IO module 230 can receive the decoded fourth response information through the second communication module 250.
  • the decoded fourth response information includes the update information of the third data in the source storage device.
  • the IO module 230 can also determine the target file system.
  • the IO module 230 determines whether the target file system module 240 contains the third data. If the target file system module 240 contains the third data, the IO module 230 can update the third data according to the decoded third request information.
  • the IO module 230 can set the priority of the third migration task to high, so that the migration module 220 preferentially executes the third migration task.
  • the third migration task is the migration task to which the third data belongs.
  • the IO module 230 can also update the third data in the target file system module 240 according to the decoded third request information after executing the third migration task, that is, after the target file system module 240 contains the third data.
  • the IO module 230 can also send a third response message to the computing device through the first communication module 210, and the third response message includes the update information of the third data.
  • the IO module 230 can also delete the recorded decoded third request information before sending the third response message to the computing device.
  • the IO module 230 may send the decoded third request information to the second communication module 250 upon receiving the decoded third request information, and may receive the decoded fourth response information through the second communication module 250.
  • the decoded fourth response information includes the third data.
  • the IO module 230 may also send the third response information to the computing device through the first communication module 210, and the third response information includes the third data.
  • the IO module 230 may determine whether the target file system module 240 contains the third data. If the target file system module 240 contains the third data, the IO module 230 may directly read the third data and send the third response information to the computing device through the first communication module 210.
  • the IO module 230 may set the priority of the third migration task to high, so that the migration module 220 may preferentially execute the third migration task.
  • the third migration task is the migration task to which the third data belongs.
  • the IO module 230 may also delete the recorded decoded third request information before sending the third response information to the computing device.
  • the target file system module 240 can store files or data migrated from the source storage device, such as the first data and/or the second data.
  • the target file system module 240 includes a target file system, and the configuration information of the target file system is the same as the configuration information of the source file system.
  • the configuration information includes structural information, and the configuration information may also include at least one of the following: permission information, user information, or sharing information.
  • the source file system is a file system in the source storage device. After the IO module 230 receives the first data and/or the second data, the target file system module 240 can be accessed by the IO module 230, so that the IO module 230 can write the first data and/or the second data into the target file system module 240.
  • the target file system module 240 can be accessed by the IO module 230, so that the IO module 230 can determine whether the third data exists in the target file system module 240. In the case that the third data exists in the target file system module 240, the target file system module 240 can also be accessed by the IO module 230, so that the IO module 230 can update the third data. For example, the target file system module 240 may receive a write instruction from the IO module 230, and update the third data according to the write instruction. Updating the third data includes: deleting the third data or modifying the third data.
  • the second communication module 250 can be used to communicate with the source storage device, for example, to send one or more of the first request information, the second request information, or the third request information to the source storage device, or to receive one or more of the first response information, the second response information, or the fourth response information from the source storage device.
  • the source storage device may be the source storage device 120 in FIG. 1.
  • the first request information is a request information encoded according to a first sharing protocol, and the first sharing protocol is any one of a plurality of sharing protocols.
  • the second request information is a request information encoded according to a second sharing protocol, and the second sharing protocol is a protocol different from the first sharing protocol among a plurality of sharing protocols.
  • the plurality of sharing protocols include a plurality of NFS, SMB, S3, or private protocols.
  • the private protocol may be a user-defined protocol.
  • the first request information is used to obtain the first data in the source storage device, and the second request information is used to obtain the second data in the source storage device.
  • the second communication module 250 can be connected to a plurality of source storage devices at the same time, that is, the file systems in a plurality of source storage devices can be accessed or migrated at the same time.
  • the second communication module 250 can also control the number of file systems in a plurality of source storage devices that are accessed or migrated in parallel according to the actual operating capacity of the storage device 200.
  • the second communication module 250 may also maintain a connection relationship with each source storage device in at least one source storage device, and keep one or more sessions active, where the one or more sessions are sessions between the second communication module 250 and the one or more source storage devices.
  • the second communication module 250 may also reestablish a connection with a source storage device when disconnected from the source storage device.
  • the second communication module 250 can also provide a unified interface, so that the impact of the sharing protocol supported by the source storage device itself on the migration source file system can be ignored. That is, no matter which sharing protocol the source storage device supports, the interface provided in the second communication module 250 can determine the corresponding request information based on the sharing protocol.
  • the corresponding request information is the request information encoded based on the sharing protocol, and the corresponding request information is used to obtain part of the files or data in the source storage device.
  • the second communication module 250 can also provide an application programming interface (API) or internal modules based on a portable operating system interface (POSIX), such as stacks corresponding to different protocols, for storing third request information or responses.
  • API application programming interface
  • POSIX portable operating system interface
  • the second communication module 250 may include a cache of response information, an external data representation (XDR) codec for encoding or decoding, a connection pool with a registered file descriptor (FD) running in multiple threads, etc., so as to facilitate the storage device 200 to perform migration tasks or respond to the third request information of the computing device.
  • the second communication module 250 may determine the first request information according to the first sharing protocol.
  • the second communication module 250 may also determine the second request information according to the second sharing protocol.
  • the second communication module 250 may also encode the decoded third request information according to the third sharing protocol to determine the third request information.
  • the second communication module 250 may also decode the fourth response information according to the third sharing protocol after receiving the fourth response information from the source storage device, determine the decoded fourth response information, and send it to the IO module 230.
  • the first sharing protocol, the second sharing protocol, and the third sharing protocol are sharing protocols supported and used by the source storage device.
  • the configuration module 260 is used to obtain the configuration information of the source file system in the source storage device, and the configuration information includes structure information.
  • the configuration information may also include any one or more of permission information, user information, or sharing information.
  • the structure information is used to indicate the structure of the source file system and the information of the nodes in the structure, and the structure may be, for example, a quadtree (Qtrees) structure.
  • the permission information is used to indicate the information of the user to whom some or all files in the source file system can be accessed.
  • the permission information may be, for example, security identifiers (SID), mode bits (mode bits), access control lists (ACL), active directory service (ADS) information, etc.
  • the user information is used to indicate the information of the user to whom the files in the source file system belong.
  • the sharing information is used to indicate the file or data information in the source file system that can be accessed remotely.
  • the configuration module 260 may obtain the configuration information of the source file system in the source storage device after the storage device 200 establishes a connection with the source storage device, and may also create a target file system in the storage device 200 according to the configuration information of the source file system. After creating the target file system, the configuration module 260 may send first indication information to the source storage device through the second communication module 250, and the first indication information may be used to instruct the source storage device to disconnect from the computing device. The first indication information may also include the network address of the storage device 200. After the configuration module 260 sends the first indication information, the storage device 200 may establish a connection with the computing device and transmit data with the computing device through the first communication module 210.
  • the storage device 200 may further include a log module 270.
  • the log module 270 may include a write ahead log (WAL), which may be used to record the third request information or the decoded third request information.
  • WAL write ahead log
  • the IO module 230 may store the decoded third request information in the log module 270.
  • the IO module 230 may also delete the decoded third request information in the log module 270.
  • the third response information is information in response to the third request information.
  • the storage device 200 can transmit data with the source storage device and/or computing device based on a variety of different protocols, so in the migration process of the source file system in the source storage device, it is not necessary to use multiple migration tools that support different protocols, thereby effectively reducing the cost of migrating the file system.
  • the embodiment of the present application can avoid the problem that when the source file system supports multiple protocols at the same time, only using a migration tool that supports one protocol cannot migrate the metadata based on other protocols in the source file system, thereby ensuring that the data, metadata and attributes in the source file system are completely migrated to the target file system.
  • the storage device 200 can also directly store the data read from the source storage device after decoding, without the need to perform the encoding and decoding processing of the information again through the migration tool, thereby shortening the migration time.
  • the permission information of the source file system can also be retained in the storage device 200, effectively protecting the security of the files in the source file system and/or the target file system.
  • the storage device 200 does not need to migrate the incremental data, but can directly establish a connection with the computing device in a shorter time, thereby shortening the time of interrupting the service.
  • the storage device 200 can also ensure the consistency of data in the source file system and the target file system by recording the third request information from the computing device or the decoded third request information and synchronously updating the third data in the source file system and the target file system.
  • FIG3 is a schematic flow chart of a method for migrating a file system provided in an embodiment of the present application, and FIG3 includes the following steps.
  • the target storage device may send first request information and second request information to the source storage device.
  • the first request information is information encoded according to a first sharing protocol, and the first request information is used to obtain first data in the source storage device.
  • the second request information is information encoded according to a second sharing protocol, and the second request information is used to obtain second data in the source storage device.
  • the first sharing protocol and the second sharing protocol are different protocols among a plurality of sharing protocols. Any one of the plurality of sharing protocols is used to access data in the source storage device.
  • the target storage device can access data in the source storage device through multiple sharing protocols.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols.
  • the private protocol can be a user-defined protocol.
  • the target storage device may establish a connection with the source storage device.
  • the target storage device may be connected to the source storage device by manual configuration.
  • the target storage device may obtain the network address of the source storage device through other devices connected to the target storage device, thereby establishing a connection with the source storage device.
  • the target storage device may receive a connection request from the source storage device, thereby establishing a connection with the source storage device, which is not limited in the embodiments of the present application.
  • the target storage device may obtain configuration information of the source file system in the source storage device.
  • the configuration information includes structure information, and the configuration information may also include at least one of the following: permission information, user information, or sharing information.
  • the structural information is used to indicate the structure of the source file system and the information of the nodes in the structure, and the structure may be, for example, a Qtrees structure, etc.
  • the structural information may include, for example, information such as at least one storage node of the source file system, a directory included in each storage node, or files included in each directory of each storage node.
  • permission information is used to indicate information about users to whom some or all files in the source file system can be accessed.
  • Permission information may be, for example, information such as SID, mode bits, ACL, or ADS.
  • User information is used to indicate information about users to whom files in the source file system belong.
  • Share information is used to indicate information about files or data in the source file system that can be accessed remotely.
  • the embodiment of the present application does not specifically limit the method of obtaining the configuration information of the source file system.
  • the target storage device can access the source file system to obtain the configuration information of the source file system.
  • the target storage device can send an access request to the source storage device, and the access request is used to request to obtain the configuration information of the source storage device.
  • the target storage device can also receive the configuration information from the source storage device.
  • the target storage device may create a target file system in the target storage device according to the configuration information of the source file system.
  • the configuration information of the target file system is the same as the configuration information of the source file system.
  • the target storage device may determine at least one migration task based on the structural information of the source file system.
  • Each of the at least one migration task is used to migrate part of the files in the source storage device to the target storage device, that is, each migration task is used to scan and copy part of the files in the source file system.
  • each migration task may include a scanning task and a copying task.
  • the target storage device may determine at least one scanning task and at least one copying task, and the at least one scanning task corresponds to the at least one copying task one by one.
  • Each of the at least one scanning task may be used to scan part of the files or data in the source file system, so as to determine the files to be migrated and/or the specific contents of the files.
  • Each of the at least one copying task may be used to copy part of the files or data in the source file system. That is, each scanning task is used to read part of the files or data in the source file system, and each copying task is used to write the files or data read by the corresponding scanning task into the target file system.
  • the target storage device may execute each migration task in the at least one migration task in series, that is, the target storage device may execute only one migration task at a time, and allocate all executable resources to the migration task.
  • the target storage device may execute one or more migration tasks in the at least one migration task in parallel, that is, the target storage device may execute multiple migration tasks at a time, and the multiple migration tasks share all executable resources, which is not limited in the embodiments of the present application.
  • the target storage device can not only migrate the content of the files and the attributes of the files in the source file system, but also migrate the metadata and the attributes of the source file system.
  • the attributes of the file may include the type of the file, the size of the file, the time information of the file, etc.
  • the time information of the file may include the creation time of the file, the modification time of the file, etc.
  • the source file system is the file system in the source storage device, and the attributes of the source file system may include the type of the source file system, the size of the source file system, the time information of the source file system, etc.
  • the time information of the source file system may include the creation time of the source file system, the modification time of the source file system, etc.
  • Metadata is used to describe the files or data in the source file system. Based on different protocols, metadata is generally different.
  • the target storage device may control the number of migration tasks executed in parallel based on factors such as the target storage device's current migration capability, operating speed, and available bandwidth, thereby maximizing the migration throughput while avoiding affecting the target storage device's response to the computing device.
  • the source file system may include at least one storage node, each storage node may be regarded as a storage space in the source file system, and each storage node may include at least one level directory and/or at least one file. Each level directory in the at least one level directory may include some files in the at least one file.
  • the target storage device may divide the directory or file in each storage node into at least one child node according to the at least one storage node included in the source file system, and assign a migration task to each child node in the at least one child node. That is, the target storage device may assign a scanning task and a copy task to each child node.
  • the target storage device may also determine a target scan queue, which includes the migration tasks of each child node in at least one child node.
  • the target storage device may execute scanning threads and/or copying threads of multiple child nodes in parallel at the same time.
  • FIG4 is a schematic diagram of executing multiple migration tasks in parallel according to an embodiment of the present application.
  • FIG4 includes a target scan queue, which includes migration tasks of subnode 1, subnode 2, ..., and subnode N, where N is a positive integer greater than or equal to 1.
  • the migration task of each subnode may include a scan thread and a copy queue, and the copy queue of each subnode may include at least one copy thread.
  • the migration task of subnode 1 may include a scan thread and a copy queue, and the copy queue includes m 1 copy threads, which are copy thread 1 to copy thread m 1.
  • m 1 is a positive integer greater than or equal to 1.
  • the migration task of subnode 2 includes a scan thread and a copy queue, and the copy queue includes copy threads m 1 +1 to copy threads m 2.
  • m 2 is a positive integer greater than or equal to m 1 +1.
  • the migration task of subnode N includes a scan thread and a copy queue, and the copy queue includes copy threads m N-1 +1 to copy threads m N.
  • mN is a positive integer greater than or equal to mN -1 + 1.
  • the target storage device can simultaneously execute the migration task of each subnode from subnode 1 to subnode N.
  • Subnode 1 to subnode N can be subnodes of the same storage node or subnodes of different storage nodes, which is not limited in the embodiments of the present application.
  • the migration task of each child node in FIG4 includes a scanning thread and a copy queue, and each copy queue includes one or more copy threads for exemplary purposes only.
  • the embodiment of the present application does not specifically limit the number of scanning threads and/or copy threads included in the migration task of each child node.
  • the migration task of each child node may include a scanning queue and a copy queue, each scanning queue includes one or more scanning threads, and each copy queue includes one or more copy threads.
  • the target storage device may traverse the files or data in the source file system by using a distributed crawler method, thereby completing the scanning task of each child node.
  • the target storage device may determine the first request information according to a first migration task.
  • the first migration task is any one of a plurality of migration tasks, and the first migration task is used to migrate the first data to the target storage device.
  • the target storage device can determine a sharing protocol that can access the first data from multiple sharing protocols based on the files or data to be scanned in the first scanning task, that is, based on the first data, that is, determine the first sharing protocol.
  • the first scanning task is a scanning task included in the first migration task.
  • the target storage device can also encode information used to obtain the first data in the source storage device according to the first sharing protocol, thereby determining the first request information. That is, the first request information is information encoded according to the first sharing protocol, and the first request information is used to obtain the first data in the source storage device.
  • the format of the first request information is the same as the information format specified by the first sharing protocol.
  • the target storage device may determine the second request information according to a second migration task.
  • the second migration task is a migration task different from the first migration task among multiple migration tasks, and the second migration task is used to migrate the second data to the target storage device.
  • the target storage device can determine a sharing protocol that can access the second data from multiple sharing protocols based on the files or data to be scanned in the second scanning task, that is, based on the second data, that is, determine the second sharing protocol.
  • the second scanning task is a scanning task included in the second migration task.
  • the target storage device can also encode information used to obtain the second data in the source storage device according to the second sharing protocol, thereby determining the second request information. That is, the second request information is information encoded according to the second sharing protocol, and the second request information is used to obtain the second data in the source storage device.
  • the format of the second request information is the same as the information format specified by the second sharing protocol.
  • the first data and/or the second data may include not only the specific content and basic attributes of the files in the source file system, but also data related to the SMB protocol, such as extended attributes (xattr) or ADS, etc.
  • the target storage device may set an ACL in the SMB session connected to the source storage device, thereby obtaining data related to the SMB protocol.
  • the target storage device may determine the first request information and the second request information according to the first migration task and the second migration task, and send the first request information and the second request information to the source storage device.
  • the first request information includes first identification information for indicating that the source storage device encodes the first data according to the first sharing protocol.
  • the second request information includes second identification information for indicating that the source storage device encodes the second data according to the second sharing protocol.
  • the target storage device may send the first request information and the second request information at the same time.
  • the target storage device may first send the first request information and then send the second request information.
  • the source storage device may receive the first request information and the second request information at the same time.
  • the source storage device may first receive the first request information and then receive the second request information. Please do not limit this to the embodiments.
  • S320 Determine first response information according to the first request information.
  • the source storage device may determine first response information according to the first request information.
  • the first response information is information encoded according to the first sharing protocol, and the first response information includes first data.
  • the source storage device may decode the first request information according to the first sharing protocol to determine the decoded first request information.
  • the decoded first request information is used to obtain the first data.
  • the source storage device may also read the first data according to the decoded first request information, and encode the first data according to the first sharing protocol to determine the first response information.
  • the source storage device may determine the first sharing protocol according to the first identification information in the first request information.
  • the source storage device may also perform encoding and decoding processing on the first request information or the first data according to the first sharing protocol.
  • S330 Determine second response information according to the second request information.
  • the source storage device may determine second response information according to the second request information.
  • the second response information is information encoded according to the second sharing protocol, and the second response information includes second data.
  • the source storage device may decode the second request information according to the second sharing protocol to determine the decoded second request information.
  • the decoded second request information is used to obtain the second data.
  • the source storage device may also read the second data according to the decoded second request information, and encode the second data according to the second sharing protocol to determine the second response information.
  • the source storage device may determine the second sharing protocol according to the second identification information in the second request information.
  • the source storage device may also perform encoding and decoding processing on the second request information or the second data according to the second sharing protocol.
  • the target storage device may receive response information from the source storage device after sending request information to the source storage device. Specifically, the target storage device may receive first response information from the source storage device after sending first request information to the source storage device. The first response information is information encoded according to a first sharing protocol, and the first response information includes first data. The target storage device may also receive second response information from the source storage device after sending second request information to the source storage device. The second response information is information encoded according to a second sharing protocol, and the second response information includes second data.
  • S350 Decode the first response information according to the first sharing protocol to obtain and store the first data.
  • the target storage device After receiving the first response information and the second response information, the target storage device can decode the response information according to the sharing protocol corresponding to the response information, thereby obtaining the data contained in the response information. Specifically, after receiving the first response information, the target storage device can decode the first response information according to the first sharing protocol to obtain the first data. The target storage device can also directly store the first data.
  • the first response information includes first identification information, and the first identification information is used to instruct the target storage device to decode the first response information according to the first sharing protocol.
  • the target storage device decodes according to the first sharing protocol means that the target storage device can determine the specific format of the first response information according to the first sharing protocol, and read the first data from the first position in the first response information.
  • the first position in the first response information is the specific position of the first data in the first response information according to the information format specified by the first sharing protocol.
  • the target storage device may directly store the first data in the target file system.
  • the location of the first data in the target file system is consistent with the location of the first data in the source file system.
  • the target storage device may write the first data into the target file system according to the first copy task in the first migration task.
  • S360 Decode the second response information according to the second sharing protocol, and obtain and store the second data.
  • the target storage device may decode the second response information according to the second sharing protocol to obtain the second data.
  • the target storage device may also directly store the second data.
  • the second response information includes second identification information, and the second identification information is used to instruct the target storage device to decode the second response information according to the second sharing protocol.
  • the target storage device decodes according to the second sharing protocol means that the target storage device can determine the specific format of the second response information according to the second sharing protocol, and read the second data from the first position in the second response information.
  • the first position in the second response information is the specific position of the second data in the second response information according to the information format specified by the second sharing protocol.
  • the target storage device may directly store the second data in the target file system.
  • the location of the second data in the target file system is consistent with the location of the second data in the source file system.
  • the target storage device may write the second data into the target file system according to the second copy task in the second migration task.
  • the target storage device can control the number of scanning tasks and/or copying tasks executed in parallel based on factors such as the current migration capability, operating speed, available bandwidth, etc. of the target storage device, thereby maximizing the migration throughput while avoiding affecting the response of the target storage device to the computing device.
  • the migration tool when the migration tool is used to migrate the first data, after obtaining the first data from the source storage device, the migration tool needs to perform protocol conversion again, so as to obtain information encoded according to the first shared protocol, and the information contains the first data.
  • the migration tool also needs to send the information to the target storage device, so that the target storage device obtains the first data after decoding the information.
  • the target storage device in the embodiment of the present application can directly store the data obtained from the source storage device after decoding, without the need for the migration tool to perform encoding and decoding processing on the information again, thereby shortening the migration time.
  • the target storage device in the embodiment of the present application can transfer data with the source storage device based on a variety of different protocols. Therefore, in the process of migrating the source file system in the source storage device, it is not necessary to use multiple migration tools that support different protocols, thereby effectively reducing the cost of migrating the file system.
  • the embodiment of the present application can avoid the problem that when the source file system supports multiple protocols at the same time, the metadata based on other protocols in the source file system cannot be migrated by using only a migration tool that supports one protocol, thereby ensuring that the data, metadata, attributes, etc. in the source file system are completely migrated to the target file system.
  • the target file system in the target storage device can also retain the permission information of the source file system, effectively protecting the security of the files in the source file system and/or the target file system.
  • FIG5 is a schematic flow chart of a method for migrating a file system provided in an embodiment of the present application.
  • the method in FIG5 includes the following steps.
  • the target storage device may establish a connection with the source storage device, and may also obtain configuration information of the source file system from the source storage device.
  • the configuration information includes structural information, and the configuration information may also include at least one of the following: permission information, user information, or sharing information.
  • the specific implementation of the target storage device establishing a connection with the source storage device and obtaining the configuration information may refer to the description in step S310.
  • the target storage device and the source storage device may transmit data via a variety of different sharing protocols, which may be protocols supported by the source storage device, such as NFS protocol, SMB protocol, S3 protocol or private protocol, etc. Any of the multiple sharing protocols is used to access data in the source storage device.
  • protocols supported by the source storage device such as NFS protocol, SMB protocol, S3 protocol or private protocol, etc. Any of the multiple sharing protocols is used to access data in the source storage device.
  • the target storage device can create a target file system according to the configuration information of the source file system.
  • the configuration information of the target file system is the same as the configuration information of the source file system.
  • the target storage device may create storage nodes in the target file system according to the structural information of the source file system, and make the storage nodes in the target file system correspond one-to-one with the storage nodes in the source file system.
  • the target storage device may also create at least one child node of each storage node in the target file system according to at least one child node of each storage node in the source file system. At least one child node of each storage node in the target file system corresponds one-to-one to at least one child node of each storage node in the source file system.
  • the target storage device may create a user of the target file system according to the SID information in the source file system, and may perform user mapping so that the SID of the user of the target file system is the same as the SID of the user of the source file system.
  • the target storage device can also obtain the mode bits and ACL of the source file system.
  • the target storage device can scan the source file system under different permissions (such as SID permissions and ACL permissions, etc.), so that the files, metadata, and attributes in the source file system can be completely migrated. Since the target file system retains the complete permission information in the source file system, it is not easy to make mistakes when the computing device accesses the target file system. For example, after the files in the source file system are migrated to the target file system, the files that user A cannot access in the source file system are still inaccessible in the target file system, and the files that user A can access in the source file system are still accessible in the target file system.
  • the target storage device may also determine the files or data in the target file system that can be remotely accessed according to the sharing information of the source file system, such as determining a shared directory or a shared file.
  • S503 Determine first request information and second request information.
  • the target storage device may determine at least one migration task according to the configuration information of the source file system. Each migration task in the at least one migration task is used to migrate part of the files in the source storage device to the target storage device.
  • the target storage device can determine a sharing protocol that can access the first data from multiple sharing protocols based on the files or data to be acquired in the first migration task, that is, based on the first data, that is, determine the first sharing protocol.
  • the first migration task is any one of the at least one migration task.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols, and the private protocol can be a user-defined protocol.
  • the target storage device can also encode information used to acquire the first data in the source storage device according to the first sharing protocol, thereby determining the first request information. That is, the first request information is information encoded according to the first sharing protocol, and the first request information is used to acquire the first data in the source storage device. In other words, the format of the first request information is the same as the information format specified by the first sharing protocol.
  • the target storage device can determine a sharing protocol that can access the second data from multiple sharing protocols based on the files or data to be obtained in the second migration task, that is, based on the second data, that is, determine the second sharing protocol.
  • the second migration task is a task that is different from the first migration task in at least one migration task.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols, and the private protocol can be a user-defined protocol.
  • the target storage device can also encode information used to obtain the second data in the source storage device according to the second sharing protocol, thereby determining the second request information. That is, the second request information is information encoded according to the second sharing protocol, and the second request information is used to obtain the second data in the source storage device.
  • the format of the second request information is the same as the information format specified by the second sharing protocol.
  • the specific implementation method can refer to the description in step S310.
  • Step S504 sending the first request information and the second request information.
  • Step S504 is similar to step S310, and will not be described again here.
  • Step S505 Determine first response information and second response information according to the first request information and the second request information. Step S505 is similar to steps S320 and S330, and will not be described in detail herein.
  • Step S506 receiving the first response information and the second response information.
  • Step S506 is similar to step S340, and will not be described in detail here.
  • Step S507 obtaining and storing the first data and the second data according to the first response information and the second response information.
  • Step S507 is similar to steps S350 and S360, and will not be described in detail here.
  • S508 Send first indication information.
  • the target storage device After the target storage device creates the target file system, it can directly send the first indication information to the source storage device. Alternatively, the target file system can send the first indication information to the source storage device after executing part or all of the migration task.
  • the first indication information is used to indicate that the source storage device is disconnected from the computing device.
  • the embodiment of the present application does not limit the order in which steps S503-S507 and step S508 are executed. For example, steps S503-S507 can be executed first, and then step S508. Alternatively, step S508 can be executed first, and then steps S503-S507 can be executed.
  • the first indication information also includes a network address of the target storage device.
  • the source storage device may disconnect from the computing device according to the first indication information.
  • the source storage device may execute step S509 to disconnect from the computing device.
  • S509 Send a second indication message to disconnect.
  • the source storage device may send second indication information to the computing device, thereby disconnecting from the computing device.
  • the second indication information is used to instruct the computing device to disconnect from the source storage device.
  • the second indication information also includes a network address of the target storage device.
  • the computing device may actively disconnect from the source storage device after receiving the second indication information.
  • the computing device may also perform step S510 after receiving the second indication information.
  • the target storage device can be connected to the computing device by manual configuration.
  • the target storage device can obtain the network address of the computing device through other devices connected to the target storage device, thereby establishing a connection with the computing device.
  • the target storage device can receive a connection request from the computing device, thereby establishing a connection with the computing device, which is not limited in the embodiments of the present application.
  • the computing device may send a connection request to the target storage device according to the network address of the target storage device in the second indication information, thereby establishing a connection with the target storage device.
  • the computing device may establish a connection with the target storage device through manual configuration after being disconnected from the source storage device.
  • the computing device may receive a connection request from the target storage device after disconnecting from the source storage device. Request to establish a connection with the target storage device.
  • the shared file system may be remounted, thereby accessing the source file storage system and/or the target storage system through the target storage device.
  • Data may be transmitted between the target storage device and the computing device via a variety of different protocols, which may be protocols supported by the computing device, such as NFS protocol, SMB protocol, S3 protocol, or private protocols.
  • protocols such as NFS protocol, SMB protocol, S3 protocol, or private protocols.
  • the target storage device can directly establish a connection with the computing device after sending the first indication information to the source storage device, without having to establish a connection with the computing device after migrating the metadata or incremental data.
  • Metadata is used to describe files or data in the source file system. Based on different protocols, metadata is generally different.
  • Incremental data is data that is newly written to the source file system by the computing device but not written to the target file system when migrating the source file system.
  • the files or data in the source file system can continue to be accessed or updated through the target storage device. That is, the computing device can send a third request message to the target storage device after establishing a connection with the target storage device.
  • the third request message is used to obtain or update the third data in the source file system and/or the target file system. That is, the third data belongs to the source storage device and/or the target storage device.
  • the third request message is a request message encoded according to a third sharing protocol, and the third sharing protocol is any one of a plurality of sharing protocols. In other words, the format of the third request message is the same as the information format specified by the third sharing protocol.
  • the multiple sharing protocols include multiple of NFS, SMB, S3, or private protocols, where the private protocols are user-defined protocols.
  • the target storage device may receive the third request information from the computing device while migrating the source file system in the source storage device. That is, the target storage device may perform the migration task without interrupting the service.
  • the target storage device may decode the third request information according to the third sharing protocol, thereby determining the decoded third request information, which is used to obtain or update the third data.
  • the decoded third request information is still used to obtain the third data. If the third request information is used to update the third data, the decoded third request is still used to update the third data.
  • the third request information includes third identification information, and the third identification information is used to instruct the target storage device to decode the third request information according to a third sharing protocol.
  • the target storage device may further execute steps S512, S513, S514, and S515.
  • S512 Record the third request information or the decoded third request information.
  • the target storage device may store the third request information, thereby ensuring the consistency of the files or data in the target file system and the source file system.
  • the target storage device may store the decoded third request information, thereby ensuring the consistency of the files or data in the target file system and the source file system.
  • the target storage device may determine whether the third data in the source file system and the target file system has been synchronously updated by recording the third request information and/or the decoded third request information, thereby ensuring that the third data is updated in the target file system at the same time as the source file system is updated.
  • S513 Send third request information.
  • the target storage device may send the third request information to the source storage device, that is, the target storage device may forward the third request information to the source storage device.
  • the target storage device may encode the decoded third request information according to the third sharing protocol to obtain the third request information, and send the third request information to the source storage device.
  • the source storage device may receive the third request information.
  • the target storage device may directly send the third request information to the source storage device.
  • the target storage device may first determine whether the third data exists in the target storage device, and then determine whether it needs to send the third request information to the source storage device.
  • the target storage device may directly send the third request information to the source storage device.
  • the target storage device may send the third request information to the source storage device.
  • the target storage device may not send the third request information to the source storage device.
  • the target storage device may directly send the third request information to the source storage device.
  • the target storage device may first determine whether the third data exists in the target storage device, and whether or not the third data exists, In the third data, third request information is sent to the source storage device.
  • S514 Determine fourth response information according to the third request information.
  • the source storage device may determine the third data or the update information of the third data in the source storage device according to the third request information. Specifically, the source storage device may decode the third request information according to the third sharing protocol to determine the decoded third request information. The decoded third request information is used to obtain or update the third data. The source storage device may also read or update the third data in the source file system according to the decoded third request information, thereby determining the third data or the update information of the third data.
  • the source storage device may also encode the third data or the update information of the third data in the source storage device according to the third sharing protocol to determine the fourth response information. That is, the fourth response information is the response information encoded according to the third sharing protocol, and the specific format of the fourth response information is consistent with the information format specified by the third sharing protocol.
  • the fourth response information includes the update information of the third data or the third data in the source storage device.
  • the fourth response information includes third identification information, where the third identification information is used to indicate that the fourth response information is to be decoded according to the third sharing protocol.
  • the target storage device may receive fourth response information from the source storage device.
  • the fourth response information includes the third data.
  • the target storage device may receive fourth response information from the source storage device.
  • the fourth response information includes update information of the third data in the source file system, and the update information may be, for example, whether the third data in the source file system has been successfully updated or not successfully updated.
  • the target storage device may decode the fourth response information according to the third sharing protocol to determine the decoded fourth response information, which includes the third data or update information of the third data in the source file system.
  • the target storage device can determine whether the third data exists in the target storage device. If the third data exists in the target storage device, the target storage device can update the third data according to the decoded third request information. Updating the third data may include deleting the third data, modifying the third data, etc. If the third data does not exist in the target storage device, the target storage device can set the priority of the third migration task to high, that is, give priority to executing the third migration task. The third migration task is the migration task to which the third data belongs. The target storage device can also update the third data according to the decoded third request information after executing the third migration task, that is, after the third data exists in the target storage device.
  • the target storage device may determine whether the third data exists in the target storage device. If the third data exists in the target storage device, the target storage device may directly read the third data according to the decoded third request information and execute step S518. If the third data does not exist in the target storage device, the target storage device may send the third request information to the source storage device. The target storage device may also set the priority of the third migration task to high, that is, to execute the third migration task first, and the third migration task is the migration task to which the third data belongs.
  • steps S513-S515 and step S516 may be executed simultaneously.
  • steps S513-S515 may be executed first, and then step S516.
  • step S516 may be executed first, and then steps S513-S515.
  • steps S513-S515 and step S516 may be executed simultaneously.
  • the target storage device may further execute step S517.
  • the target storage device may delete the recorded third request information or the decoded third request information before sending the third response information to the computing device.
  • the target storage device may delete the recorded third request information or the decoded third request information after updating the third data in the target file system.
  • the target storage device may delete the recorded third request information or the decoded third request information after determining the decoded fourth response information.
  • the target storage device may delete the recorded third request information or the decoded third request information after updating the third data in the target file system and determining the decoded fourth response information, which is not limited in the embodiments of the present application.
  • the target storage device may send third response information to the computing device while migrating files or data in the source file system, i.e., respond to the request of the computing device.
  • the third response information includes third data or update information of the third data.
  • the third data is data in the source file system and/or the target file system.
  • the update information of the third data is used to indicate the update status of the third data in the source storage device and/or the target storage device, for example, whether the third data in the source storage device and/or the target storage device has been successfully updated or has not been successfully updated.
  • the third response information is a request information encoded according to a third sharing protocol
  • the third sharing protocol is any one of a plurality of sharing protocols.
  • the format of the third request information is the same as the information format specified by the third sharing protocol.
  • the plurality of sharing protocols include multiple of NFS, SMB, S3, or private protocols, and the private protocol is a user-defined protocol.
  • the target storage device may determine the third response information based on the update information of the third data in the target storage device.
  • the target storage device may determine the third response information based on the update information of the third data in the source storage device, that is, the decoded fourth response information.
  • the target storage device may determine the third response information based on the update information of the third data in the target storage device and the source storage device, which is not limited in the embodiments of the present application.
  • the target storage device may encode the update information of the third data in the target storage device according to the third sharing protocol, thereby determining the third response information.
  • the update information of the third data in the target storage device may be, for example, whether the third data in the target storage device has been successfully updated or has not been successfully updated.
  • the target storage device may encode the decoded fourth response information according to the third sharing protocol to determine the third response information.
  • the decoded fourth response information includes update information of the third data in the source storage device, such as whether the third data in the source storage device has been successfully updated or not successfully updated.
  • the target storage device may encode the update information of the third data in the target storage device and the source storage device according to the third sharing protocol to determine the third response information.
  • the third response information may indicate that the third data has not been successfully updated.
  • the third response information may indicate that the third data has not been successfully updated.
  • the third response information may indicate that the third data has not been successfully updated.
  • the third response information may indicate that the third data has been successfully updated.
  • the decoded fourth response information indicates that the third data in the source storage device has not been successfully updated, while the third data in the target storage device has been successfully updated, the third response information may indicate that the third data has been successfully updated, etc., the embodiments of the present application are not limited to this.
  • the target storage device may determine the third response information based on the third data in the target storage device.
  • the target storage device may determine the third response information based on the third data in the source storage device, i.e., the decoded fourth response information, which is not limited in the embodiments of the present application.
  • the target storage device may directly read the third data in the target storage device, and encode the third data according to the third sharing protocol, thereby determining the third response information.
  • the target storage device may encode the decoded fourth response information according to the third sharing protocol to determine the third response information.
  • the decoded fourth response information includes the third data in the source storage device.
  • the target storage device may be disconnected from the source storage device.
  • Incremental data is data that is newly written to the source file system by the computing device and has not been written to the target file system during the migration of the source file system.
  • the target storage device can synchronously update the third data in the target file system and the source file system upon receiving the third request information from the computing device, so the target storage device does not need a long interruption time to migrate incremental data, and can ensure the consistency of files or data in the source file system and the target file system.
  • the target storage device can transfer data with the source storage device and/or computing device based on a variety of different protocols. Therefore, in the process of migrating the source file system in the source storage device, there is no need to use multiple migration tools that support different protocols, thereby effectively reducing the cost of migrating the file system.
  • the embodiment of the present application can avoid the problem that when the source file system supports multiple protocols at the same time, only using a migration tool that supports one protocol cannot migrate metadata based on other protocols in the source file system, thereby ensuring The data, metadata, and attributes in the source file system are completely migrated to the target file system.
  • the target storage device can also directly store the data read from the source storage device after decoding, without the need for the migration tool to encode and decode the information again, thus shortening the migration time.
  • the target storage device can also retain the permission information of the source file system, thereby effectively protecting the security of the files in the source file system and/or the target file system.
  • FIG. 6 is a schematic structural diagram of a storage device 600 provided in an embodiment of the present application.
  • the storage device 600 includes a transceiver module 610 and a processing module 620 .
  • the transceiver module 610 is used to send a first request message and a second request message to the source storage device, wherein the first request message is information encoded according to the first sharing protocol, and the first request message is used to obtain the first data in the source storage device.
  • the second request message is information encoded according to the second sharing protocol, and the second request message is used to obtain the second data in the source storage device.
  • the first sharing protocol and the second sharing protocol are different protocols among a plurality of sharing protocols. Any one of the plurality of sharing protocols is used to access the data in the source storage device.
  • the transceiver module 610 is also used to receive a first response message and a second response message from the source storage device, wherein the first response message is information encoded according to the first sharing protocol, and the first response message includes the first data.
  • the second response message is information encoded according to the second sharing protocol, and the second response message includes the second data.
  • the transceiver module 610 can execute steps S310 and S340 in the method of FIG. 3, and steps S504, S506, S508, S511, S513, S515, and S518 in the method of FIG. 5.
  • the processing module 620 is used to decode the first response information according to the first sharing protocol, obtain and store the first data.
  • the processing module 620 is also used to decode the second response information according to the second sharing protocol, obtain and store the second data.
  • the processing module 620 can execute steps S350 and S360 in the method of FIG. 3 and steps S501, S502, S503, S507, S510, S512, S516, and S517 in the method of FIG. 5.
  • FIG. 7 is a schematic structural diagram of a storage device 700 provided in an embodiment of the present application.
  • the storage device 700 includes a transceiver module 710 and a processing module 720 .
  • the transceiver module 710 is used to receive a first request message and a second request message from a source storage device, wherein the first request message is information encoded according to a first sharing protocol, and the first request message is used to obtain first data in the source storage device.
  • the second request message is information encoded according to a second sharing protocol, and the second request message is used to obtain second data in the source storage device.
  • the first sharing protocol and the second sharing protocol are different protocols among a plurality of sharing protocols. Any one of the plurality of sharing protocols is used to access data in the source storage device.
  • the transceiver module 710 is also used to send a first response message and a second response message to the target storage device, wherein the first response message is information encoded according to the first sharing protocol, and the second response message is information encoded according to the second sharing protocol.
  • the transceiver module 710 can execute steps S310 and S340 in the method of FIG. 3 , and steps S504, S506, S508, S509, S513, and S515 in the method of FIG. 5 .
  • the processing module 720 is used to determine the first response information according to the first request information.
  • the first response information is information encoded according to the first sharing protocol, and the first response information includes the first data.
  • the processing module 720 is also used to determine the second response information according to the second request information.
  • the second response information is information encoded according to the second sharing protocol, and the second response information includes the second data.
  • the processing module 720 can execute steps S320 and S330 in the method of Figure 3, and steps S501, S505, and S514 in the method of Figure 5.
  • the embodiment of the present application also provides a storage device.
  • the storage device includes: a processor, the processor is used to couple with the memory, read and execute instructions and/or program codes in the memory to execute the various steps executed by the target storage device or the source storage device in the above embodiment.
  • the embodiment of the present application also provides a chip system.
  • the chip system includes a logic circuit, which is used to couple with an input/output interface and transmit data through the input/output interface to execute the various steps executed by the target storage device or the source storage device in the above embodiment.
  • the present application also provides a program product, which includes: program code, when the program code is run on a storage device, the storage device executes each step executed by the target storage device or the source storage device in the above embodiment.
  • the present application also provides a storage medium, which stores program code.
  • the storage device executes each step executed by the target storage device or the source storage device in the above embodiment.
  • the embodiment of the present application also provides a migration system, which includes the target storage device and the source storage device in the above embodiment.
  • the disclosed systems, devices and methods can be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed.
  • Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art.
  • the computer software product is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store program codes.

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

本申请实施例提供了一种迁移文件系统的方法和相关设备。该方法包括:目标存储设备向源存储设备发送第一请求信息和第二请求信息,第一请求信息和第二请求信息为分别根据第一共享协议和第二共享协议编码的信息;目标存储设备接收来自于源存储设备的第一响应信息,并根据第一共享协议,解码第一响应信息,获得并存储第一数据;目标存储设备接收来自于源存储设备的第二响应信息,并根据第二共享协议,解码第二响应信息,获得并存储第二数据。目标存储设备可以基于多种不同的协议迁移源存储设备中的数据,从而不需要额外的多种不同的迁移工具进行技术支持,进而可以有效降低迁移文件系统的成本。

Description

一种迁移文件系统的方法和相关设备
本申请要求于2022年10月18日提交中国专利局、申请号为202211273874.5、申请名称为“一种迁移文件系统的方法和相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及存储器领域,并且更具体地,涉及一种迁移文件系统的方法、存储装置、存储设备、芯片系统和存储介质。
背景技术
随着大数据时代的到来,数据存储的需求急剧扩张,传统的服务器无法满足海量的数据存储的需求,网络附属存储(network attached storage,NAS)技术应运而生。NAS技术可以将存储设备与服务器分离,使存储设备用于集中管理数据,并使服务器可以通过网络连接访问存储设备中的数据,从而可以降低存储成本。NAS存储设备中包括大量的数据,这些数据可以以文件系统的形式提供给服务器访问。在NAS存储设备无法满足当前的存储需求,或者需要重新调整NAS存储设备的用途时,需要对NAS存储设备中的文件系统进行迁移。对NAS存储设备中的文件系统进行迁移需要花费大量的时间,并且会中断用户的计算设备对NAS存储设备中的文件系统的访问,给用户带来不便。
目前可以通过迁移工具(例如迁移服务器或迁移软件)迁移NAS存储设备中的文件系统。迁移工具可以连接源存储设备和目标存储设备,从而可以将源存储设备中的文件系统读出,并写入目标存储设备中。但在迁移工具进行文件系统迁移的过程中,需要对源存储设备和目标存储设备中的文件系统进行多次扫描,从而确定在文件系统的每次迁移过程中计算设备写入的新的数据,即增量数据,进而将增量数据写入目标存储设备中。由于源存储设备可以为计算设备提供基于多种不同的协议共享的源文件系统,以便计算设备访问源文件系统中的文件,并且源存储设备中还存储有基于不同的协议的元数据或属性等。因此在迁移基于不同协议共享的源文件系统时,需要使用支持不同协议的多个工具多次扫描源存储设备中的文件系统,从而才可将源存储设备中的文件、元数据和属性等完整迁移至目标存储系统中。因此,该方法需要多种不同的迁移工具进行技术支持,导致迁移文件系统的过程较为复杂,并且迁移成本较高。
因此,如何降低迁移文件系统的成本成为亟待解决的问题。
发明内容
本申请实施例提供一种迁移文件系统的方法、存储装置、存储设备、芯片系统和存储介质,可以直接通过目标存储设备实现文件系统的迁移,而不需要使用支持不同协议的多个迁移工具,从而可以降低迁移文件系统的成本。
第一方面,提供了一种迁移文件系统的方法。该方法包括:目标存储设备向源存储设备发送第一请求信息和第二请求信息;目标存储设备接收来自于源存储设备的第一响应信息和第二响应信息;目标存储设备根据第一共享协议,对第一响应信息进行解码,获得并存储第一数据;目标存储设备根据第二共享协议,对第二响应信息进行解码,获得并存储第二数据。
其中,第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。多个共享协议中的任一个共享协议用于访问源存储设备中的数据。第一响应信息为根据第一共享协议编码的信息,第二响应信息为根据第二共享协议编码的信息。第一响应信息中包括第一数据,第二响应信息中包括第二数据。
本申请实施例中,目标存储设备可以基于多种不同的协议迁移源存储设备中的数据,因此在源存储设备中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效 降低迁移文件系统的成本。本申请实施例还可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。目标存储设备还可以在获得来自于源存储设备的第一响应信息和第二响应信息后,直接解码并存储第一数据和第二数据,即可以并行迁移第一数据和第二数据,从而缩短迁移源文件系统的时间。
结合第一方面,在第一方面的某些实现方式中,多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
本申请实施例中,目标存储设备可以支持多种不同的协议,从而可以根据多种不同的协议迁移源存储设备中的源文件系统,而不需要使用额外的支持不同协议的迁移工具,从而可以降低迁移文件系统的成本。
结合第一方面,在第一方面的某些实现方式中,目标存储设备根据源存储设备中的源文件系统的结构信息,确定多个迁移任务;目标存储设备根据第一迁移任务,确定第一请求信息;目标存储设备根据第二迁移任务,确定第二请求信息。
其中,多个迁移任务中的每个迁移任务用于将源文件系统中的部分文件迁移至目标存储设备中。第一迁移任务为多个迁移任务中的任一个迁移任务,第一迁移任务用于将第一数据迁移至目标存储设备中。第二迁移任务为多个迁移任务中与第一迁移任务不同的任务,第二迁移任务用于将第二数据迁移至目标存储设备中。
本申请实施例中,目标存储设备可以根据源文件系统的结构信息,确定多个待迁移的文件或数据,即第一数据和第二数据,从而确定多个迁移任务。目标存储设备还可以根据每个迁移任务中待迁移的文件或数据,确定对应的请求信息,从而完成迁移任务。
结合第一方面,在第一方面的某些实现方式中,目标存储设备接收来自于计算设备的第三请求信息;目标存储设备根据第三请求信息,向计算设备发送第三响应信息。
其中,第三请求信息为根据第三共享协议编码的请求信息,第三请求信息用于获取或更新第三数据,第三数据属于目标存储设备和/或源存储设备。第三共享协议为多个共享协议中的任一个协议。第三响应信息为根据第三共享协议编码的请求信息,第三响应信息包括第三数据或第三数据的更新信息。
本申请实施例中,目标存储设备可以在迁移源文件系统的同时,接收来自于计算设备的访问请求,并响应计算设备的访问请求。也即,目标存储设备可以持续地为计算设备提供在线的存储服务,并可以在后台迁移源文件系统,从而同时满足用户的迁移和存储需求。
结合第一方面,在第一方面的某些实现方式中,在第三请求信息用于更新第三数据的情况下,目标存储设备根据第三共享协议,对第三请求信息进行解码,确定解码后的第三请求信息;在目标存储设备中存在第三数据的情况下,目标存储设备根据解码后的第三请求信息,更新第三数据;在目标存储设备中不存在第三数据的情况下,目标存储设备将第三迁移任务的优先级设置为高,第三迁移任务用于将第三数据迁移至目标存储设备中。
本申请实施例中,目标存储设备可以在接收到来自于计算设备的更新请求时,确定目标存储设备中是否存在第三数据。目标存储设备还可以在目标存储设备中不存在第三数据的情况下,优先迁移第三数据,从而便于后续读取或更新第三数据,进而可以缩短响应计算设备的请求的时间。
结合第一方面,在第一方面的某些实现方式中,目标存储设备记录解码后的第三请求信息;目标存储设备在完成第三迁移任务后,根据记录的解码后的第三请求信息,更新目标存储设备中的第三数据。
本申请实施例中,目标存储设备可以通过记录第三请求信息,在完成第三迁移任务后,即在目标存储设备中存在第三数据后,在源存储设备与目标存储设备中同步更新第三数据,从而保证源存储设备与目标存储设备中的文件或数据的一致性。
结合第一方面,在第一方面的某些实现方式中,目标存储设备向源存储设备发送第三请求信息;目标存储设备接收来自于源存储设备的第四响应信息;目标存储设备根据第三共享协议,对第四响应信息进行解码,确定解码后的第四响应信息;目标存储设备根据解码后的第四响应信息,向计算设备发送第三响应信息。
其中,第四响应信息为根据第三共享协议编码的响应信息,第四响应信息包括第三数据或源存储 设备中的第三数据的更新信息。
本申请实施例中,目标存储设备可以在源存储设备读取或更新第三数据后,获得来自于源存储设备的响应信息,从而确定源存储设备中的第三数据或第三数据的更新情况。目标存储设备还可以根据源存储设备中的第三数据或第三数据的更新情况,向计算设备发送第三响应信息,从而使计算设备可以获得第三数据或第三数据在源存储设备和/或目标存储设备中的更新情况。
结合第一方面,在第一方面的某些实现方式中,目标存储设备根据源存储设备中的源文件系统的权限信息,确定目标存储设备中的目标文件系统的权限信息,目标文件系统的权限信息与源文件系统中的权限信息相同。
本申请实施例中,目标文件系统可以保留源文件系统的权限信息,从而可以保护源文件系统和/或目标文件系统中的文件或数据的安全,进而可以使计算设备在访问目标文件系统时不易出错。
第二方面,提供了一种迁移文件系统的方法。该方法包括:源存储设备接收来自于目标存储设备的第一请求信息和第二请求信息;源存储设备根据第一请求信息,确定第一响应信息;源存储设备根据第二请求信息,确定第二响应信息;源存储设备向目标存储设备发送第一响应信息和第二响应信息。
其中,第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。多个共享协议中的任一个共享协议用于访问源存储设备中的数据。第一响应信息为根据第一共享协议编码的信息,第二响应信息为根据第二共享协议编码的信息。第一响应信息中包括第一数据,第二响应信息中包括第二数据。
本申请实施例中,目标存储设备可以基于多种不同的协议迁移源存储设备中的数据,因此在源存储设备中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效降低迁移文件系统的成本。本申请实施例还可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。目标存储设备还可以直接获得来自于源存储设备的第一响应信息和第二响应信息,而无需经过迁移工具的转发,从而可以减少迁移工具对第一响应信息和第二响应信息进行编解码处理的次数,缩短迁移源文件系统的时间。
结合第二方面,在第二方面的某些实现方式中,多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
本申请实施例中,目标存储设备和源存储设备可以支持多种不同的协议,从而可以使目标存储设备根据多种不同的协议迁移源存储设备中的源文件系统,而不需要使用额外的支持不同协议的迁移工具,从而可以降低迁移文件系统的成本。
结合第二方面,在第二方面的某些实现方式中,源存储设备根据第一共享协议,对第一请求信息进行解码,确定解码后的第一请求信息,解码后的第一请求信息用于获取第一数据;源存储设备根据解码后的第一请求信息,确定第一数据;源存储设备根据第一共享协议,对第一数据进行编码,确定第一响应信息。
本申请实施例中,目标存储设备可以基于第一共享协议访问源存储设备中的数据,从而可以将源存储设备中基于第一共享协议共享的数据迁移至目标存储设备中。类似地,目标存储设备还可以基于第二共享协议访问源存储设备中的数据,从而可以将源存储设备中基于第二共享协议共享的数据迁移至目标存储设备中。也即,本申请实施例可以在源存储设备基于多个共享协议共享数据的情况下,实现源存储设备中的数据的完整迁移。
结合第二方面,在第二方面的某些实现方式中,源存储设备接收来自于目标存储设备的第三请求信息;源存储设备根据第三请求信息,确定第三数据或第三数据的更新信息;源存储设备根据第三共享协议,对第三数据或第三数据的更新信息进行编码,确定第四响应信息;源存储设备向目标存储设备发送第四响应信息。
其中,第三请求信息为根据第三共享协议编码的请求信息,第三请求信息用于获取或更新第三数据。第三数据属于源存储设备。第三共享协议为多个共享协议中的任一个协议。第四响应信息包括第三数据或第三数据的更新信息。
本申请实施例中,源存储设备在读取或更新第三数据后,可以向目标存储设备发送响应信息,从 而使目标存储设备可以确定源存储设备中的第三数据或第三数据的更新情况,进而可以向计算设备进行反馈。
结合第二方面,在第二方面的某些实现方式中,源存储设备向目标存储设备发送配置信息,配置信息为源存储设备中的源文件系统的配置信息,配置信息包括源文件系统的结构信息和/或权限信息。
本申请实施例中,源存储设备可以将源文件系统的结构信息发送给目标存储设备,从而使目标存储设备可以合理利用该结构信息,确定至少一个迁移任务,从而缩短迁移时间。本申请实施例中,源存储设备还可以将源文件系统的权限信息发送给目标存储设备,从而使目标存储设备可以保留源文件系统的权限信息,进而可以包括源文件系统的安全。
第三方面,本申请实施例提供一种存储装置,该存储装置包括用于实现第一方面或第一方面的任一种可能的实现方式的单元,或者该存储装置包括用于实现第二方面或第二方面的任一种可能的实现方式的单元。
第四方面,本申请实施例提供一种存储设备,该存储设备包括处理器,该处理器用于与存储器耦合,读取并执行该存储器中的指令和/或程序代码,以执行第一方面或第一方面的任一种可能的实现方式,或者以执行第二方面或第二方面的任一种可能的实现方式。
第五方面,本申请实施例提供一种芯片系统,该芯片系统包括逻辑电路,该逻辑电路用于与输入/输出接口耦合,通过该输入/输出接口传输数据,以执行第一方面或第一方面任一种可能的实现方式,或者以执行第二方面或第二方面的任一种可能的实现方式。
第六方面,本申请实施例提供一种存储介质,该存储介质存储有程序代码,当该存储介质在存储设备上运行时,使得存储设备执行如第一方面或第一方面的任一种可能的实现方式,或者使得存储设备执行如第二方面或第二方面的任一种可能的实现方式。
第七方面,本申请实施例提供一种程序产品,该程序产品包括:程序代码,当该程序代码在存储设备上运行时,使得该存储设备执行如第一方面或第一方面的任一种可能的实现方式,或者使得该存储设备执行如第二方面或第二方面的任一种可能的实现方式。
第八方面,本申请实施例提供一种迁移系统,该迁移系统包括:如第一方面或第一方面的任一种可能的实现方式中的目标存储设备、以及如第二方面或第二方面的任一种可能的实现方式中的源存储设备。
附图说明
图1是文件系统的迁移系统100的示意性系统架构图。
图2是根据本申请一个实施例的存储设备200的示意性结构图。
图3是根据本申请一个实施例的迁移文件系统的方法的示意性流程图。
图4是根据本申请一个实施例的并行执行多个迁移任务的示意图。
图5是根据本申请另一实施例的迁移文件系统的方法的示意性流程图。
图6是根据本申请一个实施例的存储装置600的示意性结构图。
图7是根据本申请一个实施例的存储装置700的示意性结构图。
具体实施方式
下面将结合附图,对本申请实施例中的技术方案进行描述。
本申请实施例的技术方案可以迁移支持各种协议的存储设备中的文件系统。例如可以迁移支持网络文件系统(network file system,NFS)的存储设备中的文件系统,或者可以迁移支持服务器信息块(server message block,SMB)的存储设备中的文件系统,或者可以迁移支持简单存储服务协议(simple storage service,S3)的存储设备中的文件系统,或者可以迁移支持其他私有协议的存储设备中的文件系统等,本申请实施例对此并不限定。
本申请实施例的技术方案可以迁移各种类型的源存储设备中的文件系统,例如源存储设备可以与目标存储设备为不同产品类型的存储设备,或者源存储设备可以与目标存储设备为相同产品类型的存储设备,本申请实施例对此并不限定。
本申请实施例中的源存储设备可以是实体的存储服务器,或者可以是云端的云存储服务器等,本 申请实施例对此并不限定。本申请实施例中的目标存储设备可以是各种类型的存储设备,例如可以是实体的存储服务器,或者可以是云端的云存储服务器等,本申请实施例对此并不限定。本申请实施例中的目标存储设备可以与源存储设备物理连接,或者也可以通过网络等方式远程连接,本申请实施例对此并不限定。
图1是文件系统的迁移系统100的示意性系统架构图。图1中包括目标存储设备110、源存储设备120和计算设备130。
在一些实施例中,系统100中可以包括多个源存储设备120和/或多个计算设备130,即目标存储设备110可以迁移一个或多个源存储设备120中的每个源存储设备120的文件系统,目标存储设备110还可以与一个或多个计算设备130相连接。下面以系统100中包括一个源存储设备120和一个计算设备130为例进行说明。
目标存储设备110可以与源存储设备120相连接,从而可以迁移源存储设备120中的源文件系统。目标存储设备110可以与源存储设备120建立连接,并可以获得源存储设备120中的源文件系统的配置信息。该配置信息可以包括源文件系统的结构信息,该配置信息还可以包括以下至少一项:源文件系统的权限信息、用户信息或共享信息。目标存储设备110还可以根据源文件系统的配置信息,在目标存储设备110中创建目标文件系统。该目标文件系统的配置信息与源文件系统的配置信息相同。目标存储设备110还可以在创建目标文件系统后,开始迁移源存储设备120中的源文件系统。目标存储设备110在迁移源文件系统时,可以根据源文件系统的结构信息,确定至少一个迁移任务。该至少一个迁移任务中的每个迁移任务用于将源文件系统中的部分文件迁移至目标存储设备110中。目标存储设备110还可以并行执行该至少一个迁移任务中的一个或多个迁移任务。
目标存储设备110还可以在多个共享协议中确定第一共享协议和第二共享协议,该第一共享协议为多个共享协议中的任一个共享协议,该第二共享协议为多个共享协议中与第一共享协议不同的共享协议。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。私有协议可以是用户自行定义的协议。具体地,目标存储设备110可以根据第一迁移任务,确定第一共享协议。该第一迁移任务为该至少一个迁移任务中的任一个迁移任务,该第一迁移任务用于将源文件系统中的第一数据迁移至目标存储设备中。该第一数据为源存储设备120基于第一共享协议共享的数据。目标存储设备110可以根据第二迁移任务,确定第二共享协议。该第二迁移任务为该至少一个迁移任务中与第一迁移任务不同的迁移任务,该第二迁移任务用于将源文件系统中的第二数据迁移至目标存储设备中。该第二数据为源存储设备120基于第二共享协议共享的数据。
目标存储设备110还可以根据第一共享协议,确定第一请求信息,该第一请求信息为根据第一共享协议编码的请求信息,即第一请求信息的具体格式与第一共享协议规定的信息格式相同。该第一请求信息用于获取源存储设备120中的第一数据。目标存储设备110还可以根据第二共享协议,确定第二请求信息,该第二请求信息为根据第二共享协议编码的请求信息,即第二请求信息的具体格式与第二共享协议规定的信息格式相同。该第二请求信息用于获取源存储设备120中的第二数据。目标存储设备110还可以向源存储设备120发送该第一请求信息和第二请求信息。目标存储设备110还可以接收来自于源存储设备120的第一响应信息和第二响应信息。该第一响应信息为根据第一共享协议编码的响应信息,该第一响应信息中包括第一数据。该第二响应信息为根据第二共享协议编码的响应信息,该第二响应信息中包括第二数据。目标存储设备110还可以根据第一共享协议,对第一响应信息进行解码,从而获得并存储该第一数据。目标存储设备110还可以根据第二共享协议,对第二响应信息进行解码,从而获得并存储该第二数据。
目标存储设备110还可以与计算设备130相连接,从而可以在线接收来自于计算设备130的第三请求信息。该第三请求信息为根据第三共享协议编码的请求信息,即该第三请求信息的格式与第三共享协议规定的格式相同。该第三共享协议为多个共享协议中的任一个共享协议,该第三共享协议可以与第一共享协议和/或第二共享协议相同,或者也可以不同,本申请实施例对此并不限定。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个。私有协议可以是用户自行定义的协议。该第三请求信息用于获取或更新第三数据,该第三数据属于目标存储设备110和/或源存储设备120,即该第三数据为目标存储设备110和/或源存储设备120中的数据。也就是说,目标存储设备110可以在执行迁移 任务的同时,接收用户的访问或更新请求,从而为用户持续地提供存储服务。目标存储设备110可以在创建目标文件系统后,向源存储设备120发送第一指示信息,该第一指示信息用于指示源存储设备120与计算设备130断开连接。该第一指示信息中还可以包括目标存储设备110的网络地址。目标存储设备110可以在计算设备130与源存储设备120断开连接后,与计算设备130建立连接。目标存储设备110在与计算设备130建立连接后,可以接收来自于计算设备130的第三请求信息。目标存储设备110在接收到第三请求信息后,可以根据第三共享协议,对第三请求信息进行解码,确定解码后的第三请求信息。该解码后的第三请求信息用于获取或更新第三数据。
在解码后的第三请求信息用于更新第三数据的情况下,目标存储设备110可以确定目标存储设备110中是否存在第三数据,即确定第三数据是否已从源文件系统迁移至目标文件系统中。若目标存储设备110中存在第三数据,则目标存储设备110可以根据该解码后的第三请求信息,更新该第三数据。若目标存储设备110中不存在第三数据,则目标存储设备110可以将第三迁移任务的优先级设置为高,即目标存储设备110可以优先执行第三迁移任务。该第三迁移任务为第三数据所属的迁移任务,即第三迁移任务用于将源存储设备中的第三数据迁移至目标存储设备中。目标存储设备110还可记录第三请求信息或该解码后的第三请求信息。目标存储设备110还可以在第三迁移任务执行完成之后,根据记录的第三请求信息或解码后的第三请求信息,更新第三数据。
在解码后的第三请求信息用于更新第三数据的情况下,目标存储设备110还可以将第三请求信息发送给源存储设备120,并可以接收来自于源存储设备的第四响应信息。该第四响应信息为根据第三共享协议编码的响应信息,即第四响应信息的具体格式与第三共享协议规定的信息格式一致。该第四响应信息包括源存储设备120中第三数据的更新信息,该更新信息例如可以是源存储设备120中的第三数据已更新成功,或者源存储设备120中的第三数据未更新成功等。目标存储设备110还可以根据第三共享协议,对第四响应信息进行解码,从而获得源存储设备120中的第三数据的更新信息。目标存储设备110可以根据第四响应信息和/或目标存储设备110中的第三数据的更新情况,向计算设备发送第三响应信息。该第三响应信息为根据第三共享协议编码的响应信息,即第三响应信息的具体格式与第三共享协议规定的信息格式一致。该第三响应信息包括第三数据的更新信息,第三数据的更新信息例如第三数据已更新成功,或者第三数据未更新成功等。目标存储设备110还可以在发送第三响应信息前,删除记录的第三请求信息或解码后的第三请求信息。
在解码后的第三请求信息用于获取第三数据的情况下,目标存储设备110可以确定目标存储设备110中是否存在第三数据,即确定第三数据是否已成功迁移至目标文件系统中。若目标存储设备110中存在第三数据,则目标存储设备110可以直接向计算设备130发送第三响应信息。该第三响应信息为根据第三共享协议编码的响应信息,该第三响应信息中包括第三数据。若目标存储设备110中不存在第三数据,则目标存储设备110可以向源存储设备120发送第三请求信息。目标存储设备110还可以接收来自于源存储设备120的第四响应信息。该第四响应信息为根据第三共享协议编码的响应信息,该第四响应信息中包含第三数据。目标存储设备110还可以将第三迁移任务的优先级设置为高,即目标存储设备110可以优先执行第三迁移任务。该第三迁移任务为第三数据所属的迁移任务。或者,目标存储设备110可以不确定目标存储设备110中是否存在第三数据,直接向源存储设备120发送第三请求信息。也即,不论目标存储设备110中是否存在第三数据,目标存储设备110均可以直接将第三请求信息转发给源存储设备120,从而获得来自于源存储设备120的第四响应信息。目标存储设备110还可以将第三响应信息发送给计算设备130。目标存储设备110还可以在发送第三响应信息前,删除记录的第三请求信息或解码后的第三请求信息。
源存储设备120中包含源文件系统,源存储设备120可以与计算设备130和目标存储设备110相连接。源存储设备120与目标存储设备110建立连接之后,可以将源文件系统的配置信息传递给目标存储设备110。该配置信息包括源文件系统的结构信息,该配置信息还可以包括以下至少一项:源文件系统的权限信息、用户信息或共享信息。源存储设备120还可以接收来自于目标存储设备110的第一指示信息,并根据该第一指示信息,断开与计算设备130的连接。该第一指示信息用于指示源存储设备120与计算设备130断开连接。在第一指示信息中包括目标存储设备110的网络地址的情况下,源存储设备120还可以在与计算设备130断开连接之前,向计算设备130发送第二指示信息。该第二指示信息中包含目标存储设备110的网络地址。
源存储设备120还可以在与目标存储设备110建立连接之后,接收来自于目标存储设备110的第一请求信息和第二请求信息。第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备120中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备120中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个,私有协议可以为用户自行定义的协议。源存储设备120还可以根据第一请求信息,确定第一响应信息。第一响应信息为根据第一共享协议编码的信息,第一响应信息中包括第一数据。源存储设备120还可以根据第二请求信息,确定第二响应信息。第二响应信息为根据第二共享协议编码的信息,第二响应信息中包括第二数据。具体地,源存储设备120可以根据第一共享协议,对第一请求信息进行解码,确定解码后的第一请求信息。该解码后的第一请求信息用于获取第一数据。源存储设备120还可以根据解码后的第一请求信息,确定第一数据。源存储设备120还可以根据第一共享协议,对第一数据进行编码,从而确定第一响应信息。源存储设备120确定第二响应信息与确定第一响应信息的具体实现方式类似,此处不再赘述。源存储设备120还可以向目标存储设备110发送第一响应信息和第二响应信息。
源存储设备120还可以接收来自于目标计算设备的第三请求信息,该第三请求信息用于获取或更新第三数据,第三数据属于源存储设备120。第三请求信息为根据第三共享协议编码的请求信息,第三共享协议为多个共享协议中的任一个协议。源存储设备120可以在接收到第三请求信息后,根据第三共享协议,对第三请求信息进行解码,确定解码后的第三请求信息。源存储设备120还可以根据解码后的第三请求信息,读取或更新源存储设备120中的第三数据,从而确定第三数据或第三数据的更新信息。源存储设备120还可以根据第三共享协议,对第三数据或第三数据的更新信息进行编码,从而确定第四响应信息,也即,该第四响应信息为根据第三共享协议编码的响应信息,该第四响应信息包括第三数据或第三数据的更新信息。第三数据的更新信息例如可以是源存储设备120中的第三数据已更新成功,或者可以是源存储设备120中的第三数据未成功更新等。源存储设备120还可以向目标存储设备110发送第四响应信息。
计算设备130可以与目标存储设备110或源存储设备120相连接,从而可以访问目标文件系统或源文件系统。计算设备130可以在与源存储设备120连接的情况下,接收来自于源存储设备120的第二指示信息,从而断开与源存储设备120的连接。该第二指示信息用于指示计算设备130与源存储设备120断开连接。在该第二指示信息中包含目标存储设备110的网络地址的情况下,计算设备130还可以在与源存储设备120断开连接之后,与目标存储设备110建立连接。在与目标存储设备110连接的情况下,计算设备130可以通过目标存储设备110访问源文件系统或目标文件系统。该源文件系统为源存储设备120中的文件系统,该目标文件系统为目标存储设备110中的文件系统。计算设备130还可以向目标存储设备110发送第三请求信息。该第三请求信息用于获取或更新第三数据。该第三数据为源文件系统和/或目标文件系统中的数据。计算设备130还可以接收来自于目标存储设备110的第三响应信息,该第三响应信息包括第三数据或第三数据的更新信息。
图1中的目标存储设备110可以基于多种不同的协议与源存储设备120和/或计算设备130传输数据,因此在源存储设备120中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效降低迁移文件系统的成本。本申请实施例可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。目标存储设备110还可以在解码后直接存储从源存储设备120中读取的数据,而不需要使信息经过迁移工具再次进行编解码处理后,才可被目标存储设备110接收到编码后的信息,并且目标存储设备110还需再次进行解码处理后才可存储获取的数据,因此可以缩短迁移时间。
同时,图1中的目标存储设备110中的目标文件系统还可以保留源文件系统的权限信息,有效保护源文件系统和/或目标文件系统中的文件的安全。并且,在源存储设备120与计算设备130断开连接后,目标存储设备110不需要迁移增量数据,而可以在较短的时间内直接与计算设备130建立连接,从而可以缩短中断服务的时间。此外,目标存储设备110还可以通过记录来自于计算设备130的第三请求信息,并在源文件系统和目标文件系统中同步更新第三数据,从而可以保证源文件系统与目标文件系统中数据的一致性。
图2是根据本申请实施例提供的存储设备200的示意性结构图。存储设备200包括第一通信模块210、迁移模块220、输入输出(input output,IO)模块230、目标文件系统模块240、第二通信模块250和配置模块260。图2中的存储设备200与图1中的目标存储设备110类似。
第一通信模块210可以用于与计算设备相通信,例如接收来自于计算设备的第三请求信息,或者向计算设备发送第三响应信息。该计算设备可以是图1中的计算设备130。该第三请求信息为根据第三共享协议编码的请求信息,该第三请求信息用于获取或更新第三数据。该第三共享协议为多个共享协议中的任一个共享协议,该多个共享协议包括NFS、SMB、S3、或私有协议中的多个。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。私有协议可以是用户自行定义的协议。该第三数据可以是存储设备200中的数据或源存储设备中的数据。该源存储设备可以是图1中的源存储设备120。第一通信模块210在接收到第三请求信息后,可以根据第三共享协议,对第三请求信息进行解码,确定解码后的第三请求信息。第一通信模块210还可以向IO模块230发送该解码后的第三请求信息,并可以接收来自于IO模块的第三数据或第三数据的更新信息。第一通信模块210还可以根据第三共享协议,确定第三响应信息,该第三响应信息为根据第三共享协议编码的响应信息。该第三响应信息中包括第三数据或第三数据的更新信息。第一通信模块210还可以向计算设备发送该第三响应信息。
迁移模块220可以用于执行至少一个迁移任务,该至少一个迁移任务中的每个迁移任务用于将源存储设备中的部分文件迁移至存储设备200中。每个迁移任务可以包括一个扫描任务和一个复制任务。迁移模块220可以确定至少一个扫描任务,每个扫描任务可以用于对源文件系统中的部分文件或数据进行扫描。每个扫描任务可以包括一个或多个扫描线程。迁移模块220可以通过分布式爬虫的方法对源文件系统中包含的部分或全部文件进行遍历,从而完成每个扫描任务。迁移模块220还可以确定至少一个复制任务,每个复制任务可以用于对源文件系统中的部分文件或数据进行复制。每个复制任务可以包括一个或多个复制线程。该至少一个扫描任务可以与该至少一个复制任务一一对应。也即,迁移模块220可以根据第一扫描任务,通过第二通信模块250向源存储设备发送第一请求信息,该第一请求信息用于获取第一数据。该第一数据为第一扫描任务中待扫描的文件或数据,例如可以是待扫描的文件的目录、待扫描的文件的内容等。该第一扫描任务为至少一个扫描任务中的任一扫描任务。迁移模块220还可以根据第一复制任务,通过IO模块230将获取的第一数据写入目标文件系统模块240中。该第一复制任务为与第一扫描任务对应的复制任务。
迁移模块220可以并行执行该至少一个迁移任务中的一个或多个迁移任务。迁移模块220还可以根据存储设备200的实际运行能力,控制并行执行的迁移任务的数量,从而避免对存储设备200的正常运行造成影响。源文件系统中可以包括至少一个存储节点,每个存储节点可以视为源文件系统中的一个存储空间,每个存储节点中可以包括至少一级目录和/或至少一个文件。该至少一级目录中的每级目录可以包括该至少一个文件中的部分文件。迁移模块220可以根据源文件系统中包括的至少一个存储节点,将每个存储节点中的目录划分为多个子节点,并为每个子节点分配一个迁移任务。迁移模块220还可以确定目标扫描队列,该目标扫描队列中包括每个存储节点的至少一个子节点中每个子节点的迁移任务。
IO模块230可以用于提供锁机制,从而可以避免存储设备200在执行迁移任务的同时,响应计算设备的第三请求信息时发生读写错误。IO模块230可以在迁移模块220执行复制任务时,提供互斥锁,从而避免多个线程同时对同一对象进行读写操作而导致读写出错。IO模块230还可以在响应计算设备的第三请求信息(例如更新第三数据)时,提供互斥锁,从而避免迁移任务的至少一个线程与更新第三数据的线程同时对同一对象进行读写操作而导致读写出错。
IO模块230还可以通过第二通信模块250,接收来自于源存储设备的第一数据和第二数据,并可以将该第一数据和第二数据写入目标文件系统模块240中。IO模块230还可以接收来自于第一通信模块的解码后的第三请求信息。IO模块230还可以记录该解码后的第三请求信息。该解码后的第三请求信息可以用于读取或更新第三数据。
在解码后的第三请求信息用于更新第三数据的情况下,IO模块230可以在接收到解码后的第三请求信息时,将该解码后的第三请求信息发送给第二通信模块250,从而使第二通信模块250可以将第三请求信息发送给源存储设备。IO模块230可以通过第二通信模块250接收解码后的第四响应信息。该解码后的第四响应信息包括源存储设备中的第三数据的更新信息。IO模块230还可以确定目标文件系 统模块240中是否包含第三数据。若目标文件系统模块240中包含该第三数据,则IO模块230可以根据该解码后的第三请求信息,更新该第三数据。若目标文件系统模块240中不包含该第三数据,则IO模块230可以将第三迁移任务的优先级设置为高,使迁移模块220优先执行第三迁移任务。该第三迁移任务为第三数据所属的迁移任务。IO模块230还可以在执行完第三迁移任务后,即目标文件系统模块240中包含该第三数据后,根据该解码后的第三请求信息,更新目标文件系统模块240中的第三数据。IO模块230还可以通过第一通信模块210向计算设备发送第三响应信息,该第三响应信息中包括第三数据的更新信息。IO模块230还可以在向计算设备发送第三响应信息前,删除记录的解码后的第三请求信息。
在解码后的第三请求信息用于读取第三数据的情况下,IO模块230可以在接收到解码后的第三请求信息时,将该解码后的第三请求信息发送给第二通信模块250,并可以通过第二通信模块250接收解码后的第四响应信息。该解码后的第四响应信息包括第三数据。IO模块230还可以通过第一通信模块210向计算设备发送第三响应信息,该第三响应信息中包括第三数据。或者,IO模块230可以确定目标文件系统模块240中是否包含该第三数据。若目标文件系统模块240中包含该第三数据,则IO模块230可以直接读取该第三数据,并通过第一通信模块210向计算设备发送第三响应信息。若目标文件系统模块240中不包含该第三数据,则IO模块230可以将第三迁移任务的优先级设置为高,使迁移模块220优先执行第三迁移任务。该第三迁移任务为第三数据所属的迁移任务。IO模块230还可以在向计算设备发送第三响应信息前,删除记录的解码后的第三请求信息。
目标文件系统模块240可以存储从源存储设备中迁移出的文件或数据,例如第一数据和/或第二数据。目标文件系统模块240中包括目标文件系统,目标文件系统的配置信息与源文件系统的配置信息相同。该配置信息包括结构信息,该配置信息还可以包括以下至少一项:权限信息、用户信息或共享信息。该源文件系统为源存储设备中的文件系统。在IO模块230接收到第一数据和/或第二数据后,目标文件系统模块240可以被IO模块230访问,从而使IO模块230可以将第一数据和/或第二数据写入目标文件系统模块240中。在IO模块230接收到解码后的第三请求信息时,目标文件系统模块240可以被IO模块230访问,从而使IO模块230可以确定目标文件系统模块240中是否存在第三数据。在目标文件系统模块240中存在第三数据的情况下,目标文件系统模块240还可以被IO模块230访问,从而使IO模块230可以更新第三数据。例如,目标文件系统模块240可以接收来自于IO模块230的写入指令,并根据该写入指令,对第三数据进行更新。对第三数据进行更新包括:删除第三数据或修改第三数据等。
第二通信模块250可以用于与源存储设备相通信,例如向源存储设备发送第一请求信息、第二请求信息、或第三请求信息中的一个或多个信息,或者接收来自于源存储设备的第一响应信息、第二响应信息、或第四响应信息中的一个或多个信息。源存储设备可以是图1中的源存储设备120。该第一请求信息为根据第一共享协议编码的请求信息,该第一共享协议为多个共享协议中的任一个协议。该第二请求信息为根据第二共享协议编码的请求信息,该第二共享协议为多个共享协议中与第一共享协议不同的协议。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个。私有协议可以是用户自行定义的协议。该第一请求信息用于获取源存储设备中的第一数据,该第二请求信息用于获取源存储设备中的第二数据。第二通信模块250可以同时与多个源存储设备连接,即可以同时访问或迁移多个源存储设备中的文件系统。第二通信模块250还可以根据存储设备200的实际运行能力,控制并行访问或迁移多个源存储设备中的文件系统的数量。第二通信模块250还可以维护与至少一个源存储设备中每个源存储设备的连接关系,并使一个或多个会话处于活跃状态,该一个或多个会话为第二通信模块250与一个或多个源存储设备之间的会话。第二通信模块250还可以在与源存储设备断开连接的情况下,重新建立与源存储设备之间的连接。
第二通信模块250还可以提供统一的接口,从而可以忽略源存储设备自身支持使用的共享协议对迁移源文件系统的影响。也即,无论源存储设备支持使用的是哪种共享协议,第二通信模块250中提供的接口均可基于该共享协议,确定对应的请求信息。该对应的请求信息为基于该共享协议编码的请求信息,该对应的请求信息用于获取源存储设备中的部分文件或数据。第二通信模块250还可以提供基于可移植操作系统接口(portable operating system interface,POSIX)的应用程序编程接口(application programming interface,API)或内部模块,例如对应于不同协议的堆栈、用于存储第三请求信息或响 应信息的缓存、用于编码或解码的外部数据表示法(external data representation,XDR)编解码器、在多个线程中运行的注册了文件描述符(file descriptor,FD)的连接池等,从而便于存储设备200内部执行迁移任务或响应计算设备的第三请求信息。例如,第二通信模块250可以根据第一共享协议,确定第一请求信息。第二通信模块250还可以根据第二共享协议,确定第二请求信息。第二通信模块250还可以根据第三共享协议,对解码后的第三请求信息进行编码,从而确定第三请求信息。第二通信模块250还可以在接收到来自于源存储设备的第四响应信息后,根据第三共享协议,对第四响应信息进行解码,确定解码后的第四响应信息,并发送给IO模块230。第一共享协议、第二共享协议和第三共享协议为源存储设备支持使用的共享协议。
配置模块260用于获取源存储设备中的源文件系统的配置信息,该配置信息包括结构信息。该配置信息还可以包括权限信息、用户信息、或共享信息中的任一种或多种。结构信息用于指示源文件系统的结构与结构中的节点的信息,该结构例如可以是四叉树(quadtree,Qtrees)结构等。权限信息用于指示源文件系统中的部分或全部文件可以被访问的用户的信息。权限信息例如可以是安全标识符(security identifiers,SID)、模式位(mode bits)、访问控制列表(access control lists,ACL)、活动目录服务(active directory service,ADS)信息等。用户信息用于指示源文件系统中的文件所属的用户的信息。共享信息用于指示可以通过远程访问的源文件系统中的文件或数据信息。配置模块260可以在存储设备200与源存储设备建立连接之后,获得源存储设备中的源文件系统的配置信息,还可以根据源文件系统的配置信息,在存储设备200中创建目标文件系统。配置模块260在创建目标文件系统后,可以通过第二通信模块250,向源存储设备发送第一指示信息,该第一指示信息可以用于指示源存储设备与计算设备断开连接。该第一指示信息中还可以包括存储设备200的网络地址。在配置模块260发送第一指示信息后,存储设备200可以与计算设备建立连接,并通过第一通信模块210与计算设备传输数据。
在一些实施例中,存储设备200还可以包括日志模块270。日志模块270中可以包括预写日志(write ahead log,WAL),该预写日志可以用于记录第三请求信息或解码后的第三请求信息。在IO模块230接收到解码后的第三请求信息后,IO模块230可以将该解码后的第三请求信息存储至日志模块270中。在向计算设备发送第三响应信息前,IO模块230还可以删除日志模块270中的解码后的第三请求信息。该第三响应信息为响应该第三请求信息的信息。
存储设备200可以基于多种不同的协议与源存储设备和/或计算设备传输数据,因此在源存储设备中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效降低迁移文件系统的成本。本申请实施例可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。存储设备200还可以在解码后直接存储从源存储设备中读取的数据,而不需要经过迁移工具再次进行信息的编解码处理,因此可以缩短迁移时间。存储设备200中还可以保留源文件系统的权限信息,有效保护源文件系统和/或目标文件系统中的文件的安全。并且,在源存储设备与计算设备断开连接后,存储设备200不需要迁移增量数据,而可以在较短的时间内直接与计算设备建立连接,从而可以缩短中断服务的时间。此外,存储设备200还可以通过记录来自于计算设备的第三请求信息或解码后的第三请求信息,并在源文件系统和目标文件系统中同步更新第三数据,从而可以保证源文件系统与目标文件系统中数据的一致性。
图3是本申请实施例提供的迁移文件系统的方法的示意性流程图,图3中包括如下步骤。
S310,发送第一请求信息和第二请求信息。
目标存储设备可以向源存储设备发送第一请求信息和第二请求信息。该第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。
可选地,目标存储设备可以通过多个共享协议访问源存储设备中的数据。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个。私有协议可以是用户自行定义的协议。
可选地,在步骤S310前,目标存储设备可以与源存储设备建立连接。
在一些实施例中,可以通过人工配置的方式使得目标存储设备与源存储设备建立连接。或者,目 标存储设备可以通过与该目标存储设备连接的其他设备,获得源存储设备的网络地址,从而与源存储设备建立连接。或者,目标存储设备可以接收来自于源存储设备的连接请求,从而与源存储设备建立连接,本申请实施例对此并不限定。
可选地,与源存储设备建立连接之后,目标存储设备可以获得源存储设备中的源文件系统的配置信息。该配置信息包括结构信息,该配置信息还可以包括以下至少一项:权限信息、用户信息或共享信息。
在一些实施例中,结构信息用于指示源文件系统的结构与结构中的节点的信息,该结构例如可以是Qtrees结构等。该结构信息例如可以包括源文件系统的至少一个存储节点、每个存储节点包括的目录、或每个存储节点的每个目录中包括的文件等信息。
在一些实施例中,权限信息用于指示源文件系统中的部分或全部文件可以被访问的用户的信息。权限信息例如可以是SID、mode bits、ACL、或ADS等信息。用户信息用于指示源文件系统中的文件所属的用户的信息。共享信息用于指示可以通过远程访问的源文件系统中的文件或数据信息。
本申请实施例对获得源文件系统的配置信息的方式不做具体限定,例如目标存储设备可以访问源文件系统,从而获得源文件系统的配置信息。或者,目标存储设备可以向源存储设备发送访问请求,该访问请求用于请求获得源存储设备的配置信息。目标存储设备还可以接收来自于源存储设备的配置信息。
可选地,目标存储设备可以根据源文件系统的配置信息,在目标存储设备中创建目标文件系统。该目标文件系统的配置信息与源文件系统的配置信息相同。
可选地,目标存储设备可以根据源文件系统的结构信息,确定至少一个迁移任务。该至少一个迁移任务中的每个迁移任务用于将源存储设备中的部分文件迁移至目标存储设备中,也即,每个迁移任务用于对源文件系统中的部分文件进行扫描和复制。换句话说,每个迁移任务可以包括一个扫描任务和一个复制任务。目标存储设备可以确定至少一个扫描任务和至少一个复制任务,该至少一个扫描任务与至少一个复制任务一一对应。该至少一个扫描任务中的每个扫描任务可以用于对源文件系统中的部分文件或数据进行扫描,从而确定待迁移的文件和/或文件的具体内容。该至少一个复制任务中的每个复制任务可以用于对源文件系统中的部分文件或数据进行复制。也即,每个扫描任务用于读取源文件系统中的部分文件或数据,每个复制任务用于将对应的扫描任务读取的文件或数据写入目标文件系统中。
在一些实施例中,目标存储设备可以串行执行该至少一个迁移任务中的每个迁移任务,即目标存储设备每次可以仅执行一个迁移任务,并为该迁移任务分配可执行的所有资源。或者,目标存储设备可以并行执行该至少一个迁移任务中的一个或多个迁移任务,即目标存储设备每次可以执行多个迁移任务,该多个迁移任务共享可执行的所有资源,本申请实施例对此并不限定。
应理解,目标存储设备不仅可以迁移源文件系统中的文件的内容和文件的属性等,还可以迁移源文件系统中的元数据和源文件系统的属性。文件的属性可以包括文件的类型、文件的大小、文件的时间信息等。文件的时间信息可以包括文件的创建时间、文件的修改时间等。源文件系统为源存储设备中的文件系统,源文件系统的属性可以包括源文件系统的类型、源文件系统的大小、源文件系统的时间信息等。源文件系统的时间信息可以包括源文件系统的创建时间、源文件系统的修改时间等。元数据用于描述源文件系统中的文件或数据。基于不同的协议,元数据一般不同。
在一些实施例中,目标存储设备可以根据目标存储设备当前的迁移能力、运行速度、可用带宽等因素,控制并行执行的迁移任务的数量,从而在最大化迁移吞吐量的同时,避免影响目标存储设备对计算设备的响应。
在一些实施例中,源文件系统中可以包括至少一个存储节点,每个存储节点可以视为源文件系统中的一个存储空间,每个存储节点中可以包括至少一级目录和/或至少一个文件。该至少一级目录中的每级目录可以包括该至少一个文件中的部分文件。目标存储设备可以根据源文件系统中包括的至少一个存储节点,将每个存储节点中的目录或文件划分为至少一个子节点,并为至少一个子节点中的每个子节点分配一个迁移任务。也即,目标存储设备可以为每个子节点分配一个扫描任务和一个复制任务。
在目标存储设备并行执行多个迁移任务的情况下,目标存储设备还可以确定目标扫描队列,该目标扫描队列中包括至少一个子节点中每个子节点的迁移任务。也即,该目标扫描队列中包括每个子节 点的扫描任务和复制任务。每个扫描任务可以包括一个或多个扫描线程,每个复制任务可以包括一个或多个复制线程。目标存储设备可以在同一时刻并行执行多个子节点的扫描线程和/或复制线程。
在一些实施例中,目标存储设备并行执行多个迁移任务的具体方式如图4所示。图4为本申请实施例的并行执行多个迁移任务的示意图。图4中包括目标扫描队列,该目标扫描队列中包括子节点1、子节点2、……、子节点N的迁移任务,N为大于或等于1的正整数。每个子节点的迁移任务可以包括一个扫描线程和一个复制队列,每个子节点的复制队列中可以包括至少一个复制线程。例如,子节点1的迁移任务可以包括一个扫描线程和一个复制队列,该复制队列中包括m1个复制线程,分别为复制线程1至复制线程m1。其中,m1为大于或等于1的正整数。类似地,子节点2的迁移任务中包括一个扫描线程和一个复制队列,该复制队列中包括复制线程m1+1至复制线程m2。其中,m2为大于或等于m1+1的正整数。子节点N的迁移任务中包括一个扫描线程和一个复制队列,该复制队列中包括复制线程mN-1+1至复制线程mN。其中,mN为大于或等于mN-1+1的正整数。目标存储设备可以同时执行子节点1至子节点N中每个子节点的迁移任务。子节点1至子节点N可以是同一存储节点的子节点,也可以是不同存储节点的子节点,本申请实施例对此并不限定。
应理解,图4中每个子节点的迁移任务包括一个扫描线程和一个复制队列,每个复制队列包括一个或多个复制线程仅为示例性说明。本申请实施例不对每个子节点的迁移任务包含的扫描线程和/或复制线程的数量做具体限定。例如,每个子节点的迁移任务可以包括一个扫描队列和一个复制队列,每个扫描队列包括一个或多个扫描线程,每个复制队列包括一个或多个复制线程。
在一些实施例中,目标存储设备可以通过分布式爬虫的方法对源文件系统中的文件或数据进行遍历,从而完成每个子节点的扫描任务。
在一些实施例中,目标存储设备可以根据第一迁移任务,确定第一请求信息。该第一迁移任务为多个迁移任务中的任一个迁移任务,第一迁移任务用于将第一数据迁移至目标存储设备中。
在一些实施例中,目标存储设备可以根据第一扫描任务中待扫描的文件或数据,即根据第一数据,从多个共享协议中确定可以访问该第一数据的共享协议,即确定第一共享协议。第一扫描任务为第一迁移任务包括的扫描任务。目标存储设备还可以根据第一共享协议,对用于获取源存储设备中的第一数据的信息进行编码,从而确定第一请求信息。也即,该第一请求信息为根据第一共享协议编码的信息,该第一请求信息用于获取源存储设备中的第一数据。换句话说,第一请求信息的格式与第一共享协议规定的信息格式相同。
在一些实施例中,目标存储设备可以根据第二迁移任务,确定第二请求信息。该第二迁移任务为多个迁移任务中与第一迁移任务不同的迁移任务,第二迁移任务用于将第二数据迁移至目标存储设备中。
在一些实施例中,目标存储设备可以根据第二扫描任务中待扫描的文件或数据,即根据第二数据,从多个共享协议中确定可以访问该第二数据的共享协议,即确定第二共享协议。第二扫描任务为第二迁移任务包括的扫描任务。目标存储设备还可以根据第二共享协议,对用于获取源存储设备中的第二数据的信息进行编码,从而确定第二请求信息。也即,该第二请求信息为根据第二共享协议编码的信息,该第二请求信息用于获取源存储设备中的第二数据。换句话说,第二请求信息的格式与第二共享协议规定的信息格式相同。
在一些实施例中,第一数据和/或第二数据不仅可以包括源文件系统中的文件的具体内容和基本属性,还可以包括与SMB协议相关的数据,例如扩展属性(xattr)或ADS等。具体地,目标存储设备可以在与源存储设备连接的SMB会话中设置ACL,从而获取与SMB协议相关的数据。
可选地,目标存储设备可以根据第一迁移任务和第二迁移任务,确定第一请求信息和第二请求信息,并向源存储设备发送第一请求信息和第二请求信息。
在一些实施例中,第一请求信息中包含第一标识信息,该第一标识信息用于指示源存储设备根据第一共享协议对第一数据进行编码。第二请求信息中包含第二标识信息,该第二标识信息用于指示源存储设备根据第二共享协议对第二数据进行编码。
在一些实施例中,目标存储设备可以同时发送第一请求信息和第二请求信息。或者,目标存储设备可以先发送第一请求信息,再发送第二请求信息。换句话说,源存储设备可以同时接收到第一请求信息和第二请求信息。或者,源存储设备可以先接收到第一请求信息,再接收到第二请求信息,本申 请实施例对此并不限定。
S320,根据第一请求信息,确定第一响应信息。
源存储设备在接收到来自于目标存储设备的第一请求信息后,可以根据该第一请求信息,确定第一响应信息。第一响应信息为根据第一共享协议编码的信息,第一响应信息中包括第一数据。
在一些实施例中,源存储设备在接收到第一请求信息后,可以根据第一共享协议,对第一请求信息进行解码,确定解码后的第一请求信息。该解码后的第一请求信息用于获取第一数据。源存储设备还可以根据解码后的第一请求信息,读取该第一数据,并根据第一共享协议,对第一数据进行编码,从而确定第一响应信息。
在一些实施例中,源存储设备可以根据第一请求信息中的第一标识信息,确定第一共享协议。源存储设备还可以根据第一共享协议,对第一请求信息或第一数据进行编解码处理。
S330,根据第二请求信息,确定第二响应信息。
源存储设备在接收到来自于目标存储设备的第二请求信息后,可以根据该第二请求信息,确定第二响应信息。第二响应信息为根据第二共享协议编码的信息,第二响应信息中包括第二数据。
在一些实施例中,源存储设备在接收到第二请求信息后,可以根据第二共享协议,对第二请求信息进行解码,确定解码后的第二请求信息。该解码后的第二请求信息用于获取第二数据。源存储设备还可以根据解码后的第二请求信息,读取该第二数据,并根据第二共享协议,对第二数据进行编码,从而确定第二响应信息。
在一些实施例中,源存储设备可以根据第二请求信息中的第二标识信息,确定第二共享协议。源存储设备还可以根据第二共享协议,对第二请求信息或第二数据进行编解码处理。
S340,接收第一响应信息和第二响应信息。
目标存储设备可以在向源存储设备发送请求信息后,接收来自于源存储设备的响应信息。具体地,目标存储设备可以在向源存储设备发送第一请求信息后,接收来自于源存储设备的第一响应信息。该第一响应信息为根据第一共享协议编码的信息,该第一响应信息中包含第一数据。目标存储设备还可以在向源存储设备发送第二请求信息后,接收来自于源存储设备的第二响应信息。该第二响应信息为根据第二共享协议编码的信息,该第二响应信息中包含第二数据。
S350,根据第一共享协议,对第一响应信息进行解码,获得并存储第一数据。
目标存储设备在接收到第一响应信息和第二响应信息后,可以根据响应信息对应的共享协议,对响应信息进行解码,从而获得响应信息中包含的数据。具体地,目标存储设备可以在接收到第一响应信息后,根据第一共享协议,对第一响应信息进行解码,获得第一数据。目标存储设备还可以直接存储该第一数据。
在一些实施例中,第一响应信息中包含第一标识信息,该第一标识信息用于指示目标存储设备根据第一共享协议,对第一响应信息进行解码。
在一些实施例中,目标存储设备根据第一共享协议进行解码指的是:目标存储设备可以根据第一共享协议,确定第一响应信息的具体格式,并从第一响应信息中的第一位置中,读取第一数据。第一响应信息中的第一位置为根据第一共享协议规定的信息格式,第一响应信息中的第一数据的具体位置。
在一些实施例中,目标存储设备在获得第一数据后,可以直接将第一数据存储至目标文件系统中。该第一数据在目标文件系统中的位置与该第一数据在源文件系统中的位置一致。
在一些实施例中,目标存储设备在获得第一数据后,可以根据第一迁移任务中的第一复制任务,将第一数据写入目标文件系统中。
S360,根据第二共享协议,对第二响应信息进行解码,获得并存储第二数据。
目标存储设备可以在接收到第二响应信息后,根据第二共享协议,对第二响应信息进行解码,获得第二数据。目标存储设备还可以直接存储该第二数据。
在一些实施例中,第二响应信息中包含第二标识信息,该第二标识信息用于指示目标存储设备根据第二共享协议,对第二响应信息进行解码。
在一些实施例中,目标存储设备根据第二共享协议进行解码指的是:目标存储设备可以根据第二共享协议,确定第二响应信息的具体格式,并从第二响应信息中的第一位置中,读取第二数据。第二响应信息中的第一位置为根据第二共享协议规定的信息格式,第二响应信息中的第二数据的具体位置。
在一些实施例中,目标存储设备在获得第二数据后,可以直接将第二数据存储至目标文件系统中。该第二数据在目标文件系统中的位置与该第二数据在源文件系统中的位置一致。
在一些实施例中,目标存储设备在获得第二数据后,可以根据第二迁移任务中的第二复制任务,将第二数据写入目标文件系统中。
在一些实施例中,目标存储设备可以根据目标存储设备当前的迁移能力、运行速度、可用带宽等因素,控制并行执行的扫描任务和/或复制任务的数量,从而在最大化迁移吞吐量的同时,避免影响目标存储设备对计算设备的响应。
应理解,在使用迁移工具迁移第一数据时,迁移工具在从源存储设备中获得第一数据后,还需要再次进行协议转换,从而获得根据第一共享协议编码的信息,该信息中包含第一数据。迁移工具还需要将该信息发送给目标存储设备,从而使目标存储设备在解码该信息后获得第一数据。也就是说,本申请实施例中的目标存储设备可以在解码后直接存储从源存储设备中获取的数据,而不需要经过迁移工具再次进行信息的编解码处理,因此可以缩短迁移时间。
本申请实施例中的目标存储设备可以基于多种不同的协议与源存储设备传输数据,因此在源存储设备中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效降低迁移文件系统的成本。本申请实施例可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。同时,目标存储设备中的目标文件系统还可以保留源文件系统的权限信息,有效保护源文件系统和/或目标文件系统中的文件的安全。
图5是本申请实施例提供的迁移文件系统的方法的示意性流程图,图5中的方法包括如下步骤。
S501,建立连接,获得配置信息。
目标存储设备可以与源存储设备建立连接,还可以从源存储设备中获得源文件系统的配置信息。该配置信息包括结构信息,该配置信息还可以包括以下至少一项:权限信息、用户信息、或共享信息。目标存储设备与源存储设备建立连接并获得配置信息的具体实现方式可以参见步骤S310中的描述。
目标存储设备与源存储设备之间可以通过多种不同的共享协议传输数据,该多种不同的共享协议可以为源存储设备支持使用的协议,例如NFS协议、SMB协议、S3协议或私有协议等多种协议。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。
S502,创建目标文件系统。
目标存储设备可以根据源文件系统的配置信息,创建目标文件系统。目标文件系统的配置信息与源文件系统的配置信息相同。
在一些实施例中,目标存储设备可以根据源文件系统的结构信息,在目标文件系统中创建存储节点,并使目标文件系统中的存储节点与源文件系统中的存储节点一一对应。
在一些实施例中,目标存储设备还可以根据源文件系统中的每个存储节点的至少一个子节点,在目标文件系统中创建每个存储节点的至少一个子节点。目标文件系统中的每个存储节点的至少一个子节点与源文件系统中的每个存储节点的至少一个子节点一一对应。
在一些实施例中,目标存储设备可以根据源文件系统中的SID信息,创建目标文件系统的用户,并可以进行用户映射,从而使得目标文件系统的用户的SID与源文件系统的用户的SID相同。
在一些实施例中,目标存储设备还可以获得源文件系统的mode bits和ACL。目标存储设备可以在不同的权限下(例如SID权限和ACL权限等)对源文件系统进行扫描,从而可以对源文件系统中的文件、元数据和属性等进行完整迁移。由于目标文件系统中保留了源文件系统中的完整的权限信息,因此在计算设备访问目标文件系统时不易出错。例如,在源文件系统中的文件迁移至目标文件系统后,用户A在源文件系统中无法访问的文件在目标文件系统中仍无法访问,用户A在源文件系统中可以访问的文件在目标文件系统中仍可以访问。
在一些实施例中,目标存储设备还可以根据源文件系统的共享信息,确定目标文件系统中可以被远程访问的文件或数据,例如确定共享目录或共享文件等。
S503,确定第一请求信息和第二请求信息。
在一些实施例中,目标存储设备可以根据源文件系统的配置信息,确定至少一个迁移任务。该至少一个迁移任务中的每个迁移任务用于将源存储设备中的部分文件迁移至目标存储设备中。
在一些实施例中,目标存储设备可以根据第一迁移任务中待获取的文件或数据,即根据第一数据,从多个共享协议中确定可以访问该第一数据的共享协议,即确定第一共享协议。第一迁移任务为至少一个迁移任务中的任一个任务。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个,私有协议可以是用户自行定义的协议。目标存储设备还可以根据第一共享协议,对用于获取源存储设备中的第一数据的信息进行编码,从而确定第一请求信息。也即,该第一请求信息为根据第一共享协议编码的信息,该第一请求信息用于获取源存储设备中的第一数据。换句话说,第一请求信息的格式与第一共享协议规定的信息格式相同。
类似地,目标存储设备可以根据第二迁移任务中待获取的文件或数据,即根据第二数据,从多个共享协议中确定可以访问该第二数据的共享协议,即确定第二共享协议。第二迁移任务为至少一个迁移任务中与第一迁移任务不同的任务。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个,私有协议可以是用户自行定义的协议。目标存储设备还可以根据第二共享协议,对用于获取源存储设备中的第二数据的信息进行编码,从而确定第二请求信息。也即,该第二请求信息为根据第二共享协议编码的信息,该第二请求信息用于获取源存储设备中的第二数据。换句话说,第二请求信息的格式与第二共享协议规定的信息格式相同。具体实现方式可以参加步骤S310中的描述。
S504,发送第一请求信息和第二请求信息。步骤S504与步骤S310类似,此处不再赘述。
S505,根据第一请求信息和第二请求信息,确定第一响应信息和第二响应信息。步骤S505与步骤S320、S330类似,此处不再赘述。
S506,接收第一响应信息和第二响应信息。步骤S506与步骤S340类似,此处不再赘述。
S507,根据第一响应信息和第二响应信息,获得并存储第一数据和第二数据。步骤S507与步骤S350、S360类似,此处不再赘述。
S508,发送第一指示信息。
目标存储设备创建目标文件系统后,可以直接向源存储设备发送第一指示信息。或者,目标文件系统可以在执行部分或全部迁移任务后,向源存储设备发送第一指示信息。该第一指示信息用于指示源存储设备与计算设备断开连接。换句话说,本申请实施例对步骤S503-S507和步骤S508执行的先后顺序并不限定。例如,可以先执行步骤S503-S507,然后执行步骤S508。或者,可以先执行步骤S508,然后执行步骤S503-S507。
在一些实施例中,该第一指示信息还包括目标存储设备的网络地址。
在一些实施例中,源存储设备接收到来自于目标存储设备的第一指示信息后,可以根据第一指示信息,断开与计算设备的连接。或者,源存储设备在接收到第一指示信息后,可以执行步骤S509,从而与计算设备断开连接。
S509,发送第二指示信息,断开连接。
源存储设备可以在接收到第一指示信息后,向计算设备发送第二指示信息,从而与计算设备断开连接。该第二指示信息用于指示计算设备与源存储设备断开连接。
在一些实施例中,该第二指示信息还包括目标存储设备的网络地址。
在一些实施例中,计算设备可以在接收到第二指示信息后,主动断开与源存储设备的连接。计算设备还可以在接收到第二指示信息后,执行步骤S510。
S510,建立连接。
在一些实施例中,在目标存储设备创建目标文件系统后,可以通过人工配置的方式,使得目标存储设备与计算设备建立连接。或者,在目标存储设备创建目标文件系统后,目标存储设备可以通过与该目标存储设备连接的其他设备,获得计算设备的网络地址,从而与计算设备建立连接。或者,在目标存储设备创建目标文件系统后,目标存储设备可以接收来自于计算设备的连接请求,从而与计算设备建立连接,本申请实施例对此并不限定。
在一些实施例中,计算设备可以根据第二指示信息中的目标存储设备的网络地址,向目标存储设备发送连接请求,从而与目标存储设备建立连接。
在一些实施例中,计算设备可以在与源存储设备断开连接后,通过人工配置的方式,与目标存储设备建立连接。
在一些实施例中,计算设备可以在与源存储设备断开连接后,接收来自于目标存储设备的连接请 求,从而与目标存储设备建立连接。
在一些实施例中,计算设备与目标存储设备建立连接之后,可以重新装载共享文件系统,从而通过目标存储设备访问源文件存储系统和/或目标存储系统。
目标存储设备与计算设备之间可以通过多种不同的协议传输数据,该多种不同的协议可以为计算设备支持使用的协议,例如NFS协议、SMB协议、S3协议、或私有协议等多种协议。
在一些实施例中,目标存储设备可以在向源存储设备发送第一指示信息后,直接与计算设备建立连接,而不需要在迁移元数据或增量数据之后再与计算设备建立连接。元数据用于描述源文件系统中的文件或数据。基于不同的协议,元数据一般不同。增量数据为迁移源文件系统时,计算设备新写入源文件系统而未写入目标文件系统中的数据。
S511,接收第三请求信息。
计算设备与目标存储设备建立连接之后,可以通过目标存储设备继续访问或更新源文件系统中的文件或数据。也即,计算设备可以在与目标存储设备建立连接之后,向目标存储设备发送第三请求信息。该第三请求信息用于获取或更新源文件系统和/或目标文件系统中的第三数据。也即,该第三数据属于源存储设备和/或目标存储设备。该第三请求信息为根据第三共享协议编码的请求信息,该第三共享协议为多个共享协议中的任一个协议。换句话说,第三请求信息的格式与第三共享协议规定的信息格式相同。
在一些实施例中,多个共享协议包括NFS、SMB、S3、或私有协议中的多个,私有协议为用户自行定义的协议。
在一些实施例中,目标存储设备可以在迁移源存储设备中的源文件系统的同时,接收来自于计算设备的第三请求信息。也即,目标存储设备可以在不中断服务的同时,执行迁移任务。
在一些实施例中,目标存储设备在接收到第三请求信息后,可以根据第三共享协议,对第三请求信息进行解码,从而确定解码后的第三请求信息。该解码后的第三请求信息用于获取或更新第三数据。
应理解,若第三请求信息用于获取第三数据,则解码后的第三请求信息仍用于获取第三数据。若第三请求信息用于更新第三数据,则解码后的第三请求仍用于更新第三数据。
在一些实施例中,第三请求信息中包含第三标识信息,该第三标识信息用于指示目标存储设备根据第三共享协议,对第三请求信息进行解码。
可选地,目标存储设备还可以执行步骤S512、S513、S514、S515。
S512,记录第三请求信息或解码后的第三请求信息。
在一些实施例中,目标存储设备在接收到第三请求信息后,可以存储该第三请求信息,从而保证目标文件系统与源文件系统中的文件或数据的一致性。或者,目标存储设备可以在确定解码后的第三请求信息后,存储该解码后的第三请求信息,从而保证目标文件系统与源文件系统中的文件或数据的一致性。具体而言,目标存储设备可以通过记录该第三请求信息和/或解码后的第三请求信息,确定源文件系统和目标文件系统中的第三数据是否已被同步更新,从而保证第三数据在源文件系统被更新的同时,在目标文件系统中也进行了相同的更新。
S513,发送第三请求信息。
在一些实施例中,目标存储设备可以向源存储设备发送第三请求信息,即目标存储设备可以向源存储设备转发该第三请求信息。或者,目标存储设备可以根据第三共享协议,对解码后的第三请求信息进行编码,从而获得第三请求信息,并将该第三请求信息发送给源存储设备。换句话说,源存储设备可以接收到第三请求信息。
在一些实施例中,目标存储设备可以直接向源存储设备发送该第三请求信息。或者,目标存储设备可以先确定目标存储设备中是否存在第三数据,然后确定是否需要向源存储设备发送第三请求信息。
例如,在第三请求信息用于读取第三数据的情况下,目标存储设备可以直接将该第三请求信息发送给源存储设备。或者,在目标存储设备确定目标存储设备中不存在该第三数据的情况下,目标存储设备可以向源存储设备发送第三请求信息。或者,在目标存储设备确定目标存储设备中存在该第三数据的情况下,目标存储设备可以不向源存储设备发送第三请求信息。
例如,在第三请求信息用于更新第三数据的情况下,目标存储设备可以直接向源存储设备发送该第三请求信息。或者,目标存储设备可以先确定目标存储设备中是否存在第三数据,并且无论是否存 在第三数据,均向源存储设备发送第三请求信息。
S514,根据第三请求信息,确定第四响应信息。
在一些实施例中,源存储设备接收到第三请求信息后,可以根据第三请求信息,确定第三数据或源存储设备中的第三数据的更新信息。具体地,源存储设备可以根据第三共享协议,对第三请求信息进行解码,确定解码后的第三请求信息。该解码后的第三请求信息用于获取或更新第三数据。源存储设备还可以根据该解码后的第三请求信息,读取或更新源文件系统中的第三数据,从而确定第三数据或第三数据的更新信息。
在一些实施例中,源存储设备还可以根据第三共享协议,对第三数据或源存储设备中的第三数据的更新信息进行编码,确定第四响应信息。也即,该第四响应信息为根据第三共享协议编码的响应信息,第四响应信息的具体格式与第三共享协议规定的信息格式一致。第四响应信息中包括第三数据或源存储设备中的第三数据的更新信息。
在一些实施例中,第四响应信息中包含第三标识信息,该第三标识信息用于指示根据第三共享协议,对第四响应信息进行解码。
S515,接收第四响应信息。
在第三请求信息用于获取第三数据的情况下,目标存储设备可以接收来自于源存储设备的第四响应信息。第四响应信息中包括第三数据。
在第三请求信息用于更新第三数据的情况下,目标存储设备可以接收来自于源存储设备的第四响应信息。第四响应信息中包括源文件系统中的第三数据的更新信息,该更新信息例如可以是源文件系统中的第三数据已被成功更新或未被成功更新等。
在一些实施例中,目标存储设备可以在接收到第四响应信息后,根据第三共享协议,对第四响应信息进行解码,确定解码后的第四响应信息。该解码后的第四响应信息包括第三数据或源文件系统中的第三数据的更新信息。
S516,读取或更新第三数据,或者优先执行第三迁移任务。
在解码后的第三请求信息用于更新第三数据的情况下,目标存储设备可以确定第三数据是否存在于目标存储设备中。若目标存储设备中存在该第三数据,则目标存储设备可以根据该解码后的第三请求信息,更新该第三数据。更新该第三数据可以包括删除第三数据、修改第三数据等。若目标存储设备中不存在该第三数据,则目标存储设备可以将第三迁移任务的优先级设置为高,即优先执行第三迁移任务。该第三迁移任务为第三数据所属的迁移任务。目标存储设备还可以在执行完第三迁移任务后,即在目标存储设备中存在第三数据后,根据解码后的第三请求信息,更新第三数据。
在解码后的第三请求信息用于读取第三数据的情况下,目标存储设备可以确定目标存储设备中是否存在第三数据。若目标存储设备中存在该第三数据,则目标存储设备可以根据解码后的第三请求信息,直接读取第三数据,并执行步骤S518。若目标存储设备中不存在该第三数据,则目标存储设备可以向源存储设备发送第三请求信息。目标存储设备还可以将第三迁移任务的优先级设置为高,即优先执行第三迁移任务,该第三迁移任务为第三数据所属的迁移任务。
应理解,本申请实施例对步骤S513-S515与步骤S516的执行顺序并不限定,例如可以先执行步骤S513-S515,然后执行步骤S516。或者,可以先执行步骤S516,然后执行步骤S513-S515。或者,可以同时执行步骤S513-S515和步骤S516。
可选地,目标存储设备还可以执行步骤S517。
S517,删除记录的第三请求信息或解码后的第三请求信息。
在一些实施例中,目标存储设备可以在向计算设备发送第三响应信息前,删除记录的第三请求信息或解码后的第三请求信息。
在一些实施中,目标存储设备可以在更新目标文件系统中的第三数据后,删除记录的第三请求信息或解码后的第三请求信息。或者,目标存储设备可以确定解码后的第四响应信息后,删除记录的第三请求信息或解码后的第三请求信息。或者,目标存储设备可以在更新目标文件系统中的第三数据,并确定解码后的第四响应信息后,删除记录的第三请求信息或解码后的第三请求信息,本申请实施例对此并不限定。
S518,发送第三响应信息。
目标存储设备可以在迁移源文件系统中的文件或数据的同时,向计算设备发送第三响应信息,即响应计算设备的请求。该第三响应信息包括第三数据或第三数据的更新信息。该第三数据为源文件系统和/或目标文件系统中的数据。第三数据的更新信息用于指示源存储设备和/或目标存储设备中的第三数据的更新情况,例如源存储设备和/或目标存储设备中的第三数据已被成功更新或未被成功更新。
在一些实施例中,第三响应信息为根据第三共享协议编码的请求信息,该第三共享协议为多个共享协议中的任一个协议。换句话说,第三请求信息的格式与第三共享协议规定的信息格式相同。该多个共享协议包括NFS、SMB、S3、或私有协议中的多个,私有协议为用户自行定义的协议。
在解码后的第三请求信息用于更新第三数据的情况下,目标存储设备可以根据目标存储设备中的第三数据的更新信息,确定第三响应信息。或者,目标存储设备可以根据源存储设备中的第三数据的更新信息,即解码后的第四响应信息,确定第三响应信息。或者,目标存储设备可以根据目标存储设备和源存储设备中的第三数据的更新信息,确定第三响应信息,本申请实施例对此并不限定。
例如,目标存储设备可以在目标存储设备中的第三数据被更新后,根据第三共享协议,对目标存储设备中的第三数据的更新信息进行编码,从而确定第三响应信息。目标存储设备中的第三数据的更新信息例如可以是目标存储设备中的第三数据已被成功更新或未被成功更新等。
例如,目标存储设备可以在确定解码后的第四响应信息后,根据第三共享协议,对解码后的第四响应信息进行编码,从而确定第三响应信息。该解码后的第四响应信息包括源存储设备中的第三数据的更新信息,例如可以是源存储设备中的第三数据已被成功更新或未被成功更新等。
例如,目标存储设备可以在目标存储设备中的第三数据被更新,并确定解码后的第四响应信息后,根据第三共享协议,对目标存储设备和源存储设备中的第三数据的更新信息进行编码,从而确定第三响应信息。
在一些实施例中,若解码后的第四响应信息指示源存储设备中的第三数据已被成功更新,而目标存储设备中的第三数据未被成功更新,则第三响应信息可以指示第三数据未被成功更新。或者,若解码后的第四响应信息指示源存储设备中的第三数据未被成功更新,而目标存储设备中的第三数据已被成功更新,则第三响应信息可以指示第三数据未被成功更新。或者,若解码后的第四响应信息指示源存储设备中的第三数据已被成功更新,而目标存储设备中的第三数据未被成功更新,则第三响应信息可以指示第三数据已被成功更新。或者,若解码后的第四响应信息指示源存储设备中的第三数据未被成功更新,而目标存储设备中的第三数据已被成功更新,则第三响应信息可以指示第三数据已被成功更新等,本申请实施例对此并不限定。
在解码后的第三请求信息用于获取第三数据的情况下,目标存储设备可以根据目标存储设备中的第三数据,确定第三响应信息。或者,目标存储设备可以根据源存储设备中的第三数据,即解码后的第四响应信息,确定第三响应信息,本申请实施例对此并不限定。
例如,目标存储设备可以直接读取目标存储设备中的第三数据,并根据第三共享协议,对第三数据进行编码,从而确定第三响应信息。
例如,目标存储设备可以在确定解码后的第四响应信息后,根据第三共享协议,对解码后的第四响应信息进行编码,从而确定第三响应信息。该解码后的第四响应信息包括源存储设备中的第三数据。
可选地,目标存储设备在将源文件系统中的文件、元数据和属性等迁移至目标文件系统后,可以断开与源存储设备的连接。
应理解,计算设备与源存储设备断开连接后,可以直接与目标存储设备建立连接,而不需要等待目标存储设备迁移增量数据,因此可以缩短中断服务的时间。增量数据为迁移源文件系统期间,计算设备新写入源文件系统且并未写入目标文件系统中的数据。本申请实施例中,目标存储设备可以在接收到来自于计算设备的第三请求信息时,在目标文件系统和源文件系统中同步更新第三数据,因此目标存储设备不需要较长的中断时间来迁移增量数据,并且可以保证源文件系统与目标文件系统中文件或数据的一致性。
还应理解,目标存储设备可以基于多种不同的协议与源存储设备和/或计算设备传输数据,因此在源存储设备中的源文件系统的迁移过程中,不需要额外使用多个支持不同协议的迁移工具,从而可以有效降低迁移文件系统的成本。本申请实施例可以避免在源文件系统同时支持多个协议的情况下,仅使用支持一个协议的迁移工具无法迁移源文件系统中的基于其他协议的元数据的问题,从而可以保证 将源文件系统中的数据、元数据和属性等完整迁移至目标文件系统中。目标存储设备还可以在解码后直接存储从源存储设备中读取的数据,而不需要经过迁移工具再次进行信息的编解码处理,因此可以缩短迁移时间。同时,目标存储设备中还可以保留源文件系统的权限信息,从而有效保护源文件系统和/或目标文件系统中的文件的安全。
图6是本申请实施例提供的存储装置600的示意性结构图,存储装置600包括收发模块610和处理模块620。
收发模块610用于向源存储设备发送第一请求信息和第二请求信息,第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。收发模块610还用于接收来自于源存储设备的第一响应信息和第二响应信息,第一响应信息为根据第一共享协议编码的信息,第一响应信息中包括第一数据。第二响应信息为根据第二共享协议编码的信息,第二响应信息中包括第二数据。收发模块610可以执行图3的方法中的步骤S310、S340、图5的方法中的步骤S504、S506、S508、S511、S513、S515、S518。
处理模块620用于根据第一共享协议,对第一响应信息进行解码,获得并存储第一数据。处理模块620还用于根据第二共享协议,对第二响应信息进行解码,获得并存储第二数据。处理模块620可以执行图3的方法中的步骤S350、S360、图5的方法中的步骤S501、S502、S503、S507、S510、S512、S516、S517。
图7是本申请实施例提供的存储装置700的示意性结构图,存储装置700包括收发模块710和处理模块720。
收发模块710用于接收来自于源存储设备的第一请求信息和第二请求信息,第一请求信息为根据第一共享协议编码的信息,第一请求信息用于获取源存储设备中的第一数据。第二请求信息为根据第二共享协议编码的信息,第二请求信息用于获取源存储设备中的第二数据。第一共享协议和第二共享协议为多个共享协议中不同的协议。该多个共享协议中的任一个共享协议用于访问源存储设备中的数据。收发模块710还用于向目标存储设备发送第一响应信息和第二响应信息,第一响应信息为根据第一共享协议编码的信息,第二响应信息为根据第二共享协议编码的信息。收发模块710可以执行图3的方法中的步骤S310、S340、图5的方法中的步骤S504、S506、S508、S509、S513、S515。
处理模块720用于根据第一请求信息,确定第一响应信息。第一响应信息为根据第一共享协议编码的信息,第一响应信息中包括第一数据。处理模块720还用于根据第二请求信息,确定第二响应信息。第二响应信息为根据第二共享协议编码的信息,第二响应信息中包括第二数据。处理模块720可以执行图3的方法中的步骤S320、S330、图5的方法中的步骤S501、S505、S514。
根据本申请实施例提供的方法,本申请实施例还提供一种存储设备。该存储设备包括:处理器,该处理器用于与存储器耦合,读取并执行存储器中的指令和/或程序代码,以执行上述实施例中目标存储设备或源存储设备执行的各个步骤。
根据本申请实施例提供的方法,本申请实施例还提供一种芯片系统。该芯片系统包括逻辑电路,该逻辑电路用于与输入/输出接口耦合,通过该输入/输出接口传输数据,以执行上述实施例中目标存储设备或源存储设备执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种程序产品,该程序产品包括:程序代码,当该程序代码在存储设备上运行时,使得该存储设备执行上述实施例中目标存储设备或源存储设备执行的各个步骤。
根据本申请实施例提供的方法,本申请还提供一种存储介质,该存储介质存储有程序代码,当该程序代码在存储设备上运行时,使得该存储设备执行上述实施例中目标存储设备或源存储设备执行的各个步骤。
根据本申请实施例提供的方法,本申请实施例还提供一种迁移系统,该迁移系统包括上述实施例中的目标存储设备和源存储设备。
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执 行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。

Claims (30)

  1. 一种迁移文件系统的方法,其特征在于,包括:
    目标存储设备向源存储设备发送第一请求信息和第二请求信息,所述第一请求信息为根据第一共享协议编码的信息,所述第一请求信息用于获取所述源存储设备中的第一数据,所述第二请求信息为根据第二共享协议编码的信息,所述第二请求信息用于获取所述源存储设备中的第二数据,所述第一共享协议和所述第二共享协议为多个共享协议中不同的协议,所述多个共享协议中的任一个共享协议用于访问所述源存储设备中的数据;
    所述目标存储设备接收来自于所述源存储设备的第一响应信息和第二响应信息,所述第一响应信息为根据所述第一共享协议编码的信息,所述第一响应信息包括所述第一数据,所述第二响应信息为根据所述第二共享协议编码的信息,所述第二响应信息包括所述第二数据;
    所述目标存储设备根据所述第一共享协议,对所述第一响应信息进行解码,获得并存储所述第一数据;
    所述目标存储设备根据所述第二共享协议,对所述第二响应信息进行解码,获得并存储所述第二数据。
  2. 根据权利要求1所述的方法,其特征在于,所述多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
  3. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:
    所述目标存储设备根据所述源存储设备中的源文件系统的结构信息,确定多个迁移任务,所述多个迁移任务中的每个迁移任务用于将所述源文件系统中的部分文件迁移至所述目标存储设备中;
    所述目标存储设备根据第一迁移任务,确定所述第一请求信息,所述第一迁移任务为所述多个迁移任务中的任一个迁移任务,所述第一迁移任务用于将所述第一数据迁移至所述目标存储设备中;
    所述目标存储设备根据第二迁移任务,确定所述第二请求信息,所述第二迁移任务为所述多个迁移任务中与所述第一迁移任务不同的任务,所述第二迁移任务用于将所述第二数据迁移至所述目标存储设备中。
  4. 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:
    所述目标存储设备接收来自于计算设备的第三请求信息,所述第三请求信息为根据第三共享协议编码的请求信息,所述第三请求信息用于获取或更新第三数据,所述第三数据属于所述目标存储设备和/或所述源存储设备,所述第三共享协议为所述多个共享协议中的任一个协议;
    所述目标存储设备根据所述第三请求信息,向所述计算设备发送第三响应信息,所述第三响应信息为根据所述第三共享协议编码的请求信息,所述第三响应信息包括所述第三数据或所述第三数据的更新信息。
  5. 根据权利要求4所述的方法,其特征在于,在所述第三请求信息用于更新所述第三数据的情况下,所述方法还包括:
    所述目标存储设备根据所述第三共享协议,对所述第三请求信息进行解码,确定解码后的第三请求信息;
    在所述目标存储设备中存在所述第三数据的情况下,所述目标存储设备根据所述解码后的第三请求信息,更新所述第三数据;
    在所述目标存储设备中不存在所述第三数据的情况下,所述目标存储设备将第三迁移任务的优先级设置为高,所述第三迁移任务用于将所述第三数据迁移至所述目标存储设备中。
  6. 根据权利要求5所述的方法,其特征在于,所述方法还包括:
    所述目标存储设备记录所述解码后的第三请求信息;
    所述目标存储设备在完成所述第三迁移任务后,根据记录的所述解码后的第三请求信息,更新所述目标存储设备中的所述第三数据。
  7. 根据权利要求4至6中任一项所述的方法,其特征在于,所述目标存储设备根据所述第三请求信息,向所述计算设备发送第三响应信息,包括:
    所述目标存储设备向所述源存储设备发送所述第三请求信息;
    所述目标存储设备接收来自于所述源存储设备的第四响应信息,所述第四响应信息为根据所述第三共享协议编码的响应信息,所述第四响应信息包括所述第三数据或所述源存储设备中的所述第三数据的更新信息;
    所述目标存储设备根据所述第三共享协议,对所述第四响应信息进行解码,确定解码后的第四响应信息;
    所述目标存储设备根据所述解码后的第四响应信息,向所述计算设备发送所述第三响应信息。
  8. 根据权利要求1至7中任一项所述的方法,其特征在于,所述方法还包括:
    所述目标存储设备根据所述源存储设备中的源文件系统的权限信息,确定所述目标存储设备中的目标文件系统的权限信息,所述目标文件系统的权限信息与所述源文件系统中的权限信息相同。
  9. 一种迁移文件系统的方法,其特征在于,包括:
    源存储设备接收来自于目标存储设备的第一请求信息和第二请求信息,所述第一请求信息为根据第一共享协议编码的信息,所述第一请求信息用于获取所述源存储设备中的第一数据,所述第二请求信息为根据第二共享协议编码的信息,所述第二请求信息用于获取所述源存储设备中的第二数据,所述第一共享协议和所述第二共享协议为多个共享协议中不同的协议,所述多个共享协议中的任一个共享协议用于访问所述源存储设备中的数据;
    所述源存储设备根据所述第一请求信息,确定第一响应信息,所述第一响应信息为根据所述第一共享协议编码的信息,所述第一响应信息包括所述第一数据;
    所述源存储设备根据所述第二请求信息,确定第二响应信息,所述第二响应信息为根据所述第二共享协议编码的信息,所述第二响应信息包括所述第二数据;
    所述源存储设备向所述目标存储设备发送所述第一响应信息和所述第二响应信息。
  10. 根据权利要求9所述的方法,其特征在于,所述多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
  11. 根据权利要求9或10所述的方法,其特征在于,所述源存储设备根据所述第一请求信息,确定第一响应信息包括:
    所述源存储设备根据所述第一共享协议,对所述第一请求信息进行解码,确定解码后的第一请求信息,所述解码后的第一请求信息用于获取所述第一数据;
    所述源存储设备根据所述解码后的第一请求信息,确定第一数据;
    所述源存储设备根据所述第一共享协议,对所述第一数据进行编码,确定所述第一响应信息。
  12. 根据权利要求9至11中任一项所述的方法,其特征在于,所述方法还包括:
    所述源存储设备接收来自于所述目标存储设备的第三请求信息,所述第三请求信息为根据第三共享协议编码的请求信息,所述第三请求信息用于获取或更新第三数据,所述第三数据属于所述源存储设备,所述第三共享协议为所述多个共享协议中的任一个协议;
    所述源存储设备根据所述第三请求信息,确定所述第三数据或所述第三数据的更新信息;
    所述源存储设备根据所述第三共享协议,对所述第三数据或所述第三数据的更新信息进行编码,确定第四响应信息,所述第四响应信息包括所述第三数据或所述第三数据的更新信息;
    所述源存储设备向所述目标存储设备发送所述第四响应信息。
  13. 根据权利要求9至12中任一项所述的方法,其特征在于,所述方法还包括:
    所述源存储设备向所述目标存储设备发送配置信息,所述配置信息为所述源存储设备中的源文件系统的配置信息,所述配置信息包括所述源文件系统的结构信息和/或权限信息。
  14. 一种存储装置,其特征在于,包括:
    收发模块,用于向源存储设备发送第一请求信息和第二请求信息,所述第一请求信息为根据第一共享协议编码的信息,所述第一请求信息用于获取所述源存储设备中的第一数据,所述第二请求信息为根据第二共享协议编码的信息,所述第二请求信息用于获取所述源存储设备中的第二数据,所述第一共享协议和所述第二共享协议为多个共享协议中不同的协议,所述多个共享协议中的任一个共享协议用于访问所述源存储设备中的数据;
    所述收发模块,还用于接收来自于所述源存储设备的第一响应信息和第二响应信息,所述第一响 应信息为根据所述第一共享协议编码的信息,所述第一响应信息包括所述第一数据,所述第二响应信息为根据所述第二共享协议编码的信息,所述第二响应信息包括所述第二数据;
    处理模块,还用于根据所述第一共享协议,对所述第一响应信息进行解码,获得并存储所述第一数据,所述第一响应信息中包括所述第一数据;
    所述处理模块,还用于根据所述第二共享协议,对所述第二响应信息进行解码,获得并存储所述第二数据,所述第二响应信息中包括所述第二数据。
  15. 根据权利要求14所述的装置,其特征在于,所述多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
  16. 根据权利要求14或15所述的装置,其特征在于,所述处理模块,还用于:
    根据所述源存储设备中的源文件系统的结构信息,确定多个迁移任务,所述多个迁移任务中的每个迁移任务用于将所述源文件系统中的部分文件迁移至所述存储装置中;
    根据第一迁移任务,确定所述第一请求信息,所述第一迁移任务为所述多个迁移任务中的任一个迁移任务,所述第一迁移任务用于将所述第一数据迁移至所述存储装置中;
    根据第二迁移任务,确定所述第二请求信息,所述第二迁移任务为所述多个迁移任务中与所述第一迁移任务不同的任务,所述第二迁移任务用于将所述第二数据迁移至所述存储装置中。
  17. 根据权利要求14至16中任一项所述的装置,其特征在于,所述收发模块,还用于:
    接收来自于计算设备的第三请求信息,所述第三请求信息为根据第三共享协议编码的请求信息,所述第三请求信息用于获取或更新第三数据,所述第三数据属于所述存储装置和/或所述源存储设备,所述第三共享协议为所述多个共享协议中的任一个协议;
    根据所述第三请求信息,向所述计算设备发送第三响应信息,所述第三响应信息为根据所述第三共享协议编码的请求信息,所述第三响应信息包括所述第三数据或所述第三数据的更新信息。
  18. 根据权利要求17所述的装置,其特征在于,在所述第三请求信息用于更新所述第三数据的情况下,所述处理模块,还用于:
    根据所述第三共享协议,对所述第三请求信息进行解码,确定解码后的第三请求信息;
    在所述存储装置中存在所述第三数据的情况下,根据所述解码后的第三请求信息,更新所述第三数据;
    在所述存储装置中不存在所述第三数据的情况下,将第三迁移任务的优先级设置为高,所述第三迁移任务用于将所述第三数据迁移至所述存储装置中。
  19. 根据权利要求18所述的装置,其特征在于,所述处理模块,还用于:
    记录所述解码后的第三请求信息;
    在完成所述第三迁移任务后,根据记录的所述解码后的第三请求信息,更新所述存储装置中的所述第三数据。
  20. 根据权利要求14至19中任一项所述的装置,其特征在于,所述收发模块,具体用于向所述源存储设备发送所述第三请求信息;
    所述收发模块,还用于接收来自于所述源存储设备的第四响应信息,所述第四响应信息为根据所述第三共享协议编码的响应信息,所述第四响应信息包括所述第三数据或所述源存储设备中的所述第三数据的更新信息;
    所述处理模块,具体用于根据所述第三共享协议,对所述第四响应信息进行解码,确定解码后的第四响应信息;
    所述收发模块,还用于根据所述解码后的第四响应信息,向所述计算设备发送所述第三响应信息。
  21. 根据权利要求14至20中任一项所述的装置,其特征在于,所述处理模块,还用于根据所述源存储设备中的源文件系统的权限信息,确定所述存储装置中的目标文件系统的权限信息,所述目标文件系统的权限信息与所述源文件系统中的权限信息相同。
  22. 一种存储装置,其特征在于,包括:
    收发模块,用于接收来自于目标存储设备的第一请求信息和第二请求信息,所述第一请求信息为根据第一共享协议编码的信息,所述第一请求信息用于获取所述存储装置中的第一数据,所述第二请求信息为根据第二共享协议编码的信息,所述第二请求信息用于获取所述存储装置中的第二数据,所 述第一共享协议和所述第二共享协议为多个共享协议中不同的协议,所述多个共享协议中的任一个共享协议用于访问所述源存储设备中的数据;
    处理模块,用于根据所述第一请求信息,确定第一响应信息,所述第一响应信息为根据所述第一共享协议编码的信息,所述第一响应信息包括所述第一数据;
    所述处理模块,还用于根据所述第二请求信息,确定第二响应信息,所述第二响应信息为根据所述第二共享协议编码的信息,所述第二响应信息包括所述第二数据;
    所述收发模块,还用于向所述目标存储设备发送所述第一响应信息和所述第二响应信息。
  23. 根据权利要求22所述的装置,其特征在于,所述多个共享协议包括网络系统文件协议NFS、服务信息块协议SMB、或简单存储服务协议S3中的多个。
  24. 根据权利要求22或23所述的装置,其特征在于,所述处理模块,具体用于:
    根据所述第一共享协议,对所述第一请求信息进行解码,确定解码后的第一请求信息,所述解码后的第一请求信息用于获取所述第一数据;
    根据所述解码后的第一请求信息,确定第一数据;
    根据所述第一共享协议,对所述第一数据进行编码,确定所述第一响应信息。
  25. 根据权利要求22至24中任一项所述的装置,其特征在于,所述收发模块,还用于接收来自于所述目标存储设备的第三请求信息,所述第三请求信息为根据第三共享协议编码的请求信息,所述第三请求信息用于获取或更新第三数据,所述第三数据属于所述存储装置,所述第三共享协议为所述多个共享协议中的任一个协议;
    所述处理模块,还用于根据所述第三请求信息,确定所述第三数据或所述第三数据的更新信息;
    所述处理模块,还用于根据所述第三共享协议,对所述第三数据或所述第三数据的更新信息进行编码,确定第四响应信息,所述第四响应信息包括所述第三数据或所述第三数据的更新信息;
    所述收发模块,还用于向所述目标存储设备发送所述第四响应信息。
  26. 根据权利要求22至25中任一项所述的装置,其特征在于,所述收发模块,还用于向所述目标存储设备发送配置信息,所述配置信息为所述存储装置中的源文件系统的配置信息,所述配置信息包括所述源文件系统的结构信息和/或权限信息。
  27. 一种存储设备,其特征在于,包括:处理器,所述处理器用于与存储器耦合,读取并执行所述存储器中的指令和/或程序代码,以执行如权利要求1至8中任一项或9至13中任一项所述的方法。
  28. 一种芯片系统,其特征在于,包括:逻辑电路,所述逻辑电路用于与输入/输出接口耦合,通过所述输入/输出接口传输数据,以执行如权利要求1至8中任一项或9至13中任一项所述的方法。
  29. 一种存储介质,其特征在于,所述存储介质存储有程序代码,当所述程序代码在存储设备上运行时,使得存储设备执行如权利要求1至8中任一项或9至13中任一项所述的方法。
  30. 一种迁移系统,其特征在于,包括如权利要求14至21中任一项所述的存储装置和如权利要求22至26中任一项所述的存储装置。
PCT/CN2023/110766 2022-10-18 2023-08-02 一种迁移文件系统的方法和相关设备 WO2024082773A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211273874.5 2022-10-18
CN202211273874.5A CN117951080A (zh) 2022-10-18 2022-10-18 一种迁移文件系统的方法和相关设备

Publications (1)

Publication Number Publication Date
WO2024082773A1 true WO2024082773A1 (zh) 2024-04-25

Family

ID=90736935

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/110766 WO2024082773A1 (zh) 2022-10-18 2023-08-02 一种迁移文件系统的方法和相关设备

Country Status (2)

Country Link
CN (1) CN117951080A (zh)
WO (1) WO2024082773A1 (zh)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050055402A1 (en) * 2003-09-09 2005-03-10 Eiichi Sato File sharing device and inter-file sharing device data migration method
CN102611745A (zh) * 2011-12-31 2012-07-25 成都市华为赛门铁克科技有限公司 文件在线迁移方法、装置和系统
CN106649600A (zh) * 2016-11-25 2017-05-10 华为技术有限公司 一种迁移文件权限的方法、装置以及系统
CN112511627A (zh) * 2018-01-25 2021-03-16 华为技术有限公司 迁移元数据的方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050055402A1 (en) * 2003-09-09 2005-03-10 Eiichi Sato File sharing device and inter-file sharing device data migration method
CN102611745A (zh) * 2011-12-31 2012-07-25 成都市华为赛门铁克科技有限公司 文件在线迁移方法、装置和系统
CN106649600A (zh) * 2016-11-25 2017-05-10 华为技术有限公司 一种迁移文件权限的方法、装置以及系统
CN112511627A (zh) * 2018-01-25 2021-03-16 华为技术有限公司 迁移元数据的方法和装置

Also Published As

Publication number Publication date
CN117951080A (zh) 2024-04-30

Similar Documents

Publication Publication Date Title
JP4696089B2 (ja) 分散ストレージシステム
WO2020019630A1 (zh) 存储卷创建方法以及装置、服务器及存储介质
US9304815B1 (en) Dynamic replica failure detection and healing
JP2016186782A (ja) データ処理方法及びデータ処理装置
JP2007094755A (ja) 記憶システムにおけるリモートコピー制御
US20230152978A1 (en) Data Access Method and Related Device
US11416176B2 (en) Function processing using storage controllers for load sharing
US10545667B1 (en) Dynamic data partitioning for stateless request routing
EP2845110A1 (en) Reflective memory bridge for external computing nodes
US20230342087A1 (en) Data Access Method and Related Device
TW201638799A (zh) 計算系統中之軟體影像的分佈式存儲
WO2024082773A1 (zh) 一种迁移文件系统的方法和相关设备
JP5984552B2 (ja) 負荷分散システム、負荷分散システムの制御方法、およびコンピュータプログラム
WO2023093608A1 (zh) 一种自动化分布式云存储调度交互方法、装置及设备
JP2010170475A (ja) ストレージシステム、ストレージシステムにおけるデータ書込方法及びデータ書込プログラム
KR101470857B1 (ko) iSCSI 스토리지 시스템을 이용한 네트워크 분산 파일 시스템 및 방법
US20170364293A1 (en) Method and apparatus for data processing
US10838660B2 (en) Identifying and processing predefined dispersed storage network workflows
CN114615263A (zh) 集群在线迁移方法、装置、设备及存储介质
CN103488768A (zh) 一种基于云计算的文件管理方法及系统
CN114610679A (zh) 存储设备及其数据存储方法、云端存储系统
CN111488324A (zh) 一种基于消息中间件的分布式网络文件系统及其工作方法
JP6583934B2 (ja) メールサーバ装置、メール管理方法、及びメール管理プログラム
US9602562B2 (en) Terminal apparatus, information processing system and information processing method
CN116760850B (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: 23878769

Country of ref document: EP

Kind code of ref document: A1