Magnetic tape data processing method, apparatus, and program product

By creating logical storage channels and scheduling queues for the business tasks of the tape library, the task delay problem caused by the exclusivity of tape drives was solved, multi-task concurrent writing was realized, and tape data processing efficiency was improved.

CN121029494BActive Publication Date: 2026-07-21广州鼎甲计算机科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
广州鼎甲计算机科技有限公司
Filing Date
2025-08-26
Publication Date
2026-07-21

AI Technical Summary

Technical Problem

In existing technologies, the physical exclusivity of tape drives in tape libraries leads to latency and timeout failures during multi-task access, increasing hardware costs and system complexity, and resulting in low data storage efficiency.

Method used

By creating logical storage channels for multiple business tasks, forming a scheduling queue, and allocating tape drive usage rights sequentially, while limiting the number of data blocks written each time, a time-sharing concurrent mode is achieved.

Benefits of technology

It improves tape data processing efficiency, prevents a single large data task from occupying the tape drive for a long time, and enables concurrent writing of multiple tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121029494B_ABST
    Figure CN121029494B_ABST
Patent Text Reader

Abstract

The application relates to a magnetic tape data processing method, device and computer program product, relates to the technical field of data storage, and can improve the processing efficiency of magnetic tape data. The method comprises the following steps: in response to data write requests from a plurality of business tasks, corresponding logical storage channels are respectively created for the plurality of business tasks; in response to a magnetic tape drive use request of a business task, the logical storage channel corresponding to the business task is added to a scheduling queue of the magnetic tape drive; the logical storage channels in the scheduling queue are sequentially selected, and the use right of the magnetic tape drive is distributed to a target business task corresponding to each selected logical storage channel; the use right is released after at least one data block of the current target business task is written to the magnetic tape without exceeding a quantity threshold, and the use right is continuously distributed to a target business task corresponding to a next selected logical storage channel.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data storage technology, and in particular to a magnetic tape data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product. Background Technology

[0002] With the development of big data storage, tape libraries have become the core carrier for long-term data backup and archiving due to their extremely low unit storage cost, storage life of more than 30 years, and superior energy efficiency.

[0003] However, because magnetic tape is a sequential access medium, a single tape drive can only be used exclusively by one task at a time—a physical exclusivity. When multiple tasks need to access it, they must queue sequentially, causing task delays or even timeouts. Existing technologies typically address concurrency by adding disk write caches, but this undoubtedly increases additional hardware costs and system complexity, resulting in persistently low data storage efficiency. Summary of the Invention

[0004] Therefore, it is necessary to provide a magnetic tape data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0005] In a first aspect, this application provides a magnetic tape data processing method, including:

[0006] In response to data write requests from multiple business tasks, corresponding logical storage channels are created for each of the multiple business tasks.

[0007] In response to the tape drive usage request of the business task, the logical storage channel corresponding to the business task is added to the tape drive's scheduling queue; the tape drive usage request is issued when the business task requests to write data blocks to the tape.

[0008] Logical storage channels in the scheduling queue are selected sequentially, and the right to use the tape drive is allocated to the target service task corresponding to each selected logical storage channel. The right to use the tape drive is released after at least one data block of the current target service task (not exceeding a certain number threshold) is written to the tape, and is then allocated to the target service task corresponding to the next selected logical storage channel.

[0009] In one embodiment, after creating corresponding logical storage channels for the plurality of business tasks, the method further includes:

[0010] Obtain the logical channel identifier corresponding to each of the logical storage channels; the logical channel identifier indicates the file identifier of the file to which the data block requested to be written by the business task belongs, and the tape identifier of the tape to which the data block is to be written;

[0011] In response to the file read request of the business task, a target logical channel identifier containing the file identifier is determined based on the file identifier carried in the file read request;

[0012] Based on the tape identifier indicated by the target logical channel identifier, the data block in the tape belonging to the file to be read is determined for the business task to read.

[0013] In one embodiment, before determining the target logical channel identifier containing the file identifier based on the file identifier carried in the file read request, the method further includes:

[0014] Obtain the tape write position of the data block, as well as the size information and corresponding file offset information of the data block;

[0015] Obtain the logical storage channel identifier corresponding to the logical storage channel used when writing the data block;

[0016] Based on the tape write position, the size information, the file offset information, and the logical storage channel identifier, the metadata information of the current data block is determined and saved, so that the data can be read based on the metadata.

[0017] In one embodiment, determining the data block in the tape belonging to the file to be read, based on the tape identifier indicated by the target logical channel identifier, for the service task to read, includes:

[0018] Based on the tape identifier indicated by one or more logical channel identifiers corresponding to the business task, determine one or more tapes for storing the data of the business task;

[0019] Based on the pre-saved file offset information of the business task, the order of each data block corresponding to the business task on the one or more magnetic tapes in the file to be read is determined; the file offset information indicates the position of the data block in the file to be read.

[0020] Obtain the tape write position and size information of each data block on the one or more tapes corresponding to the business task, so that the business task reads the data block belonging to the file to be read according to the tape write position, size information and the order of the data blocks.

[0021] In one embodiment, after sequentially selecting logical storage channels in the scheduling queue and allocating the right to use the tape drive to the target service task corresponding to each selected logical storage channel, the method further includes:

[0022] The tape drive information corresponding to the tape drive and the first tape information of the tape are sent to the target service task, so that the target service task, based on the tape drive information, determines that access to the tape drive is permitted, obtains the second tape information provided by the tape drive, and when the first tape information matches the second tape information, the target service task controls the tape drive to write the data block to the tape.

[0023] If the target service task is not allowed to access the tape drive, when it is determined that the first tape information matches the second tape information, the data block sent by the target service task is obtained, and the tape drive is controlled to write the data block to the tape.

[0024] In one embodiment, before creating corresponding logical storage channels for each of the multiple business tasks in response to data write requests from multiple business tasks, the method further includes:

[0025] Obtain the status information of the tape drive and the tape;

[0026] If the status information indicates that the tape loaded by the tape drive meets the preset format, the metadata information of the tape is verified with the pre-saved metadata information to obtain a verification result. If the verification result indicates that the data is normal, the tape drive is controlled to write or read the data of the business task on the tape.

[0027] If the status information indicates that the tape loaded on the tape drive does not meet the preset format, then the tape drive is deactivated or the tape is unloaded.

[0028] In one embodiment, the business task corresponds to multiple logical storage channels; the multiple logical storage channels correspond to at least one data block of the business task;

[0029] The step of adding the logical storage channel corresponding to the business task to the scheduling queue of at least one tape drive in response to the tape drive usage request of the business task includes:

[0030] In response to the tape drive usage request of the business task, the plurality of logical storage channels corresponding to the business task are added to the respective scheduling queues of the plurality of tape drives;

[0031] The method further includes:

[0032] If any logical storage channel corresponding to the business task is selected, the logical storage channel of the target business task in the scheduling queue of other tape drives is removed, and the data block corresponding to any logical storage channel is written to the tape.

[0033] In one embodiment, after any logical storage channel corresponding to the business task is selected, the method further includes:

[0034] Control the tape drive to write at least one data block of the target business task onto the tape;

[0035] After at least one data block of the target business task is written to the tape, the plurality of logical storage channels are re-added to the scheduling queue of the tape drive.

[0036] Secondly, this application also provides a magnetic tape data processing apparatus, comprising:

[0037] The logical channel partitioning module is used to respond to data write requests from multiple business tasks and create corresponding logical storage channels for each of the multiple business tasks.

[0038] The task queue scheduling module is used to add the logical storage channel corresponding to the business task to the scheduling queue of the tape drive in response to the tape drive usage request of the business task; the tape drive usage request is issued when the business task requests to write data blocks to the tape.

[0039] The usage right allocation module is used to sequentially select logical storage channels in the scheduling queue and allocate the usage right of the tape drive to the target business task corresponding to each selected logical storage channel; the usage right is released after at least one data block of the current target business task is written to the tape and no more than a number threshold, and is then allocated to the target business task corresponding to the next selected logical storage channel.

[0040] Thirdly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps:

[0041] In response to data write requests from multiple business tasks, corresponding logical storage channels are created for each of the multiple business tasks.

[0042] In response to the tape drive usage request of the business task, the logical storage channel corresponding to the business task is added to the tape drive's scheduling queue; the tape drive usage request is issued when the business task requests to write data blocks to the tape.

[0043] Logical storage channels in the scheduling queue are selected sequentially, and the right to use the tape drive is allocated to the target service task corresponding to each selected logical storage channel. The right to use the tape drive is released after at least one data block of the current target service task (not exceeding a certain number threshold) is written to the tape, and is then allocated to the target service task corresponding to the next selected logical storage channel.

[0044] The aforementioned tape data processing method, apparatus, computer device, computer-readable storage medium, and computer program product, in response to data write requests from multiple business tasks, create corresponding logical storage channels for each business task; in response to tape drive usage requests from business tasks, add the logical storage channel corresponding to the business task to the tape drive's scheduling queue; the tape drive usage request is issued when a business task requests to write data blocks to the tape; logical storage channels in the scheduling queue are selected sequentially, and the right to use the tape drive is allocated to the target business task corresponding to each selected logical storage channel; the right to use is released after at least one data block of the current target business task (not exceeding a certain threshold) is written to the tape, and is then allocated to the next selected logical storage channel's target business task. In this application, by creating an independent logical storage channel for each business task, concurrent data requests are isolated and normalized at the logical level. Then, by adding the task channel requesting writing to a unified scheduling queue, orderly management of physical tape drive access rights is achieved. By allocating usage rights in a rotating manner and limiting each write to no more than a threshold of data blocks, this method transforms the traditional tape exclusive mode into a time-sharing concurrent mode. By preventing any single large-scale data task from monopolizing the tape drive for an extended period, it enables multiple business tasks to be written concurrently on a macro level, thereby improving tape data processing efficiency. Attached Figure Description

[0045] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0046] Figure 1 This is an application environment diagram of a magnetic tape data processing method in one embodiment;

[0047] Figure 2 This is a schematic diagram of the task manager structure in one embodiment;

[0048] Figure 3This is a flowchart illustrating a magnetic tape data processing method in one embodiment;

[0049] Figure 4 This is a schematic diagram of the partitioning of magnetic tape storage in one embodiment;

[0050] Figure 5 This is a schematic diagram of the tape initialization process in one embodiment;

[0051] Figure 6 This is a schematic diagram illustrating the division of logical storage channels in one embodiment;

[0052] Figure 7 This is a flowchart illustrating a data writing method in one embodiment;

[0053] Figure 8 This is a flowchart illustrating a data reading method in one embodiment;

[0054] Figure 9 This is a structural block diagram of a magnetic tape data processing device in one embodiment;

[0055] Figure 10 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0056] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0057] The terms "comprising" and "having," and any variations thereof, as used in this application, are intended to cover non-exclusive inclusion. The term "multiple" as used in this application refers to two or more. The term "and / or" as used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0058] The magnetic tape data processing method provided in this application embodiment can be applied to, for example... Figure 1 The application environment shown may include at least one media server, multiple task clients, and one or more tape libraries consisting of tape drives. Task clients may be physical servers or virtual machines running data backup software, archiving software, or other applications requiring large-scale data storage. They are responsible for generating or providing data to be written and interacting with the media server via control signaling over the internal network.

[0059] In some deployment scenarios, business task clients can also directly access tape drives for data transfer. The media server is used to manage tape drive resources and tape media resources; receive and process access requests from business task clients, such as file open, close, and drive usage requests; perform resource scheduling, dynamically allocating drives among tasks; and manage tape metadata information.

[0060] In one embodiment, such as Figure 2 As shown, the media server specifically includes a tape resource management module, which manages the accessed tape resources, including tape drive resources and tape resources. Drive resources need to record management information for each drive, including the drive's manufacturer, model, fault status, read / write mode, parameter configuration, loaded tape identifier, and logs, statistics, and alarms during use. Tape resources need to record tape identification information and their location in the tape library. A metadata management module manages the metadata of used tapes. Tape metadata includes two parts: the tape's own metadata information, including but not limited to the tape's barcode, assigned tag, specifications, number of files written, and data volume; and metadata of the data written to the tape, including but not limited to file names, write time, channel identifiers, segment lists, and the starting position of each segment on the tape (Logic object id). A task management module manages information about each task accessing the tape library, including client connection information, access mode, currently accessed files, and channel lists. A scheduling processing module creates a scheduling queue for each drive and dynamically schedules drives among various business tasks based on the status and requests of the business tasks.

[0061] In one embodiment, a tape library may include one or more tape drives and a large number of tape media, serving as the final storage destination for data.

[0062] In one exemplary embodiment, such as Figure 3 As shown, a magnetic tape data processing method is provided, which is applied to... Figure 1 Taking a media server as an example, the explanation includes the following steps S302 to S306. Wherein:

[0063] Step S302: In response to data write requests from multiple business tasks, create corresponding logical storage channels for each of the multiple business tasks.

[0064] Among them, the business task can be a data set processing task indicated by the client, such as a database backup, a batch of image files archive, etc., corresponding to one or more raw files or data streams to be written, initiated by the client application and tracked and managed by the media server throughout the entire data writing lifecycle.

[0065] A logical storage channel can be a data object or record in the memory of a media server. This object encapsulates the information required to identify a write operation, such as the associated file ID and the barcode of the target tape. It is used to decouple upper-layer business tasks from the underlying physical drive and is the basic scheduling unit for implementing time-division multiplexing of resources. When this logical storage channel is created, it means that the media server has officially accepted a write task and assigned it an internal logical handle. Subsequent resource requests for this task will carry this channel information.

[0066] Specifically, when one or more business task clients need to write data to the tape, they can send a request to the media server to open a file or create a write task. Upon receiving the write request, the media server can perform permission verification and resource assessment. If the verification is successful, the media server can create a new task instance for the business task and generate one or more logical storage channels for it. The generated logical channel information can then be returned to the corresponding business task client for use in subsequent steps.

[0067] Optionally, the number of logical storage channels created by the media server for a single data write request can vary depending on different strategies. For files of normal size or tasks with low write performance requirements, the media server may create only one logical storage channel. This channel can be associated with a tape with sufficient available space, and data blocks will be queued sequentially through this single channel to await writing. For extremely large files (e.g., petabyte-scale) or tasks with extremely high write performance requirements, the media server may create multiple logical storage channels at once. For example, a channel group containing three sub-channels can be created, with these three logical channels associated with three different tapes located on different physical drives in the tape library. In this way, the task can subsequently submit the segmented data blocks to these three channels simultaneously for queuing, achieving parallel writing from a single file to multiple tapes, thereby improving write efficiency.

[0068] Step S304: In response to the tape drive usage request of the business task, add the logical storage channel corresponding to the business task to the tape drive's scheduling queue; the tape drive usage request is issued when the business task requests to write data blocks to the tape.

[0069] The tape drive usage request, distinct from the data write request in step S302, is a resource allocation trigger signal issued by the business task client after preparing a standard data unit. It is used to notify the media server that the data is ready and can be written to the physical drive resource. The payload of this request is the logical storage channel identifier of the logical storage channel obtained in the previous step, so that the media server can associate it with the correct task and target tape.

[0070] A data block is an atomic unit for data transmission and writing. It can be a Standard Data Block (SDB). Dividing the data stream into standardized data blocks is the basis for implementing time-division multiplexing, which makes the time occupied by the driver short and predictable.

[0071] A scheduling queue is a data structure maintained independently in memory by a media server for each managed physical tape drive. The queue stores identifiers of logical storage channels that are currently waiting in line. It is used to serialize usage requests for the same drive from multiple different tasks to resolve resource contention issues and ensure that the current task is accessing the drive.

[0072] For example, after obtaining the logical storage channel identifier, the business task client can allocate a buffer locally (which could be the client's memory or a local cache disk) and begin reading data from the data source to fill the buffer. When the amount of data accumulated in the buffer reaches a preset standardized data block size, the business task client can send a tape drive usage request to the media server. This request explicitly carries the logical storage channel identifier that needs to be queued. Upon receiving the request, the media server first queries its internal metadata based on the logical storage channel identifier in the request to determine the target tape associated with the channel and the physical drive where the tape is currently located. Subsequently, the media server can add the logical storage channel identifier to the scheduling queue corresponding to the physical drive, putting it into a queuing waiting state.

[0073] Alternatively, the scheduling queue can be implemented in several ways:

[0074] In a simplified implementation, the media server maintains a standard first-in, first-out queue for each drive. Newly arriving logical storage channel identifiers can be directly appended to the end of the queue. This approach is simple to implement and guarantees basic fairness.

[0075] In complex scenarios with higher service quality requirements, media servers can employ more advanced multi-level feedback queue algorithms. For example, three priority queues can be set up: high, medium, and low. New requests first enter the high-priority queue; if a task needs to be re-queued after completion for some reason (such as excessive write time), it can be degraded to the medium-priority queue. This approach effectively balances urgent short tasks with time-consuming background tasks, preventing long tasks from blocking the entire system.

[0076] Step S306: Select logical storage channels in the scheduling queue in sequence, and allocate the right to use the tape drive to the target business task corresponding to each selected logical storage channel; the right to use is released after at least one data block of the current target business task is written to the tape and no more than the number threshold, and is then allocated to the target business task corresponding to the next selected logical storage channel.

[0077] In the resource management module of a media server, usage rights can be represented by a status identifier, such as updating the status of a drive object from idle to occupied and recording the logical storage channel ID currently occupying it. Specifically, allocating usage rights means that the media server sends a notification to the client that writing is permitted; while releasing usage rights means that the client notifies the server that the write is complete, and the server then releases the lock on the drive, making it available for the next task. This is used to ensure data consistency and atomicity of operations in a concurrent environment, ensuring that at any given time, only one business task can perform write or read operations on the specified physical tape drive, thus preventing data corruption and access conflicts.

[0078] For example, the scheduling module inside the media server can continuously monitor the status of each tape drive it manages. When it detects that a drive has become idle (e.g., the previous task has released its usage rights) and the scheduling queue corresponding to that drive is not empty, the scheduling module can sequentially select the next logical storage channel from the scheduling queue. In one embodiment, to ensure fairness among different business tasks, the media server can adopt a task-based round-robin strategy. In this case, the scheduler will not simply dequeue requests in the order they arrive, but can maintain a round-robin list of business tasks (e.g., task A -> task B -> task C -> task A...). When a selection is needed, it can search the queue for the first logical storage channel belonging to the current round of tasks, according to the order of this list. This approach can effectively prevent a task with a large number of data blocks from monopolizing the drive for a long time, avoiding starvation of other tasks.

[0079] After selecting a logical storage channel, the media server can mark the corresponding drive as occupied and grant usage rights to the business task client belonging to that channel, notifying it that it can begin writing. Once granted usage rights, the business task client writes one or more data blocks, not exceeding a preset threshold number, to the tape. This threshold number can be a configurable parameter. For example, to achieve the finest-grained task interleaving to ensure task response speed, this threshold can be set to 1. In scenarios where maximum throughput per task is prioritized, this threshold can be appropriately increased (e.g., set to 4 or 8) to reduce the overhead of task switching.

[0080] Once the client completes writing the current data block, it can send a confirmation message to the media server. Upon receiving the confirmation, the media server releases the usage rights and resets the drive status to idle. With the drive idle, the scheduling module immediately repeats the above selection process, retrieving the next logical storage channel from the queue and continuing to allocate usage rights, thus forming a closed loop that processes multiple tasks until the queue is empty.

[0081] In this embodiment, by creating an independent logical storage channel for each business task, concurrent data requests are isolated and normalized at the logical level. Next, by adding the task channels requesting writes to a unified scheduling queue, orderly management of access rights to the physical tape drive is achieved. By allocating usage rights in a round-robin fashion and limiting each write to no more than a threshold of data blocks, this method transforms the traditional tape-exclusive mode into a time-sharing concurrent mode. By preventing any single large-volume task from monopolizing the tape drive for an extended period, it enables concurrent writing of multiple business tasks at a macroscopic level, thereby improving tape data processing efficiency.

[0082] In an exemplary embodiment, after creating corresponding logical storage channels for multiple business tasks, the method further includes:

[0083] Obtain the logical channel identifier corresponding to each logical storage channel; the logical channel identifier indicates the file identifier of the file to which the data block requested by the business task belongs, and the tape identifier of the tape to which the data block is to be written; in response to the file read request of the business task, determine the target logical channel identifier containing the file identifier according to the file identifier carried in the file read request; determine the data block in the tape belonging to the file to be read according to the tape identifier indicated by the target logical channel identifier, so that the business task can read it.

[0084] A file read request can be an operation instruction initiated by a client application to access an archived file, and the request is used to indicate the file identifier of the file to be read.

[0085] For example, during the creation of a logical storage channel, the media server constructs a unique logical channel identifier for it. This identifier explicitly includes the identifier of the target tape and the identifier of the file to be written. This constructed identifier can be recorded in the media server's metadata management module. When data needs to be read, the business task client can initiate a file read request to the media server. After receiving the request, the media server can search its metadata module based on the filename carried in the request to determine one or more target logical channel identifiers associated with that file.

[0086] Subsequently, by parsing these logical channel identifiers, the media server can obtain the identifiers of the relevant tapes storing the file's data. Based on these tape identifiers, the media server can further query more detailed metadata, ultimately determining the precise physical locations of the data blocks constituting the file on each tape, providing a clear data storage route for subsequent physical read operations.

[0087] In this embodiment, a logical storage channel identifier containing a file identifier and a tape identifier is created for the logical channel when writing data. When a user requests to read a file, this logical storage channel identifier can be used to quickly and accurately locate one or more physical tapes storing the file data and ultimately determine the specific location of the relevant data blocks. This ensures that even if the data is stored in a scattered manner, it can always be read and recovered completely.

[0088] In an exemplary embodiment, before determining the target logical channel identifier containing the file identifier based on the file identifier carried in the file read request, the method further includes:

[0089] Obtain the tape write position, size, and corresponding file offset information of the data block; obtain the logical storage channel identifier corresponding to the logical storage channel used when writing the data block; determine and save the metadata information of the current data block based on the tape write position, size, file offset, and logical storage channel identifier, so as to read the data based on the metadata.

[0090] Specifically, after a business task successfully writes a data block to tape, the media server can initiate a metadata generation and storage process. In this process, the media server first collects the necessary information related to the write operation. Specifically, it can obtain the precise physical storage location of the data block on the tape (i.e., the tape write location) returned by the tape drive, and also record the exact size of the data block and its file offset information in the original file. Simultaneously, the media server can also obtain the logical storage channel identifier corresponding to the logical storage channel used in this write operation.

[0091] After gathering the above information, the media server integrates and encapsulates this information (tape write location, size, file offset, channel identifier) ​​into a structured metadata record for the data block. Finally, the media server saves this newly generated metadata record to its metadata management module, thus completing the archiving of the physical location of the data block for subsequent data retrieval requests.

[0092] In some embodiments, to achieve structured storage and fast retrieval of data, the aforementioned metadata information and data block information are stored together on the written magnetic tape, divided into two logically independent partitions, such as... Figure 4 As shown, there is a metadata partition and a data partition. The metadata partition, located at the beginning of the tape, functions as an index or directory of the entire tape's contents. As illustrated, this partition stores metadata records for multiple files (such as file 1 metadata, file n metadata, etc.). Specifically, each file's metadata record contains not only basic information about the file (e.g., filename, creation time, file size) but also a detailed list of the data blocks that make up the file (e.g., data block -n-1, data block -n-2... data block -nn included under file n metadata). Each item in this list contains a pointer or address information pointing to the physical storage location of its corresponding data block within the data partition (as indicated by the arrows in the figure), such as a Logical Object ID. The data partition stores standardized, encapsulated actual business data; these data units are called Standardized Data Blocks (SDBs). In some embodiments, the data blocks within the data partition are not stored contiguously as files but rather exhibit interleaved storage characteristics. For example, the diagram may store a data block (data block-xn) from file x, followed by multiple data blocks (data block-1-1, data block-1-2...) from file 1, thus enabling time-division multiplexing of write or read operations for multitasking.

[0093] In some embodiments, when reading files, files and tapes are indexed using metadata on a media server. The metadata on the media server can be stored using files or a database; this data is susceptible to loss due to hardware failure, accidental data entry, or other reasons. When the media server's metadata fails, it can be reconstructed by reading the metadata partitions from the used tapes.

[0094] In some embodiments, the internal structure of the stored Standardized Data Block (SDB) is as follows: Figure 4As shown on the right, each independent Standardized Data Block (SDB) consists of a header and a data portion. The header area stores the data block's metadata, such as its logical offset and checksum in the original file. The data portion contains the actual business data payload. Furthermore, to clearly define the boundaries of each data block on sequential media like magnetic tape, two adjacent SDBs can be isolated and distinguished using a file mark.

[0095] In this embodiment, by capturing and saving detailed metadata for each data block in real time during data writing, the instantaneous write behavior is transformed into persistent and queryable structured information. This allows a detailed data map to be pre-built during the data writing phase, rather than passively scanning and discovering during reading, providing a basic data foundation for the reading process and ensuring the recoverability and integrity of data in the interleaved storage mode from the source.

[0096] In an exemplary embodiment, determining data blocks in the tape belonging to the file to be read, based on the tape identifier indicated by the target logical channel identifier, for read by the business task, includes:

[0097] Based on the tape identifier indicated by one or more logical channel identifiers corresponding to the business task, determine one or more tapes for storing the data of the business task;

[0098] Based on the pre-saved file offset information of the business task, the order of each data block of the corresponding business task on one or more tapes in the file to be read is determined; the file offset information indicates the position of the data block in the file to be read.

[0099] Obtain the tape write position and size information of each data block corresponding to a business task on one or more tapes, so that the business task can read the data blocks belonging to the file to be read according to the tape write position, size information and data block order.

[0100] The data block order can be the sorting of related data blocks that make up a logical file according to their logical positions (i.e., file offsets) in the original file. Since data writing is interleaved, and the physical order of data blocks on the tape is completely different from their logical order in the file, they must be rearranged according to this data block order during reading to ensure that the recovered file is completely identical to the original file at the byte level.

[0101] Specifically, after a client requests to read a file, the media server first determines the physical tapes. Having already obtained the logical channel identifiers associated with the file, the media server can parse each logical channel identifier and extract the tape identifier it points to. By aggregating the unique tape identifiers, the media server determines a complete list of one or more physical tapes needed to store all the segmented data of the file.

[0102] Once the relevant tape has been identified, the media server can collect the metadata records of the data blocks belonging to that file from its metadata management module. Based on the collected metadata, the media server can sort the data blocks strictly according to their file offset values ​​from smallest to largest, resulting in a sorted list of data blocks.

[0103] After sorting, the media server obtains an ordered data sequence for physical reading, which allows it to determine the next data block to be read, its physical location on which tape, and how long it needs to be read, based on the correct logical order and the corresponding tape write location and size information.

[0104] In summary, through the above steps, this embodiment can handle the most complex data distribution scenarios—that is, the data of a single file is highly fragmented and interleaved and stored on multiple different tapes—and ensure the generation of an error-free data reading execution plan, thereby improving the high concurrency capability of data writing or reading.

[0105] In an exemplary embodiment, after sequentially selecting logical storage channels in the scheduling queue and allocating the right to use the tape drive to the target business task corresponding to each selected logical storage channel, the method further includes:

[0106] The tape drive information corresponding to the tape drive and the first tape information of the tape are sent to the target business task, so that the target business task, based on the tape drive information, determines that access to the tape drive is permitted, obtains the second tape information provided by the tape drive, and when the first tape information matches the second tape information, the target business task controls the tape drive to write the data block to the tape.

[0107] If the target service task is not allowed to access the tape drive, when it is determined that the first tape information matches the second tape information, the data block sent by the target service task is obtained, and the tape drive is controlled to write the data block to the tape.

[0108] The first tape information can be a unique identifier (such as a drive barcode) that the media server expects to load in the current drive based on its metadata records. The second tape information can be a unique identifier of the currently loaded tape that the entity performing the write operation (the client or the server itself) actually reads from the drive.

[0109] Specifically, after allocating usage rights, the media server can first send tape drive information and first tape information to the target business task client. Subsequently, depending on the deployment architecture and client permissions, different execution entities can be selected to write data.

[0110] Optionally, under the direct access path, after receiving the drive information, the business task client can first query whether it is connected to the drive to determine if it is allowed access. If access is granted, the client can send a query command to the drive to obtain the actual identifier of the currently loaded tape, which is the second tape information. Subsequently, the client can strictly verify whether this information matches the first tape information received from the media server. Only when the verification is correct can the business task client directly control the drive and write locally cached data blocks to the tape.

[0111] Optionally, under the proxy access path, this path is suitable when the client is not allowed to access the physical drive for security or network isolation reasons. In this case, after receiving authorization notification from the media server, the business task client can send the locally cached business data block to the media server. At this time, the media server performs the verification and write operations on behalf of the client. The media server can verify the first tape information against the second tape information read from the drive. After successful verification, the media server controls the tape drive it manages to write the data block received from the client onto the tape.

[0112] In this embodiment, by explicitly defining different write paths, data transmission efficiency can be maximized through direct paths in high-performance environments, while data write security and manageability can be guaranteed through proxy paths in secure and isolated environments. This enhances the versatility and deployment flexibility of the entire data processing method.

[0113] In an exemplary embodiment, before creating corresponding logical storage channels for each of the multiple business tasks in response to data write requests from multiple business tasks, the method further includes:

[0114] Obtain the status information of the tape drive and the tape;

[0115] If the status information indicates that the tape loaded by the tape drive meets the preset format, the tape's metadata information is verified against the pre-saved metadata information to obtain the verification result. If the verification result indicates that the tape drive is normal, the tape drive is controlled to write or read data for business tasks from the tape.

[0116] If the status information indicates that the tape loaded on the tape drive does not meet the preset format, then the tape drive is disabled or the tape is unloaded.

[0117] The status information can be a set of data obtained by the media server to understand the real-time status of the physical hardware, including but not limited to the working status of the drive (e.g., online, faulty, under maintenance) and information such as whether a tape is loaded in the drive and the identification of the loaded tape (e.g., barcode).

[0118] For example, such as Figure 5 As shown, the media server can first obtain the tape library status, and then perform an inventory of the tapes and drives separately to obtain the tape list of the tape library and obtain and update the drive information. After completing the inventory, the media server can iterate through the status information of each drive and determine the status of each loaded tape.

[0119] If the media server identifies that the currently loaded tape conforms to a preset format (for example, by finding the identifier of the metadata partition on the tape), it means that the tape is currently loaded and a consistency check can be performed. Specifically, the metadata information stored internally in the tape's metadata partition can be read and compared with the metadata information about the tape pre-stored in the media server's database. When the check result is a match, the drive and tape can be marked as ready, allowing subsequent business tasks to write or read data from them.

[0120] If the media server finds that the currently loaded tape does not meet the preset format (for example, it is a brand new blank tape, or an external tape with an incompatible format), it can trigger the preset exception handling process, which will put the drive into an unavailable state and issue an alarm (i.e., disable the tape drive), or directly command the tape library to eject the invalid tape from the drive (i.e., unload the tape).

[0121] In this embodiment, by adding a hardware status and format pre-check process before processing any actual business data, the validity of the operating environment is verified, data security is improved, and the risk of data damage or loss due to media errors is avoided.

[0122] In one exemplary embodiment, a business task corresponds to multiple logical storage channels; the multiple logical storage channels correspond to at least one data block of the business task.

[0123] In response to a tape drive usage request from a business task, the logical storage channel corresponding to the business task is added to the scheduling queue of at least one tape drive, including:

[0124] In response to a tape drive usage request from a business task, the multiple logical storage channels corresponding to the business task are added to the respective scheduling queues of the multiple tape drives.

[0125] The method also includes:

[0126] If any logical storage channel corresponding to a business task is selected, the logical storage channel of the target business task in the scheduling queue of other tape drives will be removed, and the data block corresponding to any logical storage channel will be written to the tape.

[0127] For example, a media server can allocate multiple logical storage channels for a single business task. (e.g.) Figure 6 As shown, two logical storage channels, Channel 1 and Channel 2, are allocated for a single write task. Channel 1 is mapped to physical tape 1, and Channel 2 is mapped to physical tape 2. This means that the data blocks for this task can be written to different physical tapes in a distributed manner. In this setup, when a task has data blocks ready and initiates a drive usage request, the media server can place the currently available logical channels (Channel 1 and Channel 2) for that task into the scheduling queues of their respective physical drives (i.e., the drives containing tapes 1 and 2). The write request for this task then creates a parallel competition relationship between the two independent drive resources.

[0128] Subsequently, when either of the two drives (e.g., the drive carrying tape 2) becomes idle first and selects channel 2 for the task from its queue, the media server considers this a successful resource acquisition. At this point, the media server can perform a synchronous cancellation operation, proactively removing channel 1, which is still waiting in the tape 1 drive's scheduling queue, from the queue. Finally, the selected channel 2 can use its acquired drive to write data blocks to tape 2, thus ensuring that the data is written only once and promptly releasing the queued resources of other drives.

[0129] In this embodiment, through the above steps, business tasks no longer need to passively wait for the queue of a specific drive, but can dynamically capture the earliest released resource in the entire drive pool. This shortens the average waiting time of the task and supports writing the data of the same file to multiple tapes in parallel using multiple drives when there are enough drives, thereby improving the writing efficiency of large files. This solves to some extent the problem that the physical exclusivity of the drive prevents it from supporting parallel access of multiple tasks and improves the utilization efficiency of the tape library.

[0130] In an exemplary embodiment, after any logical storage channel corresponding to a business task is selected, the method further includes:

[0131] Control the tape drive to write at least one data block of the target business task to the tape; after at least one data block of the target business task has been written to the tape, add multiple logical storage channels back to the tape drive's scheduling queue.

[0132] Specifically, once any logical storage channel for a target business task is selected in a contention, the media server first authorizes the task, and the corresponding executor (client or the server itself) controls the tape drive to write at least one data block of the task to the tape. After the data block is successfully written to the tape and the drive usage right is released, the write operation for this task is complete. However, if there are subsequent data blocks waiting to be written in the local cache of the business task client, it can send another drive usage request to the media server for the next data block. Upon receiving this new request, the media server can again add the multiple logical storage channels corresponding to the task back to the scheduling queue of multiple tape drives until all relevant data blocks of the business task have been successfully written to the tape.

[0133] In this embodiment, the above steps ensure high efficiency throughout the entire task lifecycle, not just a rapid response to the first data block, thus shortening the overall completion time of large data backup and archiving tasks.

[0134] In one exemplary embodiment, this application also provides for, as in Figure 1 In this environment, there are complete methods for writing and reading data.

[0135] like Figure 7 As shown, when a business task client needs to write data, it can send a request to the media server. The media server can respond to this request by performing a series of initialization operations, including creating a traceable business task for this write, creating a file metadata framework, allocating one or more dedicated logical storage channels for the task, and sending them to the business task client.

[0136] After initialization, the client can write source data to its local cache until the amount of data in the cache reaches a preset block size. At this point, the client can request drive resources from the media server, which then adds each channel of the task to the queue of the specified drive. When the task is scheduled for the next channel, the media server can authorize one of its channels to use the drive and return the drive information to the client. Upon receiving authorization, the client encapsulates the cached data into a standard data block and writes it to the specified tape drive. After a single data block is written, the client can release the drive, and the media server can update the file's metadata, recording information such as the position of the data block just written. Then, it can determine if all data has been written. If not, the process returns to the data writing to the cache step to prepare and write the next data block, repeating this process. If all data has been written, the client can initiate a file close request. Upon receiving this request, the media server can perform cleanup tasks, including releasing the relevant channels, updating the file metadata for the last time, updating the tape's metadata (such as the file list), and destroying the task instance.

[0137] like Figure 8As shown, when a business task client needs to read data, the media server, upon receiving a read request, can perform a series of preparatory tasks: First, it creates a task instance for this read operation. Then, it retrieves the file metadata through the filename index and parses the relevant write channels and associated standardized data block list that constitute the file from the metadata. Simultaneously, it sorts the data blocks according to their offsets within the file to determine the correct reading order. Finally, the media server can instruct the tape library to load the required tape into the physical drive based on the tape information where the data block is located. After preparation, the client enters the loop reading phase. It can request the next data block from the media server based on the progress of the currently read data. Upon receiving the request, the media server can obtain the channel to which the data block belongs and place the read request in the queue of the corresponding drive. When the drive resource becomes available, the media server acquires the right to use the drive, instructs the drive to position the tape to the beginning of the target data block, and returns drive information to the business task. After obtaining authorization and drive information, the business task directly accesses the drive, reads and parses the data block, and obtains the file data until the entire data block is read. After a single data block read is completed, the client can immediately release the drive. At this point, it can be determined whether the relevant data has been read. If not, the process will return to the step of requesting the next data block and continue reading the next part of the file. If yes, it means that the file has been completely read, and the client can initiate a request to close the file. The media server responds to this request, performs the final resource reclamation operation, that is, releases the relevant channels and destroys the task, thus ending the entire reading process.

[0138] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0139] Based on the same inventive concept, this application also provides a magnetic tape data processing apparatus for implementing the magnetic tape data processing method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more embodiments of the magnetic tape data processing apparatus provided below can be found in the limitations of the magnetic tape data processing method described above, and will not be repeated here.

[0140] In one exemplary embodiment, such as Figure 9 As shown, a magnetic tape data processing apparatus is provided, comprising: a logical channel partitioning module 910, a task queue scheduling module 920, and a usage right allocation module 930, wherein:

[0141] The logical channel partitioning module 910 is used to create corresponding logical storage channels for each of the multiple business tasks in response to data write requests from multiple business tasks.

[0142] The task queue scheduling module 920 is used to add the logical storage channel corresponding to the business task to the scheduling queue of the tape drive in response to the tape drive usage request of the business task; the tape drive usage request is issued when the business task requests to write data blocks to the tape.

[0143] The usage right allocation module 930 is used to sequentially select logical storage channels in the scheduling queue and allocate the usage right of the tape drive to the target business task corresponding to each selected logical storage channel; the usage right is released after at least one data block of the current target business task is written to the tape and no more than a number threshold, and is then allocated to the target business task corresponding to the next selected logical storage channel.

[0144] In one embodiment, the usage right allocation module 930 is further configured to obtain the logical channel identifier corresponding to each of the logical storage channels; the logical channel identifier indicates the file identifier of the file to which the data block requested to be written by the business task belongs, and the tape identifier of the tape to which the data block is to be written; in response to the file read request of the business task, a target logical channel identifier containing the file identifier is determined according to the file identifier carried in the file read request; and the data block in the tape belonging to the file to be read is determined according to the tape identifier indicated by the target logical channel identifier, so that the business task can read it.

[0145] In one embodiment, the usage right allocation module 930 is further configured to obtain the tape write position of the data block, as well as the size information and corresponding file offset information of the data block; obtain the logical storage channel identifier corresponding to the logical storage channel used when writing the data block; determine and save the metadata information of the current data block according to the tape write position, the size information, the file offset information and the logical storage channel identifier, so as to read the data according to the metadata.

[0146] In one embodiment, the usage right allocation module 930 is further configured to: determine one or more tapes storing the data of the business task based on the tape identifiers indicated by one or more logical channel identifiers corresponding to the business task; determine the data block order of each data block corresponding to the business task on the one or more tapes in the file to be read based on pre-saved file offset information of the business task; the file offset information indicates the position of the data block in the file to be read; and obtain the tape write position and size information of each data block corresponding to the business task on the one or more tapes, so that the business task reads the data block belonging to the file to be read according to the tape write position, size information and the data block order.

[0147] In one embodiment, the access rights allocation module 930 is further configured to send the tape drive information corresponding to the tape drive and the first tape information of the tape to the target service task, so that when the target service task determines that it is allowed to access the tape drive according to the tape drive information, it obtains the second tape information provided by the tape drive, and when the first tape information matches the second tape information, the target service task controls the tape drive to write the data block to the tape; when the target service task is not allowed to access the tape drive, when it is determined that the first tape information matches the second tape information, it obtains the data block sent by the target service task and controls the tape drive to write the data block to the tape.

[0148] In one embodiment, the usage rights allocation module 930 is further configured to acquire the status information of the tape drive and the tape; if the status information indicates that the tape loaded by the tape drive meets the preset format, the metadata information of the tape is verified with the pre-saved metadata information to obtain a verification result, so that if the verification result indicates that it is normal, the tape drive is controlled to perform data writing or reading of the business task on the tape; if the status information indicates that the tape loaded by the tape drive does not meet the preset format, the tape drive is deactivated or the tape is unloaded.

[0149] In one embodiment, the business task corresponds to multiple logical storage channels; the multiple logical storage channels correspond to at least one data block of the business task; the task queue scheduling module 920 is further configured to, in response to the tape drive usage request of the business task, add the multiple logical storage channels corresponding to the business task to the respective scheduling queues of the multiple tape drives.

[0150] In one embodiment, the task queue scheduling module 920 is further configured to, if any logical storage channel corresponding to the business task is selected, remove the logical storage channel of the target business task from the scheduling queue of other tape drives and write the data block corresponding to the logical storage channel to the tape.

[0151] In one embodiment, the usage rights allocation module 930 is further configured to control the tape drive to write at least one data block of the target business task to the tape; after the at least one data block of the target business task is written to the tape, the plurality of logical storage channels are re-added to the scheduling queue of the tape drive.

[0152] Each module in the aforementioned magnetic tape data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0153] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 10 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores metadata. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When executed by the processor, the computer program implements a magnetic tape data processing method.

[0154] Those skilled in the art will understand that Figure 10The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0155] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0156] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.

