Movatterモバイル変換


[0]ホーム

URL:


CN114415963B - Hard disk data cleaning method and device and computing equipment - Google Patents

Hard disk data cleaning method and device and computing equipment
Download PDF

Info

Publication number
CN114415963B
CN114415963BCN202210081999.1ACN202210081999ACN114415963BCN 114415963 BCN114415963 BCN 114415963BCN 202210081999 ACN202210081999 ACN 202210081999ACN 114415963 BCN114415963 BCN 114415963B
Authority
CN
China
Prior art keywords
hard disk
data
target hard
partition
cleaning
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.)
Active
Application number
CN202210081999.1A
Other languages
Chinese (zh)
Other versions
CN114415963A (en
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.)
Wuhan Deepin Technology Co ltd
Original Assignee
Wuhan Deepin 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 Wuhan Deepin Technology Co ltdfiledCriticalWuhan Deepin Technology Co ltd
Priority to CN202210081999.1ApriorityCriticalpatent/CN114415963B/en
Publication of CN114415963ApublicationCriticalpatent/CN114415963A/en
Application grantedgrantedCritical
Publication of CN114415963BpublicationCriticalpatent/CN114415963B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

The application discloses a method, a device and a computing device for cleaning hard disk data, wherein the method is executed in the computing device and comprises the following steps: acquiring device information of each hard disk in the computing device; determining whether each hard disk can be cleaned according to the equipment information so as to determine one or more cleanable hard disks; displaying one or more device information of the cleanable hard disk and acquiring a target hard disk selected by a user; and randomly writing data into each partition of the target hard disk until the residual space of the target hard disk is smaller than one data block, so as to trigger a garbage collection mechanism to clean the data of the target hard disk. According to the technical scheme, the SSD hard disk data can be thoroughly cleaned on the basis of keeping the original files of the system.

Description

Hard disk data cleaning method and device and computing equipment
The application is a divisional application of patent application 2021114657447 of application filed on 12 months and 3 days 2021.
Technical Field
The present application relates to the field of computer technologies, and in particular, to a hard disk data cleaning method, a hard disk data cleaning device, and a computing device.
Background
Currently, the popularity of SSD solid state drives is continuously increasing, and the speed and capacity are continuously increasing, so that SSDs have gradually replaced mechanical hard drives. The storage principle of SSD is different from that of a mechanical hard disk, and the data destruction mode is also different from that of the mechanical hard disk.
The SSD solid state disk is provided with a main control, the storage of physical data is converted through an indirect layer of a logical block address of access data of an operating system and an original data flash memory address, and the writing and erasing times of each data block are managed through a special interface of a hidden flash memory. The indirect layer enhances the access performance and reliability of the SSD and greatly prolongs the service life of the SSD. However, the indirection layer also generates duplicate data that is not visible to the user, based on which conventional methods of shredding deleted files, writing overlays, low-level formatting drives cannot ensure complete deletion of SSD data.
In the prior art, the SSD hard disk data is thoroughly cleaned in a full disk erasing mode, and the system data is completely deleted when the hard disk is erased, so that an operating system is required to be reinstalled, and the method is quite troublesome.
Therefore, a method for cleaning hard disk data is needed to solve the problems in the above technical solutions.
Disclosure of Invention
To this end, the present application provides a hard disk data cleaning method and a hard disk data cleaning device in an effort to solve or at least alleviate the above-mentioned problems.
According to one aspect of the present application, there is provided a hard disk data cleaning method, executed in a computing device, comprising the steps of: acquiring device information of each hard disk in the computing device; determining whether each hard disk can be cleaned according to the equipment information so as to determine one or more cleanable hard disks; displaying one or more device information of the cleanable hard disk and acquiring a target hard disk selected by a user; and randomly writing data into each partition of the target hard disk until the residual space of the target hard disk is smaller than one data block, so as to trigger a garbage collection mechanism to clean the data of the target hard disk.
Optionally, in the method for cleaning data of a hard disk according to the present application, after triggering a garbage collection mechanism to clean the data of the target hard disk, the method further includes the steps of: deleting all data written randomly.
Optionally, in the hard disk data cleaning method according to the present application, the step of randomly writing data to each partition of the target hard disk includes: and writing data into each partition of the target hard disk in turn based on the data block size.
Optionally, in the hard disk data cleaning method according to the present application, the step of randomly writing data into each partition of the target hard disk until the remaining space of the target hard disk is smaller than one data block includes: calculating the residual space of the target hard disk; acquiring the data block size and the paging size of the target hard disk; calculating the number of data blocks to be written based on the remaining space and the data block size; writing data to a partition of the target hard disk each time based on an integer multiple of the data block size; and determining the total number of the written data blocks, and if the total number of the written data blocks is equal to the number of the data blocks to be written, determining that the residual space of the target hard disk is smaller than one data block.
Optionally, in the hard disk data cleaning method according to the present application, the method further includes the steps of: if the total number of written data blocks is smaller than the number of data blocks to be written, and the size of the written data is smaller than or equal to the difference between the remaining space and the size of the data blocks, then: and writing data into each partition of the target hard disk in turn based on the paging size until the written data size is larger than the difference value between the residual space and the data block size, and determining that the residual space of the target hard disk is smaller than one data block.
Optionally, in the hard disk data cleaning method according to the present application, the step of randomly writing data to each partition of the target hard disk includes: reading a partition information table of the target hard disk based on the equipment information of the target hard disk, and placing a root partition of the target hard disk to the end of the partition information table; and writing data into each partition according to the partition sequence in the partition information table of the target hard disk.
Optionally, in the hard disk data cleaning method according to the present application, before randomly writing data to each partition of the target hard disk, the method further includes the steps of: detecting whether an undivided area and/or a hidden partitioned area exist in the target hard disk; if the hidden partition area exists, partitioning the non-partitioned area and/or the hidden partition area, and formatting; if not, data is randomly written to each partition of the target hard disk.
Optionally, in the hard disk data cleaning method according to the present application, if an operation of cleaning at idle is received, before randomly writing data to each partition of the target hard disk, the method further includes the steps of: detecting whether a mouse or a keyboard is operated within a preset time; and if not, acquiring the last cleaning progress of the target hard disk, and continuing to randomly write data into each partition of the target hard disk based on the last cleaning progress.
Optionally, in the hard disk data cleaning method according to the present application, displaying device information of one or more cleanable hard disks includes: a data cleaning interface is displayed on a screen of a computing device, and device information of one or more cleanable hard disks is displayed on the displayed data cleaning interface.
Optionally, in the hard disk data cleaning method according to the present application, the method further includes the steps of:
determining a cleaning progress according to the ratio of the size of the data which is written currently and the residual space of the target hard disk; and displaying the cleaning progress on the display data cleaning interface.
Optionally, in the hard disk data cleaning method according to the present application, the method further includes the steps of: and acquiring the latest historical cleaning information corresponding to the hard disk and displaying the latest historical cleaning information on the data cleaning interface.
Optionally, in the hard disk data cleaning method according to the present application, the method further includes the steps of: and recording and storing the cleaning information of the target hard disk.
Optionally, in the hard disk data cleaning method according to the present application, the cleaning information includes one or more of cleaning time, device model number, and capacity size.
Optionally, in the hard disk data cleaning method according to the present application, the hard disk is an SSD hard disk; the device information includes one or more of a drive letter, a device model number, and a capacity size.
According to one aspect of the present application, there is provided a hard disk data cleaning apparatus, residing in a computing device, comprising: the acquisition module is suitable for acquiring the equipment information of each hard disk in the computing equipment; the determining module is suitable for determining whether each hard disk can be cleaned according to the equipment information so as to determine one or more cleanable hard disks; the display module is suitable for displaying one or more equipment information of the cleanable hard disk and acquiring a target hard disk selected by a user; and the writing module is suitable for randomly writing data into each partition of the target hard disk until the residual space of the target hard disk is smaller than one data block so as to trigger a garbage collection mechanism to clean the data of the target hard disk.
According to one aspect of the present application, there is provided a computing device comprising: at least one processor; and a memory storing program instructions, wherein the program instructions are configured to be adapted to be executed by the at least one processor, the program instructions comprising instructions for performing the hard disk data cleansing method as described above.
According to one aspect of the present application, there is provided a readable storage medium storing program instructions which, when read and executed by a computing device, cause the computing device to perform a method as described above.
According to the technical scheme of the application, the method for cleaning the hard disk data is provided, the determined equipment information of one or more cleanable hard disks is displayed on the client side so that a user can select a target hard disk to be cleaned, data is randomly written into each partition of the target hard disk according to the target hard disk selected by the user, and a garbage collection mechanism is triggered to erase all dirty data blocks on the target hard disk until the residual space of the target hard disk is smaller than one data block, so that the thorough cleaning effect on the SSD hard disk dirty data is realized on the basis of keeping the original file of the system.
In addition, according to the idle time cleaning scheme selectable by the user, SSD hard disk data can be cleaned under the condition that the work of the user is not influenced, and the user experience is improved.
The foregoing description is only an overview of the present application, and is intended to be implemented in accordance with the teachings of the present application in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present application more readily apparent.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which set forth the various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to fall within the scope of the claimed subject matter. The above, as well as additional objects, features, and advantages of the present disclosure will become more apparent from the following detailed description when read in conjunction with the accompanying drawings. Like reference numerals generally refer to like parts or elements throughout the present disclosure.
FIG. 1 shows a schematic diagram of a computing device 100 according to one embodiment of the application;
FIG. 2 illustrates a flow chart of a hard disk data cleaning method 200 according to one embodiment of the application;
FIG. 3 shows a schematic diagram of a data cleansing interface according to one embodiment of the application; and
fig. 4 shows a schematic diagram of a hard disk data cleaning device 400 according to an embodiment of the application.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Fig. 1 is a schematic block diagram of an example computing device 100.
As shown in FIG. 1, in a basic configuration 102, a computing device 100 typically includes a system memory 106 and one or more processors 104. The memory bus 108 may be used for communication between the processor 104 and the system memory 106.
Depending on the desired configuration, the processor 104 may be any type of processing including, but not limited to: a microprocessor (UP), a microcontroller (UC), a digital information processor (DSP), or any combination thereof. The processor 104 may include one or more levels of caches, such as a first level cache 110 and a second level cache 112, a processor core 114, and registers 116. The example processor core 114 may include an Arithmetic Logic Unit (ALU), a Floating Point Unit (FPU), a digital signal processing core (DSP core), or any combination thereof. The example memory controller 118 may be used with the processor 104, or in some implementations, the memory controller 118 may be an internal part of the processor 104.
Depending on the desired configuration, system memory 106 may be any type of memory including, but not limited to: volatile memory (such as RAM), non-volatile memory (such as ROM, flash memory, etc.), or any combination thereof. The system memory 106 may include an operating system 120, one or more applications 122, and program data 124. In some implementations, the application 122 may be arranged to execute instructions on an operating system by the one or more processors 104 using the program data 124.
Computing device 100 also includes storage device 132, storage device 132 including removable storage 136 and non-removable storage 138.
Computing device 100 may also include a storage interface bus 134. Storage interface bus 134 enables communication from storage devices 132 (e.g., removable storage 136 and non-removable storage 138) to base configuration 102 via bus/interface controller 130. At least a portion of the operating system 120, applications 122, and data 124 may be stored on removable storage 136 and/or non-removable storage 138, and loaded into the system memory 106 via the storage interface bus 134 and executed by the one or more processors 104 when the computing device 100 is powered up or the application 122 is to be executed.
Computing device 100 may also include an interface bus 140 that facilitates communication from various interface devices (e.g., output devices 142, peripheral interfaces 144, and communication devices 146) to basic configuration 102 via bus/interface controller 130. The exemplary output device 142 includes an image processing unit 148 and an audio processing unit 150. They may be configured to facilitate communication with various external devices such as a display or speakers via one or more a/V ports 152. Example peripheral interfaces 144 may include a serial interface controller 154 and a parallel interface controller 156, which may be configured to facilitate communication with external devices such as input devices (e.g., keyboard, mouse, pen, voice input device, touch input device) or other peripherals (e.g., printer, scanner, etc.) via one or more I/O ports 158. An example communication device 146 may include a network controller 160, which may be arranged to facilitate communication with one or more other computing devices 162 via one or more communication ports 164 over a network communication link.
The network communication link may be one example of a communication medium. Communication media may typically be embodied by computer readable instructions, data structures, program modules, and may include any information delivery media in a modulated data signal, such as a carrier wave or other transport mechanism. A "modulated data signal" may be a signal that has one or more of its data set or changed in such a manner as to encode information in the signal. By way of non-limiting example, communication media may include wired media such as a wired network or special purpose network, and wireless media such as acoustic, radio Frequency (RF), microwave, infrared (IR) or other wireless media. The term computer readable media as used herein may include both storage media and communication media.
Computing device 100 may be implemented as a personal computer including desktop and notebook computer configurations. Of course, computing device 100 may also be implemented as part of a small-sized portable (or mobile) electronic device such as a cellular telephone, a digital camera, a Personal Digital Assistant (PDA), a personal media player device, a wireless web-watch device, a personal headset device, an application-specific device, or a hybrid device that may include any of the above functions. And may even be implemented as servers, such as file servers, database servers, application servers, WEB servers, and the like. The embodiments of the present application are not limited in this regard.
In an embodiment according to the application, the computing device 100 is configured to perform a hard disk data cleaning method 200 according to the application. The application of the computing device 100 includes a plurality of program instructions for executing the hard disk data cleaning method 200 of the present application, where the program instructions can be read and executed by a processor, so that the computing device 100 can implement the hard disk data cleaning method 200 of the present application to clean the hard disk data thoroughly.
According to one embodiment, the application of the computing device 100 includes a hard disk data cleaning device 400, where the hard disk data cleaning device 400 includes a plurality of program instructions for executing the hard disk data cleaning method 200 of the present application, such that the hard disk data cleaning method 200 of the present application can be executed in the hard disk data cleaning device 400.
In the embodiment, the method 200 for cleaning the hard disk data is specifically described by taking the SSD hard disk as an example. However, it should be understood that the hard disk data cleaning method 200 of the present application is not limited to a particular type of hard disk. Any kind of data cleaning of the hard disk can be realized by the method of the application is within the protection scope of the application.
FIG. 2 illustrates a flow chart of a hard disk data cleaning method 200 according to one embodiment of the application. The hard disk data cleaning method 200 may be performed in a hard disk data cleaning apparatus 400 of a computing device (e.g., the computing device 100 described previously).
According to an embodiment of the application, storage device 132 of computing device 100 includes one or more SSD hard disks.
As shown in fig. 2, the method 200 begins at step S210.
In step S210, one or more hard disks included in the computing device are scanned to obtain device information for each hard disk in the computing device. Here, the hard disk may be implemented as an SSD hard disk.
In one embodiment, the device information includes, for example, one or more of a drive, a device model number, and a capacity size.
Then in step S220, it is determined whether each hard disk is capable of cleaning according to the device information of each hard disk, and finally one or more cleanable hard disks may be determined.
Subsequently, in step S230, device information of one or more cleanable hard disks is displayed on the client, and a target hard disk selected by the user is acquired.
In one implementation, device information for one or more cleanable hard disks is displayed on a data cleaning interface by displaying the data cleaning interface on a screen of a computing device. For example, in the process of scanning one or more hard disks, if the hard disk is determined to be cleanable according to the device information of the hard disk, the device information of the cleanable hard disk may be displayed on the data cleaning interface of the client. The user may then select a target hard disk at the data cleaning interface that requires data to be cleaned. The computing device may obtain the user selected target hard disk.
FIG. 3 illustrates a schematic diagram of a data cleansing interface according to one embodiment of the application. As shown in fig. 3, the device information of the cleanable hard disk displayed on the data cleaning interface includes a drive letter (SDx), a device model number, a capacity size (xGB), and the like.
In addition, as shown in fig. 3, a history may also be displayed on the data cleaning interface. Specifically, the latest piece of history cleaning information (namely the last cleaning information) corresponding to the hard disk is obtained, and the obtained latest piece of history cleaning information is displayed on the data cleaning interface, so that a user can know the history cleaning information. Here, the historical cleaning information includes, for example, one or more of cleaning time, device model number, capacity size.
Finally, in step S240, data is randomly written into each partition of the target hard disk until the remaining space of the target hard disk is smaller than one data block, which triggers a garbage collection mechanism (GC) to clean up the target hard disk. It should be noted that triggering the garbage collection mechanism GC may collect all dirty data blocks on the target hard disk, and finally, complete cleaning of the dirty data on the target hard disk is achieved on the basis of not deleting the original file of the system.
After step S240 is performed, the data cleaning process for the target hard disk is completed by deleting all the data written randomly.
It should be noted that according to the hard disk data cleaning scheme of the application, the hard disk is not required to be subjected to full disk erasure, the original file of the system is not erased, and only useless dirty data on the hard disk is cleaned, so that the thoroughly cleaning effect of the dirty data of the hard disk is realized on the basis of protecting the original file of the system.
In one embodiment, before step S240 is performed, the partition information table of the target hard disk is read based on the drive letter in the device information of the target hard disk, the root partition of the target hard disk may be determined according to the partition information table, and then the root partition of the target hard disk is placed to the end of the partition information table (DInfo list). Further, in step S240, data may be sequentially written to each partition according to the order of the respective partitions in the partition information table of the target hard disk. Since the root partition is at the end of the partition information table, data is written to the root partition last.
Further, before step S240 is performed, it is further detected whether there is an un-partitioned area and/or a hidden partitioned area of the target hard disk, and if there is no un-partitioned area and/or hidden partitioned area, step S240 may be directly performed to randomly write data to each partition of the target hard disk.
If the target hard disk has the non-partitioned area and/or the hidden partitioned area, prompting the user that the non-partitioned area and/or the hidden partitioned area exist, partitioning the non-partitioned area and/or the hidden partitioned area and formatting the non-partitioned area and/or the hidden partitioned area, and partitioning the non-partitioned area and/or the hidden partitioned area and formatting the non-partitioned area and/or the hidden partitioned area after the user selects and confirms execution.
The data erasure of the SSD hard disk is in units of data blocks (blocks), and the writing data is in units of data pages (pages).
The principle of data cleaning of SSD hard disk based on garbage collection mechanism in the application is as follows:
it is assumed that a SSD hard disk includes two data blocks, each data block containing 16 data pages, each data page having a size of 4k. Wherein ABCD is written in the first 4 data pages of data block one, respectively, the data blocks are shown in tables 1 and 2 below:
TABLE 1 data Block one after writing ABCD
TABLE 2 data Block two after writing ABCD
If the data change, the data ABCD in the first 4 data pages of the data Block needs to be modified into a 'B' C 'D', and since the data erasure of the SSD hard disk takes the data Block as a unit, the SSD hard disk cannot directly erase the data page where the ABCD is located, and only the data a 'B' C 'D' can be written into the new data page, and the data page where the original data ABCD is located is marked as useless data, the data Block at this time is shown in the following tables 3 and 4:
TABLE 3 data block one after writing data A ' B ' C ' D
Table 4 data block two after writing data a ' B ' C ' D
It can be seen that by modifying (overlaying) the data, in fact the original data ABCD still exists, but is marked as useless data. Therefore, complete deletion of the original data ABCD cannot be achieved by way of overlaying the data.
In order to delete the original data ABCD thoroughly, the first data block in which the ABCD is located needs to be erased. Based on this, by continuing to write data "0" into the SSD hard disk until the free pages of data block one are filled, as shown in tables 5 and 6 below:
TABLE 5 data block one after writing data "0
Table 6 data block two after writing data "0
After filling the free pages of data block one, if data continues to be written into the SSD hard disk, a garbage collection mechanism (GC) is triggered to migrate the data of data block one to data block two and erase data block one, as shown in tables 7 and 8 below:
table 7 data block one after triggering garbage collection mechanism
Table 8 sets forth data block two after triggering garbage collection mechanism
To this end, the original data ABCD (i.e., useless dirty data) in the SSD hard disk is completely deleted.
According to the principle of performing data cleaning on the SSD hard disk based on the garbage collection mechanism, by randomly writing data into each partition of the target hard disk, when the residual space of the target hard disk is smaller than one data block, if the data is continuously written into the target hard disk, the garbage collection mechanism is triggered to erase (collect) the dirty data block on the target hard disk, so that the dirty data of the target hard disk is thoroughly cleaned on the basis of keeping the original file of the system.
According to one embodiment of the present application, in step S240, data may be written to each partition of the target hard disk in turn (in order of each partition) based on the data block size. Here, data may be written to each partition of the target hard disk in turn according to the partition order in the partition information table of the target hard disk.
Specifically, the random writing of data to each partition of the target hard disk may be performed as follows:
and calculating the residual space of the target hard disk. Here, the remaining space is denoted as TZ.
And acquiring the data block size and the paging size of the target hard disk by calling a system interface. Here, the data block size is denoted as BS, and the page size is denoted as PS.
The number of data blocks BC to be written is calculated based on the remaining space and the data block size. Here, the number of data blocks is denoted as BC, where bc=tz/BS.
Data is written to the partitions of the target hard disk each time in the order of the partitions based on an integer multiple of the data block size. That is, one or more data blocks are written to the partition of the target hard disk at a time. Until the remaining space TZ of the target hard disk is smaller than one data block. It will be appreciated that writing data based on integer multiples of the data block size is more efficient.
The total number of written data blocks (which may be denoted as M) is determined in real time and compared with the number of data blocks to be written BC, for example the difference between the total number of written data blocks M and the number of data blocks to be written BC may be calculated to determine the size of both.
If the total number M of the written data blocks is equal to the number BC of the data blocks to be written, the residual space of the target hard disk can be determined to be smaller than one data block, and a GC mechanism can be triggered to recycle the dirty data blocks of the target hard disk at the moment so as to clean the data of the target hard disk.
For example, if the size of each write data is 1 times the size of the data block, that is, the size of each write data is BS, the number of data blocks that have been written BC (equal to the number of data blocks to be written BC) can be reached based on the data block size BC times, in which case it is obviously determined that the remaining space TZ of the target hard disk is smaller than the size of one data block.
If the total number of written data blocks M is smaller than the number of data blocks BC to be written, and the written data size is smaller than or equal to the difference (TZ-BS) between the residual space and the data block size, the residual space of the target hard disk is larger than or equal to one data block. And then, writing data into each partition of the target hard disk in turn based on the paging size PS until the written data size is larger than a difference value (TZ-BS) between the residual space and the data block size, and determining that the residual space of the target hard disk is smaller than one data block. The GC mechanism may then be triggered to perform data cleaning on the target hard disk.
In one embodiment, as shown in FIG. 3, the data cleansing interface also displays "free cleansing", "immediate cleansing" controls that can be selected by the user. After the user selects the target hard disk, the computing device can be controlled to execute the idle cleaning mechanism by clicking the idle cleaning control to clean the hard disk data, and correspondingly, the computing device is controlled to execute the idle cleaning mechanism by clicking the immediate cleaning control to clean the hard disk data.
If the user clicks the immediate cleaning control, the computing device may receive the operation that the user selects immediate cleaning, and execute the immediate cleaning mechanism, that is, directly execute step S240 to randomly write data to each partition of the target hard disk, without selecting to randomly write data to each partition of the target hard disk during the idle time of the computing device.
If the user clicks the idle time cleaning control, the computing device may receive an operation of selecting idle time cleaning by the user, and execute an idle time cleaning mechanism. Specifically, if the computing device receives an operation of selecting idle time cleaning by the user, each time before randomly writing data to each partition of the target hard disk, it is detected whether the mouse or the keyboard is operated within a predetermined time. If a mouse or keyboard operation is detected within a predetermined time, no data is currently randomly written to each partition of the target hard disk. And if the mouse or keyboard operation is not detected within the preset time, acquiring the last cleaning progress of the target hard disk, and continuing to randomly write data into each partition of the target hard disk based on the last cleaning progress.
It should be noted that according to the idle time cleaning mechanism provided by the application, the cleaning of the hard disk data can be performed in the idle time period of the user, so that the hard disk data is cleaned without affecting the work of the user, and the user experience is improved.
In one embodiment, as shown in FIG. 3, the cleaning progress is also determined in real time during the data cleaning process for the target hard disk by randomly writing data to each partition of the target hard disk. Specifically, the size of the data which is written currently is determined in real time, the current cleaning progress is determined according to the ratio (percentage) of the size of the data which is written currently to the remaining space TZ of the target hard disk, and the current cleaning progress is displayed on a data cleaning interface in real time. The cleaning progress is displayed on the data cleaning interface in real time, so that a user can clearly know the previous cleaning state.
In addition, after deleting all the randomly written data and cleaning the target hard disk data, the cleaning information of the target hard disk is recorded. Specifically, the cleaning information (including cleaning time, equipment model, and capacity) of the target hard disk can be written into the data storage device, so that when the data of the hard disk is cleaned next time, the cleaning information of the target hard disk can be obtained from the data storage device and displayed on the data cleaning interface next time.
Fig. 4 shows a schematic diagram of a hard disk data cleaning device 400 according to an embodiment of the application. The hard disk data cleaning apparatus 400 resides in a computing device (e.g., the aforementioned computing device 100) adapted to perform the hard disk data cleaning method 200 of the present application.
As shown in fig. 4, the hard disk data cleaning device 400 includes an acquisition module 410, a determination module 420, a display module 430, and a writing module 440, which are sequentially connected. Wherein the acquisition module 410 is configured to acquire device information of each hard disk in the computing device 100. The determination module 420 may determine whether each hard disk is capable of cleaning based on the device information to determine one or more cleanable hard disks. The display module 430 may display one or more cleanable hard disk device information to obtain a user selected target hard disk. The writing module 440 is configured to randomly write data into each partition of the target hard disk until the remaining space of the target hard disk is smaller than one data block, so as to trigger the garbage collection mechanism to collect all dirty data blocks on the target hard disk, thereby achieving the effect of cleaning the data of the target hard disk.
It should be noted that the obtaining module 410 is configured to perform the foregoing step S210, the determining module 420 is configured to perform the foregoing step S220, the displaying module 430 is configured to perform the foregoing step S230, and the writing module 440 is configured to perform the foregoing step S240. The specific execution logic of the acquisition module 410, the determination module 420, the display module 430, and the writing module 440 refers to the descriptions of steps S210 to S240 in the foregoing method 200, and will not be repeated here.
According to the hard disk data cleaning method, the determined equipment information of one or more cleanable hard disks is displayed on the client side so that a user can select a target hard disk to be cleaned, data is randomly written into each partition of the target hard disk according to the target hard disk selected by the user, and a garbage collection mechanism is triggered to erase all dirty data blocks on the target hard disk until the residual space of the target hard disk is smaller than one data block, so that the thorough cleaning effect of the SSD hard disk dirty data is realized on the basis of keeping the original files of the system.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present application, or certain aspects or portions of the methods and apparatus of the present application, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U-drives, floppy diskettes, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the application.
In the case of program code execution on programmable computers, the computing device will generally include a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to execute the hard disk data cleaning method of the present application in accordance with instructions in said program code stored in the memory.
By way of example, and not limitation, readable media comprise readable storage media and communication media. The readable storage medium stores information such as computer readable instructions, data structures, program modules, or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with examples of the application. The required structure for a construction of such a system is apparent from the description above. In addition, the present application is not directed to any particular programming language. It will be appreciated that the teachings of the present application described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present application.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the application, various features of the application are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed as reflecting the intention that: i.e., the claimed application requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this application.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the devices in this example. The modules in the foregoing examples may be combined into one module or may be further divided into a plurality of sub-modules.
Those skilled in the art will appreciate that the modules in the apparatus of the embodiments may be adaptively changed and disposed in one or more apparatuses different from the embodiments. The modules or units or components of the embodiments may be combined into one module or unit or component and, furthermore, they may be divided into a plurality of sub-modules or sub-units or sub-components. Any combination of all features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or units of any method or apparatus so disclosed, may be used in combination, except insofar as at least some of such features and/or processes or units are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings), may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features but not others included in other embodiments, combinations of features of different embodiments are meant to be within the scope of the application and form different embodiments.
Furthermore, some of the embodiments are described herein as methods or combinations of method elements that may be implemented by a processor of a computer system or by other means of performing the functions. Thus, a processor with the necessary instructions for implementing the described method or method element forms a means for implementing the method or method element. Furthermore, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is for carrying out the functions performed by the elements for carrying out the objects of the application.
As used herein, unless otherwise specified the use of the ordinal terms "first," "second," "third," etc., to describe a general object merely denote different instances of like objects, and are not intended to imply that the objects so described must have a given order, either temporally, spatially, in ranking, or in any other manner.
While the application has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of the above description, will appreciate that other embodiments are contemplated within the scope of the application as described herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The disclosure of the present application is intended to be illustrative, but not limiting, of the scope of the application, which is defined by the appended claims.

Claims (14)

randomly writing data into each partition of a target hard disk until the residual space of the target hard disk is smaller than a data block, so as to trigger a garbage collection mechanism to clean the data of the target hard disk, wherein the method comprises the following steps: calculating the residual space of the target hard disk; acquiring the data block size and the paging size of the target hard disk; calculating the number of data blocks to be written based on the remaining space and the data block size; writing data to a partition of the target hard disk each time based on an integer multiple of the data block size; determining the total number of written data blocks, and if the total number of the written data blocks is equal to the number of the data blocks to be written, determining that the residual space of the target hard disk is smaller than one data block; and
the writing module is suitable for randomly writing data into each partition of the target hard disk until the residual space of the target hard disk is smaller than one data block, so as to trigger a garbage collection mechanism to clean the data of the target hard disk and delete all randomly written data, wherein the writing module is further suitable for: calculating the residual space of the target hard disk; acquiring the data block size and the paging size of the target hard disk; calculating the number of data blocks to be written based on the remaining space and the data block size; writing data to a partition of the target hard disk each time based on an integer multiple of the data block size; and determining the total number of the written data blocks, and if the total number of the written data blocks is equal to the number of the data blocks to be written, determining that the residual space of the target hard disk is smaller than one data block.
CN202210081999.1A2021-12-032021-12-03Hard disk data cleaning method and device and computing equipmentActiveCN114415963B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202210081999.1ACN114415963B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment

Applications Claiming Priority (2)

Application NumberPriority DateFiling DateTitle
CN202111465744.7ACN113867651B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment
CN202210081999.1ACN114415963B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment

Related Parent Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111465744.7ADivisionCN113867651B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment

Publications (2)

Publication NumberPublication Date
CN114415963A CN114415963A (en)2022-04-29
CN114415963Btrue CN114415963B (en)2023-09-19

Family

ID=78985787

Family Applications (2)

Application NumberTitlePriority DateFiling Date
CN202210081999.1AActiveCN114415963B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment
CN202111465744.7AActiveCN113867651B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment

Family Applications After (1)

Application NumberTitlePriority DateFiling Date
CN202111465744.7AActiveCN113867651B (en)2021-12-032021-12-03Hard disk data cleaning method and device and computing equipment

Country Status (1)

CountryLink
CN (2)CN114415963B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2004287552A (en)*2003-03-192004-10-14Tdk CorpData erasing method for hard disk, computer program, and recording medium
CN102511044A (en)*2011-09-062012-06-20华为技术有限公司 A method and device for deleting data
CN107506138A (en)*2017-08-112017-12-22东莞记忆存储科技有限公司 A method for improving the service life of solid-state hard drives
CN108874309A (en)*2018-05-252018-11-23新华三技术有限公司The method and apparatus of physical block in a kind of management solid state hard disk
CN109725842A (en)*2017-10-302019-05-07伊姆西Ip控股有限责任公司Accelerate random writing layout with the system and method for mixing the distribution of the bucket in storage system
CN112035061A (en)*2020-08-172020-12-04鹏城实验室Solid state disk resource allocation method and device and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP5221157B2 (en)*2008-02-042013-06-26株式会社日立製作所 Computer system and physical disk recovery method
AU2015381014B2 (en)*2015-12-032018-02-22Huawei Technologies Co., LtdArray controller, solid state disk, and method for controlling solid state disk to write data
CN105677243B (en)*2015-12-312018-12-28华为技术有限公司 Data writing device and method
JP6524039B2 (en)*2016-09-232019-06-05東芝メモリ株式会社 Memory system and control method
US11126561B2 (en)*2019-10-012021-09-21Alibaba Group Holding LimitedMethod and system for organizing NAND blocks and placing data to facilitate high-throughput for random writes in a solid state drive
CN111078137B (en)*2019-11-072021-07-06深圳市金泰克半导体有限公司Method for cleaning storage space
CN111090398B (en)*2019-12-132022-06-17北京浪潮数据技术有限公司Garbage recycling method, device and equipment for solid state disk and readable storage medium
CN112433676B (en)*2020-11-242024-07-16合肥康芯威存储技术有限公司Garbage recycling method and system for solid state disk
CN113360095B (en)*2021-06-042023-02-17重庆紫光华山智安科技有限公司Hard disk data management method, device, equipment and medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
JP2004287552A (en)*2003-03-192004-10-14Tdk CorpData erasing method for hard disk, computer program, and recording medium
CN102511044A (en)*2011-09-062012-06-20华为技术有限公司 A method and device for deleting data
CN107506138A (en)*2017-08-112017-12-22东莞记忆存储科技有限公司 A method for improving the service life of solid-state hard drives
CN109725842A (en)*2017-10-302019-05-07伊姆西Ip控股有限责任公司Accelerate random writing layout with the system and method for mixing the distribution of the bucket in storage system
CN108874309A (en)*2018-05-252018-11-23新华三技术有限公司The method and apparatus of physical block in a kind of management solid state hard disk
CN112035061A (en)*2020-08-172020-12-04鹏城实验室Solid state disk resource allocation method and device and storage medium

Also Published As

Publication numberPublication date
CN114415963A (en)2022-04-29
CN113867651B (en)2022-02-25
CN113867651A (en)2021-12-31

Similar Documents

PublicationPublication DateTitle
CN108021510B (en)Method of operating a storage device that manages multiple namespaces
US8417893B2 (en)Memory mapping techniques
EP3869343B1 (en)Storage device and operating method thereof
US8516219B2 (en)Index cache tree
CN102483714B (en) System and method for restoring index pages in a flash memory device
WO2017066601A1 (en)Method and apparatus for providing hybrid mode to access ssd drive
CN101354715A (en) Systems, methods and computer program products for operating data processing systems
JP2010518491A (en) Extending the life of flash drives
CN113504861B (en)Desktop management method and device and computing equipment
CN106527992A (en)Method and device for destroying data in storage equipment
CN110990301A (en)Sequential reading method of multi-plane storage medium and related device
CN114415963B (en)Hard disk data cleaning method and device and computing equipment
JP2003015928A (en)Data storage device for flash memory and data storage method used therefor
CN113254142B (en)System desktop area dividing method and computing device
JPH08137754A (en)Disk cache device
Lin et al.History-aware page replacement algorithm for NAND flash-based consumer electronics
US10613973B1 (en)Garbage collection in solid state drives
JP5452735B2 (en) Memory controller and memory access method
KR100994052B1 (en)Data management method in flash translation layer and flash memory apparatus performing the same
CN111966606B (en) Data storage device and data processing method
CN113625953B (en) A data processing method, device, equipment and storage medium
CN112988618B (en)Garbage recycling method, device and equipment for solid state disk and storage medium
CN110688325A (en) Garbage collection method, device, device and storage medium for solid-state hard disk
CN120010771A (en) A data processing method, device, storage device and medium
CN120256394A (en) Fragmentation evaluation method, device, electronic device and readable storage medium

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp