CN110908601B - Processing method and device and electronic equipment - Google Patents

Processing method and device and electronic equipment Download PDF

Info

Publication number
CN110908601B
CN110908601B CN201911053600.3A CN201911053600A CN110908601B CN 110908601 B CN110908601 B CN 110908601B CN 201911053600 A CN201911053600 A CN 201911053600A CN 110908601 B CN110908601 B CN 110908601B
Authority
CN
China
Prior art keywords
data
data erasing
task
storage medium
information
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
CN201911053600.3A
Other languages
Chinese (zh)
Other versions
CN110908601A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201911053600.3A priority Critical patent/CN110908601B/en
Publication of CN110908601A publication Critical patent/CN110908601A/en
Application granted granted Critical
Publication of CN110908601B publication Critical patent/CN110908601B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/0644Management of space entities, e.g. partitions, extents, pools
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0674Disk device
    • G06F3/0676Magnetic disk device

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Storage Device Security (AREA)

Abstract

The invention discloses a processing method, which comprises the following steps: detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium; detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium; the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition. The invention also discloses a processing device.

Description

Processing method and device and electronic equipment
Technical Field
The present invention relates to data processing technologies, and in particular, to a method and an apparatus for processing data in a storage medium, and an electronic device.
Background
At present, in the process of erasing data from a storage medium, if an electronic device in which the storage medium is located is powered off, the storage medium is usually erased from the beginning after the electronic device is powered on and started up, and thus, the data that has been erased before the power off needs to be erased again, which results in longer data erasing time and lower data erasing efficiency.
Disclosure of Invention
The technical scheme of the embodiment of the invention is realized as follows:
according to an aspect of the embodiments of the present invention, there is provided a processing method, including:
detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium;
detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition.
In the foregoing solution, the executing the second data erasing task for the target storage medium includes:
obtaining first data erasing information, and starting to execute the second data erasing task at least based on the first data erasing information;
and writing second data erasing information into the target storage medium so as to be capable of starting from the end position of the second data erasing task when the data erasing task meeting the condition is executed aiming at the target storage medium.
In the above solution, the first data erasure information and the second data erasure information are both written in the first area of the target storage medium, and the method further includes:
detecting that data in a second area in the target storage medium is completely erased, and erasing data erasing information in the first area, wherein the data erasing information at least comprises the first data erasing information and/or the second data erasing information;
the first area is an area in which data in the target storage medium has been erased when the data writing condition is satisfied, and the second area is a remaining area in the target storage medium except the first area.
In the foregoing solution, the satisfying the second data erasing condition includes:
detecting that the electronic equipment executing the first data erasing task is switched from a power-off state to a power-on state, and determining that the second data erasing condition is met;
or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that the second data erasing condition is met;
or, detecting that a data erasure instruction is obtained within a first time threshold, and determining that the second data erasure condition is satisfied.
In the foregoing solution, the satisfying the first data erasing condition includes:
detecting at least one operation for obtaining a data erasing instruction, and determining that the first data erasing condition is met; and/or the presence of a gas in the atmosphere,
the satisfying of the data writing condition includes:
and detecting that the first data erasing task executes the first time and/or the first data amount, and determining that the data writing condition is met.
In the foregoing solution, the writing the first data erasure information into the target storage medium includes:
acquiring first data erasing mode information and first data erasing progress information in the first data erasing information;
writing the first data erasing mode information into a first sub-area of the first area and writing the first data erasing progress information into a second sub-area of the first area at least based on a preset writing rule; wherein the second sub-region is a remaining region of the first region except the first sub-region.
In the foregoing scheme, the writing the first data erasure progress information into the second sub-area of the first area includes:
obtaining first data erasing progress information at a first moment, and writing the first data erasing progress information at the first moment into a first position of the second sub-area;
obtaining first data erasing progress information of a second moment, and writing the first data erasing progress information of the second moment into the first position to cover the first data erasing information of the first moment, or writing the first data erasing progress information of the second moment into a second position of the second sub-area;
wherein the first location is different from the second location, and the second time is later than the first time.
In the above scheme, the method further comprises:
obtaining a target erase pattern for the target storage medium based at least on hardware information of an electronic device;
performing the first data erasure task and the second data erasure task on the target storage medium based at least on the target erasure pattern.
According to another aspect of the embodiments of the present invention, there is provided a processing apparatus including:
the execution unit is used for detecting that a first data erasing condition is met and executing a first data erasing task aiming at the target storage medium;
a writing unit, configured to write first data erasure information into the target storage medium to be able to start from an end position of a first data erasure task when a second data erasure task is executed for the target storage medium, when it is detected that a data writing condition is satisfied;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including: the computer system comprises a memory, a processor and a response program stored in the memory and operated by the processor, wherein the processor responds to any step of the processing method when operating the response program.
According to the processing method, the processing device and the electronic equipment provided by the embodiment of the invention, a first data erasing task is executed aiming at a target storage medium by detecting that a first data erasing condition is met; detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium; the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition. Therefore, when an abnormality occurs in the process of executing the data erasing task on the target storage medium and the data erasing task is executed again, the disk data can be continuously erased from the end position of the last data erasing task without erasing the data from the initial position of the storage medium, the data erasing time is greatly saved, and the data erasing efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart illustrating an implementation of a processing method according to an embodiment of the present invention;
FIG. 2 is a schematic structural diagram of a processing apparatus according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present invention, are given by way of illustration and explanation only, not limitation.
Fig. 1 is a schematic flow chart of an implementation of a processing method in an embodiment of the present invention, as shown in fig. 1, the method includes:
step 101, detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium;
in the present application, the method is mainly applied to an electronic device with a data erasing function, and the electronic device may be a desktop computer, a notebook computer, a server, and the like. The electronic device may include a storage medium, and may also be a carrier for storing data, such as a magnetic disk, a floppy disk, a usb disk, a hard disk, a removable hard disk, a data card, and the like, and the electronic device may be capable of reading, writing, or erasing data from or on the accessed storage medium.
When the electronic equipment detects at least one operation for obtaining a data erasing instruction and determines that a first data erasing condition is met, a first data erasing task is executed aiming at a target storage medium so as to erase data stored on the target storage medium.
Here, the first data erasing task may specifically characterize a task of performing data erasing from an initial position of the target storage medium. For example, the initial position may be a starting position of the target storage medium where data is written for the first time.
In the application, when the electronic device executes a first data erasing task for a target storage medium, a target erasing mode for the target storage medium can be obtained at least based on hardware information of the electronic device; a first data erasure task is performed on the target storage medium based at least on the target erasure pattern.
For example, the target erase pattern is pattern three characterizing performing three data erases, where the first data erase is represented by the symbol "0000", the second data erase may be represented by the symbol "random number", and the third data erase may be represented by the symbol "1111". By erasing the data in the third mode, the data can be completely deleted to prevent the data from being recovered.
Here, the random number is generated by acquiring a system time, using the system time as a seed, and using a function for generating the random number.
In the application, when a user performs a boot operation on the electronic device, the electronic device may obtain a data erasing instruction based on the boot operation; or, when the user performs an application opening operation with respect to the storage medium on the electronic device, the electronic device may obtain the data erasing instruction based on the application opening operation.
Here, the application opening operation may specifically be an application that performs a data erasing task with respect to the storage medium, such as a data erasing tool.
And 102, detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to start from the end position of the first data erasing task when a second data erasing task is executed aiming at the target storage medium.
Here, the second data erasure task is a task executed for a target storage medium when a second data erasure condition, which is the same as or different from the first data erasure condition, is satisfied, and the execution timings of the second data erasure task and the first data erasure task satisfy a first time threshold.
For example, when the electronic device detects that the electronic device executing the first data erasing task is switched from a power-off state to a power-on state, determining that a second data erasing condition is met; or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that a second data erasing condition is met; or, detecting that the data erasing instruction is obtained within the first time threshold, and determining that the second data erasing condition is met.
Here, the first time threshold may characterize a time interval between an end time of the first data erasing task to a start time of the second data erasing task. The first time threshold may be a custom time interval or a random time interval; generally, the self-defined time interval represents that the execution time of the first data erasing task and the second data erasing task is controllable, for example, the corresponding data erasing task is executed based on instruction input; the random time interval characterizes that the execution time of the first erasing task and the second data erasing task is not controllable, such as state switching based on power failure to power supply and the like.
For example, the first time threshold is 1 hour, and if the electronic device detects that the time interval between the end time of the first data erasing task and the start time of the second data erasing task reaches 1 hour, the second data erasing task is triggered, and it is determined that the data erasing instruction is obtained within the first time threshold, and the second data erasing condition is met.
Or if the electronic device detects that the time interval between the end time of the first data erasing task and the start time of the second data erasing task does not reach 1 hour, but receives a data erasing instruction actively triggered by a user, triggering the second data erasing task based on the data erasing instruction actively triggered by the user, and at the moment, determining that the data erasing instruction is obtained within the first time threshold value, and meeting the second data erasing condition.
Specifically, when the first data erasing task is finished executing, the electronic device may detect a data erasing instruction within a first time threshold, and if a data erasing instruction triggered by a user is detected within the first time threshold, it is characterized that data is not required to be rewritten for deleted data, at this time, the second data erasing task may be triggered based on the data erasing instruction triggered by the user, and it is determined that a second data erasing condition is currently satisfied. If a data erasure command is not detected when the first time threshold is reached, then a second data erasure task may be triggered based on the first time threshold to determine that a second data erasure condition is currently satisfied.
In this application, the electronic device may further determine whether the data writing condition is satisfied by detecting an execution time and/or a data erasing amount of the first data erasing task.
When the electronic device determines whether the data writing condition is met by detecting the execution time of the first data erasing task, the execution time of the first data erasing task may be recorded when the first data erasing task is executed, and the comparison result is obtained by comparing the execution time with a first time preset at the same data erasing speed in combination with the data erasing speed. And when the comparison result represents that the execution time reaches the preset first time, determining that the data writing condition is met, and at the moment, writing the first data erasing information into the target storage medium.
Here, the preset first time may also be set according to the user's requirement.
When the electronic device determines whether the data writing condition is satisfied by detecting the data erasing amount of the first data erasing task, specifically, the data erasing amount of the first data erasing task may be detected when the first data erasing task is executed, and the data erasing amount is compared with a preset first data amount to obtain a comparison result. And when the comparison result represents that the data erasure amount reaches a preset first data amount, determining that the data writing condition is met, and writing the first data erasure information into the target storage medium.
Here, the preset first data amount may be set according to a user requirement. For example, the data storage amount of the first region of the target storage medium may be set to a preset first data amount. That is, when it is detected that the data in the first area of the target storage medium is completely erased, it is determined that the data erasing amount reaches a preset first data amount, and the data writing condition is satisfied.
In this application, the first data erasure information may specifically include first data erasure mode information and first data erasure progress information. The first data erasing mode information may be a data erasing mode selected by a user, or may be a default data erasing mode of the system.
For example, the first data erasure pattern information includes: in the mode I, the representation is erased once, and original data can be covered by writing a symbol '0000' so as to achieve the purpose of erasing the data; the second mode represents that the data is erased twice, the original data can be covered by writing the symbol '0000' for the first time, and the original data can be covered again by writing the symbol 'FFFF' for the second time, so that the purpose of data erasing is realized; the third mode represents erasing three times, the original data can be covered by writing the symbol "0000" for the first time, the original data can be covered again by writing the symbol "FFFF" for the second time, and the original data can be covered again by writing the symbol "1111" for the third time, so that the purpose of data erasing is realized; or, the original data can be covered by writing the symbol "0000" for the first time, the original data can be covered by writing the symbol "random number" for the second time, and the original data can be covered by writing the symbol "1111" for the third time, so that the original data can be completely deleted to prevent the data from being restored.
In this application, the first data erasing progress information may specifically be a corresponding data erasing progress when a data erasing task is performed on the storage medium after reaching a preset first time, such as a position or an area of data erasing in a target storage medium, such as a corresponding nth sector, an N +1 th sector, and the like.
For example, if the preset first time is 5 minutes, when the execution time of the first data erasing task reaches 5 minutes, the data erasing progress information corresponding to the execution of the data erasing task after 5 minutes is written in the target storage medium.
In this application, the first data erasing progress information may also be a data erasing progress corresponding to a remaining area in the target storage medium except for the first area.
For example, the target storage medium includes a first area and a second area, and when the data in the first area is completely erased, the data erasure progress information corresponding to the second area is written in the target storage medium.
In this application, when the electronic device writes the first data erasure information into the storage medium, the electronic device may specifically write the first data erasure information into the first area of the target storage medium.
Preferably, when the electronic device writes the first data erasure information into the first area of the storage medium, the electronic device may further obtain first data erasure mode information and first data erasure progress information in the first data erasure information; then, based on a preset writing rule, writing a first data erasing mode into a first sub-area of the first area, and writing first data erasing progress information into a second sub-area of the first area. The second sub-area is the remaining area of the first area except the first sub-area.
For example, the preset writing rule may be: first data erasing mode information is written into the first 4 bytes, and first data erasing progress information is written into the second 4 bytes; or, the first N bytes are written into the first data progress information, and the last N bytes are written into the first data erasing mode information, wherein N is larger than 4.
In the application, when the electronic device writes the first data erasing progress information into the second sub-area of the first area, the electronic device can specifically obtain the first data erasing progress information at the first moment, and then writes the first data erasing progress information at the first moment into the first position of the second sub-area; then, obtaining first data erasing progress information at a second moment, and writing the first data erasing progress information at the second moment into the first position to cover the first data erasing information at the first moment; here, the first position is different from the second position, and the second time is later than the first time. In this way, the writing of the first data erasure information is realized by means of data overwriting. Or, the electronic device may further write the first data erasure progress information at a second time into a second location of the second sub-area, where the first location is different from the second location, and the second time is later than the first time. In this way, the writing of the first data erasure information is realized in a data accumulation mode.
In the application, when the electronic device executes the second data erasing task for the target storage medium, the electronic device may specifically execute the second data erasing task from a position represented by the first data erasing information at least based on the first data erasing information by obtaining the first data erasing information written in the target storage medium; and writing the second data erasing information into the target storage medium according to the preset time so as to be started from the end position of the second data erasing task when the data erasing task meeting the conditions is executed aiming at the target storage medium.
Here, the data erasing task satisfying the condition may be specifically referred to as an nth data erasing task, which means a data erasing task after the second data erasing task, where N is greater than or equal to 3.
Specifically, when executing the Nth data erasing task, the electronic device can acquire the (N-1) th data erasing information written in the target storage medium, and the electronic device starts to execute the Nth data erasing task from the position represented by the (N-1) th data erasing information at least based on the (N-1) th data erasing information; writing the Nth data erasing information into a first area of the target storage medium so as to start from the end position of the Nth data erasing task when the (N + 1) th data erasing task is executed aiming at the target storage medium;
the (N + 1) th data erasing task is a task executed aiming at the target storage medium when meeting an (N + 1) th data erasing condition, the (N + 1) th data erasing condition is the same as or different from the (N) th data erasing condition, the execution time of the (N + 1) th data erasing task and the (N) th data erasing task meets an (N) th time threshold, and N is more than or equal to 3.
In the application, the second data erasure information, the nth data erasure information, the (N-1) th data erasure information, and the (N + 1) th data erasure information are all written into the first area of the target storage medium, and the writing mode may be a data accumulation mode, or a data overlay mode in which new data overlays the history data.
In the application, the electronic device may erase the data erasure information in the first area when detecting that the data in the second area in the target storage medium is erased. Here, the data erasure information at least comprises first data erasure information and/or second data erasure information and/or nth data erasure information and/or N-1 data erasure information and/or N +1 data erasure information;
the first area is an area in which data in the target storage medium is erased when the data writing condition is met, and the second area is the remaining area of the target storage medium except the first area.
In the application, the data erasing task of the electronic device for the second area is the same as or different from the data erasing task for the data erasing information in the first area.
Specifically, if the electronic device does not detect a power-off event of the electronic device when the data of the second area is completely erased, and does not detect an abnormal event for the current application for executing the data erasing task, the characterization may continue to execute the last data erasing task for the second area to erase the data erasing information of the first area. And if the electronic equipment detects a power-off event of the electronic equipment when the data of the second area is completely erased, or detects an abnormal event aiming at the current application for executing the data erasing task, when the electronic equipment is switched from the power-off state to the power-on state, or the current application is switched from the abnormal state to the normal state, re-executing a new data erasing task aiming at the data erasing information of the first area.
Of course, when the data in the second area is completely erased, the data erasing task may be directly performed on the data erasing information in the first area.
According to the data processing method provided by the application, when the electronic equipment starts to execute the first data erasing task on the storage medium, the data in the first area of the storage medium is firstly erased, and after the data in the first area is erased, the first data erasing task is continuously executed so as to erase the data in the second area of the storage medium. In erasing the data of the second area, the data erasure progress information may be written in the form of bytes into the first area every preset time, for example, 10 seconds. When the first data erasing task encounters a condition of sudden power failure in the erasing process of the second area, and when the second data erasing task is executed on the storage medium after the power supply is recovered, the data erasing progress information can be obtained from the first area, and then the data erasing progress information is continuously erased from the position erased in the last power failure, so that the function of continuously executing the last erasing progress after the erasing interruption occurs in the data erasing process is realized. And data erasure does not need to be carried out again from the position where the data is written into the storage medium for the first time, so that the data erasure time can be greatly saved, and the data erasure efficiency is improved. Further, after the data in the second area of the storage medium is erased, the data erasing progress information written in the first area can be erased again, so that the data in the storage medium can be completely erased.
The following describes a process for performing data erasure by an electronic device:
when the electronic equipment is started and powered on, starting an application for executing a data erasing task, wherein the application can generate a command prompt; the parameter represented by the command prompt can be used for reading data erasing progress information from a first area of a storage medium (in other embodiments, the parameter can also be a U disk or a mobile hard disk or the like inserted into the electronic device) of the electronic device, and when the data erasing progress information is read, the data erasing progress information is obtained, and a data erasing task is executed from a corresponding position according to the data erasing progress information; and when the data erasing progress information is not read, ending the application currently used for executing the data erasing task. Then, a system interface is displayed, and a start button for restarting the application for executing the data erasing task is displayed in the system interface. The user can restart the application by clicking the start button in the system interface, and when the application is successfully started, a data erasing mode for the user to select is displayed. The first data erasing task may be performed with respect to the storage medium according to a target data erasing mode selected by a user, at which time it is indicated that the data erasing task needs to be performed from a start position of the first data writing of the storage medium.
Fig. 2 is a schematic structural composition diagram of a processing apparatus according to an embodiment of the present invention, as shown in fig. 2, the apparatus includes:
a detection unit 201 for detecting whether a first data erasure condition is satisfied; and further for detecting whether a data write condition is satisfied;
an execution unit 202, configured to execute a first data erasure task for a target storage medium when the detection unit 201 detects that a first data erasure condition is satisfied;
a writing unit 203, configured to write first data erasure information into the target storage medium when the detection unit 201 detects that a data writing condition is satisfied, so as to be able to start from an end position of the first data erasure task when a second data erasure task is executed for the target storage medium;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition.
In a preferred embodiment, the apparatus further comprises: an acquisition unit 204;
the obtaining unit 204 is configured to obtain first data erasure information, and when the first data erasure information is obtained, trigger the executing unit 202 to start executing the second data erasure task based on at least the first data erasure information. The executing unit 202, during the process of executing the second data erasing task, may further trigger the writing unit 203 to write the second data erasing information into the target storage medium, so as to start from an end position of the second data erasing task when executing the data erasing task satisfying the condition for the target storage medium.
In a preferred embodiment, the apparatus further comprises: an erasing unit 205;
specifically, the detecting unit 201 is further configured to detect whether data in the second area of the target storage medium is completely erased; and when detecting that the data in the second area in the target storage medium is completely erased, triggering the erasing unit 205 to erase the data erasing information in the first area, wherein the data erasing information at least comprises the first data erasing information and/or the second data erasing information.
The first area is an area in which data in the target storage medium has been erased when the data writing condition is satisfied, and the second area is a remaining area in the target storage medium except the first area.
In a preferred embodiment, the detecting unit 201 specifically determines that the second data erasing condition is satisfied when it is detected that the electronic device executing the first data erasing task is switched from a power-off state to a power-on state; or when the current application for executing the first data erasing task is detected to be switched from an abnormal state to a normal state, determining that the second data erasing condition is met; or, when it is detected that a data erasure instruction is obtained within a first time threshold, determining that the second data erasure condition is satisfied.
In a preferred embodiment, the detecting unit 201 is specifically configured to determine that the first data erasure condition is satisfied when at least one operation for obtaining a data erasure instruction is detected; and determining that the data writing condition is satisfied when it is detected that the first data erasing task is executed for a first time and/or a first data amount.
In a preferred embodiment, the obtaining unit 204 is further configured to obtain first data erasure mode information and first data erasure progress information in the first data erasure information; triggering the writing unit 203 to write the first data erasing mode information into a first sub-area of the first area and write the first data erasing progress information into a second sub-area of the first area at least based on a preset writing rule; wherein the second sub-region is a remaining region of the first region except the first sub-region.
In a preferred embodiment, the obtaining unit 204 is further configured to obtain first data erasing progress information at a first time, and obtain first data erasing progress information at a second time. Triggering a writing unit 203 to write the first data erasing progress information of the first moment into the first position of the second sub-area; writing the first data erasing progress information of the second moment into the first position to cover the first data erasing information of the first moment; or writing the first data erasing progress information of the second moment into a second position of the second sub-area; wherein the first location is different from the second location, and the second time is later than the first time.
In a preferred embodiment, the obtaining unit 204 obtains a target erasing mode for the target storage medium at least based on hardware information of the electronic device; the execution unit 202 executes the first data erasing task and the second data erasing task on the target storage medium based on at least the target erasing mode.
It should be noted that: in the processing apparatus provided in the above embodiment, when erasing data, only the division of the program modules is taken as an example, and in practical applications, the processing may be distributed to different program modules according to needs, that is, the internal structure of the processing apparatus may be divided into different program modules to complete all or part of the processing described above. In addition, the processing apparatus provided in the foregoing embodiment and the processing method embodiment belong to the same concept, and specific implementation processes thereof are described in the method embodiment and are not described herein again.
Fig. 3 is a schematic structural component diagram of an electronic device in an embodiment of the present invention, and as shown in fig. 3, the electronic device 300 may be a mobile phone, a computer, a digital broadcast terminal, an information transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, and the like. The electronic device 300 shown in fig. 3 includes: at least one processor 301, memory 302, at least one network interface 304, and a user interface 303. The various components in electronic device 300 are coupled together by a bus system 305. It will be appreciated that the bus system 305 is used to enable communications among the components connected. The bus system 305 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 305 in fig. 3.
The user interface 303 may include, among other things, a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touch pad, or a touch screen.
It will be appreciated that the memory 302 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The memory 302 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 302 in embodiments of the present invention is used to store various types of data to support the operation of the electronic device 300. Examples of such data include: any computer program for operating on the electronic device 300, such as an operating system 3021 and a responsive program 3022 executed by the processor 301; contact data; telephone book data; a message; a picture; video, etc. Operating system 3021 includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and for processing hardware-based tasks. The respondable program 3022 may contain various application programs such as a Media Player (Media Player), a Browser (Browser), etc. for implementing various application services. A program implementing the method of an embodiment of the present invention may be included in the response program 3022.
The method disclosed in the above embodiments of the present invention may be applied to the processor 301, or implemented by the processor 301. The processor 301 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 301. The Processor 301 may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 301 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 302, and the processor 301 reads the information in the memory 302 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the electronic Device 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the aforementioned methods.
Specifically, when the processor 301 runs the computer program, it executes: detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium; detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium; the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition.
When the processor 301 runs the computer program, it further executes: obtaining first data erasing information, and starting to execute the second data erasing task at least based on the first data erasing information; and writing second data erasing information into the target storage medium so as to be capable of starting from the end position of the second data erasing task when the data erasing task meeting the condition is executed aiming at the target storage medium.
When the processor 301 runs the computer program, it further executes: detecting that data in a second area in the target storage medium is completely erased, and erasing data erasing information in the first area, wherein the data erasing information at least comprises the first data erasing information and/or the second data erasing information;
the first area is an area in which data in the target storage medium has been erased when the data writing condition is satisfied, and the second area is a remaining area in the target storage medium except the first area.
When the processor 301 runs the computer program, it further executes: detecting that the electronic equipment executing the first data erasing task is switched from a power-off state to a power-on state, and determining that the second data erasing condition is met; or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that the second data erasing condition is met; or, detecting that a data erasure instruction is obtained within a first time threshold, and determining that the second data erasure condition is satisfied.
When the processor 301 runs the computer program, it further executes: detecting at least one operation for obtaining a data erasing instruction, and determining that the first data erasing condition is met; and detecting that the first data erasing task executes a first time and/or a first data amount, and determining that the data writing condition is met.
When the processor 301 runs the computer program, it further executes: acquiring first data erasing mode information and first data erasing progress information in the first data erasing information; writing the first data erasing mode information into a first sub-area of the first area and writing the first data erasing progress information into a second sub-area of the first area at least based on a preset writing rule; wherein the second sub-region is a remaining region of the first region except the first sub-region.
When the processor 301 runs the computer program, it further executes: obtaining first data erasing progress information at a first moment, and writing the first data erasing progress information at the first moment into a first position of the second sub-area; obtaining first data erasing progress information of a second moment, and writing the first data erasing progress information of the second moment into the first position to cover the first data erasing information of the first moment, or writing the first data erasing progress information of the second moment into a second position of the second sub-area; wherein the first location is different from the second location, and the second time is later than the first time.
When the processor 301 runs the computer program, it further executes: obtaining a target erase pattern for the target storage medium based at least on hardware information of an electronic device; performing the first data erasure task and the second data erasure task on the target storage medium based at least on the target erasure pattern.
In an exemplary embodiment, the present application further provides a computer readable storage medium, such as a memory 302, comprising a computer program, which is executable by a processor 301 of an electronic device 300 to perform the steps of the foregoing method.
The computer readable storage medium can be Memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface Memory, optical disk, or CD-ROM; or may be a variety of devices including one or any combination of the above memories, such as a mobile phone, computer, tablet device, personal digital assistant, etc.
A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, performs: detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium;
detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition.
The computer program, when executed by the processor, further performs: obtaining first data erasing information, and starting to execute the second data erasing task at least based on the first data erasing information;
and writing second data erasing information into the target storage medium so as to be capable of starting from the end position of the second data erasing task when the data erasing task meeting the condition is executed aiming at the target storage medium.
The computer program, when executed by the processor, further performs: detecting that data in a second area in the target storage medium is completely erased, and erasing data erasing information in the first area, wherein the data erasing information at least comprises the first data erasing information and/or the second data erasing information;
the first area is an area in which data in the target storage medium has been erased when the data writing condition is satisfied, and the second area is a remaining area in the target storage medium except the first area.
The computer program, when executed by the processor, further performs: detecting that the electronic equipment executing the first data erasing task is switched from a power-off state to a power-on state, and determining that the second data erasing condition is met; or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that the second data erasing condition is met; or, detecting that a data erasure instruction is obtained within a first time threshold, and determining that the second data erasure condition is satisfied.
The computer program, when executed by the processor, further performs: detecting at least one operation for obtaining a data erasing instruction, and determining that the first data erasing condition is met; and detecting that the first data erasing task executes a first time and/or a first data amount, and determining that the data writing condition is met.
The computer program, when executed by the processor, further performs: acquiring first data erasing mode information and first data erasing progress information in the first data erasing information; writing the first data erasing mode information into a first sub-area of the first area and writing the first data erasing progress information into a second sub-area of the first area at least based on a preset writing rule; wherein the second sub-region is a remaining region of the first region except the first sub-region.
The computer program, when executed by the processor, further performs: obtaining first data erasing progress information at a first moment, and writing the first data erasing progress information at the first moment into a first position of the second sub-area;
obtaining first data erasing progress information of a second moment, and writing the first data erasing progress information of the second moment into the first position to cover the first data erasing information of the first moment, or writing the first data erasing progress information of the second moment into a second position of the second sub-area;
wherein the first location is different from the second location, and the second time is later than the first time.
The computer program, when executed by the processor, further performs: obtaining a target erase pattern for the target storage medium based at least on hardware information of an electronic device; performing the first data erasure task and the second data erasure task on the target storage medium based at least on the target erasure pattern.
The methods disclosed in the several method embodiments provided in the present application may be combined arbitrarily without conflict to obtain new method embodiments.
Features disclosed in several of the product embodiments provided in the present application may be combined in any combination to yield new product embodiments without conflict.
The features disclosed in the several method or apparatus embodiments provided in the present application may be combined arbitrarily, without conflict, to arrive at new method embodiments or apparatus embodiments.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (9)

1. A method of processing, comprising:
detecting that a first data erasing condition is met, and executing a first data erasing task aiming at a target storage medium;
detecting that a data writing condition is met, writing first data erasing information into the target storage medium so as to be capable of starting from an end position of a first data erasing task when a second data erasing task is executed aiming at the target storage medium;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition;
the satisfying of the second data erasure condition includes:
detecting that the electronic equipment executing the first data erasing task is switched from a power-off state to a power-on state, and determining that the second data erasing condition is met;
or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that the second data erasing condition is met;
or, detecting that a data erasure instruction is obtained within a first time threshold, and determining that the second data erasure condition is satisfied.
2. The method of claim 1, the performing a second data erasure task for the target storage medium, comprising:
obtaining first data erasing information, and starting to execute the second data erasing task at least based on the first data erasing information;
and writing second data erasing information into the target storage medium so as to be capable of starting from the end position of the second data erasing task when the data erasing task meeting the condition is executed aiming at the target storage medium.
3. The method of claim 2, the first data erasure information and the second data erasure information each being written to a first region of the target storage medium, the method further comprising:
detecting that data in a second area in the target storage medium is completely erased, and erasing data erasing information in the first area, wherein the data erasing information at least comprises the first data erasing information and/or the second data erasing information;
the first area is an area in which data in the target storage medium has been erased when the data writing condition is satisfied, and the second area is a remaining area in the target storage medium except the first area.
4. The method of claim 1, the satisfying a first data erasure condition, comprising:
detecting at least one operation for obtaining a data erasing instruction, and determining that the first data erasing condition is met; and/or the presence of a gas in the atmosphere,
the satisfying of the data writing condition includes:
and detecting that the execution of the first data erasing task reaches a first time and/or a first data amount, and determining that the data writing condition is met.
5. The method of claim 3, the writing first data erasure information to the target storage medium, comprising:
acquiring first data erasing mode information and first data erasing progress information in the first data erasing information;
writing the first data erasing mode information into a first sub-area of the first area and writing the first data erasing progress information into a second sub-area of the first area at least based on a preset writing rule;
wherein the second sub-region is a remaining region of the first region except the first sub-region.
6. The method of claim 5, the writing the first data erase progress information to the second sub-area of the first area comprising:
obtaining first data erasing progress information at a first moment, and writing the first data erasing progress information at the first moment into a first position of the second sub-area;
obtaining first data erasing progress information of a second moment, and writing the first data erasing progress information of the second moment into the first position to cover the first data erasing information of the first moment, or writing the first data erasing progress information of the second moment into a second position of the second sub-area;
wherein the first location is different from the second location, and the second time is later than the first time.
7. The method of claim 1, further comprising:
obtaining a target erase pattern for the target storage medium based at least on hardware information of an electronic device;
performing the first data erasure task and the second data erasure task on the target storage medium based at least on the target erasure pattern.
8. A processing apparatus, comprising:
the execution unit is used for detecting that a first data erasing condition is met and executing a first data erasing task aiming at the target storage medium;
a writing unit, configured to write first data erasure information into the target storage medium to be able to start from an end position of a first data erasure task when a second data erasure task is executed for the target storage medium, when it is detected that a data writing condition is satisfied;
the second data erasing task is a task executed aiming at the target storage medium when a second data erasing condition is met, and the second data erasing condition is the same as or different from the first data erasing condition;
the satisfying of the second data erasure condition includes: detecting that the electronic equipment executing the first data erasing task is switched from a power-off state to a power-on state, and determining that the second data erasing condition is met;
or detecting that the current application executing the first data erasing task is switched from an abnormal state to a normal state, and determining that the second data erasing condition is met;
or, detecting that a data erasure instruction is obtained within a first time threshold, and determining that the second data erasure condition is satisfied.
9. An electronic device, comprising: a memory, a processor, and a responsive program stored in the memory for execution by the processor, the processor being responsive to the steps of the processing method of any of claims 1 to 7 when executing the responsive program.
CN201911053600.3A 2019-10-31 2019-10-31 Processing method and device and electronic equipment Active CN110908601B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911053600.3A CN110908601B (en) 2019-10-31 2019-10-31 Processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911053600.3A CN110908601B (en) 2019-10-31 2019-10-31 Processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN110908601A CN110908601A (en) 2020-03-24
CN110908601B true CN110908601B (en) 2021-07-16

