CN110750496A - File copying method, system, equipment and computer readable storage medium - Google Patents

File copying method, system, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110750496A
CN110750496A CN201911012851.7A CN201911012851A CN110750496A CN 110750496 A CN110750496 A CN 110750496A CN 201911012851 A CN201911012851 A CN 201911012851A CN 110750496 A CN110750496 A CN 110750496A
Authority
CN
China
Prior art keywords
file
backtracking
copied
link
node
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
CN201911012851.7A
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.)
Sangfor Technologies Co Ltd
Original Assignee
Sangfor 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 Sangfor Technologies Co Ltd filed Critical Sangfor Technologies Co Ltd
Priority to CN201911012851.7A priority Critical patent/CN110750496A/en
Publication of CN110750496A publication Critical patent/CN110750496A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/128Details of file system snapshots on the file-level, e.g. snapshot creation, administration, deletion

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 application discloses a file copying method, a system, equipment and a computer readable storage medium, which are used for determining a file to be copied; creating a virtual snapshot node corresponding to a file to be copied; creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node; taking the virtual snapshot nodes and the link clone file as a link clone result; and taking the link cloning result as a copying result of the file to be copied. According to the file copying method, the file to be copied is subjected to link cloning to obtain the copying result of the file to be copied, the file to be copied can be traced back through the link cloning result, so that the link cloning result can be used as the copying result of the file to be copied, and data copying does not actually occur in the link cloning process, so that the file copying can be quickly completed, and the file copying efficiency is improved. The file copying system, the file copying equipment and the computer readable storage medium solve the corresponding technical problems.

Description

