CN109359091B - File management method, device, terminal and computer readable storage medium - Google Patents

File management method, device, terminal and computer readable storage medium Download PDF

Info

Publication number
CN109359091B
CN109359091B CN201811129170.4A CN201811129170A CN109359091B CN 109359091 B CN109359091 B CN 109359091B CN 201811129170 A CN201811129170 A CN 201811129170A CN 109359091 B CN109359091 B CN 109359091B
Authority
CN
China
Prior art keywords
file
target file
target
external terminal
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811129170.4A
Other languages
Chinese (zh)
Other versions
CN109359091A (en
Inventor
彭学锋
潘腾蛟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201811129170.4A priority Critical patent/CN109359091B/en
Publication of CN109359091A publication Critical patent/CN109359091A/en
Application granted granted Critical
Publication of CN109359091B publication Critical patent/CN109359091B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The present application belongs to the field of communications technologies, and in particular, to a file management method, apparatus, terminal, and computer-readable storage medium, where the method includes: receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file; if the operation code is a deletion operation code, acquiring file data of a first target file according to file identification information of the first target file; creating a second target file on a preset storage path, and writing the file data into the second target file; deleting the first target file; that is to say, the first target file is not deleted directly after receiving the file operation request message, but is deleted after being stored on a preset storage path, thereby effectively avoiding the technical problem that the file in the terminal device is lost due to misoperation or other reasons in the file management operation.

Description

File management method, device, terminal and computer readable storage medium
Technical Field
The present application belongs to the field of communications technologies, and in particular, to a file management method, an apparatus, a terminal, and a computer-readable storage medium.
Background
Media Transfer Protocol (MTP) is a Protocol for transferring Media files. At present, many mobile phones support connection in an MTP mode when connected to a computer, and when the mobile phones are connected to the computer in the MTP mode, file related information recorded in an MTP database of the mobile phones is displayed on the computer, and a user performs corresponding operations on the computer to realize file management operations such as copying, pasting, cutting, deleting and the like on files in the mobile phones.
However, when a computer is used to perform a file management operation such as deletion of a file in a terminal device such as a mobile phone, the file in the terminal device such as the mobile phone is easily lost due to an operation error in the file management operation or an operation for another reason.
Disclosure of Invention
Embodiments of the present application provide a file management method, an apparatus, a terminal, and a computer-readable storage medium, which can effectively avoid the technical problem that a file in a terminal device is lost due to a misoperation in a file management operation.
A first aspect of an embodiment of the present application provides a file management method, including:
receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file;
if the operation code is a delete operation code, acquiring file data of the first target file according to the file identification information of the first target file;
creating a second target file on a preset storage path, and writing the file data into the second target file;
and deleting the first target file.
A second aspect of the embodiments of the present application provides a file management apparatus, including:
the receiving unit is used for receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file;
an obtaining unit, configured to obtain file data of the first target file according to file identification information of the first target file if the operation code is a delete operation code;
the writing unit is used for creating a second target file on a preset storage path and writing the file data into the second target file;
and the deleting unit is used for deleting the first target file.
A third aspect of the embodiments of the present application provides a terminal device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method are implemented.
A fourth aspect of the embodiments of the present application provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the computer program implements the steps of the above method.
In the embodiment of the application, after file operation request information which is sent by an external terminal and carries a deletion operation code and file identification information of a first target file is received, file data of the first target file is obtained according to the file identification information of the first target file, a second target file is created on a preset storage path, the file data is written into the second target file, and then the first target file is deleted, namely, the first target file is not directly deleted after the file operation request information is received, but is deleted after being stored on the preset storage path, so that the technical problem that the file in the terminal equipment is lost due to misoperation or other reasons in file management operation is effectively solved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic flow chart illustrating an implementation of a file management method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a first specific implementation of step 103 of a file management method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a second specific implementation of step 103 of a file management method according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a third specific implementation of step 103 of a file management method according to an embodiment of the present application;
FIG. 5 is a schematic structural diagram of a file management apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a terminal device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
As used in this specification and the appended claims, the term "if" may be interpreted contextually as "when", "upon" or "in response to a determination" or "in response to a detection". Similarly, the phrase "if it is determined" or "if a [ described condition or event ] is detected" may be interpreted contextually to mean "upon determining" or "in response to determining" or "upon detecting [ described condition or event ]" or "in response to detecting [ described condition or event ]".
In order to explain the technical solution of the present application, the following description will be given by way of specific examples.
When a user performs a corresponding operation on a computer to implement a file management operation for deleting a file in a mobile phone, the file in the mobile phone is easily lost due to a misoperation in the file management operation.
In the embodiment of the application, after receiving file operation request information which is sent by an external terminal and carries a deletion operation code and file identification information of a first target file, file data of the first target file is obtained according to the file identification information of the first target file, a second target file is created on a preset storage path, the file data is written into the second target file, and then the first target file is deleted.
Fig. 1 shows a schematic flow chart of a file management method implemented by a terminal device, which can be executed by a file management apparatus configured on the terminal device, and is suitable for avoiding a situation where a file in the terminal device is lost due to an operation error or other reasons in a file management operation, including steps 101 to 104.
The terminal equipment comprises terminal equipment provided with a file management device, such as a smart phone, a tablet personal computer, a learning machine, a digital camera, a walkman and the like.
Step 101, receiving file operation request information sent by an external terminal, where the file operation request information carries an operation code and file identification information of a first target file.
The external terminal may be a computer, a server, or other terminal equipment.
In this embodiment of the application, the receiving of the file operation request information sent by the external terminal means that after the terminal device establishes a connection with the external terminal, the terminal device receives the file operation request information sent by the external terminal, so as to implement file management operations, such as copying, pasting, cutting, deleting, and the like, performed on a file in the terminal device by the external terminal.
The operation code carried by the file operation request information is used to determine the specific operations that the file operation request information needs to be executed by the terminal device, such as file management operations of copying, pasting, cutting, deleting, and the like. The file identification information of the first target file carried in the file operation request information is used to determine a target object of a specific operation executed by the end device, that is, an object for which the external terminal device needs to execute the file management operation on the terminal device.
And 102, if the operation code is a delete operation code, acquiring file data of the first target file according to the file identification information of the first target file.
The deleting operation code is used for instructing the terminal equipment to store the first target file in a preset storage path and delete the first target file from an original storage path.
The file data includes file attribute data and file content data, wherein the file attribute data includes attribute data such as an original storage path, a file size, a file name, a storage format of the file, and the file content data refers to the content of the file itself.
In this embodiment of the application, when it is determined that an operation code in file operation request information sent by a received external terminal is a delete operation code, file data of the first target file is obtained according to file identification information of the first target file, so that the first target file is stored in a preset storage path.
Optionally, in some embodiments of the present application, before receiving the file operation request information sent by the external terminal, the method includes: and when connection is established with an external terminal, sending an operation code set to the external terminal, wherein the operation codes in the operation code set comprise the deletion operation codes.
Since the operation codes that can be supported by different terminal devices are different, when the terminal device establishes a connection with the external terminal, the terminal device needs to send an operation code set of the terminal device to the external terminal, so that the external terminal device can pre-load a call function corresponding to the operation code that can be supported by the terminal device. The operation codes in the operation code set comprise the deletion operation codes, so that the external terminal can send file operation request information carrying the deletion operation codes to the terminal equipment.
It should be noted that the establishing of the connection between the terminal device and the external terminal includes establishing a connection based on an MTP transport protocol.
Step 103, creating a second target file on a preset storage path, and writing the file data into the second target file.
In this embodiment of the application, after the file data is acquired, a second target file is created on a preset storage path, and the file data is written into the second target file, so that the second target file is the same except for the storage path of the first target file.
The preset storage path may be a fixed storage path which is divided in advance, or a storage path corresponding to a storage space which is divided according to the use condition of the storage space of the terminal device after receiving the file operation request information carrying the delete operation code.
And 104, deleting the first target file.
In this embodiment of the application, after a second target file is created on the preset storage path and the file data of the first target file is written into the second target file, the first target file may be deleted, so as to complete the deletion operation corresponding to the deletion operation code.
Wherein deleting the first target file comprises marking the first target file as a deleted file in a media database of the MTP.
Optionally, after deleting the first target file, the method includes: sending a file updating instruction to the external terminal; the file update instruction is used for instructing the external terminal to update the file information displayed in the external terminal.
When the terminal equipment is connected with the external terminal in an MTP mode, the file related information recorded in the MTP database of the terminal equipment is displayed on the external terminal, at the moment, the file related information recorded in the MTP database is presented on the external terminal instead of each file in the terminal equipment, the external terminal equipment can access the file recorded in the MTP database of the terminal equipment, and if the related information of a certain file in the terminal equipment is not recorded in the MTP database, the external terminal cannot display the file.
Therefore, after the terminal device creates the second object file and deletes the first object file, the MTP database needs to be updated and a file update command is sent to the external terminal, so that the file information displayed in the external terminal can be updated.
Optionally, as an implementation manner of the present application, as shown in fig. 2, in step 103, creating a second target file on a preset storage path, and writing the file data into the second target file, where the method includes: step 201 to step 202.
Step 201, obtaining the file type of the first target file, and determining whether the file type of the first target file is a preset file type.
The preset file type may be a file type divided according to a storage format of the file, for example, the file with the storage format being doc storage format, dox storage format, xlsx storage format, ppt storage format, pdf storage format, or picture format is divided into a preset file type, and the file with the txt storage format and rar storage format is divided into a non-preset file type.
The preset file type may be a file type divided according to a source of the file, for example, the file created on the terminal device and the file received from the instant chat application are divided into preset file types, and the file received from another application is divided into non-preset file types.
Step 202, if the file type of the first target file is a preset file type, creating a second target file on a preset storage path, and writing the file data into the second target file.
In this embodiment, when the file type of the first target file is determined to be the preset file type, a second target file is created on a preset storage path, the file data is written into the second target file, and then the first target file is deleted, so that a user can obtain the file from the preset storage path when needing to restore the first target file, thereby avoiding the file loss in the terminal device due to misoperation or other operations in the file management operation.
Optionally, in this embodiment of the application, when it is determined that the file type of the first target file is a non-preset file type, the first target file is directly deleted, so as to save a storage space of the terminal device.
In the above-described embodiment, as shown in fig. 3, step 103 may further include, before creating a second target file on a preset storage path and writing the file data into the second target file: step 301 to step 302.
Step 301, determining whether the remaining storage capacity of the preset storage path is smaller than the data size of the file data.
Step 302, if the remaining storage capacity of the predetermined storage path is smaller than the data size of the file data, deleting the file stored in the predetermined storage path according to a predetermined rule until the remaining storage capacity of the predetermined storage path is greater than or equal to the data size of the file data.
Since the capacity of the data that can be stored in the preset storage path is limited, and the file that has been stored in the preset storage path may be data that has not been deleted after a long time of storage, creating a second target file on the preset storage path, and deleting the file stored in the preset storage path according to a preset rule when it is determined that the remaining storage capacity of the preset storage path is smaller than the data amount of the file data before writing the file data into the second target file, so that the file that has been stored in the preset storage path can be automatically updated after the file is full.
For example, the deleting the file stored in the preset storage path according to the preset rule may include: and acquiring the creation time of the files stored in the preset storage path, and deleting the files stored in the preset storage path in sequence according to the sequence of the creation time until the residual storage capacity of the preset storage path is greater than or equal to the data volume of the file data.
For another example, the deleting the file stored in the preset storage path according to the preset rule may include: and deleting the minimum number of files stored in the preset storage path according to the data quantity required by the file data, wherein the time interval between the creation time of the deleted files and the current time is greater than the preset time interval. For example, the preset time interval may be 15 days.
In some embodiments of the present application, as shown in fig. 3, after the determining whether the remaining storage capacity of the preset storage path is smaller than the data amount of the file data, the method may further include: step 303 or step 304.
Step 303, if the remaining storage capacity of the predetermined storage path is smaller than the data size of the file data, directly deleting the first target file.
Step 304, if the remaining storage capacity of the preset storage path is smaller than the data size of the file data, popping up a prompt window whether to completely delete the first target file, and directly deleting the first target file according to a received complete deletion instruction triggered on the prompt window. That is, whether to delete the first object file directly on the terminal device may be determined by a user.
It should be noted that, in practical applications, the prompt window for popping up whether to completely delete the first object file may be a prompt window for popping up whether to completely delete the first object file on the terminal device, or may be configured to control the external terminal to display the prompt window, and then receive a complete deletion instruction sent by the external terminal to directly delete the first object file, so that file loss caused by the first object file being deleted by mistake is avoided as much as possible by means of user participation.
In the above-described embodiment, as shown in fig. 4, the step 103, creating a second target file on a preset storage path, and after writing the file data into the second target file, may further include: step 401 and/or step 402.
Step 401, receiving a restore command based on the second target file, restoring the first target file according to the restore command and the file data written in the second target file, and deleting the second target file.
The recovery instruction based on the second target file may be a recovery instruction triggered by the user on the external terminal, and the recovery instruction may carry a recovery operation code and file identification information of the second target file.
The restoring the first object file according to the restoring instruction and the file data written in the second object file may include: acquiring file data of the second target file from the preset storage path according to the file identifier of the second target file to obtain an original file storage path in the file data; and creating a new first target file in the original file storage path, writing the file data of a second target file into the new first target file, and then deleting the second target file in the preset storage path, thereby completing the recovery of the first target file.
Step 402, receiving a deletion instruction based on the second target file, and deleting the second target file according to the deletion instruction.
In this embodiment, since the second object file is a file stored in the preset storage path, after the second object file is deleted according to the deletion instruction, the second object file can be completely deleted, so that the storage space of the terminal device can be freed and used for storing other second object files that need to be temporarily stored.
Fig. 5 shows a schematic structural diagram of a file management apparatus 500 provided in an embodiment of the present application, and includes a receiving unit 501, an obtaining unit 502, a writing unit 503, and a deleting unit 504.
A receiving unit 501, configured to receive file operation request information sent by an external terminal, where the file operation request information carries an operation code and file identification information of a first target file;
an obtaining unit 502, configured to obtain file data of the first target file according to file identification information of the first target file if the operation code is a delete operation code;
a writing unit 503, configured to create a second target file on a preset storage path, and write the file data into the second target file;
a deleting unit 504, configured to delete the first target file.
In some embodiments of the application, the receiving unit may be specifically configured to, before the receiving of the file operation request information sent by the external terminal, send an operation code set to the external terminal when a connection is established with the external terminal, where an operation code in the operation code set includes the delete operation code.
In some embodiments of the present application, the writing unit may be further specifically configured to acquire a file type of the first target file, and determine whether the file type of the first target file is a preset file type; and if the file type of the first target file is a preset file type, creating a second target file on a preset storage path, and writing the file data into the second target file.
In some embodiments of the application, the writing unit may be further specifically configured to receive a second communication text corresponding to the second communication voice sent by the second terminal through a communication network other than the communication network and play the machine voice corresponding to the second communication text, if the strength of the communication signal of the first terminal and/or the second terminal is less than a preset threshold.
In some embodiments of the application, the writing unit may be further specifically configured to create a second target file on a preset storage path, and determine whether a remaining storage capacity of the preset storage path is smaller than a data amount of the file data before writing the file data into the second target file; if the residual storage capacity of the preset storage path is smaller than the data volume of the file data, deleting the file stored in the preset storage path according to a preset rule until the residual storage capacity of the preset storage path is larger than or equal to the data volume of the file data; or, if the remaining storage capacity of the preset storage path is smaller than the data volume of the file data, directly deleting the first target file; or if the remaining storage capacity of the preset storage path is smaller than the data volume of the file data, popping up a prompt window whether the first target file is completely deleted, and directly deleting the first target file according to a received complete deletion instruction triggered at the prompt window.
In some embodiments of the application, the writing unit may be further specifically configured to create a second target file on a preset storage path, receive a recovery instruction based on the second target file after the file data is written in the second target file, recover the first target file according to the recovery instruction and the file data written in the second target file, and delete the second target file.
In some embodiments of the application, the writing unit may be further specifically configured to create a second target file on a preset storage path, receive a deletion instruction based on the second target file after the file data is written in the second target file, and delete the second target file according to the deletion instruction.
In some embodiments of the present application, the deleting unit may be further specifically configured to send a file update instruction to the external terminal after deleting the first target file; and the file updating instruction is used for indicating the external terminal to update the file information displayed in the external terminal.
It should be noted that, for convenience and simplicity of description, the specific working process of the file management apparatus 500 described above may refer to the corresponding process of the method described in fig. 1 to fig. 4, and is not described herein again.
As shown in fig. 6, the present application provides a terminal device for implementing the file management method, including: one or more input devices 63 (only one shown in fig. 6) and one or more output devices 64 (only one shown in fig. 6). The processor 61, memory 62, input device 63 and output device 64 are connected by a bus 65.
It should be understood that in the embodiment of the present Application, the Processor 61 may be a Central Processing Unit (CPU), and the Processor may also be other general processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The input device 63 may include a virtual keyboard, a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, etc., and the output device 64 may include a display, a speaker, etc.
The memory 62 may include a read-only memory and a random access memory, and provides instructions and data to the processor 61. Some or all of the memory 62 may also include non-volatile random access memory. For example, the memory 62 may also store device type information.
The memory 62 stores a computer program that can be executed by the processor 61, and the computer program is a program of a file management method, for example. The processor 61 implements the steps of the file management method embodiment, such as the steps 101 to 104 shown in fig. 1, when executing the computer program. Alternatively, the processor 61 implements the functions of the modules/units in the device embodiments, such as the functions of the units 501 to 504 shown in fig. 5, when executing the computer program.
The computer program may be divided into one or more modules/units, which are stored in the memory 62 and executed by the processor 61 to complete the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used for describing the execution process of the computer program in the file management terminal. For example, the computer program may be divided into a receiving unit, an obtaining unit, a writing unit, and a deleting unit, and each unit may specifically function as follows: the receiving unit is used for receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file; an obtaining unit, configured to obtain file data of the first target file according to file identification information of the first target file if the operation code is a delete operation code; the writing unit is used for creating a second target file on a preset storage path and writing the file data into the second target file; and the deleting unit is used for deleting the first target file.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned functions may be distributed as different functional units and modules according to needs, that is, the internal structure of the apparatus may be divided into different functional units or modules to implement all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described embodiments of the apparatus/terminal are merely illustrative, and for example, the division of the above-described modules or units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated modules/units described above, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the method of the embodiments described above may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the embodiments of the methods described above. The computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file or some intermediate form. The computer readable medium may include: any entity or device capable of carrying the above-described computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium described above may include content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media that does not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A file management method is applied to terminal equipment and is characterized by comprising the following steps:
receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file; the terminal equipment is configured with a file management device, and the external terminal is a computer or a server; the receiving of the file operation request information sent by the external terminal means that the terminal device receives the file operation request information sent by the external terminal after the terminal device establishes connection with the external terminal in an MTP (multiple time transfer) mode so as to realize that the external terminal performs file management operation on files in the terminal device; when the terminal equipment is connected with the external terminal in an MTP mode, file related information recorded in an MTP database of the terminal equipment is displayed on the external terminal, the external terminal presents file related information recorded in the MTP database instead of each file in the terminal equipment, and the external terminal can access the files recorded in the MTP database of the terminal equipment;
if the operation code is a delete operation code, acquiring file data of the first target file according to the file identification information of the first target file;
creating a second target file on a preset storage path, and writing the file data into the second target file, wherein the method comprises the following steps:
acquiring the file type of the first target file, and judging whether the file type of the first target file is a preset file type;
if the file type of the first target file is a preset file type, creating a second target file on a preset storage path, and writing the file data into the second target file; if the file type of the first target file is a non-preset file type, directly deleting the first target file so as to save the storage space of the terminal equipment;
deleting the first target file, including: marking the first target file as a deleted file in a media database of the MTP;
after the first target file is deleted, sending a file updating instruction to the external terminal; and the file updating instruction is used for indicating the external terminal to update the file information displayed in the external terminal.
2. The file management method according to claim 1, wherein said receiving file operation request information transmitted from the external terminal previously comprises:
and when connection with an external terminal is established, sending an operation code set to the external terminal, wherein the operation codes in the operation code set comprise the deletion operation codes.
3. The file management method according to any one of claims 1 to 2, wherein the creating of the second object file on the preset storage path, before writing the file data into the second object file, comprises:
judging whether the residual storage capacity of the preset storage path is smaller than the data volume of the file data or not;
if the residual storage capacity of the preset storage path is smaller than the data volume of the file data, deleting the file stored in the preset storage path according to a preset rule until the residual storage capacity of the preset storage path is larger than or equal to the data volume of the file data;
or, if the remaining storage capacity of the preset storage path is smaller than the data volume of the file data, directly deleting the first target file;
or if the remaining storage capacity of the preset storage path is smaller than the data volume of the file data, popping up a prompt window whether the first target file is completely deleted, and directly deleting the first target file according to a received complete deletion instruction triggered at the prompt window.
4. The file management method according to any one of claims 1 to 2, wherein the creating a second object file on a preset storage path, after writing the file data into the second object file, comprises:
and receiving a recovery instruction based on the second target file, recovering the first target file according to the recovery instruction and the file data written into the second target file, and deleting the second target file.
5. The file management method according to any one of claims 1 to 2, wherein the creating a second object file on a preset storage path, after writing the file data into the second object file, comprises:
and receiving a deleting instruction based on the second target file, and deleting the second target file according to the deleting instruction.
6. A file management apparatus included in a terminal device, comprising:
the receiving unit is used for receiving file operation request information sent by an external terminal, wherein the file operation request information carries an operation code and file identification information of a first target file; the terminal equipment is configured with a file management device, and the external terminal is a computer or a server; the receiving of the file operation request information sent by the external terminal means that the terminal device receives the file operation request information sent by the external terminal after the terminal device establishes connection with the external terminal in an MTP (multiple time transfer) mode so as to realize that the external terminal performs file management operation on files in the terminal device; when the terminal equipment is connected with the external terminal in an MTP mode, file related information recorded in an MTP database of the terminal equipment is displayed on the external terminal, the external terminal presents file related information recorded in the MTP database instead of each file in the terminal equipment, and the external terminal can access the files recorded in the MTP database of the terminal equipment;
an obtaining unit, configured to obtain file data of the first target file according to file identification information of the first target file if the operation code is a delete operation code;
a writing unit, configured to create a second target file on a preset storage path, and write the file data into the second target file, including:
acquiring the file type of the first target file, and judging whether the file type of the first target file is a preset file type;
if the file type of the first target file is a preset file type, creating a second target file on a preset storage path, and writing the file data into the second target file; if the file type of the first target file is a non-preset file type, directly deleting the first target file so as to save the storage space of the terminal equipment;
a deleting unit configured to delete the first target file, including: marking the first target file as a deleted file in a media database of the MTP;
after the first target file is deleted, sending a file updating instruction to the external terminal; and the file updating instruction is used for indicating the external terminal to update the file information displayed in the external terminal.
7. A terminal device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the method according to any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN201811129170.4A 2018-09-26 2018-09-26 File management method, device, terminal and computer readable storage medium Active CN109359091B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811129170.4A CN109359091B (en) 2018-09-26 2018-09-26 File management method, device, terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811129170.4A CN109359091B (en) 2018-09-26 2018-09-26 File management method, device, terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN109359091A CN109359091A (en) 2019-02-19
CN109359091B true CN109359091B (en) 2021-03-26

Family

ID=65347841

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811129170.4A Active CN109359091B (en) 2018-09-26 2018-09-26 File management method, device, terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN109359091B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110795388B (en) * 2019-10-12 2022-08-12 苏州浪潮智能科技有限公司 Binary file processing method, system, equipment and readable storage medium
WO2021097623A1 (en) * 2019-11-18 2021-05-27 深圳市欢太科技有限公司 File processing method and device, and terminal apparatus
CN111176708B (en) * 2019-12-20 2022-05-13 南京领行科技股份有限公司 SDK file processing method and device, electronic equipment and storage medium
CN112468841B (en) * 2020-11-26 2023-04-07 Oppo广东移动通信有限公司 Audio transmission method and device, intelligent equipment and computer readable storage medium
CN113094861B (en) * 2021-05-08 2022-06-03 国网河北省电力有限公司经济技术研究院 Data storage method, device, equipment and storage medium
CN113836091A (en) * 2021-09-01 2021-12-24 北京来也网络科技有限公司 Data identification method and device combining RPA and AI, electronic equipment and storage medium
CN114331135B (en) * 2021-12-29 2023-02-03 上海赛美特软件科技有限公司 Process flow management method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389316A (en) * 2014-09-05 2016-03-09 上海科泰世纪科技有限公司 File management system and method
CN105653397A (en) * 2015-09-30 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Recovery processing method, apparatus and electronic device
CN105930436A (en) * 2016-04-19 2016-09-07 乐视控股(北京)有限公司 File recovery method and device for mobile terminal equipment
CN107066349A (en) * 2017-01-20 2017-08-18 郑州云海信息技术有限公司 A kind of method and system of cluster file system data protection

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102034518A (en) * 2009-09-30 2011-04-27 深圳市福智软件技术有限公司 Method for editing MP3 play list and digital electronic device
KR101517895B1 (en) * 2013-04-05 2015-05-08 주식회사 팬택 Terminal and method providing application-related data
JP5991699B2 (en) * 2014-08-08 2016-09-14 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Information processing apparatus, information processing system, backup method, and program
CN104199967A (en) * 2014-09-22 2014-12-10 广东欧珀移动通信有限公司 Cellphone file recovery method and device
KR101605156B1 (en) * 2014-12-11 2016-03-21 네이버비즈니스플랫폼 주식회사 Device, method, and computer for providing file deleting service
CN106066858B (en) * 2016-05-25 2020-05-05 青岛海信移动通信技术股份有限公司 Terminal and picture transmission protocol file synchronization method thereof
CN106991130A (en) * 2017-03-07 2017-07-28 广东欧珀移动通信有限公司 A kind of document handling method, device and intelligent terminal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105389316A (en) * 2014-09-05 2016-03-09 上海科泰世纪科技有限公司 File management system and method
CN105653397A (en) * 2015-09-30 2016-06-08 宇龙计算机通信科技(深圳)有限公司 Recovery processing method, apparatus and electronic device
CN105930436A (en) * 2016-04-19 2016-09-07 乐视控股(北京)有限公司 File recovery method and device for mobile terminal equipment
CN107066349A (en) * 2017-01-20 2017-08-18 郑州云海信息技术有限公司 A kind of method and system of cluster file system data protection

Also Published As

Publication number Publication date
CN109359091A (en) 2019-02-19

Similar Documents

Publication Publication Date Title
CN109359091B (en) File management method, device, terminal and computer readable storage medium
CN108063818B (en) Data downloading method, device, terminal and computer readable storage medium
US20170163787A1 (en) Method and electronic device for upgrading or downgrading system
CN109376126B (en) File or folder processing method, mobile terminal and storage medium
CN108984339B (en) Data recovery method and related product
CN111782728A (en) Data synchronization method, device, electronic equipment and medium
EP3506599B1 (en) Method for synchronizing contact information, apparatus and medium
CN104615546A (en) File data management method and device
CN106776908B (en) Data cleaning method and device and terminal
EP3832460A1 (en) Method and apparatus for displaying application program, and terminal device
CN114461691A (en) Control method and device of state machine, electronic equipment and storage medium
CN107733781B (en) Instant messaging processing method, equipment and computer storage medium
CN108205559B (en) Data management method and equipment thereof
CN110019040B (en) Folder processing method, mobile terminal and storage medium
CN109298956B (en) File transmission method and device and terminal equipment
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN109271266B (en) File transmission method and device and terminal equipment
CN111090623A (en) Data auditing method and device, electronic equipment and storage medium
CN107168648B (en) File storage method and device and terminal
CN104796519A (en) Terminal
CN110471793B (en) Data backup method, data recovery method, first terminal and second terminal
CN114675776A (en) Resource storage method and device, storage medium and electronic equipment
CN108460128B (en) Document management method and device, electronic device and readable storage medium
CN109450885B (en) Network data interception method and device, electronic equipment and storage medium
CN112966147A (en) File access method and device, electronic equipment and storage medium

Legal Events

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