Construction method, device, storage device and electronic device for storing data in hard disk

By determining the logical address of the target sector in the hard disk and acquiring and modifying the stored data, the problem of low data accuracy when constructing UNC data in the prior art is solved, and a higher data accuracy is achieved.

CN119781698AActive Publication Date: 2025-04-08ZHEJIANG DAHUA TECH CO LTD

Patent Information

Application Number
CN202510282505.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-11
Publication Date
2025-04-08
Estimated Expiration
2045-03-11

AI Technical Summary

Technical Problem

When constructing UNC data in the prior art, the data accuracy is low and the simulation method is uncontrollable, so it is impossible to determine whether the UNC processing flow has been triggered.

Method used

By determining the target logical address of the target sector in the target hard disk where the wrong data is to be written, the first data stored in the target sector is obtained, the second data of the target number is determined in the data, and the third data is modified to obtain the constructed third data, and the third data is written to the target sector.

Benefits of technology

Improve the accuracy of constructing data, ensure that the target number of data in the specified area is modified, thus solving the problem of low data accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119781698A_ABST
    Figure CN119781698A_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides a method, device, storage device and electronic device for constructing hard disk storage data, wherein the method comprises: determining the target logical address of the target sector of the target hard disk to which the error data is to be written; obtaining the first data stored in the target sector based on the target logical address; determining the target number of second data in the first data, and modifying the second data to obtain the third data, wherein the target number is greater than a preset threshold; and writing the third data to the target sector. Through the present invention, the technical problem of low accuracy of constructed data existing in the related art is solved, and the technical effect of improving the accuracy of constructed data can be achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of firmware, and in particular, to a construction method, device, storage device and electronic device for storing data on a hard disk. Background Art

[0002] In the related art, when constructing UNC (Uncorrectable Bit Errors) data, it is usually achieved by artificially simulating bit flipping by taking advantage of the unreliable characteristics of NAND storage particles in a temperature box under high temperature environment. However, the overall simulation method is uncontrollable, and it is unknown whether UNC and other scenarios will be simulated, the number of UNC simulations is unknown, and whether the UNC processing flow is triggered is also unknown, resulting in low accuracy of the constructed data.

[0003] It can be seen from this that there is a technical problem of low accuracy of constructed data in the related technology.

[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solution has been proposed yet. Summary of the invention

[0005] The embodiments of the present invention provide a method and device for constructing hard disk storage data, a storage device and an electronic device, so as to at least solve the technical problem of low accuracy of constructed data existing in the related art.

[0006] According to one embodiment of the present invention, there is provided a method for constructing a hard disk storage data, comprising: determining a target logical address of a target sector in a target hard disk into which erroneous data is to be written; acquiring first data stored in the target sector based on the target logical address; determining a target quantity of second data in the first data, and modifying the second data to obtain third data, wherein the target quantity is greater than a preset threshold; and writing the third data to the target sector.

[0007] In an exemplary embodiment, obtaining the first data stored in the target sector based on the target logical address includes: obtaining a mapping table from the logical address to the physical address of the target hard disk; determining a target physical address corresponding to the target logical address in the mapping table; and obtaining the first data from the target physical address of the target sector.

[0008] In an exemplary embodiment, determining a target quantity of second data in the first data includes: determining an encryption method and a verification method for the first data; decrypting the first data according to a decryption method corresponding to the encryption method to obtain fourth data; decrypting the fourth data according to the verification method to obtain fifth data; and determining the target quantity of the second data in the fifth data.

[0009] In an exemplary embodiment, determining the target quantity of the second data in the fifth data includes one of the following: randomly determining the second data from the fifth data; determining the data position included in the received data acquisition instruction, and determining the data included in the fifth data and located at the data position as the second data.

[0010] In an exemplary embodiment, writing the third data to the target sector includes: encrypting the third data to obtain sixth data; verifying the sixth data to obtain seventh data; and writing the seventh data to the target sector.

[0011] In an exemplary embodiment, after writing the third data to the target sector, the method further includes: testing the target hard disk in a preset manner.

[0012] According to another embodiment of the present invention, there is provided a device for constructing a hard disk for storing data, comprising: a determination module for determining a target logical address of a target sector in a target hard disk to which erroneous data is to be written; an acquisition module for acquiring first data stored in the target sector based on the target logical address; a modification module for determining a target number of second data in the first data, and modifying the second data to obtain third data, wherein the target number is greater than a preset threshold; and a writing module for writing the third data to the target sector.

[0013] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when run.

[0014] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0015] According to yet another embodiment of the present invention, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps of the method described in each embodiment of the present application are implemented.

[0016] Through the present invention, after determining the target logical address of the target sector of the target hard disk where the erroneous data is to be constructed, the first data stored in the target sector can be obtained through the target logical address, and the target amount of second data can be determined in the first data, and modified to obtain the constructed third data, and the third data can be written to the target sector to complete the entire data construction process. Since the first data in the specified area (i.e., the target sector) can be modified by the target amount, the technical problem of low accuracy of constructed data in the related art can be solved, and the technical effect of improving the accuracy of constructed data can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a hardware structure block diagram of a mobile terminal of a construction method for storing data on a hard disk according to an embodiment of the present invention;

[0018] Figure 2 is a flow chart of a construction method for storing data on a hard disk according to an embodiment of the present invention;

[0019] Figure 3 is a data flow process diagram according to an embodiment of the present invention;

[0020] Figure 4 is a schematic diagram of a testing device according to an embodiment of the present invention;

[0021] Figure 5 is a flow chart of a method for constructing a hard disk to store data according to a specific embodiment of the present invention;

[0022] Figure 6 4 is a structural block diagram of a device for storing data on a hard disk according to an embodiment of the present invention. DETAILED DESCRIPTION

[0023] Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and in combination with the embodiments.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0025] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 FIG. 1 is a hardware structure block diagram of a mobile terminal of a method for constructing hard disk data storage according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0026] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the construction method of the hard disk storage data in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0027] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0028] In this embodiment, a method for constructing hard disk data storage is provided. Figure 2 is a flow chart of a method for constructing a hard disk to store data according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:

[0029] Step S202, determining a target logical address of a target sector in a target hard disk where error data is to be written;

[0030] Step S204, acquiring first data stored in the target sector based on the target logical address;

[0031] Step S206, determining second data of a target quantity in the first data, and modifying the second data to obtain third data, wherein the target quantity is greater than a preset threshold;

[0032] Step S208: writing the third data into the target sector.

[0033] In the above embodiment, the target hard disk can be a new type of memory, such as a solid state drive (SSD), a hybrid hard disk (SSHD), etc. The memory of the target hard disk can use NAND storage particles. After the target hard disk is used for a long time, due to the wear of the NAND storage particles themselves or the loss of electrons, high and low temperatures, etc., the data will be bit flipped. When the bit flip exceeds a certain error correction capability threshold, it will be impossible to correct it. At this time, the data will appear UNC (that is, the data will become the above-mentioned error data to be written). It can be understood that an unrepairable bit error has occurred in the flash memory device, which means that even if the target hard disk itself has exhausted all fault tolerance means, the data of the target sector can no longer be read correctly. Therefore, quickly constructing UNC data for testing can timely discover errors in the hard disk and intervene as early as possible.

[0034] In the above embodiment, the target logical address can be understood as an lba (Logical Block Addressing) data logical address, which can be understood as a method for addressing the target hard disk, and each storage block in the target hard disk can be mapped to a unique logical address, so that the system can access the data in the target hard disk through the logical address instead of the physical address, which can simplify the management and data access of the target hard disk to a certain extent. In the process of addressing the target hard disk, data can usually be addressed through a combination of sectors. Therefore, lba can regard the target hard disk as a flat logical storage area, and each storage block (i.e., the above target sector) corresponds to a unique logical address. By determining this unique lba data logical address, the target sector of the data UNC to be constructed in the target hard disk can be determined.

