CN115840736A - File sorting method, intelligent terminal and computer readable storage medium - Google Patents

File sorting method, intelligent terminal and computer readable storage medium Download PDF

Info

Publication number
CN115840736A
CN115840736A CN202111111235.4A CN202111111235A CN115840736A CN 115840736 A CN115840736 A CN 115840736A CN 202111111235 A CN202111111235 A CN 202111111235A CN 115840736 A CN115840736 A CN 115840736A
Authority
CN
China
Prior art keywords
file
sorted
intelligent terminal
read
preset
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
Application number
CN202111111235.4A
Other languages
Chinese (zh)
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.)
Shenzhen Transsion Holdings Co Ltd
Original Assignee
Shenzhen Transsion Holdings Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Transsion Holdings Co Ltd filed Critical Shenzhen Transsion Holdings Co Ltd
Priority to CN202111111235.4A priority Critical patent/CN115840736A/en
Publication of CN115840736A publication Critical patent/CN115840736A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a file arrangement method, an intelligent terminal and a computer readable storage medium, wherein the file arrangement method comprises the following steps: acquiring a file to be sorted corresponding to a target application; and moving the file fragments corresponding to the files to be sorted to a target storage space, and/or performing garbage collection on a storage module according to the file fragments. According to the method and the device, the file fragments corresponding to the files to be sorted of the target application are sorted, the logic address storage space corresponding to the file fragments and the physical address storage space of the memory are released, the file sorting pertinence is improved, and the problem that the file fragment sorting is not complete is solved.

Description

File sorting method, intelligent terminal and computer readable storage medium
Technical Field
The application relates to the technical field of storage, in particular to a file arrangement method, an intelligent terminal and a computer readable storage medium.
Background
When the physical memory required by the application program is insufficient, a temporary exchange file is generated in the hard disk by a general operating system, and the hard disk space occupied by the file is virtualized into the memory. The virtual memory management program can frequently read and write the hard disk, and a large amount of fragments are generated, which is a main reason for generating the hard disk fragments. Other temporary files or temporary file directories generated when the IE browser browses information may also be arranged to cause a large amount of fragmentation in the system. File fragmentation generally causes no problem in a system, but too much file fragmentation causes the system to search back and forth when reading files, which causes the performance of a hard disk to be reduced, and the service life of the hard disk is seriously shortened.
In the course of conceiving and implementing the present application, the inventors found that at least the following problems existed: in some implementations, the defragmentation of files is not complete and/or more defragmentation of files is easily generated, typically by freeing up storage space for the defragmentation of files in the storage device.
The foregoing description is provided for general background information and is not admitted to be prior art.
Disclosure of Invention
In view of the above technical problems, the present application provides a file arrangement method, an intelligent terminal and a computer-readable storage medium, which solve the technical problem of incomplete file defragmentation.
In order to solve the technical problem, the present application provides a file arrangement method, which is applied to an intelligent terminal, and includes:
acquiring a file to be sorted corresponding to a target application;
and moving the file fragments corresponding to the files to be sorted to a target storage space, and/or performing garbage collection on a storage module according to the file fragments.
Optionally, the step of performing garbage collection on the storage module according to the file fragment includes:
acquiring a first logical address and/or a first physical address corresponding to the file fragment;
clearing data in a storage block corresponding to the first logical address and/or the first physical address;
optionally, the first logical address is a logical address before the file fragment is moved, and/or the first physical address is a physical address before the file fragment is moved.
Optionally, the step of performing a clearing process on file data of a storage block corresponding to the first logical address and/or the first physical address includes:
marking the read-write unit corresponding to the first logical address and/or the first physical address as an invalid read-write unit, and copying data in other read-write units except the invalid read-write unit in the storage block into a preset read-write unit;
and clearing all data in the storage block.
Optionally, the step of obtaining the file to be sorted of the target application includes:
acquiring the time interval between the current time and the historical sorting time;
when the time interval is greater than or equal to a preset time interval, acquiring the current state of the intelligent terminal;
and when the current state meets a preset condition, executing the step of acquiring the file to be sorted of the target application.
Optionally, the preset condition includes at least one of:
the current time is in a preset time period;
the current electric quantity of the intelligent terminal is greater than or equal to the preset electric quantity;
the intelligent terminal is in a charging state;
and the residual capacity of the storage space of the storage module of the intelligent terminal is greater than or equal to the preset capacity.
Optionally, the step of obtaining a file to be sorted corresponding to the target application includes:
and responding to the trigger operation aiming at the target application, and acquiring the file to be sorted corresponding to the target application according to the trigger operation.
Optionally, after the step of obtaining the file to be collated of the target application, the method includes:
acquiring the file size and/or storage area information of the file to be sorted;
judging whether the fragmentation degree corresponding to the target application is larger than or equal to a degree threshold value or not according to the file size and/or the storage area information;
and when the fragmentation degree is larger than or equal to the degree threshold value, executing a step of moving the file fragments corresponding to the files to be sorted to a target storage space.
Optionally, the method further comprises:
monitoring the arrangement progress corresponding to the target application, and outputting the arrangement progress in a preset mode.
The application also provides an intelligent terminal, including: the device comprises a memory and a processor, wherein the memory is stored with a file tidying program, and the file tidying program realizes the steps of the method when being executed by the processor.
The present application also provides a computer-readable storage medium, in which a computer program is stored, which computer program, when being executed by a processor, realizes the steps of the method as described above.
As described above, according to the file arrangement method of the application, the file fragments corresponding to the files to be arranged of the target application are arranged, so that the files to be arranged are transferred to the continuous target storage space, and the logical address storage space corresponding to the file fragments and the physical address storage space of the memory can be released by performing garbage collection on the file management system and the memory, thereby solving the problem of incomplete arrangement of the file fragments.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application. In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic diagram of a hardware structure of an intelligent terminal implementing various embodiments of the present application;
fig. 2 is a communication network system architecture diagram according to an embodiment of the present application;
fig. 3 is a flowchart illustrating a file defragmentation method according to the first embodiment;
fig. 4 is an exemplary diagram showing a file defragmentation method according to the first embodiment;
fig. 5 is an exemplary diagram showing a file defragmentation method according to the first embodiment;
fig. 6 is a flowchart illustrating a file defragmentation method according to the second embodiment;
fig. 7 is an exemplary diagram showing a file defragmentation method according to the second embodiment;
fig. 8 is an exemplary diagram showing a file defragmentation method according to the second embodiment;
fig. 9 is a flowchart illustrating a file defragmentation method according to the third embodiment;
fig. 10 is a diagram showing a display interface of the smart terminal according to the third embodiment;
fig. 11 is a setting interface diagram according to the third embodiment;
fig. 12 is a sort progress interface diagram shown according to the fourth embodiment.
The implementation, functional features and advantages of the objectives of the present application will be further explained with reference to the accompanying drawings. With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
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 application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, the element defined by the phrases "comprising a component of 8230; \8230;" comprising a component of this specification does not exclude the presence of additional similar elements in processes, methods, articles, or apparatus that comprise the same component, features, or elements, which may have the same meaning in different embodiments of the application, and optionally may have different meanings that are determined by their interpretation in the specific embodiment or by their context in further combination with the specific embodiment.
It should be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope herein. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context. Also, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context indicates otherwise. It will be further understood that the terms "comprises," "comprising," "includes" and/or "including," when used in this specification, specify the presence of stated features, steps, operations, elements, components, items, species, and/or groups, but do not preclude the presence, or addition of one or more other features, steps, operations, elements, components, species, and/or groups thereof. The terms "or," "and/or," "including at least one of the following," and the like, as used herein, are to be construed as inclusive or mean any one or any combination. For example, "includes at least one of: A. b, C "means" any of the following: a; b; c; a and B; a and C; b and C; a and B and C ", again for example," a, B or C "or" a, B and/or C "means" any one of the following: a; b; c; a and B; a and C; b and C; a and B and C'. An exception to this definition will occur only when a combination of elements, functions, steps or operations are inherently mutually exclusive in some way.
It should be understood that, although the steps in the flowcharts in the embodiments of the present application are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and may be performed in other orders unless explicitly stated herein. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, in different orders, and may be performed alternately or at least partially with respect to other steps or sub-steps of other steps.
The words "if", as used herein may be interpreted as "at \8230; \8230whenor" when 8230; \8230when or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It should be noted that step numbers such as S10 and S20 are used herein for the purpose of more clearly and briefly describing the corresponding contents, and do not constitute a substantial limitation on the sequence, and those skilled in the art may perform S20 first and then S10 in the specific implementation, but these should be within the protection scope of the present application.
It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In the following description, suffixes such as "module", "component", or "unit" used to indicate elements are used only for facilitating the description of the present application, and have no particular meaning in themselves. Thus, "module", "component" or "unit" may be used mixedly.
The smart terminal may be implemented in various forms. For example, the smart terminal described in the present application may include smart terminals such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and fixed terminals such as a Digital TV, a desktop computer, and the like.
While the following description will be given by way of example of a smart terminal, those skilled in the art will appreciate that the configuration according to the embodiments of the present application can be applied to a fixed type terminal in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of an intelligent terminal for implementing various embodiments of the present application, the intelligent terminal 100 may include: RF (Radio Frequency) unit 101, wiFi module 102, audio output unit 103, a/V (audio/video) input unit 104, sensor 105, display unit 106, user input unit 107, interface unit 108, memory 109, processor 110, and power supply 111. Those skilled in the art will appreciate that the intelligent terminal architecture shown in fig. 1 does not constitute a limitation of the intelligent terminal, and that the intelligent terminal may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
The following specifically describes each component of the intelligent terminal with reference to fig. 1:
the radio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to the processor 110; in addition, the uplink data is transmitted to the base station. Typically, radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, the radio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000 (Code Division Multiple Access 2000 ), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex-Long Term Evolution), TDD-LTE (Time Division duplex-Long Term Evolution ), 5G (Global System for Mobile communications, or the like).
WiFi belongs to a short-distance wireless transmission technology, and the intelligent terminal can help a user to receive and send emails, browse webpages, access streaming media and the like through the WiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows the WiFi module 102, it is understood that it does not belong to the essential constitution of the smart terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
The audio output unit 103 may convert audio data received by the radio frequency unit 101 or the WiFi module 102 or stored in the memory 109 into an audio signal and output as sound when the smart terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, the audio output unit 103 may also provide audio output related to a specific function performed by the smart terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). The audio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and a microphone 1042, the Graphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on the display unit 106. The image frames processed by the graphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via the radio frequency unit 101 or the WiFi module 102. The microphone 1042 may receive sounds (audio data) via the microphone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via the radio frequency unit 101 in case of a phone call mode. The microphone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
The smart terminal 100 also includes at least one sensor 105, such as a light sensor, a motion sensor, and other sensors. Optionally, the light sensor includes an ambient light sensor and a proximity sensor, the ambient light sensor may adjust the brightness of the display panel 1061 according to the brightness of ambient light, and the proximity sensor may turn off the display panel 1061 and/or the backlight when the smart terminal 100 moves to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the gesture of the mobile phone (such as horizontal and vertical screen switching, related games, magnetometer gesture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
The display unit 106 is used to display information input by a user or information provided to the user. The Display unit 106 may include a Display panel 1061, and the Display panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
The user input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the intelligent terminal. Alternatively, the user input unit 107 may include a touch panel 1071 and other input devices 1072. The touch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near the touch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. The touch panel 1071 may include two parts of a touch detection device and a touch controller. Optionally, the touch detection device detects a touch orientation of a user, detects a signal caused by a touch operation, and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to the processor 110, and can receive and execute commands sent by the processor 110. In addition, the touch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to the touch panel 1071, the user input unit 107 may include other input devices 1072. Optionally, other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited thereto.
Alternatively, the touch panel 1071 may cover the display panel 1061, and when the touch panel 1071 detects a touch operation thereon or nearby, the touch panel 1071 transmits the touch operation to the processor 110 to determine the type of the touch event, and then the processor 110 provides a corresponding visual output on the display panel 1061 according to the type of the touch event. Although the touch panel 1071 and the display panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the smart terminal, in some embodiments, the touch panel 1071 and the display panel 1061 may be integrated to implement the input and output functions of the smart terminal, and is not limited herein.
The interface unit 108 serves as an interface through which at least one external device can be connected to the intelligent terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. The interface unit 108 may be used to receive input (e.g., data information, power, etc.) from an external device and transmit the received input to one or more elements within the smart terminal 100 or may be used to transmit data between the smart terminal 100 and the external device.
The memory 109 may be used to store software programs as well as various data. The memory 109 may mainly include a program storage area and a data storage area, and optionally, the program storage area may store an operating system, an application program (such as a sound playing function, an image playing function, and the like) required by at least one function, and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, the memory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
The processor 110 is a control center of the intelligent terminal, connects various parts of the entire intelligent terminal using various interfaces and lines, and performs various functions of the intelligent terminal and processes data by operating or executing software programs and/or modules stored in the memory 109 and calling data stored in the memory 109, thereby performing overall monitoring of the intelligent terminal. Processor 110 may include one or more processing units; preferably, the processor 110 may integrate an application processor and a modem processor, optionally, the application processor mainly handles operating systems, user interfaces, application programs, etc., and the modem processor mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 110.
The intelligent terminal 100 may further include a power supply 111 (such as a battery) for supplying power to each component, and preferably, the power supply 111 may be logically connected to the processor 110 through a power management system, so as to implement functions of managing charging, discharging, and power consumption through the power management system.
Although not shown in fig. 1, the smart terminal 100 may further include a bluetooth module or the like, which is not described herein.
In order to facilitate understanding of the embodiments of the present application, a communication network system on which the intelligent terminal of the present application is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present disclosure, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an e-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an epc (Evolved Packet Core) 203, and an IP service 204 of an operator, which are in communication connection in sequence.
Optionally, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 and other eNodeBs 2022, among others. Alternatively, the eNodeB2021 may be connected with other enodebs 2022 through a backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to the EPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an hss (Home Subscriber Server) 2032, other MMEs 2033, an SGW (Serving gateway) 2034, a pgw (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. Optionally, the MME2031 is a control node that handles signaling between the UE201 and the EPC203, providing bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
The IP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present application is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems (e.g. 5G), and the like.
Based on the intelligent terminal hardware structure and the communication network system, the embodiments of the application are provided.
First embodiment
Referring to fig. 3, fig. 3 is a schematic flow chart of a file sorting method according to a first embodiment. The file sorting method comprises the following steps:
s10, acquiring a file to be sorted corresponding to the target application;
and S20, moving the file fragments corresponding to the files to be sorted to a target storage space, and/or performing garbage collection on a storage module according to the file fragments.
In the embodiment of the present application, the smart terminal in the embodiment may include a smart terminal such as a mobile phone, a tablet computer, a notebook computer, a palm computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
Optionally, the target application may include an application program pre-installed on the intelligent terminal by an intelligent terminal provider, and may further include an application program installed on the intelligent terminal according to a user selection. The target application can be selected in advance by a user, and the target application can be judged and selected through the intelligent terminal. Alternatively, the storage device may be a file management system having a file storage and/or organization function in an operating system corresponding to the intelligent terminal, and/or a storage device in the intelligent terminal. Alternatively, the storage module may be at least one of a file management system, a flash memory, and a hard disk.
Optionally, after the target application is obtained, the file to be sorted of the target application is obtained, and after the file to be sorted of the target application is obtained, if the fragmentation degree corresponding to the target application is low, if the target application is sorted each time, a large amount of computing resources of the intelligent terminal are consumed. Based on the method, after the file to be sorted of the target application is obtained, the fragmentation degree of the target application is calculated based on the file to be sorted, and when the fragmentation degree of the target application is higher, the target application is sorted.
Based on this, after step S10, the method further includes:
s30, acquiring the file size and/or storage area information of the file to be sorted;
s31, judging whether the fragmentation degree corresponding to the target application is larger than or equal to a degree threshold value or not according to the file size and/or the storage area information;
and S32, when the fragmentation degree is larger than or equal to the degree threshold, executing a step of moving the file fragments corresponding to the files to be sorted to a target storage space.
Optionally, after the files to be sorted of the target application are obtained, the metadata of each file to be sorted in all the files to be sorted is read by traversing the files to be sorted in the file management system to obtain the file size of each file to be sorted and/or the storage area information of each file to be sorted. Optionally, the storage area information includes the number of storage areas of the files to be sorted, and a larger number of storage areas indicates that the storage areas where the files to be sorted are located are more dispersed.
Optionally, the fragmentation degree corresponding to the target can be measured by file size and/or storage area information. Alternatively, the fragmentation degree may correspond to a file size, and the fragmentation degree is higher if the file size corresponding to the target application is larger. The fragmentation degree may also correspond to the storage area information, and if the number of storage areas corresponding to the target application is larger, the fragmentation degree is higher. Optionally, the fragmentation degree may also be determined by the file size and storage area information. The file size and the storage area information can be set with weighted values, and the fragmentation degree can be calculated according to the file size and the storage area information and the corresponding weighted values.
Alternatively, the degree threshold may be preset according to the fragmentation degree in a specific application scenario. If the fragmentation degree is determined by the file size, the degree threshold may be a threshold related to the file size; if the fragmentation degree is determined by the number of storage regions, the degree threshold may be a threshold related to the number of storage regions.
Optionally, the files to be sorted can be found by issuing corresponding search commands (each file corresponds to a logical address), the metadata of each file to be sorted can be read to obtain the logical address of each file to be sorted, and the number of the logical addresses is the number of the storage areas of the files to be sorted. Optionally, by judging whether the number of the storage areas is greater than a degree threshold, when the number of the storage areas is greater than the degree threshold, determining that the fragmentation degree corresponding to the target application is greater than the degree threshold, judging that the target application needs to be sorted, taking the target application as an application to be sorted, and adding a file to be sorted of the target application into a sorting queue.
Optionally, the sorting queue includes at least one file to be sorted, the number of the storage areas corresponding to the file to be sorted may be greater than a degree threshold, and the file to be sorted may also be a common file. Optionally, for a common file, namely a file with a high use frequency, file fragments of the common file need to be sorted in time, so that the phenomenon that a user is stuck or delayed when the user loads the common file is avoided, and the user experience is not affected.
Optionally, the files to be sorted may be placed in the sorting queue in a preset sorting manner, where the preset sorting manner may be to obtain a preset weight of each of the files to be sorted, and place the files in an order from large to small according to the preset weight. Optionally, the preset weight may be used to represent the importance degree of each file to be sorted, where the importance degree is the highest, and is arranged at the top of the sorting queue, and so on. Optionally, the preset weight may be determined according to at least one of a fragmentation degree of the file to be sorted, a usage frequency of the file to be sorted, and a latest access time of the file to be sorted. Optionally, the higher the fragmentation degree of the file to be sorted is, the higher the preset weight is; the higher the use frequency is, the higher the preset weight is; the closer the last access time is to the current time, the higher the preset weight. The preset weights are placed in the sorting sequence from large to small, so that the higher the preset weights are, the files are sorted first, and the file defragmentation efficiency is improved.
Optionally, in the embodiment of the present application, the user may manually trigger the document finishing operation, or the intelligent terminal may trigger the document finishing operation by itself, where the manner in which the intelligent terminal triggers the document finishing operation may be triggering within a preset specific time period. Optionally, the specific time period may be midnight, and the manner may be triggered according to a preset trigger cycle. Optionally, the trigger cycle is a week, after the file defragmentation operation is executed last time, the execution time of the last time is recorded to be 2020 year, 10 month, 10 day, 03 hour and 00 minute, and the next trigger time is determined to be 2020 year, 10 month, 17 day, 03 hour and 00 minute according to the execution time of the last time and the trigger cycle.
Optionally, the triggering mode may also be that a time interval between the current time and the last file defragmentation time is obtained, and when the time interval is greater than or equal to a preset time interval and the current state of the intelligent terminal meets a preset triggering condition, the file defragmentation operation is triggered. Optionally, the preset time interval may be one week, half a month, or the like, and the preset time may be configured by a system configuration person, or may be manually set by a user. Optionally, the trigger condition may include that the current time is in a preset time period, the memory capacity of the file management system of the intelligent terminal is greater than or equal to a preset memory capacity, and the electric quantity of the intelligent terminal is greater than or equal to a preset electric quantity or in a charging state. It is understood that the manner of triggering the filing operation includes, but is not limited to, the three manners described above.
Second embodiment
The embodiment of the present application provides a method for automatically triggering file arrangement by an intelligent terminal, which further includes, before the step S10 disclosed in the first embodiment:
s11, acquiring the time interval between the current time and the historical sorting time;
s12, when the time interval is greater than or equal to a preset time interval, determining the current state of the intelligent terminal;
and S13, when the current state meets a preset condition, executing the step of acquiring the file to be sorted of the target application.
In the embodiment of the application, whether the time interval between the current time and the historical sorting time is larger than the preset time interval is judged. And when the time interval is greater than or equal to a preset time interval, the intelligent terminal is indicated not to perform file defragmentation for a long time, and the intelligent terminal is required to perform file defragmentation operation. Optionally, the preset time interval may be set according to an actual application scenario, and the preset time interval may be 12 hours, and the like, which is not specifically limited by the present disclosure.
Optionally, when the intelligent terminal needs to be subjected to a file fragmenting operation, the current state of the intelligent terminal may be acquired, whether the intelligent terminal is suitable for executing the file fragmenting operation may be determined according to the current state, optionally, a preset condition is stored in the intelligent terminal, and when it is determined that the intelligent terminal is suitable for executing the file fragmenting operation, the preset condition is called, and whether the current state of the intelligent terminal meets the preset condition may be determined.
Optionally, the determination manner for determining that the current state meets the preset condition includes at least one of the following:
the current time is in a preset time period;
the current electric quantity of the intelligent terminal is greater than or equal to the preset electric quantity;
the intelligent terminal is in a charging state;
and the residual capacity of the storage space of the storage module of the intelligent terminal is greater than or equal to the preset capacity.
Optionally, the preset time period is a specific time period for executing the file sorting operation, and the preset time period may be configured before system personnel leave a factory, or may be set by a user in a self-adaptive manner.
Optionally, when the current time is within a preset time period, it is determined whether the electric quantity of the intelligent terminal is greater than or equal to a preset electric quantity, where the preset electric quantity may be 0 or 10.
Optionally, the remaining capacity of the storage space of the storage module of the intelligent terminal is used to provide a continuous target storage space, and only when the remaining capacity of the storage space is greater than or equal to a preset capacity, the storage module can be written into the storage module to be sorted, so that the file sorting operation can be executed.
Optionally, when the current time of the intelligent terminal is in a preset time period, the electric quantity of the intelligent terminal is greater than or equal to the preset electric quantity, and the memory capacity of the file management system of the intelligent terminal is greater than the preset memory capacity, the intelligent terminal automatically triggers a file arrangement operation, and a file to be arranged corresponding to the target application can be obtained.
Optionally, when the file operation is triggered manually by a user or automatically by an intelligent terminal, the file to be sorted corresponding to the target application is acquired, the metadata corresponding to the file to be sorted can be acquired from the file management system, and the logic address corresponding to the file to be sorted is stored in the metadata. Optionally, each file fragment corresponding to the file to be sorted may be obtained according to the logical address, one of the file fragments may be stored in one of the logical blocks of the file management system, at least two of the file fragments may be stored in the same logical block of the file management system, and the logical addresses corresponding to the file fragments are not consecutive.
Optionally, after obtaining each file fragment corresponding to the file to be sorted, moving each file fragment to a target storage space, optionally, the target storage space may be a pre-allocated continuous blank storage space, or may also be a real-time allocated continuous blank storage space, where the pre-allocated continuous blank storage space is larger than or larger than a size of storing the file fragment, and the real-time allocated continuous blank storage space is a target storage space allocated to the file fragment in real time according to the size of the file fragment.
Optionally, the target storage space includes a target logical address storage space and/or a target physical address storage space, where logical addresses corresponding to the target logical address storage space are consecutive, and physical addresses corresponding to the target physical address storage space are consecutive. The method for moving the file fragments corresponding to the files to be sorted to the target storage space comprises the steps of sending a file fragment moving instruction to a storage device after moving the file fragments to the target logical storage address space, and moving the corresponding file fragments to the target physical address storage space according to the file fragment moving instruction after the storage device receives the file fragment moving instruction.
Optionally, the moving the file to the target storage space includes moving each of the file fragments to a blank continuous logical address storage space in the file management system. Optionally, the size of the continuous logical address storage space is greater than or equal to the sum of the file sizes of the respective file fragments.
Optionally, referring to fig. 4, fig. 4 is a schematic diagram of the moving of each file fragment to a target logical address storage space in the file management system. The size of each of logical blocks 1 to 5 is 256KB, the size of file fragment 1 is 4KB, the size of file fragments 2 and 3 is 8KB, and the size of file fragment 4 is 16KB. File fragment 1 is stored in logical block 1, file fragment 2 is stored in logical block 2, file fragment 3 is stored in logical block 3, and file fragment 4 is stored in logical block 4. The logical block 5 may be a pre-allocated target logical address storage space, and may migrate the file fragments 1, 2, 3, and 4 into the logical block 5, and finally store the file fragments 1, 2, 3, and 4 in the logical block 5.
Optionally, in another embodiment, the manner of moving each of the file fragments to the target logical address storage space in the file management system may further keep the target file fragment of each of the file fragments still according to the size of each of the file fragments, and move other file fragments except the target file fragment to a target logical block, where the target logical block includes a logical block where the target fragment file is located. Optionally, the target file fragment may be a file fragment with a largest size among the file fragments, or may be a file fragment with a smallest size among the file fragments. Optionally, the sizes of the logical blocks 1 to 4 are all 256KB, the size of the file fragment 1 is 4KB, the sizes of the file fragments 2 and 3 are both 8KB, and the size of the file fragment 4 is 16KB. File fragment 1 is stored in logical block 1, file fragment 2 is stored in logical block 2, file fragment 3 is stored in logical block 3, and file fragment 4 is stored in logical block 4. The file fragment 1 is a target file fragment, the logical block 1 in which the file fragment 1 is located includes a continuous storage space, the file fragments 2, 3, and 4 can all be migrated into the logical block 1, and finally the file fragments 1, 2, 3, and 4 are all stored in the logical block 1.
Optionally, after moving each file fragment to a target logical address storage space in the file management system, a file fragment moving instruction is sent to the storage device, where the file fragment moving instruction includes a first logical address corresponding to each file fragment of the file to be sorted, and the first logical address is a logical address before the file fragment is moved. And the file fragment moving instruction is used for indicating the memory to move the file fragments in the memory to a target physical address storage space according to the file fragments stored in the memory corresponding to the first logical address. Optionally, the storage device stores an address mapping table corresponding to a logical address and a physical address, and after the first logical address is obtained, a first physical address corresponding to the first logical address is obtained according to the address mapping table, where the first physical address is a physical address before the file fragment is moved, and each file fragment can be obtained according to the first physical address.
Optionally, in this embodiment of the application, when a plurality of file fragments are stored in a plurality of physical blocks, each file fragment in the plurality of file fragments corresponds to a first physical address, respectively. The first physical address of any one of the file fragments is a physical address when the any one of the file fragments is stored in the plurality of physical blocks. In the embodiment of the present application, one file fragment may be stored in one physical block, of course, two or more file fragments may also be stored in one physical block, and when two or more file fragments are stored in the same physical block, the corresponding first physical addresses of the two or more file fragments in the physical block are not consecutive.
Optionally, after obtaining each file fragment of the storage device according to the first logical address of the file moving instruction, moving each file fragment to a target physical address storage space, where second physical addresses corresponding to the target physical address storage space are consecutive, and the second physical addresses are physical addresses after the file fragments are moved. The method for moving each of the file fragments to the pre-allocated continuous physical address storage space may be that N unoccupied physical blocks are selected from a plurality of physical blocks in the memory, the N physical blocks are determined as the target physical address storage space, and then the plurality of fragment files are merged and sorted and stored in the N unoccupied physical blocks. I.e. the N physical blocks are unoccupied physical blocks. Optionally, the method may further include, according to the size of each file fragment, keeping a target file fragment of each file fragment still, and moving other file fragments except the target file fragment into a target physical block, where the target physical block is the target physical address storage space, and the target physical block includes a physical block where the target fragment file is located. Optionally, the target file fragment may be a file fragment with a largest size among the file fragments, or may be a file fragment with a smallest size among the file fragments.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating the movement of each of the file fragments to a pre-allocated contiguous physical address storage space. Optionally, the sizes of the physical blocks 1 to 4 are all 256KB, the size of the file fragment 1 is 4KB, the sizes of the file fragments 2 and 3 are both 8KB, and the size of the file fragment 4 is 16KB. File fragment 1 is stored in physical block 1, file fragment 2 is stored in physical block 2, file fragment 3 is stored in physical block 3, and file fragment 4 is stored in physical block 4. The file fragment 1 is a target file fragment, and the physical block 1 where the file fragment 1 is located is a target physical block. The physical block 1 includes a continuous physical address storage space, the file fragments 2, 3, and 4 may all be migrated into the physical block 1, and finally the file fragments 1, 2, 3, and 4 are all stored in the physical block 1.
Optionally, after moving each file fragment corresponding to the file to be sorted to the target continuous storage space, a second logical address corresponding to each file fragment is obtained, where the second logical address is a logical address after the file fragment is moved, and an address mapping table stored in the storage device may be updated according to the second logical address and the second physical address.
Optionally, after the file fragment is moved, the file fragment is rewritten into the target storage space, the data stored at the first logical address corresponding to the file fragment and/or the data stored at the second physical address corresponding to the file fragment may be invalid data, the invalid data still occupies a logical address storage space and/or a physical address storage space, the logical address corresponding to the logical address storage space occupied by the invalid data is discontinuous, the physical address corresponding to the physical address storage space occupied by the invalid data is discontinuous, and subsequently, after a new file is written into the logical address storage space with discontinuous logical addresses and/or the physical address storage space with discontinuous physical addresses, more file fragments are easily generated. Based on this, in the embodiment of the application, garbage collection is performed on the storage module based on the file fragments, and the storage space of the storage module can be released, so that data can be written into the storage space released by the file management system and/or the storage space released by the storage device when data is subsequently written, and the storage module includes the file management system and/or the storage device.
Optionally, the S20 includes:
s21, acquiring a first logical address and/or a first physical address corresponding to the file fragment;
s22, clearing data in a storage block corresponding to the first logical address and/or the first physical address; the first logical address is a logical address before the file fragment is moved, and/or the first physical address is a physical address before the file fragment is moved.
In this embodiment of the present application, the storage block includes a logical block and/or a physical block, the logical block is a logical block corresponding to a first logical address corresponding to the file fragment, the physical block is a physical block corresponding to a first physical address corresponding to the file fragment, and according to a manner that the file fragment performs garbage collection on the file management system, the file data of the logical block corresponding to the first logical address can be cleared away in order to obtain the first logical address corresponding to the file fragment. The logical block comprises a plurality of logical pages, one logical page corresponds to one read-write unit, one read-write unit corresponds to one logical address, and the clearing of the file data of the logical block is to clear the file data of each read-write unit of the logical block so as to obtain an idle logical block.
Optionally, after removing the file data of the logical block corresponding to the first logical address, a garbage collection instruction is sent to the storage device, where the garbage collection instruction includes the first logical address of the logical block occupied by the file fragment in the file management system, and the garbage collection instruction is used to instruct the storage device to remove the file data of the physical block corresponding to the first logical address according to the first logical address. Specifically, after the storage device obtains the first logical address, the storage device obtains a first physical address corresponding to the first logical address, and may perform garbage collection processing on a physical address storage space corresponding to a physical block corresponding to the first physical address, where the garbage collection processing is performed by removing file data of the physical block corresponding to the first physical address to obtain a free physical block, that is, obtaining a continuous free physical address storage space.
It can be understood that, performing garbage collection processing on the logical address storage space of the file management system according to the first logical address corresponding to the file fragment, and/or performing garbage collection processing on the physical address storage space of the memory according to the first physical address corresponding to the file fragment, to obtain a free physical block and/or obtain a free logical block, that is, obtain a continuous free logical address storage space and/or obtain a continuous free physical address storage space.
Third embodiment
The embodiment of the application further provides a file sorting method, which further comprises the following steps: acquiring a file to be sorted corresponding to a target application; and moving the file fragments corresponding to the files to be sorted to a target storage space.
Optionally, the number of times of performing garbage collection on the logical blocks of the file management system and/or the physical blocks of the storage device is effective, and if the number of times of performing garbage collection is too large, the life of the storage device is lost. Based on this, after the file fragments corresponding to the files to be sorted are moved to the target storage space, the first logical address and/or the first physical address corresponding to the file fragments are/is acquired. The first logical address is a logical address before the file is moved, and/or the first physical address is a physical address before the file fragment is moved. The logic block corresponding to the first logic address can be determined according to the first logic address, and whether the number of valid read-write units in the logic block is greater than or equal to a preset number is judged. If the number of the effective read-write units of the logic block is larger than or equal to the preset number, the number of the ineffective read-write units in the logic block is less, the number of the effective read-write units is more, and garbage collection of the logic block is not needed.
Optionally, after the first physical address of the file fragment is obtained, the physical block corresponding to the first physical address is determined according to the first physical address. And judging whether the number of the effective read-write units in the logic block is greater than or equal to a preset number, and if the number of the effective read-write units in the physical block is greater than or equal to the preset number, the number of the ineffective read-write units in the logic block is less, the number of the effective read-write units is more, and garbage collection of the physical block is not needed.
In the embodiment of the present application, by moving each of the file fragments of the target application to the target storage space, garbage collection may be performed on the file management system and/or the storage device according to the first logical address and/or the first physical address of the file fragment to release the storage space of the file management system and/or release the storage space of the storage device, and by the above implementation, not only the file fragments of the file to be sorted corresponding to the target application are sorted to improve the access performance when the target application is subsequently accessed, but also the space fragmentation of the file management system and the storage device is reduced by the garbage collection mechanism, so that the file fragment sorting is more thorough.
Fourth embodiment
Referring to fig. 6, according to the first embodiment, the step S22 includes:
step S221, marking the read-write unit corresponding to the first logical address and/or the first physical address as an invalid read-write unit, and copying data in other read-write units except the invalid read-write unit in the storage block into a preset read-write unit;
step S222, clearing all data in the storage block.
Optionally, one logical block and/or one physical block includes a plurality of read/write units (that is, one logical block includes a plurality of logical pages, and one physical block includes a plurality of physical pages), the read/write unit stores the file fragments, the read/write unit that stores the file fragments is an invalid read/write unit, the read/write unit may also store valid data other than the file fragments, and the read/write unit may also be a blank read/write unit, that is, a read/write unit that has not yet been written with file data. In the logical block and/or the physical block, the file data of each read-write unit of the logical block and/or the physical block is removed, which easily results in removing valid data.
In the embodiment of the present application, a manner of recovering the storage module according to the file fragment is to mark the read-write unit storing the file fragment as an invalid read-write unit, and the file fragment is stored based on the invalid read-write unit. The invalid read-write unit stores invalid data, and the read-write unit storing the file fragments is marked as an invalid read-write unit. The data of the other read-write units in the storage block except the invalid read-write unit may be copied to a preset read-write unit, and all the data in the storage block may be cleared.
Optionally, when the storage block is a logic block, after determining the invalid read-write unit, determining the read-write units in the logic block except the invalid read-write unit as valid read-write units in the logic block. The data corresponding to the effective read-write unit can be moved to a preset read-write unit, and the preset read-write unit can be a blank read-write unit in other logic blocks or a blank read-write unit distributed in real time according to the number of other read-write units.
Optionally, referring to fig. 7, fig. 7 is a schematic diagram illustrating data in an active read/write unit being moved to a predetermined read/write unit. The file management system comprises a logic block 1 and a logic block 2, wherein the logic block 1 comprises read-write units 1-8, the read-write units 1-3 are effective read-write units and respectively store effective data 1, effective data 2 and effective data 3, and data corresponding to the read-write units 1-3 can be copied to blank read-write units, namely read-write units 9-11, corresponding to the logic block 2.
Optionally, after the data in the valid read-write unit in the logic block is moved to another blank logic block, all the data in the logic block is cleared to obtain the blank logic block. Thus, when data needs to be stored subsequently, visible data is stored in the cleared logical block.
Optionally, when the storage block is a physical block, after the file data of the logical block is cleared, a garbage collection instruction is sent to the memory according to the logical address of the logical block, where the garbage collection instruction includes a first logical address of the logical block corresponding to the file fragment, and is used to instruct the memory to clear the file data of the physical block corresponding to the first logical address according to the first logical address.
Optionally, in this embodiment, the first logical address included in the garbage collection instruction may be a logical address range. Alternatively, the logical address range may be indicated by the starting logical address and the length of the address. Alternatively, each logical address may be indicated by identification information (e.g., an index number or a number) of each logical address, and a segment of logical addresses 1 to 10 may be represented by "1+10", where "1" indicates that the starting logical address is logical address 1, and "10" indicates that 10 logical addresses are included in the segment of logical addresses. Optionally, the garbage collection instruction includes a plurality of logical addresses, and the plurality of logical addresses are all logical addresses that need to be aligned with the physical address. Following the above example, if the logical addresses 1 to 10 need to be aligned with the physical addresses, the address allocation instruction includes identification information of each of the logical addresses, for example, "1, 2, 3 \8230; \8230, 10 ″. Optionally, the address configuration instruction includes only one logical address, where the logical address is a start address of a logical address range, and is used to indicate all logical addresses located after the logical address.
Optionally, after the first logical address is obtained, a first physical address corresponding to the logical address is obtained according to the first logical address, the read-write unit corresponding to the first physical address is identified as an invalid read-write unit, data of the valid read-write unit in the physical block can be moved to a preset read-write unit, and all data in the physical block can be cleared.
Alternatively, referring to fig. 8, the memory includes 2 physical blocks, i.e., physical block 1 and physical block 2, each of which includes 8 physical pages. One physical page corresponds to one read-write unit, one read-write unit corresponds to one logical address, the physical block 1 comprises read-write units 1-8, and the physical block 2 comprises read-write units 9-16. The read-write unit corresponding to the first physical address is a read-write unit 1-3 in the physical block 1, the read-write unit 1-3 can be identified as an invalid read-write unit, and the read-write unit 4-6 in the physical block 1 is a blank read-write unit. It can be determined that the read-write unit 7-8 in the physical block 1 is a valid read-write unit, and the data of the read-write unit 7-8 can be moved to a corresponding blank read-write unit in the physical block 2, so that all the data in the physical block 1 can be erased.
Optionally, after the data of the valid read-write unit in the physical block is moved to a preset read-write unit, the physical address corresponding to the data of the valid read-write unit changes accordingly. Optionally, after the data is moved to a preset read-write unit, a current physical address corresponding to the data may be acquired, and an address mapping table stored in the storage device may be updated according to the current physical address.
In the embodiment of the present application, the read-write unit corresponding to the first logical address and/or the first physical address corresponding to the file fragment is identified as an invalid read-write unit. The data of the valid read-write unit of the storage block corresponding to the first logical address and/or the first physical address can be moved to a preset read-write unit, and all the data in the storage block corresponding to the first logical address and/or the first physical address can be cleared to obtain a blank logical block and/or physical block, so that when the data is written subsequently, visible data can be written into the logical block and/or the physical block, and the generation of file fragments can be prevented.
Fifth embodiment
Referring to fig. 9, based on all the above embodiments, the S10 further includes:
and S14, responding to the trigger operation aiming at the target application, and acquiring the file to be sorted corresponding to the target application according to the trigger operation.
Optionally, the specific implementation of the target application preselected by the user may be that the user selects the target application from applications displayed on the display interface of the intelligent terminal, and the triggering operation for the target application may be triggered based on long-pressing the application icon corresponding to the target application. Referring to fig. 10, fig. 10 is a schematic diagram illustrating a triggering operation of a user for the target application. As shown in fig. 10, fig. 10 shows a plurality of applications, a user presses an application 5 to trigger a triggering operation of the application 5, and after detecting the triggering operation, the intelligent terminal determines the application 5 as a target application according to the triggering operation.
Optionally, after the user presses the target application for a long time, a setting page as shown in fig. 11 may be displayed in the intelligent terminal, the user may input the finishing time based on the setting page, and after the intelligent terminal receives the finishing time input by the user, the intelligent terminal performs file finishing on the target application based on the finishing time.
Optionally, the intelligent terminal detects a trigger operation of the user for the target application, determines the target application that the user wants to sort according to the trigger operation, and may obtain the file to be sorted of the target application.
Optionally, in a process of obtaining a file to be sorted of the target application and performing file sorting on the target application according to file fragments of the file to be sorted, in order to facilitate a user to know a current sorting progress in time, an embodiment of the present application further provides a file sorting method, where the method further includes:
and S40, monitoring the arrangement progress corresponding to the target application, and outputting the arrangement progress in a preset mode.
Optionally, in the process of performing file arrangement on the target application, the intelligent terminal sends a query command to the file management system and/or the storage device, and the query command is used by a user to query arrangement progress information of the target application. And the file management system receives the query command and acquires the sorting progress information of the file fragments in the file management system. The sorting progress information may be a moving progress of the file fragment to the target storage space, or a garbage collection progress of a storage module in the file management system. And after receiving the query command, the storage device obtains a sorting progress of the file fragments in the storage device, where the sorting progress information may be a moving progress of the file fragments to a target storage space, or a garbage collection progress of a storage module in the storage device.
Optionally, after the file management system and/or the storage device finishes the corresponding sorting progress information, a corresponding query response command is generated according to the sorting progress information and fed back to the intelligent terminal, and the intelligent terminal generates a corresponding sorting progress according to the query response command. Optionally: the file sorting progress is 40%, the file sorting progress is 50%, and the sorting progress can be displayed on the intelligent terminal. Optionally, the manner of displaying the sorting progress may also be a typeface that displays a document sorting progress in a display interface of the intelligent terminal as shown in the left side of fig. 12, and the document sorting progress may also be displayed in a form of a progress bar, or may also be displayed beside the target application in a form of a popup window as shown in the right side of fig. 12.
In the embodiment of the application, by responding to the trigger operation of the user based on the target application, the target application is subjected to the file sorting operation based on the trigger operation. And in the process of file sorting operation, detecting the sorting progress of the target application, and displaying the sorting progress for a user so that the user can timely perceive the sorting progress. In the embodiment of the application, the user can self-adaptively select the corresponding target application to perform the file sorting operation and can check the sorting progress in time, so that the use experience of the user is improved.
The application also provides an intelligent terminal, which comprises a memory and a processor, wherein the memory is stored with a file sorting program, and the file sorting program is executed by the processor to realize the steps of the file sorting method in any embodiment.
The present application further provides a computer-readable storage medium, in which a filing program is stored, and when the filing program is executed by a processor, the steps of the filing method in any of the above embodiments are implemented.
In the embodiments of the intelligent terminal and the computer-readable storage medium provided in the present application, all technical features of any one of the embodiments of the XX method may be included, and the expanding and explaining contents of the specification are basically the same as those of the embodiments of the XX method, and are not described herein again.
Embodiments of the present application also provide a computer program product, which includes computer program code, when the computer program code runs on a computer, the computer is caused to execute the method in the above various possible embodiments.
Embodiments of the present application further provide a chip, which includes a memory and a processor, where the memory is used to store a computer program, and the processor is used to call and run the computer program from the memory, so that a device in which the chip is installed executes the method in the above various possible embodiments.
It is to be understood that the foregoing scenarios are only examples, and do not constitute a limitation on application scenarios of the technical solutions provided in the embodiments of the present application, and the technical solutions of the present application may also be applied to other scenarios. For example, as can be known by those skilled in the art, with the evolution of system architecture and the emergence of new service scenarios, the technical solution provided in the embodiments of the present application is also applicable to similar technical problems.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The units in the device in the embodiment of the application can be merged, divided and deleted according to actual needs.
In the present application, the same or similar term concepts, technical solutions and/or application scenario descriptions will be generally described only in detail at the first occurrence, and when the description is repeated later, the detailed description will not be repeated in general for brevity, and when understanding the technical solutions and the like of the present application, reference may be made to the related detailed description before the description for the same or similar term concepts, technical solutions and/or application scenario descriptions and the like which are not described in detail later.
In the present application, each embodiment is described with emphasis, and reference may be made to the description of other embodiments for parts that are not described or illustrated in any embodiment.
The technical features of the technical solution of the present application may be arbitrarily combined, and for brevity of description, all possible combinations of the technical features in the embodiments are not described, however, as long as there is no contradiction between the combinations of the technical features, the scope of the present application should be considered as being described in the present application.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as above, and includes several instructions for enabling an intelligent terminal (e.g., a mobile phone, a computer, a server, a controlled terminal, or a network device) to execute the method of each embodiment of the present application.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital subscriber line) or wirelessly (e.g., infrared, wireless, microwave, etc.). Computer-readable storage media can be any available media that can be accessed by a computer or a data storage device, such as a server, data center, etc., that includes one or more available media. The usable medium may be a magnetic medium (e.g., floppy Disk, memory Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
The above description is only a preferred embodiment of the present application, and not intended to limit the scope of the present application, and all modifications of equivalent structures and equivalent processes, which are made by the contents of the specification and the drawings of the present application, or which are directly or indirectly applied to other related technical fields, are included in the scope of the present application.

Claims (10)

1. A method of collating documents, the method comprising:
s10, acquiring a file to be sorted corresponding to the target application;
and S20, moving the file fragments corresponding to the files to be sorted to a target storage space, and/or performing garbage collection on a storage module according to the file fragments.
2. The method of claim 1, wherein the S20 comprises:
s21, acquiring a first logical address and/or a first physical address corresponding to the file fragment;
and S22, clearing the data in the storage block corresponding to the first logical address and/or the first physical address.
3. The method of claim 2, wherein the S22 comprises:
s221, marking the read-write unit corresponding to the first logical address and/or the first physical address as an invalid read-write unit, and copying data in other read-write units except the invalid read-write unit in the storage block into a preset read-write unit;
s222, clearing all data in the storage block.
4. The method of claim 1, wherein the S10 comprises:
s11, acquiring the time interval between the current time and the historical sorting time;
s12, when the time interval is larger than or equal to a preset time interval, acquiring the current state of the intelligent terminal;
and S13, when the current state meets a preset condition, executing the step of acquiring the file to be sorted of the target application.
5. The method of claim 4, wherein the preset condition comprises at least one of:
the current time is in a preset time period;
the current electric quantity of the intelligent terminal is greater than or equal to the preset electric quantity;
the intelligent terminal is in a charging state;
and the residual capacity of the storage space of the storage module of the intelligent terminal is greater than or equal to the preset capacity.
6. The method of claim 1, wherein the S10 comprises:
and S14, responding to the trigger operation aiming at the target application, and acquiring the file to be sorted corresponding to the target application according to the trigger operation.
7. The method of any of claims 1-6, wherein after S10, the method further comprises:
s30, acquiring the file size and/or storage area information of the file to be sorted;
s31, judging whether the fragmentation degree corresponding to the target application is larger than or equal to a degree threshold value according to the file size and/or the storage area information;
s32, when the fragmentation degree is larger than or equal to the degree threshold value, a step of moving the file fragments corresponding to the files to be sorted to a target storage space is executed.
8. The method of claim 7, wherein the method further comprises:
and S40, monitoring the arrangement progress corresponding to the target application, and outputting the arrangement progress in a preset mode.
9. An intelligent terminal, characterized in that, intelligent terminal includes: memory, a processor, wherein said memory has stored thereon a filer program which when executed by said processor implements the steps of the filer method of any of claims 1-8.
10. A readable storage medium, characterized in that the readable storage medium has stored thereon a computer program which, when being executed by a processor, carries out the steps of the method of filing according to any one of claims 1 to 8.
CN202111111235.4A 2021-09-18 2021-09-18 File sorting method, intelligent terminal and computer readable storage medium Pending CN115840736A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111111235.4A CN115840736A (en) 2021-09-18 2021-09-18 File sorting method, intelligent terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111111235.4A CN115840736A (en) 2021-09-18 2021-09-18 File sorting method, intelligent terminal and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN115840736A true CN115840736A (en) 2023-03-24

Family

ID=85574460

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111111235.4A Pending CN115840736A (en) 2021-09-18 2021-09-18 File sorting method, intelligent terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN115840736A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076337A (en) * 2023-10-17 2023-11-17 北京开源芯片研究院 Data transmission method and device, electronic equipment and readable storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117076337A (en) * 2023-10-17 2023-11-17 北京开源芯片研究院 Data transmission method and device, electronic equipment and readable storage medium
CN117076337B (en) * 2023-10-17 2024-02-02 北京开源芯片研究院 Data transmission method and device, electronic equipment and readable storage medium

Similar Documents

Publication Publication Date Title
EP3514684B1 (en) Memory recovery method and apparatus
CN107247746B (en) Data sharing method and terminal
CN107967322B (en) File classification display method, mobile terminal and computer readable storage medium
US9507451B2 (en) File selection method and terminal
CN107729125B (en) Management method for resident application program in background and mobile terminal
CN110377527B (en) Memory management method and related equipment
CN107480169B (en) Picture loading method, terminal and computer readable storage medium
CN111813493B (en) Method of operating component, terminal, and storage medium
CN113268298A (en) Application display method, mobile terminal and readable storage medium
CN112597115A (en) Container mirror image compression method and device, terminal equipment and medium
CN109445945B (en) Memory allocation method of application program, mobile terminal, server and storage medium
US11126546B2 (en) Garbage data scrubbing method, and device
CN115840736A (en) File sorting method, intelligent terminal and computer readable storage medium
CN109508300B (en) Disk fragment sorting method and device and computer readable storage medium
CN107766544B (en) Information management method, terminal and computer readable storage medium
CN115494997A (en) Information reading method, intelligent terminal and storage medium
CN114356159A (en) Display method, intelligent terminal and storage medium
CN114442886A (en) Data processing method, intelligent terminal and storage medium
CN113138857A (en) Memory cleaning method, mobile terminal and storage medium
CN109828704B (en) Electronic equipment control method, terminal and computer readable storage medium
CN114253687A (en) Multi-window leakage processing method and device and computer readable storage medium
CN107562317B (en) Display method and terminal
CN108196938B (en) Memory calling method, mobile terminal and computer readable storage medium
CN113094117A (en) Processing method, terminal and storage medium
CN108304268B (en) Memory optimization method, mobile terminal and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication