WO2024051654A1 - 文件处理方法及电子设备 - Google Patents
文件处理方法及电子设备 Download PDFInfo
- Publication number
- WO2024051654A1 WO2024051654A1 PCT/CN2023/116818 CN2023116818W WO2024051654A1 WO 2024051654 A1 WO2024051654 A1 WO 2024051654A1 CN 2023116818 W CN2023116818 W CN 2023116818W WO 2024051654 A1 WO2024051654 A1 WO 2024051654A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- value
- time
- duplicate
- moment
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
- G06F16/164—File meta data generation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/16—File or folder operations, e.g. details of user interfaces specifically adapted to file systems
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1734—Details of monitoring file system events, e.g. by the use of hooks, filter drivers, logs
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/1737—Details of further file system functions for reducing power consumption or coping with limited storage space, e.g. in mobile devices
Definitions
- This application relates to the field of terminal technology, and in particular to file processing methods and electronic devices.
- This application provides document processing methods and electronic equipment to efficiently manage documents.
- a file processing method is provided, which is applied to electronic equipment or components (such as chip systems) that support the functions of electronic equipment.
- the electronic equipment stores an indication field of the first file, and the initial value of the indication field is the first value, indicating that The field is modified by the electronic device to the second value when the first file is modified; the method includes:
- the value of the indication field of the first file at the second time it is determined whether the first file has been modified during the period from the first time to the second time.
- the mobile phone successfully modifies the value of the U field (an example of the indication field) of English Grammar 3 (an example of the first file) to V1 (an example of the third value), and at time t5 (an example of the second time), query the value of the U field.
- the mobile phone can determine whether English Grammar 3 has been modified during the period t1-t5 based on the value of the U field of English Grammar 3 at time t5.
- the modification status of the first file can be determined based on the value of the indication field of the first file, and then the first file can be managed accordingly based on the modification status of the first file.
- the electronic device does not need to continue to monitor the modification status of the first file from the first moment to the second moment, but can stop monitoring at other times other than the first moment and the second moment, so as to reduce the time required for the electronic device to monitor. LF.
- the electronic device may try to modify the value of the indication field of the first file to V1 through the first application. After the first moment, the electronic device may exit the first application.
- the electronic device opens the first application again, obtains the value of the indication field of the first file, and determines whether the first file has been modified between the first moment and the second moment based on the value of the indication field. It can be seen that in the embodiment of the present application, when the first application does not need to be resident, the electronic device can also determine whether the first file has been modified within a certain period of time, which can reduce the occupation of storage space.
- try to modify the value of the indicated field of the first file to a third value including:
- the value of the indication field is modified to the third value; under the first condition, the file system of the electronic device can detect the modification of the first file within the period from the first moment to the second moment. operate.
- the file system can ensure that it senses the modification and modifies the value of the indication field of the file to a non-V1 value (such as the second value V2). Subsequently, the electronic device can query the value of the indication field of the file. If the value of the indication field is modified to a value other than V1, the electronic device determines that the file was modified between the first moment and the second moment. On the contrary, if the value of the indication field The value is still V1, then it is determined that the file has not been modified from the first moment to the second moment.
- a non-V1 value such as the second value V2
- the method after the first moment, the method also includes:
- the value of the indication field of the first file at the second time is the second value, it is determined that the first file was modified during the period from the first time to the second time, or if the indication field of the first file is at the second time.
- the value at time is not the third value, then it is determined that the time from the first time to the Within the period of time 2, the first file is modified.
- judging whether the first file has been modified during the period from the first moment to the second moment is based on the value of the indication field of the first file at the second moment, including:
- the value of the indication field of the first file at the second time is the third value, it is determined that the first file has not been modified during the period from the first time to the second time, or if the indication field of the first file is at the third time. If the value at the second moment is not the second value, it is determined that the first file has not been modified during the period from the first moment to the second moment.
- the Mobile Butler application scans duplicate files (such as binary comparison) and before displaying the scan results to the user, at time t5, the Mobile Butler application queries the field value of the U field of the English Grammar 3 file and learns The field value is V1 (an example of the third value). Since the field value of the U field of English Grammar 3 at time t5 is the same as the field value at time t1, both are V1, the mobile butler application can determine that the file English Grammar 3 has not been modified between time t1 and time t5. Pass.
- trying to modify the value of the indication field of the first file to the third value includes: if the first condition is not met, not modifying the indication field to the third value;
- the method further includes: when the value of the indication field of the first file cannot be successfully modified to the third value, determining that the first file is modified within the period from the first moment to the second moment.
- the mobile phone has performed a write memory operation for computer technology 1 in the candidate duplicate file
- the preliminary screening of duplicate files is completed, at time t1, because the first condition is not met
- the mobile phone The housekeeper application cannot successfully modify the value of the U field of Computer Technology 1 to V1 (the value of the U field is still V0).
- the mobile butler application treats computer technology 1 as a modified file (no longer a duplicate file) and will no longer perform deduplication on computer technology 1 to avoid mistaken deduplication.
- the first condition includes one or more of the following conditions: before the first moment, the first file is not mapped to the memory; before the first moment, the first file is mapped to the memory, but The electronic device has not performed a write operation to the memory.
- the file system can determine that the file is modified based on at least the first memory write operation between the first moment and the second moment, and accordingly modify the value of the U field of the file to V2.
- the application can query the value of the U field of the file, and determine whether the file has been modified between the first moment and the second moment based on the value of the U field.
- the file system does not need to detect every write memory operation. Even if the file system misses the detection of write memory operations, the file system can still determine the file based on at least the first write memory operation detected within a period of time. has been modified. In this way, the detection accuracy of electronic equipment can be improved.
- the electronic device can modify the value of the U field of the file to V1 at the first moment. Subsequently, once the file is modified between the first moment and the second moment, the U field value of the file will be modified by the file system to a non-V1 value (such as V2). The electronic device can determine the location of the file based on the U field value of the file. Whether it was modified between the first moment and the second moment.
- the approach also includes:
- the duplicate files include a first file and a second file; the first file is stored in the first storage space, and the second file is stored in the second storage space;
- the first interface includes information about the first file and information about the second file.
- English Grammar 1-4 is scanned and obtained as a set of duplicate files. These four duplicate files are stored in storage spaces 1-4 respectively. If it is determined that English Grammar 2 was modified between the first moment and the second moment, English Grammar 1, 3, 4 from the first moment to the second moment If it has not been modified during this period, it means that English Grammar 1, 3, and 4 still constitute duplicate files. As shown in (c) of Figure 10A, the mobile phone can display a first interface 906.
- the first interface 906 includes information on a group of repeated files of English Grammar 1, 3, and 4.
- a first operation input by the user in the first interface is detected
- the mobile phone after detecting the user's operation of clicking the compression button 907 (an example of the first operation), the mobile phone performs compression on a set of duplicate files (English grammar 1, 3, 4) selected by the user.
- the following English grammars 1, 3, and 4 point to the same storage space. In this way, storage space can be freed up.
- the method further includes:
- the identification of the first file and the identification of the second file are stored.
- the electronic device stores the identification of duplicate files in the duplicate file information database.
- the identification of the first file includes the first index node number of the first file; the identification of the second file includes the second index node number of the second file.
- the phone can learn that the first file and the second file are historically duplicate files based on the identifiers of the stored duplicate files.
- the mobile phone can query the values of the U fields of the first file and the second file to determine whether the first file and the second file still constitute duplicate files.
- the mobile phone does not need to rescan the contents of the first file and the second file, which helps reduce the operating consumption of the mobile phone.
- judging whether the first file has been modified during the period from the first moment to the second moment is based on the value of the indication field of the first file at the second moment, including:
- the value of the indication field of the first file at the second time is the third value, and the index node number of the first file is the first index node number, it is determined that within the period from the first time to the second time, the first file Not modified.
- the second aspect provides a file processing method that is applied to electronic equipment or components that support the functions of electronic equipment (such as chip systems).
- the method includes:
- Display a second interface which includes multiple duplicate files in the scanned electronic device; the multiple duplicate files are respectively stored in multiple storage spaces of the electronic device;
- the indication field of each duplicate file in the plurality of duplicate files is obtained, and the value of the indication field of the duplicate file is used to indicate whether the duplicate file has been modified;
- the mobile phone displays an interface 906 (an example of the second interface).
- the interface 906 includes multiple duplicate files obtained by scanning (the group of duplicate files of English Grammar 1, 3, and 4, and the computer 2, 3 this set of duplicate files).
- the mobile phone obtains the indication fields of the set of repeated files of English Grammar 1, 3, and 4 selected by the user, and according to the respective indication fields of English Grammar 1, 3, and 4 At the third time value, some files in English Grammar 1, 3, and 4 are compressed into the same storage space.
- the indication fields of duplicate files in the second interface can be obtained according to the user's operation, and some duplicate files can be compressed according to the indication fields of each duplicate file.
- it can release the storage space of the electronic device, and on the other hand, it can free up the storage space of the electronic device.
- it instead of compressing all the duplicate files selected by the user, it verifies whether the duplicate files really need to be compressed based on the value of the indication field of the duplicate files selected by the user, so as to reduce the probability of mistaken compression and avoid mistaken compression. Affect the normal operation of electronic equipment. It can be seen that this solution can achieve accurate file compression, thereby accurately releasing the storage space of electronic devices. Moreover, it can effectively avoid the problem of mistaken deduplication caused by other processes modifying duplicate files before deduplication is performed, and the deduplication program does not sense that the duplicate files have been modified.
- the initial value of the indication field of each duplicate file is the first value.
- the method before displaying the second interface, the method also includes:
- a plurality of candidate duplicate files are compared to determine a plurality of duplicate files from the plurality of candidate duplicate files.
- the scan yields multiple candidate duplicate files, including:
- the user's operation on the first control is detected, and multiple candidate duplicate files are scanned and obtained.
- the mobile phone displays an interface 901 (an example of the third interface), and the interface 901 includes a cleaning acceleration button 902 (a first control). It is detected that the user clicks the cleanup acceleration button 902.
- the mobile phone scans and obtains multiple candidate duplicate files (such as English Grammar 1-5 shown in Figure 10B), and obtains multiple duplicate files based on the multiple candidate duplicate files (such as the English grammar shown in Figure 10B). English Grammar 1-4).
- the scan yields multiple candidate duplicate files, including:
- the electronic device When the electronic device is idle, multiple candidate duplicate files are scanned. For example, the electronic device performs scanning at night, or performs scanning after the screen is locked for a certain period of time.
- the method after the first moment, the method also includes:
- the second interface When the third condition is met, the second interface is displayed; the third condition includes: the value of the indication field of at least one duplicate file at the second moment is the third value, and the index node number of at least one duplicate file is the same as the one stored in the database. The index node numbers are consistent.
- the mobile phone queries the value of the U field (indicator field) of English Grammar 1-4, where the value of the U field of English Grammar 2 is V0 ( Not V1), the values of the U fields of English Grammar 1, 3, and 4 are all V1, then the mobile phone can determine that English Grammar 1, 3, and 4 have not been modified during the period t1-t5.
- the mobile phone can display the information of English grammar 1, 3, and 4 on the interface 906 (second interface) as shown in (c) of Figure 10A.
- an attempt is made to modify the value of the indicated field of each of the multiple candidate duplicate files to a third value, including:
- the value of the indication field of the at least one candidate duplicate file is modified to a third value; under the first condition, the file system of the electronic device can detect During the period from the first moment to the second moment, the modification operation of the file is repeated for at least one candidate.
- obtaining the value of the indicator field of at least one duplicate file includes: at the second moment, obtaining the value of the indicator field of the target duplicate file in the at least one duplicate file as a third value. ;
- the method further includes: when the value of the indication field of the target duplicate file at the second moment is a third value, determining that the target duplicate file has not been modified during the period from the first moment to the second moment.
- the plurality of candidate duplicate files includes a third file
- the method further includes: detecting that the third file is modified, and modifying the value of the indication field of the third file to the second value;
- the plurality of candidate duplicate files includes a fourth file
- the method also includes: when the value of the indication field of the fourth file cannot be successfully modified to the third value, determining that the fourth file is modified within the period from the first moment to the second moment.
- some of the duplicate files among the multiple duplicate files are compressed into the same storage space based on the value of the indicator field of the multiple duplicate files at the third moment, including:
- the value of the indication field of the first file among the plurality of duplicate files at the third time is not the third value, compression is not performed on the first file.
- the value of the indication field of the first file among the multiple duplicate files at the third moment is the third value, then perform compression on the first file;
- the value of the indication field of the first file among the plurality of duplicate files at the third time is not the third value, compression is not performed on the first file.
- the mobile phone manager application queries each duplicate file again (English Grammar 1, 3, 4, Computer Technology 1, 2) The value of the U field. It is judged that the value of the U field of English Grammar 3 was successfully set to V1 at time t1, but the value of the U field at time t9 was V0. Then the Mobile Butler application can determine that the value of English Grammar 3 during the period from time t1 to time t9 has been modified. In the same way, the Mobile Manager application determines whether other duplicate files have been modified between t1 and t9.
- the approach also includes:
- the information of multiple duplicate files is stored in the database.
- the information of the duplicate files includes any one or more of the following information: the index node number of the duplicate file, the path of the duplicate file, and the name of the duplicate file.
- the value of the indication field of the target duplicate file at the second moment is the third value, it is determined that the target duplicate file has not been modified during the period from the first moment to the second moment, including :
- the value of the indication field of the target duplicate file is the third value, if the index node number of the target duplicate file does not change, it is determined that the target duplicate file has not been modified during the period from the first moment to the second moment.
- a file processing device which is applied to electronic equipment or chip systems.
- the electronic equipment stores an indication field of the first file.
- the initial value of the indication field is the first value.
- the indication field When the first file is modified, it is modified to the second value by the electronic device; the device includes:
- Processing module for:
- the value of the indication field of the first file at the second time it is determined whether the first file has been modified during the period from the first time to the second time.
- try to modify the value of the indicated field of the first file to a third value including:
- the value of the indication field is modified to the third value; under the first condition, the file system of the electronic device can detect the modification of the first file within the period from the first moment to the second moment. operate.
- the processing module is also configured to detect that the first file is modified after the first moment, and modify the value of the indication field of the first file to the second value.
- the value of the indication field of the first file at the second time is the second value, it is determined that the first file was modified during the period from the first time to the second time.
- judging whether the first file has been modified during the period from the first moment to the second moment is based on the value of the indication field of the first file at the second moment, including:
- the value of the indication field of the first file at the second time is the third value, it is determined that the first file has not been modified during the period from the first time to the second time.
- trying to modify the value of the indication field of the first file to the third value includes: if the first condition is not met, not modifying the indication field to the third value;
- the processing module is also configured to determine that the first file is modified within the period from the first moment to the second moment when the value of the indication field of the first file cannot be successfully modified to the third value.
- the first condition includes one or more of the following conditions: before the first moment, the first file is not mapped to the memory; before the first moment, the first file is mapped to the memory, but The electronic device has not performed a write operation to the memory.
- the processing module is also used to:
- the duplicate files include a first file and a second file; the first file is stored in the first storage space, and the second file is stored in the second storage space;
- the device also includes a display module, which is used to display a first interface; the first interface includes information on the first file and information on the second file.
- the device further includes an input module configured to detect the first operation input by the user in the first interface;
- the processing module is configured to compress the first file and the second file into the same storage space according to the first operation detected by the input module.
- the device also includes a storage module.
- the storage module is configured to store the identification of the first file and the identification of the second file after scanning the electronic device for duplicate files.
- the identification of the first file includes the first index node number of the first file; the identification of the second file includes the second index node number of the second file.
- judging whether the first file has been modified during the period from the first moment to the second moment is based on the value of the indication field of the first file at the second moment, including:
- the value of the indication field of the first file at the second time is the third value, and the index node number of the first file is the first index node number, it is determined that within the period from the first time to the second time, the first file Not modified.
- a file processing device which is applied to electronic equipment or chip systems.
- the device includes:
- a display module configured to display a second interface.
- the second interface includes multiple duplicate files in the scanned electronic device; the multiple duplicate files are respectively stored in multiple storage spaces of the electronic device;
- a processing module configured to respond to an operation input by the user on the second interface and, at the third moment, obtain an indication field of each of the multiple duplicate files.
- the value of the indication field of the duplicate file is used to indicate whether the duplicate file is Revise;
- the processing module is also configured to compress some of the multiple duplicate files into the same storage space based on the value of the indication field of the multiple duplicate files at the third moment.
- the initial value of the indication field of each duplicate file is the first value.
- the processing module is also used to scan and obtain multiple candidate duplicate files before displaying the second interface; the multiple candidate duplicate files include multiple duplicate files;
- the processing module is also configured to, at the first moment, attempt to modify the value of the indication field of each candidate duplicate file in the plurality of candidate duplicate files to a third value.
- the scan yields multiple candidate duplicate files, including:
- the display module is controlled to display a third interface, and the third interface includes the first control;
- the user's operation on the first control is detected, and multiple candidate duplicate files are scanned and obtained.
- the scan yields multiple candidate duplicate files, including:
- the processing module is also used to obtain the value of the indication field of at least one duplicate file at the second moment after the first moment;
- the display module is also configured to display a second interface according to the value of the indication field of at least one duplicate file at the second moment; the plurality of duplicate files in the second interface have modified statuses within the period from the first moment to the second moment. are unmodified files.
- an attempt is made to modify the value of the indicated field of each of the multiple candidate duplicate files to a third value, including:
- the value of the indication field of the at least one candidate duplicate file is modified to a third value; under the first condition, the file system of the electronic device can detect During the period from the first moment to the second moment, the modification operation of the file is repeated for at least one candidate.
- obtaining the value of the indicator field of at least one duplicate file includes: at the second moment, obtaining the value of the indicator field of the target duplicate file in the at least one duplicate file as a third value. ;
- the processing module is also configured to determine that the target duplicate file has not been modified during the period from the first moment to the second moment when the value of the indication field of the target duplicate file at the second moment is a third value.
- the plurality of candidate duplicate files includes a third file
- Processing module also used for:
- the plurality of candidate duplicate files includes a fourth file
- the processing module is also configured to determine that the fourth file is modified within the period from the first moment to the second moment when the value of the indication field of the fourth file cannot be successfully modified to the third value.
- some of the duplicate files among the multiple duplicate files are compressed into the same storage space based on the value of the indicator field of the multiple duplicate files at the third moment, including:
- the value of the indication field of the first file among the plurality of duplicate files at the third time is not the third value, compression is not performed on the first file.
- the storage module is used to store identifications of multiple duplicate files, and the identifications of the duplicate files include index node numbers of the duplicate files.
- the value of the indication field of the target duplicate file at the second moment is the third value, it is determined that the target duplicate file has not been modified during the period from the first moment to the second moment, including :
- the value of the indication field of the target duplicate file is the third value, if the index node number of the target duplicate file does not change, it is determined that the target duplicate file has not been modified during the period from the first moment to the second moment.
- the indication field is stored in the metadata area of the electronic device.
- the identification of the first file includes the first index node number of the first file; the identification of the second file includes the second index node number of the second file.
- the first condition includes one or more of the following conditions: before the first moment, the duplicate file is not mapped to the memory; before the first moment, the duplicate file is mapped to memory, but the electronic device has not performed a write operation to the memory.
- Figure 1A is an example diagram of a repetitive file scanning process provided by an embodiment of the present application.
- Figure 1B is an example diagram of the i-mtime field provided by the embodiment of the present application.
- Figure 2 is a schematic diagram of a write operation in a write interface mode provided by an embodiment of the present application
- Figure 3 is a schematic diagram of a write operation in a memory write mode provided by an embodiment of the present application.
- FIGS. 4 and 5 are additional schematic diagrams of write operations provided by embodiments of the present application.
- Figure 6 is a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
- Figure 7 is a schematic diagram of the software structure of the electronic device provided by the embodiment of the present application.
- Figure 8 is a schematic diagram of the data area and metadata area provided by the embodiment of the present application.
- Figure 9 is a schematic diagram of a file processing method provided by an embodiment of the present application.
- Figure 10A is a schematic diagram of the interface provided by an embodiment of the present application.
- FIGS. 10B and Figure 10C are schematic diagrams of scenarios provided by embodiments of the present application.
- Figure 11 is a schematic diagram of the database provided by the embodiment of the present application.
- Figure 12 is a schematic diagram of a scene in which a file provided by the embodiment of the present application is modified
- Figure 13 is a schematic diagram of a scenario where the files provided by the embodiment of the present application have not been modified
- Figure 14 is a schematic diagram of the interface provided by the embodiment of the present application.
- Figure 15 is a schematic diagram of a scenario where V1 setting fails provided by the embodiment of the present application.
- Figure 16 is a schematic diagram of a scene in which a file provided by the embodiment of the present application is modified
- Figure 17 is a schematic diagram of a scenario where the files provided by the embodiment of the present application have not been modified
- Figure 18 is a schematic diagram of a scenario where V1 setting fails provided by the embodiment of the present application.
- Figure 19 is a schematic diagram of a scene provided by an embodiment of the present application.
- Figure 20 is a schematic diagram of the interface provided by the embodiment of the present application.
- Figures 21 and 22 are schematic structural diagrams of the device provided by the embodiment of the present application.
- Duplicate files are files with exactly the same content. For example, as shown in Figure 1A, file 1 and file 2 constitute duplicate files. Before deduplication, file 1 and file 2 occupy storage space 1 and storage space 2 respectively. After the electronic device performs deduplication on File 1 and File 2, File 1 and File 2 point to the same storage space 1, which greatly frees up the storage space of the electronic device. In some scenarios, electronic devices can scan stored duplicate files. Scanning for duplicate files may include preliminary screening and binary comparison.
- the electronic device intercepts part of the content in the file and obtains a value by reading the part of the content. If the value of the excerpted content of two files is the same, the electronic device initially thinks that the two files may be duplicate files. Afterwards, the electronic device performs a binary comparison on the two files and compares the entire contents of the two files byte by byte. When the results of the binary comparison are consistent, it means that the two files are duplicate files.
- binary comparison can also be replaced by other steps for determining duplicate files, such as hash value comparison.
- the embodiments of this application do not limit the specific implementation of the scanning process for duplicate files.
- the modification status of the file can be divided into two types: one is modified within a period of time, and the other is not modified within a period of time.
- the electronic device can set the i-mtime field, which can be used to indicate the time when the file was last modified.
- the i-mtime field can usually be stored in the file system's metadata area.
- the i-mtime field can store the index node (inode) area of the metadata area.
- file 1 has been modified three times in history, and the modification times are 2022-8-22 (8:00), 2022-8-23 (10:00), and 2022-8-23 (18:00).
- the field value of the i-mtime field of file 1 can be 2022-8-23 (18:00).
- file 2 has been modified twice in history, and the modification times were 2022-8-22 (18:00) and 2022-8-23 (10:00).
- i of file 2 The field value of the -mtime field can be 2022-8-23 (10:00).
- an application in an electronic device can learn whether the file has been modified within a period of time by querying the i-mtime field of the file.
- the application queries the i-mtime field of the file at time point 1 and time point 2 respectively. If the field values of the i-mtime field in the two queries are consistent, it means that the period from time point 1 to time point 2 is the same. The internal files have not been modified. On the contrary, if the field values of the i-mtime field in the two queries are inconsistent, it means that the file has been modified between time point 1 and time point 2.
- the application queries the i-mtime field of file 1 at 10:00 and learns that the last modified time of file 1 was 8:00.
- the application queries the file again at 12:00.
- the i-mtime field of 1 indicates that the last modified time of file 1 is 8:00.
- the field values obtained by the two queries (used to indicate the time when the file was last modified) are the same, and the application can determine that file 1 has not been modified between 10:00 and 12:00.
- the application queries the i-mtime field of file 1 at 10:00 and learns that the last modified time of file 1 is 8:00.
- the application queries again at 12:00.
- the i-mtime field of file 1 indicates that the last modified time of file 1 is 11:00.
- the field values obtained by the two queries are different, and the application can determine that file 1 was modified between 10:00 and 12:00.
- each write operation will execute a piece of code in the file system.
- the file system can modify the i-mtime field of the file to record the time when the file was last modified. For example, as shown in Figure 2, when calling the write interface to modify file 1 at time t1 (10:00), the electronic device will execute the code in the file system, and the file system can modify the i-mtime field of file 1 to identify File 1 was last modified at 10:00. Similarly, when calling the write interface to modify file 1 at time t2 (12:00), the electronic device will execute the code in the file system. The file system can modify the i-mtime field of file 1 to identify the last time file 1 was The modified time is 12:00.
- electronic devices can map files to a certain memory through the mmap interface. Subsequently, when writing a file, the file can be written by writing to the memory.
- Writing memory can be understood as writing content into the memory mapped by the file, which is equivalent to writing to the corresponding file indirectly.
- the relevant code in the file system will be executed. In some examples, it may be possible to no longer execute code in the file system when writing to the same memory later, to avoid being trapped in the file system and incurring additional overhead.
- the electronic device maps file 2 to memory 2 .
- the electronic device writes to memory 2 for the first time through the mmap interface.
- the electronic device executes the relevant code in the file system to write to memory 2. Therefore, the file system can sense that file 2 associated with memory 2 has been modified, and modify the i-mtime field of file 2 accordingly to identify the time when file 2 was last modified as 10:00.
- the electronic device maps the file to a certain piece of memory.
- the electronic device writes content into the memory, which is equivalent to writing the corresponding content into the memory-mapped file. Since this write is the first write to the memory, the relevant code in the file system will be executed.
- the file system can sense that the file has been modified and modify the i-mtime field of the file to identify the last time the file was The modified time is 10:05.
- an application in the electronic device queries the i-mtime field of the file.
- the electronic device writes content to the same memory for the second time, and in order to frequently get stuck in the file system, the electronic device does not get stuck in the code in the file system when writing the memory this time. Therefore, the file system cannot detect that the file associated with the memory has been modified, and accordingly the i-mtime field of the file is not modified.
- the application queries the i-mtime field of the file again. Since the field values of the i-mtime field queried at t5 and t3 are both 10:05, the electronic device mistakenly believes that the file has not been modified during the t3-t5 period (that is, between 10:05-10:07).
- the electronic device when performing a write operation through mmap, the electronic device will not be trapped in the file system, causing the file system to be unable to detect that the file has been modified, unable to track the modification of the file, and unable to update the field value of the i-mtime field in a timely manner, causing the electronic device to fail.
- the device misjudges whether the file has been modified.
- the modification status of the file may be misjudged. For example, as shown in Figure 5, at time t1 (10:00), the file is modified. Later, at time t2, an application in the electronic device queries the i-mtime field of the file and learns that the last modified time of the file is 10:00. At time t3, the system time of the electronic device is modified, for example, from 10:30 to 9:30. After that, at time t4 (10:00 after modifying the system time), the file is modified again. At time t5, the application queries the i-mtime field of the file again. Since the field values of the i-mtime field queried at t5 and t3 are both 10:00, the electronic device mistakenly believes that the file has not been modified during the t3-t5 period (that is, between 10:05-12:00).
- the system time can be modified by the user or automatically by the system.
- the system time may be the same when the file is modified twice, which will cause the electronic device to misjudge whether the file has been modified, which cannot meet the business needs of the electronic device to accurately determine whether the file has been modified. That is, the modification status of the file cannot be reliably judged, and the performance of the electronic device is low.
- the application can notify the file system through the inotify interface that it needs to monitor the modification status of the file. Subsequently, the file system monitors the event that the file has been modified and will notify the application that the file has been modified.
- This method requires the application to run permanently during the period of time that needs to be monitored, occupying more system resources (such as memory resources), and the cost of electronic equipment is relatively large.
- FIG. 6 shows a schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present application.
- the electronic device 200 includes at least one processor 201, a memory 202 and at least one transceiver 203.
- the processor 201 can be a general central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more processors used to control the execution of the program of the present application. integrated circuit.
- CPU central processing unit
- ASIC application-specific integrated circuit
- Communication lines may be included between the above-mentioned components for transmitting information between the above-mentioned components.
- the transceiver may be a module, a circuit, a bus, an interface, or other device that can implement communication functions and is used to communicate with other devices.
- the transceiver can be an independently configured transmitter, and the transmitter can be used to send information to other devices.
- the transceiver can also be an independently configured receiver, and can be used to receive information from other devices.
- the transceiver may also be a component that integrates the functions of sending and receiving information. The embodiments of this application do not limit the specific implementation of the transceiver.
- Memory 202 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (random access memory (RAM)) or other type that can store information and instructions.
- a dynamic storage device can also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disk storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be used by a computer Any other medium for access, but not limited to this.
- the memory can exist independently and be connected to the processor through communication lines. Memory can also be integrated with the processor.
- the memory 202 is used to store computer execution instructions for implementing the solution of the present application, and is controlled by the processor 201 for execution.
- the processor 201 is used to execute computer execution instructions stored in the memory 202, thereby implementing various methods provided by the following embodiments of the application.
- the computer execution instructions in the embodiments of the present application may also be called application codes, instructions, computer programs or other names, which are not specifically limited in the embodiments of the present application.
- the processor 201 may include one or more CPUs.
- the electronic device 200 may include multiple processors. Each of these processors may be a single-CPU processor or a multi-CPU processor.
- a processor here may refer to one or more devices, circuits, and/or processing cores for processing data (eg, computer program instructions).
- Figure 6 shows an exemplary structural diagram of an electronic device. It should be understood that the illustrated electronic device is only an example, and in actual applications the electronic device may have more or fewer components than shown in Figure 6, and two or more components may be combined. Or could have different component configurations.
- Software systems of electronic devices can adopt layered architecture, event-driven architecture, microkernel architecture, microservice architecture, or cloud architecture.
- the software system of the electronic device may be system etc.
- the embodiment of the present invention takes the Android system with a layered architecture as an example to illustrate the software structure of the electronic device.
- Figure 7 is a software structure block diagram of an electronic device according to an embodiment of the present invention.
- the layered architecture divides the software into several layers, and each layer has clear roles and division of labor.
- the layers communicate through software interfaces.
- the Android system is divided into five layers, from top to bottom: application layer (referred to as application layer), application framework layer (referred to as framework layer), Android runtime (Android runtime) and system library. Hardware Abstraction Layer (HAL) and kernel layer.
- application layer referred to as application layer
- framework layer application framework layer
- Android runtime Android runtime
- HAL Hardware Abstraction Layer
- kernel layer kernel layer.
- the application layer can include a series of application packages. As shown in Figure 7, the application package can include camera, gallery, calendar, call, map, navigation, wireless local area network (WLAN), Bluetooth, music, video, short message and other applications.
- the application package can include camera, gallery, calendar, call, map, navigation, wireless local area network (WLAN), Bluetooth, music, video, short message and other applications.
- WLAN wireless local area network
- the application program may also include settings, mobile phone manager and other applications.
- the Mobile Butler application can call the interface provided by the file system to modify the field value of the U field of the corresponding file. Subsequently, the Mobile Butler application can determine whether the corresponding file has been modified within a period of time based on the field value of the U field.
- the application can determine the value of the U field through at least one of the following methods.
- the first method the application program can call the first interface provided by the file system, and the first interface returns the U field value of the file.
- the second method the application calls the second interface provided by the file system.
- the file system determines the U field value of the file during execution, and determines whether to continue executing the remaining steps of the second interface based on the U field value.
- the above application can be an application running in user mode.
- API application programming interface
- the framework layer provides APIs and programming frameworks for applications in the application layer.
- the framework layer includes some predefined functions.
- the framework layer can include activity manager, window manager, content provider, view system, phone manager, resource manager, notification manager, etc.
- the activity manager is responsible for the startup of all APP processes, the startup of the four major components of the APP (such as activity, service, broadcast receiver, content provider), the interface between APPs and within the APP. switching and the life cycle of various components.
- a window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, capture the screen, etc.
- Content providers are used to store and retrieve data and make this data accessible to applications. Said data can include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
- the view system includes visual controls, such as controls that display text, controls that display pictures, etc.
- a view system can be used to build applications.
- the display interface can be composed of one or more views.
- a display interface including a text message notification icon may include a view for displaying text and a view for displaying pictures.
- Telephone managers are used to provide communication functions of electronic devices. For example, call status management (including connected, hung up, etc.).
- the resource manager provides various resources to applications, such as localized strings, icons, pictures, layout files, video files, etc.
- the notification manager allows applications to display notification information in the status bar, which can be used to convey notification-type messages and can automatically disappear after a short stay without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc.
- the notification manager can also be notifications that appear in the status bar at the top of the system in the form of charts or scroll bar text, such as notifications for applications running in the background, or notifications that appear on the screen in the form of conversation windows. For example, text information is prompted in the status bar, a beep sounds, the electronic device vibrates, the indicator light flashes, etc.
- Android Runtime is responsible for the scheduling and management of the Android system.
- System libraries can include multiple functional modules. For example: surface manager (surface manager), media libraries (Media Libraries), 3D graphics processing libraries (for example: OpenGL ES), 2D graphics engines (for example: SGL), etc.
- the surface manager is used to manage the display subsystem and provides the integration of 2D and 3D layers for multiple applications.
- the media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc.
- the media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
- the 3D graphics processing library is used to implement 3D graphics drawing, image rendering, composition, and layer processing.
- 2D Graphics Engine is a drawing engine for 2D drawing.
- the kernel layer is the layer between hardware and software.
- the kernel layer may include a file system.
- the file system is the core module of the operating system kernel, which is one of the main components.
- the file system is responsible for managing and storing file information, mainly creating files for users, saving, reading, modifying, and dumping files, controlling file access, and revoking files when users no longer use them.
- the file system may run in kernel mode.
- API application programming interface
- Metadata in the file system can include metadata as well as data.
- metadata is used to describe the characteristics and attributes of files.
- metadata includes but is not limited to the following information: file system control information, data structure, file description information, such as file length, file type, etc.
- File types are, for example, regular files (regular inode), directory files (directory inode), soft links (symbol link inode), special files (special inode), etc.
- the file's metadata and data can be stored on a storage device (such as a hard disk).
- a storage device such as a hard disk.
- the storage of storage devices Areas may include metadata areas as well as data areas.
- the data of the file can be stored in the data area of the storage device.
- the data stored in the data area may be data obtained by file-level compression based on lossless compression technology.
- the data in the data area is stored as a collection of disk blocks in the physical storage space of the storage medium (such as a disk, flash memory, etc.). Among them, the data of the same file can be stored in consecutive disk blocks, or it can also be interleaved and stored in discontinuous disk blocks.
- Disk blocks can be used to represent small physical storage spaces obtained by dividing the physical storage space of the storage medium.
- the data storage location can be represented by the index of the block where the data is located.
- files are stored in blocks 909, 912, and 914.
- the metadata area can store the block index 909, 912, 914 of the file.
- the electronic device can read the index of the block where the file is located from the metadata area, and access (such as read) the file at the location of the corresponding block based on the index.
- a file system may provide an interface for user-mode programs to read and write files.
- the file system provides read and write interfaces (for example: read, write), and user-mode programs call the read and write interfaces to read and write files.
- the file system provides a memory mapping interface (for example: mmap).
- the user-mode program calls the memory mapping interface to map the file to the memory and obtain the mapped memory address. After that, the user-mode program can access the file through memory access, for example, writing the file by writing to the memory.
- the file system since each file access operation calls an interface provided by the file system, the file system can be aware of each file access operation.
- the file system can add an unmodified field (which can be referred to as the U field) in the metadata area, and the U field can indicate whether the corresponding file has been modified.
- U field can indicate whether the corresponding file has been modified.
- Each file has a corresponding U field.
- the file system can set the initial value of the U field.
- the initial value is set to V0.
- the file system can provide an interface to the application program, and the application program can call the interface to modify the field value of the U field (for example, modify it to V1). Subsequently, the application can determine whether the corresponding file has been modified based on the field value of the U field.
- the technical solution of the embodiment of the present application may include the following steps:
- the file system sets the value of the U field of the first file to V0.
- the U field can be saved in the metadata area of the file system.
- the mobile phone displays an interface 901 of the mobile phone manager application, and the interface 901 may include a "cleanup acceleration" button 902 .
- the mobile phone can scan the data stored in the mobile phone to be cleaned.
- the data to be cleaned can include multiple duplicate files, that is, multiple files with exactly the same content.
- the Mobile Butler application calls the interface of the file system to try to modify the field value of the U field corresponding to the multiple duplicate files from the initial value V0 to V1.
- the process of scanning for duplicate files may include preliminary screening and binary comparison. After the mobile butler application obtains files initially identified as duplicate files (can be referred to as candidate duplicate files) through preliminary screening, it can call the file system interface before binary comparison and try to change the value of the U field of each candidate duplicate file to V1. .
- the mobile phone can perform a preliminary screening of duplicate files.
- English Grammar 1-4 is initially identified as a set of candidate duplicate files, and the computer Techniques 1 and 2 are a set of candidate duplicate files. Take the example of trying to change the U field value of English Grammar 2 in candidate duplicate files to V1.
- the mobile phone performs the initial screening of duplicate files, at time t 1 (the first moment), the mobile butler application Call the file system interface and try to change the field value of the U field corresponding to English Grammar 2 from V0 to V1.
- the Mobile Butler application can successfully convert the U word of English Grammar 2 The value of the segment is modified from V0 to V1.
- the mobile phone manager application can try to modify the value of the U field of other candidate duplicate files (that is, files initially identified as duplicate files) to V1.
- the application when the application wants to set the U field of the first file to V1, it can call the interface of the file system to send a request message to the file system.
- the request message is used to request that the U field of the first file be set to V1.
- the initial value is modified to V1.
- V1 can be specified by the application or by the file system.
- the file system determines whether the first condition for modifying the value of the U field of the file is met. When the first condition is met, the file system may modify the value of the U field of the first file. The value is changed to V1. On the contrary, when the first condition is not met, the file system does not modify the value of the U field of the first file to V1.
- the first condition includes: whether the file has been mapped to memory (for example, the application has used mmap() to map the file).
- the mobile phone before time t1, the mobile phone has mapped the file Computer Technology 1 into the memory. If the first condition is not met, then at time t1, the mobile phone manager application will not successfully map the U field of Computer Technology 1. The field value is modified from V0 to V1.
- Figure 10B shows some candidate duplicate files obtained through preliminary screening.
- the Mobile Butler application initially identified English Grammar 1-5 as a group of candidate duplicate files, and Computer Technology 1-4 as a group of candidate duplicate files.
- the mobile phone manager application can call the interface of the file system to try to modify the value of the U field of each candidate duplicate file to V1.
- Table 2 shows the field values of the U field of each candidate duplicate file after time t1.
- the field value of the U field of Computer Technology 1 is still the initial value V0.
- the mobile phone has mapped the file Computer Technology 1 into the memory.
- the field values of the U fields of other files, such as English Grammar 1-4 and Computer Technology 2 were modified to V1 by the mobile phone manager application, indicating that the mobile phone did not map these files to memory before time t1.
- the file system when the first condition is met, the file system returns a successful setting message to the application program, and the application program can determine based on this that the value of the U field of the file has been modified to V1.
- the file system returns a setting failure message to the application program, and the application program can determine based on this that the value of the U field of the file is not set to V1 (is still V0).
- users can modify files.
- the mobile phone has not performed a memory write operation for English Grammar 2.
- the mobile phone writes the memory for English Grammar 2 for the first time.
- the file system can sense that English Grammar 2 has been modified, and modify the U field of English Grammar 2 from V1 to V2.
- the file system can also store the modification time of the file in the metadata area.
- the file system can store t3 in the metadata area.
- the application can determine the modification time of the file based on the modification time stored in the metadata area.
- step S104 The application determines whether the value of the U field of the first file is successfully set to V1. If the value of the U field of the first file is set to V1, the following steps S106-S110 are performed. If the value of the U field of the first file is not set to V1, step S111 is executed.
- the application program may receive a return message from the file system, the return message being used to indicate whether the value of the U field of the first file is successfully set to V1.
- the application successfully sets the value of the U field of a duplicate file to V1, which means that the mobile phone did not map the file to memory before time t1.
- the subsequent mobile phone can map the file to the memory, and if the memory writing method is used, If the file is modified in this way, the mobile phone will definitely execute the relevant code in the file system when the file is written to the memory for the first time.
- the file system can sense that the file has been modified and modify the value of the U field of the file (for example, from V1 to V2).
- the mobile phone can determine that the file has been modified based on the value of the U field (V2) of the file.
- the mobile phone does not subsequently modify the file, the value of the U field of the file will still be V1.
- the mobile phone can determine that the file has not been modified based on the value of the U field (V1) of the file.
- V2 and V1 are different.
- V2 may be equal to V0.
- the phone will also execute the relevant code of the file system every time it writes.
- the file system can still sense that the file has been modified and modify the value of the U field of the file. (V2).
- the mobile phone does not subsequently modify the file, the value of the U field of the file will still be V1.
- the mobile phone can determine that the file has not been modified based on the value of the U field (V1) of the file.
- the mobile phone can use the U field of the file to modify the file. Whether the value changes subsequently (such as the second moment), accurately determine whether the file has actually been modified.
- the application failed to successfully set the value of the U field of a certain file to V1 (still V0), which means that the mobile phone has previously mapped the file to memory.
- V1 still V0
- the mobile phone may not execute the relevant code in the file system, and the file system cannot track the modification event of the file. It is impossible to update the value of the U field of the file when the file is modified. For example, when a file is modified, the file system may not sense that the file has been modified, and therefore, the value of the U field of the file is not updated.
- the file system will not update the value of the U field of the file. In this way, no matter whether the file is modified or not, the value of the U field of the file is V0 (will not be updated to V2 by the file system), and the mobile phone cannot determine whether the file has been modified based on the value of the U field.
- the file system may not be able to sense that the file has been modified, and the file system may not update the U field value of the file in a timely manner.
- the mobile phone cannot determine whether the file has been modified based on the value of the U field at the second moment.
- the mobile phone can perform subsequent step S109 to determine that the first file is not a duplicate file, so as to avoid mistakenly deduplicating the first file.
- the application when the application lacks corresponding permissions, it may also result in the failure to successfully modify the value of the U field of the file from V0 to V1.
- the system application authorized by the user has the authority to modify the U field to reduce the risk of misjudgment.
- the application may not be able to successfully modify the value of the file's U field to V1 when there is a lack of storage space.
- the mobile phone can perform binary comparison on these candidate duplicate files, so that Determine the final duplicate files.
- the mobile phone to perform a preliminary screening of candidate duplicate files.
- the candidate duplicate files obtained by the preliminary screening include the group of candidate duplicate files of English Grammar 1-5, and the computer Techniques 1-4 are the set of candidate duplicate files.
- the Mobile Manager application attempts to set the value of the U field of each candidate duplicate file to V1.
- the Mobile Butler application can apply the candidate duplicate files of Grammar 1-4 and Computer Technology 2 -4 This set of candidate duplicate files is subjected to binary comparison to determine the final duplicate file.
- English Grammar 1-4 constitute a set of duplicate files.
- Computer Technology 2-4 constitute a set of duplicate files.
- the mobile phone can store information about duplicate files into a duplicate file information database.
- the identification of duplicate files can be stored in the duplicate file information base.
- the duplicate file information database may include the identifier of each duplicate file in the group of duplicate files of English Grammar 1-4, and the identifier of each duplicate file in the group of duplicate files of Computer Technology 2-4.
- the identification of the duplicate file includes but is not limited to: the name of the duplicate file, the inode number of the duplicate file, and whether the value of the U field of the duplicate file was successfully set to V1 at the first moment. Among them, the index node number of the file is used to uniquely identify a file. Files with different contents have different index node numbers.
- the application can query the value of the U field of each duplicate file and determine the value of the U field based on the U field of each duplicate file. The value at the second time determines whether each duplicate file has been modified between the first time and the second time.
- the application itself queries the value of the U field of the file.
- the application sends a query request to the file system, and the file system queries the value of the U field of the file and returns the value of the U field of the file to the application.
- the application program determines whether the value of the U field of the first file is V1. If the value of the U field is V1, perform the following step S107. If the value of the U field is not V1, perform the following step S108.
- the application determines that the first file has not been modified.
- the Mobile Butler application After the Mobile Butler application scans the duplicate files (binary comparison) and before displaying the scan results to the user, at time t5, the Mobile Butler application queries the field value of the U field of the duplicate file English Grammar 3. , knowing that the field value is V1. Since the field value of the U field in English Grammar 3 at time t5 is the same as the field value at time t1, both are V1, the Mobile Butler application can determine that at time t1 (time t1, the Mobile Butler application calls the file system interface and tries to From the time the field value of the U field of English Grammar 3 was modified from V0 to V1) to time t5, the file English Grammar 3 has not been modified.
- the Mobile Butler application can query the field values of the U fields of English Grammar 1, 3, and 4. If the U field values of English Grammar 1, 3, and 4 are all V1, it means that the file system has not detected English Grammar 1 and 3. ,4 is modified. Then, the Mobile Butler application can determine that the three files English Grammar 1, 3, and 4 have not been modified between time t1 and time t5. Therefore, English Grammar 1, 3, and 4 still constitute duplicate files. Subsequently, the Mobile Manager application can deduplicate this group of duplicate files to reduce the storage space occupied.
- the application determines the index node number of the first file and the value of the U field of the first file at the second moment. If the index node number of the first file remains unchanged and the U field of the first file is at the second moment, If the value of the second moment is V1, it is determined that the first file has not been modified during the period from the first moment to the second moment.
- the application determines that the first file is modified.
- the Mobile Butler application can read English grammar 2 from the metadata area.
- the field value of the U field is V2. Since the field value of the U field of English Grammar 2 at time t5 is different from the field value at time t1, the Mobile Butler application can determine that at time t1 (time t1, the Mobile Butler application requests the file system to change the field value of the U field of English Grammar 3
- the file English Grammar 2 may have been modified between the time when the value was modified from V0 to V1) and time t5. Phone no longer treats English Grammar 2 as a duplicate file. In this way, the Mobile Manager application will not perform duplication deduplication in English Grammar 2 in the future.
- the modification time t3 of English Grammar 2 can also be stored in the metadata area.
- the mobile butler application can read the modification time from the metadata area, and accordingly learn that the modification time of English Grammar 2 is t3.
- the file system misses detection such as the second write memory operation and cannot update the i-mtime field in time, causing the electronic device to mistakenly believe that the file has not been modified during the t3-t5 period.
- the technical solution of the embodiment is that for a certain file, if the file is not mapped to the memory before the first moment, once the subsequent mobile phone writes the file to the memory one or more times between the first moment and the second moment operation, the first memory write operation will definitely cause the phone to execute file system-related code. That is to say, at least the first memory write operation between the first moment and the second moment will be detected by the file system.
- the file system can determine that the file is modified based on at least the first memory write operation between the first moment and the second moment. It can be seen that in the embodiment of the present application, the file system does not need to detect every write memory operation. Even if the file system misses the detection of write memory operations, the file system can still determine the file based on at least the first write memory operation detected within a period of time. has been modified. In this way, the detection accuracy of electronic equipment can be improved.
- the application determines that the first file is not a duplicate file.
- the value of the U field of the first file was not successfully set to V1, which means that during the period from the first moment to the second moment, the first file may be modified (possibly is no longer a duplicate file), but the file system may not be able to detect that the first file has been modified.
- the application treats the first file as a modified file and the first file is no longer a duplicate.
- the application program does not perform deduplication processing on the first file to avoid mistakenly deduplicating the first file that is actually a non-duplicate file.
- the mobile phone manager application cannot successfully transfer the computer technology 1
- the value of the U field of 1 is modified to V1 (the value of the U field is still V0).
- the mobile phone manager application can no longer perform binary comparison on the computer technology 1.
- the mobile butler application can treat computer technology 1 as a modified file (no longer a duplicate file) and no longer perform deduplication on computer technology 1 to avoid mistaken deduplication.
- the mobile phone manager application determines the modification status of each duplicate file during the period t1-t5
- it may The user is presented with one or more duplicate files that have not been modified.
- the unmodified files include: English Grammar 1, 3, and 4, and Computer Technology 2 and 3. That is, English Grammar 1, 3, and 4 still constitute duplicate files, and Computer Technology 2 and 3 still constitute duplicate files.
- the mobile phone can display interface 903.
- the interface 903 may include a card 905 corresponding to the duplicate file in the mobile phone.
- card 905 there are 8 sets of duplicate files stored in the mobile phone (including the set of duplicate files of English Grammar 1, 3, and 4 and the set of duplicate files of Computer Calculation 2 and 3).
- the duplicate files occupy a total of 229MB. of storage space.
- the mobile phone may display an interface 906 as shown in (c) of Figure 10A.
- the interface 906 can present detailed information of the above eight groups of duplicate files. For example, as shown in (c) of FIG. 10A , the interface 906 displays the information of the first set of duplicate files "English Grammar 1, English Grammar 3, and English Grammar 4". The interface 906 also presents the information of the second set of duplicate files "Computer Technology 2, Computer Technology 3". In response to the user's operation such as sliding up, the interface 906 may also present information about other duplicate files. Multiple files in each set of duplicate files occupy multiple storage spaces. For example, English Grammar 1-4 each takes up 24MB of storage space.
- the user can check one or more groups of duplicate files and click the compression button 907.
- the mobile phone can deduplicate one or more sets of duplicate files selected by the user based on the user's compression/deduplication intention. For example, as shown in (c) of Figure 10A, if the user checks the group of duplicate files of English Grammar, the mobile phone can deduplicate the group of files of English Grammar 1, 3, and 4 according to the user's compression intention. As shown in Figure 10C, after deduplication, English Grammar 1, 3, and 4 only occupy one storage space (24MB), which greatly frees up the storage space of the mobile phone.
- the electronic device can still display the group of files English Grammar 1, 3, and 4 in the user interface, and the user can still open and use any file in this group of files normally. Compared with before and after deduplication, the storage space occupied by English Grammar 1, 3, and 4 has been reduced.
- file deduplication is a possible implementation method of file compression.
- File compression can also be done in other ways, which are not limited by the embodiments of this application.
- the electronic device can modify the value of the U field of the file 1 from the initial value V0 to V1 at the first moment. Then, at the second moment, the electronic device can query the value of the U field of the file 1 and determine whether the file 1 has been modified based on the value of the U field. In some cases, at the second moment, if the value of the U field of file 1 is a value other than V1 (such as V2), the electronic device can determine that the file 1 has been modified. In other cases, at the second moment, if the value of the U field of file 1 is V1, the electronic device can determine that the file 1 has not been modified during the period from the first moment to the second moment.
- V1 such as V2
- the electronic device does not modify the value of the U field of the file 2 at the first moment (the value of the U field is still the initial value V0). This means that between the first moment and the second moment, file 2 may be modified (may no longer be a duplicate file), but the file system may not be able to detect that file 2 is modified. In this case, the electronic device regards file 2 as a modified file, and file 2 is no longer a duplicate file. Furthermore, the application does not perform deduplication on File 2 to avoid mistaken deduplication of File 2 which is actually a non-duplicate file.
- V2 can also be replaced by other values other than V1 (for example, V0).
- V1 for example, V0.
- the embodiment of this application does not impose any restrictions on the specific value of the U field that is modified when the file system senses that the file has been modified.
- the above mainly takes the application as a mobile butler application as an example to explain the method of determining the modification status of a file. It should be understood that the application can also be any other possible application.
- the application can also be a file manager, etc.
- the file manager can use the technical solution of the embodiment of the present application to determine whether the files in its directory have been modified within a period of time.
- the mobile phone can scan the duplicate files on the mobile phone by itself and deduplicate some duplicate files to reduce the occupation of storage space.
- the mobile phone actively scanning for duplicate files and performing deduplication Take the mobile phone actively scanning for duplicate files and performing deduplication as an example.
- the application changes the values of the U fields of files A and B to V1.
- the application reads the contents of files A and B and considers files A and B to be duplicate files.
- file A is modified, and the value of the U field of file A is modified to V2 by the file system.
- the application queries the values of the U fields of files A and B and learns that the value of the U field of file A is V1 and the value of the U field of file B is V2, which means that file A has been modified and file B has been modified. Not modified, files A and B are no longer duplicate files. Therefore, the application does not perform deduplication on files A and B.
- the application modifies the values of the U fields of files A and B to V1.
- the application reads the contents of files A and B and considers files A and B to be duplicate files.
- the application queries the files A and B
- the value of the U field indicates that the value of the U field of files A and B is V1, which means that since time point 1, neither files A nor B have been modified, and files A and B still constitute duplicate files. Therefore, the application can perform deduplication on files A and B.
- Embodiments of the present application also provide a file processing method.
- the file has been mapped to the memory.
- This method can also include the following two situations: the file has been mapped to the memory, but the electronic device has not written to the memory mapped by the file. ;The file has been mapped into memory, and the electronic device has written to the memory mapped by the file.
- the electronic device can use different methods to determine whether the file has been modified. The following is explained with examples.
- the application program wants to modify the value of the U field of the file English Grammar 2 to V1
- the application program can call the interface of the file system to The file system sends a request message. It is judged that the file has been mmapd (that is, mapped to memory) before, but no content has been written to the memory mapped by the file. Then, the file system determines that the conditions for modifying the U field of the file are met, and the file can be The value of the U field of the file is modified from the initial value V0 to V1.
- the application can then perform a binary comparison of English Grammar 3 with other candidate duplicate files to determine the final duplicate file.
- the electronic device performs a write operation on the memory mapped by the file for the first time.
- the electronic device will call the function of the file system, so the file system can sense this write operation on the file.
- the file system can modify the value of the U field of the file from V1 to V2.
- the application queries the value of the U field (V2) of the file, Since the value of the U field obtained from the query at time t5 is different from the value of the U field at time t1, the application can determine that the file has been modified during the period t1-t5.
- the application queries the value of the U field (V1) of the file. Since the value of the U field obtained by the query at time t5 is the same as the value of the U field at time t1, the application can determine the value of the U field at time t1.
- the file has not been modified during the t1-t5 period.
- the mobile phone can display duplicate files that have not been modified during the t1-t5 period to the user. For example, during the period t1-t5, if English Grammar 1, 3, and 4 in the duplicate file have not been modified, the mobile phone can display the information of English Grammar 1, 3, and 4 in the interface shown in (c) of Figure 10A .
- the application program wants to modify the value of the U field of the computer technology 1 file to V1
- the application program can call the interface of the file system to The file system sends a request message. It is judged that the file has been mmapd before (that is, it has been mapped to memory), and the content has been written to the memory mapped by the file. Then, the file system determines that the conditions for modifying the U field of the file are not met. Therefore, the file The system does not modify the value of the U field of the file, and the value of the U field of the file is still V0.
- the application treats the file as a modified file and the file is no longer a duplicate. Also, the application does not perform deduplication on the file to avoid mistakenly deduplicating files that are actually non-duplicate files.
- the mobile phone manager application sends a deduplication request to the file system, and the file system can check each item again.
- the value of the U field of the duplicate file is used to further determine whether each duplicate file has been modified since the first moment. For example, as shown in Figure 19, after the user clicks the "Compress" button and before the mobile phone performs deduplication, at time t9, the file system queries the U of each duplicate file (English Grammar 1, 3, 4, Computer Technology 1, 2) again. The value of the field.
- the mobile phone After judging that the value of the U field of English Grammar 3 was successfully set to V1 at time t1, but the value of the U field at time t9 was V0, the mobile phone can determine that English Grammar 3 was modified between time t1 and time t9. Pass. In the same way, the mobile phone determines whether other duplicate files have been modified at t1-t9.
- the file system checks the U field value of the file to ensure that the U field value is checked and the atomicity of the deduplication operation is checked, that is, the U field value is checked to determine that the deduplication condition is met, During the deduplication process, the files will not be modified.
- the application does not need to run permanently. In this way, system overhead can be reduced while ensuring accurate judgment of the modification status of the file.
- the user opens the Phone Manager app and clicks the "Clean Acceleration" button to trigger the phone to perform a scanning process for duplicate files. Afterwards, the user can turn off the phone Housekeeper application. Later, when the remaining storage space of the phone is insufficient and a phenomenon such as lag occurs, the user can open the Phone Manager app again and click the "Clean Acceleration" button.
- the phone can scan the duplicate files based on the historical results and modify some duplicate files. Status, re-determine duplicate files in the phone to reduce resource consumption caused by re-scanning duplicate files.
- the Mobile Butler application scans and obtains: English Grammar 1-4 are a set of duplicate files, and Computer Technology 1 and Computer Technology 2 are a set of duplicate files.
- the mobile phone can store the file identifiers of the group of duplicate files English Grammar 2-4 and the file identifiers of the group of duplicate files Computer Technology 1 and Computer Technology 2 in the duplicate file information database as shown in Figure 11.
- the Mobile Butler application can query the duplicate file information database as shown in Figure 11 and learn English Grammar 1-4. Group the duplicate files in history, as well as the group of historical duplicate files in Computer Technology 2-4, and query the U field values of the duplicate files in English Grammar 1-4 and Computer Technology 2-4, so that according to the The U field value determines whether each duplicate file has been modified within a period of time.
- the mobile butler application can determine that English Grammar 3 and English Grammar 4 still constitute duplicate files, and Computer Technology 3 and Computer Technology 2 still constitute duplicate files. As shown in Figure 14, at time t6, the mobile butler application can display the above groups of duplicate files in the interface 906.
- the phone can reduce the scanning of some files (for example, there is no need to read the contents of historical duplicate files from the corresponding memory), which greatly reduces the cost of the phone. operating consumption.
- the duplicate file information database such as shown in Figure 11 can be updated.
- the above first condition is only an example. It should be understood that any condition that can ensure that the write operation at t1-t5 is sensed by the file system can be used as the first condition. On the contrary, as long as subsequent writes cannot be guaranteed to be sensed by the file system, the first condition can be used. One condition is not met. Illustratively, as another feasible embodiment, it can be determined whether the file was mmapted before the first moment, and whether mmap has write permission. If the file was mmapted before the first moment, but mmap does not have write permission, the first condition is determined to be met. If the file was mmapted before the first moment, but mmap has write permission, the first condition is definitely not met.
- the mobile phone can also perform a pre-scanning process, scan the duplicate files during idle periods, and store the scan results.
- the repeated file scanning process in the above embodiment can also be a scanning process executed when the mobile phone is idle (such as at night).
- the preliminary screening and binary comparison process shown in Figure 12 can be performed in advance at night.
- the mobile phone can perform scanning for duplicate files at night. Assume that the scan obtains English Grammar 1-4 as a set of duplicate files, and during the scanning process, at time t1, try to modify the value of the U field of English Grammar 1-4 to V1. Afterwards, as shown in (a) of Figure 10A, the user clicks the "Clean Up Acceleration" button 902 during the day, and the mobile phone can query the value of the U field of English Grammar 1-4. Assume that the values of the U field of English Grammar 1-4 are all successfully set to V1 at time t1, and the values of the U field of English Grammar 1, 3, and 4 are still V1, then the mobile phone determines that English Grammar 1, 3, and 4 have been set since t1. Since they have not been modified since the beginning of time, these three files still constitute duplicate files. The mobile phone can display the information of these three duplicate files in an interface such as shown in (c) of Figure 10A.
- the embodiments of the present application do not limit the timing when the electronic device performs pre-scanning of repeated files.
- the electronic device can perform a pre-scanning process for duplicate files in appropriate scenarios. For example, at night, a pre-scan is performed when the lock screen duration exceeds a threshold.
- the electronic device may also provide a setting portal so that the user can set the timing for performing the pre-scan.
- a switch 201 is displayed in the setting interface 20 of the mobile phone. When switch 201 is turned on, the phone can perform pre-scanning when idle.
- the mobile phone can also provide a setting portal so that the user can set the timing of the pre-scan. For example, the user can set the pre-scan to be performed at night or when the screen lock exceeds a certain threshold.
- the electronic device can also determine whether V1 is set successfully at other opportunities and scenarios. For example, before querying the field value of the file each time, determine whether V1 is set successfully.
- a device which may be the above-mentioned electronic device (such as a mobile phone, etc.) or a server.
- the device may include a display, memory, and one or more processors.
- the display, memory and processor are coupled.
- the memory is used to store computer program code, which includes computer instructions.
- the processor executes the computer instructions, the device can perform each function or step performed by the mobile phone in the above method embodiment.
- the structure of the device may refer to the electronic equipment (such as a terminal) shown in Figure 6 .
- the core structure of the device can be represented as the structure shown in Figure 21.
- the device includes: a processing module 1301, an input module 1302, a storage module 1303 and a display module 1304.
- the processing module 1301 may include at least one of a central processing unit (CPU), an application processor (Application Processor, AP), or a communication processor (Communication Processor, CP).
- the processing module 1301 may perform operations or data processing related to control and/or communication of at least one of the other elements of the user electronic device. Specifically, the processing module 1301 can be used to control the content displayed on the home screen according to certain trigger conditions.
- the processing module 1301 is also used to process the input instructions or data, and determine the display style according to the processed data.
- the processing module 1301 may be implemented as the processor 201 shown in FIG. 6 .
- the input module 1302 is used to obtain instructions or data input by the user, and transmit the obtained instructions or data to other modules of the electronic device.
- the input method of the input module 1302 may include touch, gesture, proximity to the screen, etc., or may be voice input.
- the input module may be a screen of an electronic device, obtains the user's input operation, generates an input signal according to the obtained input operation, and transmits the input signal to the processing module 1301 .
- the storage module 1303 may include volatile memory and/or non-volatile memory.
- the storage module is used to store at least one related instruction or data among other modules of the user terminal device.
- the storage module 1303 may be implemented as the memory 202 shown in FIG. 6 .
- the display module 1304 may include, for example, a liquid crystal display (LCD), a light emitting diode (LED) display, an organic light emitting diode (OLED) display, a microelectromechanical systems (MEMS) display, or an electronic paper display. Used to display user-viewable content (e.g., text, images, videos, icons, symbols, etc.).
- LCD liquid crystal display
- LED light emitting diode
- OLED organic light emitting diode
- MEMS microelectromechanical systems
- a communication module 1305 is also included for supporting the personal terminal to communicate with other personal terminals (through a communication network).
- the communication module may be connected to the network via wireless communication or wired communication to communicate with other personal terminals or network servers.
- Wireless communications may employ at least one of cellular communications protocols, such as Long Term Evolution (LTE), Long Term Evolution-Advanced (LTE-A), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Universal Mobile Communications System (UMTS), Wireless Broadband (WiBro) or Global System for Mobile Communications (GSM).
- Wireless communications may include, for example, short-range communications.
- Short-range communication may include at least one of Wireless Fidelity (Wi-Fi), Bluetooth, Near Field Communication (NFC), Magnetic Stripe Transmission (MST), or GNSS.
- the communication module 1305 may be implemented as a transceiver 203 such as shown in FIG. 6 .
- each functional module of the device can perform one or more steps in the above method embodiment.
- the chip system includes at least one processor 1401 and at least one interface circuit 1402.
- the processor 1401 and the interface circuit 1402 may be interconnected by wires.
- interface circuitry 1402 may be used to receive signals from other devices, such as memory of an electronic device.
- interface circuit 1402 may be used to send signals to other devices (eg, processor 1401).
- the interface circuit 1402 can read instructions stored in the memory and send the instructions to the processor 1401.
- the electronic device can be caused to perform various steps in the above embodiments.
- the chip system may also include other discrete devices, which are not specifically limited in the embodiments of this application.
- Embodiments of the present application also provide a computer storage medium.
- the computer storage medium includes computer instructions.
- the electronic device When the computer instructions are run on the above-mentioned electronic device, the electronic device causes the electronic device to perform various functions or steps performed by the mobile phone in the above-mentioned method embodiments. .
- An embodiment of the present application also provides a computer program product.
- the computer program product When the computer program product is run on a computer, the The computer executes each function or step executed by the mobile phone in the above method embodiment.
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are only illustrative.
- the division of modules or units is only a logical function division.
- there may be other division methods for example, multiple units or components may be The combination can either be integrated into another device, or some features can be omitted, or not implemented.
- the coupling or direct coupling or communication connection between each other shown or discussed may be through some interfaces, and the indirect coupling or communication connection of the devices or units may be in electrical, mechanical or other forms.
- the units described as separate components may or may not be physically separated.
- the components shown as units may be one physical unit or multiple physical units, that is, they may be located in one place, or they may be distributed to multiple different places. . Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
- each functional unit in various embodiments of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
- the above integrated units can be implemented in the form of hardware or software functional units.
- the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a readable storage medium.
- the technical solutions of the embodiments of the present application are essentially or contribute to the existing technology, or all or part of the technical solution can be embodied in the form of a software product, and the software product is stored in a storage medium , including several instructions to cause a device (which can be a microcontroller, a chip, etc.) or a processor to execute all or part of the steps of the methods described in various embodiments of this application.
- the aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM), random access memory (RAM), magnetic disk or optical disk and other media that can store program code.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
Description
Claims (28)
- 一种文件处理方法,其特征在于,应用于电子设备,所述电子设备存储有第一文件的指示字段,所述指示字段的初始值为第一值,所述指示字段在所述第一文件被修改时被所述电子设备修改为第二值;所述方法包括:在第一时刻,尝试将所述第一文件的指示字段的值修改为第三值;所述第三值与所述第一值不同;所述第三值与所述第二值不同;若成功将所述第一文件的指示字段的值修改为所述第三值,则在第二时刻,获取所述指示字段的值;根据所述第一文件的指示字段在所述第二时刻的值,判断在所述第一时刻至所述第二时刻的时段内,所述第一文件是否被修改。
- 根据权利要求1所述的方法,其特征在于,所述指示字段存储在所述电子设备的元数据区中。
- 根据权利要求1或2所述的方法,其特征在于,所述尝试将所述第一文件的指示字段的值修改为第三值,包括:若满足第一条件,则将所述指示字段的值修改为所述第三值;在所述第一条件下,所述电子设备的文件系统能够检测到在所述第一时刻至所述第二时刻的时段内,针对所述第一文件的修改操作。
- 根据权利要求1-3任一项所述的方法,其特征在于,在所述第一时刻之后,所述方法还包括:检测到所述第一文件被修改,将所述第一文件的指示字段的值修改为所述第二值;根据所述第一文件的指示字段在所述第二时刻的值,判断在所述第一时刻至所述第二时刻的时段内,所述第一文件是否被修改,包括:若所述第一文件的指示字段在所述第二时刻的值为所述第二值,则确定在所述第一时刻至所述第二时刻的时段内,所述第一文件被修改,或者,若所述第一文件的指示字段在所述第二时刻的值不是所述第三值,则确定在所述第一时刻至所述第二时刻的时段内,所述第一文件被修改。
- 根据权利要求1-3任一项所述的方法,其特征在于,根据所述第一文件的指示字段在所述第二时刻的值,判断在所述第一时刻至所述第二时刻的时段内,所述第一文件是否被修改,包括:若所述第一文件的指示字段在所述第二时刻的值为所述第三值,则确定在所述第一时刻至所述第二时刻的时段内,所述第一文件未被修改,或者,若所述第一文件的指示字段在所述第二时刻的值不是所述第二值,则确定在所述第一时刻至所述第二时刻的时段内,所述第一文件未被修改。
- 根据权利要求1或2所述的方法,其特征在于,所述尝试将所述第一文件的指示字段的值修改为第三值,包括:若不满足第一条件,则不将所述指示字段修改为第三值;所述方法还包括:在不能成功将所述第一文件的指示字段的值修改为所述第三值时,确定在所述第一时刻至所述第二时刻的时段内,所述第一文件被修改。
- 根据权利要求3或6所述的方法,其特征在于,所述第一条件包括如下一项或多项条件:在所述第一时刻之前,所述第一文件未被映射到内存;在所述第一时刻之前,所述第一文件被映射到内存,但所述电子设备未对所述内存执行过写入操作。
- 根据权利要求1-7任一项所述的方法,其特征在于,所述方法还包括:扫描得到所述电子设备中的重复文件,所述重复文件包括所述第一文件和第二文件;所述第一文件存储在第一存储空间,所述第二文件存储在第二存储空间;确定所述第一时刻至所述第二时刻的时段内,所述第一文件、所述第二文件未被修改;显示第一界面;所述第一界面包括所述第一文件的信息以及所述第二文件的信息。
- 根据权利要求8所述的方法,其特征在于,检测到用户在所述第一界面中输入的第一操作;将所述第一文件以及所述第二文件压缩至同一存储空间。
- 根据权利要求8或9所述的方法,其特征在于,在扫描所述电子设备中的重复文件之后,所述方法还包括:存储所述第一文件的标识和所述第二文件的标识。
- 根据权利要求10所述的方法,其特征在于,所述第一文件的标识包括所述第一文件的第一索引节点编号;所述第二文件的标识包括所述第二文件的第二索引节点编号。
- 根据权利要求11所述的方法,其特征在于,根据所述第一文件的指示字段在所述第二时刻的值,判断在所述第一时刻至所述第二时刻的时段内,所述第一文件是否被修改,包括:若所述第一文件的指示字段在所述第二时刻的值为所述第三值,且所述第一文件的索引节点编 号为所述第一索引节点编号,则确定在所述第一时刻至所述第二时刻的时段内,所述第一文件未被修改。
- 一种文件处理方法,其特征在于,应用于电子设备,所述方法包括:显示第二界面,所述第二界面包括扫描得到的所述电子设备中的多个重复文件;所述多个重复文件分别存储在所述电子设备的多个存储空间;响应于用户在所述第二界面上输入的操作,在第三时刻,获取所述多个重复文件中每个重复文件的指示字段,所述重复文件的指示字段的值用于指示所述重复文件是否被修改;根据所述多个重复文件的指示字段在所述第三时刻的值,将所述多个重复文件中的部分重复文件压缩至同一存储空间。
- 根据权利要求13所述的方法,其特征在于,根据所述多个重复文件的指示字段在所述第三时刻的值,将所述多个重复文件中的部分重复文件压缩至同一存储空间,包括:若所述多个重复文件中第一文件的指示字段在所述第三时刻的值为第三值,则对所述第一文件执行压缩;或者,若所述多个重复文件中第一文件的指示字段在所述第三时刻的值不是第三值,则不对所述第一文件执行压缩。
- 根据权利要求13或14所述的方法,其特征在于,每个重复文件的指示字段的初始值为第一值。
- 根据权利要求13-15任一项所述的方法,其特征在于,显示第二界面之前,所述方法还包括:扫描得到多个候选重复文件;所述多个候选重复文件包括所述多个重复文件;在第一时刻,尝试将所述多个候选重复文件中每个候选重复文件的指示字段的值修改为第三值;对所述多个候选重复文件进行比对,以从所述多个候选重复文件中确定所述多个重复文件。
- 根据权利要求16所述的方法,其特征在于,确定所述多个重复文件之后,所述方法还包括:将所述多个重复文件的信息存储在数据库中,所述重复文件的信息包括如下任一项或多项信息:所述重复文件的索引节点编号、所述重复文件的路径、所述重复文件的名称。
- 根据权利要求16或17所述的方法,其特征在于,扫描得到所述多个候选重复文件,包括:显示第三界面,所述第三界面包括第一控件;检测到用户对所述第一控件的操作,扫描得到所述多个候选重复文件。
- 根据权利要求16或17所述的方法,其特征在于,扫描得到所述多个候选重复文件,包括:当所述电子设备空闲时,扫描得到所述多个候选重复文件。
- 根据权利要求16-19任一项所述的方法,其特征在于,尝试将所述多个候选重复文件中每个候选重复文件的指示字段的值修改为第三值,包括:若所述多个候选重复文件中的至少一个候选重复文件满足第一条件,则将所述至少一个候选重复文件的指示字段的值修改为所述第三值;在所述第一条件下,所述电子设备的文件系统能够检测到在所述第一时刻至所述第二时刻的时段内,针对所述至少一个候选重复文件的修改操作。
- 根据权利要求20所述的方法,其特征在于,在第二时刻,获取所述至少一个重复文件的指示字段的值,包括:在所述第二时刻,获取到所述至少一个重复文件中目标重复文件的指示字段的值为第三值;所述方法还包括:在所述目标重复文件的指示字段在所述第二时刻的值为第三值的情况下,确定在所述第一时刻至所述第二时刻的时段内,所述目标重复文件未被修改。
- 根据权利要求20所述的方法,其特征在于,所述多个候选重复文件包括第三文件;在所述第一时刻之后,所述方法还包括:检测到所述第三文件被修改,将所述第三文件的指示字段的值修改为第二值;在第二时刻,获取到所述第三文件的指示字段的值不是所述第三值;确定在所述第一时刻至所述第二时刻的时段内,所述第三文件被修改。
- 根据权利要求16-19任一项所述的方法,其特征在于,所述多个候选重复文件包括第四文件;所述在第一时刻,尝试将所述多个候选重复文件中每个候选重复文件的指示字段的值修改为第三值,包括:若所述第四文件不满足第一条件,则不将所述第四文件的指示字段修改为第三值;所述方法还包括:在不能成功将所述第四文件的指示字段的值修改为所述第三值时,确定在所述第一时刻至第二时刻的时段内,所述第四文件被修改。
- 根据权利要求20-23任一项所述的方法,其特征在于,所述第一条件包括如下一项或多项条件:在所述第一时刻之前,所述重复文件未被映射到内存;在所述第一时刻之前,所述重复文件被映射到内存,但所述电子设备未对所述内存执行过写入操作。
- 根据权利要求16-24任一项所述的方法,其特征在于,在第一时刻之后,所述方法还包括:在第二时刻,获取所述至少一个重复文件的指示字段的值以及所述至少一个重复文件的索引节点编号;当满足第三条件时,显示所述第二界面;所述第三条件包括:所述至少一个重复文件的指示字段在所述第二时刻的值为第三值,且,所述至少一个重复文件的索引节点编号与数据库中存储的索引节点编号一致。
- 根据权利要求13-25任一项所述的方法,其特征在于,所述指示字段存储在所述电子设备的元数据区中。
- 一种电子设备,其特征在于,包括:处理器以及存储器;所述存储器用于存储计算机执行指令,所述处理器与所述存储器耦接,当所述电子设备运行时,所述处理器执行所述存储器存储的所述计算机执行指令,以使所述电子设备执行如权利要求1-12中任一项所述的方法,或者,执行如权利要求13-26中任一项所述的方法。
- 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,其特征在于,当所述指令在电子设备上运行时,使得所述电子设备执行如权利要求1-12中任一项所述的方法,或者执行如权利要求13-26中任一项所述的方法。
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202380064000.5A CN119836627A (zh) | 2022-09-05 | 2023-09-04 | 文件处理方法及电子设备 |
| EP23862348.2A EP4528529A4 (en) | 2022-09-05 | 2023-09-04 | FILE PROCESSING METHOD AND ELECTRONIC DEVICE |
| US19/069,237 US20250321934A1 (en) | 2022-09-05 | 2025-03-04 | File processing method and electronic device |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202211095247.7A CN117648288B (zh) | 2022-09-05 | 2022-09-05 | 文件处理方法及电子设备 |
| CN202211095247.7 | 2022-09-05 |
Related Child Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| US19/069,237 Continuation US20250321934A1 (en) | 2022-09-05 | 2025-03-04 | File processing method and electronic device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024051654A1 true WO2024051654A1 (zh) | 2024-03-14 |
Family
ID=90045623
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/116818 Ceased WO2024051654A1 (zh) | 2022-09-05 | 2023-09-04 | 文件处理方法及电子设备 |
Country Status (4)
| Country | Link |
|---|---|
| US (1) | US20250321934A1 (zh) |
| EP (1) | EP4528529A4 (zh) |
| CN (3) | CN117648288B (zh) |
| WO (1) | WO2024051654A1 (zh) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN120909998A (zh) * | 2024-05-06 | 2025-11-07 | 云智能资产控股(新加坡)私人股份有限公司 | 文件系统中的对象处理方法、系统、设备、产品及介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0774715A1 (en) * | 1995-10-23 | 1997-05-21 | Stac Electronics | System for backing up files from disk volumes on multiple nodes of a computer network |
| CN108647317A (zh) * | 2018-05-10 | 2018-10-12 | 东软集团股份有限公司 | 增量文件的生成方法、装置和存储介质以及电子设备 |
| CN112783848A (zh) * | 2021-01-20 | 2021-05-11 | 杭州数梦工场科技有限公司 | 一种数据同步方法、装置及电子设备 |
| CN114116611A (zh) * | 2020-08-29 | 2022-03-01 | 华为技术有限公司 | 一种文件扫描方法及相关装置 |
| CN114880299A (zh) * | 2021-02-05 | 2022-08-09 | 北京字跳网络技术有限公司 | 多媒体草稿文件同步方法、装置、设备和介质 |
Family Cites Families (11)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20140019497A1 (en) * | 2010-02-22 | 2014-01-16 | Asaf CIDON | Modification of files within a cloud computing environment |
| US8504515B2 (en) * | 2010-03-30 | 2013-08-06 | Commvault Systems, Inc. | Stubbing systems and methods in a data replication environment |
| US8516022B1 (en) * | 2012-01-11 | 2013-08-20 | Emc Corporation | Automatically committing files to be write-once-read-many in a file system |
| CN105468686A (zh) * | 2015-11-17 | 2016-04-06 | 北京奇虎科技有限公司 | 减少冗余数据的方法及装置 |
| US10394794B2 (en) * | 2015-11-30 | 2019-08-27 | Open Text Sa Ulc | Systems and methods for multi-file check-in |
| US10547576B1 (en) * | 2016-04-04 | 2020-01-28 | Google Llc | Modifying presentation of message based on content identified by uniform resource locator (URL) in message |
| US11086545B1 (en) * | 2018-03-23 | 2021-08-10 | Tintri By Ddn, Inc. | Optimizing a storage system snapshot restore by efficiently finding duplicate data |
| CN108874585B (zh) * | 2018-05-25 | 2021-01-22 | 南京云信达科技有限公司 | 文件备份方法、装置及系统 |
| CN108763582B (zh) * | 2018-06-11 | 2023-04-21 | 腾讯科技(深圳)有限公司 | 文件搜索方法、装置、终端及存储介质 |
| CN110059115B (zh) * | 2019-03-19 | 2023-08-11 | 创新先进技术有限公司 | 一种数据读取方法和装置 |
| CN114567674B (zh) * | 2022-02-25 | 2024-03-15 | 腾讯科技(深圳)有限公司 | 一种数据处理方法、装置、计算机设备以及可读存储介质 |
-
2022
- 2022-09-05 CN CN202211095247.7A patent/CN117648288B/zh active Active
- 2022-09-05 CN CN202411397973.3A patent/CN119513041A/zh active Pending
-
2023
- 2023-09-04 EP EP23862348.2A patent/EP4528529A4/en active Pending
- 2023-09-04 WO PCT/CN2023/116818 patent/WO2024051654A1/zh not_active Ceased
- 2023-09-04 CN CN202380064000.5A patent/CN119836627A/zh active Pending
-
2025
- 2025-03-04 US US19/069,237 patent/US20250321934A1/en active Pending
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0774715A1 (en) * | 1995-10-23 | 1997-05-21 | Stac Electronics | System for backing up files from disk volumes on multiple nodes of a computer network |
| CN108647317A (zh) * | 2018-05-10 | 2018-10-12 | 东软集团股份有限公司 | 增量文件的生成方法、装置和存储介质以及电子设备 |
| CN114116611A (zh) * | 2020-08-29 | 2022-03-01 | 华为技术有限公司 | 一种文件扫描方法及相关装置 |
| CN112783848A (zh) * | 2021-01-20 | 2021-05-11 | 杭州数梦工场科技有限公司 | 一种数据同步方法、装置及电子设备 |
| CN114880299A (zh) * | 2021-02-05 | 2022-08-09 | 北京字跳网络技术有限公司 | 多媒体草稿文件同步方法、装置、设备和介质 |
Non-Patent Citations (1)
| Title |
|---|
| See also references of EP4528529A4 |
Also Published As
| Publication number | Publication date |
|---|---|
| EP4528529A1 (en) | 2025-03-26 |
| CN119513041A (zh) | 2025-02-25 |
| CN119836627A (zh) | 2025-04-15 |
| EP4528529A4 (en) | 2025-10-08 |
| CN117648288B (zh) | 2024-09-17 |
| CN117648288A (zh) | 2024-03-05 |
| US20250321934A1 (en) | 2025-10-16 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN110162525B (zh) | 基于b+树的读写冲突解决方法、装置及存储介质 | |
| KR102124231B1 (ko) | 플레이스홀더 및 콘텐츠 스트리밍 기법 | |
| US12591706B2 (en) | Open access token for determining that file is accessible to everyone | |
| WO2022156484A1 (zh) | 媒体数据处理方法、装置及终端设备 | |
| US20130227085A1 (en) | Terminal and method for using cloud services | |
| WO2020119491A1 (zh) | 来电提醒方法及终端 | |
| CN108021590A (zh) | 一种目标对象属性确定方法、属性更新方法及装置 | |
| US20140297586A1 (en) | Device and method for cloud file management | |
| WO2024078348A1 (zh) | 应用移植环境下注册表操作的处理方法、装置和介质 | |
| US20250321934A1 (en) | File processing method and electronic device | |
| CN118120212A (zh) | 一种文件去重方法、装置和设备 | |
| EP2686791B1 (en) | Variants of files in a file system | |
| CN114328007B (zh) | 一种容器备份还原方法、装置及其介质 | |
| US20170091206A1 (en) | Information Processing Method and Electronic Apparatus | |
| WO2018107361A1 (zh) | 镜像处理方法以及计算设备 | |
| CN108845772A (zh) | 一种硬盘故障处理方法、系统、设备及计算机存储介质 | |
| CN105430314A (zh) | 视频数据存储访问控制方法及装置 | |
| EP3073360A1 (en) | Multi-media data backup method, user terminal and synchronizer | |
| CN117708070B (zh) | 一种文件压缩方法及电子设备 | |
| CN112286869A (zh) | 一种快照创建方法及装置 | |
| CN119248737A (zh) | 文件同步方法、电子设备及存储介质 | |
| CN118869879A (zh) | 文件扫描方法、文件扫描装置和电子设备 | |
| US8990265B1 (en) | Context-aware durability of file variants | |
| CN108345431B (zh) | 一种数据读取的方法及装置 | |
| US20110106861A1 (en) | Interface Techniques Providing Contiguous Storage For Files |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23862348 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2023862348 Country of ref document: EP |
|
| ENP | Entry into the national phase |
Ref document number: 2023862348 Country of ref document: EP Effective date: 20241217 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 202380064000.5 Country of ref document: CN |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| WWP | Wipo information: published in national office |
Ref document number: 202380064000.5 Country of ref document: CN |