[0035] In the above embodiment, the first data stored in the target sector, that is, the data in the corresponding NAND storage particle in the target sector, can be obtained by determining the LBA address. The target number of second data can be determined in the first data, and the second data can be modified to obtain the constructed data UNC (that is, the third data mentioned above) and re-write the constructed third data into the target sector. Among them, the target number can be the number of data randomly selected in the target sector, or it can be determined according to the degree of error correction of the algorithm inside each target sector. However, in order to ensure that the target disk can never be corrected back to a normal state, the target number must be at least greater than a preset threshold, which can be 200, 300, etc., but is not limited to this.

[0036] In the above embodiment, the UNC writing of data of multiple target sectors can also be completed at one time, that is, all required lba data logical addresses can be integrated into a list, and the lba addresses in the list are obtained in sequence for subsequent operations. For example: if a list table contains a logical address of lba1=128k, a logical address of lba2=64k, and a logical address of lba3=512k, the modification and writing of the data of the target sector corresponding to lba1 is completed first, and then the modification and writing of the data of the target sectors corresponding to lba2 and lba3 are completed.

[0037] Through the present invention, after determining the target logical address of the target sector of the target hard disk where the erroneous data is to be constructed, the first data stored in the target sector can be obtained through the target logical address, and the target amount of second data can be determined in the first data, and modified to obtain the constructed third data, and the third data can be written to the target sector to complete the entire data construction process. Since the first data in the specified area (i.e., the target sector) can be modified by the target amount, the technical problem of low accuracy of constructed data in the related art can be solved, and the technical effect of improving the accuracy of constructed data can be achieved.

[0038] Optionally, the execution subject of the above steps may be a processor, a server, or a terminal, but is not limited thereto.

[0039] In an exemplary embodiment, obtaining the first data stored in the target sector based on the target logical address includes: obtaining a mapping table from the logical address to the physical address of the target hard disk; determining a target physical address corresponding to the target logical address in the mapping table; and obtaining the first data from the target physical address of the target sector.

[0040] In the above embodiment, the l2p (Logical to Physical mapping table) table, that is, the mapping table of logical addresses to physical addresses in the solid-state drive, can be queried according to the lba data logical address corresponding to the target sector (that is, the above target logical address). The actual physical location of the ppn (physical page number) data corresponding to the lba logical address (that is, the above target physical address), that is, the actual physical location of the nand storage particle, can be obtained through the l2p table, and the pageread interface of the nand is used to read the real data in the nand corresponding to the lba (that is, the above first data). Among them, the ppn format can be seen in Table 1. As shown in Table 1, ppn can include the ch (Channel) channel, ce (Chip Enable, chip enable), plane plane, block block, page page and cw (Coreword) where the nand particle is located. Among them, the ch channel can be used to store command data from the system on the nand storage particle; the ce signal can be used to enable the controller to communicate with a specific chip and disable other chips; the plane plane can be understood as an independent storage unit in the chip, which can be used to store and manage data; the page page can be understood as the smallest addressable unit in the nand storage particle; the block block can be understood as the smallest unit of erasable operation in the nand storage particle.

[0041] Table 1

[0042]

[0043] In an exemplary embodiment, determining a target quantity of second data in the first data includes: determining an encryption method and a verification method for the first data; decrypting the first data according to a decryption method corresponding to the encryption method to obtain fourth data; decrypting the fourth data according to the verification method to obtain fifth data; and determining the target quantity of the second data in the fifth data.

[0044] In the above embodiment, Figure 3 is a data flow process diagram according to an embodiment of the present invention, such as Figure 3As shown, since the host side of the CPU processor usually needs to first verify the raw data (i.e., the first data mentioned above) through algorithms such as ECC (EllipseCurve Ctyptography, an encryption algorithm based on elliptic curves) when writing the raw data (i.e., the first data mentioned above) into the storage (such as a solid state drive), and randomize the data through encryption algorithms such as AES (Advanced Encryption Standard, Advanced Encryption Standard), if the real data written by the host side is to be obtained (i.e., the fifth data mentioned above), corresponding decryption and de-verification are required, and the target number of second data are selected from the real data.