Family

ID=69814726

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911053600.3A Active CN110908601B (en) 2019-10-31 2019-10-31 Processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110908601B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543476A (en) * 2018-11-14 2019-03-29 捷德(中国)信息科技有限公司 Data processing method, device and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005217910A (en) * 2004-01-30 2005-08-11 Toshiba Corp Video recording and reproducing apparatus, content management method, and content reproduction method
JP6433170B2 (en) * 2014-06-24 2018-12-05 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Method to reduce the time required to delete recorded data by using read head and write head
KR20180050862A (en) * 2016-11-07 2018-05-16 에스케이하이닉스 주식회사 Memory system and operating method thereof
CN109960463B (en) * 2017-12-26 2021-11-02 中兴通讯股份有限公司 Disk management method, device and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109543476A (en) * 2018-11-14 2019-03-29 捷德(中国)信息科技有限公司 Data processing method, device and storage medium

Also Published As

Publication number Publication date
CN110908601A (en) 2020-03-24

Similar Documents

Publication Publication Date Title
US11822805B2 (en) Method and terminal for reclaiming memory after freezing program
US9612824B2 (en) Firmware variable update method
CN107609199B (en) Method, equipment and storage medium for processing and recovering page
JP2003280914A (en) Information equipment, storage medium, and method for restoring initial condition
CN110083404B (en) Data processing method and system of human-computer interface equipment and human-computer interface equipment
CN101477484A (en) Method and equipment for recovering destroyed main bootstrap program
CN110908601B (en) Processing method and device and electronic equipment
US20070005860A1 (en) Interrupt control system and method
CN108009039B (en) Terminal information recording method, device, storage medium and electronic equipment
JP5104619B2 (en) Information processing apparatus, information processing method, and program
JP6775651B1 (en) Information processing equipment, control methods, and programs
CN113849494A (en) Data updating method and device
JP2020071632A (en) Information processing device, control method, and program
CN116009969A (en) Application program control method, device, electronic equipment, chip and storage medium
CN108228299B (en) Display method and electronic equipment
CN114153642A (en) System detection method and electronic equipment
CN113778485A (en) System operation method and device of electronic chip, electronic chip and storage medium
CN110018968B (en) Data reading method, electronic equipment and computer storage medium
CN112182652B (en) Method and device for protecting data partition from being fully written, storage medium and terminal equipment
JP2003288213A (en) Boot program storage device and method of storing boot program of electronic appliance
JP2005313568A (en) Printer, erasing method of data in printer, program and recording medium
CN111130056B (en) Monitoring method and device
CN116701042B (en) Memory data retention method, retention device and related equipment
JP7005577B2 (en) Information processing equipment and information processing method
CN111737044A (en) Terminal device recovery mode guiding method and device, terminal device and storage medium

Legal Events

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