CN111240590A - Dirty data erasing method, dirty data erasing device and electronic equipment - Google Patents
Dirty data erasing method, dirty data erasing device and electronic equipment Download PDFInfo
- Publication number
- CN111240590A CN111240590A CN202010006534.0A CN202010006534A CN111240590A CN 111240590 A CN111240590 A CN 111240590A CN 202010006534 A CN202010006534 A CN 202010006534A CN 111240590 A CN111240590 A CN 111240590A
- Authority
- CN
- China
- Prior art keywords
- fstrim
- dirty data
- kernel space
- monitoring
- unit
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 43
- 238000012544 monitoring process Methods 0.000 claims abstract description 63
- 230000008569 process Effects 0.000 claims abstract description 15
- 230000004044 response Effects 0.000 claims abstract description 7
- 238000005201 scrubbing Methods 0.000 claims description 11
- 230000001960 triggered effect Effects 0.000 claims description 8
- 238000012545 processing Methods 0.000 description 12
- 238000004891 communication Methods 0.000 description 11
- 238000010586 diagram Methods 0.000 description 11
- 238000005516 engineering process Methods 0.000 description 8
- 230000003287 optical effect Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 230000001133 acceleration Effects 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 230000002411 adverse Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 239000012634 fragment Substances 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0602—Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
- G06F3/0614—Improving the reliability of storage systems
- G06F3/0616—Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0628—Interfaces specially adapted for storage systems making use of a particular technique
- G06F3/0646—Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
- G06F3/0652—Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input 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/06—Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
- G06F3/0601—Interfaces specially adapted for storage systems
- G06F3/0668—Interfaces specially adapted for storage systems adopting a particular infrastructure
- G06F3/0671—In-line storage system
- G06F3/0673—Single storage device
- G06F3/0679—Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
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 disclosure relates to a dirty data erasing method and a dirty data erasing apparatus of NAND Flash, and an electronic device and a computer-readable storage medium. The dirty data erasing method is applied to a file system of the terminal equipment and comprises the following steps: monitoring the system state; if the system meets the trigger condition, the kernel space executes Fstrim operation; monitoring whether a system is awakened or not in the Fstrim operation process of the kernel space; if the system is woken up, the kernel space exits Fstrim operation. The dirty data of the NAND Flash is erased by the linux file system when the system meets the trigger condition, and if the system is awakened in the erasing process, the erasing task can be stopped in time, so that the influence on the foreground process of the system can be avoided, the system blockage is reduced while the erasing efficiency is ensured, and the response speed of the system is improved.
Description
Technical Field
The present disclosure relates to the field of intelligent identification, and in particular, to a dirty data erasing method, a dirty data erasing apparatus, an electronic device, and a computer-readable storage medium.
Background
With the popularization of NAND Flash (NAND Flash) applications, in a Linux file system, it is necessary to implement a Discard function to fully exert the performance of NAND Flash and to improve the life of NAND Flash. In some technologies, the Discard function is implemented by two ways, namely, a Discard mount option and a FITRIM ioctl command.
However, the existing mode for realizing the Discard function is low in efficiency and cannot process in time, or the system is excessively occupied, so that the task request of the system foreground cannot be responded in time.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a dirty data erasing method, a dirty data erasing apparatus, an electronic device, and a computer-readable storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a dirty data erasing method applied to a file system of a terminal device, the method including: monitoring the system state; if the system meets the trigger condition, the kernel space executes Fstrim operation; monitoring whether a system is awakened or not in the Fstrim operation process of the kernel space; if the system is woken up, the kernel space exits Fstrim operation.
In an embodiment, the trigger condition comprises at least one of: the system is in an idle state; or the electric quantity of the terminal equipment is greater than the electric quantity threshold value; or the amount of data deleted by the system reaches a capacity threshold.
In one embodiment, the kernel space execution Fstrim operation is triggered in the following manner: and sending an Fstrim notification to the kernel space through ioctl system call, so that the kernel space executes Fstrim operation.
In one embodiment, the kernel space exit Fstrim operation is triggered as follows: and sending a SIGURSR 1 signal to the kernel space to enable the kernel space to exit Fstim operation.
In an embodiment, the method further comprises: setting a trigger period; monitoring whether a trigger time is reached based on a trigger period; and if the triggering time is reached, executing the step of monitoring the system state.
In an embodiment, the system state is monitored, and if the system does not meet the trigger condition, the step of monitoring whether the trigger time is reached is returned.
In an embodiment, the method further comprises: and when the kernel space completes Fstrim operation or the system is awakened, returning to the step of monitoring whether the trigger time is reached.
In one embodiment, an Fstrim operation is performed, comprising: traversing the block groups to obtain a target block group to be erased; issuing a discard command to a block in an idle state in a target block group; and returning to the step of traversing the block group to obtain another block group to be erased.
In one embodiment, during the Fstrim operation performed in the kernel space, monitoring whether the system is woken up includes: before issuing the discard command to the block in the free state in the target block group, the kernel space monitors a SIGURSR 1 signal, and stops Fstrim operation if the SIGURSR 1 signal is received.
According to a second aspect of the embodiments of the present disclosure, there is provided a dirty data erasing apparatus, applied to a file system of a terminal device, the apparatus including: the first monitoring unit is used for monitoring the system state; the second monitoring unit is used for monitoring whether the system is awakened or not in the Fstrim operation process executed by the kernel space; the erasing unit is used for enabling the kernel space to execute Fstrim operation when the system meets the triggering condition; and when the system is awakened, causing the kernel space to exit Fstrim operation.
In an embodiment, the trigger condition comprises at least one of: the system is in an idle state; or the electric quantity of the terminal equipment is greater than the electric quantity threshold value; or the amount of data deleted by the system reaches a capacity threshold.
In an embodiment, the apparatus further comprises: the system comprises a calling unit, an erasing unit and a judging unit, wherein the calling unit is used for sending Fstrim notification to the erasing unit through ioctl system calling when the system meets a trigger condition; the erase unit causes the kernel space to perform an Fstrim operation in response to the Fstrim notification.
In an embodiment, the apparatus further comprises: a sending unit, for sending a SIGUSR1 signal to the erasing unit when the system is awakened; the erase unit, in response to the sigscr 1 signal, causes the kernel space to exit the Fstrim operation.
In an embodiment, the apparatus further comprises: a setting unit for setting a trigger period; a third monitoring unit for monitoring whether the trigger time is reached based on the trigger period; the first monitoring unit is used for monitoring the system state when the trigger time is reached.
In an embodiment, the third monitoring unit is further configured to: and when the first monitoring unit monitors that the system does not meet the triggering condition, monitoring whether the triggering time is reached again.
In an embodiment, the third monitoring unit is further configured to: when the Fstrim operation is completed in the kernel space or when the second monitoring unit monitors that the system is awakened, whether the trigger time is reached is monitored again.
In one embodiment, the erase unit is to: traversing the block groups to obtain a target block group to be erased; issuing a discard command to a block in an idle state in a target block group; and returning to the step of traversing the block group to obtain another block group to be erased.
In one embodiment, the erase unit is further to: the SIGUSR1 signal is monitored before a discard command is issued for a tile in the free state within the target block group.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a memory to store instructions; and a processor for invoking the memory-stored instructions to perform the dirty data scrubbing method of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium storing instructions that, when executed by a processor, perform the dirty data erasure method of the first aspect.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects: when the system meets the triggering condition, the dirty data of the NAND Flash is erased by the linux file system, and if the system is awakened in the erasing process, the erasing task can be stopped in time, so that the influence on the foreground process of the system can be avoided, the system blockage is reduced while the erasing efficiency is ensured, and the response speed of the system is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
FIG. 1 is a flow diagram illustrating a method of dirty data erasure, according to an exemplary embodiment;
FIG. 2 is a flow diagram illustrating another dirty data erasure method in accordance with an illustrative embodiment;
FIG. 3 is a flow diagram illustrating another dirty data erasure method in accordance with an illustrative embodiment;
FIG. 4 is a schematic block diagram illustrating a dirty data erase device in accordance with one illustrative embodiment;
FIG. 5 is a schematic block diagram illustrating another dirty data erase device in accordance with an exemplary embodiment;
FIG. 6 is a schematic block diagram illustrating another dirty data erasure apparatus in accordance with an illustrative embodiment;
FIG. 7 is a schematic block diagram illustrating another dirty data erase device in accordance with an exemplary embodiment;
FIG. 8 is a schematic block diagram illustrating an apparatus in accordance with an exemplary embodiment.
FIG. 9 is a schematic block diagram illustrating an electronic device in accordance with an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
In some related technologies, to avoid the impact on foreground IO, an asynchronous Discard scheme generally issues a Discard command to an underlying block device when a system is idle. The scheme is influenced by a system sleep awakening strategy, when the system is in sleep, a kernel thread responsible for issuing the Discard command can also enter a freeze state, the Discard command cannot be issued in time, and the problem of low efficiency exists.
In other related technologies, a FITRIM ioctl command is adopted, an upper-layer user space process executes the FITRIM ioctl command through ioctl system call, a kernel file system is notified to execute Fstrim, and a Discard command is issued to all idle blocks of the file system to a bottom-layer Block device. In the scheme, the kernel file system executes Fstrim to generate a large number of Discard commands, and the requests cannot be interrupted, so that other foreground IO requests cannot be processed in time, and the performance of the system is affected.
In order to solve the above problem, the present embodiment of the disclosure provides a dirty data erasing method 10, which may be implemented in a terminal device that uses a Linux file system, such as a mobile phone and a tablet computer, and also includes an intelligent terminal device that uses a Linux file system intelligent sound box, and the like, and erases NAND Flash (NAND Flash) dirty data through the Linux file system, where the Linux system includes a user space and a kernel space and performs communication through system call. Referring to FIG. 1, the dirty data erasure method 10 includes steps S11-S14, which are described in detail below:
in step S11, the system status is monitored.
By monitoring the current state of the system through the user space, the erasing needs to occupy system resources, so that the embodiment of the disclosure only erases the system when the system meets the trigger condition, thereby ensuring the operation of foreground IO.
In an embodiment, the trigger condition may include one or more of: the system is in an idle state; or the electric quantity of the terminal equipment is greater than the electric quantity threshold value; or the amount of data deleted by the system reaches a capacity threshold. The electric quantity threshold value and the capacity threshold value can be preset according to the actual situation of the terminal equipment, when the triggering condition is met, the current state of the system is suitable for erasing dirty data, if the system is in an idle state, and the current user does not use the system, the erasing work can occupy more resources and does not influence the use of the user; the electric quantity is larger than a set electric quantity threshold value, so that the influence on the use of the terminal by a user due to the consumption of erasing work can be avoided; if the deleted data amount reaches the capacity threshold value, the current dirty data is excessive, the system performance is possibly affected, and the data needs to be erased as soon as possible. The trigger condition may also include other conditions that ensure proper system operation.
In step S12, if the system meets the trigger condition, the kernel space executes an Fstrim operation.
The kernel space execution of the Fstrim operation may be triggered to execute in a variety of ways, and in one embodiment, may be triggered as follows: and when the system meets the trigger condition, sending an Fstrim notification to the kernel space through ioctl system call, so that the kernel space executes Fstrim operation.
When the system is judged to be in the idle state, the user space can be called through the ioctl system, communicate with the kernel space, and send an Fstrim notification to the kernel space, so that the kernel space executes Fstrim operation.
In one embodiment, as shown in fig. 2, the step S12 of causing the kernel space to perform an Fstrim operation may include: step S121, traversing block groups (block groups) to obtain target block groups to be erased; step S122, issuing a discard command to a block (block) in an idle state in the target block group; returning to step S121, another block group to be erased is obtained. Among them, the Linux Ext4 file system divides a disk space into a plurality of groups, and manages the disk space in units of the groups, and the groups are called block groups (block groups). And issuing a discard command to the blocks in the idle state through the kernel space to complete the erasing of the dirty data in the file system.
Step S13, during the Fstrim operation performed in the kernel space, it is monitored whether the system is woken up.
In the process of executing the Fstrim operation, the system may be awakened, and because the Fstrim operation needs to occupy the resources of the system, after the system is awakened, the erasing operation needs to be stopped to ensure the IO of the foreground of the system, so that whether the system is awakened or not is monitored in the process of executing the Fstrim operation.
In step S14, if the system is woken up, the kernel space exits the Fstrim operation.
The kernel space exit Fstrim operation may also be triggered to execute in a variety of ways, and in one embodiment, may be triggered as follows: when the system is awakened, a SIGURSR 1 signal is sent to the kernel space, so that the kernel space exits Fstrim operation.
In the Fstrim operation process, when the monitoring system is awakened, the user space can send a SIGURSR 1 signal to the kernel space, so that the kernel space stops erasing, and the running performance of the system is ensured.
In an embodiment, before performing step S122, the method further includes: the kernel space monitors the SIGUSR1 signal and, if the SIGUSR1 signal is received, the Fstrim operation is stopped. In the Fstrim operation executing process, the kernel space can monitor whether a SIGURSR 1 signal is received, namely, the system is determined to be still in an idle state and not to be awakened, and then a discard command is issued to an idle block, so that erasing in the idle state is ensured, and adverse conditions of system performance reduction, jamming and the like caused by the fact that the system is awakened but cannot stop erasing when large-scale erasing is executed are avoided.
In one embodiment, as shown in FIG. 3, the dirty data scrubbing method 10 may further include: step S15, setting a trigger period; step S16, monitoring whether the triggering time is reached based on the triggering period; and if the triggering time is reached, executing the step of monitoring the system state.
In order to reduce the system operation cost and avoid the burden on the system caused by real-time monitoring, a trigger period can be set to periodically monitor the system state. When the trigger time of a trigger period is reached, the system state is monitored once, if the trigger condition is met, the erasing operation can be carried out, if the system is busy, the step of monitoring whether the trigger time is reached is returned, and whether the trigger condition is met is judged again after the next starting time is continuously monitored. Therefore, the calculation amount is reduced, the system operation burden is reduced, and the monitoring efficiency is improved.
In one embodiment, when the kernel space completes the Fstrim operation or the system is woken up, the step of monitoring whether the trigger time is reached is returned. After Fstrim operation is completed once, or under the condition that erasing operation is interrupted because the system is awakened in the Fstrim operation process, a new round of monitoring can be performed on the system again according to the trigger period, whether the next trigger time is reached is monitored, whether the system meets the trigger condition is judged again, and then the system is erased. Through the embodiment, the erasing work of the file system on the dirty data can be carried out not at one time, the influence on the IO in the previous day is avoided, the system state can be erased when the triggering condition is met through monitoring the system state, and the system state is stopped and monitored again when the system is busy, so that the system operation is ensured, the efficiency is improved, and the idle time of system fragments can be utilized.
Based on the same inventive concept, fig. 4 shows a dirty data erasing apparatus 100, which can be applied to a file system of a terminal device, especially a Linux file system, to erase dirty data of a NAND Flash (NAND Flash), and as shown in fig. 4, the dirty data erasing apparatus 100 includes: a first monitoring unit 110 for monitoring a system state; the second monitoring unit 120 is configured to monitor whether the system is awakened during the Fstrim operation executed in the kernel space; an erasing unit 130, configured to enable the kernel space to perform an Fstrim operation when the system satisfies a trigger condition; and when the system is awakened, the kernel space is exited from the Fstrim operation.
In an embodiment, the trigger condition comprises at least one of: the system is in an idle state; or the electric quantity of the terminal equipment is greater than the electric quantity threshold value; or the amount of data deleted by the system reaches a capacity threshold.
In one embodiment, as shown in fig. 5, the dirty data erasing apparatus 100 may further include: the calling unit 140 is configured to send an Fstrim notification to the erasing unit 130 through ioctl system call when the system meets the trigger condition; the erase unit 130 causes the kernel space to perform an Fstrim operation in response to the Fstrim notification.
In one embodiment, as shown in fig. 6, the dirty data erasing apparatus 100 may further include: a sending unit 150, configured to send a SIGUSR1 signal to the erasing unit 130 when the system is woken up; the erase unit 130, in response to the SIGUSR1 signal, causes the kernel space to exit the Fstrim operation.
In one embodiment, as shown in FIG. 7, the dirty data erasing apparatus 100 further includes: a setting unit 160 for setting a trigger period; a third monitoring unit 170 for monitoring whether the trigger time is reached based on the trigger period; the first monitoring unit 110 is used to monitor the system status when the trigger time is reached.
In an embodiment, the third monitoring unit 170 is further configured to: when the first monitoring unit 110 monitors that the system does not meet the trigger condition, it monitors again whether the next trigger time is reached.
In an embodiment, the third monitoring unit 170 is further configured to: when the kernel space completes the Fstrim operation, or when the second monitoring unit 120 monitors that the system is woken up, whether the trigger time is reached is monitored again.
In one embodiment, the erase unit 130 is configured to: traversing the block groups to obtain a target block group to be erased; issuing a discard command to a block in an idle state in a target block group; and returning to the step of traversing the block group to obtain another block group to be erased.
In one embodiment, the erase unit 130 is further configured to: the SIGUSR1 signal is monitored before a discard command is issued for a tile in the free state within the target block group.
With regard to the dirty data erasing apparatus 100 in the above-described embodiment, the specific manner in which each unit performs the operation has been described in detail in the embodiment related to the method, and will not be described in detail here.
Fig. 8 is a schematic block diagram illustrating an apparatus of any of the previous embodiments in accordance with an exemplary embodiment. For example, the apparatus 300 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 8, the apparatus 300 may include one or more of the following components: a processing component 302, a memory 304, a power component 306, a multimedia component 308, an audio component 310, an input/output (I/O) interface 312, a sensor component 314, and a communication component 316.
The processing component 302 generally controls overall operation of the device 300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 302 may include one or more processors 320 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 302 can include one or more modules that facilitate interaction between the processing component 302 and other components. For example, the processing component 302 may include a multimedia module to facilitate interaction between the multimedia component 308 and the processing component 302.
The memory 304 is configured to store various types of data to support operations at the apparatus 300. Examples of such data include instructions for any application or method operating on device 300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 304 may be implemented by any type or combination of volatile or non-volatile memory devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The multimedia component 308 includes a screen that provides an output interface between the device 300 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 308 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 300 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 310 is configured to output and/or input audio signals. For example, audio component 310 includes a Microphone (MIC) configured to receive external audio signals when apparatus 300 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 304 or transmitted via the communication component 316. In some embodiments, audio component 310 also includes a speaker for outputting audio signals.
The I/O interface 312 provides an interface between the processing component 302 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 314 includes one or more sensors for providing various aspects of status assessment for the device 300. For example, sensor assembly 314 may detect an open/closed state of device 300, the relative positioning of components, such as a display and keypad of device 300, the change in position of device 300 or a component of device 300, the presence or absence of user contact with device 300, the orientation or acceleration/deceleration of device 300, and the change in temperature of device 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 314 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 316 is configured to facilitate wired or wireless communication between the apparatus 300 and other devices. The device 300 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 316 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 316 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 300 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 304 comprising instructions, executable by the processor 320 of the apparatus 300 to perform the above-described method is also provided. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Fig. 9 is a block diagram illustrating an electronic device 400 according to an example embodiment. For example, the apparatus 400 may be provided as a server. Referring to fig. 9, apparatus 400 includes a processing component 422, which further includes one or more processors, and memory resources, represented by memory 432, for storing instructions, such as applications, that are executable by processing component 422. The application programs stored in memory 432 may include one or more modules that each correspond to a set of instructions. Further, the processing component 422 is configured to execute instructions to perform the above-described methods.
The apparatus 400 may also include a power component 426 configured to perform power management of the apparatus 300, a wired or wireless network interface 450 configured to connect the apparatus 400 to a network, and an input output (I/O) interface 458. The apparatus 400 may operate based on an operating system stored in the memory 432, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.
Claims (20)
1. A dirty data erasing method is applied to a file system of a terminal device, and the method comprises the following steps:
monitoring the system state;
if the system meets the trigger condition, the kernel space executes Fstrim operation;
monitoring whether the system is awakened or not during the Fstrim operation executed by the kernel space;
if the system is awakened, the kernel space exits the Fstrim operation.
2. A dirty data scrubbing method as claimed in claim 1, wherein the trigger condition includes at least one of:
the system is in an idle state; or
The electric quantity of the terminal equipment is greater than an electric quantity threshold value; or
The amount of data deleted by the system reaches a capacity threshold.
3. A dirty data scrubbing method as claimed in claim 1, wherein the kernel space performing Fstrim operations is triggered by: and sending an Fstrim notification to a kernel space through ioctl system call, so that the kernel space executes Fstrim operation.
4. The dirty data scrubbing method as claimed in claim 1, wherein the kernel space exiting the Fstrim operation is triggered by: sending a SIGURSR 1 signal to the kernel space to cause the kernel space to exit the Fstrim operation.
5. A dirty data scrubbing method according to any one of claims 1 to 4, wherein the method further comprises:
setting a trigger period;
monitoring whether a trigger time is reached based on the trigger period;
and if the triggering time is reached, executing the step of monitoring the system state.
6. The dirty data scrubbing method as claimed in claim 5, wherein the step of monitoring the status of the system and returning to the step of monitoring whether a trigger time has been reached if the system does not satisfy the trigger condition.
7. The dirty data erase method of claim 5, further comprising:
and when the Fstrim operation is completed by the kernel space or the system is awakened, returning to the step of monitoring whether the trigger time is reached.
8. A dirty data scrubbing method according to any one of claims 1 to 4, wherein the performing Fstrim operations includes:
traversing the block groups to obtain a target block group to be erased;
issuing a discard command to the block in the idle state in the target block group;
and returning to the step of traversing the block group to obtain another block group to be erased.
9. The dirty data scrubbing method as claimed in claim 8, wherein said monitoring whether said system is awake during said Fstrim operation performed by said kernel space comprises:
before issuing a discard command to the block in the idle state in the target block group, the kernel space monitors a SIGUSR1 signal, and if the SIGUSR1 signal is received, the Fstrim operation is stopped.
10. A dirty data erasing apparatus, applied to a file system of a terminal device, the apparatus comprising:
the first monitoring unit is used for monitoring the system state;
the second monitoring unit is used for monitoring whether the system is awakened or not in the Fstrim operation process executed by the kernel space;
the erasing unit is used for enabling the kernel space to execute Fstrim operation when the system meets a trigger condition; and when the system is awakened, the kernel space is exited from the Fstrim operation.
11. The dirty data erase device of claim 10, wherein the trigger condition includes at least one of:
the system is in an idle state; or
The electric quantity of the terminal equipment is greater than an electric quantity threshold value; or
The amount of data deleted by the system reaches a capacity threshold.
12. The dirty data erase device of claim 10, further comprising: the calling unit is used for sending an Fstrim notification to the erasing unit through ioctl system calling when the system meets the trigger condition; the erasure unit causes the kernel space to perform an Fstrim operation in response to the Fstrim notification.
13. The dirty data erase device of claim 10, further comprising: a sending unit, configured to send a SIGUSR1 signal to the erasing unit when the system is woken up; the erase unit is responsive to the SIGURSR 1 signal to cause the kernel space to exit the Fstrim operation.
14. A dirty data wiping apparatus as claimed in any one of claims 10 to 13, wherein the apparatus further comprises:
a setting unit for setting a trigger period;
a third monitoring unit, configured to monitor whether a trigger time is reached based on the trigger period;
the first monitoring unit is used for monitoring the system state when the triggering time is reached.
15. The dirty data erase device of claim 14, wherein the third monitoring unit is further configured to: and when the first monitoring unit monitors that the system does not meet the trigger condition, monitoring whether the trigger time is reached again.
16. The dirty data erase device of claim 14, wherein the third monitoring unit is further configured to:
when the Fstrim operation is completed by the kernel space or when the second monitoring unit monitors that the system is awakened, whether the trigger time is reached is monitored again.
17. The dirty data erasing apparatus of any of claims 10 to 13, wherein the erasing unit is configured to:
traversing the block groups to obtain a target block group to be erased;
issuing a discard command to the block in the idle state in the target block group;
and returning to the step of traversing the block group to obtain another block group to be erased.
18. The dirty data erase device of claim 17, wherein the erase unit is further configured to: monitoring the SIGOSR 1 signal before issuing a discard command to a block within the target block group that is in an idle state.
19. An electronic device, comprising:
a memory to store instructions; and
a processor for invoking the memory stored instructions to perform a dirty data scrubbing method as claimed in any one of claims 1 to 9.
20. A computer-readable storage medium storing instructions which, when executed by a processor, perform a dirty data scrubbing method as claimed in any one of claims 1 to 9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010006534.0A CN111240590A (en) | 2020-01-03 | 2020-01-03 | Dirty data erasing method, dirty data erasing device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010006534.0A CN111240590A (en) | 2020-01-03 | 2020-01-03 | Dirty data erasing method, dirty data erasing device and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111240590A true CN111240590A (en) | 2020-06-05 |
Family
ID=70877620
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010006534.0A Pending CN111240590A (en) | 2020-01-03 | 2020-01-03 | Dirty data erasing method, dirty data erasing device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111240590A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113341924A (en) * | 2021-06-09 | 2021-09-03 | 中国第一汽车股份有限公司 | ECU power-off method, device, equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760311A (en) * | 2016-02-17 | 2016-07-13 | 珠海全志科技股份有限公司 | Trim command response method and system and operation system |
CN105824577A (en) * | 2016-03-10 | 2016-08-03 | 福州瑞芯微电子股份有限公司 | Method and system for optimizing secure erase |
CN108089822A (en) * | 2017-12-20 | 2018-05-29 | 北京京存技术有限公司 | Management method, system, equipment and the storage medium of storage chip |
CN110209596A (en) * | 2019-04-23 | 2019-09-06 | 努比亚技术有限公司 | Disk method for sorting, device and computer readable storage medium |
-
2020
- 2020-01-03 CN CN202010006534.0A patent/CN111240590A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105760311A (en) * | 2016-02-17 | 2016-07-13 | 珠海全志科技股份有限公司 | Trim command response method and system and operation system |
CN105824577A (en) * | 2016-03-10 | 2016-08-03 | 福州瑞芯微电子股份有限公司 | Method and system for optimizing secure erase |
CN108089822A (en) * | 2017-12-20 | 2018-05-29 | 北京京存技术有限公司 | Management method, system, equipment and the storage medium of storage chip |
CN110209596A (en) * | 2019-04-23 | 2019-09-06 | 努比亚技术有限公司 | Disk method for sorting, device and computer readable storage medium |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113341924A (en) * | 2021-06-09 | 2021-09-03 | 中国第一汽车股份有限公司 | ECU power-off method, device, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108762839B (en) | Interface display method and device of application program | |
EP3188066B1 (en) | A method and an apparatus for managing an application | |
CN105955765B (en) | Application preloading method and device | |
CN110166371B (en) | Flow control method and device, electronic equipment and storage medium | |
US10409684B2 (en) | Method, device and storage medium for cleaning memory | |
US11706081B2 (en) | Method for controlling beam failure recovery procedure, electronic device and storage medium | |
CN107040591B (en) | Method and device for controlling client | |
CN105930213B (en) | Using operation method and device | |
CN105528055A (en) | Running object processing method and device | |
EP3015983A1 (en) | Method and device for optimizing memory | |
CN111581174A (en) | Resource management method and device based on distributed cluster system | |
CN105912204B (en) | Method and device for starting application interface | |
CN113703937A (en) | Animation switching method and device and storage medium | |
US9678868B2 (en) | Method and device for optimizing memory | |
CN113867927A (en) | Resource allocation method, device, electronic equipment and storage medium | |
CN110968523A (en) | Memory defragmentation method and device | |
CN109634762B (en) | Data recovery method and device, electronic equipment and storage medium | |
CN109062625B (en) | Application program loading method and device and readable storage medium | |
CN108874450B (en) | Method and device for waking up voice assistant | |
CN111240590A (en) | Dirty data erasing method, dirty data erasing device and electronic equipment | |
CN111580980B (en) | Memory management method and device | |
CN112947739A (en) | Terminal application program management method and device, terminal and storage medium | |
CN106249843B (en) | A kind of course control method, device and mobile device | |
CN105786561B (en) | Method and device for calling process | |
CN112286692A (en) | Memory recovery method, memory recovery 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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200605 |