Method and device for copying mirror files in a magnetic tape and computer equipment

By dividing the magnetic tape into virtual tape sets and transferring the image files stored across tapes, the problem of low stability in traditional methods is solved, and more stable image file transfer is achieved.

CN114579527BActive Publication Date: 2025-12-23INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210241943.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-11
Publication Date
2025-12-23
Estimated Expiration
2042-03-11

AI Technical Summary

Technical Problem

Traditional methods for transferring image files on magnetic tapes suffer from low stability, especially when storing across multiple tapes, where tape contention can easily lead to transfer interruptions.

Method used

By obtaining the initial tape identifier of the image file stored across tapes, it is allocated to a virtual tape set and then transferred to the target physical tape, thus avoiding tape contention.

Benefits of technology

It improves the stability of image file transfer and avoids transfer interruptions caused by tape contention.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579527B_ABST
    Figure CN114579527B_ABST
Patent Text Reader

Abstract

The application relates to a mirroring method and device for mirror files in a magnetic tape, computer equipment, a storage medium and a computer program product, and relates to the technical field of big data. The method comprises the following steps: acquiring a set of mirror files to be migrated; if, in the set of mirror files, a first mirror file to be migrated is associated with a file identifier of a second mirror file to be migrated, acquiring a second initial magnetic tape band corresponding to the second mirror file to be migrated according to the file identifier; acquiring a first initial magnetic tape band corresponding to the first mirror file to be migrated; in the set of mirror files to be migrated, dividing the mirror files to be migrated corresponding to the first initial magnetic tape band and the mirror files to be migrated corresponding to the second initial magnetic tape band into one virtual magnetic tape in a virtual magnetic tape set, to obtain mirror files to be migrated contained in each virtual magnetic tape; and migrating the mirror files to be migrated contained in each virtual magnetic tape into a target physical magnetic tape. In this way, the stability of mirror file migration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data, and in particular, to a mirroring file transfer method and device for magnetic tapes, a computer device, a storage medium, and a computer program product. BACKGROUND

[0002] Currently, for the magnetic tapes stored in the magnetic tape library, mirroring files in the magnetic tapes need to be transferred every certain period of time (for example, 5 years) to ensure that the mirroring files have multiple copies, so as to provide redundant copies for recovery use in the extreme condition of original magnetic tape damage.

[0003] In the traditional mirroring file transfer method for magnetic tapes, because the number of initial physical magnetic tapes and mirroring files stored in the initial physical magnetic tapes involved in each transfer is large, a plurality of target physical magnetic tapes are usually provided, and a transfer channel can be formed between each target physical magnetic tape and each initial physical magnetic tape. In this way, the mirroring files to be transferred can be transferred in parallel to the plurality of target physical magnetic tapes through a plurality of different transfer channels.

[0004] However, in actual situations, some mirroring files are stored across magnetic tapes. For example, a mirroring file is divided into two mirroring segments, mirroring file n1 to be transferred and mirroring file n2 to be transferred, where mirroring file n1 to be transferred is stored in initial physical magnetic tape A, and mirroring file n2 to be transferred is stored in initial physical magnetic tape B. Initial physical magnetic tape B also stores mirroring file n3 to be transferred. In the process of parallel transfer using the traditional technology, if mirroring file n1 to be transferred in initial physical magnetic tape A is transferred to target physical magnetic tape C at the same time as mirroring file n3 to be transferred in initial physical magnetic tape B is transferred to target physical magnetic tape D, if mirroring file n1 to be transferred and mirroring file n2 to be transferred belonging to the same mirroring file and stored across magnetic tapes need to be transferred together, a situation of contention between target physical magnetic tape C and target physical magnetic tape D for initial physical magnetic tape B will occur, thereby causing the problem of transfer interruption due to magnetic tape contention.

[0005] As can be seen, using the traditional technology, the stability of mirroring file transfer is low. SUMMARY

[0006] Therefore, it is necessary to provide a mirroring file transfer method and device for magnetic tapes, a computer device, a computer readable storage medium, and a computer program product, which can improve the stability of mirroring file transfer.

[0007] In a first aspect, the present application provides a mirroring file transfer method for magnetic tapes. The method comprises:

[0008] obtaining a mirroring file set to be transferred;

[0009] if there is a file identifier associated with the second to-be-archived image file in the set of image files to be archived, acquiring a second initial tape label corresponding to the second to-be-archived image file according to the file identifier, wherein the second initial tape label is a tape label of an initial physical tape storing the second to-be-archived image file;

[0010] acquiring a first initial tape label corresponding to the first to-be-archived image file, wherein the first initial tape label is a tape label of an initial physical tape storing the first to-be-archived image file;

[0011] dividing the to-be-archived image file corresponding to the first initial tape label and the to-be-archived image file corresponding to the second initial tape label in the set of image files to be archived into one virtual tape in a set of virtual tapes, to obtain to-be-archived image files contained in each virtual tape;

[0012] archiving the to-be-archived image files contained in each virtual tape into a target physical tape corresponding to each virtual tape.

[0013] In one embodiment, before the to-be-archived image files contained in each virtual tape are archived into a target physical tape corresponding to each virtual tape, the method further comprises:

[0014] acquiring a file size of the to-be-archived image files contained in each virtual tape, and acquiring a storage capacity of each target physical tape in a plurality of preset target physical tapes;

[0015] determining a target physical tape corresponding to each virtual tape according to the file size and the storage capacity.

[0016] In one embodiment, after the target physical tape corresponding to each virtual tape is determined according to the file size and the storage capacity, the method further comprises:

[0017] acquiring a virtual tape label of each virtual tape and a target tape label of the target physical tape corresponding to each virtual tape;

[0018] generating a file archiving command carrying the virtual tape label, the target tape label, and a preset image file archiving parameter;

[0019] The to-be-archived image files contained in each virtual tape are archived into a target physical tape corresponding to each virtual tape, comprising:

[0020] According to the file migration command, the to-be-migrated image file contained in each virtual tape is migrated into a target physical tape corresponding to each virtual tape.

[0021] In one of the embodiments, the method further comprises:

[0022] Obtaining an execution feedback result generated for the file migration command;

[0023] If the execution feedback result is a result representing successful execution of the command, it is queried whether the copy number of the to-be-migrated image file has increased;

[0024] If the copy number of the to-be-migrated image file has increased, the increased copy number and the tape label corresponding to the migrated image file are updated to a preset database, wherein the increased copy number is the copy number of the migrated image file.

[0025] In one of the embodiments, the obtaining of the set of to-be-migrated image files comprises:

[0026] Obtaining a set of tape labels corresponding to the set of to-be-processed tapes;

[0027] According to each tape label in the set of tape labels, attribute information of an image file stored in each to-be-processed tape in the set of to-be-processed tapes is searched from a preset database;

[0028] According to the attribute information of the image file stored in each to-be-processed tape, it is determined whether the image file stored in each to-be-processed tape is in a migration queue;

[0029] A set of image files in the migration queue is determined as the set of to-be-migrated image files.

[0030] In one of the embodiments, the obtaining of the set of to-be-migrated image files comprises:

[0031] Obtaining a set of tape labels corresponding to the set of to-be-processed tapes;

[0032] According to the set of tape labels, it is queried whether all to-be-processed tapes in the set of to-be-processed tapes are located in a tape library;

[0033] If all to-be-processed tapes in the set of to-be-processed tapes are located in the tape library, a set of image files stored in all to-be-processed tapes in the set of to-be-processed tapes is determined as the set of to-be-migrated image files.

[0034] In one of the embodiments, the obtaining of the set of to-be-migrated image files further comprises:

[0035] If there is a to-be-processed magnetic tape that is not located in the magnetic tape library in the to-be-processed magnetic tape set, alarm information carrying a magnetic tape label of the to-be-processed magnetic tape is generated, and the alarm information is output, where the alarm information is used to indicate that the to-be-processed magnetic tape is added to the magnetic tape library according to the magnetic tape label of the to-be-processed magnetic tape.

[0036] In a second aspect, the present application further provides a mirroring file migration device for a magnetic tape. The device comprises:

[0037] a mirroring file acquisition module, configured to acquire a to-be-migrated mirroring file set;

[0038] a first tape label acquisition module, configured to, if there is a file identifier associated with a second to-be-migrated mirroring file in a first to-be-migrated mirroring file in the to-be-migrated mirroring file set, acquire a second initial magnetic tape label corresponding to the second to-be-migrated mirroring file according to the file identifier, where the second initial magnetic tape label is a magnetic tape label of an initial physical magnetic tape storing the second to-be-migrated mirroring file;

[0039] a second tape label acquisition module, configured to acquire a first initial magnetic tape label corresponding to the first to-be-migrated mirroring file, where the first initial magnetic tape label is a magnetic tape label of an initial physical magnetic tape storing the first to-be-migrated mirroring file;

[0040] a mirroring file division module, configured to, in the to-be-migrated mirroring file set, divide a to-be-migrated mirroring file corresponding to the first initial magnetic tape label and a to-be-migrated mirroring file corresponding to the second initial magnetic tape label into one virtual magnetic tape in a virtual magnetic tape set, to obtain to-be-migrated mirroring files contained in each virtual magnetic tape;

[0041] a mirroring file migration module, configured to migrate the to-be-migrated mirroring files contained in each virtual magnetic tape to a target physical magnetic tape corresponding to the virtual magnetic tape.

[0042] In a third aspect, the present application further provides a computer device. The computer device comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:

[0043] acquire a to-be-migrated mirroring file set;

[0044] if there is a file identifier associated with a second to-be-migrated mirroring file in a first to-be-migrated mirroring file in the to-be-migrated mirroring file set, acquire a second initial magnetic tape label corresponding to the second to-be-migrated mirroring file according to the file identifier, where the second initial magnetic tape label is a magnetic tape label of an initial physical magnetic tape storing the second to-be-migrated mirroring file;

[0045] obtaining a first initial tape label corresponding to the first to-be-archived image file, wherein the first initial tape label is a tape label of an initial physical tape storing the first to-be-archived image file;

[0046] In the set of to-be-archived image files, the to-be-archived image file corresponding to the first initial tape label and the to-be-archived image file corresponding to the second initial tape label are divided into one virtual tape in the set of virtual tapes, to obtain to-be-archived image files contained in each virtual tape;

[0047] The to-be-archived image files contained in each virtual tape are archived into a target physical tape corresponding to each virtual tape.

[0048] In a fourth aspect, the present application further provides a computer readable storage medium. The computer readable storage medium has a computer program stored thereon, and the computer program is executed by a processor to implement the following steps:

[0049] obtaining a set of to-be-archived image files;

[0050] If, in the set of to-be-archived image files, a first to-be-archived image file is associated with a file identifier of a second to-be-archived image file, then according to the file identifier, a second initial tape label corresponding to the second to-be-archived image file is obtained, wherein the second initial tape label is a tape label of an initial physical tape storing the second to-be-archived image file;

[0051] obtaining a first initial tape label corresponding to the first to-be-archived image file, wherein the first initial tape label is a tape label of an initial physical tape storing the first to-be-archived image file;

[0052] In the set of to-be-archived image files, the to-be-archived image file corresponding to the first initial tape label and the to-be-archived image file corresponding to the second initial tape label are divided into one virtual tape in the set of virtual tapes, to obtain to-be-archived image files contained in each virtual tape;

[0053] The to-be-archived image files contained in each virtual tape are archived into a target physical tape corresponding to each virtual tape.

[0054] In a fifth aspect, the present application further provides a computer program product. The computer program product comprises a computer program, and the computer program is executed by a processor to implement the following steps:

[0055] obtaining a set of to-be-archived image files;

[0056] If there is a file identifier associated with the second to-be-archived image file in the first to-be-archived image file in the set of to-be-archived image files, the second initial tape band corresponding to the second to-be-archived image file is obtained according to the file identifier, wherein the second initial tape band is the tape band of the initial physical tape storing the second to-be-archived image file;

[0057] The first initial tape band corresponding to the first to-be-archived image file is obtained, wherein the first initial tape band is the tape band of the initial physical tape storing the first to-be-archived image file;

[0058] In the set of to-be-archived image files, the to-be-archived image file corresponding to the first initial tape band and the to-be-archived image file corresponding to the second initial tape band are divided into one virtual tape in the set of virtual tapes, to obtain the to-be-archived image files contained in each virtual tape;

[0059] The to-be-archived image files contained in each virtual tape are archived into the target physical tape corresponding to each virtual tape.

[0060] The above-mentioned archiving method, device, computer equipment, storage medium and computer program product for image files in tapes, if there is a file identifier associated with the second to-be-archived image file in the first to-be-archived image file in the set of to-be-archived image files, it indicates that the first to-be-archived image file and the second to-be-archived image file belong to the fragments of the image files stored across tapes, then according to the file identifier, the second initial tape band corresponding to the second to-be-archived image file is obtained, and in addition, the first initial tape band corresponding to the first to-be-archived image file is obtained, then in the set of to-be-archived image files, the to-be-archived image file corresponding to the first initial tape band and the to-be-archived image file corresponding to the second initial tape band are divided into one virtual tape in the set of virtual tapes, to obtain the to-be-archived image files contained in each virtual tape, so that the first to-be-archived image file and the second to-be-archived image file belonging to the same image file stored across tapes can be divided together, so that when the to-be-archived image files contained in each virtual tape library are archived to the corresponding target physical tape, the first to-be-archived image file and the second to-be-archived image file belonging to the storage across tapes will only perform archiving operations in the archiving channel constructed by the virtual tape library and the target physical tape, and will not appear tape contention, so as to avoid the problem of archiving interruption caused by tape contention, thereby improving the stability of image file archiving. BRIEF DESCRIPTION OF DRAWINGS

[0061] Figure 1 A flowchart of the archiving method for image files in tapes in one embodiment;

[0062] Figure 2A flowchart of a supplementary scheme for acquiring a set of image files to be migrated in an embodiment;

[0063] Figure 3 A structural block diagram of a migration device for image files in a magnetic tape in an embodiment;

[0064] Figure 4 An internal structural diagram of a computer device in an embodiment. DETAILED DESCRIPTION

[0065] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0066] In an embodiment, as shown in Figure 1 , a migration method for image files in a magnetic tape is provided. In this embodiment, the method is exemplified by being applied to a terminal. It should be understood that the method can also be applied to a server, and can also be applied to a system including a terminal and a server, and can be realized through the interaction of the terminal and the server. In this embodiment, the method includes the following steps:

[0067] Step S102, acquiring a set of image files to be migrated.

[0068] The set of image files to be migrated refers to a set composed of at least one image file to be migrated.

[0069] Specifically, the terminal acquires the set of image files to be migrated.

[0070] Step S104, if there is a first image file to be migrated associated with a file identifier of a second image file to be migrated in the set of image files to be migrated, then according to the file identifier, a second initial magnetic tape barcode corresponding to the second image file to be migrated is acquired.

[0071] The second initial magnetic tape barcode is the barcode of the initial physical magnetic tape storing the second image file to be migrated.

[0072] Specifically, since the image files stored across the magnetic tapes correspond to their respective file identifiers in different magnetic tapes, such complete image files will be associated with multiple file identifiers. Based on this, if the terminal detects that the first image file to be migrated not only corresponds to a first file identifier, but also is associated with a second file identifier of the second image file to be migrated, it indicates that the first image file to be migrated and the second image file to be migrated belong to the fragments of the image files stored across the magnetic tapes. Then, the terminal acquires the second initial magnetic tape barcode corresponding to the second image file to be migrated from the preset database according to the second file identifier.

[0073] Optionally, the terminal can detect in sequence whether the to-be-archived mirror image file is associated with a file identifier of another to-be-archived mirror image file, and if yes, step S104 is executed; if no, the next to-be-archived mirror image file is detected.

[0074] In step S106, a first initial tape label corresponding to the first to-be-archived mirror image file is acquired.

[0075] The first initial tape label is a tape label of an initial physical tape storing the first to-be-archived mirror image file.

[0076] Specifically, the terminal acquires the first initial tape label corresponding to the first to-be-archived mirror image file from a preset database.

[0077] In step S108, the to-be-archived mirror image file corresponding to the first initial tape label and the to-be-archived mirror image file corresponding to the second initial tape label are divided into one virtual tape in the virtual tape set in the set of to-be-archived mirror image files, to obtain the to-be-archived mirror image files contained in each virtual tape.

[0078] Specifically, the terminal extracts the to-be-archived mirror image file corresponding to the first initial tape label and the to-be-archived mirror image file corresponding to the second initial tape label from the set of to-be-archived mirror image files. The to-be-archived mirror image file corresponding to the first initial tape label is a to-be-archived mirror image file stored in an initial physical tape corresponding to the first initial tape label. The to-be-archived mirror image file corresponding to the second initial tape label is a to-be-archived mirror image file stored in an initial physical tape corresponding to the second initial tape label.

[0079] Then, the terminal divides the to-be-archived mirror image file corresponding to the first initial tape label and the to-be-archived mirror image file corresponding to the second initial tape label into one virtual tape in the virtual tape set, that is, the to-be-archived mirror image files in the initial physical tapes involved in cross-tape storage are integrated into one virtual tape. Optionally, if the first initial tape label includes multiple first initial tape labels, the to-be-archived mirror image files corresponding to different first initial tape labels and the to-be-archived mirror image files corresponding to the second initial tape label can be divided into different virtual tapes in the virtual tape set.

[0080] For example, assuming that the first initial tape labels include D1 and D2, the second initial tape label corresponding to the first initial tape label D1 is D3, and the second initial tape label corresponding to the first initial tape label D2 is D4, the to-be- migrated mirror image file corresponding to the first initial tape label D1 and the to-be-migrated mirror image file corresponding to the second initial tape label D3 can be divided into the virtual tape T1, and the to-be-migrated mirror image file corresponding to the first initial tape label D2 and the to-be-migrated mirror image file corresponding to the second initial tape label D4 can be divided into the virtual tape T2. Of course, several groups of to-be-migrated mirror image files corresponding to different first initial tape labels and corresponding second initial tape labels can also be divided into one virtual tape in the virtual tape set. In this way, the to-be-migrated mirror image files contained in each virtual tape can be obtained.

[0081] In step S110, the to-be-migrated mirror image files contained in each virtual tape are migrated to the target physical tape corresponding to each virtual tape.

[0082] Specifically, the terminal migrates the to-be-migrated mirror image files contained in each virtual tape to the target physical tape corresponding to each virtual tape.

[0083] Subsequently, the terminal automatically queries the tape state of the initial physical tape in the preset database to determine whether the migration is completed. If the migration is completed, the migration task of the mirror image file of the initial physical tape is ended.

[0084] In the migration method of the mirror image file in the tape, if there is a file identifier associated with the second to-be-migrated mirror image file in the first to-be-migrated mirror image file in the to-be-migrated mirror image file set, it indicates that the first to-be-migrated mirror image file and the second to-be-migrated mirror image file belong to the fragments of the cross-tape storage mirror image file. According to the file identifier, the second initial tape label corresponding to the second to-be-migrated mirror image file is obtained, and the first initial tape label corresponding to the first to-be-migrated mirror image file is obtained. Then, in the to-be-migrated mirror image file set, the to-be-migrated mirror image file corresponding to the first initial tape label and the to-be-migrated mirror image file corresponding to the second initial tape label are divided into one virtual tape in the virtual tape set, to obtain the to-be-migrated mirror image file contained in each virtual tape. In this way, the first to-be-migrated mirror image file and the second to-be-migrated mirror image file belonging to the same mirror image file and stored across tapes can be divided together. Therefore, when the to-be-migrated mirror image file contained in each virtual tape library is migrated to the corresponding target physical tape, the first to-be-migrated mirror image file and the second to-be-migrated mirror image file belonging to the cross-tape storage only need to perform the migration operation in the migration channel constructed by the virtual tape library and the target physical tape, and the tape contention does not occur. Therefore, the problem of migration interruption caused by tape contention can be avoided, and the stability of the mirror image file migration is improved.

[0085] In one embodiment, before step S110, the method further comprises the following steps:

[0086] In step S1092, the file size of the image file to be migrated contained in each virtual tape is obtained, and the storage capacity of each target physical tape in the preset plurality of target physical tapes is obtained.

[0087] In step S1094, the target physical tape corresponding to each virtual tape is determined according to the file size and the storage capacity.

[0088] Specifically, the terminal obtains the file size of the image file to be migrated contained in each virtual tape, and obtains the storage capacity of each target physical tape in the preset plurality of target physical tapes. Then the terminal compares the size between the file size of the image file to be migrated contained in the current virtual tape and the storage capacity of the current target physical tape, if the file size is less than or equal to the storage capacity, the correspondence between the current virtual tape and the current target physical tape is established; if the file size is greater than the storage capacity, the size between the file size of the image file to be migrated contained in the current virtual tape and the storage capacity of the next target physical tape is compared, and so on, until all virtual tapes have corresponding target physical tapes.

[0089] In this embodiment, the correspondence between the virtual tape and the target physical tape is determined according to the size of the image file in the virtual tape and the storage capacity of the target physical tape, which can improve the stability of the image file migration.

[0090] In one embodiment, after step S1094, the method further comprises the following steps:

[0091] In step S1096, the virtual tape band label of each virtual tape and the target tape band label of the target physical tape corresponding to each virtual tape are obtained.

[0092] In step S1098, a file migration command carrying the virtual tape band label, the target tape band label and the preset image file migration parameter is generated.

[0093] Based on this, step S110 comprises the following steps:

[0094] In step S1102, according to the file migration command, the image file to be migrated contained in each virtual tape is migrated into the target physical tape corresponding to each virtual tape.

[0095] Specifically, the terminal acquires a virtual tape band label of each virtual tape, a target tape band label of a target physical tape corresponding to each virtual tape, and preset mirror file migration parameters, and generates a corresponding file migration command. It should be noted that different virtual tape band labels and target tape band labels correspond to different file migration commands. The mirror file migration parameters include a server identifier required for mirror file copying, a migration retention time, and a priority. Then, the terminal migrates the to-be-migrated mirror file contained in each virtual tape to the target physical tape corresponding to each virtual tape according to the file migration command.

[0096] For example, the to-be-migrated mirror file contained in each virtual tape can be migrated to the target physical tape corresponding to each virtual tape in parallel according to different file migration commands through the API (application programming interface, a backup software command line program) of the Veritas NBU application software.

[0097] In this embodiment, the automatic migration of the mirror file can be realized by generating the file migration command carrying the virtual tape band label, the target tape band label, and the preset mirror file migration parameters.

[0098] In one embodiment, the method further includes:

[0099] Step S112, acquiring an execution feedback result generated for the file migration command;

[0100] Step S114, if the execution feedback result is a result representing successful execution of the command, querying whether the copy number of the to-be-migrated mirror file has increased;

[0101] Step S116, if the copy number of the to-be-migrated mirror file has increased, updating the increased copy number and the tape band label of the migrated mirror file to the preset database.

[0102] The increased copy number is the copy number of the migrated mirror file.

[0103] Specifically, the terminal automatically polls the execution feedback result generated for the file migration command to confirm whether the file migration command is successfully executed. If the execution feedback result is a result representing successful execution of the command, the terminal automatically queries the latest attribute information of the mirror file, including the copy number, to determine whether the copy number of the to-be-migrated mirror file has increased. If the copy number of the to-be-migrated mirror file has increased, the terminal updates the increased copy number and the tape band label of the target physical tape where the migrated mirror file (the latest copy) is located to the preset database. If the execution feedback result is a result representing failed execution of the command, the terminal repeats the step S1102, and after multiple failed executions, sends an email alarm and skips the related tapes.

[0104] In this embodiment, by checking whether the migration is successful in time and updating the attribute information of the new image file in time, the timeliness and accuracy of the data can be ensured.

[0105] In one embodiment, as shown in FIG. 1, step S102 includes the following steps: Figure 2

[0106] Step S1022, acquiring the tape tag set corresponding to the set of magnetic tapes to be processed.

[0107] Step S1024, according to each tape tag in the tape tag set, searching the attribute information of the image file stored in each magnetic tape to be processed in the set of magnetic tapes to be processed from the preset database.

[0108] Step S1026, according to the attribute information of the image file stored in each magnetic tape to be processed, judging whether the image file stored in each magnetic tape to be processed is in the migration queue.

[0109] Step S1028, determining the image file set in the migration queue as the image file set to be migrated.

[0110] The attribute information of the image file includes one or more of the copy number of the image file, the segment number of the image file, the migration time, the migration data write time, and the migration data expiration time.

[0111] Specifically, the terminal first acquires the list of magnetic tape tags to be processed. The list includes a set of magnetic tape tags. Then, the terminal searches the attribute information of the image file stored in each magnetic tape to be processed in the set of magnetic tapes to be processed from the preset database according to each magnetic tape tag in the set of magnetic tape tags. After that, the terminal judges whether the image file stored in each magnetic tape to be processed is in the migration queue according to the attribute information of the image file stored in each magnetic tape to be processed. Finally, the terminal determines the image file set in the migration queue as the image file set to be migrated, and eliminates the image file set that is not in the migration queue, i.e., the image file set that has completed migration.

[0112] ​Exemplarily, the terminal acquires the mirror file relationship information of the magnetic tape, and according to each magnetic tape tape label, the information attributes of the magnetic tape tape label, the mirror name, the copy number, the segment number, the data backup time, the data write time, the data expiration time, the state (default is to be migrated) can be obtained, and written into the migration mirror table. Then, the data write time of the storage mirror table is checked, if the difference between the data write time and the current time is greater than 5 years, it means that the mirror file meets the migration, and the state of the migration mirror table is updated to "to be migrated", if the mirror file does not meet the migration, the state is updated to "no need to migrate" (call NBU API to obtain all the information of the mirror file according to the mirror file, if the same mirror file is found to have the latest write time, it means that this mirror file has been migrated recently), in this case, the state of the mirror file is also "no need to migrate". Then, the tape label of the migration mirror table is counted to determine whether the mirror file related to the tape label has "to be migrated", if yes, the state attribute of the tape label of the migration situation table is updated to "to be migrated". The subsequent "to be migrated" modifies the state to "queue", the terminal will call the actual migration command, and the tape label with the state of "queue" in the migration situation table will be obtained, and according to the tape label and the mirror file with the state of "tape migration", the mirror file list is pulled out to form: tape label + mirror file. For subsequent batch migration.

[0113] In the embodiment, by migrating the mirror file in the to-be-migrated state, the migration resource is saved.

[0114] In one embodiment, step S102 includes the following steps:

[0115] Step S1021, acquiring a tape label set corresponding to a to-be-processed magnetic tape set;

[0116] Step S1023, according to the tape label set, querying whether all the to-be-processed magnetic tapes in the to-be-processed magnetic tape set are located in the tape library;

[0117] Step S1025, if all the to-be-processed magnetic tapes in the to-be-processed magnetic tape set are located in the tape library, the mirror file set stored by all the to-be-processed magnetic tapes in the to-be-processed magnetic tape set is determined as the to-be-migrated mirror file set.

[0118] Specifically, the terminal first acquires a to-be-processed tape label list. The list includes a tape label set. Then, the terminal queries whether all the to-be-processed tapes in the to-be-processed tape set are located in the tape library according to the tape label set, that is, queries whether the to-be-processed tapes are located in the backup system environment or are independently retained outside the system, so as to confirm whether the to-be-processed tapes are available. If it is queried that all the to-be-processed tapes in the to-be-processed tape set are located in the tape library, it is indicated that all the to-be-processed tapes are located in the backup system environment, and thus all the to-be-processed tapes are available. Then, the terminal determines a set of image files stored in all the to-be-processed tapes in the to-be-processed tape set as a set of image files to be migrated.

[0119] For example, the query command line can be invoked by the Veritas NBU application software to query whether all the to-be-processed tapes in the to-be-processed tape set are located in the tape library.

[0120] Further, the step S102 further includes the following steps.

[0121] In step S1027, if there is a to-be-processed tape not located in the tape library in the to-be-processed tape set, alarm information carrying a tape label of the to-be-processed tape is generated, and the alarm information is output.

[0122] The alarm information is used to indicate that the to-be-processed tape is added to the tape library according to the tape label of the to-be-processed tape.

[0123] Specifically, if there is a to-be-processed tape not located in the tape library in the to-be-processed tape set, it is indicated that the to-be-processed tape is independently retained outside the system, and the to-be-processed tape is unavailable because an error will occur in copying the image during the migration process. Then, the terminal generates alarm information carrying a tape label of the to-be-processed tape, and outputs the alarm information. Optionally, the terminal outputs the alarm information in the form of an email. Then, the to-be-processed tape can be manually added to the tape library.

[0124] In this embodiment, the presence of all the tapes can be ensured by checking the presence of the tapes, which is beneficial to improving the integrity of the image file migration.

[0125] In one embodiment, the step S102 includes: acquiring a tape label set corresponding to the to-be-processed tape set; querying whether all the to-be-processed tapes in the to-be-processed tape set are located in the tape library according to the tape label set; if all the to-be-processed tapes in the to-be-processed tape set are located in the tape library, searching a preset database for attribute information of image files stored in each to-be-processed tape in the to-be-processed tape set; judging whether the image files stored in each to-be-processed tape are in a migration queue according to the attribute information of the image files stored in each to-be-processed tape; and determining a set of image files in the migration queue as the set of image files to be migrated.

[0126] In this embodiment, the physical tapes are ensured to be in place by checking the physical tapes in place, and the mirror files in the physical tapes in the standby migration state are migrated, so that the integrity of the mirror file migration is improved, and the migration resources are saved.

[0127] It should be understood that, although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.

[0128] Based on the same inventive concept, the embodiments of the present application also provide a migration device for mirror files in a tape for implementing the migration method for mirror files in a tape as described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more migration device embodiments for mirror files in a tape provided below can refer to the limitations of the migration method for mirror files in a tape described above, and will not be repeated here.

[0129] In one embodiment, as shown in Figure 3 a migration device for mirror files in a tape is provided, comprising:

[0130] The mirror file acquisition module 202 is configured to acquire a set of mirror files to be migrated.

[0131] The first tape label acquisition module 204 is configured to, if there is a file identifier associated with a second to-be-migrated mirror file in the set of to-be-migrated mirror files, acquire a second initial tape label corresponding to the second to-be-migrated mirror file according to the file identifier, wherein the second initial tape label is the tape label of the initial physical tape storing the second to-be-migrated mirror file.

[0132] The second tape label acquisition module 206 is configured to acquire a first initial tape label corresponding to the first to-be-migrated mirror file, wherein the first initial tape label is the tape label of the initial physical tape storing the first to-be-migrated mirror file.

[0133] The mirror file division module 208 is configured to divide, in the set of mirror files to be migrated, the mirror file corresponding to the first initial tape label and the mirror file corresponding to the second initial tape label into one virtual tape in the set of virtual tapes, to obtain the mirror files to be migrated contained in each virtual tape.

[0134] The mirror file migration module 210 is configured to migrate the mirror files to be migrated contained in each virtual tape into the target physical tape corresponding to each virtual tape.

[0135] In the above migration device for the mirror files in the tapes, if there is a file identifier associated with the second mirror file to be migrated in the first mirror file to be migrated in the set of mirror files to be migrated, it indicates that the first mirror file to be migrated and the second mirror file to be migrated belong to the fragments of the mirror files stored across the tapes, then the second initial tape label corresponding to the second mirror file to be migrated is obtained according to the file identifier, and the first initial tape label corresponding to the first mirror file to be migrated is obtained, and then the mirror file corresponding to the first initial tape label and the mirror file corresponding to the second initial tape label are divided into one virtual tape in the set of virtual tapes in the set of mirror files to be migrated, to obtain the mirror files to be migrated contained in each virtual tape. In this way, the first mirror file to be migrated and the second mirror file to be migrated belonging to the same mirror file and stored across the tapes can be divided together, so that when the mirror files to be migrated contained in each virtual tape library are migrated to the corresponding target physical tape, the first mirror file to be migrated and the second mirror file to be migrated belonging to the cross-tape storage only need to be migrated in the migration channel constructed by the virtual tape library and the target physical tape, and the tape contention does not occur, so that the problem of migration interruption caused by the tape contention can be avoided, thereby improving the stability of the mirror file migration.

[0136] In one embodiment, the device further comprises:

[0137] The tape determination module is configured to obtain the file size of the mirror files to be migrated contained in each virtual tape, and obtain the storage capacity of each target physical tape in the plurality of target physical tapes; and determine the target physical tape corresponding to each virtual tape according to the file size and the storage capacity.

[0138] In one embodiment, the mirror file migration module 210 is specifically configured to migrate the mirror files to be migrated contained in each virtual tape into the target physical tape corresponding to each virtual tape according to the file migration command.

[0139] In one embodiment, the mirror file obtaining module 202 is specifically configured to obtain a tape tag set corresponding to the set of tapes to be processed; find attribute information of the mirror files stored in each tape to be processed in the set of tapes to be processed from a preset database according to each tape tag in the tape tag set; determine whether the mirror files stored in each tape to be processed are in the migration queue according to the attribute information of the mirror files stored in each tape to be processed; and determine the set of mirror files in the migration queue as the set of mirror files to be migrated.

[0140] In one embodiment, the mirror file obtaining module 202 is specifically configured to obtain a tape tag set corresponding to the set of tapes to be processed; query whether all the tapes to be processed in the set of tapes to be processed are located in the tape library according to the tape tag set; if all the tapes to be processed in the set of tapes to be processed are located in the tape library, determine the set of mirror files stored in all the tapes to be processed in the set of tapes to be processed as the set of mirror files to be migrated.

[0141] In one embodiment, the mirror file obtaining module 202 is specifically configured to, if there is a tape to be processed that is not located in the tape library in the set of tapes to be processed, generate alarm information carrying a tape tag of the tape to be processed, and output the alarm information, wherein the alarm information is used to indicate that the tape to be processed is added to the tape library according to the tape tag of the tape to be processed.

[0142] The above various modules in the migration device for the mirror files in the tapes can be realized by software, hardware, and combinations thereof, in whole or in part. The above various modules can be embedded in or independent of a processor in a computer device in a hardware form, or can be stored in a memory in the computer device in a software form, so as to be called and executed by a processor to perform operations corresponding to the above various modules.

[0143] In one embodiment, a computer device is provided, which can be a terminal, and an internal structure diagram of the computer device can be as shown in Figure 4As shown in the figure. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through WIFI, mobile cellular network, NFC (near field communication) or other technologies. The computer program is executed by the processor to implement a mirroring file migration method in a magnetic tape. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer overlaid on the display screen, or a key, trackball or touchpad arranged on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0144] Those skilled in the art can understand that, Figure 4 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. A specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0145] In one embodiment, a computer device is also provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps in the above method embodiments.

[0146] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps in the above method embodiments.

[0147] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by a processor to implement the steps in the above method embodiments.

[0148] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.

[0149] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (Read-Only Memory, ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (Magnetoresistive Random Access Memory, MRAM), ferroelectric memory (Ferroelectric Random Access Memory, FRAM), phase change memory (Phase Change Memory, PCM), graphene memory, etc. Volatile memory can include random access memory (Random Access Memory, RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (Static Random Access Memory, SRAM) or dynamic random access memory (Dynamic Random Access Memory, DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.

[0150] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist contradictory, it should be considered as the scope of the present application.

[0151] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are within the scope of protection of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A method for migrating a mirror image file in a magnetic tape, characterized by, The method comprises: acquiring a set of image files to be migrated; if, in the set of image files to be migrated, there is a first image file to be migrated associated with a file identifier of a second image file to be migrated, acquiring a second initial tape label corresponding to the second image file to be migrated according to the file identifier, wherein the second initial tape label is a tape label of an initial physical tape storing the second image file to be migrated; acquiring a first initial tape label corresponding to the first image file to be migrated, wherein the first initial tape label is a tape label of an initial physical tape storing the first image file to be migrated; in the set of image files to be migrated, dividing the image files to be migrated corresponding to the first initial tape label and the image files to be migrated corresponding to the second initial tape label into one virtual tape in a set of virtual tapes, to obtain image files to be migrated contained in each virtual tape; migrating the image files to be migrated contained in each virtual tape to a target physical tape corresponding to each virtual tape; the acquiring of the set of image files to be migrated comprises: acquiring a set of tape labels corresponding to a set of tapes to be processed; inquiring whether all the tapes to be processed in the set of tapes to be processed are located in a tape library according to the set of tape labels; if all the tapes to be processed in the set of tapes to be processed are located in the tape library, finding attribute information of image files stored in each tape to be processed in the set of tapes to be processed from a preset database; judging whether the image files stored in each tape to be processed are in a migration queue according to the attribute information of the image files stored in each tape to be processed; determining a set of image files in the migration queue as the set of image files to be migrated.

2. The method of claim 1, wherein, Before the migrating of the image files to be migrated contained in each virtual tape to a target physical tape corresponding to each virtual tape, the method further comprises: acquiring a file size of the image files to be migrated contained in each virtual tape, and acquiring a storage capacity of each target physical tape in a plurality of preset target physical tapes; determining a target physical tape corresponding to each virtual tape according to the file size and the storage capacity.

3. The method of claim 2, wherein, After the determining of the target physical tape corresponding to each virtual tape according to the file size and the storage capacity, the method further comprises: acquiring a virtual tape label of each virtual tape and a target tape label of the target physical tape corresponding to each virtual tape; generating a file migration command carrying the virtual tape label, the target tape label and a preset image file migration parameter; the migrating of the image files to be migrated contained in each virtual tape to the target physical tape corresponding to each virtual tape comprises: migrating the image files to be migrated contained in each virtual tape to the target physical tape corresponding to each virtual tape according to the file migration command.

4. The method of claim 3, wherein, The method further comprises: acquiring an execution feedback result generated for the file migration command; If the execution feedback result is a result representing successful execution of a command, it is inquired whether the copy number of the image file to be migrated has increased; If the copy number of the image file to be migrated has increased, the increased copy number and the tape label corresponding to the migrated image file are updated into a preset database, wherein the increased copy number is the copy number of the migrated image file.

5. The method of claim 1, wherein, The image file acquisition module is specifically configured to acquire a tape label set corresponding to the set of tapes to be processed; inquire whether all the tapes to be processed in the set of tapes to be processed are located in a tape library according to the tape label set; if all the tapes to be processed in the set of tapes to be processed are located in the tape library, find attribute information of image files stored in each tape to be processed in the set of tapes to be processed from a preset database; determine whether the image files stored in each tape to be processed are in a migration queue according to the attribute information of the image files stored in each tape to be processed; and determine a set of image files in the migration queue as the set of image files to be migrated. The device comprises:

6. A migration apparatus for mirror images in a magnetic tape, characterized by, An image file acquisition module, configured to acquire a set of image files to be migrated; A first tape label acquisition module, configured to, if there is a second image file to be migrated associated with a file identifier of a first image file to be migrated in the set of image files to be migrated, acquire a second initial tape label corresponding to the second image file to be migrated according to the file identifier, wherein the second initial tape label is a tape label of an initial physical tape storing the second image file to be migrated; A second tape label acquisition module, configured to acquire a first initial tape label corresponding to the first image file to be migrated, wherein the first initial tape label is a tape label of an initial physical tape storing the first image file to be migrated; An image file division module, configured to, in the set of image files to be migrated, divide the image file to be migrated corresponding to the first initial tape label and the image file to be migrated corresponding to the second initial tape label into one virtual tape in a set of virtual tapes, to obtain image files to be migrated contained by each virtual tape; An image file migration module, configured to migrate the image files to be migrated contained by each virtual tape into a target physical tape corresponding to each virtual tape; The image file acquisition module is specifically configured to acquire a tape label set corresponding to the set of tapes to be processed; inquire whether all the tapes to be processed in the set of tapes to be processed are located in a tape library according to the tape label set; if all the tapes to be processed in the set of tapes to be processed are located in the tape library, find attribute information of image files stored in each tape to be processed in the set of tapes to be processed from a preset database; determine whether the image files stored in each tape to be processed are in a migration queue according to the attribute information of the image files stored in each tape to be processed; and determine a set of image files in the migration queue as the set of image files to be migrated. The processor executes the computer program to implement the steps of the method in any one of claims 1 to 5. 7.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-6. The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.

8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 5.

9. A computer program product comprising a computer program, characterized in that, ​

Citation Information

Patent Citations

  • Mirror image storage method and device and computer readable storage medium

    CN110019013A

  • Resource competition method and device, electronic equipment and computer readable storage medium

    CN112379957A