[0045] In the above embodiment, the process of the AES decryption algorithm (i.e., the decryption method corresponding to the above encryption method) can be divided into three rounds: the initial round, the main round, and the final round. The extended key required for decryption can be determined first, and the order of extension is opposite to that of encryption. In the initial round, the ciphertext and the key of the final round can be XORed through the AddRoundKey function. In the main round, the first data and the round key of the current round can be XORed through the AddRoundKey function, the columns of the first data can be reverse mixed through the MixColumns function, the rows of the first data can be reverse shifted through the ShiftRows function, and the inverse nonlinear substitution (inverse S box) can be applied to each byte of the first data through the SubBytes function. In the final round, the AddRoundKey function, the ShiftRows function, and the SubBytes function in the main round can be executed. After the final round is completed, the decrypted data Plaintext (i.e., the fourth data mentioned above) can be obtained.

[0046] In the above embodiment, the ECC algorithm (i.e., the above verification method) can be used to perform an ECC de-verification operation on the decrypted fourth data, so as to obtain the real raw data (i.e., the above fifth data) that has not been processed by the algorithm. The essence of the ECC de-verification algorithm can be understood as the inverse process of the ECC verification algorithm, which can be used to verify the integrity of the data when the data is read, and correct errors when necessary. The de-verification process may include: reading data and verification code: when reading data, the ECC verification code associated with the data can be read at the same time; recalculating the verification code: the verification code can be recalculated according to the ECC algorithm during the use of the read data; comparing the verification code: the recalculated verification code can be compared with the stored verification code; error detection: if the verification code does not match, it can indicate that there is an error in the data; error correction: if the ECC algorithm supports error correction, the location of the error can be determined according to the verification code, and the error can be corrected; returning data: after the error is detected and corrected, the corrected fifth data can be returned for system use.

[0047] In an exemplary embodiment, determining the target quantity of the second data in the fifth data includes one of the following: randomly determining the second data from the fifth data; determining the data position included in the received data acquisition instruction, and determining the data included in the fifth data and located at the data position as the second data.

[0048] In the above embodiment, after obtaining the final real fifth data written by the host side corresponding to the final lba, the data in the corresponding cw data can be manually modified according to the test requirements, 0 is manually flipped to 1, and 1 is manually flipped to 0, and the target number of flipped second data needs to reach an uncorrectable unc number, wherein the flipped second data can be randomly selected from the fifth data. The flipped second data can also be determined according to the algorithm error correction degree within each target sector, that is, the second data to be flipped in the status data is determined according to the data position included in the received data acquisition instruction.

[0049] In an exemplary embodiment, writing the third data to the target sector includes: encrypting the third data to obtain sixth data; verifying the sixth data to obtain seventh data; and writing the seventh data to the target sector.

[0050] In the above embodiment, due to the characteristics of nand, nand needs to be erased before writing, so the block erase interface on the nand side can be called to erase the current block. Figure 3 , the flipped data (i.e. the third data) can be re-encrypted using the AES encryption algorithm, so that the third data can be re-randomized to obtain the sixth data; the ECC algorithm is continued to be used to perform a check operation on the sixth data, and the obtained seventh data can be re-written into the PPN position corresponding to the target sector LBA by calling the page program interface of NAND, thus completing a round of UNC LBA abnormal data construction and injection.

[0051] In an exemplary embodiment, after writing the third data to the target sector, the method further includes: testing the target hard disk in a preset manner.

[0052] In the above embodiment, normal read and write operations can be performed on the data rewritten to the target sector, or data garbage collection, power-off and other operations of the target sector can be triggered. It can be checked whether the corresponding UNC data meets expectations under various abnormal or normal conditions such as being read, moved, or powered off. At the same time, it can also be checked whether the UNC times and the number of injected UNCs remain equal, so as to determine whether it meets expectations.

[0053] The following is an explanation of the construction method of hard disk data storage in conjunction with a specific implementation method: The above method can be applied to the following test devices: Figure 4 is a schematic diagram of a test device according to an embodiment of the present invention. Figure 4 As shown, the data reading module can be used to read the real data in the corresponding nand storage particle in the target sector, and the data decryption module and the de-verification module can decrypt and de-verify the data of the nand storage particle to obtain the real raw data that has not been processed by the algorithm. The data fault construction module can re-encrypt and verify the real raw data through the data encryption and verification modules to obtain the constructed UNC data. Finally, the data writing module can be used to re-write the constructed UNC data into the target sector, and the data testing module can be used to test whether it meets the expected effect.

[0054] Figure 5 is a flow chart of a method for constructing hard disk data storage according to a specific embodiment of the present invention. Figure 5 As shown, the process may include:

[0055] Step S502, access the lba list address of the UNC to be injected;

[0056] Step S504, query the corresponding ppn physical address in the lp2 table, and use the pageread interface to read the real data;

[0057] Step S506, using the AES algorithm to decrypt and derandomize the data;

[0058] Step S508, performing an ECC de-checking operation using an ECC algorithm;

[0059] Step S510, obtaining real raw data that is not encrypted or scrambled;

[0060] Step S512, according to the upper lba position, obtain the cw range that needs to be modified in the raw data;

[0061] Step S514, when the number of flips from 0 to 1 and from 1 to 0 in cw reaches more than 200 times, the number of unc error bits that cannot be corrected by the algorithm is reached;

[0062] Step S516, calling the blk erase interface to perform an erase operation on the current block;

[0063] Step S518, re-adding ECC check to the raw data after the errorbit is added;

[0064] Step S520, continue to use the ASE algorithm to perform encryption operations to randomize the data;

[0065] Step S522, call the page program interface to rewrite the rawdata+data after modifying errorbit+ecc+aes to the ppn position corresponding to lba;

[0066] Step S524, determining whether all lba list data injection is completed, if yes, executing step S526; if no, executing step S502;

[0067] Step S526, read and write or gc power-off operation is performed normally, and the corresponding unc data status is checked to see whether it meets expectations, whether the unc times are increased, and whether the bad marking strategy meets expectations;

[0068] Step S528, end.

[0069] In the above embodiment, the UNC data of multiple locations can be quickly constructed in batches by constructing an LBA list, and a large amount of UNC data can be constructed in batches in a short time, which has good test efficiency and test effect. In addition, the UNC data of the specified location can be accurately constructed by selecting the LBA address of the target disk area. In a specific firmware code process, such as ordinary reading and writing, GC garbage collection, power-off process, etc., the constructed UNC data can be accurately pre-embedded in advance, which can make it easier to detect potential problems of the product, especially for test difficulties and test pain points, more valuable problems can be excavated, so that the product quality can be very reliably guaranteed.

[0070] In the above embodiments, the traditional test method is time-consuming and laborious, and the test results are unpredictable, and the test results and test quality are unreliable. However, the present invention can read the real host write data model through the AES decryption algorithm, ECC de-verification and other means, and read the L2P and other methods, modify the number of data error bits in the data model in a targeted manner, and then write it for the second time to achieve the purpose of constructing UNC data in the NAND. It can achieve high efficiency standards, low development and testing costs, good test results, and no need to run for a long time through a traditional incubator.

[0071] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods described in each embodiment of the present invention.

[0072] In this embodiment, a construction device for storing data on a hard disk is also provided, and the device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0073] Figure 6 is a structural block diagram of a device for storing data on a hard disk according to an embodiment of the present invention. Figure 6 As shown, the device comprises:

[0074] A determination module 602 is used to determine a target logical address of a target sector in a target hard disk where error data is to be written;

[0075] An acquisition module 604 is configured to acquire first data stored in the target sector based on the target logical address;

[0076] A modification module 606, configured to determine a second data of a target quantity from the first data, and modify the second data to obtain a third data, wherein the target quantity is greater than a preset threshold;

[0077] The writing module 608 is configured to write the third data into the target sector.

[0078] In the above embodiment, the determination module 602 and the acquisition module 604 can correspond to the data reading module in the above test device; the modification module 606 can correspond to the above data decryption, de-verification module and the data reading fault construction module, data encryption, and verification module; the writing module 608 can correspond to the above data writing module.

[0079] In an exemplary embodiment, the acquisition module 604 can acquire the first data stored in the target sector based on the target logical address in the following manner: acquire a mapping table from the logical address to the physical address of the target hard disk; determine the target physical address corresponding to the target logical address in the mapping table; and acquire the first data from the target physical address of the target sector.

[0080] In an exemplary embodiment, the modification module 606 can determine the target quantity of second data in the first data in the following manner: determine the encryption method and verification method of the first data; decrypt the first data according to the decryption method corresponding to the encryption method to obtain fourth data; decrypt the fourth data according to the verification method to obtain fifth data; and determine the target quantity of the second data in the fifth data.

[0081] In an exemplary embodiment, the modification module 606 can determine the target quantity of the second data in the fifth data by at least one of the following methods: randomly determining the second data from the fifth data; determining the data position included in the received data acquisition instruction, and determining the data included in the fifth data and located at the data position as the second data.

[0082] In an exemplary embodiment, the writing module 608 may write the third data to the target sector in the following manner: encrypt the third data to obtain sixth data; verify the sixth data to obtain seventh data; and write the seventh data to the target sector.

[0083] In an exemplary embodiment, the apparatus is configured to: test the target hard disk in a preset manner after writing the third data to the target sector.

[0084] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0085] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.

[0086] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0087] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0088] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0089] An embodiment of the present invention further provides a computer program product, including a computer program, which implements the steps of the method in each embodiment of the present application when the computer program is executed by a processor.

[0090] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0091] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0092] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for constructing a hard disk to store data, characterized in that: include: Determine a target logical address of a target sector in a target hard disk where error data is to be written; Acquire first data stored in the target sector based on the target logical address; Determine second data of a target quantity from the first data, and modify the second data to obtain third data, wherein the target quantity is greater than a preset threshold; The third data is written to the target sector.

2. The method according to claim 1, characterized in that Acquiring first data stored in the target sector based on the target logical address includes: Obtaining a mapping table from the logical address to the physical address of the target hard disk; Determining in the mapping table a target physical address corresponding to the target logical address; The first data is obtained from the target physical address of the target sector.

3. The method according to claim 1, characterized in that The second data of the target quantity determined in the first data includes: Determining an encryption method and a verification method for the first data; Decrypting the first data according to a decryption method corresponding to the encryption method to obtain fourth data; De-checking the fourth data according to the checking method to obtain fifth data; The target amount of the second data is determined in the fifth data.

4. The method according to claim 3, characterized in that The second data for determining the target quantity in the fifth data includes one of the following: randomly determining the second data from the fifth data; The data position included in the received data acquisition instruction is determined, and the data included in the fifth data and located at the data position is determined as the second data.

5. The method according to claim 1, characterized in that Writing the third data to the target sector comprises: encrypting the third data to obtain sixth data; Verifying the sixth data to obtain seventh data; The seventh data is written to the target sector.

6. The method according to claim 1, characterized in that After writing the third data to the target sector, the method further includes: The target hard disk is tested in a preset manner.

7. A device for constructing hard disk data storage, characterized in that: include: A determination module, used for determining a target logical address of a target sector in a target hard disk where error data is to be written; An acquisition module, configured to acquire first data stored in the target sector based on the target logical address; a modification module, configured to determine a second data of a target quantity from the first data, and modify the second data to obtain a third data, wherein the target quantity is greater than a preset threshold; A writing module is used to write the third data into the target sector.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program is configured to execute the method according to any one of claims 1 to 6 when executed.

9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to perform the method according to any one of claims 1 to 6.

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

Citation Information

Patent Citations

  • Bad track repairing method and bad track repairing device

    CN103544995A

  • Hard disk fault maintenance method

    CN111722950A

  • Hard disk, storage system and hard disk capacity marking method

    CN112558859A

  • Error correction capability test method and device, readable storage medium and electronic equipment

    CN113778822A

  • Garbage recycling method, device and equipment for solid state disk and medium

    CN114489489A

Cited By

  • Reading interference processing method and electronic equipment

    CN121029099A