CN117951080A - Method for migrating file system and related equipment - Google Patents

Method for migrating file system and related equipment Download PDF

Info

Publication number
CN117951080A
CN117951080A CN202211273874.5A CN202211273874A CN117951080A CN 117951080 A CN117951080 A CN 117951080A CN 202211273874 A CN202211273874 A CN 202211273874A CN 117951080 A CN117951080 A CN 117951080A
Authority
CN
China
Prior art keywords
storage device
information
data
request information
source
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211273874.5A
Other languages
Chinese (zh)
Inventor
罗金·乔治
苏拉布·维什瓦卡尔马
维韦克·冈杜拉奥·拉奥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202211273874.5A priority Critical patent/CN117951080A/en
Priority to PCT/CN2023/110766 priority patent/WO2024082773A1/en
Publication of CN117951080A publication Critical patent/CN117951080A/en
Pending legal-status Critical Current

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

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

The embodiment of the application provides a method for migrating a file system and related equipment. The method comprises the following steps: the target storage device sends first request information and second request information to the source storage device, wherein the first request information and the second request information are information coded according to a first sharing protocol and a second sharing protocol respectively; the target storage device receives first response information from the source storage device, decodes the first response information according to a first sharing protocol, and obtains and stores first data; the target storage device receives the second response information from the source storage device, decodes the second response information according to the second sharing protocol, and obtains and stores second data. The target storage device can migrate the data in the source storage device based on a plurality of different protocols, so that technical support is not required by additional different migration tools, and the cost of migrating the file system can be effectively reduced.

Description

Method for migrating file system and related equipment
Technical Field
Embodiments of the present application relate to the field of memory, and more particularly, to a method of migrating a file system, a storage device, a storage apparatus, a chip system, and a storage medium.
Background
With the advent of the large data age, the data storage requirements have expanded dramatically, and traditional servers have failed to meet the massive data storage requirements, and network attached storage (network attached storage, NAS) technology has grown. NAS technology may separate a storage device from a server, use the storage device for centralized management of data, and allow the server to access data in the storage device through a network connection, thereby reducing storage costs. NAS storage devices include large amounts of data that may be provided to a server for access in the form of a file system. When the NAS storage apparatus cannot meet the current storage requirement or the purpose of the NAS storage apparatus needs to be readjusted, migration of a file system in the NAS storage apparatus is required. Migrating a file system in a NAS storage device takes a lot of time and can interrupt access to the file system in the NAS storage device by a user's computing device, causing inconvenience to the user.
File systems in NAS storage devices can currently be migrated by migration tools (e.g., migration servers or migration software). The migration tool may connect the source storage device and the target storage device so that the file system in the source storage device may be read from and written to the target storage device. However, in the process of performing file system migration by the migration tool, multiple scans are required to be performed on the file systems in the source storage device and the target storage device, so that new data written by the computing device, namely incremental data, in each migration process of the file systems is determined, and the incremental data is written into the target storage device. Since the source storage device may provide a source file system for the computing device that is shared based on a number of different protocols, the computing device may access files in the source file system, and metadata or attributes based on the different protocols may also be stored in the source storage device. Therefore, when migrating a source file system shared based on different protocols, a plurality of tools supporting different protocols need to be used for scanning the file system in the source storage device for multiple times, so that files, metadata, attributes and the like in the source storage device can be completely migrated to the target storage system. Therefore, the method needs a plurality of different migration tools for technical support, so that the process of migrating the file system is complex, and the migration cost is high.
Therefore, how to reduce the cost of migrating file systems is a major issue.
Disclosure of Invention
The embodiment of the application provides a method, a storage device, a chip system and a storage medium for migrating a file system, which can realize migration of the file system directly through target storage equipment without using a plurality of migration tools supporting different protocols, thereby reducing the cost of migrating the file system.
In a first aspect, a method of migrating a file system is provided. The method comprises the following steps: the target storage device sends first request information and second request information to the source storage device; the target storage device receives the first response information and the second response information from the source storage device; the target storage device decodes the first response information according to the first sharing protocol to obtain and store first data; and the target storage equipment decodes the second response information according to the second sharing protocol to obtain and store second data.
The first request information is information coded according to a first sharing protocol, and the first request information is used for acquiring 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 for acquiring second data in the source storage device. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. Any of a plurality of sharing protocols is used to access data in the source storage device. The first response information is information encoded according to a first shared protocol and the second response information is information encoded according to a second shared protocol. The first response information includes first data, and the second response information includes second data.
In the embodiment of the application, the target storage device can migrate the data in the source storage device based on a plurality of different protocols, so that a plurality of migration tools supporting different protocols are not required to be additionally used in the migration process of the source file system in the source storage device, and the cost of migrating the file system can be effectively reduced. The embodiment of the application can also avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like in the source file system are completely migrated to the target file system. The target storage device can 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, and can parallelly migrate the first data and the second data, so that the time for migrating the source file system is shortened.
With reference to the first aspect, in certain implementations of the first aspect, the plurality of shared protocols includes a plurality of network system file protocols NFS, service information block protocols SMB, or simple storage service protocols S3.
In the embodiment of the application, the target storage device can support a plurality of different protocols, so that the source file system in the source storage device can be migrated according to the plurality of different protocols without using an additional migration tool supporting the different protocols, and the cost of migrating the file system can be reduced.
With reference to the first aspect, in certain implementation manners of the first aspect, the target storage device determines a plurality of migration tasks according to structure information of a source file system in the source storage device; the target storage device determines first request information according to the first migration task; and the target storage equipment determines second request information according to the second migration task.
Each of the plurality of migration tasks is used for migrating part of the files in the source file system to the target storage device. The first migration task is any one of a plurality of migration tasks, and the first migration task is used for migrating the first data to the target storage device. The second migration task is a different task from the first migration task in the plurality of migration tasks, and is used for migrating the second data to the target storage device.
In the embodiment of the application, the target storage device can determine a plurality of files or data to be migrated, namely the first data and the second data, according to the structure information of the source file system, so as to determine a plurality of migration tasks. The target storage device can also determine corresponding request information according to the files or data to be migrated in each migration task, so that the migration task is completed.
With reference to the first aspect, in certain implementations of the first aspect, 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 according to the third request information.
The third request information is request information encoded according to a third sharing protocol, and the third request information is used for acquiring or updating third data, wherein the third data belongs to the target storage device and/or the source storage device. The third shared protocol is any one of a plurality of shared protocols. The third response information is request information encoded according to a third sharing protocol, and the third response information includes third data or update information of the third data.
In the embodiment of the application, the target storage device can receive the access request from the computing device and respond to the access request of the computing device while migrating the source file system. That is, the target storage device may continuously provide online storage services for the computing device and may migrate the source file system in the background to meet both migration and storage requirements of the user.
With reference to the first aspect, in some implementations of the first aspect, in a case where the third request information is used to update the third data, the target storage device decodes the third request information according to a third sharing protocol, and determines the decoded third request information; under the condition that third data exist in the target storage device, the target storage device updates the third data according to the decoded third request information; in the case where the third data is not present in the target storage device, the target storage device sets the priority of the third migration task to be high, and the third migration task is used to migrate the third data into the target storage device.
In the embodiment of the application, the target storage device can determine whether third data exists in the target storage device when receiving the update request from the computing device. The target storage device may also preferentially migrate the third data if the third data is not present in the target storage device, thereby facilitating a subsequent reading or updating of the third data, and further may shorten a time to respond to a request of the computing device.
With reference to the first aspect, in certain implementations of the first aspect, the target storage device records the decoded third request information; and after the target storage device completes the third migration task, updating third data in the target storage device according to the recorded decoded third request information.
In the embodiment of the application, the target storage device can synchronously update the third data in the source storage device and the target storage device after the third migration task is completed, namely after the third data exists in the target storage device, by recording the third request information, so that the consistency of files or data in the source storage device and the target storage device is ensured.
With reference to the first aspect, in certain implementations of the first aspect, 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; and the target storage device sends the third response information to the computing device according to the decoded fourth response information.
The fourth response information is response information coded according to a third sharing protocol, and the fourth response information comprises third data or update information of the third data in the source storage device.
In the embodiment of the application, the target storage device can obtain the response information from the source storage device after the source storage device reads or updates the third data, thereby determining the third data or the update condition of the third data in the source storage device. The target storage device may also send third response information to the computing device according to the third data or the update condition of the third data in the source storage device, so that the computing device may obtain the third data or the update condition of the third data in the source storage device and/or the target storage device.
With reference to the first aspect, in some implementations of the first aspect, the target storage device determines rights information of a target file system in the target storage device according to rights information of a source file system in the source storage device, where the rights information of the target file system is the same as the rights information in the source file system.
In the embodiment of the application, the target file system can keep the authority information of the source file system, so that the security of files or data in the source file system and/or the target file system can be protected, and the computing equipment is not easy to make mistakes when accessing the target file system.
In a second aspect, a method of migrating a file system is provided. The method comprises the following steps: the source storage device receives first request information and second request information from the 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; the source storage device sends first response information and second response information to the target storage device.
The first request information is information coded according to a first sharing protocol, and the first request information is used for acquiring 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 for acquiring second data in the source storage device. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. Any of a plurality of sharing protocols is used to access data in the source storage device. The first response information is information encoded according to a first shared protocol and the second response information is information encoded according to a second shared protocol. The first response information includes first data, and the second response information includes second data.
In the embodiment of the application, the target storage device can migrate the data in the source storage device based on a plurality of different protocols, so that a plurality of migration tools supporting different protocols are not required to be additionally used in the migration process of the source file system in the source storage device, and the cost of migrating the file system can be effectively reduced. The embodiment of the application can also avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like in the source file system are completely migrated to the target file system. The target storage device can directly obtain the first response information and the second response information from the source storage device without forwarding by a migration tool, so that the number of times of encoding and decoding processing of the first response information and the second response information by the migration tool can be reduced, and the time for migrating the source file system is shortened.
With reference to the second aspect, in certain implementations of the second aspect, the plurality of shared protocols includes a plurality of network system file protocols NFS, service information block protocols SMB, or simple store service protocols S3.
In the embodiment of the application, the target storage device and the source storage device can support a plurality of different protocols, so that the target storage device can migrate the source file system in the source storage device according to the plurality of different protocols without using an additional migration tool supporting the different protocols, and the cost of migrating the file system can be reduced.
With reference to the second aspect, in some implementations of the second aspect, the source storage device decodes the first request information according to the first sharing protocol, determines decoded first request information, and uses the decoded first request information to obtain the first data; the source storage device determines first data according to the decoded first request information; the source storage device encodes the first data according to a first shared protocol and determines first response information.
In the embodiment of the application, 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. Similarly, the target storage device may also access data in the source storage device based on the second sharing protocol, such that data in the source storage device that is shared based on the second sharing protocol may be migrated into the target storage device. That is, the embodiment of the application can realize complete migration of data in the source storage device under the condition that the source storage device shares data based on a plurality of sharing protocols.
With reference to the second aspect, in certain implementations of the second aspect, 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 according to the third request information; the source storage device encodes third data or update information of the third data according to a third sharing protocol, and determines fourth response information; the source storage device sends fourth response information to the target storage device.
The third request information is request information encoded according to a third sharing protocol, and the third request information is used for acquiring or updating third data. The third data belongs to the source storage device. The third shared protocol is any one of a plurality of shared protocols. The fourth response information includes the third data or update information of the third data.
In the embodiment of the application, after the third data is read or updated, the source storage device can send the response information to the target storage device, so that the target storage device can determine the third data in the source storage device or the update condition of the third data, and further can feed back to the computing device.
With reference to the second aspect, in some implementations of the second aspect, the source storage device sends configuration information to the target storage device, where the configuration information is configuration information of a source file system in the source storage device, and the configuration information includes structure information and/or authority information of the source file system.
In the embodiment of the application, 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 utilize the structure information to determine at least one migration task, thereby shortening the migration time. In the embodiment of the application, the source storage device can also send the authority information of the source file system to the target storage device, so that the target storage device can keep the authority information of the source file system and further can comprise the security of the source file system.
In a third aspect, embodiments of the present application provide a storage device comprising means for implementing the first aspect or any one of the possible implementations of the first aspect, or comprising means for implementing the second aspect or any one of the possible implementations of the second aspect.
In a fourth aspect, embodiments of the present application provide a storage device comprising a processor for coupling with a memory, reading and executing instructions and/or program code in the memory to perform the first aspect or any one of the possible implementations of the second aspect.
In a fifth aspect, embodiments of the present application provide a chip system comprising logic circuitry for coupling with an input/output interface through which data is transferred to perform the first aspect or any one of the possible implementations of the first aspect or to perform the second aspect or any one of the possible implementations of the second aspect.
In a sixth aspect, embodiments of the present application provide a storage medium storing program code which, when run on a storage device, causes the storage device to perform any one of the possible implementations of the first aspect or the first aspect, or causes the storage device to perform any one of the possible implementations of the second aspect or the second aspect.
In a seventh aspect, embodiments of the present application provide a program product comprising: program code which, when run on a storage device, causes the storage device to perform as the first aspect or any one of the possible implementations of the first aspect or causes the storage device to perform as the second aspect or any one of the possible implementations of the second aspect.
In an eighth aspect, an embodiment of the present application provides a migration system, including: a target storage device as in the first aspect or any of the possible implementations of the first aspect, and a source storage device as in the second aspect or any of the possible implementations of the second aspect.
Drawings
FIG. 1 is a schematic system architecture diagram of a migration system 100 of a file system.
Fig. 2 is a schematic block diagram of a memory device 200 according to one embodiment of the application.
FIG. 3 is a schematic flow chart diagram of a method of migrating a file system in accordance with one embodiment of the present application.
FIG. 4 is a schematic diagram of performing multiple migration tasks in parallel, according to one embodiment of the application.
FIG. 5 is a schematic flow chart diagram of a method of migrating a file system in accordance with another embodiment of the present application.
Fig. 6 is a schematic block diagram of a memory device 600 according to one embodiment of the present application.
Fig. 7 is a schematic block diagram of a memory device 700 according to one embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.
The technical scheme of the embodiment of the application can migrate the file system in the storage equipment supporting various protocols. For example, the file system in the storage device supporting the Network File System (NFS) may be migrated, or the file system in the storage device supporting the server information block (SERVER MESSAGE block, SMB) may be migrated, or the file system in the storage device supporting the simple storage service protocol (simple storage service, S3) may be migrated, or the file system in the storage device supporting other proprietary protocols may be migrated, or the like, which the embodiment of the present application is not limited to.
The technical solution of the embodiment of the present application may migrate file systems in various types of source storage devices, for example, the source storage device may be a storage device of a different product type from the target storage device, or the source storage device may be a storage device of the same product type as the target storage device, which is not limited in the embodiment of the present application.
The source storage device in the embodiment of the present application may be an entity storage server, or may be a cloud storage server of a cloud, which is not limited in the embodiment of the present application. The target storage device in the embodiment of the present application may be various types of storage devices, for example, may be an entity storage server, or may be a cloud storage server of a cloud, which is not limited in the embodiment of the present application. The target storage device in the embodiment of the present application may be physically connected to the source storage device, or may also be remotely connected through a network, etc., which is not limited in the embodiment of the present application.
FIG. 1 is a schematic system architecture diagram of a migration system 100 of a file system. Included in fig. 1 are a target storage device 110, a source storage device 120, and a computing device 130.
In some embodiments, multiple source storage devices 120 and/or multiple computing devices 130 may be included in the system 100, i.e., the target storage device 110 may migrate a file system of each of the one or more source storage devices 120, and the target storage device 110 may also be connected to the one or more computing devices 130. The following illustrates the system 100 as including a source storage device 120 and a computing device 130.
The target storage device 110 may be coupled to the source storage device 120 so that a source file system in the source storage device 120 may be migrated. The target storage device 110 may establish a connection with the source storage device 120 and may obtain configuration information for a source file system in the source storage device 120. The configuration information may include structure information of the source file system, and the configuration information may further include at least one of: rights 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 based on 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 begin migrating 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 based on the structure information of the source file system when migrating the source file system. Each of the at least one migration task is for migrating a portion 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 of the at least one migration task in parallel.
The target storage device 110 may also determine a first sharing protocol among the plurality of sharing protocols, the first sharing protocol being any one of the plurality of sharing protocols, and a second sharing protocol among the plurality of sharing protocols, the second sharing protocol being a different sharing protocol than the first sharing protocol. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols. Any of the plurality of sharing protocols is used to access data in the source storage device. The private protocol may be a user-defined protocol. Specifically, the target storage device 110 may determine the first sharing protocol according to 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 for migrating 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 a first sharing protocol. The target storage device 110 may determine a second sharing protocol based on the second migration task. The second migration task is a different migration task from the first migration task in the at least one migration task, and the second migration task is used for migrating 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 a second sharing protocol.
The target storage device 110 may further determine the first request information according to the first sharing protocol, where the first request information is the 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 first data in the source storage device 120. The target storage device 110 may further determine the second request information according to the second sharing protocol, where the second request information is request information encoded according to the second sharing protocol, that is, a specific format of the second request information is the same as an information format specified by the second sharing protocol. The second request information is used to obtain 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 the first response information and the second response information from the source storage device 120. The first response information is response information encoded according to a first shared protocol, and the first response information includes first data. The second response information is response information encoded according to a second shared protocol, and the second response information includes second data. The target storage device 110 may also decode the first response information according to the first shared protocol to obtain and store the first data. The target storage device 110 may also decode the second response information according to a second sharing protocol to obtain and store the second data.
The target storage device 110 may also be connected to the computing device 130 so that third request information from the computing device 130 may be received online. The third request information is request information encoded according to a third sharing protocol, i.e. the format of the third request information is the same as the format specified by the third sharing protocol. The third shared protocol is any one of a plurality of shared protocols, and may be the same as the first shared protocol and/or the second shared protocol, or may be different, which is not limited by the embodiment of the present application. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols. The private protocol may be a user-defined protocol. The third request information is used to obtain or update third data, where the third data belongs to the target storage device 110 and/or the source storage device 120, i.e. the third data is data in the target storage device 110 and/or the source storage device 120. That is, the target storage device 110 may receive an access or update request of the user while performing the migration task, thereby continuously providing the storage service to the user. The target storage device 110 may, after creating the target file system, send first indication information to the source storage device 120, the first indication information being used to indicate that the source storage device 120 is disconnected from the computing device 130. The first indication information may further include a 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 disconnects from the source storage device 120. The target storage device 110 may receive the third request information from the computing device 130 after establishing a connection with the computing device 130. After receiving the third request information, the target storage device 110 may decode the third request information according to the third sharing protocol, and determine the decoded third request information. The decoded third request information is used to obtain or update third data.
In the case where the decoded third request information is used to update the third data, the target storage device 110 may determine whether the third data is present in the target storage device 110, i.e., whether the third data has been migrated from the source file system into the target file system. If third data exists in the target storage device 110, the target storage device 110 may update the third data according to the decoded third request information. If the third data is not present in the target storage device 110, the target storage device 110 may set the priority of the third migration task high, i.e., the target storage device 110 may preferentially perform 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 for migrating the third data in the source storage device to the target storage device. The target storage device 110 may also record the third request information or the decoded third request information. The target storage device 110 may further update the third data according to the recorded third request information or the decoded third request information after the third migration task is performed.
In the case where the decoded third request information is used to update the third data, the target storage device 110 may also transmit 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 the response information coded 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, which may be, for example, that the third data in the source storage device 120 has been updated successfully, that the third data in the source storage device 120 has not been updated successfully, or the like. The target storage device 110 may also decode the fourth response information according to the third shared protocol to obtain updated information for the third data in the source storage device 120. The target storage device 110 may send the third response information to the computing device based on the fourth response information and/or an update of the third data in the target storage device 110. The third response information is response information coded 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, for example, the third data has been updated successfully, or the third data has not been updated successfully, or the like. The target storage device 110 may further delete the recorded third request information or the decoded third request information before transmitting the third response information.
In the case where the decoded third request information is used to obtain the third data, the target storage device 110 may determine whether the third data is present in the target storage device 110, i.e., whether the third data has been successfully migrated to the target file system. If third data is present in target storage device 110, target storage device 110 may send the third response information directly to computing device 130. The third response information is response information encoded according to a third shared protocol, and the third response information includes third data. If the third data is not present in the target storage device 110, the target storage device 110 may send the third request information to the source storage device 120. The target storage device 110 may also receive fourth response information from the source storage device 120. The fourth response information is response information encoded according to a third shared protocol, and the fourth response information includes third data. The target storage device 110 may also set the priority of the third migration task high, i.e., the target storage device 110 may preferentially perform the third migration task. The third migration task is a migration task to which the third data belongs. Or the target storage device 110 may send the third request information directly to the source storage device 120 without determining whether the third data is present in the target storage device 110. That is, regardless of whether the third data is present in the target storage device 110, the target storage device 110 may directly forward the third request information to the source storage device 120, thereby obtaining fourth response information from the source storage device 120. The target storage device 110 may also send third response information to the computing device 130. The target storage device 110 may further delete the recorded third request information or the decoded third request information before transmitting the third response information.
The source storage device 120 includes a source file system, and the source storage device 120 may 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, configuration information for the source file system may be transferred to the target storage device 110. The configuration information includes structure information of the source file system, and the configuration information may further include at least one of: rights information, user information, or sharing information of the source file system. The source storage device 120 may also receive first indication information from the target storage device 110 and disconnect from the computing device 130 based on 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. In the event that the network address of the target storage device 110 is included in the first indication information, the source storage device 120 may also send the second indication information to the computing device 130 prior to 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 the first request information and the 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 a first shared protocol, and is used to obtain first data in the source storage device 120. The second request information is information encoded according to a second sharing protocol, and is used to obtain second data in the source storage device 120. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols, which may be user-defined protocols. The source storage device 120 may also determine first response information based on the first request information. The first response information is information encoded according to a first shared protocol, and the first response information includes first data. The source storage device 120 may also determine second response information based on the second request information. The second response information is information encoded according to a second shared protocol, and the second response information includes second data. Specifically, the source storage device 120 may decode the first request information according to the first shared protocol, and determine the decoded first request information. The decoded first request information is used to obtain first data. The source storage device 120 may also determine the first data based on the decoded first request information. The source storage device 120 may also encode the first data according to a first shared protocol to determine first response information. The specific implementation of determining the second response information by the source storage device 120 is similar to that of determining the first response information, and will not be described in detail herein. 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 third request information from the target computing device, the third request information being used to obtain or update third data pertaining to the source storage device 120. The third request information is request information encoded according to a third sharing protocol, the third sharing protocol being 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 after receiving the third request information, and 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 further encode the third data or update information of the third data according to the third shared protocol, thereby determining fourth response information, that is, the fourth response information is the response information encoded according to the third shared protocol, the fourth response information including 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 updated successfully, or that the third data in the source storage device 120 has not been updated successfully, or the like. The source storage device 120 may also send 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 that the target file system or the source file system may be accessed. The computing device 130 may receive the second indication information from the source storage device 120 while connected to the source storage device 120, thereby disconnecting from the source storage device 120. The second indication information is used to indicate that the computing device 130 is disconnected from the source storage device 120. In the case where the network address of the target storage device 110 is included in the second indication information, the computing device 130 may also establish a connection with the target storage device 110 after disconnecting from the source storage device 120. In the case of a connection with the target storage device 110, 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 the file system in the source storage device 120 and the target file system is the file system in the target storage device 110. The computing device 130 may also send third request information to the target storage device 110. The third request information is used to acquire 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, the third response information including third data or updated information for the third data.
The target storage device 110 in fig. 1 may transmit data with the source storage device 120 and/or the computing device 130 based on a plurality of different protocols, so that during the migration process of the source file system in the source storage device 120, a plurality of migration tools supporting different protocols need not be additionally used, and thus the cost of migrating the file system may be effectively reduced. The embodiment of the application can avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like in the source file system are completely migrated to the target file system. The target storage device 110 may also directly store the data read from the source storage device 120 after decoding, without having to make the migration tool perform the encoding and decoding processes again to receive the encoded information by the target storage device 110, and the target storage device 110 may store the obtained data after performing the decoding process again, so that the migration time may be shortened.
Meanwhile, the target file system in the target storage device 110 in fig. 1 may also retain authority information of the source file system, so as to effectively protect security of files in the source file system and/or the target file system. Also, after the source storage device 120 is disconnected from the computing device 130, the target storage device 110 may directly establish a connection with the computing device 130 in a shorter time without migrating incremental data, so that the time for interrupting the service may be shortened. In addition, the target storage device 110 may further record the third request information from the computing device 130, and synchronously update the third data in the source file system and the target file system, so that consistency of the data in the source file system and the target file system may be ensured.
Fig. 2 is a schematic block 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 FIG. 2 is similar to the target storage device 110 in FIG. 1.
The first communication module 210 may be used to communicate with the computing device, for example, to receive third request information from the computing device, or to send third response information to the computing device. The computing device may be computing device 130 of fig. 1. The third request information is request information encoded according to a third sharing protocol, and the third request information is used for acquiring or updating third data. The third shared protocol is any one of a plurality of shared protocols including NFS, SMB, S, or a plurality of proprietary protocols. Any of the plurality of sharing protocols is used to access data in the source storage device. The private protocol may be a user-defined protocol. The third data may be data in the storage device 200 or data in a source storage device. The source storage device may be source storage device 120 of fig. 1. After receiving the third request information, the first communication module 210 may decode the third request information according to the third sharing protocol, and determine the decoded third request information. The first communication module 210 may also send the decoded third request information to the IO module 230, and may receive 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 a third shared protocol, the third response information being response information encoded according to the third shared 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 may be configured to perform at least one migration task, each of the at least one migration task being configured to migrate a portion of the files in the source storage device to the storage device 200. Each migration task may include a scanning task and a replication task. The migration module 220 may determine at least one scan task, each of which may be used to scan a portion of a file or data in the source file system. Each scan task may include one or more scan threads. The migration module 220 may traverse some or all of the files contained in the source file system by a distributed crawler method, thereby completing each scan task. The migration module 220 may also determine at least one replication task, each of which may be used to replicate a portion of a file or data in the source file system. Each replication task may include one or more replication threads. The at least one scan task may be in one-to-one correspondence with the at least one copy task. That is, the migration module 220 may send, according to the first scan task, first request information to the source storage device through the second communication module 250, the first request information being used to obtain the first data. The first data is a file or data to be scanned in the first scanning task, for example, may be a directory of the file to be scanned, a content of the file to be scanned, and the like. The first scan job is any one of the at least one scan job. The migration module 220 may also write the obtained first data to 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 may execute one or more of the at least one migration task in parallel. The migration module 220 may also control the number of migration tasks performed in parallel according to the actual operation capability of the storage apparatus 200, so as to avoid affecting the normal operation of the storage apparatus 200. At least one storage node may be included in the source file system, each storage node may be considered a storage space in the source file system, and each storage node may include at least one level one directory and/or at least one file therein. Each of the at least one level of directories may include a portion of the at least one file. The migration module 220 may divide the directory in each storage node into a plurality of child nodes according to at least one storage node included in the source file system and allocate one migration task to each child node. The migration module 220 may also determine a target scan queue that includes a migration task for each of the at least one child node of each storage node.
IO module 230 may be configured to provide a lock mechanism to avoid read-write errors when storage device 200 responds to a third request from a computing device while performing a migration task. The IO module 230 may provide a mutual exclusion lock when the migration module 220 performs a replication task, so as to avoid read-write errors caused by simultaneous read-write operations of multiple threads on the same object. The IO module 230 may further provide a mutual exclusion lock when responding to third request information (e.g., updating third data) of the computing device, so as to avoid read-write errors caused by simultaneous read-write operation of at least one thread of the migration task and a thread updating the third data on the same object.
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.
In the case where the decoded third request information is used to update the third data, the IO module 230 may transmit the decoded third request information to the second communication module 250 when receiving the decoded third request information, so that the second communication module 250 may transmit the third request information to the source storage device. The IO module 230 may receive the decoded fourth response information through the second communication module 250. The decoded fourth response information includes update information of the third data in the source storage device. The IO module 230 may also determine whether the third data is contained in the target file system module 240. If the target file system module 240 includes the third data, the IO module 230 may update the third data according to the decoded third request information. If the target file system module 240 does not include the third data, the IO module 230 may set the priority of the third migration task to be high, so that the migration module 220 preferentially executes the third migration task. The third migration task is a migration task to which the third data belongs. The IO module 230 may further update the third data in the target file system module 240 according to the decoded third request information after the third migration task is performed, that is, after the third data is included in the target file system module 240. The IO module 230 may also send third response information to the computing device through the first communication module 210, where the third response information includes update information of the third data. The IO module 230 may also delete the recorded decoded third request information before sending the third response information to the computing device.
In the case where the decoded third request information is used to read the third data, the IO module 230 may transmit the decoded third request information to the second communication module 250 when 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 third data. The IO module 230 may also send third response information to the computing device through the first communication module 210, where the third response information includes third data. Or the IO module 230 may determine whether the third data is included in the target file system module 240. If the target file system module 240 includes the third data, the IO module 230 may directly read the third data and send third response information to the computing device through the first communication module 210. If the target file system module 240 does not include the third data, the IO module 230 may set the priority of the third migration task to be high, so that the migration module 220 preferentially executes the third migration task. The third migration task is a 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 may store files or data, such as first data and/or second data, migrated from the source storage device. The target file system module 240 includes a target file system, and configuration information of the target file system is the same as configuration information of the source file system. The configuration information includes structural information, and the configuration information may further include at least one of: rights information, user information, or sharing information. The source file system is a file system in a source storage device. After the IO module 230 receives the first data and/or the second data, the target file system module 240 may be accessed by the IO module 230, so that the IO module 230 may write the first data and/or the second data into the target file system module 240. When the IO module 230 receives the decoded third request information, the target file system module 240 may be accessed by the IO module 230, so that the IO module 230 may determine whether third data exists in the target file system module 240. In the event that third data is present in the target file system module 240, the target file system module 240 may also be accessed by the IO module 230 so that the IO module 230 may 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: delete the third data or modify the third data, etc.
The second communication module 250 may be configured to communicate with the source storage device, such as 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 source storage device 120 in fig. 1. The first request information is request information encoded according to a first shared protocol, the first shared protocol being any one of a plurality of shared protocols. The second request information is request information encoded according to a second shared protocol, and the second shared protocol is a different protocol from the first shared protocol among the plurality of shared protocols. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols. The private protocol may be a user-defined protocol. The first request information is used for acquiring first data in the source storage device, and the second request information is used for acquiring second data in the source storage device. The second communication module 250 may be connected to multiple source storage devices simultaneously, i.e., may access or migrate file systems in the multiple source storage devices simultaneously. The second communication module 250 may also control the number of file systems in the multiple source storage devices to be accessed or migrated in parallel, depending on the actual operational capabilities of the storage device 200. The second communication module 250 may also maintain a connection relationship with each of the at least one source storage device and place one or more sessions in an active state, the one or more sessions being 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 the source storage device if disconnected from the source storage device.
The second communication module 250 may also provide a unified interface so that the impact of the shared protocol used by the source storage device itself support on the migration source file system may be ignored. That is, regardless of which shared protocol is used supported by the source storage device, the interface provided in the second communication module 250 may determine the corresponding request information based on the shared protocol. The corresponding request information is request information encoded based on the sharing protocol, and the corresponding request information is used for acquiring part of files or data in the source storage device. The second communication module 250 may also provide an application programming interface (application programming interface, API) or an internal module based on a portable operating system interface (portable operating SYSTEM INTERFACE, POSIX), such as a stack corresponding to a different protocol, a cache for storing third request information or response information, an external data representation (external data representation, XDR) codec for encoding or decoding, a connection pool running in multiple threads where File Descriptors (FD) are registered, etc., to facilitate the internal execution of migration tasks by the storage device 200 or in response to third request information by the computing device. For example, the second communication module 250 may determine the first request information according to a first shared protocol. The second communication module 250 may also determine the second request information according to a second shared protocol. The second communication module 250 may further encode the decoded third request information according to a third shared protocol to determine the third request information. The second communication module 250 may further 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 the decoded fourth response information to the IO module 230. The first, second, and third sharing protocols support a shared protocol for use by the source storage device.
The configuration module 260 is configured to obtain configuration information of a source file system in a source storage device, where the configuration information includes structure information. The configuration information may also include any one or more of rights information, user information, or sharing information. The structure information is information indicating the structure of the source file system and nodes in the structure, which may be, for example, a quadtree (quadtree, qtrees) structure, or the like. Rights information is information indicating users that some or all of the files in the source file system may be accessed. The rights information may be, for example, a security identifier (security identifiers, SID), mode bits, access control list (access control lists, ACL), active directory service (active directory service, ADS) information, etc. The user information is information indicating a user to whom a file in the source file system belongs. The shared information is used to indicate file or data information in the source file system that can be accessed remotely. The configuration module 260 may obtain configuration information of a source file system in the source storage device after the storage device 200 establishes a connection with the source storage device, and may 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, via the second communication module 250, first indication information to the source storage device, which may be used to indicate that the source storage device is disconnected from the computing device. The first indication information may further include a 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.
In some embodiments, the storage device 200 may also include a log module 270. A pre-written log (WRITE AHEAD log, WAL) may be included in the log module 270, which may be used to record the third request information or the decoded third request information. After the IO module 230 receives the decoded third request information, 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 before sending the third response information to the computing device. The third response information is information in response to the third request information.
The storage device 200 may transmit data with the source storage device and/or the computing device based on a plurality of different protocols, so that a plurality of migration tools supporting different protocols are not required to be additionally used in the migration process of the source file system in the source storage device, thereby effectively reducing the cost of migrating the file system. The embodiment of the application can avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like 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 performing the encoding and decoding process of the information again through the migration tool, and thus the migration time can be shortened. Rights information of the source file system may also be maintained in the storage device 200, so that security of files in the source file system and/or the target file system is effectively protected. Moreover, after the source storage device is disconnected from the computing device, the storage device 200 does not need to migrate incremental data, but can directly establish a connection with the computing device in a shorter time, so that the time for interrupting service can be shortened. In addition, the storage device 200 may further record the third request information from the computing device or the decoded third request information, and update the third data synchronously in the source file system and the target file system, so that consistency of the data in the source file system and the target file system may be ensured.
Fig. 3 is a schematic flowchart of a method for migrating a file system according to an embodiment of the present application, where fig. 3 includes the following steps.
S310, the first request information and the second request information are sent.
The target storage device may send the first request information and the second request information to the source storage device. The first request information is information encoded according to a first shared protocol, and the first request information is used for acquiring first data in a source storage device. The second request information is information encoded according to a second sharing protocol, and the second request information is used for acquiring second data in the source storage device. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. Any of the plurality of sharing protocols is used to access data in the source storage device.
Alternatively, the target storage device may access the data in the source storage device via multiple shared protocols. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols. The private protocol may be a user-defined protocol.
Optionally, prior to step S310, the target storage device may establish a connection with the source storage device.
In some embodiments, the target storage device may be manually configured to establish a connection with the source storage device. Or the target storage device may obtain the network address of the source storage device through other devices connected to the target storage device, so as to establish a connection with the source storage device. Or the target storage device may receive a connection request from the source storage device to establish a connection with the source storage device, the embodiment of the application is not limited in this respect.
Alternatively, after establishing a connection with the source storage device, the target storage device may obtain configuration information for the source file system in the source storage device. The configuration information includes structural information, and the configuration information may further include at least one of: rights information, user information, or sharing information.
In some embodiments, the structure information is used to indicate the structure of the source file system and information of nodes in the structure, which may be, for example, qtrees structures, etc. The structure 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 a file included in each directory of each storage node.
In some embodiments, rights information is used to indicate information of users that some or all files in the source file system may be accessed. The authority information may be information such as SID, mode bits, ACL, or ADS. The user information is information indicating a user to whom a file in the source file system belongs. The shared information is used to indicate file or data information in the source file system that can be accessed remotely.
The mode of obtaining the configuration information of the source file system is not particularly limited in the embodiment of the present application, for example, the target storage device may access the source file system, so as to obtain the configuration information of the source file system. Or the target storage device may send an access request to the source storage device requesting that configuration information of the source storage device be obtained. The target storage device may also receive configuration information from the source storage device.
Alternatively, the target storage device may create a target file system in the target storage device based on 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.
Alternatively, the target storage device may determine at least one migration task based on the structure information of the source file system. Each of the at least one migration task is for migrating a portion of the files in the source storage device to the target storage device, i.e., each migration task is for scanning and copying a portion of the files in the source file system. In other words, each migration task may include one scan task and one copy task. The target storage device may determine at least one scan task and at least one copy task, the at least one scan task corresponding one-to-one to the at least one copy task. Each of the at least one scanning task may be used to scan a portion of the files or data in the source file system to determine the files to be migrated and/or the specific content of the files. Each of the at least one replication task may be used to replicate a portion of a file or data in the source file system. That is, each scan task is used to read a portion of a file or data in the source file system, and each copy task is used to write the file or data read by the corresponding scan task into the target file system.
In some embodiments, the target storage device may perform each of the at least one migration task serially, i.e., the target storage device may perform only one migration task at a time and allocate all resources executable for the migration task. Or the target storage device may execute one or more of the at least one migration task in parallel, i.e., the target storage device may execute multiple migration tasks at a time, the multiple migration tasks sharing all of the resources that may be executed, which the embodiment of the application is not limited to.
It should be appreciated that the target storage device may migrate not only the contents of files and attributes of files, etc. in the source file system, but also metadata in the source file system and attributes of the source file system. The attributes of the file may include the type of the file, the size of the file, time information of the file, etc. The time information of the file may include creation time of the file, modification time of the file, and the like. The source file system is a file system in the source storage device, and the attributes of the source file system may include a type of the source file system, a size of the source file system, time information of the source file system, and the like. The time information of the source file system may include creation time of the source file system, modification time of the source file system, and the like. Metadata is used to describe files or data in a source file system. Metadata is generally different based on different protocols.
In some embodiments, the target storage device may control the number of migration tasks performed in parallel according to factors such as current migration capability, running speed, available bandwidth, etc. of the target storage device, thereby avoiding affecting the response of the target storage device to the computing device while maximizing migration throughput.
In some embodiments, at least one storage node may be included in the source file system, each storage node may be considered a storage space in the source file system, and each storage node may include at least one level one directory and/or at least one file therein. Each of the at least one level of directories may include a portion of the at least one file. The target storage device may divide a directory or file in each storage node into at least one child node according to at least one storage node included in the source file system and assign a migration task to each of the at least one child node. That is, the target storage device may assign each child node a scan task and a copy task.
In the case where the target storage device performs multiple migration tasks in parallel, the target storage device may also determine a target scan queue that includes the migration tasks for each of the at least one child node. That is, the target scan queue includes a scan task and a copy task for each child node. Each scan task may include one or more scan threads and each replication task may include one or more replication threads. The target storage device may execute the scan threads and/or copy threads of multiple child nodes in parallel at the same time.
In some embodiments, a specific manner in which the target storage device performs multiple migration tasks in parallel is shown in FIG. 4. FIG. 4 is a schematic diagram of performing multiple migration tasks in parallel according to an embodiment of the present application. Fig. 4 includes a target scan queue, where the target scan queue includes migration tasks of child node 1, child nodes 2, … …, and child node N, where N is a positive integer greater than or equal to 1. The migration task of each child node may include a scanning thread and a replication queue, and the replication queue of each child node may include at least one replication thread. For example, the migration task of the child node 1 may include a scanning thread and a replication queue, where the replication queue includes m 1 replication threads, which are replication thread 1 to replication thread m 1 respectively. Wherein m 1 is a positive integer greater than or equal to 1. Similarly, the migration task of the child node 2 includes a scanning thread and a replication queue, where the replication queue includes replication threads m 1 +1 through m 2. Wherein m 2 is a positive integer greater than or equal to m 1 +1. The migration task of the child node N includes a scanning thread and a replication queue, where the replication queue includes replication threads m N-1 +1 through m N. Wherein m N is a positive integer greater than or equal to m N-1 +1. The target storage device may simultaneously perform the migration tasks for each of child node 1 through child node N. The child nodes 1 to N may be child nodes of the same storage node or child nodes of different storage nodes, which is not limited in the embodiment of the present application.
It should be understood that the migration tasks of each child node in fig. 4 include one scanning thread and one replication queue, each replication queue including one or more replication threads is for illustrative purposes only. The embodiment of the application does not specifically limit the number of scanning threads and/or copying threads contained in the migration task of each child node. For example, the migration task of each child node may include one scan queue and one replication queue, each scan queue including one or more scan threads, and each replication queue including one or more replication threads.
In some embodiments, the target storage device may traverse the files or data in the source file system by a distributed crawler method, thereby completing the scanning task of each child node.
In some embodiments, the target storage device may determine the first request information based on the first migration task. The first migration task is any one of a plurality of migration tasks, and the first migration task is used for migrating the first data to the target storage device.
In some embodiments, the target storage device may determine, from among a plurality of shared protocols, a shared protocol that may access the first data, i.e., determine a first shared protocol, based on a file or data to be scanned in the first scanning task, i.e., based on the first data. The first scanning task is a scanning task included in the first migration task. The target storage device may also encode information for retrieving the first data in the source storage device according to the first shared protocol to determine the first request information. That is, the first request information is information encoded according to a first shared protocol, and the first request information is used to acquire 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 shared protocol.
In some embodiments, the target storage device may determine the second request information based on the second migration task. The second migration task is a migration task different from the first migration task in the plurality of migration tasks, and the second migration task is used for migrating the second data to the target storage device.
In some embodiments, the target storage device may determine, from the plurality of shared protocols, a shared protocol that may access the second data, i.e., determine a second shared protocol, based on the file or data to be scanned in the second scanning task, i.e., based on the second data. The second scanning task is a scanning task included in the second migration task. The target storage device may also encode information for retrieving second data in the source storage device according to a second sharing protocol to determine second request information. That is, the second request information is information encoded according to a second shared protocol, and the second request information is used to acquire second data in the source storage device. In other words, the format of the second request information is the same as the information format specified by the second sharing protocol.
In some embodiments, the first data and/or the second data may include not only specific content and basic attributes of files in the source file system, but also data related to the SMB protocol, such as extended attributes (xattr) or ADS, etc. Specifically, the target storage device may set an ACL in the SMB session connected to the source storage device, thereby acquiring data related to the SMB protocol.
Alternatively, 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.
In some embodiments, the first request information includes first identification information, where the first identification information is used to instruct the source storage device to encode the first data according to the first sharing protocol. The second request information includes second identification information, where the second identification information is used to instruct the source storage device to encode second data according to a second sharing protocol.
In some embodiments, the target storage device may send the first request information and the second request information simultaneously. Or the target storage device may send the first request information before sending the second request information. In other words, the source storage device may receive the first request information and the second request information at the same time. Or the source storage device may receive the first request information and then receive the second request information, which is not limited by the embodiment of the present application.
S320, determining first response information according to the first request information.
The source storage device may determine the first response information according to the first request information after receiving the first request information from the target storage device. The first response information is information encoded according to a first shared protocol, and the first response information includes first data.
In some embodiments, after receiving the first request information, the source storage device may decode the first request information according to a first shared protocol, and determine the decoded first request information. The decoded first request information is used to obtain 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 a first shared protocol to determine first response information.
In some embodiments, the source storage device may determine the first sharing protocol based on the first identification information in the first request information. The source storage device may also perform a codec process on the first request information or the first data according to the first shared protocol.
S330, determining second response information according to the second request information.
After receiving the second request information from the target storage device, the source storage device may determine second response information according to the second request information. The second response information is information encoded according to a second shared protocol, and the second response information includes second data.
In some embodiments, after receiving the second request information, the source storage device may decode the second request information according to a second sharing protocol, and determine the decoded second request information. The decoded second request information is used to obtain 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 a second sharing protocol to determine second response information.
In some embodiments, the source storage device may determine the second sharing protocol based on second identification information in the second request information. The source storage device may also perform a codec process on the second request information or the second data according to a second sharing protocol.
S340, receiving the first response information and the second response information.
The target storage device may receive the response information from the source storage device after sending the request information to the source storage device. Specifically, the target storage device may receive the first response information from the source storage device after transmitting the first request information to the source storage device. The first response information is information coded according to a first shared protocol, and the first response information contains first data. The target storage device may also receive second response information from the source storage device after sending the second request information to the source storage device. The second response information is information encoded according to a second shared protocol, and the second response information includes second data.
S350, decoding the first response information according to the first sharing protocol to obtain and store the first data.
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, so as to obtain data contained in the response information. Specifically, after receiving the first response information, the target storage device may decode the first response information according to the first sharing protocol to obtain the first data. The target storage device may also store the first data directly.
In some embodiments, the first response information includes first identification information, where the first identification information is used to instruct the target storage device to decode the first response information according to the first sharing protocol.
In some embodiments, the target storage device decoding according to the first shared protocol refers to: the target storage device may determine a specific format of the first response information according to the first shared protocol, and read the first data from the first location in the first response information. The first location in the first response message is a specific location of the first data in the first response message in accordance with the information format specified by the first shared protocol.
In some embodiments, the target storage device may store the first data directly into the target file system after obtaining the first data. 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.
In some embodiments, after obtaining the first data, the target storage device may write the first data to the target file system according to a first replication task of the first migration tasks.
S360, decoding the second response information according to the second sharing protocol to obtain and store second data.
The target storage device may decode the second response information according to the second shared protocol after receiving the second response information, to obtain second data. The target storage device may also store the second data directly.
In some embodiments, the second response information includes second identification information, where the second identification information is used to instruct the target storage device to decode the second response information according to a second sharing protocol.
In some embodiments, the target storage device decoding according to the second shared protocol refers to: the target storage device may determine a specific format of the second response information according to the second sharing protocol, and read the second data from the first location in the second response information. The first location in the second response message is a specific location of the second data in the second response message in accordance with the information format specified by the second sharing protocol.
In some embodiments, the target storage device, after obtaining the second data, may store the second data directly into 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.
In some embodiments, after obtaining the second data, the target storage device may write the second data to the target file system according to a second replication task of the second migration tasks.
In some embodiments, the target storage device may control the number of scanning tasks and/or replication tasks performed in parallel based on factors such as the current migration capability, operating speed, available bandwidth, etc. of the target storage device, thereby avoiding affecting the response of the target storage device to the computing device while maximizing migration throughput.
It should be appreciated that when the migration tool is used to migrate the first data, the migration tool needs to perform the protocol conversion again after obtaining the first data from the source storage device, so as to obtain the information encoded according to the first shared protocol, where the information includes the first data. The migration tool also needs to send this information to the target storage device so that the target storage device obtains the first data after decoding the information. That is, the target storage device in the embodiment of the present application can directly store the data acquired from the source storage device after decoding, without performing the encoding and decoding process of the information again through the migration tool, so that the migration time can be shortened.
The target storage device in the embodiment of the application can transmit data with the source storage device based on a plurality of different protocols, so that a plurality of migration tools supporting different protocols are not required to be additionally used in the migration process of the source file system in the source storage device, thereby effectively reducing the cost of migrating the file system. The embodiment of the application can avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like in the source file system are completely migrated to the target file system. Meanwhile, the target file system in the target storage device can also keep the authority information of the source file system, so that the safety of files in the source file system and/or the target file system is effectively protected.
FIG. 5 is a schematic flow chart of a method for migrating a file system according to an embodiment of the present application, wherein the method in FIG. 5 includes the following steps.
S501, establishing connection and obtaining configuration information.
The target storage device may establish a connection with the source storage device and may also obtain configuration information for the source file system from the source storage device. The configuration information includes structural information, and the configuration information may further include at least one of: rights information, user information, or sharing information. A specific implementation of the target storage device establishing a connection with the source storage device and obtaining configuration information may be referred to the description in step S310.
Data may be transferred between the target storage device and the source storage device via a plurality of different shared protocols, which may support a plurality of protocols used by the source storage device, such as NFS protocol, SMB protocol, S3 protocol, or proprietary protocol. Any of the plurality of sharing protocols is used to access data in the source storage device.
S502, creating a target file system.
The target storage device may create a target file system based on configuration information of the source file system. The configuration information of the target file system is the same as that of the source file system.
In some embodiments, the target storage device may create storage nodes in the target file system based on the structure 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.
In some embodiments, the target storage device may also create at least one child node of each storage node in the target file system from 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 is in one-to-one correspondence with at least one child node of each storage node in the source file system.
In some embodiments, the target storage device may create a user of the target file system from the SID information in the source file system and may perform user mapping such 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.
In some embodiments, the target storage device may also obtain mode bits and ACLs for the source file system. The target storage device can scan the source file system under different rights (such as SID rights and ACL rights), so that the files, metadata, attributes and the like in the source file system can be completely migrated. Since the complete rights information in the source file system is maintained in the target file system, errors are less likely to occur when the computing device accesses the target file system. For example, after a file in the source file system is migrated to the target file system, a file that is inaccessible to user a in the source file system is still inaccessible in the target file system, and a file that is accessible to user a in the source file system is still accessible in the target file system.
In some embodiments, the target storage device may also determine files or data in the target file system that may be accessed remotely, such as determining a shared directory or shared files, based on the sharing information of the source file system.
S503, determining the first request information and the second request information.
In some embodiments, the target storage device may determine at least one migration task based on configuration information of the source file system. Each of the at least one migration task is configured to migrate a portion of the files in the source storage device to the target storage device.
In some embodiments, the target storage device may determine, from among a plurality of sharing protocols, a sharing protocol that may access the first data, i.e., determine a first sharing protocol, according to a file or data to be acquired in the first migration task, i.e., according to the first data. The first migration task is any one of the at least one migration task. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols, which may be user-defined protocols. The target storage device may also encode information for retrieving the first data in the source storage device according to the first shared protocol to determine the first request information. That is, the first request information is information encoded according to a first shared protocol, and the first request information is used to acquire 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 shared protocol.
Similarly, the target storage device may determine, from the plurality of sharing protocols, a sharing protocol that may access the second data, i.e., determine the second sharing protocol, based on the file or data to be acquired in the second migration task, i.e., based on the second data. The second migration task is a different task from the first migration task in the at least one migration task. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols, which may be user-defined protocols. The target storage device may also encode information for retrieving second data in the source storage device according to a second sharing protocol to determine second request information. That is, the second request information is information encoded according to a second shared protocol, and the second request information is used to acquire second data in the source storage device. In other words, the format of the second request information is the same as the information format specified by the second sharing protocol. A specific implementation may participate in the description in step S310.
S504, the first request information and the second request information are sent. Step S504 is similar to step S310, and will not be described here.
S505, according to the first request information and the second request information, determining first response information and second response information. Step S505 is similar to steps S320 and S330, and will not be described here.
S506, receiving the first response information and the second response information. Step S506 is similar to step S340, and will not be described here.
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 here.
S508, the first indication information is sent.
After the target storage device creates the target file system, the first indication information may be directly sent to the source storage device. Or the target file system may send the first indication information to the source storage device after performing part or all of the migration task. The first indication information is to indicate that the source storage device is disconnected from the computing device. In other words, the embodiment of the present application is not limited to the order of execution of steps S503 to S507 and step S508. For example, steps S503 to S507 may be performed first, and then step S508 may be performed. Or step S508 may be performed first and then steps S503 to S507 may be performed.
In some embodiments, the first indication information further includes a network address of the target storage device.
In some embodiments, after receiving the first indication information from the target storage device, the source storage device may disconnect from the computing device according to the first indication information. Or the source storage device may perform step S509 after receiving the first indication information, thereby disconnecting from the computing device.
S509, transmitting second indication information to disconnect the connection.
The source storage device may send the second indication information to the computing device after receiving the first indication information, thereby disconnecting from the computing device. The second indication information is to indicate that the computing device is disconnected from the source storage device.
In some embodiments, the second indication information further includes a network address of the target storage device.
In some embodiments, the computing device may actively disconnect from the source storage device upon receiving the second indication information. The computing device may also perform step S510 after receiving the second indication information.
S510, establishing connection.
In some embodiments, after the target storage device creates the target file system, the target storage device may be manually configured to establish a connection with the computing device. Or after the target storage device creates the target file system, the target storage device can obtain the network address of the computing device through other devices connected with the target storage device, so that connection is established with the computing device. Or after the target storage device creates the target file system, the target storage device may receive a connection request from the computing device to establish a connection with the computing device, which is not limited by the embodiment of the application.
In some embodiments, 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.
In some embodiments, the computing device may establish a connection with the target storage device by way of manual configuration after disconnecting from the source storage device.
In some embodiments, the computing device may receive a connection request from the target storage device after disconnecting from the source storage device, thereby establishing a connection with the target storage device.
In some embodiments, after the computing device establishes a connection with the target storage device, the shared file system may be reloaded to access the source file storage system and/or the target storage system through the target storage device.
Data may be transferred between the target storage device and the computing device via a variety of different protocols that may support the protocols used for the computing device, such as NFS protocol, SMB protocol, S3 protocol, or proprietary protocols.
In some embodiments, the target storage device may establish a connection directly 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 delta data. Metadata is used to describe files or data in a source file system. Metadata is generally different based on different protocols. When the incremental data is a migrated source file system, the computing device newly writes the source file system and does not write the data in the target file system.
S511, third request information is received.
After the computing device establishes a connection with the target storage device, the files or data in the source file system may continue to be accessed or updated through the target storage device. That is, the computing device may send the third request information to the target storage device after establishing the connection with the target storage device. The third request information is used to obtain or update third data in the source file system and/or the target file system. I.e. the third data belongs to the source storage device and/or the target storage device. The third request information is request information encoded according to a third shared protocol, the third shared protocol being any one of a plurality of shared protocols. In other words, the format of the third request information is the same as the information format specified by the third sharing protocol.
In some embodiments, the plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols, which are user-defined protocols.
In some embodiments, 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 migration tasks while not interrupting service.
In some embodiments, after receiving the third request information, the target storage device may decode the third request information according to a third sharing protocol, thereby determining decoded third request information. The decoded third request information is used to obtain or update third data.
It should be understood that if the third request information is used to obtain 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.
In some embodiments, the third request information includes third identification information, where the third identification information is used to instruct the target storage device to decode the third request information according to a third sharing protocol.
Optionally, the target storage device may also perform steps S512, S513, S514, S515.
And S512, recording the third request information or the decoded third request information.
In some embodiments, the target storage device, upon receiving the third request information, may store the third request information, thereby ensuring consistency of the target file system with files or data in the source file system. Or the target storage device may store the decoded third request information after determining the decoded third request information, thereby ensuring consistency of the target file system and the files or data in the source file system. Specifically, the target storage device may determine whether the third data in the source file system and the target file system has been updated synchronously by recording the third request information and/or the decoded third request information, thereby ensuring that the third data is updated in the source file system and the same update is performed in the target file system at the same time.
S513, the third request information is sent.
In some embodiments, the target storage device may send the third request information to the source storage device, i.e., the target storage device may forward the third request information to the source storage device. Or the target storage device may encode the decoded third request information according to the third sharing protocol, thereby obtaining third request information, and send the third request information to the source storage device. In other words, the source storage device may receive the third request information.
In some embodiments, the target storage device may send the third request information directly to the source storage device. Or the target storage device may first determine whether third data is present in the target storage device and then determine whether third request information needs to be sent to the source storage device.
For example, in the case where the third request information is used to read the third data, the target storage device may directly transmit the third request information to the source storage device. Or the target storage device may send the third request information to the source storage device in the event that the target storage device determines that the third data is not present in the target storage device. Or the target storage device may not send the third request information to the source storage device in the event that the target storage device determines that the third data is present in the target storage device.
For example, in the case where the third request information is used to update the third data, the target storage device may send the third request information directly to the source storage device. Or the target storage device may first determine whether third data is present in the target storage device and send third request information to the source storage device regardless of whether third data is present.
S514, fourth response information is determined according to the third request information.
In some embodiments, after the source storage device receives the third request information, the third data or update information of the third data in the source storage device may be determined according to the third request information. Specifically, the source storage device may decode the third request information according to the third sharing protocol, and determine the decoded third request information. The decoded third request information is used to obtain or update third data. The source storage device may also read or update the third data in the source file system based on the decoded third request information to determine the third data or updated information for the third data.
In some embodiments, the source storage device may further encode the third data or update information of the third data in the source storage device according to a third sharing protocol, determining the fourth response information. That is, the fourth response information is the response information encoded according to the third shared protocol, and the specific format of the fourth response information is identical to the information format specified by the third shared protocol. The fourth response information includes the third data or update information of the third data in the source storage device.
In some embodiments, the fourth response information includes third identification information, where the third identification information is used to indicate that the fourth response information is decoded according to a third sharing protocol.
S515, fourth response information is received.
In the case where the third request information is used to obtain the third data, the target storage device may receive fourth response information from the source storage device. The fourth response information includes third data.
In the case where the third request information is used to update 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, that the third data in the source file system has been successfully updated or has not been successfully updated.
In some embodiments, the target storage device may decode the fourth response information according to the third shared protocol after receiving the fourth response information, and determine the decoded fourth response information. The decoded fourth response information includes updated information for the third data or third data in the source file system.
S516, the third data is read or updated, or the third migration task is preferentially executed.
In the case where the decoded third request information is used to update the third data, 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 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, and the like. If the third data does not exist in the target storage device, the target storage device may set the priority of the third migration task to be high, that is, preferentially execute the third migration task. The third migration task is a migration task to which the third data belongs. The target storage device may further update the third data according to the decoded third request information after the third migration task is performed, that is, after the third data exists in the target storage device.
In the case where the decoded third request information is used to read the third data, the target storage device may determine whether the third data is present 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 third request information to the source storage device. The target storage device may also set the priority of the third migration task to be high, that is, preferentially execute the third migration task, where the third migration task is a migration task to which the third data belongs.
It should be understood that the execution sequence of steps S513-S515 and step S516 is not limited in the embodiment of the present application, for example, steps S513-S515 may be executed first, and then step S516 may be executed. Or step S516 may be performed first and then steps S513-S515 may be performed. Or steps S513-S515 and step S516 may be performed simultaneously.
Optionally, the target storage device may also perform step S517.
S517, deleting the recorded third request information or the decoded third request information.
In some embodiments, 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.
In some implementations, 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. Or the target storage device may delete the recorded third request information or the decoded third request information after determining the decoded fourth response information. Or 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 by the embodiment of the present application.
S518, third response information is sent.
The target storage device may send third response information to the computing device, i.e., in response to the request of the computing device, while migrating the file or data in the source file system. 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 an update of the third data in the source storage device and/or the target storage device, e.g., the third data in the source storage device and/or the target storage device has been successfully updated or has not been successfully updated.
In some embodiments, the third response information is request information encoded according to a third shared protocol, the third shared protocol being any one of a plurality of shared protocols. In other words, the format of the third request information is the same as the information format specified by the third sharing protocol. The plurality of shared protocols includes NFS, SMB, S, or a plurality of proprietary protocols, which are user-defined protocols.
In the case where the decoded third request information is used to update the third data, the target storage device may determine third response information according to the update information of the third data in the target storage device. Or the target storage device may determine the third response information according to the update information of the third data in the source storage device, i.e., the decoded fourth response information. Or the target storage device may determine the third response information according to update information of the third data in the target storage device and the source storage device, which is not limited by the embodiment of the present application.
For example, the target storage device may encode update information of the third data in the target storage device according to the third sharing protocol after the third data in the target storage device is updated, thereby determining the third response information. The update information of the third data in the target storage device may be, for example, that the third data in the target storage device has been successfully updated or has not been successfully updated, or the like.
For example, the target storage device may determine the third response information by encoding the decoded fourth response information according to the third shared protocol after determining the decoded fourth response information. The decoded fourth response information includes update information of the third data in the source storage device, for example, the third data in the source storage device has been successfully updated or has not been successfully updated.
For example, the target storage device may determine the third response information by encoding update information of the third data in the target storage device and the source storage device according to the third sharing protocol after the third data in the target storage device is updated and the decoded fourth response information is determined.
In some embodiments, if the decoded fourth response information indicates that the third data in the source storage device has been successfully updated and the third data in the target storage device has not been successfully updated, the third response information may indicate that the third data has not been successfully updated. Or if the decoded fourth response information indicates that the third data in the source storage device has not been successfully updated and the third data in the target storage device has been successfully updated, the third response information may indicate that the third data has not been successfully updated. Or if the decoded fourth response information indicates that the third data in the source storage device has been successfully updated and the third data in the target storage device has not been successfully updated, the third response information may indicate that the third data has been successfully updated. Or if the decoded fourth response information indicates that the third data in the source storage device has not been successfully updated and 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, and the embodiment of the application is not limited to this.
In the case where the decoded third request information is used to acquire third data, the target storage device may determine third response information according to the third data in the target storage device. Or the target storage device may determine the third response information according to the third data in the source storage device, that is, the decoded fourth response information, which is not limited by the embodiment of the present application.
For example, the target storage device may directly read the third data in the target storage device and encode the third data according to a third shared protocol to determine third response information.
For example, the target storage device may determine the third response information by encoding the decoded fourth response information according to the third shared protocol after determining the decoded fourth response information. The decoded fourth response information includes third data in the source storage device.
Alternatively, the target storage device may disconnect from the source storage device after migrating files, metadata, attributes, etc. in the source file system to the target file system.
It should be appreciated that after the computing device is disconnected from the source storage device, a connection may be established directly with the target storage device without waiting for the target storage device to migrate the incremental data, thus reducing the time to interrupt service. Incremental data is data that during migration of the source file system, the computing device newly writes to the source file system and not to the target file system. In the embodiment of the application, the target storage device can synchronously update the third data in the target file system and the source file system when receiving the third request information from the computing device, so that the target storage device does not need longer interrupt time to migrate the incremental data, and the consistency of the source file system and the files or data in the target file system can be ensured.
It should also be appreciated that the target storage device may communicate data with the source storage device and/or the computing device based on a variety of different protocols, and thus, during migration of the source file system in the source storage device, there is no need to additionally use a plurality of migration tools supporting different protocols, which may effectively reduce the cost of migrating the file system. The embodiment of the application can avoid the problem that metadata based on other protocols in the source file system cannot be migrated by using a migration tool supporting one protocol under the condition that the source file system supports a plurality of protocols at the same time, thereby ensuring that data, metadata, attributes and the like 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 performing the encoding and decoding process of the information again through the migration tool, so that the migration time can be shortened. Meanwhile, the authority information of the source file system can be reserved in the target storage device, so that the safety of files in the source file system and/or the target file system is effectively protected.
Fig. 6 is a schematic structural diagram of a storage device 600 according to an embodiment of the present application, where the storage device 600 includes a transceiver module 610 and a processing module 620.
The transceiver module 610 is configured to send first request information and second request information to the source storage device, where the first request information is encoded according to a first shared 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 for acquiring second data in the source storage device. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. Any of the plurality of sharing protocols is used to access data in the source storage device. The transceiver module 610 is further configured to receive first response information and second response information from the source storage device, where the first response information is encoded according to a first shared protocol, and the first response information includes first data. The second response information is information encoded according to a second shared protocol, and the second response information includes second data. The transceiver module 610 may perform steps S310, S340 in the method of fig. 3, steps S504, S506, S508, S511, S513, S515, S518 in the method of fig. 5.
The processing module 620 is configured to decode the first response information according to the first shared protocol, and obtain and store the first data. The processing module 620 is further configured to decode the second response information according to a second sharing protocol, to obtain and store second data. The processing module 620 may perform steps S350, S360 in the method of fig. 3, steps S501, S502, S503, S507, S510, S512, S516, S517 in the method of fig. 5.
Fig. 7 is a schematic structural diagram of a storage device 700 according to an embodiment of the present application, where the storage device 700 includes a transceiver module 710 and a processing module 720.
The transceiver module 710 is configured to receive first request information and second request information from a source storage device, where the first request information is encoded according to a first shared 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 for acquiring second data in the source storage device. The first shared protocol and the second shared protocol are different protocols of the plurality of shared protocols. Any of the plurality of sharing protocols is used to access data in the source storage device. The transceiver module 710 is further configured to send first response information and second response information to the target storage device, where the first response information is information encoded according to a first sharing protocol, and the second response information is information encoded according to a second sharing protocol. The transceiver module 710 may perform steps S310, S340 in the method of fig. 3, steps S504, S506, S508, S509, S513, S515 in the method of fig. 5.
The processing module 720 is configured to determine first response information according to the first request information. The first response information is information encoded according to a first shared protocol, and the first response information includes first data. The processing module 720 is further configured to determine second response information according to the second request information. The second response information is information encoded according to a second shared protocol, and the second response information includes second data. The processing module 720 may perform steps S320, S330 in the method of fig. 3, steps S501, S505, S514 in the method of fig. 5.
According to the method provided by the embodiment of the application, the embodiment of the application also provides a storage device. The storage device includes: a processor for coupling with the memory, reading and executing instructions and/or program code in the memory to perform the steps performed by the target storage device or the source storage device in the embodiments described above.
According to the method provided by the embodiment of the application, the embodiment of the application also provides a chip system. The system-on-chip includes logic circuitry for coupling with an input/output interface through which data is transferred to perform the steps performed by the target storage device or the source storage device in the above-described embodiments.
According to the method provided by the embodiment of the application, the application further provides a program product, which comprises: program code which, when run on a storage device, causes the storage device to perform the steps performed by the target storage device or the source storage device in the above embodiments.
According to the method provided by the embodiment of the present application, the present application further provides a storage medium storing program code, where the program code when executed on a storage device causes the storage device to execute the steps executed by the target storage device or the source storage device in the above embodiment.
According to the method provided by the embodiment of the application, the embodiment of the application also provides a migration system, which comprises the target storage device and the source storage device in the embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, and are not repeated herein.
In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the apparatus embodiments described above are merely illustrative, e.g., the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, e.g., multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of 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.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, comprising several instructions for causing a computer device (which may be a personal computer, a server, a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (30)

1. A method of migrating a file system, comprising:
The method comprises the steps that a target storage device sends first request information and second request information to a source storage device, wherein the first request information is information coded according to a first sharing protocol, the first request information is used for acquiring first data in the source storage device, the second request information is information coded according to a second sharing protocol, the second request information is used for acquiring second data in the source storage device, the first sharing protocol and the second sharing protocol are different protocols in a plurality of sharing protocols, and any sharing protocol in the plurality of sharing protocols is used for accessing the data in the source storage device;
The target storage device receives first response information and second response information from the source storage device, wherein the first response information is information coded according to the first sharing protocol, the first response information comprises the first data, the second response information is information coded according to the second sharing protocol, and the second response information comprises the second data;
The target storage device decodes the first response information according to the first sharing protocol to obtain and store the first data;
and the target storage equipment decodes the second response information according to the second sharing protocol to obtain and store the second data.
2. The method of claim 1, wherein the plurality of shared protocols comprises a plurality of network system file protocols NFS, service information block protocols SMB, or simple store service protocols S3.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
The target storage device determines a plurality of migration tasks according to the structure information of the source file system in the source storage device, wherein each migration task in the plurality of migration tasks is used for migrating part of files in the source file system to the target storage device;
The target storage device determines the first request information according to a first migration task, wherein the first migration task is any one of the migration tasks, and the first migration task is used for migrating the first data to the target storage device;
And the target storage device determines the second request information according to a second migration task, wherein the second migration task is a different task from the first migration task in the plurality of migration tasks, and the second migration task is used for migrating the second data to the target storage device.
4. A method according to any one of claims 1 to 3, further comprising:
The target storage device receives third request information from the computing device, wherein the third request information is request information coded according to a third sharing protocol, the third request information is used for acquiring or updating third data, the third data belongs to the target storage device and/or the source storage device, and the third sharing protocol is any one protocol of the plurality of sharing protocols;
And the target storage device sends third response information to the computing device according to the third request information, wherein the third response information is the request information coded according to the third sharing protocol, and the third response information comprises the third data or the update information of the third data.
5. The method of claim 4, wherein in the case where the third request information is used to update the third data, the method further comprises:
The target storage device decodes the third request information according to the third sharing protocol, and determines the decoded third request information;
in the case that the third data exists in the target storage device, the target storage device updates the third data according to the decoded third request information;
In the case that the third data is not present in the target storage device, the target storage device sets the priority of a third migration task to be high, and the third migration task is used for migrating the third data to the target storage device.
6. The method of claim 5, wherein the method further comprises:
the target storage device records the decoded third request information;
And after the target storage device completes the third migration task, updating the third data in the target storage device according to the recorded decoded third request information.
7. The method of any of claims 4 to 6, wherein the target storage device sending third response information to the computing device in accordance with the third request information, comprising:
The target storage device sends the third request information to the source storage device;
The target storage device receives fourth response information from the source storage device, wherein the fourth response information is response information coded according to the third sharing protocol, and the fourth response information comprises the third data or update information of the third data in the source storage device;
The target storage device decodes the fourth response information according to the third sharing protocol, and determines decoded fourth response information;
And the target storage device sends the third response information to the computing device according to the decoded fourth response information.
8. The method according to any one of claims 1 to 7, further comprising:
And the target storage device determines the authority information of a target file system in the target storage device according to the authority information of the source file system in the source storage device, wherein the authority information of the target file system is the same as the authority information in the source file system.
9. A method of migrating a file system, comprising:
The method comprises the steps that a source storage device receives first request information and second request information from a target storage device, wherein the first request information is information coded according to a first sharing protocol, the first request information is used for acquiring first data in the source storage device, the second request information is information coded according to a second sharing protocol, the second request information is used for acquiring second data in the source storage device, the first sharing protocol and the second sharing protocol are different protocols in a plurality of sharing protocols, and any sharing protocol in the plurality of sharing protocols is used for accessing the data in the source storage device;
The source storage device determines first response information according to the first request information, wherein the first response information is information coded according to the first sharing protocol, and the first response information comprises the first data;
The source storage device determines second response information according to the second request information, wherein the second response information is information coded according to the second sharing protocol, and the second response information comprises the second data;
The source storage device sends the first response information and the second response information to the target storage device.
10. The method of claim 9, wherein the plurality of shared protocols comprises a plurality of network system file protocols NFS, service information block protocols SMB, or simple store service protocols S3.
11. The method of claim 9 or 10, wherein the source storage device determining first response information from the first request information comprises:
the source storage device decodes the first request information according to the first sharing protocol, and determines decoded first request information, wherein the decoded first request information is used for acquiring the first data;
The source storage device determines first data according to the decoded first request information;
The source storage device encodes the first data according to the first sharing protocol, and determines the first response information.
12. The method according to any one of claims 9 to 11, further comprising:
the source storage device receives third request information from the target storage device, wherein the third request information is request information coded according to a third sharing protocol, the third request information is used for acquiring or updating third data, the third data belongs to the source storage device, and the third sharing protocol is any one protocol of the plurality of sharing protocols;
the source storage device determines the third data or update information of the third data according to the third request information;
The source storage device encodes the third data or the update information of the third data according to the third sharing protocol, and determines fourth response information, wherein the fourth response information comprises the third data or the update information of the third data;
The source storage device sends the fourth response information to the target storage device.
13. The method according to any one of claims 9 to 12, further comprising:
The source storage device sends configuration information to the target storage device, wherein the configuration information is configuration information of a source file system in the source storage device, and the configuration information comprises structure information and/or authority information of the source file system.
14. A memory device, comprising:
The system comprises a receiving and transmitting module, a source storage device and a source storage device, wherein the receiving and transmitting module is used for transmitting first request information and second request information to the source storage device, the first request information is information coded according to a first sharing protocol, the first request information is used for acquiring first data in the source storage device, the second request information is information coded according to a second sharing protocol, the second request information is used for acquiring second data in the source storage device, the first sharing protocol and the second sharing protocol are different protocols in a plurality of sharing protocols, and any sharing protocol in the plurality of sharing protocols is used for accessing the data in the source storage device;
The transceiver module is further configured to receive first response information and second response information from the source storage device, where the first response information is information encoded according to the first sharing protocol, the first response information includes the first data, 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 is further used for decoding the first response information according to the first sharing protocol to obtain and store the first data, wherein the first response information comprises the first data;
The processing module is further configured to decode the second response information according to the second sharing protocol, to obtain and store the second data, where the second response information includes the second data.
15. The apparatus of claim 14, wherein the plurality of shared protocols comprises a plurality of network system file protocols NFS, service information block protocols SMB, or simple store service protocols S3.
16. The apparatus of claim 14 or 15, wherein the processing module is further configured to:
Determining a plurality of migration tasks according to the structure information of the source file system in the source storage device, wherein each migration task in the plurality of migration tasks is used for migrating part of files in the source file system to the storage device;
determining the first request information according to a first migration task, wherein the first migration task is any one of the migration tasks, and the first migration task is used for migrating the first data to the storage device;
And determining the second request information according to a second migration task, wherein the second migration task is a different task from the first migration task in the plurality of migration tasks, and the second migration task is used for migrating the second data into the storage device.
17. The apparatus of any one of claims 14 to 16, wherein the transceiver module is further configured to:
Receiving third request information from a computing device, wherein the third request information is request information coded according to a third sharing protocol, the third request information is used for acquiring or updating third data, the third data belongs to the storage device and/or the source storage device, and the third sharing protocol is any one protocol of the plurality of sharing protocols;
And sending third response information to the computing equipment according to the third request information, wherein the third response information is request information coded according to the third sharing protocol, and the third response information comprises the third data or update information of the third data.
18. The apparatus of claim 17, wherein, in the case where the third request information is used to update the third data, the processing module is further configured to:
Decoding the third request information according to the third sharing protocol, and determining the decoded third request information;
updating the third data according to the decoded third request information when the third data exists in the storage device;
And setting the priority of a third migration task to be high when the third data is not present in the storage device, wherein the third migration task is used for migrating the third data to the storage device.
19. The apparatus of claim 18, wherein the processing module is further configured to:
Recording the decoded third request information;
And after the third migration task is completed, updating the third data in the storage device according to the recorded decoded third request information.
20. The apparatus according to any one of claims 14 to 19, wherein the transceiver module is specifically configured to send the third request information to the source storage device;
The transceiver module is further configured to receive fourth response information from the source storage device, where the fourth response information is response information encoded according to the third shared protocol, and the fourth response information includes the third data or update information of the third data in the source storage device;
the processing module is specifically configured to decode the fourth response information according to the third sharing protocol, and determine decoded fourth response information;
the transceiver module is further configured to send the third response information to the computing device according to the decoded fourth response information.
21. The apparatus of any one of claims 14 to 20, wherein the processing module is further configured to determine rights information for a target file system in the storage device based on rights information for a source file system in the source storage device, the rights information for the target file system being the same as the rights information in the source file system.
22. A memory device, comprising:
The receiving and transmitting module is used for receiving first request information and second request information from the target storage device, wherein the first request information is information coded according to a first sharing protocol, the first request information is used for acquiring first data in the storage device, the second request information is information coded according to a second sharing protocol, the second request information is used for acquiring second data in the storage device, the first sharing protocol and the second sharing protocol are different protocols in a plurality of sharing protocols, and any sharing protocol in the plurality of sharing protocols is used for accessing the data in the source storage device;
the processing module is used for determining first response information according to the first request information, wherein the first response information is information coded according to the first sharing protocol, and the first response information comprises the first data;
The processing module is further configured to determine second response information according to the second request information, where the second response information is information encoded according to the second sharing protocol, and the second response information includes the second data;
the receiving and transmitting module is further configured to send the first response information and the second response information to the target storage device.
23. The apparatus of claim 22, wherein the plurality of shared protocols comprises a plurality of network system file protocols NFS, service information block protocols SMB, or simple store service protocols S3.
24. The apparatus according to claim 22 or 23, wherein the processing module is specifically configured to:
Decoding the first request information according to the first sharing protocol, and determining decoded first request information, wherein the decoded first request information is used for acquiring the first data;
determining first data according to the decoded first request information;
and encoding the first data according to the first sharing protocol, and determining the first response information.
25. The apparatus according to any one of claims 22 to 24, wherein the transceiver module is further configured to receive third request information from the target storage device, the third request information being request information encoded according to a third shared protocol, the third request information being used to obtain or update third data, the third data belonging to the storage device, the third shared protocol being any one of the plurality of shared protocols;
The processing module is further configured to determine the third data or update information of the third data according to the third request information;
The processing module is further configured to encode the third data or update information of the third data according to the third sharing protocol, and determine fourth response information, where the fourth response information includes the third data or the update information of the third data;
the transceiver module is further configured to send the fourth response information to the target storage device.
26. The apparatus according to any one of claims 22 to 25, wherein the transceiver module is further configured to send configuration information to the target storage device, the configuration information being configuration information of a source file system in the storage device, the configuration information including configuration information and/or rights information of the source file system.
27. A memory device, comprising: a processor for coupling with a memory, reading and executing instructions and/or program code in the memory to perform the method of any of claims 1 to 8 or any of claims 9 to 13.
28. A chip system, comprising: logic circuitry for coupling with an input/output interface through which data is transmitted to perform the method of any one of claims 1 to 8 or any one of claims 9 to 13.
29. A storage medium storing program code which, when run on a storage device, causes the storage device to perform the method of any one of claims 1 to 8 or 9 to 13.
30. A migration system comprising a storage apparatus according to any one of claims 14 to 21 and a storage apparatus according to any one of claims 22 to 26.
CN202211273874.5A 2022-10-18 2022-10-18 Method for migrating file system and related equipment Pending CN117951080A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202211273874.5A CN117951080A (en) 2022-10-18 2022-10-18 Method for migrating file system and related equipment
PCT/CN2023/110766 WO2024082773A1 (en) 2022-10-18 2023-08-02 Method for migrating file system, and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211273874.5A CN117951080A (en) 2022-10-18 2022-10-18 Method for migrating file system and related equipment

Publications (1)

Publication Number Publication Date
CN117951080A true CN117951080A (en) 2024-04-30

Family

ID=90736935

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211273874.5A Pending CN117951080A (en) 2022-10-18 2022-10-18 Method for migrating file system and related equipment

Country Status (2)

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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4349871B2 (en) * 2003-09-09 2009-10-21 株式会社日立製作所 File sharing apparatus and data migration method between file sharing apparatuses
CN102611745B (en) * 2011-12-31 2015-02-25 华为数字技术(成都)有限公司 On-line file moving method, device and system
CN106649600B (en) * 2016-11-25 2019-07-09 华为技术有限公司 A kind of method, apparatus and system of migrated file permission
CN110086836B (en) * 2018-01-25 2020-12-15 华为技术有限公司 Method and device for acquiring metadata

Also Published As

Publication number Publication date
WO2024082773A1 (en) 2024-04-25

Similar Documents

Publication Publication Date Title
US9087021B2 (en) Peer-to-peer transcendent memory
JP4696089B2 (en) Distributed storage system
JP2019220230A (en) Data processing method and data processing device
WO2018068626A1 (en) Method, device, and system for managing disk lock
CN105340240A (en) Methods and systems for shared file storage
WO2015196815A1 (en) Ip hard disk and storage system, and data operating method therefor
US10552089B2 (en) Data processing for managing local and distributed storage systems by scheduling information corresponding to data write requests
CN111209090B (en) Method and assembly for creating virtual machine in cloud platform and server
US20230152978A1 (en) Data Access Method and Related Device
JP2007094755A (en) Remote copy control in storage system
CN112579311A (en) Method for accessing solid state disk and storage device
CN112616024A (en) USB camera data acquisition method and device, electronic equipment and storage medium
CN113961139A (en) Method for processing data by using intermediate device, computer system and intermediate device
US20150074316A1 (en) Reflective memory bridge for external computing nodes
US10437849B2 (en) Method and apparatus for implementing storage of file in IP disk
CN104516687A (en) Windows remote mapping method for Linux block device
CN117951080A (en) Method for migrating file system and related equipment
CN109308288B (en) Data processing method and device
WO2018032499A1 (en) Load balancing method and associated device
EP4261671A1 (en) Data access method and related device
KR20120073799A (en) Data synchronizing and servicing apparatus and method based on cloud storage
CN114615263A (en) Cluster online migration method, device, equipment and storage medium
CN109558205B (en) Disk access method and device
CN110098945B (en) Data processing method and device applied to node system
US20200333979A1 (en) Identifying and processing predefined dispersed storage network workflows

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination