CN117076170A - Hard disk data processing method, device, computer equipment and storage medium - Google Patents

Hard disk data processing method, device, computer equipment and storage medium Download PDF

Info

Publication number
CN117076170A
CN117076170A CN202311010275.9A CN202311010275A CN117076170A CN 117076170 A CN117076170 A CN 117076170A CN 202311010275 A CN202311010275 A CN 202311010275A CN 117076170 A CN117076170 A CN 117076170A
Authority
CN
China
Prior art keywords
physical
data
unit
hard disk
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311010275.9A
Other languages
Chinese (zh)
Inventor
王择珑
王海英
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Juhor Precision Technology Co ltd
Original Assignee
Shenzhen Juhor Precision Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Juhor Precision Technology Co ltd filed Critical Shenzhen Juhor Precision Technology Co ltd
Priority to CN202311010275.9A priority Critical patent/CN117076170A/en
Publication of CN117076170A publication Critical patent/CN117076170A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/079Root cause analysis, i.e. error or fault diagnosis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application relates to the technical field of data storage, and provides a hard disk data processing method, computer equipment and a storage medium. According to the method, the device and the system, the damage condition of the physical unit is detected in real time, if the physical unit is detected to be physically damaged, the physical unit is subjected to regional isolation, the standby unit is allocated, data in the physical unit is backed up to the standby unit, the physical address of the standby unit is updated to the regional management table, when an access request is received, the target physical address corresponding to the request is determined according to the regional management table, and the access request is mapped to target data corresponding to the target physical address. By distributing the spare unit to the physical unit with physical damage, the service life of the hard disk can be prolonged, after the physical unit data is backed up to the spare unit, the logical address of the physical unit and the physical address of the spare unit are stored in the area management table of the control chip in an associated manner, the loss of the data is avoided, and the performance of the solid state disk is maintained.

Description

Hard disk data processing method, device, computer equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and apparatus for processing hard disk data, a computer device, and a storage medium.
Background
Currently, in Solid State Disk (SSD) design, a hard Disk is divided into a plurality of independent physical units for storing data. The read-write abnormality of the hard disk data is divided into two cases, some of which are caused by physical damage of the hard disk and some of which are caused by logical damage of the hard disk. Generally, if the hard disk is damaged due to physical damage, the whole hard disk can only be scrapped, which is not a small loss for users, especially for large-capacity hard disks. If the hard disk is not replaced, the data in the hard disk with physical damage is continuously read and written, and the performance and stability of the solid state hard disk are seriously affected.
Disclosure of Invention
In view of the above, the present application provides a method for processing hard disk data, a computer device and a storage medium, so as to solve the problem of data reading and writing when the hard disk is physically damaged. By shielding the physically damaged area, only the undamaged portion of the hard disk is used, and data can be stored in a short period of time, so that the problem of a large number of users can be solved.
A first aspect of the present application provides a hard disk data processing method, the method comprising:
monitoring whether a physical unit of the hard disk is damaged or not;
if the physical unit is monitored to be physically damaged, carrying out regional isolation on the physical unit;
a standby unit is allocated for the physical unit in the hard disk, and data in the physical unit is backed up to the standby unit;
storing the logical address of the physical unit and the physical address of the standby unit in an area management table in an associated mode, wherein the area management table is stored in a control chip of the hard disk;
when an access request is received, determining a target physical address corresponding to the access request according to the area management table, and mapping the access request to target data corresponding to the target physical address.
In an alternative embodiment, the method further comprises:
when the physical unit is monitored to be not damaged, acquiring the access heat of the physical unit;
judging whether the access heat is greater than a preset access heat threshold;
when the access heat is greater than a preset access heat threshold, predicting the probability of physical damage of the physical unit;
And when the probability of predicting the physical damage of the physical unit exceeds a preset probability threshold, allocating a standby unit for the physical unit in the hard disk, and backing up the data in the physical unit to the standby unit.
In an alternative embodiment, the predicting the probability of physical damage to the physical unit comprises:
determining the model of the physical unit;
collecting historical fault data associated with a target physical unit of a type similar to the model;
acquiring target historical fault data with the fault type of physical damage type in the historical fault data;
obtaining a physical damage fault probability time distribution map based on the fault occurrence time corresponding to the target historical fault data;
and predicting the probability of physical damage to the physical unit in a specified time period based on the physical damage probability time distribution map by using a time sequence model.
In an alternative embodiment, the method further comprises:
when the access request is for updating the target data, acquiring updated data in the access request;
dividing the update data according to the space allowance of the buffer memory of the control chip to obtain a plurality of update sub-data;
The plurality of updated sub-data are cached into a buffer memory of the control chip one by one, and the residual space allowance of the buffer memory is obtained after one updated sub-data is cached each time;
and when the residual space allowance reaches a first preset threshold value, updating the target data according to the updating sub-data cached in the buffer memory.
In an optional implementation manner, the splitting the update data according to the space allowance of the buffer memory of the control chip to obtain a plurality of update sub-data includes:
determining the storage space of the update data in the buffer memory according to the priority of the update data and the space allowance of the buffer memory;
and splitting the update data according to the space allowance of the storage space to obtain a plurality of update sub-data.
In an alternative embodiment, the method further comprises:
when the access request is for reading the target data, copying the target data into the buffer memory;
and reading the target data from the buffer memory.
In an alternative embodiment, the method further comprises:
Obtaining the number of physical units in the hard disk, which are physically damaged;
and when the number reaches a preset number threshold, generating a hard disk damage report and sending the hard disk damage report to a preset terminal.
A second aspect of the present application provides a hard disk data processing apparatus, the apparatus comprising:
the unit monitoring module is used for monitoring whether the physical unit of the hard disk is damaged or not;
the area isolation module is used for carrying out area isolation on the physical unit when the physical unit is monitored to be physically damaged;
the spare allocation module is used for allocating a spare unit for the physical unit in the hard disk and backing up the data in the physical unit to the spare unit;
the updating mapping module is used for storing the logical address of the physical unit and the physical address of the standby unit in an area management table in an associated mode, and the area management table is stored in a control chip of the hard disk;
and the request processing module is used for determining a target physical address corresponding to the access request according to the area management table when the access request is received, and mapping the access request to target data corresponding to the target physical address.
A third aspect of the application provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the hard disk data processing method when executing the computer program.
A fourth aspect of the application provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the hard disk data processing method.
According to the hard disk data processing method, the device, the computer equipment and the storage medium, through detecting the damage condition of the physical units in real time, if physical damage to a certain physical unit is detected, the physical unit is subjected to regional isolation and spare units are allocated, data in the physical unit are backed up to the spare units, the physical address of the spare units is updated to the regional management table, when an access request is received, a target physical address corresponding to the request is determined according to the regional management table, and the access request is mapped to target data corresponding to the target physical address. By distributing the spare unit to the physical unit with physical damage, the service life of the hard disk can be prolonged, after the physical unit data is backed up to the spare unit, the logical address of the physical unit and the physical address of the spare unit are stored in the area management table of the control chip in an associated manner, the loss of the data is avoided, and the performance of the solid state disk is maintained.
Drawings
FIG. 1 is a flow chart of a hard disk data processing method according to an embodiment of the present application;
FIG. 2 is a functional block diagram of a hard disk data processing apparatus according to an embodiment of the present application;
fig. 3 is a block diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings in the embodiments of the present application.
The hard disk data processing method provided by the embodiment of the application is executed by the computer equipment, and correspondingly, the hard disk data processing device is operated in the computer equipment.
Fig. 1 is a flowchart of a hard disk data processing method according to an embodiment of the present application, where the hard disk data processing method specifically includes the following steps.
S11, monitoring whether the physical unit of the hard disk is damaged.
When the hard disk is designed, the hard disk can be divided into a plurality of independent physical units, each physical unit has a unique identifier, and all the physical units are uniformly managed through a set of management system. Each physical unit of the hard disk may be monitored in real time using bad track management techniques.
When a physical unit of the hard disk is monitored to be damaged, whether the physical unit of the hard disk is physically damaged or logically damaged is further monitored. If the hard disk emits abnormal noise, the hard disk cannot be started or has no reaction, and the like, the physical damage of the hard disk is indicated. If the hard disk is capable of starting and rotating normally, but cannot read or write data, it may be due to a logical problem such as a file system corruption, a partition table error, or a file system error.
When physical damage occurs to the physical unit, S12 is performed; when the physical unit is not physically damaged, S13 is performed.
S12, carrying out regional isolation on the physical units.
The hard disk with logic damage can be recovered to a certain extent, and compared with the logic damage, the physical damage is more complex, so that the embodiment of the application can adopt the area isolation technology to carry out the area isolation treatment on the physical unit with the physical damage so as to prevent the data from being read or written, thereby further damaging the physical unit.
S13, acquiring the access heat of the physical unit.
When the physical unit is not physically damaged, in order to protect important data in the physical unit, the access heat of the physical unit can be periodically obtained, so that whether the data in the physical unit is important data or not is determined according to the access heat, and whether backup is needed or not is further judged.
The access heat of the physical unit can be obtained by recording the access times or the access frequency of the physical unit. The more the number of accesses or the higher the access frequency, the higher the access heat, the fewer the number of accesses or the lower the access frequency, the lower the access heat.
S14, judging whether the access heat is larger than a preset access heat threshold.
The preset access heat threshold is a preset critical value for judging whether the data in the physical unit is important data or not.
When the access heat is greater than or equal to a preset access heat threshold, indicating that the data in the physical unit is important data, executing S15; and when the access heat is smaller than the preset access heat threshold, indicating that the data in the physical unit is not important data, and executing S18.
S15, predicting the probability of physical damage of the physical unit, and judging whether the probability exceeds a preset probability threshold.
In an alternative embodiment, the predicting the probability of physical damage to the physical unit comprises:
determining the model of the physical unit;
collecting historical fault data associated with a target physical unit of a type similar to the model;
acquiring target historical fault data with the fault type of physical damage type in the historical fault data;
obtaining a physical damage fault probability time distribution map based on the fault occurrence time corresponding to the target historical fault data;
and predicting the probability of physical damage to the physical unit in a specified time period based on the physical damage probability time distribution map by using a time sequence model.
Different models of physical units may have different reliability and failure modes, so it is necessary to determine the model of each physical unit in the hard disk (i.e., the model of the hard disk) to identify and distinguish between different physical units, and failure data of physical units similar to the model is more suitable for predicting what type of damage and probability of damage to the physical units.
Physical unit fault data of similar types or under similar use conditions can be collected, wherein the historical fault data are historical fault data, and the historical fault data can comprise types, fault occurrence time, fault duration, fault positions and the like. The target historical fault data with the fault type of physical damage is obtained, the probability of physical damage at each time point can be obtained by analyzing the target historical fault data, and the probability of physical damage at each time point can be obtained according to the ratio between the number of hard disks with physical damage at the corresponding time point and the total number of hard disks with physical damage at the corresponding time point. And carrying out histogram processing on the probability of physical damage at each time point to obtain a physical damage probability time distribution map, wherein the distribution map reflects the probability of physical damage of the physical units at different time points. And establishing a time sequence model by using the trend and the mode in the historical fault data, and predicting the probability of physical damage of the physical unit in a specified time period by using the time sequence model.
The probability of physical damage of the physical unit in the appointed time period can be predicted by analyzing the historical fault data and the application time sequence model of the target physical unit with the same or similar model, whether the predicted probability exceeds a preset probability threshold value is judged, and when the probability of physical damage of the physical unit is predicted to exceed the preset probability threshold value, S16 is executed; when the probability of the physical damage of the physical unit is predicted not to exceed the preset probability threshold, S18 is performed.
S16, a standby unit is allocated for the physical unit in the hard disk, and data in the physical unit is backed up to the standby unit.
The hard disk is composed of a control unit, a default reserved area and a physical unit, wherein the physical unit is responsible for storing data, the default reserved area is used for providing a reserved block for replacing a bad block of a storage area, and the control unit is responsible for controlling reading and writing of the data.
When physical damage occurs to a physical unit, a reserved block selection algorithm may be used to allocate a reserved block as a spare unit for the physically damaged physical unit in the default reserved area. After the spare unit is allocated to the physically damaged physical unit, the data in the physically damaged physical unit can be copied to the spare unit, so that the data of the physically damaged physical unit can be backed up.
When physical damage does not occur to the physical unit, but the access heat of the physical unit is greater than or equal to a preset access heat threshold, and the probability of predicting physical damage to the physical unit exceeds the preset probability threshold, a reserved block is allocated as a spare unit to the physical unit with greater access heat and greater probability of predicting physical damage to the physical unit in the default reserved area. For convenience of description, a physical unit having a large access heat and a large probability of predicting occurrence of physical damage will be referred to as a physical unit having a large probability of physical damage. After the spare unit is allocated to the physical unit with the high probability of physical damage, the data in the physical unit with the high probability of physical damage can be copied to the spare unit, so that the advanced backup of important data is realized.
For example, when physical damage occurs to the physical unit a in the hard disk, the reserved block C is selected as a spare physical unit of the physical unit a according to the reserved block selection algorithm, and the reserved block C is in an unused state and is in an empty storage state. And backing up the data a in the physical unit A to the standby unit.
S17, storing the logical address of the physical unit and the physical address of the standby unit in an area management table in an associated mode, wherein the area management table is stored in a control chip of the hard disk.
The mapping relation between the physical address and the logical address of the physical unit is stored in the area management table. When the physical damaged physical unit or the physical unit with the high probability of physical damage is detected, the control chip marks the physical address corresponding to the physical damaged physical unit or the physical unit with the high probability of physical damage as invalid or a fault state in the area management table, and updates the physical address of the corresponding standby unit into the area management table, namely, the physical address, the logical address and the physical address of the standby unit of the physical damaged physical unit are stored in the area management table in a correlated manner.
For example, when physical damage occurs to the physical unit a in the hard disk, the physical address x of the physical unit a in the area management table is marked as invalid, and the physical address m of the spare unit B is correspondingly increased, that is, the logical address y of the physical unit a in the area management table is stored in association with the physical address m.
The hard disk is provided with a control chip, the area management table is stored in the control chip, so that the area management table can be conveniently accessed in the control chip later, and the hard disk is prevented from being damaged due to frequent reading of the area management table.
And S18, when an access request is received, determining a target physical address corresponding to the access request according to the area management table, and mapping the access request to target data corresponding to the target physical address.
When the computer equipment receives the access request, the access request is analyzed to obtain a target logical address to be accessed, and a target physical address corresponding to the target logical address is searched in a region management table of the control chip. And after the target physical address is determined, accessing target data in the solid state disk according to the target physical address, and mapping the access request to the target data for processing.
In some embodiments, when the computer receives the access request, the physical address of the physical unit may be searched in the area management table of the control chip according to the target logical address, and when the physical address of the target physical unit corresponding to the target logical address is searched, whether the physical address of the target physical unit is valid is identified. When the physical address of the target physical unit is valid, then the access request is mapped to data in the physical address of the target physical unit. When the physical address of the target physical unit is invalid, mapping the access request to the data in the physical address of the target standby unit corresponding to the target physical unit.
Illustratively, when the target logical address is y, a valid physical address m corresponding to the logical address y is found in the area management table, and the access request is mapped to the physical unit B.
And when the target data needs to be accessed, the target physical address mapped by the target logical address is queried in the area management table, so that the access to the target data is realized. The mapping relation ensures the abstraction of the logical address, conceals the change of the underlying physical area, and simultaneously provides the advantages of high performance and data redundancy.
The access request may be update target data or read target data.
When the access request is for updating the target data, the access request can be analyzed to obtain updated data in the access request, the updated data are segmented according to the space allowance of the buffer memory of the control chip to obtain a plurality of updated sub-data, the updated sub-data are cached into the buffer memory of the control chip one by one, the residual space allowance of the buffer memory is obtained after each time of caching of the updated sub-data, and when the residual space allowance reaches a first preset threshold, the target data are updated according to the updated sub-data cached in the buffer memory.
After each time an update sub-data is cached, the control chip calculates the remaining space margin of the buffer memory, which represents how much data can be stored in the buffer memory. Once the residual space allowance in the buffer memory reaches a first preset threshold value, the buffer memory is indicated to accumulate enough updated sub-data, and the updating operation can be executed, and at the moment, the updated data in the buffer memory is written into the target physical unit to realize the updating of the target data.
According to the alternative embodiment, the update data is divided into smaller update sub-data and cached one by one, so that the space of the buffer memory can be effectively utilized, and the utilization rate of resources is improved; when the data volume of the updated sub data in the buffer memory reaches the set threshold value, the batch updating is carried out, so that the frequent access and operation to the target physical address can be reduced, the overall performance of the system is improved, and the loss to the hard disk is reduced.
In an optional implementation manner, the splitting the update data according to the space allowance of the buffer memory of the control chip to obtain a plurality of update sub-data includes:
determining the storage space of the update data in the buffer memory according to the priority of the update data and the space allowance of the buffer memory;
And splitting the update data according to the space allowance of the storage space to obtain a plurality of update sub-data.
The priority of the update data may be determined based on different factors, such as the importance of the target data, the frequency of access, or the attributes. The priority of the update data may also be specified in the access request.
By taking priority into account, it is possible to determine which update data should be stored preferentially. For the update data with high priority, more storage space is allocated in the buffer memory, so that the update data can be quickly written into the buffer memory, and then quickly updated to the target physical address, thereby realizing the priority protection of the update data with high priority. For update data with low priority, less storage space is allocated in the buffer memory, so that the occupation of storage resources of update data with high priority is avoided.
According to the optional implementation manner, the priority of the update data stored in the buffer memory is determined according to the priority of the update data and the space allowance of the buffer memory, so that reasonable allocation of the storage space is ensured; and dividing the update data according to the space allowance of the storage space to obtain a plurality of update sub-data, so that the effective utilization of the storage space can be ensured, the phenomenon of data flow congestion is avoided, and the update data can be stored in time for subsequent processing or update operation.
When the access request is to read target data, the target data can be copied into the buffer memory, and the target data can be read from the buffer memory.
Buffer memories generally have lower access delays and higher read speeds, and the use of buffer memories can improve the performance and response speed of reading data. By storing the target data in the buffer memory and reading the target data in the buffer memory, the read request of the computer equipment can be responded more quickly, the access to the target physical address is reduced, and better user experience is provided.
In an alternative embodiment, the method further comprises:
obtaining the number of physical units in the hard disk, which are physically damaged;
and when the number reaches a preset number threshold, generating a hard disk damage report and sending the hard disk damage report to a preset terminal.
When physical damaged physical units in the hard disk are monitored, the number of the physical damaged physical units is recorded in real time, and whether the number of the physical damaged physical units reaches a preset number threshold is judged. When the number of physical units with physical damage reaches a preset number threshold, indicating that the physical damage condition of the hard disk is serious, generating a hard disk damage report and sending the hard disk damage report to a preset terminal, and prompting a user of the preset terminal to replace the hard disk.
The hard disk damage report may include detailed information of the hard disk, such as the hard disk model number, location and number of damaged physical units, etc., and may also contain other relevant information of the type of damage, time stamp, etc.
In the above alternative embodiment, when the number of physical units damaged physically is excessive, the hard disk damage report is generated and sent to the preset terminal in time, for example, the operation interface of the computer device, so as to inform the user of the preset terminal to solve the hard disk damage problem as soon as possible, and ensure the integrity of the data in the hard disk.
According to the embodiment of the application, when the physical units of the hard disk are physically damaged, the data writing is avoided by carrying out area isolation on the physically damaged physical units, the service life of the hard disk is prolonged, after the area isolation, the spare units are allocated to the physically damaged physical units, the data in the physical units are backed up to the spare units, the data loss in the physically damaged physical units is reduced, the physical addresses of the physical units and the physical addresses of the spare units are stored in the area management table in the control chip of the hard disk in an associated manner, when an access request is received, the target physical address corresponding to the access request is determined according to the area management table, and the access request is mapped to the target data corresponding to the target physical address, so that the reading and writing of the physically damaged physical units can be avoided, the hard disk is protected, and users can access the data seamlessly.
Fig. 2 is a functional block diagram of a hard disk data processing apparatus according to a second embodiment of the present invention.
In some embodiments, the hard disk data processing device 20 may include a plurality of functional modules that are comprised of computer program segments. The computer program of the individual program segments in the hard disk data processing device 20 can be stored in a memory of the electronic device and executed by at least one processor to perform the functions of the hard disk data processing (described in detail with reference to fig. 1).
In this embodiment, the hard disk data processing apparatus 20 may be divided into a plurality of functional modules according to the functions performed by the hard disk data processing apparatus. The functional module may include: the system comprises a unit monitoring module 201, a region isolation module 202, a heat acquisition module 203, a heat judging module 204, a probability prediction module 205, a standby allocation module 206, an update mapping module 207, a request processing module 208 and a hard disk reporting module 209. The module referred to in the present invention refers to a series of computer program segments capable of being executed by at least one processor and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The unit monitoring module 201 is configured to monitor whether a physical unit of the hard disk is damaged.
When the hard disk is designed, the hard disk can be divided into a plurality of independent physical units, each physical unit has a unique identifier, and all the physical units are uniformly managed through a set of management system. Each physical unit of the hard disk may be monitored in real time using bad track management techniques.
When a physical unit of the hard disk is monitored to be damaged, whether the physical unit of the hard disk is physically damaged or logically damaged is further monitored. If the hard disk emits abnormal noise, the hard disk cannot be started or has no reaction, and the like, the physical damage of the hard disk is indicated. If the hard disk is capable of starting and rotating normally, but cannot read or write data, it may be due to a logical problem such as a file system corruption, a partition table error, or a file system error.
The area isolation module 202 is configured to perform area isolation on a physical unit that is physically damaged.
The hard disk with logic damage can be recovered to a certain extent, and compared with the logic damage, the physical damage is more complex, so that the embodiment of the application can adopt the area isolation technology to carry out the area isolation treatment on the physical unit with the physical damage so as to prevent the data from being read or written, thereby further damaging the physical unit.
The heat acquiring module 203 is configured to acquire access heat of the physical unit.
When the physical unit is not physically damaged, in order to protect important data in the physical unit, the access heat of the physical unit can be periodically obtained, so that whether the data in the physical unit is important data or not is determined according to the access heat, and whether backup is needed or not is further judged.
The access heat of the physical unit can be obtained by recording the access times or the access frequency of the physical unit. The more the number of accesses or the higher the access frequency, the higher the access heat, the fewer the number of accesses or the lower the access frequency, the lower the access heat.
The heat judging module 204 is configured to judge whether the access heat is greater than a preset access heat threshold.
The preset access heat threshold is a preset critical value for judging whether the data in the physical unit is important data or not.
And when the access heat is greater than or equal to a preset access heat threshold, indicating that the data in the physical unit is important data, and when the access heat is less than the preset access heat threshold, indicating that the data in the physical unit is not important data.
The probability prediction module 205 is configured to predict a probability of physical damage to the physical unit when the access heat is greater than or equal to a preset access heat threshold.
In an alternative embodiment, the predicting the probability of physical damage to the physical unit comprises:
determining the model of the physical unit;
collecting historical fault data associated with a target physical unit of a type similar to the model;
acquiring target historical fault data with the fault type of physical damage type in the historical fault data;
obtaining a physical damage fault probability time distribution map based on the fault occurrence time corresponding to the target historical fault data;
and predicting the probability of physical damage to the physical unit in a specified time period based on the physical damage probability time distribution map by using a time sequence model.
Different models of physical units may have different reliability and failure modes, so it is necessary to determine the model of each physical unit in the hard disk (i.e., the model of the hard disk) to identify and distinguish between different physical units, and failure data of physical units similar to the model is more suitable for predicting what type of damage and probability of damage to the physical units.
Physical unit fault data of similar types or under similar use conditions can be collected, wherein the historical fault data are historical fault data, and the historical fault data can comprise types, fault occurrence time, fault duration, fault positions and the like. The target historical fault data with the fault type of physical damage is obtained, the probability of physical damage at each time point can be obtained by analyzing the target historical fault data, and the probability of physical damage at each time point can be obtained according to the ratio between the number of hard disks with physical damage at the corresponding time point and the total number of hard disks with physical damage at the corresponding time point. And carrying out histogram processing on the probability of physical damage at each time point to obtain a physical damage probability time distribution map, wherein the distribution map reflects the probability of physical damage of the physical units at different time points. And establishing a time sequence model by using the trend and the mode in the historical fault data, and predicting the probability of physical damage of the physical unit in a specified time period by using the time sequence model.
The method comprises the steps of predicting the probability of physical damage of a physical unit in a specified time period by analyzing historical fault data and an application time sequence model of target physical units of the same or similar model, judging whether the predicted probability exceeds a preset probability threshold, distributing a standby unit for the physical unit in the hard disk when the predicted probability of physical damage of the physical unit exceeds the preset probability threshold, and backing up the data in the physical unit to the standby unit; and when the probability of predicting the physical damage of the physical unit does not exceed a preset probability threshold, not processing the physical unit.
And the standby allocation module 206 is configured to allocate a standby unit to the physical unit in the hard disk, and backup data in the physical unit to the standby unit.
The hard disk is composed of a control unit, a default reserved area and a physical unit, wherein the physical unit is responsible for storing data, the default reserved area is used for providing a reserved block for replacing a bad block of a storage area, and the control unit is responsible for controlling reading and writing of the data.
When physical damage occurs to a physical unit, a reserved block selection algorithm may be used to allocate a reserved block as a spare unit for the physically damaged physical unit in the default reserved area. After the spare unit is allocated to the physically damaged physical unit, the data in the physically damaged physical unit can be copied to the spare unit, so that the data of the physically damaged physical unit can be backed up.
When physical damage does not occur to the physical unit, but the access heat of the physical unit is greater than or equal to a preset access heat threshold, and the probability of predicting physical damage to the physical unit exceeds the preset probability threshold, a reserved block is allocated as a spare unit to the physical unit with greater access heat and greater probability of predicting physical damage to the physical unit in the default reserved area. For convenience of description, a physical unit having a large access heat and a large probability of predicting occurrence of physical damage will be referred to as a physical unit having a large probability of physical damage. After the spare unit is allocated to the physical unit with the high probability of physical damage, the data in the physical unit with the high probability of physical damage can be copied to the spare unit, so that the advanced backup of important data is realized.
For example, when physical damage occurs to the physical unit a in the hard disk, the reserved block C is selected as a spare physical unit of the physical unit a according to the reserved block selection algorithm, and the reserved block C is in an unused state and is in an empty storage state. And backing up the data a in the physical unit A to the standby unit.
The update mapping module 207 is configured to store the logical address of the physical unit and the physical address of the spare unit in an area management table, where the area management table is stored in a control chip of the hard disk.
The mapping relation between the physical address and the logical address of the physical unit is stored in the area management table. When the physical damaged physical unit or the physical unit with the high probability of physical damage is detected, the control chip marks the physical address corresponding to the physical damaged physical unit or the physical unit with the high probability of physical damage as invalid or a fault state in the area management table, and updates the physical address of the corresponding standby unit into the area management table, namely, the physical address, the logical address and the physical address of the standby unit of the physical damaged physical unit are stored in the area management table in a correlated manner.
For example, when physical damage occurs to the physical unit a in the hard disk, the physical address x of the physical unit a in the area management table is marked as invalid, and the physical address m of the spare unit B is correspondingly increased, that is, the logical address y of the physical unit a in the area management table is stored in association with the physical address m.
The hard disk is provided with a control chip, the area management table is stored in the control chip, so that the area management table can be conveniently accessed in the control chip later, and the hard disk is prevented from being damaged due to frequent reading of the area management table.
The request processing module 208 is configured to determine, when an access request is received, a target physical address corresponding to the access request according to the area management table, and map the access request to target data corresponding to the target physical address.
When the computer equipment receives the access request, the access request is analyzed to obtain a target logical address to be accessed, and a target physical address corresponding to the target logical address is searched in a region management table of the control chip. And after the target physical address is determined, accessing target data in the solid state disk according to the target physical address, and mapping the access request to the target data for processing.
In some embodiments, when the computer receives the access request, the request processing module 208 may search the area management table of the control chip for the physical address of the physical unit according to the target logical address, and when the physical address of the target physical unit corresponding to the target logical address is found, identify whether the physical address of the target physical unit is valid. When the physical address of the target physical unit is valid, then the access request is mapped to data in the physical address of the target physical unit. When the physical address of the target physical unit is invalid, mapping the access request to the data in the physical address of the target standby unit corresponding to the target physical unit.
Illustratively, when the target logical address is y, a valid physical address m corresponding to the logical address y is found in the area management table, and the access request is mapped to the physical unit B.
And when the target data needs to be accessed, the target physical address mapped by the target logical address is queried in the area management table, so that the access to the target data is realized. The mapping relation ensures the abstraction of the logical address, conceals the change of the underlying physical area, and simultaneously provides the advantages of high performance and data redundancy.
The access request may be update target data or read target data.
When the access request is for updating the target data, the access request can be analyzed to obtain updated data in the access request, the updated data are segmented according to the space allowance of the buffer memory of the control chip to obtain a plurality of updated sub-data, the updated sub-data are cached into the buffer memory of the control chip one by one, the residual space allowance of the buffer memory is obtained after each time of caching of the updated sub-data, and when the residual space allowance reaches a first preset threshold, the target data are updated according to the updated sub-data cached in the buffer memory.
After each time an update sub-data is cached, the control chip calculates the remaining space margin of the buffer memory, which represents how much data can be stored in the buffer memory. Once the residual space allowance in the buffer memory reaches a first preset threshold value, the buffer memory is indicated to accumulate enough updated sub-data, and the updating operation can be executed, and at the moment, the updated data in the buffer memory is written into the target physical unit to realize the updating of the target data.
According to the alternative embodiment, the update data is divided into smaller update sub-data and cached one by one, so that the space of the buffer memory can be effectively utilized, and the utilization rate of resources is improved; when the data volume of the updated sub data in the buffer memory reaches the set threshold value, the batch updating is carried out, so that the frequent access and operation to the target physical address can be reduced, the overall performance of the system is improved, and the loss to the hard disk is reduced.
In an optional implementation manner, the splitting the update data according to the space allowance of the buffer memory of the control chip to obtain a plurality of update sub-data includes:
determining the storage space of the update data in the buffer memory according to the priority of the update data and the space allowance of the buffer memory;
And splitting the update data according to the space allowance of the storage space to obtain a plurality of update sub-data.
The priority of the update data may be determined based on different factors, such as the importance of the target data, the frequency of access, or the attributes. The priority of the update data may also be specified in the access request.
By taking priority into account, it is possible to determine which update data should be stored preferentially. For the update data with high priority, more storage space is allocated in the buffer memory, so that the update data can be quickly written into the buffer memory, and then quickly updated to the target physical address, thereby realizing the priority protection of the update data with high priority. For update data with low priority, less storage space is allocated in the buffer memory, so that the occupation of storage resources of update data with high priority is avoided.
According to the optional implementation manner, the priority of the update data stored in the buffer memory is determined according to the priority of the update data and the space allowance of the buffer memory, so that reasonable allocation of the storage space is ensured; and dividing the update data according to the space allowance of the storage space to obtain a plurality of update sub-data, so that the effective utilization of the storage space can be ensured, the phenomenon of data flow congestion is avoided, and the update data can be stored in time for subsequent processing or update operation.
When the access request is to read target data, the request processing module 208 may copy the target data into the buffer memory, and read the target data from the buffer memory.
Buffer memories generally have lower access delays and higher read speeds, and the use of buffer memories can improve the performance and response speed of reading data. By storing the target data in the buffer memory and reading the target data in the buffer memory, the read request of the computer equipment can be responded more quickly, the access to the target physical address is reduced, and better user experience is provided.
In an alternative embodiment, the hard disk reporting module 209 is configured to:
obtaining the number of physical units in the hard disk, which are physically damaged;
and when the number reaches a preset number threshold, generating a hard disk damage report and sending the hard disk damage report to a preset terminal.
When physical damaged physical units in the hard disk are monitored, the number of the physical damaged physical units is recorded in real time, and whether the number of the physical damaged physical units reaches a preset number threshold is judged. When the number of physical units with physical damage reaches a preset number threshold, indicating that the physical damage condition of the hard disk is serious, generating a hard disk damage report and sending the hard disk damage report to a preset terminal, and prompting a user of the preset terminal to replace the hard disk.
The hard disk damage report may include detailed information of the hard disk, such as the hard disk model number, location and number of damaged physical units, etc., and may also contain other relevant information of the type of damage, time stamp, etc.
In the above alternative embodiment, when the number of physical units damaged physically is excessive, the hard disk damage report is generated and sent to the preset terminal in time, for example, the operation interface of the computer device, so as to inform the user of the preset terminal to solve the hard disk damage problem as soon as possible, and ensure the integrity of the data in the hard disk.
According to the embodiment of the application, when the physical units of the hard disk are physically damaged, the data writing is avoided by carrying out area isolation on the physically damaged physical units, the service life of the hard disk is prolonged, after the area isolation, the spare units are allocated to the physically damaged physical units, the data in the physical units are backed up to the spare units, the data loss in the physically damaged physical units is reduced, the physical addresses of the physical units and the physical addresses of the spare units are stored in the area management table in the control chip of the hard disk in an associated manner, when an access request is received, the target physical address corresponding to the access request is determined according to the area management table, and the access request is mapped to the target data corresponding to the target physical address, so that the reading and writing of the physically damaged physical units can be avoided, the hard disk is protected, and users can access the data seamlessly.
Fig. 3 is a schematic structural diagram of a computer device according to an embodiment of the present application. In the preferred embodiment of the application, the computer device 3 includes a memory 31, at least one processor 32, at least one communication bus 33.
It will be appreciated by those skilled in the art that the configuration of the computer device shown in fig. 3 is not limiting of the embodiments of the present application, and that either a bus-type configuration or a star-type configuration is possible, and that the computer device 3 may include more or less other hardware or software than that shown, or a different arrangement of components.
In some embodiments, the computer device 3 is a device capable of automatically performing numerical calculation and/or information processing according to preset or stored instructions, and its hardware includes, but is not limited to, a microprocessor, an application specific integrated circuit, a programmable gate array, a digital processor, an embedded device, and the like. The computer device 3 may also include other computer devices, including but not limited to any electronic product that can interact with a user by way of a keyboard, mouse, remote control, touch pad, or voice control device, such as a personal computer, tablet, smart phone, digital camera, etc.
It should be noted that the computer device 3 is only used as an example, and other electronic products that may be present in the present application or may be present in the future are also included in the scope of the present application by way of reference.
In some embodiments, the memory 31 stores a computer program that, when executed by the at least one processor 32, performs all or part of the steps in the hard disk data processing method as described. The Memory 31 includes Read-Only Memory (ROM), programmable Read-Only Memory (PROM), erasable programmable Read-Only Memory (EPROM), one-time programmable Read-Only Memory (One-time Programmable Read-Only Memory, OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for computer-readable carrying or storing data.
In some embodiments, the at least one processor 32 is a Control Unit (Control Unit) of the computer device 3, connects the various components of the entire computer device 3 using various interfaces and lines, and performs various functions and processes of the computer device 3 by running or executing programs or modules stored in the memory 31, and invoking data stored in the memory 31. For example, the at least one processor 32, when executing the computer program stored in the memory, implements all or part of the steps of the hard disk data processing method described in the embodiments of the present application; or to implement all or part of the functionality of the hard disk data processing method. The at least one processor 32 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central processing units (Central Processing unit, CPU), microprocessors, digital processing bad block control chips, graphics processors, combinations of various control bad block control chips, and the like.
In some embodiments, the at least one communication bus 33 is arranged to enable connected communication between the memory 31 and the at least one processor 32 or the like. Although not shown, the computer device 3 may further comprise a power source (such as a battery) for powering the various components, preferably the power source is logically connected to the at least one processor 32 via a power management means, whereby the functions of managing charging, discharging, and power consumption are performed by the power management means. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The computer device 3 may further include various sensors, bluetooth modules, wi-Fi modules, etc., which will not be described in detail herein.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing a computer device (which may be a personal computer, a computer device, or a network device, etc.) or processor (processor) to perform portions of the methods described in the various embodiments of the application.
In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is merely a logical function division, and there may be other manners of division when actually implemented.
The modules described as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms as well, unless the context clearly indicates to the contrary. It should also be understood that the term "and/or" as used in this disclosure is intended to encompass any or all possible combinations of one or more of the listed items. The terms "first," "second," and the like, are used for descriptive purposes only and are not to be construed as implying or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include one or more such feature, and in the description of embodiments of the application, unless otherwise indicated, the meaning of "a plurality" is two or more.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the application is subject to the protection scope of the claims.

Claims (10)

1. A method for processing hard disk data, the method comprising:
monitoring whether a physical unit of the hard disk is damaged or not;
if the physical unit is monitored to be physically damaged, carrying out regional isolation on the physical unit;
a standby unit is allocated for the physical unit in the hard disk, and data in the physical unit is backed up to the standby unit;
storing the logical address of the physical unit and the physical address of the standby unit in an area management table in an associated mode, wherein the area management table is stored in a control chip of the hard disk;
when an access request is received, determining a target physical address corresponding to the access request according to the area management table, and mapping the access request to target data corresponding to the target physical address.
2. The hard disk data processing method according to claim 1, wherein the method further comprises:
when the physical unit is monitored to be not damaged, acquiring the access heat of the physical unit;
judging whether the access heat is greater than a preset access heat threshold;
when the access heat is greater than a preset access heat threshold, predicting the probability of physical damage of the physical unit;
And when the probability of predicting the physical damage of the physical unit exceeds a preset probability threshold, allocating a standby unit for the physical unit in the hard disk, and backing up the data in the physical unit to the standby unit.
3. The hard disk data processing method according to claim 2, wherein predicting the probability of physical damage to the physical unit comprises:
determining the model of the physical unit;
collecting historical fault data associated with a target physical unit of a type similar to the model;
acquiring target historical fault data with the fault type of physical damage type in the historical fault data;
obtaining a physical damage fault probability time distribution map based on the fault occurrence time corresponding to the target historical fault data;
and predicting the probability of physical damage to the physical unit in a specified time period based on the physical damage probability time distribution map by using a time sequence model.
4. A hard disk data processing method according to any one of claims 1 to 3, characterized in that the method further comprises:
when the access request is for updating the target data, acquiring updated data in the access request;
Dividing the update data according to the space allowance of the buffer memory of the control chip to obtain a plurality of update sub-data;
the plurality of updated sub-data are cached into a buffer memory of the control chip one by one, and the residual space allowance of the buffer memory is obtained after one updated sub-data is cached each time;
and when the residual space allowance reaches a first preset threshold value, updating the target data according to the updating sub-data cached in the buffer memory.
5. The method for processing hard disk data according to claim 4, wherein the slicing the update data according to the space margin of the buffer memory of the control chip to obtain a plurality of update sub-data includes:
determining the storage space of the update data in the buffer memory according to the priority of the update data and the space allowance of the buffer memory;
and splitting the update data according to the space allowance of the storage space to obtain a plurality of update sub-data.
6. The hard disk data processing method according to claim 5, wherein the method further comprises:
when the access request is for reading the target data, copying the target data into the buffer memory;
And reading the target data from the buffer memory.
7. The hard disk data processing method according to claim 5, wherein the method further comprises:
obtaining the number of physical units in the hard disk, which are physically damaged;
and when the number reaches a preset number threshold, generating a hard disk damage report and sending the hard disk damage report to a preset terminal.
8. A hard disk data processing apparatus, the apparatus comprising:
the unit monitoring module is used for monitoring whether the physical unit of the hard disk is damaged or not;
the area isolation module is used for carrying out area isolation on the physical units which are physically damaged;
the spare allocation module is used for allocating a spare unit for the physical unit in the hard disk and backing up the data in the physical unit to the spare unit;
the updating mapping module is used for storing the logical address of the physical unit and the physical address of the standby unit in an area management table in an associated mode, and the area management table is stored in a control chip of the hard disk;
and the request processing module is used for determining a target physical address corresponding to the access request according to the area management table when the access request is received, and mapping the access request to target data corresponding to the target physical address.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the hard disk data processing method according to any one of claims 1 to 7 when the computer program is executed.
10. A computer-readable storage medium, on which a computer program is stored, characterized in that the computer program, when being executed by a processor, implements the steps of the hard disk data processing method according to any one of claims 1 to 7.
CN202311010275.9A 2023-08-10 2023-08-10 Hard disk data processing method, device, computer equipment and storage medium Pending CN117076170A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311010275.9A CN117076170A (en) 2023-08-10 2023-08-10 Hard disk data processing method, device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311010275.9A CN117076170A (en) 2023-08-10 2023-08-10 Hard disk data processing method, device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117076170A true CN117076170A (en) 2023-11-17

Family

ID=88710735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311010275.9A Pending CN117076170A (en) 2023-08-10 2023-08-10 Hard disk data processing method, device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117076170A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785565A (en) * 2024-02-23 2024-03-29 深圳市创世飞达科技有限公司 Solid state storage hard disk data recovery method and solid state hard disk

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117785565A (en) * 2024-02-23 2024-03-29 深圳市创世飞达科技有限公司 Solid state storage hard disk data recovery method and solid state hard disk
CN117785565B (en) * 2024-02-23 2024-05-03 深圳市创世飞达科技有限公司 Solid state storage hard disk data recovery method and solid state hard disk

Similar Documents

Publication Publication Date Title
US10552272B2 (en) Maintaining high availability during N-node failover
JP5629919B2 (en) How to place virtual volume hotspots in a storage pool using ongoing load measurement and ranking
CN100524229C (en) System and method for dynamic memory management of unallocated memory in a logical partitioned data processing system
US8645750B2 (en) Computer system and control method for allocation of logical resources to virtual storage areas
US11243706B2 (en) Fragment management method and fragment management apparatus
US8200999B2 (en) Selective power reduction of memory hardware
US8069191B2 (en) Method, an apparatus and a system for managing a snapshot storage pool
JP5402693B2 (en) Disk array device control method and disk array device
US7587427B2 (en) Hierarchical storage system, and control method and program therefor
US9563552B2 (en) Storage control device and storage control method
US8677167B2 (en) Storage apparatus and power control method
US20150039837A1 (en) System and method for tiered caching and storage allocation
US20170228161A1 (en) Lifetime management device and lifetime management method
JPH08241227A (en) Specific method for enhancement of performance of storage system
WO2015114643A1 (en) Data storage system rebuild
CN109614276A (en) Fault handling method, device, distributed memory system and storage medium
CN110780811B (en) Data protection method, device and storage medium
CN117076170A (en) Hard disk data processing method, device, computer equipment and storage medium
US20100313069A1 (en) Computer system and failure recovery method
CN101582046A (en) High-available system state monitoring, forcasting and intelligent management method
JP2005309828A (en) Backup processing method, execution device and processing program
CN104375954A (en) Implementing dynamic cache enabling and disabling based upon workload
CN107729182B (en) Data storage and access method and device
CN106899436A (en) A kind of cloud platform failure predication diagnostic system
CN113687790A (en) Data reconstruction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination