A storage device data erasure method and apparatus, an electronic device, and a storage medium
By determining the padding bits and interval bits of logical partitions in the storage device and filling the target physical sector, the problem of low data erasure efficiency in the prior art is solved, and efficient data erasure and data leakage protection are achieved.
Patent Information
- Application Number
- CN202211549462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-05
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2042-12-05
AI Technical Summary
Existing technologies for deleting data from storage devices by overwriting deleted data are inefficient and pose a risk of data leakage.
By obtaining the logical partitions and their capacities of the storage device, the padding bits and spacing bits of the target logical partition are determined. Based on these bits, the target physical sector is filled, thus destroying the original data.
It improves data writing and erasing efficiency, reduces data volume, and lowers the risk of data leakage while ensuring the lifespan of storage devices.
Smart Images

Figure CN115826861B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of storage media, and in particular to a storage device data elimination method and device, an electronic device, and a storage medium. BACKGROUND
[0002] When deleting data in a storage device, only the mark of the data on the storage device is deleted from the partition table, and the data is not deleted, and the data is actually saved in the storage device. When new data is detected to be written, the new data is overwritten and written in the position of the deleted data. Therefore, if the storage device is repaired or scrapped, the data information may be easily leaked.
[0003] At present, in order to reduce the situation of data information leakage, useless data is actively written into the storage device, that is, each storage bit in the storage device is overwritten by useless data, so as to overwrite and erase the deleted data. Since there are many storage bits in the storage device, the method of covering each storage bit in the storage device by useless data to eliminate the data in the storage device takes a long time and has low efficiency. SUMMARY
[0004] In order to improve the erasing efficiency of the storage device, the present application provides a storage device data elimination method and device, an electronic device, and a storage medium.
[0005] In a first aspect, the present application provides a storage device data elimination method, which adopts the following technical solution:
[0006] A storage device data elimination method comprises the following steps:
[0007] Obtaining a logical partition of a storage device and a capacity corresponding to the logical partition, the logical partition corresponding to a physical sector;
[0008] According to the detected partition selection instruction, a target logical partition is determined;
[0009] According to the capacity of the target logical partition, a filling bit for filling data and / or an interval bit without filling data is determined;
[0010] Based on the filling bit and / or the interval bit, a target physical sector corresponding to the target logical partition is filled.
[0011] By adopting the technical scheme, the logical partition of the storage device and the capacity corresponding to the logical partition are obtained, so that the target logical partition needing to be eliminated from erasing can be determined when the detected partition selection instruction is detected. Since the capacity of the target logical partition is the capacity of how much data can be stored, and the actual storage data position of the logical partition is the position on the physical sector, the filling bit needing to be filled with data and / or the interval bit not needing to be filled with data are determined according to the capacity of the target logical partition. Then, the target physical sector of the target logical partition is filled according to the determined filling bit and / or interval bit, so as to destroy the originally stored data. Since the interval jump filling reduces the data amount and improves the filling efficiency compared with filling each bit on the target physical sector.
[0012] In another possible implementation manner, the determining the filling bit and the interval bit according to the capacity of the target logical partition comprises:
[0013] determining a preset capacity interval in which the capacity of the target logical partition is located, to determine the number of filling bits of the target logical partition, the preset capacity interval having a corresponding relationship with the number of filling bits;
[0014] determining the filling bit based on the number of filling bits and the capacity of the target logical partition, each of the filling bits corresponding to a storage bit;
[0015] determining the storage bit other than the filling bit in the target logical partition as an interval bit.
[0016] By adopting the technical scheme, the greater the capacity of the target logical partition is, the more the number of required filling bits is, that is, the more the filled data is, so as to ensure that the data can be effectively destroyed. Therefore, the preset capacity interval in which the capacity of the target logical partition is located is determined, so that the number of filling bits corresponding to the target logical partition is determined according to the capacity. Since the capacity of the target logical partition is determined, the position of each filling bit can be determined after the number of filling bits required by the target logical partition is determined. After the position of each filling bit is determined, the storage bit other than the filling bit is the interval bit, so that the accuracy of determining the filling bit and the interval bit can be improved.
[0017] In another possible implementation manner, the filling the target physical sector corresponding to the target logical partition based on the filling bit comprises:
[0018] determining the filling data corresponding to the filling bit from the set filling data;
[0019] filling the filling data into the filling bit to complete the filling of the target physical sector.
[0020] By adopting the technical scheme, after the padding bits are determined, the padding data corresponding to each padding bit is determined from the padding data set in advance, so that the padding can be more conveniently performed, the padding time is shortened as a whole, and the efficiency is improved.
[0021] In another possible implementation manner, the determining the target logical partition further includes:
[0022] Obtaining category information of the storage device and creation time of a file in the storage device;
[0023] Determining an earliest creation time from the creation time of the file;
[0024] Determining a padding number of times based on the earliest creation time, the category information, and respective corresponding coefficients, the coefficients being used to represent importance degrees of the earliest creation time and the category information.
[0025] By adopting the technical scheme, the service life of the storage device is mainly related to the category of the storage device, and the theoretical padding number of times corresponding to different categories of storage devices is different, that is, the service life of different categories of storage devices is different. The file with the earliest creation time in the storage device can also represent the use time of the storage device, and the padding number of times is determined more accurately according to the category information of the storage device, the earliest creation time, and respective corresponding coefficients, so that the service life of the storage device can be reduced while the padding success rate is further improved.
[0026] In another possible implementation manner, the determining the target logical partition further includes:
[0027] Obtaining category information of the storage device;
[0028] Searching, from the set category information, whether there is target category information consistent with the category information of the storage device, each of the set category information corresponding to a padding number of times;
[0029] If the target category information exists, the padding number of times corresponding to the target category information is determined as the padding number of times of the storage device.
[0030] By adopting the technical scheme, after the category information of the storage device is obtained, the target category information consistent with the storage device is searched from the set category information, and if the target category information exists, the padding number of times of the target category information is determined as the padding number of times of the storage device, that is, the padding number of times of the storage device is determined more conveniently and accurately through the padding number of times corresponding to the set category information.
[0031] In another possible implementation, if the storage device is a storage device integrated into an electronic device, the step of obtaining the logical partitions of the storage device and the corresponding capacities of the logical partitions further includes:
[0032] Determine the operating system running on the electronic device;
[0033] If the operating system is Linux, then the physical sector on the storage device corresponding to the root directory is determined, and the root directory is used to record all files and directories in the Linux system;
[0034] The physical sectors on the storage device corresponding to the root directory are masked.
[0035] By adopting the above technical solution, the root directory in the Linux system records the access paths of all files. Therefore, the physical sector where the root directory is located is determined, and then the physical sector is blocked, which reduces the possibility of users accidentally deleting the root directory, thereby reducing damage to the system.
[0036] In another possible implementation, the process of filling the target physical sector corresponding to the target logical partition based on the padding bits and / or interval bits further includes:
[0037] Obtain the data of the padding bits;
[0038] Determine whether the acquired data is consistent with the data filled in the last fill operation;
[0039] If they match, the filling was successful;
[0040] If there is a discrepancy, the filling process is deemed to have failed.
[0041] By adopting the above technical solution, after the fill position is filled, the data in the current fill position is retrieved again, which makes it easier to know the filling status. The filled data is then compared with the data from the last fill. If they match, it means that each fill position was filled successfully; if they do not match, it means that there are fill positions that failed to fill. This verification allows users to know whether the filling was successful.
[0042] In another possible implementation, the determination of filling failure is followed by:
[0043] The following steps are executed repeatedly until the target fill position is successfully filled, wherein the target fill position includes fill positions that are inconsistent with the fill data of the last fill operation;
[0044] Determine the target fill position;
[0045] The data to be filled is determined based on the fill data from the last fill operation and the target fill position;
[0046] fill the target filling bit based on the data to be filled.
[0047] By adopting the technical scheme, when the filling fails, the target filling bit of the filling failure is determined, that is, the filling bit inconsistent after comparing with the data at the last time of filling, the data to be filled of the target filling bit is determined from the data at the last time of filling after the target filling bit is determined. The target filling bit is filled with the data to be filled again, and then the data of the target filling bit after filling is acquired again, and whether the target filling bit is filled successfully is judged, if the filling still fails, the target filling bit and the data to be filled are determined again, and the filling and whether the filling is successful are judged until the filling is successful, so that the success rate of filling is improved.
[0048] In a second aspect, the application provides a storage device data erasing apparatus, which adopts the following technical scheme:
[0049] A storage device data erasing apparatus comprises:
[0050] A first acquisition module is configured to acquire logical partitions of a storage device and capacities corresponding to the logical partitions, and the logical partitions correspond to physical sectors;
[0051] A first determination module is configured to determine a target logical partition according to a detected partition selection instruction;
[0052] A second determination module is configured to determine filling bits for filling data and / or interval bits for not filling data according to a capacity of the target logical partition;
[0053] A filling module is configured to fill target physical sectors corresponding to the target logical partition based on the filling bits and / or the interval bits.
[0054] By adopting the technical scheme, the first acquisition module acquires logical partitions of a storage device and capacities corresponding to the logical partitions, and the first determination module can determine a target logical partition requiring erasing and writing according to a detected partition selection instruction. Since the capacity of the target logical partition is the capacity of how much data can be stored, and the actual storage data position of the logical partition is the position on the physical sector, the second determination module determines filling bits requiring filling data and / or interval bits not requiring filling data according to the capacity of the target logical partition. Then, the filling module fills the target physical sectors of the target logical partition according to the determined filling bits and / or interval bits, so as to destroy the original stored data. Since the interval skip filling reduces the data amount and improves the filling efficiency compared with filling every bit on the target physical sector.
[0055] In a possible implementation, the second determining module, when determining the padding bits and the interval bits according to the capacity of the target logical partition, specifically includes:
[0056] determining a preset capacity interval in which the capacity of the target logical partition is located, and determining a number of padding bits of the target logical partition, the preset capacity interval and the number of padding bits having a corresponding relationship;
[0057] determining the padding bits based on the number of padding bits and the capacity of the target logical partition, each of the padding bits corresponding to a storage bit;
[0058] determining, as interval bits, the storage bits in the target logical partition except the padding bits.
[0059] In a possible implementation, the padding module, when padding the target physical sector corresponding to the target logical partition based on the padding bits, specifically includes:
[0060] determining padding data corresponding to the padding bits from the set padding data;
[0061] padding the padding data into the padding bits to complete the padding of the target physical sector.
[0062] In a possible implementation, the apparatus further includes:
[0063] a second obtaining module configured to obtain category information of the storage device and a creation time of a file in the storage device;
[0064] a time determining module configured to determine an earliest creation time from the creation time of the file;
[0065] a first number determining module configured to determine a padding number based on the earliest creation time, the category information, and respective coefficients, the coefficients being used to represent importance of the earliest creation time and the category information.
[0066] In a possible implementation, the apparatus further includes:
[0067] a category obtaining module configured to obtain category information of the storage device;
[0068] a category searching module configured to search, from set category information, whether there is target category information consistent with the category information of the storage device, each of the set category information corresponding to a padding number;
[0069] a second number determining module configured to, when there is the target category information, determine the padding number corresponding to the target category information as the padding number of the storage device.
[0070] In another possible implementation, the apparatus further includes:
[0071] a system determining module configured to determine an operating system running on the electronic device;
[0072] a sector determining module configured to determine, when the operating system is a Linux system, a physical sector corresponding to a root directory on a storage device, the root directory being used to record all files and directories in the Linux system;
[0073] a shielding module configured to shield the physical sector corresponding to the root directory on the storage device.
[0074] In another possible implementation, the apparatus further includes:
[0075] a data obtaining module configured to obtain data of the padding bit;
[0076] a judging module configured to judge whether the obtained data is consistent with padding data of a last padding operation;
[0077] a third determining module configured to determine that padding is successful when the obtained data is consistent with the padding data of the last padding operation;
[0078] a fourth determining module configured to determine that padding is unsuccessful when the obtained data is inconsistent with the padding data of the last padding operation.
[0079] In another possible implementation, the apparatus further includes:
[0080] a loop module configured to repeatedly execute the following steps until padding of a target padding bit is successful, the target padding bit including a padding bit inconsistent with padding data of a last padding operation in the padding bit;
[0081] determining a target padding bit;
[0082] determining to-be-padded data based on the padding data of the last padding operation and the target padding bit;
[0083] padding the target padding bit based on the to-be-padded data.
[0084] In a third aspect, the present application provides an electronic device, which adopts the following technical solution:
[0085] An electronic device, which includes:
[0086] one or more processors;
[0087] a memory;
[0088] One or more application programs, wherein the one or more application programs are stored in the memory and configured to be executed by the one or more processors, the one or more application programs are configured to: execute the storage device data elimination method according to any possible implementation manner of the first aspect.
[0089] In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical solution:
[0090] A computer readable storage medium, when the computer program is executed in the computer, the computer executes the storage device data elimination method according to any one of the first aspect.
[0091] In summary, the present application includes at least one of the following beneficial technical effects:
[0092] 1. Obtain the logical partition of the storage device and the capacity corresponding to the logical partition, so as to determine the target logical partition which needs to be eliminated and erased when the detected partition selection instruction is detected. Since the capacity of the target logical partition is the capacity of how much data can be stored, and the actual storage data position of the logical partition is the position on the physical sector, the filling bit which needs to be filled with data and / or the interval bit which does not need to be filled with data is determined according to the capacity of the target logical partition. Then, the target physical sector of the target logical partition is filled according to the determined filling bit and / or interval bit, so as to destroy the original stored data. Since the interval jump filling reduces the data amount and improves the filling efficiency compared with filling each bit on the target physical sector,
[0093] 2. The service life of the storage device is mainly related to the type of the storage device. Different types of storage devices correspond to different theoretical fillable times, that is, the service life of different types of storage devices is different. The file created earliest in the storage device can also represent the use time of the storage device. According to the type information and use time of the storage device, the filling times are more accurately determined, so as to further improve the filling success rate and reduce the loss and aging of the storage device. BRIEF DESCRIPTION OF DRAWINGS
[0094] Figure 1 is a flowchart of a storage device data elimination method of an embodiment of the present application.
[0095] Figure 2 is a structural schematic diagram of a storage device data elimination device of an embodiment of the present application.
[0096] Figure 3 is a structural schematic diagram of an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0097] The application will be described in further detail below with reference to the drawings.
[0098] Any modifications made by those skilled in the art on the basis of the application described in the specification should fall within the scope of the patent law as long as they are not creative contributions.
[0099] To make the objectives, technical solutions and advantages of the embodiments of the application clearer, the technical solutions in the embodiments of the application will be described in detail below with reference to the drawings accompanying the embodiments of the application. Obviously, the described embodiments are only some but not all of the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those of ordinary skill in the art without creative efforts should fall within the scope of the application.
[0100] In addition, the term "and / or" in this document only describes the association relationship of the associated objects, which means that there can be three relationships, for example, A and / or B, which can represent the three cases of A alone, A and B together, and B alone. In addition, the character " / " in this document generally represents an "or" relationship between the associated objects unless otherwise specified.
[0101] The embodiments of the application will be described in further detail below with reference to the drawings accompanying the specification.
[0102] The embodiments of the application provide a storage device data elimination method, which is executed by an electronic device. The electronic device can be a server or a terminal device. The server can be a physical server, a server cluster composed of multiple physical servers, a distributed system, or a cloud server providing cloud computing services. The terminal device can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but is not limited to this. The terminal device and the server can be directly or indirectly connected through wired or wireless communication. The storage device data elimination method provided by the embodiments of the application can also be executed by the storage device itself. The embodiments of the application are not limited to this. When a central processing unit (CPU) is arranged in the electronic device, the method can support electronic devices with CPU architectures such as ARM, AMD, and MIPS, as shown in FIG. 1. The method can include the following steps. Figure 1
[0103] Step S101: Obtain the logical partitions of the storage device and the capacities corresponding to the logical partitions.
[0104] The logical partition corresponds to a physical sector.
[0105] For the embodiments of the present application, the storage device can be a storage device integrated in the electronic device, such as a hard disk in a computer and a read-only memory in a mobile phone, etc. The storage device can also be a storage device not integrated in the electronic device, such as a U disk connected to a computer and an SD storage card connected to a mobile phone, etc.
[0106] In step S102, the target logical partition is determined according to the detected partition selection instruction.
[0107] The partition selection instruction can be triggered by a user through a mouse, a keyboard, a touch screen and other input devices. After the electronic device obtains the number and capacity of the storage device, each logical partition can be displayed on a display device such as a display screen through a visual operation interface, and the user can select the logical partition to be eliminated through the visual operation interface, i.e., the logical partition to be filled with data.
[0108] The electronic device can determine the target logical partition by triggering the selection instruction of the logical partition to be eliminated. Assuming that there are logical partition 1, logical partition 2 and logical partition 3, the electronic device displays the above three logical partitions through the visual operation interface, and the user triggers the partition selection instruction about the logical partition 2, so that the electronic device determines that the target logical partition is the logical partition 2.
[0109] In step S103, the filling bit for filling data and / or the interval bit for not filling data are determined according to the capacity of the target logical partition.
[0110] For the embodiments of the present application, the more the capacity of the logical partition, the more data is needed to eliminate data, so that more storage positions can be erased and filled. Therefore, the filling bit and / or the interval bit need to be determined according to the capacity of the logical partition. Taking step S102 as an example, after determining that the logical partition 2 is the target logical partition, assuming that the capacity of the logical partition 2 is 200 MB, the physical sector is the 51st sector to the 100th sector, the size of one sector is 512 KB, and 1 KB includes 1024 B, i.e., one sector has 524288 B of storage bits. In order to destroy the data in the logical partition 2 while ensuring safety, the filling bit and / or the interval bit need to be determined according to the capacity of the logical partition 2.
[0111] The filling bit and the interval bit both belong to the storage bit, i.e., the filling bit and the interval bit jointly constitute a physical sector. Therefore, only the filling bit can be determined, and after the filling bit is determined, the remaining storage bit is the interval bit; only the interval bit can be determined, and after the interval bit is determined, the remaining storage bit is the filling bit; or the filling bit and the interval bit can be determined at the same time, which is not limited herein.
[0112] Step S104, filling the target physical sectors corresponding to the target logical partition based on the filling bits and / or the interval bits.
[0113] For the embodiments of the present application, after the filling bits and / or the interval bits are determined, data is filled into the filling bits in the target physical sectors, thereby destroying the original data and making the original data not easy to be recovered. When the electronic device fills data into the target physical sectors, the interval bits do not need to be filled with data, and the interval bits are skipped, thereby reducing the amount of data filling and the filling time of the target physical sectors, and the efficiency is higher compared to filling each storage bit in the target physical sectors.
[0114] The target logical partition capacity is different, and the required filling bits and interval bits are also different, so in order to more accurately determine the filling bits and / or the interval bits, step S103 determines the filling bits and the interval bits according to the capacity of the target logical partition, specifically including step S1031 (not shown in the figure), step S1032 (not shown in the figure) and step S1033 (not shown in the figure), wherein,
[0115] Step S1031, determining the preset capacity interval in which the capacity of the target logical partition is located, so as to determine the number of filling bits of the target logical partition.
[0116] The preset capacity interval and the number of filling bits have a corresponding relationship.
[0117] Suppose there are 3 preset capacity intervals, which are [100MB, 150MB], (150MB, 250MB) and (250MB, 400MB). The number of filling bits corresponding to [100MB, 150MB] is 10000, the number of filling bits corresponding to (150MB, 250MB) is 20000, and the number of filling bits corresponding to (250MB, 400MB) is 30000. It should be noted that the larger the capacity of the target logical partition is, the more filling bits are required. The appropriate number of filling bits corresponding to the capacity can be measured in advance through experiments, and the smaller the range of a single preset capacity interval is, the more the number of filling bits corresponding to the preset capacity interval where the logical partition capacity is located conforms to the actual needs of the logical partition after the logical partition capacity is determined.
[0118] Taking step S103 as an example, the electronic device determines that the preset capacity interval where the logical partition 2 is located is (150MB, 250MB), so the number of filling bits corresponding to (150MB, 250MB), i.e. 20000, is determined as the number of filling bits of the logical partition 2.
[0119] Step S1032, determining the filling bits based on the number of filling bits and the capacity of the target logical partition.
[0120] Each filling bit corresponds to a storage bit.
[0121] For example, in step S1031, after determining that the number of padding bits of the logical partition 2 is 20000, the capacity 200MB of the logical partition 2 is converted into the number of storage bits according to the measurement unit (B) of the storage bits in the physical sector, and the number of storage bits is obtained, that is, the size of one storage bit is equal to 1B, and the number of storage bits also represents the capacity of the logical partition 2.
[0122] The difference between the number of storage bits and the number of padding bits is calculated, and then the obtained difference is divided by the number of padding bits, so that the number of interval bits between the adjacent padding bits is determined. For example, 200MB is converted into 209715200B according to the measurement unit (B) of the storage bits, that is, the physical sector of 200MB includes 209715200 storage bits, and the difference between the number of storage bits 209715200 and the number of padding bits 20000 is 209695200. The value obtained by dividing the difference by the number of padding bits 20000 is equal to 10484.76. Since the obtained value is not an integer, the obtained value can be rounded to an integer 10484, or rounded to an integer 10485, or processed according to the progress method to obtain 10485. Assuming that 10485 is taken as the number of interval bits between the adjacent two padding bits, after the number of interval bits is obtained, the interval of 10485 is filled, the first padding bit is the storage bit at the 10486th position in the target physical sector, and the interval between the adjacent two padding bits is 10485 storage bits. In other embodiments, the position of the starting padding bit can be set in the electronic device by the user in advance, for example, the starting storage bit is taken as the first padding bit, that is, the specified storage bit is taken as the first padding bit.
[0123] In the embodiments of the present application, the capacity can also be directly divided by the capacity corresponding to the number of padding bits. For example, one storage bit (B) is approximately equal to 0.0000009537MB, and the capacity corresponding to the number of padding bits 20000 is 0.019074MB. The value obtained by dividing the capacity 200MB by the capacity 0.019074MB corresponding to the number of padding bits is approximately equal to 10485.4776. The integer 10485 can be obtained by rounding or rounding, and the value can also be processed according to the progress method to obtain 10486. Assuming that 10485 is taken as the number of interval bits between the adjacent two padding bits, after the number of interval bits is obtained, the interval of 10485 is filled, and the first padding bit is the storage bit at the 10486th position in the target physical sector. In other embodiments, the position of the starting padding bit can also be set in the electronic device by the user in advance, for example, the starting storage bit is taken as the first padding bit, that is, the specified storage bit is taken as the first padding bit.
[0124] If the interval value between the two adjacent padding bits is not an integer, and the interval value between the two adjacent padding bits is obtained by rounding, rounding or rounding up, the last padding bit in the number of padding bits can not have a corresponding storage bit. For example, there are 12 storage bits in the capacity, 5 padding bits are filled in the 12 storage bits, and the interval value between the two adjacent padding bits is equal to 1.4. According to the rounding up method, the interval value between the two adjacent padding bits is 2. The starting storage bit is taken as the first padding bit, and the padding is performed according to the interval of 2. The second last padding bit is located at the third last storage bit in the capacity. At this time, there are only 2 storage bits as interval bits, and the last padding bit cannot be filled into the storage bit. For example, there are 14 storage bits in the capacity, 5 padding bits are filled in the 14 storage bits, and the interval value between the two adjacent padding bits is approximately equal to 1.8. According to the rounding up method, the interval value between the two adjacent padding bits is 2. If the third storage bit is taken as the first padding bit at this time, the padding is performed according to the interval of 2, and the second last padding bit is located at the third last storage bit in the capacity. At this time, there are only 2 storage bits as interval bits, and the last padding bit cannot be filled into the storage bit. The above two cases can be filled according to the preset rule. The preset rule can be to give up filling the last padding bit when the above-mentioned situation occurs. At this time, the actual number of padding bits in the logical partition is less than the determined number of padding bits. Also, when the above-mentioned situation occurs, the last storage bit in the capacity is determined as a padding bit for filling, which is not limited here.
[0125] If the number of interval bits between the two adjacent padding bits is obtained by rounding or rounding, it is also possible that after filling the last padding bit, the number of remaining storage bits is greater than the number of interval bits between the two adjacent padding bits. Still taking the capacity of the logical partition as an example, there are 12 storage bits, 5 padding bits are filled in the 12 storage bits, and the interval value between the two adjacent padding bits is approximately equal to 1.4. The interval value obtained by rounding or rounding is 1. The starting storage bit is taken as the first padding bit, and the padding is performed according to the interval of 1. The last padding bit is located at the fourth last storage bit in the 12 storage bits. At this time, the number of remaining storage bits is 3. Therefore, in order to further improve the data elimination effect, if the number of remaining storage bits is greater than the number of interval bits between the two adjacent padding bits, a padding bit is determined again according to the number of interval bits between the two adjacent padding bits, that is, the second last storage bit is determined as a padding bit and filled with data. If the number of remaining storage bits is greater than the number of interval bits between the two adjacent padding bits, it can also be selected not to determine a padding bit from the remaining storage bits, which is not limited here.
[0126] In other embodiments, one padding bit can include one storage bit (1B), or can include at least two storage bits. When one padding bit includes at least two storage bits, the padding bit can be referred to as a padding group in the embodiments of the present application, that is, the padding group includes at least two continuous storage bits. The position of the starting padding group can be set in the electronic device in advance by the user, for example, the position of the starting padding group starts from the first storage bit of the target physical sector. Referring to the above method of determining the position of each padding bit, the difference between the number of storage bits and the total number of storage bits corresponding to all padding groups is calculated, and then the obtained difference is divided by the number of padding groups, so that the number of interval bits between the padding groups can be determined.
[0127] In step S1033, the storage bits in the target logical partition except the padding bits are determined as interval bits.
[0128] For the embodiments of the present application, after the position of each padding bit is determined, the storage bits in the target physical sector except the padding bits are interval bits. For example, each storage bit can be labeled, and after the position of each padding bit is determined, the label corresponding to each padding bit is marked, so as to distinguish the interval bits and the padding bits.
[0129] Since the number of padding bits in the storage device is large, in order to improve the padding efficiency and reduce the padding time, the target physical sector corresponding to the target logical partition is padded based on the padding bits in step S104. Specifically, the padding data corresponding to the padding bits can be determined from the set padding data, and the padding data is filled into the padding bits to complete the padding of the target physical sector.
[0130] In the embodiments of the present application, random data can be generated in the electronic device in advance, and the random number is stored in a specific storage chip in the electronic device. The number of padding bits corresponding to each preset capacity interval corresponds to at least one random number data packet.
[0131] For example, the number of padding bits of the logical partition 2 is 20000, corresponding to 50 random number data packets, and each random number data packet contains 20000 random numbers. When padding is needed, one of the 50 random number data packets can be selected. The number of random numbers in each random number data packet corresponding to the logical partition 2 can also be different from the number of preset storage bits. For example, the 50 random number data packets corresponding to the logical partition 2 can each contain 2000 random numbers. When the logical partition 2 needs to be padded, 10 data packets can be randomly selected from the 50 random number data packets. Compared with generating random numbers on site when padding is needed, this method saves time and is more convenient. When the data in each random number data packet is less than the number of corresponding padding bits, more than one random number data packet is randomly selected, thereby further improving the complexity of the padding data, the data is not easy to recover, and the security of the data is improved.
[0132] In the embodiment of the present application, if one padding bit is composed of two storage bits, and the number of padding bits of the logical partition 2 is 20000, in fact, when the logical partition 2 is padded, 20000*2 random numbers are needed, that is, one padding bit can fill two random numbers. Assuming that there are 50 random number data packets corresponding, each random number data packet contains 40000 random numbers, then one of the 50 random number data packets can be randomly selected for padding. If each random number data packet contains 20000 random numbers, then two of the 50 random number data packets can be randomly selected for padding.
[0133] In order to further improve the padding effect and effectively eliminate the data in the storage device, the data in the storage device can be eliminated by multiple padding. However, since the service life of the storage device is related to the number of padding times, too many padding times will cause the storage device to age faster. Therefore, after determining the target logical partition in step S102, the method further includes steps S1 (not shown in the figure), S2 (not shown in the figure) and S3 (not shown in the figure), wherein,
[0134] In step S1, the type information of the storage device and the creation time of the file in the storage device are obtained.
[0135] For the embodiments of the present application, since the maximum data filling times corresponding to different types of storage devices are different, for example, the storage device of SLC (Single-Level Cell) architecture can withstand about 100,000 times of data filling erasing and writing, the storage device of MLC (Multi-Level Cell) architecture can withstand about 10,000 times of data filling erasing and writing, and the storage device of TLC (Triple-Level Cell) architecture can withstand about 500 times of data filling erasing and writing. Therefore, the type information of the storage device is obtained, so that the service life of the storage device can be known.
[0136] The creation time of the file in the storage device can also represent the use of the storage device. The longer the file creation time is, the longer the storage device is used, that is, the more the data filling times of the storage device are, and the less the remaining erasable filling times are. Therefore, the electronic device reads the attribute information of the file in the storage device, so that the creation time of the file can be known. For example, the electronic device reads that the creation time of file A is January 1, 2021, and the creation time of file B is May 1, 2021.
[0137] In step S2, the earliest creation time is determined from the creation time of the file.
[0138] After the electronic device reads the creation time of the file in the storage device, the earliest creation time is determined therefrom to represent the use time of the storage device. Taking step S1 as an example, the electronic device compares the creation times of file A and file B, so that the earliest creation time is determined to be January 1, 2021. The earlier the earliest creation time is, the longer the storage device is used, and the less the remaining erasable filling times are.
[0139] In step S3, the filling times are determined based on the earliest creation time, the type information, and the respective corresponding coefficients.
[0140] The coefficients are used to represent the importance of the earliest creation time and the type information.
[0141] Since the type information of the storage device and the earliest creation time of the file are both related to the service life of the storage device, in order to determine as many filling times as possible under the premise of ensuring the service life, the filling times are more accurately determined by comprehensively determining the filling times through the earliest creation time and the type information.
[0142] The more the theoretical erasable fill-in times of the storage device, the more the fill-in times that can be determined when erasing and filling, that is, the determined erasing and filling times are positively correlated with the type of the storage device. The earlier the earliest creation time, the greater the time difference from the current time, and the fewer the remaining erasable fill-in times, that is, the earliest creation time is negatively correlated with the fill-in times. Assuming that the coefficient of the type information is 0.007 and the coefficient of the earliest creation time is -0.03. The coefficients can be adjusted according to actual conditions.
[0143] The correspondence between the type information and the theoretical erasable fill-in times can be stored in the electronic device in advance, that is, the erasable fill-in times of the storage device can be determined after the type information is obtained. Assuming that the theoretical erasable times of the storage device are 10000 times. Taking step S2 as an example, the earliest creation time is January 1, 2021, the current time is October 15, 2022, and the difference between the earliest creation time and the current time is 287 days. The score of the storage device is calculated by the type information, the earliest creation time, and their respective coefficients, and 10000 x 0.007 + (-0.03) x 287 = 61.51 is obtained.
[0144] After the electronic device determines the score of the storage device, the fill-in times can be determined according to the score. For example, according to the determined score interval, each score interval corresponds to fill-in times, and after the score interval is determined, the fill-in times of the storage device can be determined. The score can also be divided by a reduction coefficient and rounded to obtain the fill-in times, for example, the reduction coefficient is 0.1, the electronic device calculates 61.51 ÷ 0.1 = 6.151, and then rounds to obtain 6, thereby determining the fill-in times of 6 times. The reduction coefficient can be pre-set and stored in the electronic device, and the reduction coefficient can be adjusted according to actual needs.
[0145] In another possible implementation of the embodiments of the present application, the method further comprises: obtaining type information of the storage device, and searching for whether there is target type information consistent with the type information of the storage device from the set type information. If there is, the fill-in times corresponding to the target type information are determined as the fill-in times of the storage device. Each set type information corresponds to fill-in times.
[0146] The optimal fill-in times of each type of storage device can be measured by experiment, and then the fill-in times corresponding to the type information can be stored in the electronic device. Assuming that the fill-in times of the storage device of SLC architecture are 10 times, the fill-in times of the storage device of MLC architecture are 5 times, and the fill-in times of the storage device of TLC architecture are 1 time.
[0147] After the electronic device obtains the type information of the storage device, the electronic device can search the set type information to determine whether the target type information consistent with the type information of the storage device is found, and then determine the filling number of the storage device. Assuming that the obtained type information of the storage device is SLC architecture, the electronic device searches the set type information to find SLC architecture, that is, the target type information consistent with the type information of the storage device exists in the set type information, and thus the electronic device can determine the filling number corresponding to SLC architecture as the filling number of the storage device.
[0148] In the embodiment of the present application, after the filling number is determined, the filling data at each filling time can be the same or different. The filling bits at each filling time can be the same or different, and the position of each filling bit is determined by the position of the first filling bit, that is, the starting filling position, so that the starting filling position at each filling time is different, thereby making the filling bits at each filling time different, and further improving the data elimination effect.
[0149] In other embodiments, the filling number of the storage device can be pre-set and programmed in the electronic device, or can be set by the user through a visual operation interface according to actual needs, or can be set by other means, which is not limited herein. Further, the random number at each filling time can also be pre-set in the electronic device, and when the storage device is filled, the pre-set random number is called for filling; or the user can select the random number at each filling time through a visual operation interface, and after the user selects the random number at each filling time, the electronic device can fill according to the random number selected by the user when the electronic device detects the filling instruction triggered by the user.
[0150] Further, if the storage device is integrated on the electronic device, after obtaining the logical partition of the storage device and the capacity corresponding to the logical partition, the method further includes steps Sa (not shown in the figure), step Sb (not shown in the figure) and step Sc (not shown in the figure), wherein,
[0151] In step Sa, the operating system running on the electronic device is determined.
[0152] In the embodiment of the present application, the electronic device calls the related attribute information of the electronic device to determine the running environment of the software, and thus determines the operating system on the electronic device. The operating system includes windows system and linux system.
[0153] In step Sb, if the operating system is the linux system, the root directory corresponding to the physical sector on the storage device is determined.
[0154] For the embodiment of the present application, the file systems for files are different between the windows system and the linux system. The windows system divides the logical partitions into different drive letters according to the space of the storage device, each drive letter is relatively independent, and the operating system is generally installed into the c drive, so that the user can easily identify the drive letter where the system is located. The partitions of the linux system are all embodied under / dev, i.e. the root directory, and the file needs to be mounted under the root directory when accessed. Since the user cannot determine the drive letter where the root directory system is located, it is easy to cause the mistaken deletion of the root directory drive letter.
[0155] In the embodiment of the present application, since there are many versions of the linux system, if the related commands are used to obtain the storage device information such as the serial number of the storage device, the mounting drive letter name and the storage device capacity size, etc., the formats or languages of the above information are different, so it is difficult to analyze the above information, and the linux system version needs to be adapted, thereby increasing the difficulty of analyzing the related information of the storage device. The electronic device encapsulates the serial number of the storage device, the mounting drive letter name and the storage device capacity size, etc. according to the self-defined format by using the kernel partition library, analyzes the information in the self-defined format, so as to display various information of the storage device, thereby realizing the adaptation to various versions of the linux system.
[0156] After the operating system of the electronic device is determined, the parted library in the linux system can be called, and then the instruction and the related operation for viewing the partition where the root directory is located in the part library can be used to view the partition where the root directory is located.
[0157] Step Sc, shielding the physical sector on the storage device corresponding to the root directory.
[0158] After the electronic device views the partition where the root directory is located, the partition where the root directory is located is shielded or hidden, so as to shield or hide the drive letter where the root directory is located, thereby not easily damaging the linux system. For example, by modifying the specific value in the registry, the shielding effect is achieved.
[0159] The related information of the number of logical partitions of the storage device and the capacity of each logical partition can be stored in a specific chip in the storage device, and the electronic device can obtain the logical partitions and the capacities corresponding to the logical partitions by reading the chip. After the number of logical partitions and the capacities corresponding to each logical partition are read, the region of the physical sector of the actual storage data corresponding to each logical partition can be determined, thereby facilitating the subsequent data filling.
[0160] In the embodiment of the present application, when the storage device is a U disk, because the quality of U disks on the market is uneven, some U disks can not record serial numbers and other information, thus causing certain difficulties in obtaining serial number information and analysis. Therefore, the electronic device can call instructions related to querying serial numbers in the parted library, and obtain and identify the serial number of the U disk according to the related instructions and the file when the electronic device is running. If the electronic device does not identify the serial number of the U disk, the U disk without a serial number is specially processed, for example, the position of the U disk serial number is filled with a "null" field or other specified field, and then the information such as the mounting disk symbol name and the storage device capacity size of the U disk is obtained.
[0161] In order to verify whether the filling of the target logical partition is successful, after step S104, steps S105 (not shown in the figure), S106 (not shown in the figure), S107 (not shown in the figure) and S108 (not shown in the figure) are further included, wherein after step S106 is executed, step S107 can be executed, or step S108 can be executed, wherein,
[0162] In step S105, the data of the filled bit is obtained.
[0163] For the embodiment of the present application, after the storage device is filled multiple times, the data recovery related script software is used to obtain the data of the filled bit in the target physical sector by breaking through the addressing and addressing mode of the operating system.
[0164] In step S106, it is judged whether the obtained data is consistent with the filled data of the last filling operation.
[0165] In step S107, if the data is consistent, it is determined that the filling is successful.
[0166] In step S108, if the data is not consistent, it is determined that the filling fails.
[0167] For the embodiment of the present application, the electronic device obtains the data of the filled bit after filling, and then calls the filled data of the last filling operation. Thus, the data of the filled bit and the data at the time of filling can be compared. Thus, it is judged whether the target physical sector is filled successfully. If the data of each filled bit is consistent with the data at the time of the last filling, it is indicated that the filling is successful, and if there is inconsistent data, it is indicated that the filling of the filled bit fails, thus possibly leading to data leakage.
[0168] To further improve the filling success rate of the target filling bit, after the acquired data is inconsistent with the filling data of the last filling operation, i.e., after the filling fails, the method can further include: cyclically performing the following steps, step S4 (not shown in the figure), step S5 (not shown in the figure), and step S6 (not shown in the figure), until the target filling bit is filled successfully, wherein the target filling bit includes the filling bit that is inconsistent with the filling data of the last filling operation, and wherein
[0169] Step S4, determining the target filling bit.
[0170] Step S5, determining the to-be-filled data based on the filling data of the last filling operation and the target filling bit.
[0171] Step S6, filling the target filling bit based on the to-be-filled data.
[0172] For the embodiment of the present application, the electronic device compares the data of the filled filling bit after filling with the data at the time of the last filling, thereby determining the filling bit that is inconsistent with the data at the time of the last filling as the target filling bit. Assuming that the 70th and 75th filling bits fail to fill, the 70th and 75th filling bits can be determined as the target filling bit. After the target filling bit is determined, the to-be-filled data, i.e., the data of the target filling bit that fails to fill, can be determined according to the position or label of the target filling bit, in the filling order from the filling data at the time of the last filling, assuming that the to-be-filled data is 3 and 5. After the to-be-filled data is determined, 3 and 5 are filled in the 70th and 75th filling bits to attempt to fill the filling bits that fail to fill successfully. After filling is completed, the data of the 70th and 75th filling bits is acquired again to determine whether the data of the above two filling bits is 3 and 5, thereby determining whether filling is successful, and further improving the security of the data in the storage device.
[0173] If the data of the 70th filling bit is still not 3 and / or the data of the 75th filling bit is still not 5, it indicates that there is still a filling bit that fails to fill. Assuming that the 70th filling bit fails to fill and the 75th filling bit fills successfully, the electronic device re-determines the 70th filling bit as the target filling bit, determines 3 as the to-be-filled data, and fills again to fill the target filling bit successfully.
[0174] Therefore, when there is a filling bit that fails to fill, the filling bit that fails to fill is continuously filled, and after each re-filling, it is determined whether it is consistent with the filling data at the time of the last filling, until there is no filling bit that is inconsistent with the data at the time of the last filling, thereby improving the success rate of filling the target filling bit.
[0175] In the embodiment of the present application, due to the particularity of the file system in the linux operating system, after the file is read and written and saved, the actual physical storage location of the file in the storage device will change, that is, the logical partition does not correspond to the physical sector, so when the file is overwritten, the storage location of the file in the physical hard disk before writing is not easily completely cleared by the data written in the row, thereby causing that when the storage device is deeply recovered, the file content before the read and write operation can be recovered. The electronic device adjusts the specific parameter settings related to the overwrite erasing in the linux system function, so that the actual location of the file in the physical sector can be directly overwritten, thereby avoiding saving the file to other physical sector locations of the storage device, so that when the file is recovered, the file cannot be recovered, thereby achieving more thorough cleaning of the file, and further increasing the difficulty of recovering the file.
[0176] The above embodiment introduces a storage device data elimination method from the perspective of method flow, and the following embodiment introduces a storage device data elimination apparatus from the perspective of virtual module or virtual unit. For details, please refer to the following embodiment.
[0177] The embodiment of the present application provides a storage device data elimination apparatus, as shown in the figure, the storage device data elimination apparatus 2 can specifically include: Figure 2
[0178] The first acquisition module 201 is configured to acquire the logical partition of the storage device and the capacity corresponding to the logical partition, and the logical partition corresponds to a physical sector.
[0179] The first determination module 202 is configured to determine the target logical partition according to the detected partition selection instruction.
[0180] The second determination module 203 is configured to determine the filling bit for filling data and / or the interval bit for not filling data according to the capacity of the target logical partition.
[0181] The filling module 204 is configured to fill the target physical sector corresponding to the target logical partition based on the filling bit and / or the interval bit.
[0182] By adopting the technical scheme, the first acquisition module 201 acquires the logical partition of the storage device and the capacity corresponding to the logical partition, the first determination module 202 can determine the target logical partition which needs to be eliminated according to the detected partition selection instruction, since the capacity of the target logical partition is the capacity of how much data can be stored, and the actual storage data position of the logical partition is the position on the physical sector, the second determination module 203 determines the filling bit and / or interval bit which needs to be filled according to the capacity of the target logical partition. Then the filling module 204 fills the target physical sector of the target logical partition according to the determined filling bit and / or interval bit, so as to destroy the original stored data, since the interval jump filling reduces the data amount compared with filling each bit on the target physical sector, and improves the filling efficiency.
[0183] In a possible implementation of the embodiment, the capacity of the target logical partition corresponds to all the storage bits in the target physical sector, and when the second determination module 203 determines the filling bit and the interval bit according to the capacity of the target logical partition, specifically includes:
[0184] determining a preset capacity interval in which the capacity of the target logical partition is located, and determining the number of filling bits of the target logical partition, the preset capacity interval and the number of filling bits have a corresponding relationship;
[0185] determining the filling bit based on the number of filling bits and the capacity of the target logical partition, each filling bit corresponds to a storage bit;
[0186] determining the storage bit other than the filling bit in the target logical partition as an interval bit.
[0187] In a possible implementation of the embodiment, when the filling module 204 fills the target physical sector corresponding to the target logical partition based on the filling bit, specifically includes:
[0188] determining the filling data corresponding to the filling bit from the set filling data;
[0189] filling the filling data into the filling bit to complete the filling of the target physical sector.
[0190] In a possible implementation of the embodiment, the device 20 further includes:
[0191] a second acquisition module, configured to acquire the category information of the storage device and the creation time of the file in the storage device;
[0192] a time determination module, configured to determine the earliest creation time from the creation time of the file;
[0193] a first number determination module, configured to determine the filling number based on the earliest creation time, the category information and the respective corresponding coefficients.
[0194] In a possible implementation of the embodiment of the application, the device 20 further includes:
[0195] The category obtaining module is configured to obtain category information of the storage device.
[0196] The category searching module is configured to search, from the set category information, whether there is target category information consistent with the category information of the storage device, each set category information corresponding to a filling number.
[0197] The second number determining module is configured to determine, when there is, the filling number corresponding to the target category information as the filling number of the storage device.
[0198] In a possible implementation of the embodiment of the application, the device 20 further includes:
[0199] The system determining module is configured to determine an operating system running on the electronic device.
[0200] The sector determining module is configured to determine, when the operating system is a linux system, a physical sector corresponding to a root directory on the storage device, the root directory being used to record all files and directories in the linux system.
[0201] The shielding module is configured to shield the physical sector corresponding to the root directory on the storage device.
[0202] In a possible implementation of the embodiment of the application, the device 20 further includes:
[0203] The data obtaining module is configured to obtain data of the filling bit.
[0204] The judging module is configured to judge whether the obtained data is consistent with filling data of the last filling operation.
[0205] The third determining module is configured to determine that the filling is successful when the obtained data is consistent with the filling data of the last filling operation.
[0206] The fourth determining module is configured to determine that the filling fails when the obtained data is not consistent with the filling data of the last filling operation.
[0207] In a possible implementation of the embodiment of the application, the device 20 further includes:
[0208] The cycle module is configured to cyclically execute the following steps until the target filling bit is filled successfully, the target filling bit including a filling bit that is not consistent with filling data of the last filling operation in the filling bit.
[0209] The target filling bit is determined.
[0210] The data to be filled is determined based on the filling data of the last filling operation and the target filling bit.
[0211] The target padding bits are padded based on the to-be-padded data.
[0212] In the embodiments of the present application, the first obtaining module 201 and the second obtaining module can be the same obtaining module, or can be different obtaining modules. The first determining module 202, the second determining module 203, the third determining module and the fourth determining module can be the same determining module, or can be different determining modules, or can be partially the same determining module. The first times determining module and the second times determining module can be the same times determining module, or can be different determining modules.
[0213] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the above-described storage device data elimination apparatus 20 can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0214] An electronic device is provided in the embodiments of the present application, such as Figure 3 as shown in the figure, Figure 3 The electronic device 30 shown in the figure includes a processor 301 and a memory 303. The processor 301 and the memory 303 are connected, such as through a bus 302. Optionally, the electronic device 30 can also include a transceiver 304. It should be noted that the transceiver 304 is not limited to one in actual application, and the structure of the electronic device 30 does not constitute a limitation on the embodiments of the present application.
[0215] The processor 301 can be a CPU (Central Processing Unit, central processor), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, application specific integrated circuit), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules and circuits described in combination with the disclosure content of the present application. The processor 301 can also be a combination of computing functions, such as a combination of one or more microprocessors, a combination of DSP and microprocessor, etc.
[0216] The bus 302 can include a channel for transmitting information between the above-mentioned components. The bus 302 can be a PCI (Peripheral Component Interconnect, peripheral component interconnect) bus or an EISA (Extended Industry Standard Architecture, extended industry standard architecture) bus, etc. The bus 302 can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation,Figure 3 Only one bus is shown among the buses, but this does not mean that there is only one bus or only one type of bus.
[0217] The memory 303 can be a ROM (Read Only Memory) or other type of static storage device that can store static information and instructions, a RAM (Random Access Memory) or other type of dynamic storage device that can store information and instructions, an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
[0218] The memory 303 is used to store application program codes for implementing the solutions of the present application, and is controlled by the processor 301 to execute. The processor 301 is used to execute the application program codes stored in the memory 303 to realize the content shown in the foregoing method embodiments.
[0219] The electronic device includes, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (Personal Digital Assistant), a PAD (Tablet Personal Computer), a PMP (Portable Multimedia Player), a car terminal (for example, a car navigation terminal), and the like, and a fixed terminal such as a digital TV, a desktop computer, and the like. It can also be a server or the like. Figure 3 The electronic device shown is only an example, and should not bring any limitation to the functions and use range of the embodiments of the present application.
[0220] The embodiment of the present application provides a computer readable storage medium, which stores a computer program, and when the computer program is run on a computer, the computer can execute the corresponding content in the foregoing method embodiment. Compared with the related art, the logical partition of the storage device and the capacity corresponding to the logical partition are acquired in the embodiment of the present application, so that when the detected partition selection instruction is detected, the target logical partition needing to be eliminated and erased can be determined. Since the capacity of the target logical partition is the capacity of how much data can be stored, and the actual storage data position of the logical partition is the position on the physical sector, the filling bit needing to be filled with data and / or the interval bit not needing to be filled with data are determined according to the capacity of the target logical partition. Then, the target physical sector of the target logical partition is filled according to the determined filling bit and / or interval bit, so that the originally stored data is destroyed. Since the interval jump filling reduces the data amount compared with filling each bit on the target physical sector, and the filling efficiency is improved.
[0221] It should be understood that, although each step in the flowchart of the accompanying drawings is displayed in sequence according to the indication of the arrow, these steps are not necessarily executed in sequence according to the indication of the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other sequences. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately executed with other steps or at least part of the sub-steps or stages of other steps.
[0222] The above only describes some embodiments of the present application, and it should be pointed out that, for ordinary skilled in the art, without departing from the principles of the present application, a number of improvements and refinements can be made, and these improvements and refinements should be considered as the protection scope of the present application.
Claims
1. A storage device data erasure method characterized by comprising: The method comprises the following steps: acquiring logical partitions of a storage device and capacities corresponding to the logical partitions, the logical partitions corresponding to physical sectors; determining a target logical partition according to a detected partition selection instruction; determining padding bits for filling data and / or interval bits for not filling data according to the capacity of the target logical partition; filling target physical sectors corresponding to the target logical partition based on the padding bits and / or interval bits; The step of determining the padding bits for filling data and / or the interval bits for not filling data according to the capacity of the target logical partition comprises the following steps: determining a preset capacity interval in which the capacity of the target logical partition is located, and determining the number of padding bits of the target logical partition, the preset capacity interval and the number of padding bits having a corresponding relationship; determining the padding bits based on the number of padding bits and the capacity of the target logical partition, each of the padding bits corresponding to a storage bit; determining storage bits other than the padding bits in the target logical partition as interval bits; The step of filling the target physical sectors corresponding to the target logical partition based on the padding bits comprises the following steps: determining padding data corresponding to the padding bits from the set padding data; filling the padding data into the padding bits to complete the filling of the target physical sectors.
2. The method of claim 1, wherein, After the step of determining the target logical partition, the method further comprises the following steps: acquiring category information of the storage device and creation time of a file in the storage device; determining the earliest creation time from the creation time of the file; determining the filling times based on the earliest creation time, the category information and respective coefficients, the coefficients being used to represent the importance of the earliest creation time and the category information.
3. The method of claim 1, wherein, After the step of determining the target logical partition, the method further comprises the following steps: acquiring category information of the storage device; finding whether there is target category information consistent with the category information of the storage device from the set category information, each of the set category information corresponding to filling times; if there is, determining the filling times corresponding to the target category information as the filling times of the storage device.
4. The method of claim 1, wherein, If the storage device is a storage device integrated on an electronic device, the step of acquiring the logical partitions of the storage device and the capacities corresponding to the logical partitions further comprises the following steps: determining an operating system running on the electronic device; if the operating system is a linux system, determining the physical sectors corresponding to a root directory on the storage device, the root directory being used to record all files and directories in the linux system; masking the physical sectors corresponding to the root directory on the storage device.
5. The method of claim 1, wherein, After the step of filling the target physical sectors corresponding to the target logical partition based on the padding bits and / or interval bits, the method further comprises the following steps: acquiring data of the padding bits; judging whether the acquired data is consistent with padding data of a last filling operation; if yes, determining that the filling is successful; if no, determining that the filling fails.
6. A storage device data erasure apparatus, characterized by comprising: The method comprises the following steps: a first acquiring module, configured to acquire logical partitions of a storage device and capacities corresponding to the logical partitions, the logical partitions corresponding to physical sectors; a first determining module, configured to determine a target logical partition according to a detected partition selection instruction; The second determining module is configured to determine the padding bits for padding data and / or the interval bits for non-padding data according to the capacity of the target logical partition; The padding module is configured to pad the target physical sector corresponding to the target logical partition based on the padding bits and / or the interval bits. In a specific implementation, when determining the padding bits and the interval bits according to the capacity of the target logical partition, the second determining module is specifically configured to determine a preset capacity interval in which the capacity of the target logical partition is located, and determine a number of padding bits of the target logical partition, the preset capacity interval and the number of padding bits having a corresponding relationship; determine the padding bits based on the number of padding bits and the capacity of the target logical partition, each of the padding bits corresponding to one storage bit; and determine the storage bits other than the padding bits in the target logical partition as the interval bits. In a specific implementation, when padding the target physical sector corresponding to the target logical partition based on the padding bits, the padding module is specifically configured to determine padding data corresponding to the padding bits from the set padding data; and fill the padding data into the padding bits to complete the padding of the target physical sector.
7. An electronic device, comprising: It comprises: at least one processor; a memory; at least one application program, wherein the at least one application program is stored in the memory and is configured to be executed by the at least one processor, and the at least one application program is configured to perform the storage device data elimination method according to any one of claims 1-5.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, When the computer program is executed in the computer, the computer is enabled to perform the storage device data elimination method according to any one of claims 1-5.
Citation Information
Patent Citations
Multi-antenna channel measurement data collection method based on virtual consecutive storage mode and multi-antenna channel measurement data collection device based on virtual consecutive storage mode
CN104239118A
Method, system and equipment for testing disk stability and medium
CN111427733A