[0157] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0158] 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 used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0159] 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 used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0160] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0161] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0162] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A magnetic tape data processing method, characterized in that, The method includes: In response to data write requests from multiple business tasks, corresponding logical storage channels are created for each of the multiple business tasks; each logical storage channel has a different logical channel identifier; the logical channel identifier also indicates the file identifier of the file to which the data block requested to be written by the business task belongs, and the tape identifier of the tape to which the data block is to be written; In response to the tape drive usage request of the business task, the logical storage channel corresponding to the business task is added to the scheduling queue of the tape drive; the tape drive usage request is issued when the business task requests to write data blocks to the tape and the amount of data accumulated in the buffer corresponding to the business task reaches a preset data block size, including the logical storage channel identifier corresponding to the logical storage channel to be entered into the scheduling queue; wherein, adding the logical storage channel corresponding to the business task to the scheduling queue of the tape drive includes: determining the corresponding tape and the tape drive according to the logical storage channel identifier in the drive usage request; adding the logical storage channel corresponding to the business task to the scheduling queue of the tape drive; Logical storage channels in the scheduling queue are selected sequentially, and the right to use the tape drive is allocated to the target service task corresponding to each selected logical storage channel. The right to use the tape drive is released after at least one data block of the current target service task (not exceeding a certain number threshold) is written to the tape, and is then allocated to the target service task corresponding to the next selected logical storage channel.

2. The method according to claim 1, characterized in that, After creating corresponding logical storage channels for the multiple business tasks, the method further includes: in response to a file read request from a business task, determining a target logical channel identifier containing the file identifier based on the file identifier carried in the file read request; Based on the tape identifier indicated by the target logical channel identifier, the data block in the tape belonging to the file to be read is determined for the business task to read.

3. The method according to claim 2, characterized in that, Before determining the target logical channel identifier containing the file identifier based on the file identifier carried in the file read request, the method further includes: Obtain the tape write position of the data block, as well as the size information and corresponding file offset information of the data block; Obtain the logical storage channel identifier corresponding to the logical storage channel used when writing the data block; Based on the tape write position, the size information, the file offset information, and the logical storage channel identifier, the metadata information of the current data block is determined and saved, so that the data can be read based on the metadata.

4. The method according to claim 2, characterized in that, The step of determining the data block in the tape belonging to the file to be read, based on the tape identifier indicated by the target logical channel identifier, for the business task to read, includes: Based on the tape identifier indicated by one or more logical channel identifiers corresponding to the business task, determine one or more tapes for storing the data of the business task; Based on the pre-saved file offset information of the business task, the order of each data block corresponding to the business task on the one or more magnetic tapes in the file to be read is determined; the file offset information indicates the position of the data block in the file to be read. Obtain the tape write position and size information of each data block on the one or more tapes corresponding to the business task, so that the business task reads the data block belonging to the file to be read according to the tape write position, size information and the order of the data blocks.

5. The method according to claim 1, characterized in that, After sequentially selecting logical storage channels in the scheduling queue and allocating the right to use the tape drive to the target business task corresponding to each selected logical storage channel, the process further includes: The tape drive information corresponding to the tape drive and the first tape information of the tape are sent to the target service task, so that the target service task, based on the tape drive information, determines that access to the tape drive is permitted, obtains the second tape information provided by the tape drive, and when the first tape information matches the second tape information, the target service task controls the tape drive to write the data block to the tape. If the target service task is not allowed to access the tape drive, when it is determined that the first tape information matches the second tape information, the data block sent by the target service task is obtained, and the tape drive is controlled to write the data block to the tape.

6. The method according to claim 5, characterized in that, Before creating corresponding logical storage channels for each of the multiple business tasks in response to data write requests from multiple business tasks, the method further includes: Obtain the status information of the tape drive and the tape; If the status information indicates that the tape loaded by the tape drive meets the preset format, the metadata information of the tape is verified with the pre-saved metadata information to obtain a verification result. If the verification result indicates that the data is normal, the tape drive is controlled to write or read the data of the business task on the tape. If the status information indicates that the tape loaded on the tape drive does not meet the preset format, then the tape drive is deactivated or the tape is unloaded.

7. The method according to claim 1, characterized in that, The business task corresponds to multiple logical storage channels; the multiple logical storage channels correspond to at least one data block of the business task; The step of adding the logical storage channel corresponding to the business task to the scheduling queue of at least one tape drive in response to the tape drive usage request of the business task includes: In response to the tape drive usage request of the business task, the plurality of logical storage channels corresponding to the business task are added to the respective scheduling queues of the plurality of tape drives; The method further includes: If any logical storage channel corresponding to the business task is selected, the logical storage channel of the target business task in the scheduling queue of other tape drives is removed, and the data block corresponding to any logical storage channel is written to the tape.

8. The method according to claim 7, characterized in that, After any logical storage channel corresponding to the business task is selected, the following steps are also included: Control the tape drive to write at least one data block of the target business task onto the tape; After at least one data block of the target business task is written to the tape, the plurality of logical storage channels are re-added to the scheduling queue of the tape drive.

9. A magnetic tape data processing device, characterized in that, The device includes: The logical channel partitioning module is used to respond to data write requests from multiple business tasks and create corresponding logical storage channels for each of the multiple business tasks; each logical storage channel has a different logical channel identifier; the logical channel identifier also indicates the file identifier of the file to which the data block requested to be written by the business task belongs, and the tape identifier of the tape to which the data block is to be written; A task queue scheduling module is used to respond to a tape drive usage request of a business task by adding the logical storage channel corresponding to the business task to the scheduling queue of the tape drive. The tape drive usage request is issued when the business task requests to write data blocks to the tape and the amount of data accumulated in the buffer corresponding to the business task reaches a preset data block size, including the identifier of the logical storage channel to be entered into the scheduling queue. Adding the logical storage channel corresponding to the business task to the scheduling queue includes: determining the corresponding tape and tape drive based on the logical storage channel identifier in the drive usage request; adding the logical storage channel corresponding to the business task to the scheduling queue of the tape drive. A usage right allocation module is used to sequentially select logical storage channels in the scheduling queue and allocate the usage right of the tape drive to the target business task corresponding to each selected logical storage channel. The usage right is released after at least one data block of the current target business task (not exceeding a quantity threshold) is written to the tape and is then allocated to the next selected target business task corresponding to the logical storage channel.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.