A data storage method, device, system and computer readable storage medium
By partitioning the shingled disk and adjusting the write location based on the number of writes, the write amplification problem is solved, improving data storage efficiency and speed.
Patent Information
- Application Number
- CN202211624954.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-16
- Publication Date
- 2025-11-28
- Estimated Expiration
- 2042-12-16
AI Technical Summary
In existing technologies, shingled disks suffer from write amplification during the writing process, which affects data storage efficiency and speed.
By dividing the tracks on a shingled disk into multiple recording units, and upon receiving data to be written, determining whether the number of writes has reached a preset condition, if so, the data to be written is written to the outer track of the recording unit; otherwise, it is directly written to the original track, thereby reducing the number of outer tracks that are frequently written to.
It reduces write amplification, speeds up disk writes, and improves data storage efficiency and disk performance.
Smart Images

Figure CN115951829B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of storage, in particular to a data storage method. The present application also relates to a data storage device, system and computer readable storage medium. BACKGROUND
[0002] With the continuous development of network technology, users have higher and higher requirements for data storage capacity, and the capacity of storage devices is becoming a more and more concerned development point. In particular, the storage capacity of a disk can be expanded in two ways: one is to increase the number of disk platters, and the other is to increase the storage density of a single platter. Due to the limitations of disk size and stability, the number of platters is usually controlled at about 9-10, and it is difficult to continue to increase. Therefore, the mainstream way at present is to increase the storage capacity of a single platter, and the SMR technology is an effective way to increase the storage capacity of a single platter. The SMR cancels the track gap in the traditional way, so that the tracks overlap each other, greatly increasing the track density of the platter and improving the storage capacity.
[0003] In the prior art, a certain interval is usually set between the recording units, and no track is set in the interval. Since the tracks in the recording units overlap each other, when data is written into a certain track, the data in the adjacent track will be overwritten. Therefore, in order to ensure the integrity of the data in the adjacent track, the data in the adjacent track must be read out before writing the data, and then the data to be written and the read-out data are written in order according to the upper and lower relationship between the tracks. If the data to be written is located in the bottommost track of the recording unit, all the data in the upper tracks needs to be read out and then written in turn. If the data in the bottommost track needs to be modified again, the whole process needs to be repeated. This writing method causes a large write amplification problem, affects the writing speed of the data in the disk, and reduces the storage efficiency of the data. SUMMARY
[0004] The purpose of the present application is to provide a data storage method, device, system and computer readable storage medium, which reduces the write amplification problem in the data storage process, speeds up the writing speed of the disk, improves the performance of the disk, and improves the storage efficiency of the data.
[0005] To solve the above technical problems, the present application provides a data storage method applied to a shingled disk, which comprises:
[0006] The tracks on the shingled disk are divided into N recording units, and N is a positive integer;
[0007] When the data to be written is received, the data to be written in the recording unit corresponding to the data to be written is determined;
[0008] determining whether the write times of the data to be written reach a preset condition;
[0009] if yes, taking the outer track of the track to be written in the recording unit as a new track to be written, and writing the data to be written into the new track to be written;
[0010] if no, writing the data to be written into the track to be written.
[0011] Preferably, the determining whether the write times of the data to be written reach a preset condition comprises:
[0012] determining whether the write times of the data to be written in a preset time period reach a preset number of times;
[0013] if yes, determining that the write times of the data to be written reach the preset condition;
[0014] if no, determining that the write times of the data to be written do not reach the preset condition.
[0015] Preferably, a safety interval area is arranged between each two adjacent recording units, and a preset number of tracks are arranged in the safety interval area.
[0016] Further comprising:
[0017] determining whether a bad track exists on the track of the shingled disk;
[0018] if yes, reading the data in the bad track, writing the data into a track in a safety interval area adjacent to the recording unit where the bad track is located, adding the track in the safety interval area to the recording unit where the bad track is located, and adding the bad track to the safety interval area.
[0019] Preferably, the determining whether a bad track exists on the track of the shingled disk comprises:
[0020] determining whether a track with a damaged capacity reaching a preset capacity exists in the shingled disk;
[0021] if yes, determining that the track with the damaged capacity reaching the preset capacity is a bad track.
[0022] Preferably, after determining that the track with the damaged capacity reaching the preset capacity is a bad track, further comprising:
[0023] controlling a prompt module to execute a corresponding prompt strategy.
[0024] Preferably, the taking the outer track of the track to be written in the recording unit as a new track to be written comprises:
[0025] taking the outermost track of the track to be written in the recording unit as a new track to be written.
[0026] Preferably, a safety interval is arranged between every two adjacent recording units, and a preset number of tracks are arranged in the safety interval.
[0027] Before writing the to-be-written data into the new to-be-written track, further comprising:
[0028] judging whether the outermost track of the recording unit has stored data;
[0029] If yes, the adjacent track in the safety interval adjacent to the outermost track of the recording unit is taken as the new to-be-written track and added to the recording unit, and the step of writing the to-be-written data into the new to-be-written track is entered.
[0030] If no, the step of writing the to-be-written data into the new to-be-written track is entered.
[0031] To solve the above technical problems, the present application further provides a data storage device, comprising:
[0032] a memory for storing a computer program;
[0033] a processor for executing the computer program to realize the steps of the above data storage method.
[0034] To solve the above technical problems, the present application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is executed by a processor to realize the steps of the above data storage method.
[0035] To solve the above technical problems, the present application further provides a data storage system applied to a shingled disk, comprising:
[0036] a partition unit for partitioning tracks on the shingled disk into N recording units, wherein N is a positive integer;
[0037] a determination unit for determining a to-be-written track in a recording unit corresponding to to-be-written data when the to-be-written data is received;
[0038] a judgment unit for judging whether the writing times of the to-be-written data reach a preset condition, if yes, triggering a replacement unit, and if no, triggering a normal writing unit;
[0039] the replacement unit for taking an outer track of the to-be-written track in the recording unit as a new to-be-written track, and writing the to-be-written data into the new to-be-written track;
[0040] the normal writing unit for writing the to-be-written data into the to-be-written track.
[0041] The application provides a data storage method applied to a shingled disk, and after receiving to-be-written data and determining a to-be-written track, the number of times of writing the to-be-written data is judged, when it is judged that the to-be-written data has reached the condition of frequent re-writing, the outer track of the to-be-written track is taken as a new to-be-written track, and the to-be-written data is written into the new to-be-written track, so that the data existing in the frequent writing condition is located at the upper track position in the recording unit, the number of tracks outside the data is reduced, when the data needs to be changed subsequently, the data of the upper tracks does not need to be read again, the write amplification problem in the data storage process is reduced, the writing speed of the disk is accelerated, the disk performance is improved, and the data storage efficiency is improved.
[0042] The application further provides a data storage device, system and computer readable storage medium, which have the same beneficial effects as the data storage method. BRIEF DESCRIPTION OF DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the application, the drawings needed to be used in the prior art and the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0044] Figure 1 A flowchart of a data storage method provided by the application;
[0045] Figure 2 A structural diagram of a data storage device provided by the application;
[0046] Figure 3 A structural diagram of a data storage system provided by the application;
[0047] Figure 4 A structural diagram of a shingled disk provided by the application. DETAILED DESCRIPTION
[0048] The core of the application is to provide a data storage method, device, system and computer readable storage medium, which reduces the write amplification problem in the data storage process, accelerates the writing speed of the disk, improves the disk performance, and improves the data storage efficiency.
[0049] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0050] The data storage method provided by the present application is mainly applied to an SMR (Shingled Magnetic Recording) storage module, in particular, a shingled magnetic disk. The storage capacity is improved by increasing the storage capacity of a single disk. The selection and size of the shingled magnetic disk are not particularly limited in the present application. It should be noted that the tracks on the shingled magnetic disk are all overlapping tracks. The specific implementation is described below.
[0051] Please refer to Figure 1 , Figure 1 The flowchart of the data storage method provided by the present application is shown in the figure.
[0052] A data storage method applied to a shingled magnetic disk, the method comprising:
[0053] S11: Dividing the tracks on the shingled magnetic disk into N recording units, N being a positive integer;
[0054] Generally, the shingled magnetic disk is divided into multiple recording units to realize the division of multiple storage areas. The recording unit is a storage area that can perform data writing and other operations. There is a certain interval between each two adjacent recording units. The number of recording units and the specific capacity of each recording unit are not particularly limited in the present application. The division of recording units can be performed according to actual application requirements. The recording unit can also be referred to as a ZONE or a ZONE recording area.
[0055] It can be understood that there are many ways to divide multiple recording units. For example, the division of areas can be physically performed when the disk is shipped, such as setting tracks in the recording unit area and not setting tracks in the interval area between adjacent two recording units. The recording units and the safety interval area can also not be divided during production. Tracks are set in the recording unit and the interval area between adjacent two recording units, that is, the safety interval area. The processor divides all the tracks on the disk logically according to the preset mode. The tracks corresponding to each recording unit are set in advance in the preset mode. The specific way of dividing the recording units is not particularly limited in the present application.
[0056] S12: when receiving the to-be-written data, determining a to-be-written track in a recording unit corresponding to the to-be-written data;
[0057] Specifically, when the to-be-written data is received by the shingled disk, the recording unit corresponding to the to-be-written data and the to-be-written track in the corresponding recording unit are determined, so as to complete the subsequent writing operation. The specific manner of determining the recording unit and the to-be-written track in the corresponding recording unit is not particularly limited herein, and can be realized by an address signal or a number.
[0058] Generally, the received to-be-written data can be in units of a track, a sector in a track, or a preset number of sectors. The form, content, and capacity of the to-be-written data are not particularly limited herein, and can be adjusted according to actual needs.
[0059] S13: determining whether the writing times of the to-be-written data reach a preset condition;
[0060] It can be understood that whether the writing times of the to-be-written data reach the preset condition can be determined in various ways. For example, it can be determined whether the writing times of the to-be-written data reach a preset number within a preset time period, that is, whether the writing frequency of the to-be-written data reaches a preset frequency within the preset time period, or whether the total writing times of the to-be-written data reach a preset number in the entire storage process. The specific manner of determining whether the writing times of the to-be-written data reach the preset condition and the corresponding determination basis are not particularly limited herein.
[0061] Specifically, when determining, the to-be-written data of each unit can be determined in sequence, or all the to-be-written data can be determined simultaneously. The determination can be performed in real time or according to a preset period. The frequency and the number of objects of the determination are not particularly limited herein. The preset period, the preset number, the preset frequency, and the preset condition are preset values in the processor, and can be adjusted according to actual application. The specific setting manner and content of the preset values such as the preset period, the preset number, the preset frequency, and the preset condition are not particularly limited herein.
[0062] S14: if yes, taking an outer track of the to-be-written track in the recording unit as a new to-be-written track, and writing the to-be-written data into the new to-be-written track;
[0063] When it is detected that the write times of the to-be-written data reach the preset condition, it is indicated that the to-be-written data has undergone frequent re-writing process, and thus the outer track of the to-be-written track in the recording unit is taken as a new to-be-written track, and the to-be-written data is written into the new to-be-written track. The outer track refers to a new track in the same recording unit and located at the upper layer of the to-be-written track, that is, the to-be-written data is stored in a track at a higher layer, so as to reduce the number of outer tracks in the same recording unit as much as possible, so that the to-be-written data can reduce the data in the track at the upper layer that needs to be read during subsequent modification or other re-writing process, reduce the write amplification problem of the entire storage process, and improve the write speed and efficiency.
[0064] Specifically, the new to-be-written track only needs to be at the upper layer of the previous to-be-written track, which can be a track at the outermost side of the corresponding recording unit, or other upper layer track in the recording unit. The specific selection of the track at which layer depends on the storage condition of the recording unit itself or actual demand, etc., which is not particularly limited in the present application.
[0065] S15: If not, the to-be-written data is written into the to-be-written track.
[0066] When it is detected that the write times of the to-be-written data do not reach the preset condition, it is proved that the to-be-written data has not undergone frequent re-writing before, and is stored for the first time or in other cases, and thus the to-be-written data only needs to be directly written according to the previously determined corresponding recording unit and the to-be-written track in the corresponding recording unit.
[0067] In actual application, the entire storage process can be controlled and completed by a processor inside the disk, or can be completed by other control modules, and there are many choices. The specific selection, setting position and size of the processor are not particularly limited in the present application.
[0068] It can be understood that the entire data storage process can be performed in real time, or can be performed according to a preset period or a preset time period, etc. The frequency and object quantity of data writing are not particularly limited in the present application. After the data storage process is completed, the staff can complete subsequent other operations through the storage content of the shingle disk, which is not particularly limited in the present application.
[0069] The application provides a data storage method applied to a shingled disk, after receiving to-be-written data and determining a to-be-written track, the number of times of writing the to-be-written data is judged, when it is judged that the to-be-written data has reached the condition of frequent re-writing, the outer track of the to-be-written track is taken as a new to-be-written track, and the to-be-written data is written into the new to-be-written track, so that the data existing in the frequent writing condition is located at the upper track position in the recording unit, the number of tracks outside the data is reduced, when the data needs to be changed subsequently, the data of the upper tracks does not need to be read again, the write amplification problem in the data storage process is reduced, the writing speed of the disk is accelerated, the disk performance is improved, and the data storage efficiency is improved.
[0070] On the basis of the above embodiment,
[0071] Please refer to Figure 4 , Figure 4 The application provides a structure diagram of a shingled disk.
[0072] As a preferred embodiment, whether the number of times of writing the to-be-written data reaches a preset condition is judged, including:
[0073] whether the number of times of writing the to-be-written data in a preset time period reaches a preset number of times is judged;
[0074] if yes, it is determined that the number of times of writing the to-be-written data reaches the preset condition;
[0075] if no, it is determined that the number of times of writing the to-be-written data does not reach the preset condition.
[0076] It can be understood that whether the number of times of writing the to-be-written data reaches the preset condition can be judged by judging whether the number of times of writing the to-be-written data in a preset time period reaches a preset number of times, when the number of times of writing the to-be-written data in a preset time period reaches a preset number of times, that is, the writing frequency of the to-be-written data in a preset time period reaches a preset frequency, it can be determined that the number of times of writing the to-be-written data reaches the preset condition, when the number of times of writing the to-be-written data in a preset time period does not reach a preset number of times, that is, the writing frequency of the to-be-written data in a preset time period does not reach a preset frequency, it can be determined that the number of times of writing the to-be-written data does not reach the preset condition, and the specific way of detecting the number of times of writing the to-be-written data is not particularly limited herein.
[0077] Specifically, the frequency of judgment, the number of objects, and the like are not particularly limited in the present application, and the preset period, the preset number of times, the preset frequency, and the preset condition are all preset values in the processor, which can be adjusted according to actual application. The specific setting method and content of the preset period, the preset number of times, the preset frequency, and the preset condition are not particularly limited in the present application.
[0078] The embodiment is a specific way of judging whether the write number of the data to be written reaches a preset condition. The write number of the data to be written is determined by judging whether the write number of the data to be written in a preset time period reaches a preset number of times. The judgment method is simple and effective, easy to implement, and the entire judgment process is very fast, saving the time of the entire storage process and improving the write efficiency.
[0079] As a preferred embodiment, a safety interval area is arranged between each two adjacent recording units, and a preset number of tracks are arranged in the safety interval area.
[0080] Further comprising:
[0081] Judging whether a bad track exists in the tracks on the shingled disk;
[0082] If yes, reading the data in the bad track, writing the data into a track in a safety interval area adjacent to the recording unit where the bad track is located, adding the track in the safety interval area to the recording unit where the bad track is located, and adding the bad track to the safety interval area.
[0083] Considering that when a bad track exists in the tracks on the shingled disk, the write process of the data in the bad track is more fragmented, further increasing the write amplification problem, reducing the work efficiency of writing data, and affecting the performance of the hard disk, the fault tolerance replacement function is added, that is, a safety interval area is arranged between each two adjacent recording units, and a preset number of tracks are arranged in the safety interval area. At the same time, the judgment process of whether a bad track exists in the tracks on the shingled disk is added. When it is detected that a bad track exists in the tracks on the shingled disk, the track in the safety interval area adjacent to the recording unit where the bad track is located is used for replacement, and the data in the bad track is written into the track in the safety interval area. At the same time, the area is re-divided, the replaceable track in the safety interval area is divided into the recording unit, and the bad track is divided into the safety interval area.
[0084] It can be understood that the preset number of the tracks in the safety interval area can be selected in many ways, which is not particularly limited in the present application, and depends on the actual application requirements. When replacing the bad track, the track in any one of the two safety interval areas adjacent to the recording unit can be replaced. Generally, the track adjacent to the recording unit is selected as the replacement track, and other tracks can also be selected. The specific selection of which track in which safety interval area as the replacement track for the bad track is not particularly limited in the present application. The specific implementation mode and process of re-partitioning are not particularly limited in the present application.
[0085] When it is detected that there is no bad track on the shingled disk, other data storage operations can be normally performed, or the process can be directly exited, which is not particularly limited in the present application. It should be noted that considering that the continuous generation of bad blocks on the track will exacerbate the write amplification problem and increase the bad block rate on the entire track, the data writing process can only be continuous small data block writing, thereby reducing the writeability of the entire recording unit, and even causing the entire disk to be scrapped, resulting in great waste. The track with more bad blocks can be regarded as a bad track. The specific judgment mode and basis of the bad track are not particularly limited in the present application, and the bad track can also be directly defined in the processor.
[0086] It should be noted that there are many ways to judge whether the track on the shingled disk has a bad track. The storage capacity of the bad block in the track can reach a preset capacity, or the ratio of the storage capacity of the bad block in the track to the total capacity of the track can reach a preset value. The specific mode and basis of judging whether the track on the shingled disk has a bad track are not particularly limited in the present application.
[0087] Specifically, when judging, each track on the shingled disk can be judged in sequence, or all tracks can be judged at the same time. The judgment can be real-time or performed at a preset period. The frequency and number of objects of the judgment are not particularly limited in the present application. The preset period and the preset capacity are preset values in the processor, and can be adjusted according to actual application. The specific setting mode and content of the preset period and the preset capacity are not particularly limited in the present application.
[0088] In view of the adverse effect of the bad track on the data storage process, a safety interval area is arranged between each adjacent two recording units, a preset number of tracks are arranged in the safety interval area, and a judgment process of whether the tracks on the shingled disk have bad tracks is increased. The bad tracks and the tracks in the safety interval area are replaced, a re-partitioning operation is completed, the bad tracks are re-divided into the safety interval area, the continuous influence of the bad tracks on the data storage process is prevented, the safety and reliability of the written data are further protected, the fault tolerance of the disk is increased, the disk performance is improved, and the reliability and service life of the hard disk are improved.
[0089] As a preferred embodiment, the judgment of whether the tracks on the shingled disk have bad tracks comprises:
[0090] judging whether the tracks with a damaged capacity reaching a preset capacity exist in the shingled disk.
[0091] If yes, the tracks with the damaged capacity reaching the preset capacity are determined as bad tracks.
[0092] In the embodiment, whether the tracks on the shingled disk have bad tracks is judged by judging whether the tracks with a damaged capacity reaching a preset capacity exist in the shingled disk. When the tracks with the damaged capacity reaching the preset capacity exist in the shingled disk, the tracks with the damaged capacity reaching the preset capacity are determined as bad tracks. When the tracks with the damaged capacity reaching the preset capacity do not exist in the shingled disk, secondary judgment or other operations can be performed after a preset time. The specific detection and statistical method of the damaged capacity are not particularly limited in the application.
[0093] Specifically, in the judgment process, each track on the shingled disk can be judged in sequence, or all the tracks can be judged at the same time. The judgment can be performed in real time, or can be performed according to a preset period. The frequency and object quantity of the judgment are not particularly limited in the application. The preset period and the preset capacity are preset values in the processor, and can be adjusted according to actual application. The specific setting method and content of the preset values such as the preset period and the preset capacity are not particularly limited in the application.
[0094] The embodiment is a specific implementation of the judgment of whether the tracks on the shingled disk have bad tracks. Whether the tracks on the shingled disk have bad tracks is determined by judging whether the tracks with a damaged capacity reaching a preset capacity exist in the shingled disk. The judgment method is simple and effective, and is easy to implement, so as to facilitate the subsequent replacement process of the bad tracks.
[0095] As a preferred embodiment, after the tracks with the damaged capacity reaching the preset capacity are determined as bad tracks, the method further comprises:
[0096] The control prompt module executes a corresponding prompt strategy.
[0097] In view of the fact that the generation of a bad track needs to be prompted for subsequent maintenance or replacement by a staff, a prompt process is added, and after determining that the damaged track reaches the preset capacity, the control prompt module executes a corresponding prompt strategy.
[0098] Specifically, the prompt module can be one or a combination of a prompt light, a speaker, and a voice module, and an online prompt. Different prompt strategies can be set for different bad tracks of a recording unit or different numbers of bad tracks, or no prompt strategy can be set. The distinction of the prompt strategy can be achieved by setting different prompt sub-modules or different prompt modes in the prompt module, such as one or a combination of the flashing frequency of the indicator light, the color change of the indicator light, and the pitch of the sound of the speaker. The specific implementation mode of the prompt module and the distinction mode of the prompt strategy are not particularly limited herein. Meanwhile, the setting position and the setting size of the prompt module are not particularly limited herein, and can be adjusted according to different structures of the disk.
[0099] In view of the fact that the generation of a bad track needs to be prompted, a prompt process is added, and after detecting the bad track, the control prompt module executes a corresponding prompt strategy, which can effectively prompt the staff that there is a bad track in the disk, so as to perform subsequent disk replacement or troubleshooting operations, thereby improving the safety and reliability of the entire data storage process.
[0100] As a preferred embodiment, the outer track of the to-be-written track in the recording unit is taken as a new to-be-written track, including:
[0101] The outermost track of the to-be-written track in the recording unit is taken as a new to-be-written track.
[0102] In view of the fact that the frequent re-writing process of the to-be-written data will have a great impact on the data in the upper track of the track, the outermost track of the to-be-written track in the recording unit is directly taken as a new to-be-written track. The outermost track refers to the uppermost track in the recording unit, and the re-writing process of the to-be-written data will not have an impact on the data in other tracks in the recording unit.
[0103] The outermost track of the to-be-written track in the recording unit is directly taken as a new to-be-written track, which can reduce the influence on the data of other tracks in the recording unit in the re-writing process after the to-be-written data, further solve the write amplification problem, save the write time of the data, improve the work efficiency, further guarantee the disk performance, and improve the reliability and security of the data.
[0104] As a preferred embodiment, a safety interval area is arranged between each two adjacent recording units, and a preset number of tracks are arranged in the safety interval area;
[0105] Before the to-be-written data is written into the new to-be-written track, the method further comprises:
[0106] determining whether the outermost track has stored data;
[0107] If yes, an adjacent track in the safety interval area adjacent to the outermost track of the recording unit is taken as a new to-be-written track and added to the recording unit, and the step of writing the to-be-written data into the new to-be-written track is entered;
[0108] If no, the step of writing the to-be-written data into the new to-be-written track is entered.
[0109] In consideration of the case that the outermost track of the to-be-written track in the recording unit has stored data, a safety interval area is arranged between each two adjacent recording units, and a preset number of tracks are arranged in the safety interval area, and a process of determining whether the outermost track has stored data is added. When it is detected that the outermost track has stored data, an adjacent track in the safety interval area adjacent to the outermost track of the recording unit can be taken as a new to-be-written track, which is re-divided into the recording unit, and then the step of writing the to-be-written data into the new to-be-written track is entered. At this time, it is also ensured that the new to-be-written track is the outermost track of the recording unit. When it is detected that the outermost track has not stored data, the outermost track of the to-be-written track in the recording unit is directly taken as a new to-be-written track, and subsequent write operation is performed.
[0110] It can be understood that the preset number of tracks in the safety interval area can be selected in many ways, which is not particularly limited in the present application and depends on actual application requirements. Specifically, the adjacent safety area can be directly re-partitioned by reducing one track, that is, the recording unit directly annexes the track in the safety interval area, or directly translates one track outward to divide the adjacent track of the recording unit on the other side into the safety interval area to replace the tracks, and there are many specific ways of re-partitioning. The specific implementation manner and process of re-partitioning are not particularly limited in the present application.
[0111] Specifically, in the judgment process, it can be judged in real time, or it can be judged according to a preset period, etc. The frequency of judgment is not particularly limited in this application. The preset period and the preset number are preset values in the processor, and can be adjusted according to the actual application. The specific setting method and content of the preset value such as the preset period and the preset number are not particularly limited in this application.
[0112] Considering the case that the outermost track of the track to be written in the recording unit has already stored data, a safety interval area is provided between every two adjacent recording units. While a preset number of tracks are provided in the safety interval area, a judgment process of whether the outermost track has stored data is added. The data to be written is written into the outermost track of the recording unit through the adjacent track of the safety interval area adjacent to the outermost track of the recording unit. Flexible area division can effectively solve the write amplification problem of frequent re-writing data, improve the performance of the hard disk, and further improve the reliability and service life of the hard disk.
[0113] Please refer to Figure 2 , Figure 2 A structural diagram of a data storage device provided by the present application is shown in the following figure:
[0114] To solve the above technical problems, the present application further provides a data storage device, comprising:
[0115] A memory 1 for storing a computer program;
[0116] A processor 2 for executing the computer program to realize the steps of the above data storage method.
[0117] The processor 2 can include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 2 can be implemented in at least one of a hardware form of a DSP (Digital Signal Processor), an FPGA (Field-Programmable Gate Array), a PLA (Programmable Logic Array). The processor 2 can also include a main processor and a coprocessor, the main processor being a processor for processing data in a wake-up state, also known as a central processor; the coprocessor being a low-power processor for processing data in a standby state. In some embodiments, the processor 2 can be integrated with a GPU (graphics processing unit) for rendering and drawing the content required to be displayed by the display screen. In some embodiments, the processor 2 can further include an AI (Artificial Intelligence) processor for processing machine learning-related computing operations.
[0118] The memory 1 can include one or more computer-readable storage media, which can be non-transitory. The memory 1 can also include a high-speed random access memory, and a non-volatile memory such as one or more disk storage devices, flash storage devices. In the present embodiment, the memory 1 is at least used to store the following computer programs, wherein the computer programs are loaded and executed by the processor 2, and can realize the related steps of the data storage method disclosed in any one of the preceding embodiments. In addition, the resources stored by the memory 1 can also include an operating system and data, etc., and the storage mode can be temporary storage or permanent storage. The operating system can include Windows, Unix, Linux, etc. The data can include but is not limited to data of the data storage method, etc.
[0119] In some embodiments, the data storage device can further include a display screen, an input / output interface, a communication interface, a power supply, and a communication bus.
[0120] Those skilled in the art can understand that, Figure 2 The structure shown in the figure does not constitute a limitation on the data storage device, and can include more or fewer components than those shown in the figure.
[0121] For the data storage device provided by the present application, please refer to the above-mentioned method embodiments, and the present application will not be repeated here.
[0122] To solve the above technical problems, the application further provides a computer readable storage medium, and the computer readable storage medium stores a computer program.
[0123] It can be understood that if the method in the above embodiment is implemented in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or the whole or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and performs all or part of the steps of the methods described in the various embodiments of the present application. Specifically, the computer readable storage medium can include, but is not limited to, any type of disk, including floppy disks, optical disks, and mobile hard disks, or any type of medium or device suitable for storing instructions, data, and the like. The present application does not make special limitations here.
[0124] For the computer readable storage medium provided by the present application, please refer to the above method embodiment, and the present application will not be repeated here.
[0125] Please refer to Figure 3 , Figure 3 The structural schematic diagram of the data storage system provided by the present application;
[0126] To solve the above technical problems, the application further provides a data storage system applied to a shingled disk, and the system comprises:
[0127] The partition unit 31 is used for dividing the tracks on the shingled disk into N recording units, and N is a positive integer;
[0128] The determination unit 32 is used for determining the to-be-written track in the recording unit corresponding to the to-be-written data when the to-be-written data is received;
[0129] The judgment unit 33 is used for judging whether the writing times of the to-be-written data reach a preset condition, if yes, triggering the replacement unit, and if no, triggering the normal writing unit;
[0130] The replacement unit 34 is used for taking the outer track of the to-be-written track in the recording unit as a new to-be-written track, and writing the to-be-written data into the new to-be-written track;
[0131] The normal writing unit 35 is used for writing the to-be-written data into the to-be-written track.
[0132] As a preferred embodiment, the judgment unit 33 comprises:
[0133] The judging subunit is used for judging whether the writing times of the data to be written in a preset time period reach a preset number, if yes, triggering the first judging unit, if no, triggering the second judging unit;
[0134] The first judging unit is used for judging whether the writing times of the data to be written reach a preset condition.
[0135] The second judging unit is used for judging whether the writing times of the data to be written reach a preset condition.
[0136] As a preferred embodiment, a safety interval area is arranged between every two adjacent recording units, and a preset number of tracks are arranged in the safety interval area; further comprising:
[0137] The judging bad track unit is used for judging whether a bad track exists in the shingled disk, if yes, triggering the bad track replacing unit;
[0138] The bad track replacing unit is used for reading the data in the bad track, writing the data into a track in a safety interval area adjacent to the recording unit where the bad track is located, adding the track in the safety interval area to the recording unit where the bad track is located, and adding the bad track to the safety interval area.
[0139] As a preferred embodiment, the judging bad track unit comprises:
[0140] The judging bad track subunit is used for judging whether a track with a damaged capacity reaching a preset capacity exists in the shingled disk, if yes, triggering the third judging unit;
[0141] The third judging unit is used for judging that the track with the damaged capacity reaching the preset capacity is a bad track.
[0142] As a preferred embodiment, further comprising:
[0143] The prompting unit is used for controlling the prompting module to execute a corresponding prompting strategy.
[0144] As a preferred embodiment, the replacing unit 34 comprises:
[0145] The replacing subunit is used for taking the outermost track of the track to be written in the recording unit as a new track to be written, and writing the data to be written into the new track to be written.
[0146] As a preferred embodiment, a safety interval area is arranged between every two adjacent recording units, and a preset number of tracks are arranged in the safety interval area; further comprising:
[0147] The confirming storage unit is used for judging whether the outermost track has stored data, if yes, triggering the re-partitioning unit, if no, triggering the writing new track unit;
[0148] a re-partitioning unit configured to add the adjacent track in the safety interval area adjacent to the outermost track of the recording unit as a new to-be-written track to the recording unit and trigger a write new track unit to write data to be written to the new to-be-written track;
[0149] a write new track unit configured to write the data to be written to the new to-be-written track.
[0150] For the data storage system provided by the present application, please refer to the above method embodiments, and the present application will not be repeated here.
[0151] Those skilled in the art will further appreciate that the units and algorithm steps of each example described in connection with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or combinations of both. To clearly illustrate the interchangeability of hardware and software, and to avoid obscuring the disclosure with details of the example implementations and techniques, the description herein has generally been stated in the context of specific examples. Those skilled in the art will recognize that the disclosure described herein can be implemented in a variety of ways. Embodiments of the present application are not limited to the above-described examples, and thus many modifications and variations are possible in light of the above teachings. It is therefore to be understood that, within the scope of the claims and their equivalents, the present application can be practiced otherwise than as specifically described.
[0152] The above description of disclosed embodiments enables a person skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the examples shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A data storage method, characterized in that, Applied to shingled disks, the method includes: The tracks on the shingled disk are divided into N recording units, where N is a positive integer; Upon receiving data to be written, determine the track to be written in the recording unit corresponding to the data to be written; Determine whether the number of writes of the data to be written has reached a preset condition; the preset condition is the condition of frequent rewriting. If so, the outer track of the track to be written in the recording unit is taken as the new track to be written, and the data to be written is written to the new track to be written; If not, write the data to be written to the track to be written; A safety interval is provided between each pair of adjacent recording units, and a preset number of magnetic tracks are provided within the safety interval; Also includes: Determine whether there are bad tracks on the shingled disk; If so, read the data from the bad track, write it into a track in a safe interval adjacent to the recording unit where the bad track is located, add the track in the safe interval to the recording unit where the bad track is located, and add the bad track to the safe interval.
2. The data storage method as described in claim 1, characterized in that, Determining whether the number of write attempts of the data to be written has reached a preset condition includes: Determine whether the number of times the data to be written has been written within a preset time period has reached a preset number; If so, it is determined that the number of writes of the data to be written has reached the preset condition; If not, it is determined that the number of write attempts for the data to be written has not reached the preset condition.
3. The data storage method as described in claim 1, characterized in that, Determining whether there are bad tracks on the shingled disk includes: Determine whether there are damaged tracks in the shingled disk with a capacity reaching a preset capacity; If so, the track whose damage capacity reaches the preset capacity is determined to be a bad track.
4. The data storage method as described in claim 3, characterized in that, After determining that a track with a damage capacity reaching a preset capacity is a bad track, the process further includes: The control prompt module executes the corresponding prompt strategy.
5. The data storage method according to any one of claims 1 to 4, characterized in that, Using the outer track of the track to be written in the recording unit as a new track to be written includes: The outermost track of the track to be written in the recording unit is taken as the new track to be written.
6. The data storage method as described in claim 5, characterized in that, A safety interval is provided between each pair of adjacent recording units, and a preset number of magnetic tracks are provided within the safety interval; Before writing the data to be written to a new track, the process also includes: Determine whether the outermost magnetic track has stored data; If so, the adjacent track in the safety interval area adjacent to the outermost track of the recording unit is taken as a new track to be written and added to the recording unit, and the step of writing the data to be written to the new track to be written is entered. If not, proceed to the step of writing the data to be written to a new track.
7. A data storage device, characterized in that, include: Memory, used to store computer programs; A processor for executing the computer program to implement the steps of the data storage method as described in any one of claims 1 to 6.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data storage method as described in any one of claims 1 to 6.
9. A data storage system, characterized in that, For use with shingled disks, the system includes: A partitioning unit is used to divide the tracks on the shingled disk into N recording units, where N is a positive integer. The determining unit is used to determine the track to be written in the recording unit corresponding to the data to be written when the data to be written is received; The judgment unit is used to determine whether the number of writes of the data to be written has reached a preset condition. If yes, the replacement unit is triggered; if no, the normal writing unit is triggered. The preset condition is the condition of frequent rewriting. The replacement unit is used to take the outer track of the track to be written in the recording unit as the new track to be written, and write the data to be written into the new track to be written. The normal write unit is used to write the data to be written into the track to be written; A safety interval is provided between each pair of adjacent recording units, and a preset number of magnetic tracks are provided within the safety interval; This data storage system is also used for: Determine whether there are bad tracks on the shingled disk; If so, read the data from the bad track, write it into a track in a safe interval adjacent to the recording unit where the bad track is located, add the track in the safe interval to the recording unit where the bad track is located, and add the bad track to the safe interval.
Citation Information
Patent Citations
Data write management
US20150279395A1
Post-write scan operations for interlaced magnetic recording
US9324362B1