WO2018049883A1 - File operation method and device - Google Patents

File operation method and device Download PDF

Info

Publication number
WO2018049883A1
WO2018049883A1 PCT/CN2017/092244 CN2017092244W WO2018049883A1 WO 2018049883 A1 WO2018049883 A1 WO 2018049883A1 CN 2017092244 W CN2017092244 W CN 2017092244W WO 2018049883 A1 WO2018049883 A1 WO 2018049883A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
application
target
read
database
Prior art date
Application number
PCT/CN2017/092244
Other languages
French (fr)
Chinese (zh)
Inventor
陆天洋
Original Assignee
广东欧珀移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 广东欧珀移动通信有限公司 filed Critical 广东欧珀移动通信有限公司
Publication of WO2018049883A1 publication Critical patent/WO2018049883A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Definitions

  • the present invention relates to the field of terminal technologies, and in particular, to a file operating method and apparatus.
  • a first aspect of the embodiments of the present invention provides a file operation method, including:
  • Receiving an application migration instruction acquiring a target application and a target terminal corresponding to the application migration instruction;
  • a second aspect of the embodiments of the present invention provides a file operating device, including:
  • a file read/write operation detecting module configured to detect a file read and write operation of an installed application, and obtain the The file corresponding to the first application identifier and file read and write operations of the installed application;
  • a storage storage module configured to store the first application identifier and the file corresponding to the file read and write operation in a preset database
  • the application migration instruction receiving module is configured to receive an application migration instruction, and acquire the target application and the target terminal corresponding to the application migration instruction;
  • a file migration module configured to search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
  • a third aspect of the embodiments of the present invention provides a terminal, where the system includes:
  • the memory is for storing instructions
  • the processor is operative to execute the instructions to perform the steps of any of the methods of the first aspect of the embodiments of the present invention.
  • a fourth aspect of the embodiments of the present invention provides a storage medium, where the storage medium stores a program, and the program is used to perform the steps described in any one of the first aspects of the embodiments of the present invention.
  • FIG. 1 is a schematic flow chart of a file operation method in an embodiment
  • FIG. 2 is a schematic structural view of a file operating device in an embodiment
  • FIG. 3 is a schematic structural diagram of a computer device for operating the foregoing file operation method in an embodiment.
  • Each application installed in the terminal can read and write files other than system files or application files, that is, in the process of using, for each file, each application installed in the terminal is You can create or modify or otherwise make the file. For example, when performing an application uninstallation, because it is not determined which files in the terminal are created or modified by the application, when the application is uninstalled, the file corresponding to the application will remain in the system, along with the terminal. The increase in usage time will result in a large number of redundant files left in the terminal.
  • a file operation method is proposed, and the implementation of the method may depend on a computer program, which may be a file management program based on an Android system or an IOS system, such as a mobile phone moving application or a data backup migration and restoration.
  • File manager in the app may be a terminal device such as a smart phone or a tablet computer that runs the above computer program.
  • a database for recording and reading, reading, writing, and modifying the operation of the file is created in the system, and when the application in the terminal is detected to perform related operations on the file, corresponding The operation record is recorded in the database; then, in the process of application migration, all the operated files corresponding to the application are searched in the above database, and the found files are migrated to the target terminal along with the migration of the application. That is to say, by monitoring and recording the operation records of all the files in the terminal, all the corresponding files can be accurately determined in the process of application migration, the accuracy of application matching is improved, and the migration in the application migration process is improved. The integrity and accuracy of the file enhances the user experience.
  • the foregoing file operation method includes the following steps:
  • Step S102 Detecting a file read/write operation of the installed application, and acquiring a file corresponding to the first application identifier and the file read/write operation of the installed application.
  • the application process corresponding to the installed application in the terminal can perform read and write operations on the file in the terminal, for example, the photo PS application can read the picture file in the terminal, and the corresponding picture file The modification operation is performed, or alternatively, the WPS application can read the file in the .dox format in the terminal, and can edit the file.
  • the corresponding file needs to be obtained.
  • Specific operations such as read operations or write operations or copy operations or create operations.
  • Step S104 Correspondly store the first application identifier and the file corresponding to the file read/write operation into a preset database.
  • a database is created in the terminal, which has been created when the terminal is first used. After detecting the read and write operations of any installed files in the terminal, the corresponding application identifiers for reading and writing operations and corresponding files are stored in the database. It should be noted that, in the database, related records of read and write operations for any file in the terminal are stored, and each record includes an application identifier, a file name, a specific operation, and the like, that is, in the database. In the database, all the files corresponding to the operation corresponding to the application may be determined according to the application identifier, and all applications that have been related to the file may also be determined according to the file name.
  • the step of acquiring the file corresponding to the first application identifier and the file read/write operation of the installed application includes: acquiring only the file corresponding to the file write operation.
  • the foregoing monitoring of the read and write operations of files in the system may be implemented through an interface function of the system file read/write interface.
  • the step of loading the first application identifier of the application and the file corresponding to the file read/write operation includes: pre-defining a system file read/write interface, wherein the installed application reads and writes a file operation through the system file read/write interface; The file read/write interface acquires a file corresponding to the first application identifier and the file read/write operation of the installed application.
  • the interface function of the system file read/write interface is modified, and all the installed applications in the terminal must implement the read/write operation on the file in the terminal, and must be implemented through the interface function of the system file read/write interface. That is to say, the corresponding application process obtains the first application identifier corresponding to the installed application and the file that needs to be read and written by calling the interface function of the system file read/write interface.
  • Step S106 Receive an application migration instruction, and acquire a target application and a target terminal corresponding to the application migration instruction.
  • the application data is migrated between the terminal and the terminal, and all data related to one of the applications in the source terminal is migrated to the migration terminal and stored.
  • the migration of the application data may be implemented by a communication connection between the migration terminal and the migration source terminal, and may be an application based on mobile phone data backup and migration installed on the terminal, for example, mobile phone.
  • the user can input an application migration instruction for a target application in the migration source terminal.
  • the target application corresponding to the application migration instruction and the corresponding target terminal are obtained, and the target terminal is the migration terminal.
  • Step S108 Search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
  • the application identifier according to the target application is in the preset.
  • the database determines all the files corresponding to the target application, that is, all the files that the target application has read and written, that is, the target file. After the target is determined, the target file is migrated to the migration terminal, that is, migrated to the target terminal according to the detected application migration instruction.
  • the method for determining all files corresponding to one application in the method may also be used to determine a file that needs to be uninstalled during the application uninstallation process.
  • the method further includes: receiving an application uninstallation instruction, acquiring a target uninstallation application corresponding to the application uninstallation instruction; and searching, in the database, a target corresponding to the target uninstallation application according to the application identifier of the target uninstallation application. Unloading the file, deleting the target uninstall file according to the application uninstallation instruction.
  • the target uninstallation file corresponding to the target uninstalled application is determined and deleted in the above database according to the corresponding target uninstalled application that needs to be uninstalled. Further, a certain file may not only be read and written by one application. If the target uninstall application is only one of them, in this case, directly deleting it may result in data integrity of other applications.
  • the target uninstall file is also read and written by other applications, that is, before deleting the corresponding target uninstall file, in the above database, searching for an application corresponding to the file, if If there is another application other than the target uninstall application, the target uninstall file is not deleted, and if there is no other application than the target uninstall application, the step of deleting the target uninstall file is performed.
  • the step of receiving the application migration instruction further includes: detecting an installation operation of the application, acquiring a second application identifier corresponding to the installation operation, and a file written by the installation operation; The second application identifier and the file written by the installation operation are stored in a preset database; and the step of receiving the application migration instruction is performed.
  • a new application can be installed in the terminal, and when an application is installed, some files on the terminal need to be modified, that is, the corresponding settings or configurations are written into the corresponding system files.
  • the application identifier corresponding to the corresponding installation operation, the written file corresponding to the installation operation, and the file written by the corresponding installation operation are stored in the database. Then, when determining the file corresponding to the application, the determined file includes the file written by the installation operation described above; when the application data migration is performed, the migrated data further includes the file written by the installation operation.
  • a file operation device is also proposed. As shown in FIG. 2, the device includes a file read/write operation detection module 102, a record storage module 104, an application migration instruction receiving module 106, and a file migration module 108. ,among them:
  • the file read/write operation detecting module 102 is configured to detect a file read and write operation of the installed application, and obtain a file corresponding to the first application identifier and the file read and write operation of the installed application;
  • a record storage module 104 configured to store the first application identifier and the file corresponding to the file read and write operation in a preset database
  • the application migration instruction receiving module 106 is configured to receive an application migration instruction, and acquire a target application and a target terminal corresponding to the application migration instruction;
  • the file migration module 108 is configured to search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
  • the file read/write operation detecting module 102 is configured to detect a file read/write operation of the installed application
  • the method is specifically configured to: start a process in the system; and detect the installed application based on the opened process. File read and write operations.
  • the foregoing apparatus further includes an application installation module 110, configured to detect an installation operation of the application, obtain a second application identifier corresponding to the installation operation, and write the installation operation. And storing the file written by the second application identifier and the installation operation into a preset database; calling the application migration instruction receiving module 106.
  • an application installation module 110 configured to detect an installation operation of the application, obtain a second application identifier corresponding to the installation operation, and write the installation operation. And storing the file written by the second application identifier and the installation operation into a preset database; calling the application migration instruction receiving module 106.
  • the migrated data also includes files written by the installation operation.
  • the file read/write operation detecting module 102 is further configured to pre-define a system file read/write interface, and the installed application reads and writes a file operation through the system file read/write interface;
  • the system file read/write interface acquires a file corresponding to the first application identifier and the file read and write operation of the installed application.
  • the file read/write operation detecting module 102 is further configured to obtain only the file corresponding to the file write operation.
  • the foregoing apparatus further includes an application uninstalling module 112, configured to receive an application uninstallation instruction, acquire a target uninstallation application corresponding to the application uninstallation instruction, and uninstall the application according to the target.
  • the application identifier searches the database for a target uninstall file corresponding to the target uninstall application, and deletes the target uninstall file according to the application uninstallation instruction.
  • the file operating device further includes: a database establishing module 114, configured to create a database in the terminal, the database is created when the terminal is used for the first time, and the database is used for storing Each record of the read and write operations for any file in the terminal is stored, and each record includes an application identifier, a file name, and a specific operation.
  • a database establishing module 114 configured to create a database in the terminal, the database is created when the terminal is used for the first time, and the database is used for storing
  • Each record of the read and write operations for any file in the terminal is stored, and each record includes an application identifier, a file name, and a specific operation.
  • the file operating device further includes:
  • the searching module 116 is configured to search, in the database, an application corresponding to the target uninstall file.
  • the triggering module 118 is configured to trigger the application uninstalling module to perform the operation of deleting the target uninstall file according to the application uninstalling instruction if there is no other application than the target uninstalling application.
  • a database for recording and reading, reading, writing, and modifying the operation of the file is created in the system, and when the application in the terminal is detected to perform related operations on the file, corresponding The operation record is recorded in the database; then, in the process of application migration, all the operated files corresponding to the application are searched in the above database, and the found files are migrated to the target terminal along with the migration of the application. That is to say, by monitoring and recording the operation records of all the files in the terminal, all the corresponding files can be accurately determined in the process of application migration, the accuracy of application matching is improved, and the migration in the application migration process is improved. The integrity and accuracy of the file enhances the user experience.
  • FIG. 3 illustrates a terminal of a computer system that operates the above described method of operating a file.
  • the computer system can be a terminal device such as a smart phone, a tablet computer, or a palmtop computer.
  • an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included.
  • the external input interface 1001 can optionally include at least a network interface 10012.
  • the memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034.
  • the output interface 1004 can include at least a device such as a display 10042.
  • the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned computer system, loaded into the internal memory 10034 at runtime, and then compiled into machine code and then passed.
  • Executed in the processor 1002 so that a logical file read/write operation detecting module 102, a record storage module 104, an application migration instruction receiving module 106, a file migration module 108, and an application installation are formed in a von Neumann system-based computer system.
  • the input parameters are received by the external input interface 1001, and transferred to the cache in the memory 1003, and then input to the processor 1002 for processing, and the processed result data is cached in the memory 1003. Subsequent processing, or passed to output interface 1004 for output.
  • the units in the terminal in the embodiment of the present invention may be combined, divided, and deleted according to actual needs.
  • the terminal provided by the embodiment of the present invention includes but is not limited to piggybacking Or terminals of other operating systems, such as mobile phones.
  • Other terminals may also be used, such as a laptop or tablet or desktop computer with a touch-sensitive surface (eg, a touch screen display and/or a touch pad).
  • a terminal including a display and a touch-sensitive surface is described. It should be understood, however, that the terminal can include one or more other physical user interface devices, such as a physical keyboard, mouse, and/or joystick.
  • Terminals typically support a variety of applications, such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
  • applications such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
  • the various applications that can be executed on the terminal can use at least one shared physical user interface device, such as a touch-sensitive surface.
  • One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed from one application to the next and/or adjusted and/or varied within the respective application.
  • the shared physical architecture of the terminal such as a touch-sensitive surface, can support a variety of applications with a user interface that is intuitive to the user.
  • the machine can be read into a storage medium, and when executed, the program can include the flow of an embodiment of the methods as described above.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Abstract

A file operation method, comprising: detecting a file reading/writing operation of an installed application, and obtaining an application identifier of the installed application and a file corresponding to the file reading/writing operation (S102); correspondingly storing the application identifier and the file corresponding to the file reading/writing operation in a preset database (S104); receiving an application migration instruction, and obtaining a target application and a target terminal corresponding to the application migration instruction (S106); and searching the database for a corresponding target file according to an identifier of the target application, and migrating the target file to the target terminal (S108).

Description

文件操作方法及装置File operation method and device
本发明要求2016年9月14日递交的发明名称为“文件操作方法及装置”的申请号201610825679.7的在先申请优先权,上述在先申请的内容以引入的方式并入本文本中。The present application claims priority to the priority of the application Serial No. No. No. No. No. No. No. No. No. No. No. No. No. No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No No
技术领域Technical field
本发明涉及终端技术领域,尤其涉及一种文件操作方法及装置。The present invention relates to the field of terminal technologies, and in particular, to a file operating method and apparatus.
背景技术Background technique
随着终端技术的发展,在终端上集成的功能也是越来越多,例如,创建文件或者对文件进行读写或修改。一般来讲,可以在系统设置中对应用的读写权限进行配置例如,可配置应用完整的读写终端中的除了系统文件等之外的所有文件的读写权限。With the development of terminal technologies, more and more functions are integrated on the terminal, for example, creating files or reading or modifying files. In general, you can configure the read and write permissions of the application in the system settings. For example, you can configure the read and write permissions of all files except the system files in the complete read and write terminal of the application.
发明内容Summary of the invention
本发明实施例第一方面提供一种文件操作方法,包括:A first aspect of the embodiments of the present invention provides a file operation method, including:
检测已安装应用的文件读写操作,获取所述已安装应用的第一应用标识和文件读写操作对应的文件;Detecting a file read/write operation of the installed application, and acquiring a file corresponding to the first application identifier and the file read and write operation of the installed application;
将所述第一应用标识和所述文件读写操作对应的文件对应存储到预设的数据库中;And correspondingly storing the first application identifier and the file corresponding to the file read/write operation in a preset database;
接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端;Receiving an application migration instruction, acquiring a target application and a target terminal corresponding to the application migration instruction;
根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。Searching for a corresponding target file in the database according to the application identifier of the target application, and migrating the target file to the target terminal.
本发明实施例第二方面提供一种文件操作装置,包括:A second aspect of the embodiments of the present invention provides a file operating device, including:
文件读写操作检测模块,用于检测已安装应用的文件读写操作,获取所述 已安装应用的第一应用标识和文件读写操作对应的文件;a file read/write operation detecting module, configured to detect a file read and write operation of an installed application, and obtain the The file corresponding to the first application identifier and file read and write operations of the installed application;
记录存储模块,用于将所述第一应用标识和所述文件读写操作对应的文件对应存储到预设的数据库中;a storage storage module, configured to store the first application identifier and the file corresponding to the file read and write operation in a preset database;
应用迁移指令接收模块,用于接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端;The application migration instruction receiving module is configured to receive an application migration instruction, and acquire the target application and the target terminal corresponding to the application migration instruction;
文件迁移模块,用于根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。And a file migration module, configured to search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
本发明实施例第三方面提供一种终端,其特征在于,所述系统包括:A third aspect of the embodiments of the present invention provides a terminal, where the system includes:
存储器和处理器;Memory and processor;
所述存储器用于存储指令;The memory is for storing instructions;
所述处理器用于执行所述指令以执行本发明实施例第一方面任一方法所述的步骤。The processor is operative to execute the instructions to perform the steps of any of the methods of the first aspect of the embodiments of the present invention.
本发明实施例第四方面提供一种存储介质,所述存储介质存储有程序,所述程序用于执行本发明实施例第一方面任一方法所述的步骤。A fourth aspect of the embodiments of the present invention provides a storage medium, where the storage medium stores a program, and the program is used to perform the steps described in any one of the first aspects of the embodiments of the present invention.
附图说明DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the description of the prior art will be briefly described below. Obviously, the drawings in the following description are only It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
其中:among them:
图1为一个实施例中一种文件操作方法的流程示意图;1 is a schematic flow chart of a file operation method in an embodiment;
图2为一个实施例中一种文件操作装置的结构示意图;2 is a schematic structural view of a file operating device in an embodiment;
图3为一个实施例中运行前述文件操作方法的计算机设备的结构示意图。FIG. 3 is a schematic structural diagram of a computer device for operating the foregoing file operation method in an embodiment.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是 全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, instead of All embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.
终端中安装的每一个应用均可以对除系统文件或应用文件之外的其他文件进行读写,也就是说,在使用的过程中,针对某一个文件来讲,终端中安装的每一个应用均可以创建该文件或对该文件进行修改或者其他操作。例如,在进行某一个应用卸载时,因为不确定终端中哪些文件是由该应用创建或者修改过的,因此,在应用被卸载时,与该应用对应的文件依旧会存留于系统,随着终端使用时间的增加,会造成终端中遗留了大量的冗余文件。Each application installed in the terminal can read and write files other than system files or application files, that is, in the process of using, for each file, each application installed in the terminal is You can create or modify or otherwise make the file. For example, when performing an application uninstallation, because it is not determined which files in the terminal are created or modified by the application, when the application is uninstalled, the file corresponding to the application will remain in the system, along with the terminal. The increase in usage time will result in a large number of redundant files left in the terminal.
也就是说,在上述文件的操作方法中,因为对文件的床架、修改或读取等操作在系统或文件中并没有任何相关的记录,导致了在应用数据迁移、应用卸载等操作的过程中,无法确定与相应的应用对应的所有文件,从而导致了数据迁移不完整或系统中存在大量的冗余文件。That is to say, in the operation method of the above file, since the operation of the bed frame, modification or reading of the file does not have any relevant records in the system or the file, the process of applying data migration, application uninstallation, etc. is caused. In this case, all files corresponding to the corresponding application cannot be determined, resulting in incomplete data migration or a large number of redundant files in the system.
在本发明一实施例中提出了一种文件操作方法,该方法的实现可依赖于计算机程序,该计算机程序可以是基于Android系统或IOS系统的文件管理程序,例如手机搬家应用或数据备份迁移还原应用中的文件管理程序。该计算机系统可以是运行上述计算机程序的例如智能手机、平板电脑等终端设备。In an embodiment of the present invention, a file operation method is proposed, and the implementation of the method may depend on a computer program, which may be a file management program based on an Android system or an IOS system, such as a mobile phone moving application or a data backup migration and restoration. File manager in the app. The computer system may be a terminal device such as a smart phone or a tablet computer that runs the above computer program.
采用了上述文件操作方法和装置之后,在系统中创建一个用来记载与文件的创建、读写、修改等操作记录的数据库,在检测到终端中的应用对文件进行相关操作时,将相应的操作记录记载在该数据库中;然后在应用迁移的过程中,在上述数据库中查找与该应用对应的所有操作过的文件,并将查找到的文件随着应用的迁移一并迁移至目标终端。也就是说,通过对终端中所有文件的操作记录的监控及记录,使得在应用迁移的过程中能准确确定相应的所有文件,提高应用于文件匹配的精准度,提高应用迁移过程中的迁移的文件的完整性和精准度,提升用户体验。After adopting the above file operation method and device, a database for recording and reading, reading, writing, and modifying the operation of the file is created in the system, and when the application in the terminal is detected to perform related operations on the file, corresponding The operation record is recorded in the database; then, in the process of application migration, all the operated files corresponding to the application are searched in the above database, and the found files are migrated to the target terminal along with the migration of the application. That is to say, by monitoring and recording the operation records of all the files in the terminal, all the corresponding files can be accurately determined in the process of application migration, the accuracy of application matching is improved, and the migration in the application migration process is improved. The integrity and accuracy of the file enhances the user experience.
具体的,如图1所示,上述文件操作方法包括如下步骤:Specifically, as shown in FIG. 1 , the foregoing file operation method includes the following steps:
步骤S102:检测已安装应用的文件读写操作,获取所述已安装应用的第一应用标识和文件读写操作对应的文件。 Step S102: Detecting a file read/write operation of the installed application, and acquiring a file corresponding to the first application identifier and the file read/write operation of the installed application.
具体实施中,终端中已安装的应用对应的应用进程可以对终端中的文件进行权限之内的读写操作,例如,照片PS应用可以读取终端中的图片文件,并且,对相应的图片文件进行修改操作,又或者,WPS应用可以读取终端中的.dox格式的文件,并且可以对该文件进行编辑。In a specific implementation, the application process corresponding to the installed application in the terminal can perform read and write operations on the file in the terminal, for example, the photo PS application can read the picture file in the terminal, and the corresponding picture file The modification operation is performed, or alternatively, the WPS application can read the file in the .dox format in the terminal, and can edit the file.
在系统中开启一个进程,用于监控终端中所有文件的读写操作,例如,在终端中已安装的应用对终端中的任意文件进行读操作或者写操作时,该进程会检测到相应的操作,并对该操作进行监控。具体的,在检测到终端中已安装应用的文件读写操作时,获取与检测到的文件读写操作对应的已安装应用的应用标识,即第一应用标识,还获取与该文件读写操作对应的文件。Open a process in the system to monitor the read and write operations of all files in the terminal. For example, when an installed application in the terminal reads or writes any file in the terminal, the process detects the corresponding operation. And monitor the operation. Specifically, when detecting a file read/write operation of the installed application in the terminal, obtaining an application identifier of the installed application corresponding to the detected file read and write operation, that is, the first application identifier, and acquiring and reading the file Corresponding file.
也就是说,只要是检测到终端中已安装文件的读写操作,即获取相应的进行读操作或者写操作的应用的应用标识,并获取具体的文件,在一个实施例中,还需要获取相应的具体操作,例如,读操作或写操作或复制操作或创建操作等。That is, as long as the read/write operation of the installed file in the terminal is detected, that is, the application identifier of the corresponding read or write operation is obtained, and a specific file is obtained, in one embodiment, the corresponding file needs to be obtained. Specific operations, such as read operations or write operations or copy operations or create operations.
步骤S104:将所述第一应用标识和所述文件读写操作对应的文件对应存储到预设的数据库中。Step S104: Correspondly store the first application identifier and the file corresponding to the file read/write operation into a preset database.
在本实施例中,在终端中创建一个数据库,该数据库在终端第一次使用时已创建完毕。在检测到终端中任意的已安装文件的读写操作之后,将对应的进行读写操作的应用标识以及对应的文件均存储在该数据库中。需要说明的是,在该数据库中,存储了终端中每一次针对任意文件的读写操作的相关记录,并且每一条记录均包含了应用标识、文件名称、具体操作等,也就是说,在该数据库中,可以根据应用标识,确定与该应用对应的所有的操作对应的文件,并且,还可以根据文件名称确定对该文件进行过相关操作的所有应用。In this embodiment, a database is created in the terminal, which has been created when the terminal is first used. After detecting the read and write operations of any installed files in the terminal, the corresponding application identifiers for reading and writing operations and corresponding files are stored in the database. It should be noted that, in the database, related records of read and write operations for any file in the terminal are stored, and each record includes an application identifier, a file name, a specific operation, and the like, that is, in the database. In the database, all the files corresponding to the operation corresponding to the application may be determined according to the application identifier, and all applications that have been related to the file may also be determined according to the file name.
需要说明的是,若一个应用仅仅是读取了某一个文件,却并没有对该文件进行任何写操作或者修改、编辑操作,则说明该应用与该文件的关系可能不是很紧密,在进行应用卸载或者应用数据迁移的过程中不需要考虑该文件。It should be noted that if an application only reads a certain file, but does not perform any write operation or modification or editing operation on the file, the relationship between the application and the file may not be very close, and the application is performed. This file does not need to be considered during the process of uninstalling or applying data migration.
具体的,在一个实施例中,上述获取所述已安装应用的第一应用标识和文件读写操作对应的文件的步骤包括:仅获取文件写操作对应的文件。Specifically, in an embodiment, the step of acquiring the file corresponding to the first application identifier and the file read/write operation of the installed application includes: acquiring only the file corresponding to the file write operation.
需要说明的是,在本实施例中,上述针对系统中文件的读写操作的监控,可以是通过系统文件读写接口的接口函数实现的。具体的,上述获取所述已安 装应用的第一应用标识和文件读写操作对应的文件的步骤包括:预定义系统文件读写接口,所述已安装应用通过所述系统文件读写接口进行读写文件操作;通过所述系统文件读写接口获取所述已安装应用的第一应用标识和文件读写操作对应的文件。It should be noted that, in this embodiment, the foregoing monitoring of the read and write operations of files in the system may be implemented through an interface function of the system file read/write interface. Specifically, the above obtaining the said security The step of loading the first application identifier of the application and the file corresponding to the file read/write operation includes: pre-defining a system file read/write interface, wherein the installed application reads and writes a file operation through the system file read/write interface; The file read/write interface acquires a file corresponding to the first application identifier and the file read/write operation of the installed application.
也就是说,对系统文件读写接口的接口函数进行修改,终端中所有的已安装应用在对终端中的文件实现读写操作时,都必须经过该系统文件读写接口的接口函数来实现,也就是说,相应的应用进程通过调用系统文件读写接口的接口函数获取已安装应用对应的第一应用标识以及其需要进行读写操作的文件。That is to say, the interface function of the system file read/write interface is modified, and all the installed applications in the terminal must implement the read/write operation on the file in the terminal, and must be implemented through the interface function of the system file read/write interface. That is to say, the corresponding application process obtains the first application identifier corresponding to the installed application and the file that needs to be read and written by calling the interface function of the system file read/write interface.
步骤S106:接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端。Step S106: Receive an application migration instruction, and acquire a target application and a target terminal corresponding to the application migration instruction.
在本实施例中,终端与终端之间可以进行应用数据的迁移,即将迁移源终端中某一个应用相关的所有数据迁移至迁移终端中并进行存储。在本实施例中,应用数据的迁移可以通过迁移终端与迁移源终端之间的通信连接实现,并且可以是基于终端上安装的例如手机搬家的手机数据备份和迁移的应用程序。In this embodiment, the application data is migrated between the terminal and the terminal, and all data related to one of the applications in the source terminal is migrated to the migration terminal and stored. In this embodiment, the migration of the application data may be implemented by a communication connection between the migration terminal and the migration source terminal, and may be an application based on mobile phone data backup and migration installed on the terminal, for example, mobile phone.
例如,在迁移终端和迁移源终端中开启了手机搬家等数据迁移应用之后,用户在迁移源终端中可以输入针对某一个目标应用的应用迁移指令。在检测到用书输入的应用迁移指令之后,获取该应用迁移指令对应的目标应用以及对应的目标终端,该目标终端即为迁移终端。For example, after the data migration application such as mobile phone relocation is enabled in the migration terminal and the migration source terminal, the user can input an application migration instruction for a target application in the migration source terminal. After detecting the application migration instruction input by the book, the target application corresponding to the application migration instruction and the corresponding target terminal are obtained, and the target terminal is the migration terminal.
步骤S108:根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。Step S108: Search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
在本实施例中,在进行应用迁移的过程中,迁移的不仅仅是相应的应用文件,还包括该应用相关的文件,因此,在目标应用确定之后,根据目标应用的应用标识在上述预设的数据库中确定与该目标应用对应的所有文件,即目标应用进行读写操作过的所有文件,即目标文件。在目标确定之后,根据上述检测到的应用迁移指令,将上述目标文件迁移至迁移终端,即迁移至目标终端。In this embodiment, in the process of performing application migration, not only the corresponding application file but also the file related to the application is migrated. Therefore, after the target application is determined, the application identifier according to the target application is in the preset. The database determines all the files corresponding to the target application, that is, all the files that the target application has read and written, that is, the target file. After the target is determined, the target file is migrated to the migration terminal, that is, migrated to the target terminal according to the detected application migration instruction.
可选的,在其他应用场景中,例如应用卸载的应用场景中,也可以根据本方法中确定与一个应用对应的所有文件的方法,确定在应用卸载的过程中需要卸载的文件。 Optionally, in other application scenarios, such as an application uninstallation scenario, the method for determining all files corresponding to one application in the method may also be used to determine a file that needs to be uninstalled during the application uninstallation process.
具体的,所述方法还包括:接收应用卸载指令,获取所述应用卸载指令对应的目标卸载应用;根据所述目标卸载应用的应用标识在所述数据库中查找与所述目标卸载应用对应的目标卸载文件,根据所述应用卸载指令删除所述目标卸载文件。Specifically, the method further includes: receiving an application uninstallation instruction, acquiring a target uninstallation application corresponding to the application uninstallation instruction; and searching, in the database, a target corresponding to the target uninstallation application according to the application identifier of the target uninstallation application. Unloading the file, deleting the target uninstall file according to the application uninstallation instruction.
也就是说,在进行应用卸载时,根据对应的需要卸载的目标卸载应用在上述数据库中确定与该目标卸载应用对应的目标卸载文件,并进行删除。进一步的,某一个文件,可能不仅仅被一个应用进行读写过,若目标卸载应用只是其中的一个,则在此种情况下,直接将其进行删除,则可能造成其他应用的数据完整性收到影响,因此,在一个实施例中,还需要考虑目标卸载文件是否还被其他应用读写过,即在删除相应的目标卸载文件之前,在上述数据库中,查找与该文件对应的应用,若存在除目标卸载应用之外的其他应用,则不删除该目标卸载文件,若不存在除目标卸载应用之外的其他应用,则执行上述删除目标卸载文件的步骤。That is to say, when the application uninstallation is performed, the target uninstallation file corresponding to the target uninstalled application is determined and deleted in the above database according to the corresponding target uninstalled application that needs to be uninstalled. Further, a certain file may not only be read and written by one application. If the target uninstall application is only one of them, in this case, directly deleting it may result in data integrity of other applications. In an embodiment, it is also necessary to consider whether the target uninstall file is also read and written by other applications, that is, before deleting the corresponding target uninstall file, in the above database, searching for an application corresponding to the file, if If there is another application other than the target uninstall application, the target uninstall file is not deleted, and if there is no other application than the target uninstall application, the step of deleting the target uninstall file is performed.
可选的,在一个实施例中,上述接收应用迁移指令的步骤之前还包括;检测应用的安装操作,获取所述安装操作对应的第二应用标识和安装操作写入的文件;将所述第二应用标识和所述安装操作写入的文件存储到预设的数据库中;执行所述接收应用迁移指令的步骤。Optionally, in an embodiment, the step of receiving the application migration instruction further includes: detecting an installation operation of the application, acquiring a second application identifier corresponding to the installation operation, and a file written by the installation operation; The second application identifier and the file written by the installation operation are stored in a preset database; and the step of receiving the application migration instruction is performed.
也就是说,可以在终端中安装新的应用,并且,在安装一个应用时,需要对终端上的部分文件进行修改,即将相应的设置或者配置写入到相应的系统文件中去。在安装新的应用时,获取相应的安装操作对应的应用标识,以及与该安装操作对应的写入的文件,然后将该应用标识与相应的安装操作写入的文件存储到上述数据库中。然后在确定与该应用对应的文件时,确定的文件该包括上述与安装操作写入的文件;在进行应用数据迁移时,迁移的数据还包括有该安装操作写入的文件。That is to say, a new application can be installed in the terminal, and when an application is installed, some files on the terminal need to be modified, that is, the corresponding settings or configurations are written into the corresponding system files. When the new application is installed, the application identifier corresponding to the corresponding installation operation, the written file corresponding to the installation operation, and the file written by the corresponding installation operation are stored in the database. Then, when determining the file corresponding to the application, the determined file includes the file written by the installation operation described above; when the application data migration is performed, the migrated data further includes the file written by the installation operation.
此外,在一个实施例中,还提出了一种文件操作装置,如图2所示,上述装置包括文件读写操作检测模块102、记录存储模块104、应用迁移指令接收模块106、文件迁移模块108,其中: In addition, in one embodiment, a file operation device is also proposed. As shown in FIG. 2, the device includes a file read/write operation detection module 102, a record storage module 104, an application migration instruction receiving module 106, and a file migration module 108. ,among them:
文件读写操作检测模块102,用于检测已安装应用的文件读写操作,获取所述已安装应用的第一应用标识和文件读写操作对应的文件;The file read/write operation detecting module 102 is configured to detect a file read and write operation of the installed application, and obtain a file corresponding to the first application identifier and the file read and write operation of the installed application;
记录存储模块104,用于将所述第一应用标识和所述文件读写操作对应的文件对应存储到预设的数据库中;a record storage module 104, configured to store the first application identifier and the file corresponding to the file read and write operation in a preset database;
应用迁移指令接收模块106,用于接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端;The application migration instruction receiving module 106 is configured to receive an application migration instruction, and acquire a target application and a target terminal corresponding to the application migration instruction;
文件迁移模块108,用于根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。The file migration module 108 is configured to search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
所述所述文件读写操作检测模块102在用于检测已安装应用的文件读写操作时,具体用于:在系统中开启一个进程;基于所述开启的进程,检测所述已安装应用的文件读写操作。When the file read/write operation detecting module 102 is configured to detect a file read/write operation of the installed application, the method is specifically configured to: start a process in the system; and detect the installed application based on the opened process. File read and write operations.
可选的,在一个实施例中,如图2所示,上述装置还包括应用安装模块110,用于检测应用的安装操作,获取所述安装操作对应的第二应用标识和安装操作写入的文件;将所述第二应用标识和所述安装操作写入的文件存储到预设的数据库中;调用所述应用迁移指令接收模块106。Optionally, in an embodiment, as shown in FIG. 2, the foregoing apparatus further includes an application installation module 110, configured to detect an installation operation of the application, obtain a second application identifier corresponding to the installation operation, and write the installation operation. And storing the file written by the second application identifier and the installation operation into a preset database; calling the application migration instruction receiving module 106.
所述迁移的数据还包括安装操作写入的文件。The migrated data also includes files written by the installation operation.
可选的,在一个实施例中,文件读写操作检测模块还102用于预定义系统文件读写接口,所述已安装应用通过所述系统文件读写接口进行读写文件操作;通过所述系统文件读写接口获取所述已安装应用的第一应用标识和文件读写操作对应的文件。Optionally, in one embodiment, the file read/write operation detecting module 102 is further configured to pre-define a system file read/write interface, and the installed application reads and writes a file operation through the system file read/write interface; The system file read/write interface acquires a file corresponding to the first application identifier and the file read and write operation of the installed application.
可选的,在一个实施例中,文件读写操作检测模块102还用于仅获取文件写操作对应的文件。Optionally, in one embodiment, the file read/write operation detecting module 102 is further configured to obtain only the file corresponding to the file write operation.
可选的,在一个实施例中,如图2所示,上述装置还包括应用卸载模块112,用于接收应用卸载指令,获取所述应用卸载指令对应的目标卸载应用;根据所述目标卸载应用的应用标识在所述数据库中查找与所述目标卸载应用对应的目标卸载文件,根据所述应用卸载指令删除所述目标卸载文件。Optionally, in an embodiment, as shown in FIG. 2, the foregoing apparatus further includes an application uninstalling module 112, configured to receive an application uninstallation instruction, acquire a target uninstallation application corresponding to the application uninstallation instruction, and uninstall the application according to the target. The application identifier searches the database for a target uninstall file corresponding to the target uninstall application, and deletes the target uninstall file according to the application uninstallation instruction.
所述文件操作装置还包括:数据库建立模块114,用于在终端中创建一个数据库,所述数据库在所述终端第一次使用时已创建完毕,所述数据库用于存 储所述终端中每一次针对任意文件的读写操作的相关记录,并且每一条记录均包括应用标识、文件名称、具体操作。The file operating device further includes: a database establishing module 114, configured to create a database in the terminal, the database is created when the terminal is used for the first time, and the database is used for storing Each record of the read and write operations for any file in the terminal is stored, and each record includes an application identifier, a file name, and a specific operation.
所述文件操作装置还包括:The file operating device further includes:
查找模块116,用于在所述数据库中查找查找与所述目标卸载文件对应的应用;The searching module 116 is configured to search, in the database, an application corresponding to the target uninstall file.
触发模块118,用于若不存在除所述目标卸载应用之外的其他应用,则触发所述应用卸载模块执行所述根据所述应用卸载指令删除所述目标卸载文件的操作。The triggering module 118 is configured to trigger the application uninstalling module to perform the operation of deleting the target uninstall file according to the application uninstalling instruction if there is no other application than the target uninstalling application.
采用了上述文件操作方法和装置之后,在系统中创建一个用来记载与文件的创建、读写、修改等操作记录的数据库,在检测到终端中的应用对文件进行相关操作时,将相应的操作记录记载在该数据库中;然后在应用迁移的过程中,在上述数据库中查找与该应用对应的所有操作过的文件,并将查找到的文件随着应用的迁移一并迁移至目标终端。也就是说,通过对终端中所有文件的操作记录的监控及记录,使得在应用迁移的过程中能准确确定相应的所有文件,提高应用于文件匹配的精准度,提高应用迁移过程中的迁移的文件的完整性和精准度,提升用户体验。After adopting the above file operation method and device, a database for recording and reading, reading, writing, and modifying the operation of the file is created in the system, and when the application in the terminal is detected to perform related operations on the file, corresponding The operation record is recorded in the database; then, in the process of application migration, all the operated files corresponding to the application are searched in the above database, and the found files are migrated to the target terminal along with the migration of the application. That is to say, by monitoring and recording the operation records of all the files in the terminal, all the corresponding files can be accurately determined in the process of application migration, the accuracy of application matching is improved, and the migration in the application migration process is improved. The integrity and accuracy of the file enhances the user experience.
在一个实施例中,如图3所示,图3展示了一种运行上述文件操作方法的计算机系统的终端。该计算机系统可以是智能手机、平板电脑、掌上电脑等终端设备。具体的,可包括通过系统总线连接的外部输入接口1001、处理器1002、存储器1003和输出接口1004。其中,外部输入接口1001可选的可至少包括网络接口10012。存储器1003可包括外存储器10032(例如硬盘、光盘或软盘等)和内存储器10034。输出接口1004可至少包括显示屏10042等设备。In one embodiment, as shown in FIG. 3, FIG. 3 illustrates a terminal of a computer system that operates the above described method of operating a file. The computer system can be a terminal device such as a smart phone, a tablet computer, or a palmtop computer. Specifically, an external input interface 1001, a processor 1002, a memory 1003, and an output interface 1004 connected through a system bus may be included. The external input interface 1001 can optionally include at least a network interface 10012. The memory 1003 may include an external memory 10032 (eg, a hard disk, an optical disk, or a floppy disk, etc.) and an internal memory 10034. The output interface 1004 can include at least a device such as a display 10042.
在本实施例中,本方法的运行基于计算机程序,该计算机程序的程序文件存储于前述计算机系统的外存储器10032中,在运行时被加载到内存储器10034中,然后被编译为机器码之后传递至处理器1002中执行,从而使得基于冯诺依曼体系的计算机系统中形成逻辑上的文件读写操作检测模块102、记录存储模块104、应用迁移指令接收模块106、文件迁移模块108、应用安装 模块110、应用卸载模块112、数据库建立模块114、查找模块116、触发模块118。且在上述文件操作方法执行过程中,输入的参数均通过外部输入接口1001接收,并传递至存储器1003中缓存,然后输入到处理器1002中进行处理,处理的结果数据或缓存于存储器1003中进行后续地处理,或被传递至输出接口1004进行输出。In the present embodiment, the operation of the method is based on a computer program whose program file is stored in the external memory 10032 of the aforementioned computer system, loaded into the internal memory 10034 at runtime, and then compiled into machine code and then passed. Executed in the processor 1002, so that a logical file read/write operation detecting module 102, a record storage module 104, an application migration instruction receiving module 106, a file migration module 108, and an application installation are formed in a von Neumann system-based computer system. The module 110, the application uninstallation module 112, the database establishment module 114, the lookup module 116, and the trigger module 118. During the execution of the file operation method, the input parameters are received by the external input interface 1001, and transferred to the cache in the memory 1003, and then input to the processor 1002 for processing, and the processed result data is cached in the memory 1003. Subsequent processing, or passed to output interface 1004 for output.
本发明实施例方法中的步骤可以根据实际需要进行顺序调整、合并和删减。The steps in the method of the embodiment of the present invention may be sequentially adjusted, merged, and deleted according to actual needs.
本发明实施例终端中的单元可以根据实际需要进行合并、划分和删减。本发明实施例提供的终端包括但不限于搭载
Figure PCTCN2017092244-appb-000001
或者其它操作系统的终端,诸如移动电话。也可以是其它终端,诸如具有触敏表面(例如,触摸屏显示器和/或触控板)的膝上型计算机或平板电脑或台式计算机。
The units in the terminal in the embodiment of the present invention may be combined, divided, and deleted according to actual needs. The terminal provided by the embodiment of the present invention includes but is not limited to piggybacking
Figure PCTCN2017092244-appb-000001
Or terminals of other operating systems, such as mobile phones. Other terminals may also be used, such as a laptop or tablet or desktop computer with a touch-sensitive surface (eg, a touch screen display and/or a touch pad).
在下面的讨论中,介绍了一种包括显示器和触敏表面的终端。然而应当理解,终端可以包括一个或多个其他物理用户接口设备,诸如物理键盘、鼠标和/或操作杆。In the discussion that follows, a terminal including a display and a touch-sensitive surface is described. It should be understood, however, that the terminal can include one or more other physical user interface devices, such as a physical keyboard, mouse, and/or joystick.
终端通常支持多种应用程序,诸如以下中的一种或多种:画图应用程序、呈现应用程序、文字处理应用程序、网页创建应用程序、盘编辑应用程序、电子表格应用程序、游戏应用程序、电话应用程序、视频会议应用程序、电子邮件应用程序、即时消息应用程序、锻炼支持应用程序、相片管理应用程序、数字相机应用程序、数字视频摄像机应用程序、网络浏览应用程序、数字音乐播放器应用程序、和/或数字视频播放器应用程序。Terminals typically support a variety of applications, such as one or more of the following: a drawing application, a rendering application, a word processing application, a web page creation application, a disk editing application, a spreadsheet application, a gaming application, Telephony applications, video conferencing applications, email applications, instant messaging applications, workout support applications, photo management applications, digital camera applications, digital video camera applications, web browsing applications, digital music player applications Program, and/or digital video player application.
可在终端上执行的各种应用程序可使用至少一个共用的物理用户接口设备,诸如触敏表面。触敏表面的一种或多种功能以及显示在终端上的相应信息可从一种应用程序调整和/或变化至下一种应用程序和/或在相应应用程序内被调整和/或变化。这样,终端的共用物理架构(诸如触敏表面)可利用对于用户而言直观清楚的用户界面来支持各种应用程序。The various applications that can be executed on the terminal can use at least one shared physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal may be adjusted and/or changed from one application to the next and/or adjusted and/or varied within the respective application. In this way, the shared physical architecture of the terminal, such as a touch-sensitive surface, can support a variety of applications with a user interface that is intuitive to the user.
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算 机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(read-only memory,ROM)或随机存储记忆体(random access memory,RAM)等。One of ordinary skill in the art can understand that all or part of the process of implementing the above embodiment method can be completed by a computer program to instruct related hardware, and the program can be stored in a calculation. The machine can be read into a storage medium, and when executed, the program can include the flow of an embodiment of the methods as described above. The storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
以上所揭露的仅为本发明较佳实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。 The above is only the preferred embodiment of the present invention, and the scope of the present invention is not limited thereto, and thus equivalent changes made in the claims of the present invention are still within the scope of the present invention.

Claims (20)

  1. 一种文件操作方法,其特征在于,包括:A file operation method, comprising:
    检测已安装应用的文件读写操作,获取所述已安装应用的第一应用标识和文件读写操作对应的文件;Detecting a file read/write operation of the installed application, and acquiring a file corresponding to the first application identifier and the file read and write operation of the installed application;
    将所述第一应用标识和所述文件读写操作对应的文件对应存储到预设的数据库中;And correspondingly storing the first application identifier and the file corresponding to the file read/write operation in a preset database;
    接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端;Receiving an application migration instruction, acquiring a target application and a target terminal corresponding to the application migration instruction;
    根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。Searching for a corresponding target file in the database according to the application identifier of the target application, and migrating the target file to the target terminal.
  2. 根据权利要求1所述的文件操作方法,其特征在于,所述检测已安装应用的文件读写操作,包括:The file operation method according to claim 1, wherein the detecting a file read and write operation of the installed application comprises:
    在系统中开启一个进程;Open a process in the system;
    基于所述开启的进程,检测所述已安装应用的文件读写操作。A file read and write operation of the installed application is detected based on the opened process.
  3. 根据权利要求1所述的文件操作方法,其特征在于,所述方法还包括:The file operating method according to claim 1, wherein the method further comprises:
    在终端中创建一个数据库,所述数据库在所述终端第一次使用时已创建完毕,所述数据库用于存储所述终端中每一次针对任意文件的读写操作的相关记录,并且每一条记录均包括应用标识、文件名称、具体操作。Creating a database in the terminal, the database has been created when the terminal is used for the first time, and the database is used to store related records of read and write operations for any file in the terminal, and each record Both include application identification, file name, and specific operations.
  4. 根据权利要求1所述的文件操作方法,其特征在于,所述接收应用迁移指令的步骤之前还包括;The file operating method according to claim 1, wherein the step of receiving the application migration instruction further comprises:
    检测应用的安装操作,获取所述安装操作对应的第二应用标识和安装操作写入的文件;Detecting an installation operation of the application, obtaining a second application identifier corresponding to the installation operation, and a file written by the installation operation;
    将所述第二应用标识和所述安装操作写入的文件存储到预设的数据库中;And storing the second application identifier and the file written by the installation operation into a preset database;
    执行所述接收应用迁移指令的步骤。The step of receiving the application migration instruction is performed.
  5. 根据权利要求4所述的文件操作方法,其特征在于,所述迁移的数据 还包括安装操作写入的文件。The file operating method according to claim 4, wherein said migrated data It also includes files written by the install operation.
  6. 根据权利要求1所述的文件操作方法,其特征在于,所述获取所述已安装应用的第一应用标识和文件读写操作对应的文件的步骤包括;The file operation method according to claim 1, wherein the step of acquiring the first application identifier of the installed application and the file corresponding to the file read/write operation comprises:
    预定义系统文件读写接口,所述已安装应用通过所述系统文件读写接口进行读写文件操作;Pre-defining a system file read/write interface, wherein the installed application reads and writes a file operation through the system file read/write interface;
    通过所述系统文件读写接口获取所述已安装应用的第一应用标识和文件读写操作对应的文件。Obtaining, by the system file read/write interface, a file corresponding to the first application identifier and the file read and write operation of the installed application.
  7. 根据权利要求1所述的文件操作方法,其特征在于,所述获取所述已安装应用的第一应用标识和文件读写操作对应的文件的步骤包括:The file operation method according to claim 1, wherein the step of acquiring the first application identifier of the installed application and the file corresponding to the file read/write operation comprises:
    仅获取文件写操作对应的文件。Only the file corresponding to the file write operation is obtained.
  8. 根据权利要求1所述的文件操作方法,其特征在于,所述方法还包括:The file operating method according to claim 1, wherein the method further comprises:
    接收应用卸载指令,获取所述应用卸载指令对应的目标卸载应用;Receiving an application uninstallation instruction, acquiring a target uninstall application corresponding to the application uninstallation instruction;
    根据所述目标卸载应用的应用标识在所述数据库中查找与所述目标卸载应用对应的目标卸载文件,根据所述应用卸载指令删除所述目标卸载文件。And searching for the target uninstall file corresponding to the target uninstall application in the database according to the application identifier of the target uninstall application, and deleting the target uninstall file according to the application uninstallation instruction.
  9. 根据权利要求8所述的文件操作方法,其特征在于,所述根据所述应用卸载指令删除所述目标卸载文件之前,所述方法还包括:The file operation method according to claim 8, wherein the method further comprises: before deleting the target uninstall file according to the application uninstallation instruction, the method further comprising:
    在所述数据库中查找查找与所述目标卸载文件对应的应用;Finding, in the database, an application corresponding to the target uninstall file;
    若不存在除所述目标卸载应用之外的其他应用,则执行所述根据所述应用卸载指令删除所述目标卸载文件的步骤。If there is no other application than the target uninstall application, the step of deleting the target uninstall file according to the application uninstallation instruction is performed.
  10. 一种文件操作装置,其特征在于,包括:A document operating device, comprising:
    文件读写操作检测模块,用于检测已安装应用的文件读写操作,获取所述已安装应用的第一应用标识和文件读写操作对应的文件;a file read/write operation detecting module, configured to detect a file read and write operation of the installed application, and obtain a file corresponding to the first application identifier and the file read and write operation of the installed application;
    记录存储模块,用于将所述第一应用标识和所述文件读写操作对应的文件 对应存储到预设的数据库中;a storage storage module, configured to: record the first application identifier and the file corresponding to the file read and write operation Corresponding to the default database;
    应用迁移指令接收模块,用于接收应用迁移指令,获取所述应用迁移指令对应的目标应用和目标终端;The application migration instruction receiving module is configured to receive an application migration instruction, and acquire the target application and the target terminal corresponding to the application migration instruction;
    文件迁移模块,用于根据所述目标应用的应用标识在所述数据库中查找对应的目标文件,将所述目标文件迁移至所述目标终端。And a file migration module, configured to search for a corresponding target file in the database according to the application identifier of the target application, and migrate the target file to the target terminal.
  11. 根据权利要求10所述的文件操作装置,其特征在于,所述文件读写操作检测模块在用于检测已安装应用的文件读写操作时,具体用于:The file operating device according to claim 10, wherein the file read/write operation detecting module is configured to: when detecting a file read/write operation of the installed application, specifically:
    在系统中开启一个进程;基于所述开启的进程,检测所述已安装应用的文件读写操作。Opening a process in the system; detecting a file read and write operation of the installed application based on the opened process.
  12. 根据权利要求10所述的文件操作装置,其特征在于,所述文件操作装置还包括:The document operating device according to claim 10, wherein the file operating device further comprises:
    数据库建立模块,用于在终端中创建一个数据库,所述数据库在所述终端第一次使用时已创建完毕,所述数据库用于存储所述终端中每一次针对任意文件的读写操作的相关记录,并且每一条记录均包括应用标识、文件名称、具体操作。a database establishing module, configured to create a database in the terminal, the database is created when the terminal is used for the first time, and the database is used to store each read and write operation of any file in the terminal. Record, and each record includes the application ID, file name, and specific operations.
  13. 根据权利要求10所述的文件操作装置,其特征在于,所述装置还包括:The document operating device according to claim 10, wherein the device further comprises:
    应用安装模块,用于检测应用的安装操作,获取所述安装操作对应的第二应用标识和安装操作写入的文件;将所述第二应用标识和所述安装操作写入的文件存储到预设的数据库中;调用所述应用迁移指令接收模块。An application installation module, configured to detect an installation operation of the application, obtain a second application identifier corresponding to the installation operation, and a file written by the installation operation; store the second application identifier and the file written by the installation operation to the pre-file Set in the database; call the application migration instruction receiving module.
  14. 根据权利要求13所述的文件操作装置,其特征在于,所述迁移的数据还包括安装操作写入的文件。The file operating device according to claim 13, wherein said migrated data further comprises a file written by a mounting operation.
  15. 根据权利要求10所述的文件操作装置,其特征在于, A document operating device according to claim 10, wherein
    所述文件读写操作检测模块还用于预定义系统文件读写接口,所述已安装应用通过所述系统文件读写接口进行读写文件操作;通过所述系统文件读写接口获取所述已安装应用的第一应用标识和文件读写操作对应的文件。The file read/write operation detecting module is further configured to pre-define a system file read/write interface, and the installed application reads and writes a file operation through the system file read/write interface; Install the first application ID of the application and the file corresponding to the file read and write operations.
  16. 根据权利要求10所述的文件操作装置,其特征在于,所述文件读写操作检测模块还用于仅获取文件写操作对应的文件。The file operating device according to claim 10, wherein the file read/write operation detecting module is further configured to acquire only a file corresponding to the file write operation.
  17. 根据权利要求10所述的文件操作装置,其特征在于,所述装置还包括:The document operating device according to claim 10, wherein the device further comprises:
    应用卸载模块,用于接收应用卸载指令,获取所述应用卸载指令对应的目标卸载应用;根据所述目标卸载应用的应用标识在所述数据库中查找与所述目标卸载应用对应的目标卸载文件,根据所述应用卸载指令删除所述目标卸载文件。An application uninstalling module, configured to receive an application uninstallation instruction, obtain a target uninstallation application corresponding to the application uninstallation instruction, and search for, in the database, a target uninstallation file corresponding to the target uninstalled application according to the application identifier of the target uninstallation application, The target uninstall file is deleted according to the application uninstallation instruction.
  18. 根据权利要求17所述的文件操作装置,其特征在于,所述文件操作装置还包括:The document operating device according to claim 17, wherein the file operating device further comprises:
    查找模块,用于在所述数据库中查找查找与所述目标卸载文件对应的应用;a searching module, configured to search, in the database, an application corresponding to the target uninstall file;
    触发模块,用于若不存在除所述目标卸载应用之外的其他应用,则触发所述应用卸载模块执行所述根据所述应用卸载指令删除所述目标卸载文件的操作。The triggering module is configured to trigger the application uninstalling module to perform the operation of deleting the target uninstall file according to the application uninstalling instruction if there is no other application than the target uninstalling application.
  19. 一种终端,其特征在于,所述系统包括:存储器和处理器;A terminal, characterized in that the system comprises: a memory and a processor;
    所述存储器用于存储指令;The memory is for storing instructions;
    所述处理器用于执行所述指令以执行权利要求1-9任一项所述的方法。The processor is operative to execute the instructions to perform the method of any of claims 1-9.
  20. 一种存储介质,所述存储介质存储有程序,所述程序用于执行权利要求1-9任一项所述的方法。 A storage medium storing a program for performing the method of any one of claims 1-9.
PCT/CN2017/092244 2016-09-14 2017-07-07 File operation method and device WO2018049883A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610825679.7 2016-09-14
CN201610825679.7A CN106484779B (en) 2016-09-14 2016-09-14 File operation method and device

Publications (1)

Publication Number Publication Date
WO2018049883A1 true WO2018049883A1 (en) 2018-03-22

Family

ID=58273602

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/092244 WO2018049883A1 (en) 2016-09-14 2017-07-07 File operation method and device

Country Status (2)

Country Link
CN (1) CN106484779B (en)
WO (1) WO2018049883A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710571A (en) * 2018-12-27 2019-05-03 腾讯音乐娱乐科技(深圳)有限公司 A kind of document analysis method, equipment and storage medium
CN109977040A (en) * 2019-03-27 2019-07-05 努比亚技术有限公司 File read-write authority control method, device, terminal and storage medium

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106484779B (en) * 2016-09-14 2020-05-05 Oppo广东移动通信有限公司 File operation method and device
CN109558749B (en) * 2018-11-28 2021-06-01 Oppo广东移动通信有限公司 Data storage method, terminal and computer storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092664A (en) * 2013-02-07 2013-05-08 珠海市君天电子科技有限公司 Processing method and device of data file of android system
CN104133641A (en) * 2014-07-24 2014-11-05 深圳市同洲电子股份有限公司 External storage equipment file deleting method and device
CN104866510A (en) * 2014-02-26 2015-08-26 北京金山安全软件有限公司 Method and device for removing residual file and method and device for establishing feature library of residual file
WO2016066130A1 (en) * 2014-10-31 2016-05-06 腾讯科技(深圳)有限公司 Method, apparatus and system for migrating application data between terminals
CN106484779A (en) * 2016-09-14 2017-03-08 广东欧珀移动通信有限公司 File operation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103092664A (en) * 2013-02-07 2013-05-08 珠海市君天电子科技有限公司 Processing method and device of data file of android system
CN104866510A (en) * 2014-02-26 2015-08-26 北京金山安全软件有限公司 Method and device for removing residual file and method and device for establishing feature library of residual file
CN104133641A (en) * 2014-07-24 2014-11-05 深圳市同洲电子股份有限公司 External storage equipment file deleting method and device
WO2016066130A1 (en) * 2014-10-31 2016-05-06 腾讯科技(深圳)有限公司 Method, apparatus and system for migrating application data between terminals
CN106484779A (en) * 2016-09-14 2017-03-08 广东欧珀移动通信有限公司 File operation method and device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109710571A (en) * 2018-12-27 2019-05-03 腾讯音乐娱乐科技(深圳)有限公司 A kind of document analysis method, equipment and storage medium
CN109977040A (en) * 2019-03-27 2019-07-05 努比亚技术有限公司 File read-write authority control method, device, terminal and storage medium
CN109977040B (en) * 2019-03-27 2023-11-14 努比亚技术有限公司 File read-write permission control method, device, terminal and storage medium

Also Published As

Publication number Publication date
CN106484779A (en) 2017-03-08
CN106484779B (en) 2020-05-05

Similar Documents

Publication Publication Date Title
WO2018049888A1 (en) Application data migration method and device
KR102128139B1 (en) File management with placeholders
WO2018049883A1 (en) File operation method and device
US20160224207A1 (en) Method and system for freezing and unfreezing applications
US20150032690A1 (en) Virtual synchronization with on-demand data delivery
US10191838B2 (en) Method and device for checking influence of deleting cache file, and mobile terminal
CN109564566B (en) Discovery of calling applications for controlling file hydration behavior
US11232066B2 (en) Method for data migration and terminal
CN108717516B (en) File labeling method, terminal and medium
WO2018049880A1 (en) Data migration method and device
US9910662B2 (en) Selectively migrating applications during an operating system upgrade
US9894510B1 (en) Event-based data backup and recovery for mobile devices
CN111782474A (en) Log processing method and device, electronic equipment and medium
US9753933B2 (en) Electronic device and method for mounting file system using virtual block device
US9910667B2 (en) Segregating a monolithic computing system into multiple attachable application containers based on application boundaries
CN106547485B (en) Data migration method and device
WO2022083190A1 (en) Data downloading method and apparatus, computer device, and storage medium
US20210248106A1 (en) Systems and methods for updating select files in an image backup
WO2018006545A1 (en) Read and write method and apparatus for sd card
CN112286448A (en) Object access method and device, electronic equipment and machine-readable storage medium
CN110795389A (en) Storage snapshot based copying method, user equipment, storage medium and device
CN115421785B (en) Method, device and medium for transplanting application program
CN111813323A (en) Film data copying system, method, terminal and storage medium
WO2022088711A1 (en) Program execution method, program processing method, and related device
US7702890B2 (en) Information processing apparatus and program

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: 17850086

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17850086

Country of ref document: EP

Kind code of ref document: A1