File copying method, system, equipment and computer readable storage medium
Technical Field
The present application relates to the field of storage technologies, and in particular, to a file copying method, system, device, and computer-readable storage medium.
Background
In the storage system, when a file needs to be copied, the whole file needs to be copied, the copying time and the copying difficulty are continuously increased along with the increase of the file amount, and the file copying efficiency is low.
In summary, how to improve the efficiency of file copying is a problem to be solved urgently by those skilled in the art.
Disclosure of Invention
The application aims to provide a file copying method which can solve the technical problem of improving the file copying efficiency to a certain extent. The application also provides a file copying system, equipment and a computer readable storage medium.
In order to achieve the above purpose, the present application provides the following technical solutions:
a file copying method, comprising:
determining a file to be copied;
creating a virtual snapshot node corresponding to the file to be copied;
creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node;
taking the virtual snapshot node and the link clone file as a link clone result;
and taking the link cloning result as a copying result of the file to be copied.
Preferably, the taking the virtual snapshot node and the link clone file as a link clone result includes:
recording the information of the file to be copied and recording the derived snapshot node information of the file to be copied;
and taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derived snapshot node information of the file to be copied as the link clone result.
Preferably, the determining the file to be copied includes:
determining a snapshot file of an original file as the file to be copied;
after the creating of the link clone file corresponding to the virtual snapshot node, the method further includes:
and carrying out snapshot on the link clone file.
Preferably, after the step of taking the result of the linked clone as the result of copying the file to be copied, the method further includes:
receiving a data reading instruction;
and based on the link clone result, according to a first-class backtracking sequence from a root node to a father node, backtracking is started from the latest snapshot corresponding to the link clone file, and data to be read corresponding to the data reading instruction is searched in each first-class backtracking file.
Preferably, the searching for the data to be read corresponding to the data reading instruction in each first-type backtracking file includes:
for each first-type backtracking file, judging whether the first-type backtracking file is a root node and is a non-link clone file; if not, judging whether the first type backtracking file is a link clone root node or not;
if the first type of backtracking file is a chained clone root node, judging whether the data to be read exists in the first type of backtracking file;
if the data to be read exists in the first type of backtracking file, ending backtracking;
if the data to be read does not exist in the first type of backtracking file, continuing backtracking.
Preferably, in the process of searching for the data to be read corresponding to the data reading instruction in each first-type backtracking file, the method further includes:
for each first-type backtracking file, judging whether the first-type backtracking file has other unrelooked-up snapshot files or not;
if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from a parent node to a root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
Preferably, after determining that the first type of backtracking file is a root node and is a non-linked clone file, the method further includes:
and searching the data to be read according to a snapshot reading mode from the first type backtracking file.
A file copying system comprising:
the first determining module is used for determining a file to be copied;
the first creating module is used for creating a virtual snapshot node corresponding to the file to be copied;
the second creating module is used for creating a link clone file corresponding to the virtual snapshot node and recording the information of the link clone file in the virtual snapshot node;
the first setting module is used for taking the virtual snapshot node and the link clone file as a link clone result;
and the second setting module is used for taking the link cloning result as the copying result of the file to be copied.
A file copying apparatus comprising:
a memory for storing a computer program;
a processor for implementing the steps of the file copying method as described in any one of the above when the computer program is executed.
A computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, carries out the steps of the file copying method according to any one of the preceding claims.
The file copying method provided by the application determines a file to be copied; creating a virtual snapshot node corresponding to a file to be copied; creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node; taking the virtual snapshot nodes and the link clone file as a link clone result; and taking the link cloning result as a copying result of the file to be copied. According to the file copying method, the file to be copied is subjected to link cloning to obtain the copying result of the file to be copied, the file to be copied can be traced back through the link cloning result, so that the link cloning result can be used as the copying result of the file to be copied, and data copying does not actually occur in the link cloning process, so that the file copying can be quickly completed, and the file copying efficiency is improved. The file copying system, the file copying equipment and the computer readable storage medium solve the corresponding technical problems.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments or the prior art will be briefly introduced below, it is obvious that the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a file copying method according to an embodiment of the present application;
FIG. 2 is a flow chart of the present application for obtaining results of linked cloning;
FIG. 3 is a schematic view of a copy of document A;
fig. 4 is a schematic structural diagram of a file copying system according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a file copying apparatus according to an embodiment of the present application;
fig. 6 is another schematic structural diagram of a file copying apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Referring to fig. 1, fig. 1 is a flowchart of a file copying method according to an embodiment of the present disclosure.
The file copying method provided by the embodiment of the application can comprise the following steps:
step S11: and determining a file to be copied.
In practical application, the type of the file to be copied may be determined according to actual needs, for example, the file may be a system file generated by a server in an operation process, user data received by a client in an operation process, and the like.
Step S12: and creating a virtual snapshot node corresponding to the file to be copied.
Step S13: and creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node.
Step S14: and taking the virtual snapshot node and the link clone file as a link clone result.
In practical application, after the file to be copied is determined, the file to be copied is not copied according to the existing mode, but the file to be copied is subjected to link cloning to obtain a corresponding link cloning result, and the link cloning result can be traced back to the file to be copied according to the link cloning result because the link cloning needs to be continuously linked with the file to be copied, namely the link cloning result can serve as the copying result of the file to be copied. Specifically, when the link cloning is performed on the file to be copied, the virtual snapshot node corresponding to the file to be copied may be created first, the link clone file corresponding to the virtual snapshot node may be created, the information of the link clone file may be recorded in the virtual snapshot node, and finally the virtual snapshot node and the link clone file may be used as the link cloning result.
In a specific application scenario, the virtual snapshot node is used for storing information of the link clone file, so that the link clone file can be found based on the information of the link clone file, and the virtual snapshot node is linked with the file to be copied, so that the file to be copied and the link clone file can be linked through the virtual snapshot node, and the file to be copied can be traced back from the link clone file. It should be noted that the link clone file corresponding to the virtual snapshot node may be an empty file, or a subsequent file related to the file to be copied, for example, in a data storage scenario, after the file to be copied is copied, the copy result may be stored together with other files, and then the other files in the data storage scenario may be used as the link clone file.
Step S15: and taking the link cloning result as a copying result of the file to be copied.
In practical application, after the link cloning result is obtained, the link cloning result can be directly used as the copying result of the file to be copied, and then, the operations of the copying result can be carried out on the basis of the link cloning result.
The file copying method provided by the application determines a file to be copied; creating a virtual snapshot node corresponding to a file to be copied; creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node; taking the virtual snapshot nodes and the link clone file as a link clone result; and taking the link cloning result as a copying result of the file to be copied. According to the file copying method, the file to be copied is subjected to link cloning to obtain the copying result of the file to be copied, the file to be copied can be traced back through the link cloning result, so that the link cloning result can be used as the copying result of the file to be copied, and data copying does not actually occur in the link cloning process, so that the file copying can be quickly completed, and the file copying efficiency is improved.
Referring to FIG. 2, FIG. 2 is a flow chart of the present application for obtaining the result of linked cloning.
In the file copying method provided in the embodiment of the present application, step S14: the process of using the virtual snapshot node and the link clone file as the link clone result may specifically include:
step S141: recording the information of the file to be copied and recording the derived snapshot node information of the file to be copied.
Step S142: and taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derivative snapshot node information of the file to be copied as a link clone result.
In practical application, since the link clone links the link clone file and the file to be copied through the link relationship, in order to ensure the link relationship between the link clone file and the file to be copied, information of the file to be copied needs to be recorded, and for convenience of subsequent data searching, information of a derived snapshot node of the file to be copied needs to be recorded together.
It should be noted that in the process of copying the file to be copied, since the actual data copy does not occur to the link clone file, if the link clone is performed for many times, the data read-write efficiency may be affected, and the snapshot may generate a fully available copy of the data set, so that in order to ensure the data read-write efficiency, the link clone may be combined with the snapshot technology, and when the file to be copied is determined, the snapshot file of the original file may be determined as the file to be copied; after the link clone file corresponding to the virtual snapshot node is created, the link clone file can be snapshot.
In the file copying method provided by the embodiment of the application, after the link clone result is used as the copying result of the file to be copied, a data reading instruction can be received; and based on the link clone result, according to a first-class backtracking sequence from the root node to the father node, backtracking is started from the latest snapshot corresponding to the link clone file, and the data to be read corresponding to the data reading instruction is searched in each first-class backtracking file.
In the file copying method provided by the embodiment of the application, when data to be read corresponding to a data reading instruction is searched in each first-class backtracking file, whether the first-class backtracking file is a root node and is a non-link clone file or not can be judged for each first-class backtracking file; if not, judging whether the first type of backtracking files are the link clone root nodes or not; if the first type of backtracking file is a chained clone root node, judging whether the first type of backtracking file has data to be read; if the data to be read exists in the first type of backtracking file, ending backtracking; if the data to be read does not exist in the first type of backtracking file, the backtracking is continued.
In the application, when data to be read is searched in a file corresponding to a link clone, the file corresponding to the link clone, that is, a related file generated by a link clone operation, can be traced back from a latest snapshot corresponding to the link clone file according to a first-class tracing sequence from a root node to a father node based on a link clone result, that is, the latest snapshot corresponding to the link clone file can be used as a current first-class tracing file, the data to be read is searched in the current first-class tracing file, if the data to be read is not searched, the father node of the current first-class tracing file is used as the current first-class tracing file, and the steps of searching the data to be read in the current first-class tracing file and then returning are executed. For convenience of understanding, the process is described with reference to fig. 3, fig. 3 is a schematic copy diagram of a file a, in fig. 3, original files of a snapshot 5, a snapshot 4, and a file B all belong to files corresponding to a link clone, and the snapshot 5 is a latest snapshot corresponding to the link clone file, when a first-type backtracking sequence from a root node to a parent node is followed, the snapshot 5 is required to be taken as a current first-type backtracking file, data to be read is searched in the snapshot 5, if the data to be read does not exist in the snapshot 5, the snapshot 4 is taken as the parent node of the snapshot 5, the data to be read is searched in the snapshot 4, and so on until the searching process is completed.
In the file copying method provided in the embodiment of the present application, when data to be read is searched for in a file corresponding to a linked clone, since other snapshots may exist in the file corresponding to the linked clone, it is assumed that a snapshot 6 may exist in addition to a snapshot 5 in fig. 3, and when backtracking is performed according to a first type of backtracking sequence from a root node to a parent node, the backtracking cannot reach the snapshot 6, which may affect the searching accuracy of the data to be read, and in order to ensure the searching accuracy of the data to be read, in a process of searching for the data to be read corresponding to a data reading instruction in each first type of backtracking file, for each first type of backtracking file, it is determined whether the first type of backtracking file has other unrequired snapshot files; if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from the father node to the root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
In the file copying method provided by the embodiment of the application, after a first type of backtracking file which is a root node and is a non-link clone file is backtracked, the first type of backtracking file may be an original file serving as a snapshot file of the file to be copied, the original file is not backtracked at this time, in order to be backtracked to the original file and ensure the searching accuracy of the data to be read, after the first type of backtracking file is judged to be the root node and is the non-link clone file, the data to be read can be searched from the first type of backtracking file according to a snapshot reading mode.
Referring to fig. 4, fig. 4 is a schematic structural diagram of a file copying system according to an embodiment of the present disclosure.
The file copying system provided by the embodiment of the application can comprise:
a first determining module 101, configured to determine a file to be copied;
a first creating module 102, configured to create a virtual snapshot node corresponding to a file to be copied;
a second creating module 103, configured to create a link clone file corresponding to the virtual snapshot node, and record information of the link clone file in the virtual snapshot node;
a first setting module 104, configured to use the virtual snapshot node and the link clone file as a link clone result;
and a second setting module 105, configured to use the link clone result as a copy result of the file to be copied.
In an embodiment of the present application, a file copying system, a first setting module may include:
the first recording submodule is used for recording the information of the file to be copied and recording the derived snapshot node information of the file to be copied;
and the first setting submodule is used for taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derived snapshot node information of the file to be copied as the link clone result.
In an embodiment of the present application, a file copying system, a first determining module may include:
the first determining submodule is used for determining the snapshot file of the original file as a file to be copied;
the method can also comprise the following steps:
and the first snapshot module is used for performing snapshot on the link clone file after the second creating submodule creates the link clone file corresponding to the virtual snapshot node.
The file copying system provided by the embodiment of the application can further include:
the first receiving module is used for receiving a data reading instruction after the second setting module takes the link cloning result as the copying result of the file to be copied;
and the first searching module is used for starting backtracking from the latest snapshot corresponding to the chained cloned file according to the first type backtracking sequence from the root node to the father node based on the chained cloned result, and searching the data to be read corresponding to the data reading instruction in each first type backtracking file.
In an embodiment of the present application, a first searching module may include:
the first judging unit is used for judging whether the first type of backtracking files are root nodes and are not linked clone files or not for each first type of backtracking files; if not, judging whether the first type of backtracking files are the link clone root nodes or not; if the first type of backtracking file is a chained clone root node, judging whether the first type of backtracking file has data to be read; if the data to be read exists in the first type of backtracking file, ending backtracking; if the data to be read does not exist in the first type of backtracking file, the backtracking is continued.
The file copying system provided by the embodiment of the application can further include:
the second judging unit is used for judging whether the first-class backtracking files have other unrequired snapshot files or not for each first-class backtracking file in the process of searching the data to be read corresponding to the data reading instruction in each first-class backtracking file; if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from the father node to the root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
The file copying system provided by the embodiment of the application can further include:
and the second searching module is used for searching the data to be read from the first type of backtracking file according to a snapshot reading mode after the first judging unit judges that the first type of backtracking file is the root node and is not a linked clone file.
The application also provides a file copying processing device and a computer readable storage medium, which have the corresponding effects of the file copying method provided by the embodiment of the application. Referring to fig. 5, fig. 5 is a schematic structural diagram of a file copying apparatus according to an embodiment of the present disclosure.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program:
determining a file to be copied;
creating a virtual snapshot node corresponding to a file to be copied;
creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node;
taking the virtual snapshot nodes and the link clone file as a link clone result;
and taking the link cloning result as a copying result of the file to be copied.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: recording information of a file to be copied and recording derived snapshot node information of the file to be copied; and taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derivative snapshot node information of the file to be copied as a link clone result.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: determining a snapshot file of an original file as a file to be copied; and after the link clone file corresponding to the virtual snapshot node is created, carrying out snapshot on the link clone file.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: after the link cloning result is used as a copying result of the file to be copied, receiving a data reading instruction; and based on the link clone result, according to a first-class backtracking sequence from the root node to the father node, backtracking is started from the latest snapshot corresponding to the link clone file, and the data to be read corresponding to the data reading instruction is searched in each first-class backtracking file.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: for each first-class backtracking file, judging whether the first-class backtracking file is a root node and is a non-link clone file; if not, judging whether the first type of backtracking files are the link clone root nodes or not; if the first type of backtracking file is a chained clone root node, judging whether the first type of backtracking file has data to be read; if the data to be read exists in the first type of backtracking file, ending backtracking; if the data to be read does not exist in the first type of backtracking file, the backtracking is continued.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: in the process of searching the data to be read corresponding to the data reading instruction in each first-class backtracking file, judging whether other unrelooked snapshot files exist in the first-class backtracking files or not for each first-class backtracking file; if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from the father node to the root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
The file copying device provided by the embodiment of the application comprises a memory 201 and a processor 202, wherein a computer program is stored in the memory 201, and the processor 202 implements the following steps when executing the computer program: after the first type of backtracking file is judged to be the root node and the unlinked clone file, the data to be read is searched from the first type of backtracking file according to the snapshot reading mode.
Referring to fig. 6, another file copying apparatus provided in the embodiment of the present application may further include: an input port 203 connected to the processor 202, for transmitting externally input commands to the processor 202; a display unit 204 connected to the processor 202, for displaying the processing result of the processor 202 to the outside; and the communication module 205 is connected with the processor 202 and is used for realizing the communication between the file copying device and the outside. The display unit 204 may be a display panel, a laser scanning display, or the like; the communication method adopted by the communication module 205 includes, but is not limited to, mobile high definition link technology (HML), Universal Serial Bus (USB), High Definition Multimedia Interface (HDMI), and wireless connection: wireless fidelity technology (WiFi), bluetooth communication technology, bluetooth low energy communication technology, ieee802.11s based communication technology.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps:
determining a file to be copied;
creating a virtual snapshot node corresponding to a file to be copied;
creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node;
taking the virtual snapshot nodes and the link clone file as a link clone result;
and taking the link cloning result as a copying result of the file to be copied.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: recording information of a file to be copied and recording derived snapshot node information of the file to be copied; and taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derivative snapshot node information of the file to be copied as a link clone result.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: determining a snapshot file of an original file as a file to be copied; and after the link clone file corresponding to the virtual snapshot node is created, carrying out snapshot on the link clone file.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: after the link cloning result is used as a copying result of the file to be copied, receiving a data reading instruction; and based on the link clone result, according to a first-class backtracking sequence from the root node to the father node, backtracking is started from the latest snapshot corresponding to the link clone file, and the data to be read corresponding to the data reading instruction is searched in each first-class backtracking file.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: for each first-class backtracking file, judging whether the first-class backtracking file is a root node and is a non-link clone file; if not, judging whether the first type of backtracking files are the link clone root nodes or not; if the first type of backtracking file is a chained clone root node, judging whether the first type of backtracking file has data to be read; if the data to be read exists in the first type of backtracking file, ending backtracking; if the data to be read does not exist in the first type of backtracking file, the backtracking is continued.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: in the process of searching the data to be read corresponding to the data reading instruction in each first-class backtracking file, judging whether other unrelooked snapshot files exist in the first-class backtracking files or not for each first-class backtracking file; if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from the father node to the root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
A computer-readable storage medium is provided in an embodiment of the present application, in which a computer program is stored, and when the computer program is executed by a processor, the computer program implements the following steps: after the first type of backtracking file is judged to be the root node and the unlinked clone file, the data to be read is searched from the first type of backtracking file according to the snapshot reading mode.
The computer-readable storage media to which this application relates include Random Access Memory (RAM), memory, Read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage media known in the art.
For a description of a relevant part in a file copying system, a device and a computer readable storage medium provided in the embodiments of the present application, refer to a detailed description of a corresponding part in a file copying method provided in the embodiments of the present application, which is not repeated herein. In addition, parts of the above technical solutions provided in the embodiments of the present application, which are consistent with the implementation principles of corresponding technical solutions in the prior art, are not described in detail so as to avoid redundant description.
It is further noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the application. Thus, the present application is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims (10)

1. A method for copying a file, comprising:
determining a file to be copied;
creating a virtual snapshot node corresponding to the file to be copied;
creating a link clone file corresponding to the virtual snapshot node, and recording the information of the link clone file in the virtual snapshot node;
taking the virtual snapshot node and the link clone file as a link clone result;
and taking the link cloning result as a copying result of the file to be copied.
2. The method according to claim 1, wherein the using the virtual snapshot node and the link clone file as a link clone result comprises:
recording the information of the file to be copied and recording the derived snapshot node information of the file to be copied;
and taking the virtual snapshot node, the link clone file, the information of the file to be copied and the derived snapshot node information of the file to be copied as the link clone result.
3. The method of claim 2, wherein the determining the file to be copied comprises:
determining a snapshot file of an original file as the file to be copied;
after the creating of the link clone file corresponding to the virtual snapshot node, the method further includes:
and carrying out snapshot on the link clone file.
4. The method according to claim 3, wherein the step of using the link clone result as the copy result of the file to be copied further comprises:
receiving a data reading instruction;
and based on the link clone result, according to a first-class backtracking sequence from a root node to a father node, backtracking is started from the latest snapshot corresponding to the link clone file, and data to be read corresponding to the data reading instruction is searched in each first-class backtracking file.
5. The method according to claim 4, wherein the searching for the data to be read corresponding to the data reading instruction in each first-class backtracking file comprises:
for each first-type backtracking file, judging whether the first-type backtracking file is a root node and is a non-link clone file; if not, judging whether the first type backtracking file is a link clone root node or not;
if the first type of backtracking file is a chained clone root node, judging whether the data to be read exists in the first type of backtracking file;
if the data to be read exists in the first type of backtracking file, ending backtracking;
if the data to be read does not exist in the first type of backtracking file, continuing backtracking.
6. The method according to claim 5, wherein in the process of searching for the data to be read corresponding to the data read instruction in each first-type backtracking file, the method further comprises:
for each first-type backtracking file, judging whether the first-type backtracking file has other unrelooked-up snapshot files or not;
if the first type of backtracking files have other unrelooked-up snapshot files, backtracking is started from the other unrelooked-up snapshot files according to a second backtracking sequence from a parent node to a root node, and data to be read corresponding to the data reading instruction is searched in each second type of backtracking file.
7. The method according to claim 5 or 6, wherein after determining that the first type of backtracking file is a root node and is a non-linked clone file, the method further comprises:
and searching the data to be read according to a snapshot reading mode from the first type backtracking file.
8. A file copying system, comprising:
the first determining module is used for determining a file to be copied;
the first creating module is used for creating a virtual snapshot node corresponding to the file to be copied;
the second creating module is used for creating a link clone file corresponding to the virtual snapshot node and recording the information of the link clone file in the virtual snapshot node;
the first setting module is used for taking the virtual snapshot node and the link clone file as a link clone result;
and the second setting module is used for taking the link cloning result as the copying result of the file to be copied.
9. A file copying apparatus characterized by comprising:
a memory for storing a computer program;
a processor for implementing the steps of the file copying method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the file copying method according to any one of claims 1 to 7.
CN201911012851.7A 2019-10-23 2019-10-23 File copying method, system, equipment and computer readable storage medium Pending CN110750496A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911012851.7A CN110750496A (en) 2019-10-23 2019-10-23 File copying method, system, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911012851.7A CN110750496A (en) 2019-10-23 2019-10-23 File copying method, system, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110750496A true CN110750496A (en) 2020-02-04

Family

ID=69279556

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911012851.7A Pending CN110750496A (en) 2019-10-23 2019-10-23 File copying method, system, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110750496A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737223A (en) * 2020-06-28 2020-10-02 浪潮电子信息产业股份有限公司 File copying method, device, equipment and storage medium
CN112035833A (en) * 2020-08-21 2020-12-04 郑州信大捷安信息技术股份有限公司 File copy monitoring method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103038767A (en) * 2010-07-30 2013-04-10 国际商业机器公司 Data sharing for file clones
CN104461780A (en) * 2014-11-28 2015-03-25 华为技术有限公司 Data block release method and device
CN106802840A (en) * 2017-01-19 2017-06-06 郑州云海信息技术有限公司 A kind of virtual machine backup, restoration methods and device
CN106933699A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of data recovery, snapshot establishment, snapshot delet method and device
CN107038596A (en) * 2016-02-04 2017-08-11 希姆通信息技术(上海)有限公司 Accumulated point exchanging method and its system
CN107291391A (en) * 2017-06-21 2017-10-24 郑州云海信息技术有限公司 A kind of data processing method and system for distributed memory system
CN109032762A (en) * 2018-08-09 2018-12-18 腾讯科技(深圳)有限公司 Virtual machine retrogressive method and relevant device
CN109408291A (en) * 2018-10-31 2019-03-01 郑州云海信息技术有限公司 A kind of distributed memory system disk snapshot restoration methods, device and electronic equipment
CN109597707A (en) * 2018-10-25 2019-04-09 平安科技(深圳)有限公司 Clone volume data copying method, device and computer readable storage medium

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103038767A (en) * 2010-07-30 2013-04-10 国际商业机器公司 Data sharing for file clones
CN104461780A (en) * 2014-11-28 2015-03-25 华为技术有限公司 Data block release method and device
CN106933699A (en) * 2015-12-30 2017-07-07 中移(苏州)软件技术有限公司 A kind of data recovery, snapshot establishment, snapshot delet method and device
CN107038596A (en) * 2016-02-04 2017-08-11 希姆通信息技术(上海)有限公司 Accumulated point exchanging method and its system
CN106802840A (en) * 2017-01-19 2017-06-06 郑州云海信息技术有限公司 A kind of virtual machine backup, restoration methods and device
CN107291391A (en) * 2017-06-21 2017-10-24 郑州云海信息技术有限公司 A kind of data processing method and system for distributed memory system
CN109032762A (en) * 2018-08-09 2018-12-18 腾讯科技(深圳)有限公司 Virtual machine retrogressive method and relevant device
CN109597707A (en) * 2018-10-25 2019-04-09 平安科技(深圳)有限公司 Clone volume data copying method, device and computer readable storage medium
CN109408291A (en) * 2018-10-31 2019-03-01 郑州云海信息技术有限公司 A kind of distributed memory system disk snapshot restoration methods, device and electronic equipment

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111737223A (en) * 2020-06-28 2020-10-02 浪潮电子信息产业股份有限公司 File copying method, device, equipment and storage medium
CN111737223B (en) * 2020-06-28 2023-02-28 浪潮电子信息产业股份有限公司 File copying method, device, equipment and storage medium
CN112035833A (en) * 2020-08-21 2020-12-04 郑州信大捷安信息技术股份有限公司 File copy monitoring method and system
CN112035833B (en) * 2020-08-21 2022-02-11 郑州信大捷安信息技术股份有限公司 File copy monitoring method and system

