WO2022012044A1 - 精简置备文件拷贝方法、装置、设备及可读存储介质 - Google Patents
精简置备文件拷贝方法、装置、设备及可读存储介质 Download PDFInfo
- Publication number
- WO2022012044A1 WO2022012044A1 PCT/CN2021/076953 CN2021076953W WO2022012044A1 WO 2022012044 A1 WO2022012044 A1 WO 2022012044A1 CN 2021076953 W CN2021076953 W CN 2021076953W WO 2022012044 A1 WO2022012044 A1 WO 2022012044A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- target
- source host
- host
- target file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/065—Replication mechanisms
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0604—Improving or facilitating administration, e.g. storage management
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0638—Organizing or formatting or addressing of data
- G06F3/0643—Management of files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0664—Virtualisation aspects at device level, e.g. emulation of a storage device or system
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0662—Virtualisation aspects
- G06F3/0665—Virtualisation aspects at area level, e.g. provisioning of virtual or logical volumes
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/067—Distributed or networked storage systems, e.g. storage area networks [SAN], network attached storage [NAS]
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0674—Disk device
- G06F3/0676—Magnetic disk device
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
Definitions
- the present application relates to the field of computer technologies, and in particular, to a method, apparatus, device, and readable storage medium for copying thin provisioning files.
- the basic principle of thin provisioning is "allocate on write", that is, the space seen by upper-layer applications and users is only virtual storage space, which does not occupy physical disk space, only when data is written. Allocate physical disk space, so thin provisioning technology can improve the utilization and flexibility of physical storage devices, provide larger storage space at a lower cost, and realize the function of "super-divided" storage.
- thin provisioning is configured for hosts and files. For example, if thin provisioning is configured on host A, but not on host B, after copying the file stored in thin provisioning on host A to host B, the file will be stored on host B in the normal way, that is, the After the files stored in thin provisioning mode are copied across hosts, they become thick provisioned files, so the files on host B lose the advantages of thin provisioning.
- the purpose of the present application is to provide a thin-provisioned file copying method, apparatus, device, and readable storage medium, so as to retain the advantages of the thin-provisioned file after the thin-provisioned file is copied across hosts. Its specific plan is as follows:
- the present application provides a thin provisioning file copy method, applied to a destination host, including:
- the target file is a thin provisioning file, creating a virtual storage area with the same size as the target file and not occupying disk space according to the file information;
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain various data included in the target file The disk location where the segment is stored, and a copy notification message of the target file is sent to the destination host.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, to obtain Obtain the disk location where each data segment included in the target file is stored.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain various data included in the target file The disk location where the segment is stored, and waits for the copy request.
- the method further includes:
- the judging whether the target file is consistent with the target file includes:
- Calculate the destination MD5 value of the destination file obtain the source MD5 value of the destination file from the file information, and determine whether the destination MD5 value and the source MD5 value are consistent.
- the types of file systems deployed by the source host and the destination host are different.
- the present application provides a thin provisioning file copy device, applied to a destination host, including:
- a sending module configured to send a copy request of the target file to the source host, and receive the file information of the target file returned by the source host;
- a creating module configured to create a virtual storage area with the same size as the target file and not occupying disk space according to the file information if the target file is a thin provisioning file;
- the copying module is configured to send the acquisition request of the target data segment to the source host one by one according to the file information, receive the target data segment returned by the source host, and store the target data segment in a thin provisioning manner to the source host.
- the disk address corresponding to the virtual storage area is used to copy the target file from the source host to the destination host; the target data segment is any one of all data segments included in the target file.
- the present application provides a thin provisioning file copy device, including:
- the processor is configured to execute the computer program to implement the thin provisioning file copy method disclosed above.
- the present application provides a readable storage medium for storing a computer program, wherein when the computer program is executed by a processor, the aforementioned method for copying a thin provisioning file is implemented.
- the present application provides a method for copying a thin provisioning file, which is applied to a target host, including: sending a copy request of a target file to a source host, and receiving the file information of the target file returned by the source host; If the target file is a thin provisioning file, create a virtual storage area that is the same size as the target file and does not occupy disk space according to the file information; The source host receives the target data segment returned by the source host, and stores the target data segment in a thin provisioning manner to a disk address corresponding to the virtual storage area, so as to transfer the target file from the source host. The host is copied to the target host; the target data segment is any one of all data segments included in the target file.
- the destination host will create a virtual storage area that is the same size as the thin provisioning file and does not occupy disk space, which is used for subsequent data storage. Prepare.
- the corresponding disk address is allocated for the data to be placed on the disk, so that after the thin provisioning file is copied from the source host to the destination host, it is still a thin provisioning file in the destination host.
- the advantages of thin provisioning are retained and the physical storage space of the destination host is saved.
- the present application only transmits valid data in the target file (that is, all data segments included in the target file) to the target host, which can also reduce the data amount of the transmitted file, improve the transmission speed of the file, and thus improve the copy efficiency.
- the thin provisioning file copying apparatus, device and readable storage medium provided by the present application also have the above technical effects.
- FIG. 1 is a flowchart of a method for copying a thin provisioning file disclosed in the present application
- FIG. 2 is a flowchart of another method for copying thin provisioning files disclosed in this application.
- FIG. 3 is a schematic diagram of a thin provisioning file copy device disclosed in the present application.
- FIG. 4 is a schematic diagram of a thin provisioning file copy device disclosed in the present application.
- the present application provides a thin-provisioning file copy solution, which enables thin-provisioning files to be copied across hosts, while retaining the advantages of thin-provisioning and saving the physical storage space of the destination host.
- an embodiment of the present application discloses a thin provisioning file copy method, which is applied to a destination host, including:
- S101 Send a copy request of a target file to a source host, and receive file information of the target file returned by the source host.
- the types of file systems deployed by the source host and the destination host are different.
- the types of file systems deployed on the source host and the destination host can also be the same. If the types of file systems deployed by the source host and the destination host are different, this embodiment can implement copying of thin provisioning files across hosts and file systems. If the file systems deployed by the source host and the destination host are of the same type, this embodiment can implement the copying of thin provisioning files across hosts.
- the types of file systems are: ext3/4 (Third/Forth extended file system, the third/fourth generation extended file system), XFS (a high-performance 64-bit journaling file system developed by Silicon Graphics in 1993), btrfs (b -tree file system, a file system developed by Oracle based on the copy-on-write principle), OCFs2 (Oracle Cluster File system version 2, Oracle Cluster File System version 2).
- ext3/4 Third/Forth extended file system, the third/fourth generation extended file system
- XFS high-performance 64-bit journaling file system developed by Silicon Graphics in 1993
- btrfs b -tree file system, a file system developed by Oracle based on the copy-on-write principle
- OCFs2 Oracle Cluster File system version 2, Oracle Cluster File System version 2
- the source host and the destination host communicate through sockets.
- thin provisioning is supported for all types of file systems.
- the source host reply can also be: the user first triggers the source host to perform the preparation work required for copying the target file on the source host, and then triggers the destination host to send a copy request of the target file to the source host on the destination host.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain the data stored in each data segment included in the target file. and send a copy notification message of the target file to the destination host, so that the destination host sends a copy request of the target file to the source host.
- This method is: the user triggers the copy operation on the source host, so that the source host knows which file is currently being copied, and then performs the corresponding preparations (that is, according to the type of the file system deployed by the source host to analyze the current file to be copied.
- the source host After the source host receives the copy request, it does not need to perform the corresponding preparations, and can directly return the file information to destination host.
- the source host only sends the copy notification message of the target file to the destination host under the user's operation, and does not perform the corresponding preparation work for the time being, and the destination host sends the copy request of the target file to the source host after receiving the copy notification message.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host to obtain the disk location stored by each data segment included in the target file, and returns the file information to the target host.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain various data included in the target file The disk location where the segment is stored.
- This method is: the user triggers the copy operation on the destination host, so that the destination host knows which file is currently being copied, and then the destination host sends a copy request of the file to be copied to the source host, so that the source host executes the corresponding file based on the file. , and then returns the file information.
- the file information includes: the size of the target file, the identification information (eg: MD5 value) of the target file, the number of data segments included in the target file, and the offset address and length of each data segment.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain the data stored in each data segment included in the target file. the disk location and wait for a copy request.
- This method is as follows: the user first triggers the source host to perform the preparation work required for copying the target file on the source host, and then triggers the destination host to send a copy request of the target file to the source host on the destination host.
- the target file is a thin provisioning file, create a virtual storage area with the same size as the target file and not occupying disk space according to the file information.
- a file stored in a thin provisioning manner is referred to as a thin provisioning file (eg QCOW2)
- a file stored in a thick provisioning manner is referred to as a thick provisioning file.
- Thick provisioning means that when a virtual space is created, the corresponding physical storage space is directly allocated, and there is no need to allocate physical storage space when there is an I/O operation.
- QCOW2 (QEMU Copy On Write version 2, QEMU copy-on-write file format version 2) is an image file format supported by QEMU (Quick Emulator, an open source hypervisor capable of hardware virtualization). Its main feature is to support The thin provisioning function of disk image files can be considered as an image file format specially developed by QEMU to support the thin provisioning function of files.
- the file information may further include a flag bit of whether the target file is a thin provisioning file, so that the destination host can know whether the target file is a thin provisioning file, and then execute corresponding steps. If the target file is not a thin-provisioned file, the target host creates a virtual storage area that is the same size as the target file and occupies disk space according to the file information to store the target file in thick-provisioning mode.
- the thick provisioning methods include: thick provisioning delayed zeroing and thick provisioning zeroing.
- Thick provisioning delayed zeroing means that when creating a virtual disk, space is allocated directly from the physical disk, but the data reserved on the physical disk is not zeroed; when there is an I/O operation, the data needs to be zeroed before writing data.
- Thick provisioning zeroing means: when creating a virtual space, directly allocate the corresponding physical storage space, and perform zeroing operation on the data reserved in the physical disk. When there is an I/O operation, there is no need to do zeroing operation, and it can be written directly. data.
- S103 Send the acquisition request of the target data segment to the source host one by one according to the file information, receive the target data segment returned by the source host, and store the target data segment to the disk address corresponding to the virtual storage area in a thin provisioning manner, so as to transfer the target file from the source host to the corresponding disk address.
- the host is copied to the destination host; the target data segment is any one of all the data segments included in the target file.
- the destination host sends the acquisition request of each data segment one by one according to the offset address and length of each data segment in the file information, and in accordance with the order of each data segment in the target file, so that the source host returns each data segment one by one. part.
- the destination host receives a data segment, it stores the current data segment to the disk address corresponding to the virtual storage area in a thin provisioning manner, and so on and so forth, until all data segments included in the target file fall into the disk of the destination host.
- the method further includes: combining all data segments of the target file stored by the target host into the target file, and judging whether the target file and the target file are consistent; , then send a notification message that the target file is copied successfully to the source host.
- judging whether the destination file and the destination file are consistent includes: calculating the destination MD5 value of the destination file, obtaining the source MD5 value of the destination file from the file information, and judging whether the destination MD5 value and the source MD5 value are consistent. If the destination file is inconsistent with the destination file, a notification message of the failure of copying the destination file will be sent to the source host, and an error will be reported. After that, the technician can choose whether to re-copy the target file from the source host to the destination host according to the error message.
- this embodiment only transmits valid data in the target file (that is, all data segments included in the target file) to the destination host, and can also reduce the data amount of the transmitted file, improve the transmission speed of the file, and thereby improve the copy efficiency.
- the destination host will create a virtual storage area that is the same size as the thin provisioning file and does not occupy disk space, which is the storage area for subsequent data. Prepare for storage.
- the corresponding disk address is allocated for the data to be placed on the disk, so that after the thin provisioning file is copied from the source host to the destination host, it is still a thin provisioning file in the destination host.
- the embodiment of the present application discloses another method for copying a simplified provisioning file.
- the triggering method for executing the method is as follows: a user first triggers the source host to perform the preparation work required for copying the target file on the source host, and then triggers the destination host to send the target file on the destination host. A copy of the file is requested to the source host. Specifically, the user triggers the operation of the file transfer service in the source host based on the human-computer interaction interface of the source host, and specifies the target file to be copied, so as to use the file transfer service to parse the metadata of the target file to obtain various data included in the target file.
- the disk location where the segment is stored (that is, the distribution of data on the disk); then, the user specifies the target file to be copied based on the human-computer interaction interface of the destination host, and triggers the destination host to send a copy request of the target file to the source host for execution. subsequent process.
- the file transfer service can be extended to make it compatible with many types of file systems.
- file transfer service ie server service running on the source host is specifically used for:
- Gets the name of the thin provisioned file entered by the user Determine the type of the file system of the source host, and parse the metadata of the thin provisioning file according to the type of the file system of the source host, so as to obtain the distribution of the valid data of the thin provisioning file on the disk. After determining the file information of the thin provisioning file based on the file name, wait for the copy request from the destination host.
- the destination host uses the client process running on it to obtain the name of the thin provisioning file entered by the user.
- the corresponding physical address of the virtual file is queried, and each data segment is placed on the disk one by one in a thin-provisioning manner, until all the data segments included in the thin-provisioning file fall into the disk of the destination host.
- the data segment acquisition request sent by the destination host includes the offset address and length of the data segment; the data returned by the source host includes the offset address and length of the data segment and the data segment itself.
- the destination host calculates the MD5 value of the thin provisioning file that falls into the disk of the destination host. If the MD5 value is the same as the MD5 value in the file information, it means that the copy is successful . At this point, the socket connection between the destination host and the source host can be disconnected, and the file transfer service and client process can be closed. Otherwise, fail with an error.
- This embodiment implements a server service at the source end of the file, and the server can parse the metadata of the thin provisioning file according to the type of the file system of the source end, obtain the actual data distribution of the thin provisioning file, and then start to wait for the client request.
- Start a client process at the destination end use the client to send a copy request to the source end, and after getting a response, create a virtual file with the same size as the thin provisioning file but with 0 disk space; then the destination end requests the data segment from the source end, After receiving the reply, perform the disk placement operation of the data segment in thin provisioning mode.
- the destination end judges whether the placed file is correct based on the MD5 value of the file. It can be seen that this solution does not depend on the types of the file systems of the source and destination, and supports the copying of thin provisioning files across file systems and hosts.
- This embodiment adopts the C/S structure (client-server mode), which has good scalability. It only needs to write corresponding metadata parsing logic for different types of file systems to achieve expansion; and because the data transmission format does not depend on For specific file systems, it can also support thin-provisioning copy across file systems, which further improves the application scope of the thin-provisioning feature and solves the problem of cross-host migration and backup of thin-provisioned image files in virtualization scenarios.
- the following describes an apparatus for copying a thin provisioning file provided by an embodiment of the present application.
- the apparatus for copying a thin provisioning file described below and a method for copying a thin provisioning file described above may refer to each other.
- an embodiment of the present application discloses a thin provisioning file copy device, which is applied to a destination host, including:
- the sending module 301 is used for sending the copy request of the target file to the source host, and receiving the file information of the target file returned by the source host;
- the creating module 302 is configured to, if the target file is a thin provisioning file, create a virtual storage area that is the same size as the target file and does not occupy disk space according to the file information;
- the copying module 303 is configured to send the acquisition request of the target data segment to the source host one by one according to the file information, receive the target data segment returned by the source host, and store the target data segment to the disk address corresponding to the virtual storage area in a thin provisioning manner, so as to copy the target data segment to the corresponding disk address of the virtual storage area.
- the target file is copied from the source host to the target host; the target data segment is any one of all the data segments included in the target file.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain the data stored in each data segment included in the target file. , and send a copy notification message of the target file to the destination host.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain various data included in the target file The disk location where the segment is stored.
- the source host parses the metadata of the target file according to the type of the file system deployed by the source host, so as to obtain the data stored in each data segment included in the target file. the disk location and wait for a copy request.
- it also includes:
- the judgment module is used to combine all the data segments of the target file stored by the destination host into the destination file, and determine whether the destination file and the destination file are consistent;
- the notification module is used for sending a notification message that the target file is copied successfully to the source host if the target file is consistent with the target file.
- the judgment module is specifically used for:
- Calculate the destination MD5 value of the destination file obtain the source MD5 value of the destination file from the file information, and determine whether the destination MD5 value and the source MD5 value are consistent.
- it also includes:
- the notification module is specifically used for: if the target file and the target file are inconsistent, send a notification message of the target file copy failure to the source host.
- the types of file systems deployed by the source host and the destination host are different.
- this embodiment provides an apparatus for copying a thin provisioning file.
- the target host In the process of copying a thin provisioning file from a source host to a destination host, the target host will create a thin provisioning file that is the same size as the thin provisioning file and does not occupy A virtual storage area of disk space in preparation for subsequent data storage.
- the corresponding disk address is allocated for the data to be placed on the disk, so that after the thin provisioning file is copied from the source host to the destination host, it is still a thin provisioning file in the destination host.
- the advantages of thin provisioning are retained and the physical storage space of the destination host is saved.
- the following describes a thin-provisioned file copying device provided by an embodiment of the present application.
- the thin-provisioning file copying device described below and the thin-provisioning file copying method and apparatus described above can be referred to each other.
- an embodiment of the present application discloses a thin provisioning file copy device, including:
- the memory 401 is used to save the computer program
- the processor 402 is configured to execute the computer program to implement the method disclosed in any of the foregoing embodiments.
- the following describes a readable storage medium provided by an embodiment of the present application.
- the readable storage medium described below and the method, apparatus, and device for copying a thin provisioning file described above may refer to each other.
- a readable storage medium for storing a computer program wherein when the computer program is executed by a processor, the method for copying a thin provisioning file disclosed in the foregoing embodiments is implemented.
- the specific steps of the method reference may be made to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.
- references in this application to "first”, “second”, “third”, “fourth”, etc. are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It is to be understood that data so used can be interchanged under appropriate circumstances so that the embodiments described herein can be practiced in sequences other than those illustrated or described herein.
- the terms “comprising” and “having”, and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method or apparatus comprising a series of steps or elements is not necessarily limited to those steps or elements expressly listed , but may include other steps or elements not expressly listed or inherent to these processes, methods or apparatus.
- the steps of a method or algorithm described in connection with the embodiments disclosed herein may be directly implemented in hardware, a software module executed by a processor, or a combination of the two.
- the software module can be placed in random access memory (RAM), internal memory, read only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other in the technical field. in any other form of readable storage medium that is well known.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种精简置备文件拷贝方法、装置、设备及可读存储介质。该方法包括:目的主机发送目标文件的拷贝请求至源主机,接收源主机返回的目标文件的文件信息(S101);若目标文件为精简置备文件,则按照文件信息创建与目标文件的大小相同,且不占用磁盘空间的虚拟存储区域(S102);按照文件信息逐一发送目标数据段的获取请求至源主机,接收源主机返回的目标数据段,并以精简置备方式存储目标数据段至虚拟存储区域对应的磁盘地址,以将目标文件从源主机拷贝至目的主机;目标数据段为目标文件包括的所有数据段中的任一个(S103)。该方法使精简置备文件跨主机拷贝后,保留了精简置备的优势。
Description
本申请要求于2020年07月17日提交至中国专利局、申请号为202010692366.5、发明名称为“精简置备文件拷贝方法、装置、设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及计算机技术领域,特别涉及一种精简置备文件拷贝方法、装置、设备及可读存储介质。
精简置备(Thin Provision)的基本原理是“写时分配”,即:上层应用以及用户看到的空间只是虚拟存储空间,该虚拟存储空间并不占用物理磁盘空间,只有在数据写入时才会进行物理磁盘空间的分配,因此精简置备技术可以提高物理存储设备的利用率和灵活性,能够以较低的成本提供更大存储空间,实现了存储的“超分”功能。
但是,精简置备是针对主机和文件配置的。例如:主机A配置了精简置备,但主机B未配置,那么在将主机A中以精简置备方式存储的文件拷贝至主机B后,该文件会以正常方式存储在主机B中,也就是本来以精简置备方式存储的文件跨主机拷贝后,变成了厚置备文件,这样文件在主机B中就失去了精简置备的优势。
因此,在精简置备文件跨主机拷贝后,如何保留精简置备文件的优势,是本领域技术人员需要解决的问题。
发明内容
有鉴于此,本申请的目的在于提供一种精简置备文件拷贝方法、装置、设备及可读存储介质,以在精简置备文件跨主机拷贝后,保留精简置备文件的优势。其具体方案如下:
第一方面,本申请提供了一种精简置备文件拷贝方法,应用于目的主机,包括:
发送目标文件的拷贝请求至源主机,并接收所述源主机返回的所述目标文件的文件信息;
若所述目标文件为精简置备文件,则按照所述文件信息创建与所述目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;
按照所述文件信息逐一发送目标数据段的获取请求至所述源主机,接收所述源主机返回的所述目标数据段,并以精简置备方式存储所述目标数据段至所述虚拟存储区域对应的磁盘地址,以将所述目标文件从所述源主机拷贝至所述目的主机;所述目标数据段为所述目标文件包括的所有数据段中的任一个。
优选地,所述发送目标文件的拷贝请求至源主机之前,所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置,并发送所述目标文件的拷贝通知消息至所述目的主机。
优选地,所述源主机返回所述文件信息之前,若所述目标文件为精简置备文件,则所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置。
优选地,所述发送目标文件的拷贝请求至源主机之前,所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置,并等待所述拷贝请求。
优选地,所述将所述目标文件从所述源主机拷贝至所述目的主机之后,还包括:
将所述目的主机存储的所述目标文件的所有数据段组合为目的文件,并判断所述目的文件和所述目标文件是否一致;
若是,则发送所述目标文件拷贝成功的通知消息至所述源主机;
若否,则发送所述目标文件拷贝失败的通知消息至所述源主机。
优选地,所述判断所述目的文件和所述目标文件是否一致,包括:
计算所述目的文件的目的MD5值,并从所述文件信息中获取所述目标文件的源MD5值,判断所述目的MD5值和所述源MD5值是否一致。
优选地,所述源主机和所述目的主机部署的文件系统的类型不同。
第二方面,本申请提供了一种精简置备文件拷贝装置,应用于目的主机,包括:
发送模块,用于发送目标文件的拷贝请求至源主机,并接收所述源主机返回的所述目标文件的文件信息;
创建模块,用于若所述目标文件为精简置备文件,则按照所述文件信息创建与所述目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;
拷贝模块,用于按照所述文件信息逐一发送目标数据段的获取请求至所述源主机,接收所述源主机返回的所述目标数据段,并以精简置备方式存储所述目标数据段至所述虚拟存储区域对应的磁盘地址,以将所述目标文件从所述源主机拷贝至所述目的主机;所述目标数据段为所述目标文件包括的所有数据段中的任一个。
第三方面,本申请提供了一种精简置备文件拷贝设备,包括:
存储器,用于存储计算机程序;
处理器,用于执行所述计算机程序,以实现前述公开的精简置备文件拷贝方法。
第四方面,本申请提供了一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述公开的精简置备文件拷贝方法。
通过以上方案可知,本申请提供了一种精简置备文件拷贝方法,应用于目的主机,包括:发送目标文件的拷贝请求至源主机,并接收所述源主机返回的所述目标文件的文件信息;若所述目标文件为精简置备文件,则按照所述文件信息创建与所述目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;按照所述文件信息逐一发送目标数据段的获取请求至所述源主机,接收所述源主机返回的所述目标数据段,并以精简置备方式存储所述目标数据段至所述虚拟存储区域对应的磁盘地址,以将所述目标文件从所述源主机拷贝至所述目的主机;所述目标数据段为所述目标文件包括的所有数据段中的任一个。
可见,本申请在将精简置备文件从源主机拷贝至目的主机的过程中,目的主机会创建与所述精简置备文件的大小相同,且不占用磁盘空间的虚拟存储区域,为后续数据的存储做准备。在精简置备文件包括的数据真正 需要写入时,才分配相应的磁盘地址供数据落盘,使得精简置备文件从源主机拷贝至目的主机后,其在目的主机中仍然是精简置备文件,从而使精简置备文件跨主机拷贝后,保留了其精简置备的优势,也节约了目的主机的物理存储空间。同时,本申请仅传输目标文件中的有效数据(即目标文件包括的所有数据段)至目的主机,还可以降低传输文件的数据量,提高文件的传输速度,从而提高拷贝效率。
相应地,本申请提供的一种精简置备文件拷贝装置、设备及可读存储介质,也同样具有上述技术效果。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为本申请公开的一种精简置备文件拷贝方法流程图;
图2为本申请公开的另一种精简置备文件拷贝方法流程图;
图3为本申请公开的一种精简置备文件拷贝装置示意图;
图4为本申请公开的一种精简置备文件拷贝设备示意图。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
目前,精简置备文件跨主机拷贝后,就变成了厚置备文件,这样文件就失去了精简置备的优势。为此,本申请提供了一种精简置备文件拷贝方案,能够使精简置备文件跨主机拷贝后,保留其精简置备的优势,同时节约目的主机的物理存储空间。
参见图1所示,本申请实施例公开了一种精简置备文件拷贝方法,应 用于目的主机,包括:
S101、发送目标文件的拷贝请求至源主机,并接收源主机返回的目标文件的文件信息。
在一种具体实施方式中,源主机和目的主机部署的文件系统的类型不同。当然,源主机和目的主机部署的文件系统的类型也可以相同。若源主机和目的主机部署的文件系统的类型不同,那么本实施例就可以实现跨主机、且跨文件系统的精简置备文件的拷贝。若源主机和目的主机部署的文件系统的类型相同,那么本实施例就可以实现跨主机的精简置备文件的拷贝。文件系统的类型如:ext3/4(Third/Forth extended file system,第三/四代扩展文件系统)、XFS(由Silicon Graphics公司1993年开发的一个高性能64位日志文件系统)、btrfs(b-tree file system,由Oracle基于写时复制原则开发的文件系统)、OCFs2(Oracle Cluster File system version 2,Oracle集群文件系统版本2)。源主机和目的主机通过socket通信。目前,各个类型的文件系统都支持精简置备。
需要说明的是,触发文件拷贝有多种方式:可以由用户在源主机触发,由源主机通知目的主机进行后续操作;也可以由用户在目的主机触发,由目的主机发送文件的拷贝请求来触发源主机回复,当然,还可以是:用户先在源主机触发源主机执行拷贝目标文件所需的准备工作,再在目的主机触发目的主机发送目标文件的拷贝请求至源主机。
在一种具体实施方式中,目的主机发送目标文件的拷贝请求至源主机之前,源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置,并发送目标文件的拷贝通知消息至目的主机,以使目的主机发送目标文件的拷贝请求至源主机。此种方式为:由用户在源主机触发拷贝操作,使得源主机得知当前将要拷贝哪个文件,然后执行相应准备工作后(即:按照源主机部署的文件系统的类型解析当前将要拷贝的文件的元数据),然后发送拷贝通知消息通至目的主机,以使目的主机发送当前将要拷贝的文件的拷贝请求,之后源主机接收到拷贝请求后不必再执行相应的准备工作,可以直接返回文件信息给目的主机。
在一种具体实施方式中,源主机在用户操作下只发送目标文件的拷贝 通知消息至目的主机,暂不执行相应准备工作,目的主机接收到拷贝通知消息后发送目标文件的拷贝请求至源主机,源主机接收到拷贝请求后按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置,并返回文件信息至目的主机。
在一种具体实施方式中,源主机返回文件信息之前,若目标文件为精简置备文件,则源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置。此种方式为:由用户在目的主机触发拷贝操作,使得目的主机得知当前将要拷贝哪个文件,然后目的主机发送当前将要拷贝的文件的拷贝请求至源主机,以使源主机基于该文件执行相应的准备工作,然后返回文件信息。文件信息包括:目标文件的大小,目标文件的标识信息(如:MD5值),目标文件包括的数据段的个数,各个数据段的偏移地址和长度。
在一种具体实施方式中,目的主机发送目标文件的拷贝请求至源主机之前,源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置,并等待拷贝请求。此种方式为:用户先在源主机触发源主机执行拷贝目标文件所需的准备工作,再在目的主机触发目的主机发送目标文件的拷贝请求至源主机。
S102、若目标文件为精简置备文件,则按照文件信息创建与目标文件的大小相同,且不占用磁盘空间的虚拟存储区域。
在本申请中,以精简置备方式存储的文件称为精简置备文件(如QCOW2),以厚置备方式存储的文件称为厚置备文件。厚置备即:创建虚拟空间时,直接分配相应的物理存储空间,有i/o操作时无需再分配物理存储空间。
QCOW2(QEMU Copy On Write version 2,QEMU写时复制文件格式版本2)是QEMU(Quick Emulator,一种开源的能够进行硬件虚拟化的管理程序)支持的一种镜像文件格式,其主要特性就是支持磁盘镜像文件的精简置备功能,可认为其是QEMU为了支持文件的精简置备功能而专门开发的一个镜像文件格式。
在本实施例中,文件信息中还可以包括目标文件是否为精简置备文件的标志位,这样目的主机就可以知悉目标文件是否为精简置备文件,然后 执行相应步骤。若目标文件不是精简置备文件,则目的主机按照文件信息创建与目标文件的大小相同,且占用磁盘空间的虚拟存储区域,以利用厚置备方式存储目标文件。
其中,厚置备方式包括:厚置备延迟置零和厚置备置零。厚置备延迟置零即:创建虚拟磁盘时,直接从物理磁盘分配空间,但对物理磁盘保留的数据不置零;当有i/o操作时,需要做置零的操作后,再写入数据。厚置备置零即:创建虚拟空间时,直接分配相应的物理存储空间,并对物理磁盘保留的数据做置零操作,有i/o操作时不需要再做置零的操作,可直接写入数据。
S103、按照文件信息逐一发送目标数据段的获取请求至源主机,接收源主机返回的目标数据段,并以精简置备方式存储目标数据段至虚拟存储区域对应的磁盘地址,以将目标文件从源主机拷贝至目的主机;目标数据段为目标文件包括的所有数据段中的任一个。
需要说明的是,目的主机按照文件信息中的各个数据段的偏移地址和长度,按照各个数据段在目标文件中的顺序逐一发送每个数据段的获取请求,从而使得源主机逐一返回各个数据段。目的主机每接收到一个数据段,便以精简置备方式存储当前数据段至虚拟存储区域对应的磁盘地址,如此循环往复,直至目标文件包括的所有数据段都落入目的主机的磁盘。
在一种具体实施方式中,将目标文件从源主机拷贝至目的主机之后,还包括:将目的主机存储的目标文件的所有数据段组合为目的文件,并判断目的文件和目标文件是否一致;若是,则发送目标文件拷贝成功的通知消息至源主机。其中,判断目的文件和目标文件是否一致,包括:计算目的文件的目的MD5值,并从文件信息中获取目标文件的源MD5值,判断目的MD5值和源MD5值是否一致。若目的文件和目标文件不一致,则发送目标文件拷贝失败的通知消息至源主机,并报错。之后技术人员可以根据报错提示消息选择是否重新将目标文件从源主机拷贝至目的主机。
需要说明的是,本实施例仅传输目标文件中的有效数据(即目标文件包括的所有数据段)至目的主机,还可以降低传输文件的数据量,提高文件的传输速度,从而提高拷贝效率。
可见,本申请实施例在将精简置备文件从源主机拷贝至目的主机的过 程中,目的主机会创建与所述精简置备文件的大小相同,且不占用磁盘空间的虚拟存储区域,为后续数据的存储做准备。在精简置备文件包括的数据真正需要写入时,才分配相应的磁盘地址供数据落盘,使得精简置备文件从源主机拷贝至目的主机后,其在目的主机中仍然是精简置备文件,从而使精简置备文件跨主机拷贝后,保留了其精简置备的优势,也节约了目的主机的物理存储空间。
本申请实施例公开了另一种精简置备文件拷贝方法,该方法执行的触发方式为:用户先在源主机触发源主机执行拷贝目标文件所需的准备工作,再在目的主机触发目的主机发送目标文件的拷贝请求至源主机。具体的,用户基于源主机的人机交互界面触发源主机中的文件传输服务运行,并指定要拷贝的目标文件,以利用文件传输服务解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置(即数据在磁盘上的分布);而后,用户基于目的主机的人机交互界面指定要拷贝的目标文件,并触发目的主机发送目标文件的拷贝请求至源主机,以便执行后续流程。
其中,文件传输服务可以进行扩展,使其兼容多种类型的文件系统。
参见图2所示,源主机上利用其上运行的文件传输服务(即server服务)具体用于:
获取用户输入的精简置备文件的名称。判断源主机的文件系统的类型,按照源主机的文件系统的类型解析精简置备文件的元数据,以获得精简置备文件的有效数据在磁盘上的分布。基于文件名称确定精简置备文件的文件信息后,等待目的主机发过来的拷贝请求。
目的主机利用其上运行的client进程具体用于:获取用户输入的精简置备文件的名称。基于文件名称发送精简置备文件的拷贝请求至源主机。接收源主机返回的文件信息。创建一个与精简置备文件大小相同的虚拟文件,此时该虚拟文件的实际占用磁盘空间为0。按照文件信息逐一发送数据段获取请求给源主机。接收源主机返回的数据段。查询虚拟文件的对应的物理地址,并以精简置备方式逐一将各个数据段落盘,直至精简置备文件包括的数据段全部落入目的主机的磁盘。
其中,目的主机发送的数据段获取请求中包括数据段的偏移地址和长 度;源主机返回的数据中包括数据段的偏移地址、长度以及数据段本身。
在精简置备文件包括的数据段全部落入目的主机的磁盘之后,目的主机计算落入目的主机磁盘的精简置备文件的MD5值,如果该MD5值和文件信息中的MD5值一样,则表示拷贝成功。此时可以断开目的主机与源主机之间的socket连接,并关闭文件传输服务和client进程。否则,失败报错。
本实施例在文件的源端实现了一个server服务,利用该server可以针对源端的文件系统的类型解析精简置备文件的元数据,得到精简置备文件的实际数据分布,然后开始等待client请求。在目的端起一个client进程,利用client向源端发送拷贝请求,得到回应后,创建一个与精简置备文件大小相同、但磁盘占用空间为0的虚拟文件;然后目的端向源端请求数据段,收到回复后,以精简置备方式进行数据段的落盘操作。最后,目的端获得精简置备文件的全部数据段后,以文件的MD5值判断落盘文件是否正确。可见,该方案不依赖于源端和目的端的文件系统的类型,支持跨文件系统、跨主机的精简置备文件的拷贝。
本实施例采用C/S结构(客户机-服务器模式),具有很好的扩展性,只需针对不同类型的文件系统编写相应的元数据解析逻辑即可实现扩展;且由于数据传输格式不依赖于具体的文件系统,还可支持跨文件系统的精简置备拷贝,进一步提高了精简置备特性的应用范围,也解决了虚拟化场景中精简置备的镜像文件的跨主机迁移、备份的问题。
下面对本申请实施例提供的一种精简置备文件拷贝装置进行介绍,下文描述的一种精简置备文件拷贝装置与上文描述的一种精简置备文件拷贝方法可以相互参照。
参见图3所示,本申请实施例公开了一种精简置备文件拷贝装置,应用于目的主机,包括:
发送模块301,用于发送目标文件的拷贝请求至源主机,并接收源主机返回的目标文件的文件信息;
创建模块302,用于若目标文件为精简置备文件,则按照文件信息创建与目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;
拷贝模块303,用于按照文件信息逐一发送目标数据段的获取请求至源主机,接收源主机返回的目标数据段,并以精简置备方式存储目标数据段至虚拟存储区域对应的磁盘地址,以将目标文件从源主机拷贝至目的主机;目标数据段为目标文件包括的所有数据段中的任一个。
在一种具体实施方式中,目的主机发送目标文件的拷贝请求至源主机之前,源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置,并发送目标文件的拷贝通知消息至目的主机。
在一种具体实施方式中,源主机返回文件信息之前,若目标文件为精简置备文件,则源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置。
在一种具体实施方式中,目的主机发送目标文件的拷贝请求至源主机之前,源主机按照源主机部署的文件系统的类型解析目标文件的元数据,以获得目标文件包括的各个数据段所存储的磁盘位置,并等待拷贝请求。
在一种具体实施方式中,还包括:
判断模块,用于将目的主机存储的目标文件的所有数据段组合为目的文件,并判断目的文件和目标文件是否一致;
通知模块,用于若目的文件和目标文件一致,则发送目标文件拷贝成功的通知消息至源主机。
在一种具体实施方式中,判断模块具体用于:
计算目的文件的目的MD5值,并从文件信息中获取目标文件的源MD5值,判断目的MD5值和源MD5值是否一致。
在一种具体实施方式中,还包括:
通知模块具体用于:若目的文件和目标文件不一致,则发送目标文件拷贝失败的通知消息至源主机。
在一种具体实施方式中,源主机和目的主机部署的文件系统的类型不同。
其中,关于本实施例中各个模块、单元更加具体的工作过程可以参考前述实施例中公开的相应内容,在此不再进行赘述。
可见,本实施例提供了一种精简置备文件拷贝装置,该装置在将精简 置备文件从源主机拷贝至目的主机的过程中,目的主机会创建与所述精简置备文件的大小相同,且不占用磁盘空间的虚拟存储区域,为后续数据的存储做准备。在精简置备文件包括的数据真正需要写入时,才分配相应的磁盘地址供数据落盘,使得精简置备文件从源主机拷贝至目的主机后,其在目的主机中仍然是精简置备文件,从而使精简置备文件跨主机拷贝后,保留了其精简置备的优势,也节约了目的主机的物理存储空间。
下面对本申请实施例提供的一种精简置备文件拷贝设备进行介绍,下文描述的一种精简置备文件拷贝设备与上文描述的一种精简置备文件拷贝方法及装置可以相互参照。
参见图4所示,本申请实施例公开了一种精简置备文件拷贝设备,包括:
存储器401,用于保存计算机程序;
处理器402,用于执行所述计算机程序,以实现上述任意实施例公开的方法。
下面对本申请实施例提供的一种可读存储介质进行介绍,下文描述的一种可读存储介质与上文描述的一种精简置备文件拷贝方法、装置及设备可以相互参照。
一种可读存储介质,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现前述实施例公开的精简置备文件拷贝方法。关于该方法的具体步骤可以参考前述实施例中公开的相应内容,在此不再进行赘述。
本申请涉及的“第一”、“第二”、“第三”、“第四”等(如果存在)是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的实施例能够以除了在这里图示或描述的内容以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法或设备固有的其它步 骤或单元。
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。
本说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其它实施例的不同之处,各个实施例之间相同或相似部分互相参见即可。
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM、或技术领域内所公知的任意其它形式的可读存储介质中。
本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想;同时,对于本领域的一般技术人员,依据本申请的思想,在具体实施方式及应用范围上均会有改变之处,综上所述,本说明书内容不应理解为对本申请的限制。
Claims (10)
- 一种精简置备文件拷贝方法,其特征在于,应用于目的主机,包括:发送目标文件的拷贝请求至源主机,并接收所述源主机返回的所述目标文件的文件信息;若所述目标文件为精简置备文件,则按照所述文件信息创建与所述目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;按照所述文件信息逐一发送目标数据段的获取请求至所述源主机,接收所述源主机返回的所述目标数据段,并以精简置备方式存储所述目标数据段至所述虚拟存储区域对应的磁盘地址,以将所述目标文件从所述源主机拷贝至所述目的主机;所述目标数据段为所述目标文件包括的所有数据段中的任一个。
- 根据权利要求1所述的精简置备文件拷贝方法,其特征在于,所述发送目标文件的拷贝请求至源主机之前,所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置,并发送所述目标文件的拷贝通知消息至所述目的主机。
- 根据权利要求1所述的精简置备文件拷贝方法,其特征在于,所述源主机返回所述文件信息之前,若所述目标文件为精简置备文件,则所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置。
- 根据权利要求1所述的精简置备文件拷贝方法,其特征在于,所述发送目标文件的拷贝请求至源主机之前,所述源主机按照所述源主机部署的文件系统的类型解析所述目标文件的元数据,以获得所述目标文件包括的各个数据段所存储的磁盘位置,并等待所述拷贝请求。
- 根据权利要求2至4任一项所述的精简置备文件拷贝方法,其特征在于,所述将所述目标文件从所述源主机拷贝至所述目的主机之后,还包括:将所述目的主机存储的所述目标文件的所有数据段组合为目的文件,并判断所述目的文件和所述目标文件是否一致;若是,则发送所述目标文件拷贝成功的通知消息至所述源主机;若否,则发送所述目标文件拷贝失败的通知消息至所述源主机。
- 根据权利要求5所述的精简置备文件拷贝方法,其特征在于,所述判断所述目的文件和所述目标文件是否一致,包括:计算所述目的文件的目的MD5值,并从所述文件信息中获取所述目标文件的源MD5值,判断所述目的MD5值和所述源MD5值是否一致。
- 根据权利要求5所述的精简置备文件拷贝方法,其特征在于,所述源主机和所述目的主机部署的文件系统的类型不同。
- 一种精简置备文件拷贝装置,其特征在于,应用于目的主机,包括:发送模块,用于发送目标文件的拷贝请求至源主机,并接收所述源主机返回的所述目标文件的文件信息;创建模块,用于若所述目标文件为精简置备文件,则按照所述文件信息创建与所述目标文件的大小相同,且不占用磁盘空间的虚拟存储区域;拷贝模块,用于按照所述文件信息逐一发送目标数据段的获取请求至所述源主机,接收所述源主机返回的所述目标数据段,并以精简置备方式存储所述目标数据段至所述虚拟存储区域对应的磁盘地址,以将所述目标文件从所述源主机拷贝至所述目的主机;所述目标数据段为所述目标文件包括的所有数据段中的任一个。
- 一种精简置备文件拷贝设备,其特征在于,包括:存储器,用于存储计算机程序;处理器,用于执行所述计算机程序,以实现如权利要求1至7任一项所述的精简置备文件拷贝方法。
- 一种可读存储介质,其特征在于,用于保存计算机程序,其中,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的精简置备文件拷贝方法。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| US18/005,003 US20230195347A1 (en) | 2020-07-17 | 2021-02-19 | Thin-Provisioned File Copying Method, Apparatus and Device, and Readable Storage Medium |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010692366.5 | 2020-07-17 | ||
| CN202010692366.5A CN112000277B (zh) | 2020-07-17 | 2020-07-17 | 精简置备文件拷贝方法、装置、设备及可读存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2022012044A1 true WO2022012044A1 (zh) | 2022-01-20 |
Family
ID=73467976
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2021/076953 Ceased WO2022012044A1 (zh) | 2020-07-17 | 2021-02-19 | 精简置备文件拷贝方法、装置、设备及可读存储介质 |
Country Status (3)
| Country | Link |
|---|---|
| US (1) | US20230195347A1 (zh) |
| CN (1) | CN112000277B (zh) |
| WO (1) | WO2022012044A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20220100699A1 (en) * | 2020-09-30 | 2022-03-31 | Beijing Tsingmicro Intelligent Technology Co., Ltd. | Computing array and processor having the same |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112000277B (zh) * | 2020-07-17 | 2022-07-08 | 苏州浪潮智能科技有限公司 | 精简置备文件拷贝方法、装置、设备及可读存储介质 |
| CN114866537B (zh) * | 2022-05-31 | 2023-08-04 | 山东省计算中心(国家超级计算济南中心) | 一种跨主机跨网络的文件传输方法及系统 |
| CN116301593B (zh) * | 2023-02-09 | 2024-02-02 | 安超云软件有限公司 | 在云平台下跨集群跨存储拷贝块数据的方法及应用 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150373102A1 (en) * | 2014-06-24 | 2015-12-24 | Vmware, Inc. | Deployment of virtual machine disks from a shared network file system |
| CN110515539A (zh) * | 2019-07-22 | 2019-11-29 | 平安科技(深圳)有限公司 | 基于云存储的云磁盘挂载方法、装置、设备和存储介质 |
| CN110888843A (zh) * | 2019-10-31 | 2020-03-17 | 北京浪潮数据技术有限公司 | 一种跨主机的稀疏文件拷贝方法、装置、设备及存储介质 |
| CN111143126A (zh) * | 2019-12-20 | 2020-05-12 | 浪潮电子信息产业股份有限公司 | 一种分布式文件系统的数据拷贝方法、系统及相关组件 |
| CN112000277A (zh) * | 2020-07-17 | 2020-11-27 | 苏州浪潮智能科技有限公司 | 精简置备文件拷贝方法、装置、设备及可读存储介质 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103019804B (zh) * | 2012-12-28 | 2016-05-11 | 中国人民解放军国防科学技术大学 | OpenVZ虚拟化的VPS快速迁移方法 |
| CN109040221A (zh) * | 2018-07-26 | 2018-12-18 | 郑州云海信息技术有限公司 | 一种数据传输方法、系统、设备及存储阵列和存储介质 |
-
2020
- 2020-07-17 CN CN202010692366.5A patent/CN112000277B/zh active Active
-
2021
- 2021-02-19 US US18/005,003 patent/US20230195347A1/en not_active Abandoned
- 2021-02-19 WO PCT/CN2021/076953 patent/WO2022012044A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20150373102A1 (en) * | 2014-06-24 | 2015-12-24 | Vmware, Inc. | Deployment of virtual machine disks from a shared network file system |
| CN110515539A (zh) * | 2019-07-22 | 2019-11-29 | 平安科技(深圳)有限公司 | 基于云存储的云磁盘挂载方法、装置、设备和存储介质 |
| CN110888843A (zh) * | 2019-10-31 | 2020-03-17 | 北京浪潮数据技术有限公司 | 一种跨主机的稀疏文件拷贝方法、装置、设备及存储介质 |
| CN111143126A (zh) * | 2019-12-20 | 2020-05-12 | 浪潮电子信息产业股份有限公司 | 一种分布式文件系统的数据拷贝方法、系统及相关组件 |
| CN112000277A (zh) * | 2020-07-17 | 2020-11-27 | 苏州浪潮智能科技有限公司 | 精简置备文件拷贝方法、装置、设备及可读存储介质 |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20220100699A1 (en) * | 2020-09-30 | 2022-03-31 | Beijing Tsingmicro Intelligent Technology Co., Ltd. | Computing array and processor having the same |
| US12013809B2 (en) * | 2020-09-30 | 2024-06-18 | Beijing Tsingmicro Intelligent Technology Co., Ltd. | Computing array and processor having the same |
Also Published As
| Publication number | Publication date |
|---|---|
| US20230195347A1 (en) | 2023-06-22 |
| CN112000277B (zh) | 2022-07-08 |
| CN112000277A (zh) | 2020-11-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2022012044A1 (zh) | 精简置备文件拷贝方法、装置、设备及可读存储介质 | |
| US11409705B2 (en) | Log-structured storage device format | |
| US11436157B2 (en) | Method and apparatus for accessing storage system | |
| CN102594849B (zh) | 数据备份、恢复方法、虚拟机快照删除、回滚方法及装置 | |
| US9652265B1 (en) | Architecture for managing I/O and storage for a virtualization environment with multiple hypervisor types | |
| US8601473B1 (en) | Architecture for managing I/O and storage for a virtualization environment | |
| EP3531666B1 (en) | Method for managing storage devices in a storage system, and storage system | |
| CN102708060B (zh) | 一种镜像文件访问方法、装置及系统 | |
| EP4006737A1 (en) | Concurrent multiprotocol access to an object storage system | |
| CN103729300B (zh) | 非易失内存的管理方法和相关装置 | |
| US20160077996A1 (en) | Fibre Channel Storage Array Having Standby Controller With ALUA Standby Mode for Forwarding SCSI Commands | |
| US11822370B2 (en) | Concurrent multiprotocol access to an object storage system | |
| CN113703672B (zh) | 一种超融合系统及其io请求下发方法、物理服务器 | |
| US9940152B2 (en) | Methods and systems for integrating a volume shadow copy service (VSS) requester and/or a VSS provider with virtual volumes (VVOLS) | |
| EP3531266A1 (en) | Method and apparatus for managing storage device in storage system | |
| JP2013196066A (ja) | ファイルサーバ、データ入出力方法、i/oフックモジュールプログラム及びi/o代行デーモンプログラム | |
| CN100405304C (zh) | 基于存储区域网络的高速固态存储设备的实现方法 | |
| CN112714910B (zh) | 分布式存储系统及计算机程序产品 | |
| CN106445409A (zh) | 一种分布式块存储的数据写入方法及装置 | |
| US20200379899A1 (en) | Methods for facilitating efficient storage operations using host-managed solid-state disks and devices thereof | |
| US11327895B1 (en) | Protocol for processing requests that assigns each request received by a node a sequence identifier, stores data written by the request in a cache page block, stores a descriptor for the request in a cache page descriptor, and returns a completion acknowledgement of the request | |
| CN114564339A (zh) | 一种磁盘镜像文件跨平台迁移方法及系统 | |
| CN106293994A (zh) | 网络文件系统中的虚拟机克隆方法和网络文件系统 | |
| US7627710B1 (en) | Converting an object identifier to a block I/O address to identify a storage location on a server | |
| CN116700904A (zh) | 内存快照生成方法、装置、计算机设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 21841494 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 21841494 Country of ref document: EP Kind code of ref document: A1 |