A data rewriting method and apparatus

By performing data block decoding and verification on the host, and using user-defined encoding error correction thresholds and reserved verification lengths, the problem of inflexible tape data rewriting methods is solved. This enables flexible rewriting conditions and efficient data reading, making it suitable for more scenarios, reducing management overhead and improving reliability.

CN122309229APending Publication Date: 2026-06-30HUAWEI TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HUAWEI TECH CO LTD
Filing Date
2024-12-31
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing tape data rewriting methods are inflexible and cannot adapt to the needs of different scenarios. Furthermore, the mapping position and length of user data to the tape are uncertain, resulting in high data maintenance and management costs and low reading efficiency.

Method used

The host performs decoding and verification of data blocks, adopts user-defined encoding error correction thresholds and reserved verification lengths, flexibly determines rewrite conditions, and meets the needs of different scenarios without changing the hardware, ensuring that the mapping and length of user data to the physical location of the tape are fixed.

Benefits of technology

It provides flexibility in data rewriting, reduces data maintenance and management overhead, improves data reading efficiency, is suitable for more application scenarios, and ensures the reliability of rewritten data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122309229A_ABST
    Figure CN122309229A_ABST
Patent Text Reader

Abstract

A data rewriting method and apparatus are disclosed. The method includes: acquiring the decoding result of a data block read from a magnetic tape by a tape drive, the data block comprising multiple data sub-blocks, each data sub-block comprising multiple data units and at least one check unit, the at least one check unit being obtained by encoding the multiple data units; the decoding result of the data block indicating the number of erroneous data units and / or check units in each of the one or more data sub-blocks included in the data block; determining whether the data block passes verification based on encoding capability information, the encoding capability information including a first encoding error correction threshold and a second encoding erasure threshold; if the number of data sub-blocks that fail decoding in the data block exceeds the second encoding erasure threshold, the data block fails verification; a data sub-block that fails decoding refers to a data sub-block containing erroneous data units and / or check units exceeding the first encoding error correction threshold; and rewriting the data block that fails verification.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of magnetic tape, and more particularly to a data rewriting method and apparatus. Background Technology

[0002] Magnetic tape is a technology that uses magnetic materials as a storage medium, employing the transformation of magnetic signals to represent and store data. It is a low-cost, reliable data backup medium, primarily used for pre-emptive backup in case of system crashes and for long-term data archiving. Starting in the 1980s, with the emergence and widespread adoption of other storage technologies such as optical discs, hard drives, and flash memory, magnetic tape was gradually replaced in the consumer market. However, in enterprise-level data backup and archiving, magnetic tape still has important applications due to its advantages such as low cost, high capacity, and long lifespan.

[0003] With the widespread application of emerging technologies such as the Internet of Things, artificial intelligence, 5G, cloud computing, and autonomous driving, the global amount of information is growing rapidly, and IDC predicts it will reach 175 ZB by 2025. Stored data can be categorized into hot, warm, and cold data based on access frequency. Data frequently accessed in computer memory or cache is called hot data. Data stored on hard drives or flash memory is typically warm data. Data that does not require frequent access, such as data from digital libraries, AI training, life sciences, financial archives, and space exploration, is usually stored on magnetic tape or optical discs; this data is called cold data and accounts for more than 50%. Therefore, although magnetic tape has a slower random read / write speed, it still plays an important role in modern storage systems due to its advantages such as large storage capacity, low cost, media stability, and wide applicability.

[0004] Currently, the data rewriting method for magnetic tapes is fixed in the tape drive, making the rewriting method inflexible. Summary of the Invention

[0005] This application provides a data rewriting method and apparatus to provide flexibility in data rewriting.

[0006] Firstly, this application provides a data rewriting method, which can be executed by a host or by components or functional modules included in the host. Taking host execution as an example, the method includes: the host acquiring the decoding result of a data block read from a tape drive, the data block including multiple data sub-blocks, any data sub-block including multiple data units and at least one verification unit, the at least one verification unit being obtained by encoding the multiple data units; the decoding result of the data block indicating the number of erroneous data units and / or verification units in each of the one or more data sub-blocks included in the data block; determining whether the data block passes verification based on encoding capability information, the encoding capability information including a first encoding error correction threshold and a second encoding erasure threshold; if the number of data sub-blocks that fail decoding in the data block exceeds the second encoding erasure threshold, then determining that the data block fails verification; the data sub-block that fails decoding refers to the data sub-block having an erroneous data unit and / or verification unit exceeding the first encoding error correction threshold; and rewriting the data block that fails verification.

[0007] The above design allows the host to verify whether a data block passes verification, rather than the tape drive doing so. Compared to the tape drive's method of performing read-after-write verification with fixed rewrite conditions, this method provides greater flexibility in rewriting.

[0008] In one possible implementation of the first aspect, the at least one verification unit is the at least one first verification unit; the first encoding error correction threshold is determined based on the first encoding parameter; or the first encoding error correction threshold is determined based on the first encoding parameter and the first encoding reserved verification length set by the user; the first encoding parameter is used to indicate the total length of the at least one first verification unit in any data block, and the first encoding reserved verification length is not greater than the total length of the at least one first verification unit.

[0009] The above design provides users with the flexibility to set rewrite conditions.

[0010] In one possible implementation of the first aspect, the second encoding error correction threshold is determined based on the second encoding parameter; or the second encoding error correction threshold is determined based on the second encoding parameter and the second encoding reserved verification length set by the user; the second encoding parameter is used to indicate the total length of at least one second verification unit corresponding to each column of data in the data block, and the second encoding reserved verification length is not greater than the total length of the at least one second verification unit.

[0011] The above design provides users with the flexibility to set rewrite conditions.

[0012] In one possible implementation of the first aspect, the first reserved check length and / or the second reserved check length are determined based on the rewrite rate index and / or reliability index.

[0013] The above design allows for rewriting conditions to meet the needs of different scenarios without changing the hardware.

[0014] In one possible implementation of the first aspect, before obtaining the decoding result of the data block read from the tape drive, the method further includes: sending a first write request to the tape drive, the first write request including user data to be written (including multiple data blocks); caching the multiple data blocks; and rewriting the data block that failed the verification includes: obtaining the cached multiple data blocks; and sending a second write request to the tape drive, the second write request including the multiple data blocks, the second write request being used to request the rewriting of the multiple data blocks into the tape.

[0015] Through the above design, it can be ensured that the mapping and length of user data to the physical location of the magnetic tape are fixed, solving the problem of uncertain mapping position and length of user data to the magnetic tape in the prior art. Compared with the existing technical solutions, which are only applicable to streaming storage scenarios such as storing movies and other sequentially read data, the embodiments of this application are applicable to more scenarios. When managing user data in dimensions, only the mapping relationship between user data and the starting address (or offset) of the physical location of the magnetic tape needs to be recorded. The process of reading user data is also simpler. For the basic amount of magnetic tape, this can significantly reduce the data maintenance and management overhead and improve the data reading efficiency.

[0016] In one possible implementation of the first aspect, the storage location of the plurality of data blocks included in the second write request on the magnetic tape is different from the storage location of the plurality of data blocks included in the first write request on the magnetic tape.

[0017] The above design ensures the reliability of rewritten data.

[0018] In one possible implementation of the first aspect, prior to sending the first write request to the tape drive, the method further includes:

[0019] The process involves: acquiring user data to be written; dividing the user data into multiple data subsets, and further dividing any data subset into N sub-data, where N is a positive integer; encoding multiple data units included in any row of data in the first sub-data using a first encoding parameter to obtain at least one first verification unit; the first sub-data being any one of the N sub-data; encoding data units in the same column of the first sub-data using a second encoding parameter to obtain at least one second verification unit; and encoding the remaining sub-data using the encoding method for the first sub-data to obtain the multiple data blocks.

[0020] The above design improves the reliability of the data to be written by encoding it.

[0021] Secondly, this application also provides a data rewriting apparatus, which has the function of implementing the behavior in the method of the first aspect described above. The beneficial effects are described in the first aspect and will not be repeated here. The function can be implemented by hardware or by hardware executing corresponding software. The hardware or software includes one or more modules corresponding to the above functions. In one possible design, the apparatus structure includes an acquisition module, a verification module, and a rewriting module; optionally, it also includes a communication module. In one possible design, some or all of the modules can be the same module; for example, the acquisition module and the communication module can be the same module. These modules can perform the functions of the behavior in the method example of the first aspect described above, as detailed in the method example, and will not be repeated here.

[0022] Thirdly, this application also provides a computing device cluster, which includes at least one computing device. This at least one computing device has the functionality to implement the behavior described in the method example of the first aspect above. The beneficial effects can be found in the description of the first aspect and will not be repeated here. Each computing device includes a processor and a memory. The processor is configured to support the computing device in executing the method described in the first aspect or any possible design of the first aspect. The memory is coupled to the processor and stores the necessary program instructions and data of the computing device. The computing device also includes a communication interface for communicating with other devices.

[0023] Fourthly, this application also provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in the first aspect or any possible design of the first aspect.

[0024] Fifthly, this application also provides a computer program product containing instructions that, when run on a computer, cause the computer to perform the method described in the first aspect or any possible design of the first aspect.

[0025] Sixthly, this application also provides a computer chip connected to a memory, the chip being used to read and execute a software program stored in the memory, and to execute the method described in the first aspect or any possible design of the first aspect.

[0026] For the beneficial effects of aspects two through six, please refer to the beneficial effects of aspect one, which will not be repeated here. Attached Figure Description

[0027] Figure 1 A schematic diagram of a system architecture is provided for this application;

[0028] Figure 2 A schematic diagram of the structure of a host 100 and a tape drive 200 provided in this application;

[0029] Figure 3 This application provides a schematic diagram of the structure of a drive component 220;

[0030] Figure 4 A schematic diagram of the magnetic tracks of a linear magnetic tape provided in this application;

[0031] Figure 5A This is a flowchart illustrating an existing technical solution.

[0032] Figure 5B This is a diagram illustrating the data writing method.

[0033] Figure 5C This is a schematic diagram of a data rewriting method.

[0034] Figure 6 A flowchart illustrating the data writing method provided in this application;

[0035] Figure 7 A flowchart illustrating the data rewriting method provided in this application;

[0036] Figure 8 A schematic diagram of an encoding method provided in this application;

[0037] Figure 9 A schematic diagram of data shuffling provided in this application;

[0038] Figure 10A A schematic diagram of a sub-dataset provided in this application;

[0039] Figure 10B A flowchart illustrating a rewriting condition provided for this application;

[0040] Figure 11 This application provides a schematic diagram of a data rewriting location;

[0041] Figure 12 Other data rewrite locations provided for this application;

[0042] Figure 13 A schematic diagram illustrating another data rewriting method provided in this application;

[0043] Figure 14 A schematic diagram of the experimental data provided in this application;

[0044] Figure 15 This is a schematic diagram of the structure of a data rewriting device provided in an embodiment of this application;

[0045] Figure 16 This is a schematic diagram of the structure of a computing device provided in an embodiment of this application;

[0046] Figure 17 This is a schematic diagram of the structure of a computing device cluster provided in an embodiment of this application. Detailed Implementation

[0047] This application provides a data rewriting method based on magnetic tape. The magnetic tape can also serve as storage for a computer device, allowing the computer device to access the tape and perform data storage and retrieval. This method can be used to solve the problem of inflexible data rewriting methods.

[0048] Figure 1 This is a schematic diagram of a storage system architecture provided in an embodiment of this application. The storage system 10 includes a host 100, a tape drive 200, and a tape 300.

[0049] The host 100 is able to receive and / or generate user data, and write the user data to the tape 300 for persistent storage via the tape drive 200.

[0050] This application does not limit the specific form of the host 100. The host 100 can be a hardware device, such as a server, mobile terminal, or other computing device. The host 100 can also be a hardware component in the computing device, such as the processor (or processing cores within the processor) or offloading card (such as a data processing unit (DPU)). In some application scenarios, the host 100 can also be a computing instance running on the computing device, such as a virtual machine, container, or other software module with an independent operating environment formed by hardware virtualization of the computing device. The host 100 can also be software running on the computing device, such as file management software or database management software. Any module capable of accessing the tape 300 can serve as the host 100.

[0051] The tape drive 200 is located between the host 100 and the tape 300. The tape drive 200 can be understood as the "controller" of the tape 300. The tape drive 200 is capable of handling some complex tasks, such as managing the data stored on the tape 300, maintaining the performance and lifespan of the tape 300, etc.

[0052] The following section uses host 100 as an example of a computing device to explain the structure of host 100 and tape drive 200 from a hardware perspective. Figure 2 This illustration shows a schematic diagram of the structure of a host 100 and a tape drive 200 provided in an embodiment of this application.

[0053] 1. Host 100: may include processor 101 and memory 102. Processor 101 is connected to memory 102 via a double data rate (DDR) bus or other type of bus.

[0054] (1) The processor 101 is the computing and control core of the host 100. It can be a central processing unit (CPU). The CPU 101 can execute the data rewriting method provided in the embodiments of this application. Figure 2 The processor 101 is illustrated using a CPU as an example. In practical applications, the processor 101 can also be other general-purpose processors, DPUs, digital signal processors (DSPs), hardware logic circuits, processing cores, system-on-chips (SoCs), application-specific integrated circuits (ASICs), AI chips, or programmable logic devices (PLDs). Furthermore, Figure 2 Only one CPU 101 is shown in this embodiment. In practical applications, there can be multiple CPUs 101, and each CPU 101 has one or more processor cores. This embodiment does not limit the number of processors or the number of processor cores.

[0055] (2) Memory 102 refers to the internal memory that directly exchanges data and instructions with the CPU 101. It can read and write data at any time and at a very high speed, serving as temporary data storage for the operating system or other running programs. Memory 102 includes, but is not limited to: random access memory (RAM), read-only memory (ROM), static random access memory (SRAM), dynamic random access memory (DRAM), double data rate memory (DDR), and storage class memory (SCM). Read-only memory can be programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), etc. In practical applications, the host 100 can be configured with multiple memory modules 102, and different types of memory modules 102. This embodiment does not limit the number or type of memory modules 102.

[0056] In this embodiment, CPU 101 can execute the following text by calling computer program instructions stored in memory 102. Figure 7 In this method embodiment, host 100 needs to execute some methods.

[0057] II. Tape drive 200: including controller 210 and drive assembly 220.

[0058] (1) Controller 210 is the control center of tape drive 200. Controller 210 is mainly used to complete processing operations, such as parsing access requests and location information initiated by host 100. By parsing access requests, controller 210 can determine the physical location of the data to be accessed (such as the track where the data is located and its offset within the track), and by parsing location information, determine the physical location of the data to be accessed subsequently. Controller 210 can control drive component 220 to perform read or write operations on tape 300 (such as in the scenario where controller 210 is parsing access requests). Controller 210 can also control drive component 220 to adjust the positions of read head 223 and write head 224 on tape 300 (such as in the scenario where controller 210 is parsing location information).

[0059] Figure 2The controller 210 is illustrated using a field-programmable gate array (FPGA) as an example. In practical applications, the controller 210 can also be other specific integrated circuits. For example, a complex programmable logical device (CPLD), a generic array logic (GAL), an application-specific integrated circuit (ASIC), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Alternatively, the controller 210 can be a general-purpose processor such as a CPU, a data processing unit (DPU), or a digital signal processor (DSP). This application does not limit the type of the controller 210.

[0060] (2) The drive assembly 220 is the operable part of the tape drive 200, including at least one read head 233. Figure 2 Only one read head is shown, but the embodiments of this application do not limit the number of read heads) and at least one write head 224. Figure 2 Only one write head is shown, but the number of read heads is not limited in this embodiment. Alternatively, the drive assembly 220 may include at least one head that functions as both a read head 233 and a write head 224, which is not limited in this embodiment.

[0061] 3. Magnetic tape 300

[0062] Magnetic tape 300 is a storage device capable of storing data such as sound, images, and digital signals. The magnetic tape uses magnetic materials to store data. The storage medium in magnetic tape 300 is a thin film coated with magnetic material, magnetic oxide, or alloy. Different states of the magnetic material, magnetic oxide, or alloy correspond to different types of data. In this embodiment, the thin film of magnetic tape 300 can be referred to as the baseband of the magnetic tape, and the baseband serves as a support for the magnetic material.

[0063] The following example, using a baseband with magnetic material attached, illustrates the methods for reading and writing data onto magnetic tape.

[0064] 1) Data writing.

[0065] Writing data onto the magnetic tape 300 requires a write head 224. A common write head 224 can be a horseshoe electromagnet, with its two poles very close together and a slit in the middle. When writing data to the magnetic tape 300, the FPGA 211 supplies a voltage representing the data to the write head 224; this voltage is variable. The FPGA 211 controls the write head 224 to move close to the baseband. The magnetic field at the slit on the write head 224 changes with the voltage, altering the state of the magnetic material on the thin film (e.g., changing the magnetization direction and strength of the magnetic material). Thus, data is recorded on the magnetic tape. In this embodiment, the portion of the baseband where data is recorded is called the magnetic track. This magnetic track is the portion through which the slit passes when the write head 224 is close to the baseband.

[0066] Figure 3 An exemplary schematic diagram of the magnetic track distribution in a serpentine magnetic tape is shown. Figure 3 The solid black lines with arrows represent magnetic tracks. The direction of the magnetic track refers to the direction of movement of the read / write head relative to the baseband when reading or writing data from that track (i.e., the direction of head movement with the baseband as a reference). For example, if the magnetic track direction is from left to right, it means that when reading or writing data on that track, the read / write head moves from left to right relative to the baseband. In reality, when writing or reading data on the magnetic track, the position of the read / write head usually remains relatively constant, while the baseband moves under the action of the winding pins. Therefore, when reading or writing data on that track, the direction of baseband movement is opposite to the direction of the magnetic track, that is, it needs to move from right to left.

[0067] Figure 3 The diagram shows a magnetic track formed by data written by a write head 224. When the drive assembly 220 includes multiple write heads 224, the multiple write heads 224 can write data to the magnetic tape 300 in parallel, thereby forming multiple parallel magnetic tracks. See [link to documentation]. Figure 4 As shown, Figure 4 An example is shown showing the magnetic track distribution for parallel writing of data by four write heads 224.

[0068] 2) Data reading.

[0069] Data reading is the reverse process of data writing. Reading data from magnetic tape 300 requires the use of a read head 223. The read head 223 has a similar structure to the write head 224, also being a horseshoe electromagnet. When reading data from magnetic tape 300, FPGA 211 controls the read head 223 to move close to the thin film from the location of the data on the tape. As the magnetic material in the magnetic tape 300 passes through the slit of the read head 223, the magnetic flux generated on the read head 223 changes due to the state of the magnetic material (such as changes in the magnetization direction and magnetic strength), resulting in an induced current on the read head 223. This induced current, or amplified induced current, is the data to be read. FPGA 211 obtains the data by analyzing this induced current or amplified induced current.

[0070] It should be noted that the system or device architectures shown in the above figures are merely examples. In actual applications, the storage system 10 may include more or fewer devices. For example, the CPU 101 and memory 102 may be integrated into the tape drive 200. Furthermore, the host 100 and tape drive 200 may include more or fewer components. For example, the host 100 may also include a hard disk. This application does not limit these aspects. Figure 2 The structure of the drive assembly 220 shown is merely an example. In practical applications, the drive assembly 220 may include more components, and this application embodiment does not limit this. For example, the drive assembly 220 may also include a winding post and a motor. The winding post can be used to fix the baseband, and the motor can be used to drive the winding post to rotate, thereby moving the baseband. This application embodiment does not limit the number of winding posts and motors. In addition, the serpentine magnetic tape listed above is only an example. In practical applications, the magnetic tape 300 may also use other types of magnetic tape, such as linear magnetic tape, and this application embodiment does not limit this either.

[0071] The following combination Figures 5A-5C This paper introduces the existing methods for writing magnetic tape.

[0072] See Figure 5A As shown, at the functional level, the tape drive 200 can handle access requests from the host 100 and access the tape 300 according to the access request initiated by the host 100. If the access request is a write request, the write request includes user data to be written. The tape drive 200 responds to the write request and writes the user data requested by the host 100 into the tape 300.

[0073] To ensure the reliability of the written data, before writing, the tape drive 200 divides the user data into multiple small blocks and encodes each block using horizontal (C1) encoding and vertical (C2) encoding, respectively, to obtain horizontal and vertical check information for each block. C1 encoding involves horizontally encoding a row of horizontally arranged user information to generate horizontal check information (denoted as C1 check information). C2 encoding involves vertically encoding a column of vertically arranged user information to generate vertical check information (denoted as C2 check information). This check information can be used to verify the integrity and accuracy of the data. This check information is written to the tape 300 along with the small data blocks. If data read from the tape 300 is lost or erroneous, the check information can be used to recover the erroneous or lost data portions of the small data blocks, thereby enhancing data reliability.

[0074] The tape drive 200 can also assess tape quality based on the amount of missing or erroneous data in small data blocks, thereby determining whether to rewrite. See also Figure 5A As shown, to further ensure the reliability of the data written to tape 300, tape drive 200 (e.g., FPGA 211) performs read-while-write (RWW) verification on the data written to tape 300. RWW verification means that after tape drive 200 writes data to a designated location on tape 300, data can be immediately read from that location. Due to tape damage, contamination, or other reasons, the data read from tape 300 may be lost or contain errors; that is, the read data is different from the written data. FPGA 211 uses RWW verification to perform C1 decoding on the read data to identify erroneous data portions. If the amount of erroneous data does not exceed the error correction capability of C1 encoding, the verification passes. If the amount of erroneous data exceeds the error correction capability of C1 encoding, the verification fails, indicating that the quality of that tape area is poor. FPGA 211 will then select a new location on tape 300 and rewrite this data to tape 300.

[0075] Specifically, Figure 5B An exemplary flowchart illustrates a method for writing user data. In this method, user data is grouped, encoded, and written at a fixed granularity, such as... Figure 5B As shown, the granularity of user data processing is a fixed-size dataset, meaning the amount of user data included in a dataset is fixed. A dataset can be further divided into several sub-datasets, for example... Figure 5BTaking a dataset comprising 64 sub-datasets as an example, each sub-dataset is further divided into four parts. The user information (arranged in multiple rows and columns) within each part is C1 encoded and C2 encoded, resulting in four Error Correction Codes (ECC) units. Each ECC unit includes user information, C1 checksums for each row of user information, and C2 checksums for each column of user information. Each row of the sub-dataset is used to form Code Word Interleave (CWI)-4, where -4 indicates that the sub-dataset contains four ECC units, and CWI-4 is composed of the same row of these four ECC units. Each time data is written, tape drive 200 writes to tape 300 at a granularity of CWI-4.

[0076] During the write-read verification, FPGA211 also reads data from tape 300 and verifies it at the CWI-4 granularity. If there are errors in the read CWI-4 and the amount of data in the erroneous part exceeds the error correction capability of C1 encoding, the verification fails and FPGA211 determines that the CWI-4 needs to be rewritten.

[0077] Figure 5C This is a schematic diagram of a method for writing and rewriting data to magnetic tape 300 in the prior art. Figure 5C Each column includes multiple CWI-4 ( Figure 5C Each small block represents a CWI-4. Multiple CWI-4s in each column are written to the magnetic tape 300 in parallel. This operation can be achieved using multiple parallel write heads 224. For example, when each column contains 32 CWI-4s, the FPGA 211 can control 32 write heads 224 to write data to the magnetic tape 300 in parallel, forming 32 tracks. Each write head 224 is responsible for writing one CWI-4, thus writing all 32 CWI-4s to the magnetic tape 300 in parallel. After this column of data is written, the FPGA 211 immediately reads the data from the magnetic tape 300 for post-write verification. If any CWI-4 in the column fails the verification, the data in that column is immediately rewritten in the subsequent area. It can be seen that the rewriting conditions in this rewriting method are fixed in the hardware (FPGA 211) of the magnetic tape drive 200, making the rewriting method inflexible.

[0078] In view of this, embodiments of this application provide a data rewriting method implemented through hardware and software collaboration, see [link to relevant documentation]. Figure 6As shown, in this method, the tape drive 200 only needs to perform C1 decoding and feed back the decoding result to the host 100. The host 100 then determines whether to rewrite based on the decoding result. This method allows rewriting conditions to be configured according to user needs (such as rewrite probability, reserved space, reliability requirements, etc.), providing flexibility in the rewriting method. Furthermore, unlike existing technologies where encoding and verification are implemented in hardware, this embodiment can offload encoding and verification to the host 100, reducing the hardware resource overhead of the tape drive 200.

[0079] The following is combined Figure 6 and Figure 7 The data rewriting method provided in the embodiments of this application will be described in detail.

[0080] Figure 7 This is a flowchart illustrating a data rewriting method provided in an embodiment of this application. The method can be implemented by... Figure 6 The method can be executed by host 100, or by components included in host 100 (such as CPU 101), or, when host 100 is software, by a software module. The following example, using host 100 as an example, illustrates that the method may include some or all of the following steps. Figure 7 As shown, the method may include:

[0081] Step 701: Host 100 performs C1 encoding and C2 encoding on the user data to obtain the encoded data.

[0082] The following introduces an encoding method, combined with... Figure 5B and Figure 8 understand, Figure 8 It can be Figure 5B A schematic diagram of the internal structure of an ECC unit.

[0083] Host 100 stores user data into a dataset, then divides the dataset into multiple sub-datasets, and each sub-dataset is further divided into 4 ECC units. Figure 8 An exemplary diagram illustrates the encoding of an ECC unit, such as... Figure 8 As shown, user information in an ECC unit is represented in the form of data units, for example... Figure 8 Each number-identified square is a data unit, and the size of each data unit can be fixed, such as each data unit including 1 byte of data.

[0084] During encoding, host 100 performs C1 encoding on each row of data in the ECC unit to obtain C1 check information. For example, C1 encoding of the first row of data (0,1,2,3) yields two check units, P0 and Q0. C1 encoding of the second row of data (4,5,6,7) yields two check units, P1 and Q1. C1 encoding of the third row of data (8,9,10,11) yields two check units, P2 and Q2.

[0085] Similarly, host 100 performs C2 encoding on each column of data units in the ECC unit to obtain C2 check information. For example, C2 encoding of the first column of data units (0,4,8) yields the R1 check unit. C2 encoding of the second column of data units (1,5,9) yields the R2 check unit. C2 encoding of the third column of data units (2,6,10) yields the R3 check unit, and so on, obtaining the check unit for each row and each column respectively.

[0086] Similarly, C1 encoding can be performed on the C2 checksum of each row to obtain the corresponding C1 checksum for each row of data. Likewise, C2 encoding can be performed on the C1 checksum of each column to obtain the corresponding C2 checksum for each column of data. For example, C2 encoding of P0, P1, and P2 yields C2 checksum unit K1. C2 encoding of Q0, Q1, and Q2 yields C2 checksum unit K2. It should be noted that C1 encoding of R1, R2, R3, and R4 will also yield two C1 checksum units, K1 and K2. Therefore, any encoding method can be used to encode the checksum information.

[0087] Optionally, the host 100 may first perform C1 encoding on the user data and then perform C2 encoding, or first perform C2 encoding on the user data and then perform C1 encoding, or perform both C1 and C2 encoding on the user data simultaneously. This application embodiment does not limit this.

[0088] For ease of explanation, the check unit obtained by C1 encoding will be referred to as C1 unit, and the check unit obtained by C2 encoding will be referred to as C2 unit. The size of each check unit can be the same as the size of the data unit. For example, when the length of a data unit (the amount of data included in the data unit) is 1 byte, the length of each C1 unit and each C2 unit is also 1 byte. C1 encoding and C2 encoding can use the same encoding technique or different encoding techniques. The encoding techniques applicable to the embodiments of this application include, but are not limited to, Reed-Solomon (RS) codes, low-density parity-check codes (LDPC), polar codes, turbo codes, etc. No specific limitation is made; any encoding technique with error correction functionality is applicable to the embodiments of this application.

[0089] It should be understood that Figure 8 The number of verification units in each row and column shown is merely an example; this application does not limit the number of C1 units corresponding to each row of data, or the number of C2 units corresponding to each column of data. Furthermore, the length of each data unit and verification unit is also illustrative, and this application does not limit these aspects. Additionally, in practical applications, the method of dataset partitioning, the number of sub-datasets, the number of ECC units included in each sub-dataset, and the number of ECC units involved in a CWI are all examples, and this application does not limit these aspects. For ease of explanation, this document uses... Figure 5B The structure shown will be described.

[0090] To further improve data reliability, this application improves the method of obtaining CWI-4. After encoding, the four ECC units included in a sub-dataset are shuffled. Each complete ECC is split into small data blocks (such as data units / check units) at the granularity, so that the data blocks of different ECC units are arranged in an interleaved and dispersed manner, replacing the original sequential arrangement of ECC units. Assuming Figure 8 For ECC0, see [link / reference] Figure 9 As shown, in one shuffling method, the first data unit from each of the four ECC units can be arranged, followed by the second data unit, then the third data unit, and so on, until all data units and check units are cross-arranged. In this way, when a certain area of ​​the tape 300 is contaminated, the probability of a large number of errors concentrated in a single ECC unit can be significantly reduced, as can the probability of uncorrectable bit errors (UBE) within the ECC unit. This allows for recovery using the check unit, thereby improving data reliability.

[0091] Step 702: The host 100 writes the encoded data to the tape 300 via the tape drive 200.

[0092] Such as combination Figure 6 Understandably, host 100 sends a write request to tape drive 200, which may include all CWI-4s contained in the dataset. FPGA 211 controls drive component 220 to write each CWI-4 to tape 300. Alternatively, the write request may include all ECC units contained in a dataset, with FPGA 211 determining the CWI-4s included in the dataset.

[0093] Step 703: The tape drive 200 reads the data written from the tape 300 and performs C1 decoding on the read data to obtain the decoding result.

[0094] The tape drive 200 can perform read-after-write verification at CWI-4 granularity, and use Partial Response Maximum Likelihood (PRML) technology to detect signals and perform C1 decoding to obtain the decoding result.

[0095] The decoding result can indicate the number of erroneous units (data units and / or check units) in the data row of each ECC unit involved in CWI-4. Optionally, the decoding result can also indicate the location of the erroneous unit in each ECC unit. Alternatively, the decoding result can indicate the number of ECC units in CWI-4 that failed to decode, where failed ECC units refer to ECC units that include Uncorrectable Bit Errors (UBE).

[0096] Step 704: Host 100 obtains the decoding result from tape drive 200.

[0097] There are several methods for obtaining the data. In some embodiments, the tape drive 200 sends the CWI-4 decoding results to the host 100, and the host 100 passively receives the decoding results sent by the tape drive 200. Optionally, the tape drive 200 sends the data once it receives a CWI-4 decoding result. For example, after receiving the first CWI-4 decoding result, it sends the first CWI-4 decoding result to the host 100, and after receiving the second CWI-4 decoding result, it sends the second CWI-4 decoding result to the host 100. Alternatively, the tape drive 200 sends all the CWI-4 decoding results for a dataset to the host 100 at once.

[0098] In other embodiments, the host 100 can actively obtain the decoding result of the tape drive 200. For example, when the host 100 is in the tape drive 200, the tape drive 200 stores the decoding result in the memory 102, and the host 100 obtains the decoding result from the memory 102.

[0099] Step 705: The host 100 determines whether the data meets the rewrite conditions based on the decoding result. If it does not meet the conditions, the verification is successful and the writing is confirmed. If it does meet the conditions, step 706 is executed.

[0100] Host 100 can make judgments at the CWI-4 level. If a CWI-4 meets the rewrite conditions, the CWI-4 verification fails and needs to be rewritten. Alternatively, host 100 can make judgments at the sub-dataset level. If a sub-dataset meets the rewrite conditions, the sub-dataset verification fails and needs to be rewritten.

[0101] The conditions for rewriting are described below:

[0102] Assume the CWI-4 decoding result indicates the number of erroneous units in each ECC within the CWI-4. Here, the number of erroneous units refers to the sum of the number of erroneous data units and erroneous check units in the data rows of the ECCs involved in the CWI-4. Take a CWI-4 as an example:

[0103] In one example, the rewrite condition (denoted as rewrite condition one) includes: determining whether the number of erroneous units (denoted as e1) in any ECC of the CWI-4 exceeds the C1 coding error correction threshold (denoted as t1). If it does, the CWI-4 decoding is determined to have failed, i.e., the CWI-4 contains UBE. It should be noted that in this example, ECC refers to one row of ECCs included in the CWI-4, not the entire ECC.

[0104] For example, with Figure 9 Taking CWI-4 as an example, combined with Figure 8 and Figure 9 understand, Figure 9 The CWI-4 in the code includes the first rows of ECC0-ECC3. The decoding result of this CWI-4 includes the number of erroneous units in the first row of ECC0, the first row of ECC1, the first row of ECC2, and the first row of ECC3. The number of erroneous units in ECCn refers to the sum of the number of erroneous data units and erroneous check units in the first row of ECCn.

[0105] Based on the decoding result, host 100 can sequentially determine whether the number of erroneous units (e1) in the first line of ECC0 exceeds the C1 encoding error correction threshold (t1), or in other words, whether the first line of ECC0 contains UBE. If e1 exceeds t1 (then the first line of ECC0 contains UBE), then the CWI-4 decoding is determined to have failed. If the first line of ECC0 does not contain UBE, then the host continues to determine whether the first line of ECC1 contains UBE. If it does, then the CWI-4 decoding is determined to have failed. If the first line of ECC1 does not contain UBE, then the host continues to determine whether the first line of ECC2 contains UBE. If it does, then the CWI-4 decoding is determined to have failed. If the first line of ECC2 does not contain UBE, then the host continues to determine the next ECC, until it is determined that the first line of all ECCs does not contain UBE, then the CWI-4 write is determined to have succeeded. Otherwise, if any ECC (first line) contains UBE, then the CWI-4 decoding is determined to have failed. It should be noted that this example uses a serial method for determination. In an alternative method, the host 100 can also determine in parallel whether the first line of each ECC contains UBE. If one or more ECCs (the first line) contain UBE, then the CWI-4 decoding fails.

[0106] Host 100 marks CWI-4 as having failed decoding, i.e., CWI-4 as failing verification.

[0107] Combination Figure 10B In another example, the rewrite condition (referred to as rewrite condition two) includes: Using a subdataset as the granularity, based on the decoding result of a subdataset, host 100 determines whether the number of data lines that failed to decode in a complete ECC within that subdataset (referred to as e2) exceeds the C2 encoding erasure capability (referred to as t2). If it exceeds, it is determined that the ECC contains UBE, i.e., the ECC decoding failed; otherwise, it is determined that the ECC write was successful. This applies if any ECC decoding in the subdataset fails.

[0108] For example, combining Figure 8 and Figure 10A Understanding, assumption Figure 10A The structure of each ECC included in the sub-dataset is as follows: Figure 8As shown, each of ECC0-ECC3 consists of four data rows (row 1: 0-Q0, row 2: 4-Q1, row 3: 8-Q2, row 4: R1-K2). These four data rows form four CWI-4 datasets, denoted as CWI-4A, CWI-4B, CWI-4C, and CWI-4D. Based on the decoding results of this sub-dataset—namely, the decoding results of CWI-4A, CWI-4B, CWI-4C, and CWI-4D—the number of data rows that failed to decode in each ECC is determined. For example, the decoding result of CWI-4A indicates that the first line of ECC3 (including UBE) failed to decode in ECC0-ECC3; the decoding result of CWI-4B indicates that the second line of ECC1 and the second line of ECC2 failed to decode in ECC0-ECC3; the decoding result of CWI-4C indicates that the third line of ECC3 failed to decode in ECC0-ECC3; and the decoding result of CWI-4D indicates that the fourth line of ECC2 failed to decode in ECC0-ECC3. Based on this, it can be determined that the number of data lines that failed to decode in ECC0 is e2 = 0. The number of data lines that failed to decode in ECC1 is e2 = 1 (the second line); the number of data lines that failed to decode in ECC2 is e2 = 2 (the second and fourth lines); and the number of data lines that failed to decode in ECC3 is e2 = 2 (the first and third lines). That is, for each data line containing UBE detected in an ECC, the e2 of that ECC is increased by 1.

[0109] Host 100 can sequentially check if e2 of ECC0 exceeds t2. If it does, it determines that ECC0 contains UBE, meaning ECC0 verification fails (ECC0 decoding fails). If it does not exceed t2, it determines that ECC0 was written successfully, meaning verification passed. Clearly, ECC0 was written successfully here. Host 100 can then continue to check if e2 of the next ECC1 exceeds t2. Similarly, if it does, it determines that ECC1 contains UBE, meaning ECC1 verification fails (ECC1 decoding fails). If it does not exceed t2, it determines that ECC1 was written successfully. Host 100 continues to check if e2 of ECC2 exceeds t2, and so on, until any ECC decoding fails.

[0110] Host 100 marks the ECC and / or sub-dataset that failed decoding, i.e., the ECC and / or sub-dataset that failed verification.

[0111] Step 706: The host rewrites the data that meets the rewrite conditions.

[0112] This application provides various rewrite granularities in its embodiments:

[0113] In some embodiments, host 100 performs refactoring at the dataset level. For example, see... Figure 11 As shown, for the above rewrite condition two, when host 100 determines in step 705 that any ECC or sub-dataset verification fails, host 100 rewrites the entire dataset. Optionally, in the above rewrite condition one, when host 100 determines in step 705 that any CWI-4 verification fails, host 100 rewrites the entire dataset.

[0114] It should be noted that the dataset rewritten to tape 300 is the original dataset. After the host 100 writes the dataset to tape 300 for the first time, it can temporarily cache the dataset. If the dataset passes the verification in subsequent iterations, it can be released / deleted. If the dataset fails the verification and needs to be rewritten, the cached dataset is rewritten and sent to tape drive 200, and the host 100 is instructed to rewrite the dataset at other locations on tape 300.

[0115] It should be noted that when the rewrite granularity is the entire dataset, the write granularity can still be CWI-4. The rewrite location can be specified by host 100. For example, the rewrite location can be after the original dataset being written. Regarding the choice of the rewrite location, besides... Figure 11 In addition to rewriting backwards, it is also possible to select the upper and lower regions in that direction based on the direction of tape movement, such as... Figure 12 As shown.

[0116] The above design ensures that the mapping and length between user data and the physical location of the magnetic tape are fixed, solving the problem of uncertain mapping position and length of user data (dataset) to magnetic tape in the prior art. Compared with the existing technical solutions, which are only applicable to streaming storage scenarios such as storing movies and other sequentially read data, the embodiments of this application are applicable to more scenarios. When managing user data in dimensions, only the mapping relationship between user data and the starting address (or offset) of the physical location of the magnetic tape needs to be recorded. The process of reading user data is also simpler. For the basic amount of magnetic tape, this can significantly reduce the data maintenance and management overhead and improve the data reading efficiency.

[0117] In other embodiments, host 100 may perform rewriting at the CWI-4 granularity. For example, host 100 may only rewrite CWI-4 values ​​marked as failing verification. Figure 13 This is a schematic diagram of an implementation architecture for cache rewriting provided in an embodiment of this application. See also... Figure 13As shown in (a), each sub-dataset is configured with a buffer area to record CWI-4s that fail verification and to cache the first write data of that CWI-4. After the entire dataset is written, the data in the buffer will be rewritten later in the dataset, such as... Figure 13 As shown in (b). It should be noted that in this method, the order of CWI-4 stored in tape 300 is disordered. When the user reads the data, the host 100 or tape drive 200 needs to read the entire dataset, adjust the order of CWI-4, restore it to the original order of the dataset, and then return it to the user.

[0118] In this embodiment, the rewrite conditions can be user-defined. Optionally, the host 100 can provide a user-friendly interface, allowing users to easily input or modify rewrite conditions. For example, users can set the C1 encoding error correction threshold (i.e., the value of t1) and / or the C2 encoding erasure threshold (i.e., the value of t2) based on one or more indicators such as rewrite probability, reserved space, and reliability requirements. A detailed description follows:

[0119] This application proposes a data rewriting scheme based on reserved redundancy, combined with Figure 10B Understanding. Given C1 encoding parameters (N1, K1) and C2 encoding parameters (N2, K2), where N1 and N2 are codeword lengths, and K1 and K2 are information dimensions. The codeword length refers to the total length including user information and verification information. Therefore, the error correction capability of C1 encoding is T1 = (N1 – K1) / 2, and the erasure capability of C2 encoding is T2 = N2 – K2. It should be noted that in this embodiment, since C1 encoding does not know the location of the erroneous unit during error correction, its error correction capability is half the length of the verification information. In contrast, C2 encoding operates on the premise that the location of the erroneous unit is known; therefore, its erasure capability is equal to the length of the verification information.

[0120] During the write-after-read verification process, this embodiment of the application reserves a portion of redundant length for both C1 encoding and C2 encoding for error correction or deletion, thus determining the reliability of data writing in a more stringent manner. For example, if a redundant length R1 (0≤R1≤N1-K1) is reserved for C1 encoding, then the error correction capability of C1 encoding becomes t1=(N1–K1–R1) / 2, t1≤T1; similarly, if a redundant length R2 (0≤R2≤N2–K2) is reserved for C2 encoding, then the deletion capability of C2 encoding becomes t2=N2–K2–R2, t2≤T2. That is, the error correction threshold for C1 encoding = t1, and the deletion threshold for C2 encoding = t2.

[0121] In this embodiment, the reserved redundancy lengths R1 and R2 are variable, and correspondingly, the C1 encoding error correction threshold t1 and the C2 encoding erasure threshold t2 are also variable. It is worth noting that in this embodiment, the reserved redundancy lengths R1 and R2 can be used only to adjust the C1 encoding error correction threshold and the C2 encoding erasure threshold. In reality, during encoding, the codeword length, information dimension, and check information length do not change. That is, the actual C1 encoding error correction capability remains T1 = (N1 – K1) / 2, and the C2 encoding erasure capability remains T2 = N2 – K2; that is, the C1 and C2 encoding erasure capabilities remain unchanged. Therefore, this embodiment also allows for more flexible rewriting of the condition settings and rewriting methods, enabling flexible settings for different application scenarios without modifying the hardware.

[0122] For example, the C1 encoding parameters and C2 encoding parameters used by host 100 are RS(211,199) and RS(192,168) respectively. That is, the error correction capability T1 of C1 encoding is 6 bytes (B), and the erasure capability T2 of C2 encoding is 24 bytes. During read-write verification, the C1 encoding reserves a redundancy length of 4 bytes, so the C1 encoding error correction threshold t1 = 4 bytes; the C2 encoding reserves a redundancy length of 7 bytes, so the C2 encoding erasure capability t2 = 17 bytes. Therefore, when the decoding result indicates that the length of the erroneous unit in the ECC within CWI-4 exceeds 4 bytes (or the number of erroneous units exceeds 4), host 100 will record it in that ECC unit. When the length of the erroneous unit in any column of data (including the user information part and the verification information part) in any ECC unit exceeds 17 bytes, host 100 determines that the ECC unit verification fails, and host 100 can rewrite the current dataset at another location on tape 300. Based on the current configuration, when the raw bit error rate (RBER) of PRML output is 1e-3, the rewrite probability is 3.43‰.

[0123] For another example, during read-write verification, the C1 encoding has a reserved redundancy length of 2 bytes, and the C1 encoding error correction threshold t1 = 5 bytes; the C2 encoding has a reserved redundancy length of 16 bytes, and the C2 encoding erasure capability t2 = 8 bytes. Therefore, when the decoding result indicates that the length of the erroneous unit in the ECC unit within CWI-4 exceeds 5 bytes, the host 100 will record it in that ECC unit. When the length of the erroneous unit in any column of data in any ECC unit exceeds 8 bytes, the host 100 determines that the ECC unit verification has failed, and the host 100 can rewrite the current dataset at another location on the tape 300. Based on the current configuration, when the raw bit error rate (RBER) of the PRML output is 1e-3, the rewrite probability is 5.76‰.

[0124] Figure 14 Based on experimental data obtained by those skilled in the art, it can be seen that different rewrite probabilities can be obtained by modifying different reserved redundancy lengths (or numbers) in the embodiments of this application. A longer reserved redundancy length results in a higher rewrite probability, stricter verification, and higher data reliability. Conversely, a shorter reserved redundancy length results in a lower rewrite probability and relatively lower data reliability. Therefore, through the above design, users can configure rewrite conditions based on one or more indicators such as reserved redundancy length, rewrite probability, and data reliability, thereby improving rewrite flexibility.

[0125] Based on the same inventive concept as the method embodiments, this application also provides a data rewriting apparatus for performing the above-described... Figure 7 The method described in this embodiment describes the behavior of host 160. For example... Figure 15 As shown, in one example, the data rewriting device 1500 includes an acquisition module 1501, a verification module 1502, and a rewriting module 1503. Optionally, it also includes a communication module 1504 and a cache module 1505. Specifically, in the data rewriting device 1500, the modules are connected to each other through a communication path.

[0126] The acquisition module 1501 is used to acquire the decoding result of a data block read from a magnetic tape by a tape drive. The data block includes multiple data sub-blocks, and any data sub-block includes multiple data units and at least one check unit. The at least one check unit is obtained by encoding the multiple data units. The decoding result of the data block indicates the number of erroneous data units and / or check units in each of the one or more data sub-blocks included in the data block. See details [link to documentation]. Figure 7 The description of step 704 in the method embodiment will not be repeated here.

[0127] Verification module 1502 is used to determine whether the data block passes verification based on encoding capability information, wherein the encoding capability information includes a first encoding error correction threshold and a second encoding erasure threshold; if the number of data sub-blocks that fail decoding in the data block exceeds the second encoding erasure threshold, then the data block is determined to fail verification; the data sub-blocks that fail decoding refer to data sub-blocks containing erroneous data units and / or verification units whose number exceeds the first encoding error correction threshold; see details [link to relevant documentation]. Figure 7 The description of step 705 in the method embodiment will not be repeated here.

[0128] The rewrite module 1503 is used to rewrite the data blocks that failed the verification. See details below. Figure 7 The description of step 704 in the method embodiment will not be repeated here. For details, please refer to [link to relevant documentation]. Figure 7The description of step 706 in the method embodiment will not be repeated here.

[0129] In one possible implementation, the at least one verification unit is the at least one first verification unit; the first encoding error correction threshold is determined based on the first encoding parameter; or the first encoding error correction threshold is determined based on the first encoding parameter and the user-set first encoding reserved verification length; the first encoding parameter is used to indicate the total length of the at least one first verification unit in any data block, and the first encoding reserved verification length is not greater than the total length of the at least one first verification unit.

[0130] In one possible implementation, the second encoding error correction threshold is determined based on the second encoding parameter; or the second encoding error correction threshold is determined based on the second encoding parameter and the user-set second encoding reserved verification length; the second encoding parameter is used to indicate the total length of at least one second verification unit corresponding to each column of data in the data block, and the second encoding reserved verification length is not greater than the total length of the at least one second verification unit.

[0131] In one possible implementation, the first reserved check length and / or the second reserved check length are determined based on the rewrite rate index and / or reliability index.

[0132] In one possible implementation, the communication module 1504 is configured to send a first write request to the tape drive, the first write request comprising a plurality of data blocks to be written; see details below. Figure 7 The description of step 702 in the method embodiment will not be repeated here. The cache module 1505 is used to cache the plurality of data blocks;

[0133] When the rewrite module 1503 rewrites the data blocks that failed the verification, it is specifically used to: control the acquisition module to acquire the cached plurality of data blocks; and send a second write request to the tape drive through the communication module, the second write request including the plurality of data blocks, the second write request being used to request the rewriting of the plurality of data blocks onto the tape. See details [link to relevant documentation]. Figure 7 The description of step 706 in the method embodiment will not be repeated here.

[0134] It should be noted that the module division in this embodiment is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. The functional modules in this embodiment can be integrated into one module, or each module can exist physically separately, or two or more modules can be integrated into one module. For example, the acquisition module 1501 and the output module 1504 can be integrated into one module. The integrated units described above can be implemented in hardware or as software functional units.

[0135] This application also provides a computing device 1600. For example... Figure 16 As shown, the computing device 1600 includes a bus 1602, a processor 1604, a memory 1606, and a communication interface 1608. The processor 1604, the memory 1606, and the communication interface 1608 communicate with each other via the bus 1602. The computing device 1600 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in the computing device 1600.

[0136] The 1602 bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, Figure 16 The bus 1602 may be represented by a single line, but this does not mean that there is only one bus or one type of bus. The bus 1602 may include a path for transmitting information between various components of the computing device 1600 (e.g., memory 1606, processor 1604, communication interface 1608).

[0137] Processor 1604 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0138] The memory 1606 may include volatile memory, such as random access memory (RAM). The processor 1604 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0139] In one possible design, the memory 1606 stores executable program code, which the processor 1604 executes to implement the functions of the aforementioned acquisition module 1501, verification module 1502, rewrite module 1503, communication module 1504, and cache module 1505, thereby realizing the data rewriting method. That is, the memory 1606 stores instructions for the data rewriting device 1600 to execute the data rewriting method provided in this application.

[0140] This application also provides a computing device cluster. The computing device cluster includes at least one computing device. The computing device may be a server. In some embodiments, the computing device may also be a desktop computer, a laptop computer, or a smartphone, or other terminal device.

[0141] like Figure 17 As shown, the computing device cluster includes at least one computing device 1600. The memory 1606 of one or more computing devices 1600 in the computing device cluster may store the same instructions for performing data rewriting methods.

[0142] In some possible implementations, the memory 1606 of one or more computing devices 1600 in the computing device cluster may also store partial instructions for executing the data rewriting method. In other words, a combination of one or more computing devices 1600 can jointly execute the instructions for executing the data rewriting method.

[0143] It should be noted that the memory 1606 in different computing devices 1600 within the computing device cluster can store different instructions, each used to execute a portion of the functions of the data rewriting device 1600. That is, the instructions stored in the memory 1606 of different computing devices 1600 can implement the functions of one or more modules among the acquisition module 1501, model matching module 1502, simulation module 1503, output module 1504, fitting module 1505, synthesis module 1506, and recognition module 1507.

[0144] Based on the above embodiments, this application also provides a computer program that, when run on a computer, causes the computer to perform... Figure 7 The illustrated embodiment provides a data rewriting method.

[0145] Based on the above embodiments, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a computer, causes the computer to perform... Figure 7 The illustrated embodiment provides a data rewriting method. The storage medium can be any available medium accessible to a computer. For example, but not limited to, a computer-readable medium can include RAM, ROM, EEPROM, CD-ROM or other optical disk storage, magnetic disk storage media or other magnetic storage devices, or any other medium capable of carrying or storing desired program code having an instruction or data structure form and accessible to a computer.

[0146] Based on the above embodiments, this application also provides a chip, which is used to read a computer program stored in a memory and implement... Figure 7 The illustrated embodiment provides a data rewriting method.

[0147] Based on the above embodiments, this application provides a chip system including a processor for supporting computer devices to implement... Figure 7 The illustrated embodiment provides a data rewriting method. In one possible design, the chip system further includes a memory for storing programs and data necessary for the computer device. The chip system may consist of chips or may include chips and other discrete components.

[0148] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0149] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0150] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0151] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0152] Obviously, those skilled in the art can make various modifications and variations to this application without departing from the scope of protection of this application. Therefore, if such modifications and variations fall within the scope of the claims of this application and their equivalents, this application also intends to include such modifications and variations.

Claims

1. A data rewriting method, characterized in that, The method includes: The decoding result of a data block read from a magnetic tape is obtained by the tape drive. The data block includes multiple data sub-blocks, and any data sub-block includes multiple data units and at least one check unit. The at least one check unit is obtained by encoding the multiple data units. The decoding result of the data block indicates the number of erroneous data units and / or check units in each of the one or more data sub-blocks included in the data block. The data block is determined to pass the verification based on the coding capability information, which includes a first coding error correction threshold and a second coding erasure threshold. If the number of data sub-blocks that fail to decode in the data block exceeds the second encoding erasure threshold, then the data block is determined to fail the verification; the data sub-block that fails to decode refers to the data sub-block in which the number of erroneous data units and / or verification units exceeds the first encoding error correction threshold; The data blocks that failed the verification were rewritten.

2. The method as described in claim 1, characterized in that, The at least one verification unit is the at least one first verification unit; The first encoding error correction threshold is determined based on the first encoding parameters; or the first encoding error correction threshold is determined based on the first encoding parameters and the first encoding reserved check length set by the user. The first encoding parameter is used to indicate the total length of the at least one first check unit in any data block, and the first encoding reserved check length is not greater than the total length of the at least one first check unit.

3. The method as described in claim 1 or 2, characterized in that, The second encoding error correction threshold is determined based on the second encoding parameters; or the second encoding error correction threshold is determined based on the second encoding parameters and the user-set second encoding reserved check length. The second encoding parameter is used to indicate the total length of at least one second verification unit corresponding to each column of data in the data block, and the reserved verification length of the second encoding is not greater than the total length of the at least one second verification unit.

4. The method as described in claim 2 or 3, characterized in that, The first reserved verification length and / or the second reserved verification length are determined based on the rewrite rate index and / or reliability index.

5. The method according to any one of claims 2-4, characterized in that, Before obtaining the decoding result of the data block read from the tape drive, the process also includes: Send a first write request to the tape drive, the first write request including multiple data blocks to be written; Cache the multiple data blocks; The rewriting of the data block that failed the verification includes: Retrieve the cached data blocks; A second write request is sent to the tape drive, the second write request including the plurality of data blocks, the second write request being used to request the rewriting of the plurality of data blocks into the tape.

6. The method as described in claim 5, characterized in that, The storage location of the multiple data blocks included in the second write request on the magnetic tape is different from the storage location of the multiple data blocks included in the first write request on the magnetic tape.

7. The method as described in claim 5 or 6, characterized in that, Before sending the first write request to the tape drive, the method further includes: Retrieve the user data to be written; The user data is divided into multiple data subsets, and any data subset is divided into N sub-data, where N is a positive integer; The first encoding parameter is used to encode multiple data units included in any row of data in the first sub-data to obtain at least one first verification unit; the first sub-data is any one of the N sub-data; The data units in the same column of the first sub-data are encoded using the second encoding parameters to obtain at least one second verification unit; The remaining sub-data are encoded using the same encoding method used for the first sub-data to obtain the multiple data blocks.

8. A data rewriting apparatus, characterized in that, The device includes: An acquisition module is used to acquire the decoding result of a data block read from a magnetic tape by a tape drive. The data block includes multiple data sub-blocks, and any data sub-block includes multiple data units and at least one check unit. The at least one check unit is obtained by encoding the multiple data units. The decoding result of the data block indicates the number of erroneous data units and / or check units in each of the one or more data sub-blocks included in the data block. The verification module is used to determine whether the data block passes verification based on the encoding capability information, which includes a first encoding error correction threshold and a second encoding erasure threshold. If the number of data sub-blocks that fail to decode in the data block exceeds the second encoding erasure threshold, then the data block is determined to fail the verification; the data sub-block that fails to decode refers to the data sub-block in which the number of erroneous data units and / or verification units exceeds the first encoding error correction threshold; The rewrite module is used to rewrite the data blocks that fail the verification.

9. The apparatus as claimed in claim 8, characterized in that, The at least one verification unit is the at least one first verification unit; The first encoding error correction threshold is determined based on the first encoding parameters; or the first encoding error correction threshold is determined based on the first encoding parameters and the first encoding reserved check length set by the user. The first encoding parameter is used to indicate the total length of the at least one first check unit in any data block, and the first encoding reserved check length is not greater than the total length of the at least one first check unit.

10. The apparatus as claimed in claim 8 or 9, characterized in that, The second encoding error correction threshold is determined based on the second encoding parameters; or the second encoding error correction threshold is determined based on the second encoding parameters and the user-set second encoding reserved check length. The second encoding parameter is used to indicate the total length of at least one second verification unit corresponding to each column of data in the data block, and the reserved verification length of the second encoding is not greater than the total length of the at least one second verification unit.

11. The apparatus as claimed in claim 9 or 10, characterized in that, The first reserved verification length and / or the second reserved verification length are determined based on the rewrite rate index and / or reliability index.

12. The apparatus according to any one of claims 9-11, characterized in that, The device also includes a communication module; A communication module is used to send a first write request to the tape drive, the first write request including multiple data blocks to be written; A caching module is used to cache the multiple data blocks; When the rewrite module rewrites the data blocks that fail the verification, it is specifically used to: control the acquisition module to acquire the cached multiple data blocks; and send a second write request to the tape drive through the communication module. The second write request includes the multiple data blocks and is used to request the rewriting of the multiple data blocks into the tape.

13. The apparatus as claimed in claim 12, characterized in that, The storage location of the multiple data blocks included in the second write request on the magnetic tape is different from the storage location of the multiple data blocks included in the first write request on the magnetic tape.

14. A computing device cluster, characterized in that, It includes at least one computing device, each computing device including a processor and memory; The processor of the at least one computing device is configured to execute instructions stored in the memory of the at least one computing device to cause the cluster of computing devices to perform the method as described in any one of claims 1 to 7.

15. A computer program product containing instructions, characterized in that, When the instruction is executed by the computing device cluster, the computing device cluster causes the computing device cluster to perform the method as described in any one of claims 1 to 7.

16. A computer-readable storage medium, characterized in that, Includes computer program instructions, which, when executed by a cluster of computing devices, perform the method as described in any one of claims 1 to 7.