Similar Documents

Publication Publication Date Title
CN108572823B (en) Front-end and back-end development management method and system based on interface engine
US9104511B2 (en) Method and computation node for processing application data
US10108501B2 (en) Terminal backup and recovery method
CN106445643B (en) It clones, the method and apparatus of upgrading virtual machine
CN109508178A (en) A kind of program developing method and device
CN112684982B (en) Data migration method, system, equipment and computer readable storage medium
US11455117B2 (en) Data reading method, apparatus, and system, avoiding version rollback issues in distributed system
CN105160018A (en) Method, device and system for image copy/paste
US20170277622A1 (en) Web Page Automated Testing Method and Apparatus
CN110750496A (en) File copying method, system, equipment and computer readable storage medium
CN113312336A (en) Data processing method, data processing apparatus, electronic device, storage medium, and program product
CN110321082B (en) Data clearing method and device for computer
CN104572917A (en) Method and device for locking data and distributed storage system
CN111399857A (en) FRU data burning method, system, equipment and computer storage medium
CN111130856A (en) Server configuration method, system, equipment and computer readable storage medium
CN114546823B (en) Method for reproducing debug scenario of logic system design and related equipment
CN112162699B (en) Data reading and writing method, device, equipment and computer readable storage medium
CN114817218A (en) Data verification method and system, electronic device and readable storage medium
CN109324760B (en) Disk data cloud method, system, equipment and computer storage medium
CN109740027B (en) Data exchange method, device, server and storage medium
CN109254870B (en) Data backup method and device
CN111737223A (en) File copying method, device, equipment and storage medium
CN110597828A (en) Database changing method, device, equipment and storage medium
CN110795283A (en) Cascade backup method, system, equipment and computer readable storage medium
CN110851126A (en) Method and device for configuring homemade private library on iOS platform

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
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200204