CN109376126B - File or folder processing method, mobile terminal and storage medium - Google Patents
File or folder processing method, mobile terminal and storage medium Download PDFInfo
- Publication number
- CN109376126B CN109376126B CN201811126790.2A CN201811126790A CN109376126B CN 109376126 B CN109376126 B CN 109376126B CN 201811126790 A CN201811126790 A CN 201811126790A CN 109376126 B CN109376126 B CN 109376126B
- Authority
- CN
- China
- Prior art keywords
- folder
- processed
- mobile terminal
- file
- information
- 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
Links
Images
Landscapes
- Telephone Function (AREA)
Abstract
The application is applicable to the technical field of media transmission, and provides a file or folder processing method, a mobile terminal and a storage medium, wherein the method comprises the following steps: after the mobile terminal is connected with the terminal equipment, if a processing instruction sent by the terminal equipment to a file or a folder in a storage space of the mobile terminal is monitored, information of a to-be-processed document or information of the to-be-processed folder corresponding to the processing instruction is obtained through a framework layer of the mobile terminal, the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction is transmitted to a driving layer of the mobile terminal, the driving layer of the mobile terminal processes the to-be-processed document or the to-be-processed folder corresponding to the processing instruction based on the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction to obtain a processing result, and when the folder in the storage space of the mobile terminal is processed on one side of the terminal equipment, the processing efficiency can be improved through the application.
Description
Technical Field
The present application relates to the field of media transmission technologies, and in particular, to a method for processing a file or folder, a mobile terminal, and a computer-readable storage medium.
Background
Media Transfer Protocol (MTP) is a custom extension protocol based on Picture Transfer Protocol (PTP). After the MTP connection is established between a master device (e.g., a terminal device) and a slave device (e.g., a mobile terminal), the master device may perform processing, such as deleting, cutting, copying, and the like, on a file or a folder in a storage space of the slave device.
At present, when the master device and the slave device are connected based on MTP, and when the master device performs related processing on a file or a folder in a storage space of the slave device, the processing speed is slow, which results in low processing efficiency.
Disclosure of Invention
In view of this, embodiments of the present application provide a file or folder processing method, a mobile terminal, and a computer-readable storage medium, so as to solve the problem that the processing efficiency is low when a terminal device processes a file or folder in a storage space of the mobile terminal.
A first aspect of an embodiment of the present application provides a file or folder processing method, including:
after the mobile terminal is connected with the terminal equipment, monitoring a processing instruction of a file or a folder in a storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal;
if a processing instruction of a file or a folder in the storage space of the mobile terminal sent by the terminal equipment is monitored, acquiring information of a to-be-processed document or information of the to-be-processed folder corresponding to the processing instruction through a frame layer of the mobile terminal, and transmitting the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction to a driving layer of the mobile terminal;
and the drive layer of the mobile terminal processes the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result.
A second aspect of an embodiment of the present application provides a mobile terminal, including:
the monitoring unit is used for monitoring a processing instruction of a file or a folder in the storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal after the mobile terminal is connected with the terminal equipment;
the information acquisition unit is used for acquiring information of a to-be-processed document or information of a to-be-processed folder corresponding to a processing instruction through a framework layer of the mobile terminal and transmitting the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction to a driving layer of the mobile terminal if the processing instruction of the document or the folder in the storage space of the mobile terminal, which is sent by the terminal equipment, is monitored;
and the processing unit is used for processing the file to be processed or the folder to be processed corresponding to the processing instruction by the driving layer of the mobile terminal based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result.
A third aspect of an embodiment of the present application provides a mobile terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method provided in the first aspect of the embodiment of the present application when executing the computer program.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium storing a computer program which, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
A fifth aspect of embodiments of the present application provides a computer program product comprising a computer program that, when executed by one or more processors, performs the steps of the method provided by the first aspect of embodiments of the present application.
The embodiment of the application provides a file or folder processing method, which is applied to a mobile terminal, wherein in the file or folder processing method provided by the embodiment of the application, a terminal device side can send a processing instruction for a file or folder, a driving layer of the mobile terminal monitors the processing instruction sent by the terminal device, and acquires information of a file or folder to be processed related to the processing instruction through a frame layer, and performs related processing on the file or folder to be processed corresponding to the processing instruction through the driving layer.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a schematic flow chart of an implementation of a file or folder processing method provided in an embodiment of the present application;
FIG. 2 is a schematic flow chart illustrating an implementation of another file or folder processing method according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a mobile terminal according to an embodiment of the present application;
fig. 4 is a schematic block diagram of another mobile terminal provided in an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system structures, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
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 described in the present application, the following description will be given by way of specific examples.
Fig. 1 is a schematic flow chart of an implementation process of a file or folder processing method provided in an embodiment of the present application, and as shown in the drawing, the method may include the following steps:
step S101, after the mobile terminal is connected with the terminal equipment, monitoring a processing instruction of a file or a folder in a storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal.
In this embodiment of the present application, the mobile terminal and the terminal device may establish a connection based on a Universal Serial Bus (USB), and after establishing the connection, may perform information interaction based on a Media Transfer Protocol (MTP), for example, the terminal device completes related processing on a folder in a storage space of the mobile terminal, which may be deletion processing, cutting processing, copy processing, and the like. The mobile terminal side may monitor information sent by the terminal device to the mobile terminal, for example, monitor a processing instruction for a file or folder in the storage space of the mobile terminal.
As another embodiment of the present application, after the mobile terminal establishes a connection with the terminal device, monitoring, by a driver layer of the mobile terminal, a processing instruction sent by the terminal device for a file or a folder in a storage space of the mobile terminal includes:
after a mobile terminal and a terminal device are connected through a USB interface, a drive layer of the mobile terminal monitors a processing instruction of the terminal device to a file or a folder in a storage space of the mobile terminal, which is sent by the terminal device based on a media transmission protocol, wherein the processing instruction comprises: delete instructions, copy instructions, and cut instructions.
In this embodiment of the present application, the connection is established through a USB interface, which may be in a UMS mode or an MTP mode, where UMS represents a mass storage device, and MTP represents a media transfer protocol, and this embodiment of the present application is used in the MTP mode, and the monitored processing instruction is a processing instruction of the terminal device for a file or a folder in a storage space of the mobile terminal, which is sent based on the media transfer protocol, and of course, the processing instruction may be a delete instruction, a copy instruction, a cut instruction, and the like.
In the embodiment of the application, when information interaction is performed between the mobile terminal side and the terminal device side, the information interaction is realized on the driving layer of the mobile terminal side.
Step S102, if a processing instruction of the file or the folder in the storage space of the mobile terminal sent by the terminal equipment is monitored, acquiring information of the file to be processed or the folder to be processed corresponding to the processing instruction through a frame layer of the mobile terminal, and transmitting the information of the file to be processed or the folder to be processed corresponding to the processing instruction to a driving layer of the mobile terminal.
In the embodiment of the application, when a processing instruction sent by a terminal device for a file in a storage space of a mobile terminal is monitored, information of a to-be-processed file corresponding to the processing instruction needs to be acquired from the terminal device side, and when a processing instruction sent by the terminal device for a folder in the storage space of the mobile terminal is monitored, information of the to-be-processed folder corresponding to the processing instruction needs to be acquired from the terminal device side.
After establishing a connection between the terminal equipment and the mobile terminal based on the MTP protocol, the files stored in the storage space at one side of the mobile terminal can form a media library, and at the same time, on the side of the terminal equipment, the files stored in the memory space of the mobile terminal will also be displayed, but, displayed on the terminal device side is a virtual media library, on which the user performs an operation, for example, selecting virtual folder a, the deletion operation is carried out on the virtual folder A, when the user carries out the deletion operation on the virtual folder A in the virtual media library on the side of the terminal equipment, a processing instruction is sent to the mobile terminal, the mobile terminal monitors a deletion instruction sent by the terminal equipment to the folder A in the storage space of the mobile terminal, at the moment, and one side of the mobile terminal acquires the information of the folder A to be processed corresponding to the deleting instruction. For example, path information of the to-be-processed folder a. The processing of the file may refer to the processing of the folder, and will not be described herein.
In addition, the process of acquiring the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction is performed by the framework layer of the mobile terminal, and the framework layer of the mobile terminal can transmit the information of the file to be processed or the information of the folder to be processed to the driving layer of the mobile terminal.
And step S103, the drive layer of the mobile terminal processes the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result.
In the embodiment of the present application, when deleting the to-be-processed folder a, the deletion process is not performed on the folder a itself, but performed on the folder a and all files stored in the folder a. For example, the instruction sent by the user at the terminal device side is to delete the to-be-processed folder a in the virtual media library (the media library on the mobile terminal is mapped to the virtual library on the terminal device), and accordingly, the mobile terminal side needs to delete the to-be-processed folder a stored in the actual media library and all files or folders in the to-be-processed folder a. Namely, the user sends a processing instruction through the virtual media library at the terminal equipment side, and the mobile terminal side performs related processing on files in the real media library. Also, it is noted that the processing operation is implemented by a driving layer of the mobile terminal.
In the method for processing the file or the folder provided by the embodiment of the application, one side of the terminal device can send a processing instruction for the file or the folder, the driving layer of the mobile terminal monitors the processing instruction sent by the terminal device, information of the file or the folder to be processed related to the processing instruction is obtained through the framework layer, and the file or the folder to be processed corresponding to the processing instruction is processed through the driving layer.
Fig. 2 is a schematic flow chart of an implementation of another file or folder processing method provided in an embodiment of the present application, and as shown in the drawing, the method may include the following steps:
step S201, after the mobile terminal establishes a connection with the terminal device, acquiring a version of an operating system of the terminal device.
Step S202, if the version of the operating system of the terminal equipment is a preset version, monitoring a processing instruction of the terminal equipment to a file or a folder in a storage space of the mobile terminal through a driving layer of the mobile terminal.
In the embodiment of the present application, since the MTP protocol represents a protocol, in practical applications, different processing flows may be generated based on the MTP protocol, and therefore, a problem that an operating system of a terminal device is compatible with the processing flow of the MTP protocol occurs, so that, in order to enable processing of a file or a folder based on the MTP protocol between the terminal device and a mobile terminal that establish a connection, the operating system of the terminal device may be acquired at a side of the mobile terminal. The method includes the steps that a corresponding processing flow is determined according to an operating system, the operating system compatible with the embodiment of the application can be set as the operating system with a preset version, and if the version of the operating system of the terminal device is the preset version, a processing instruction sent by the terminal device to a file or a folder in a storage space of the mobile terminal can be monitored according to the processing flow provided by the embodiment of the application.
Step S2031, if a processing instruction for the file in the storage space of the mobile terminal sent by the terminal equipment is monitored, based on a media transmission protocol, the driver layer of the mobile terminal obtains a handle of the file to be processed and a handle of a path of a target folder corresponding to the processing instruction from the terminal equipment, and transmits the handle of the file to be processed and the handle of the path of the target folder to the frame layer of the mobile terminal.
In the embodiment of the present application, a to-be-processed file corresponding to a processing instruction is taken as an example for description, and when the processing instruction is a delete instruction, the mobile terminal side may obtain, from the terminal device side, a to-be-processed file handle corresponding to the processing instruction based on a media transport protocol. When the processing instruction is a cutting or copying instruction, a file handle to be processed and a target folder path handle corresponding to the processing instruction are acquired from the terminal equipment side based on a media transmission protocol. The target folder represents a folder to be copied or cut, e.g., file b is copied into folder C, which then represents the target folder.
In file I/O, to read data from a file, an operating system function is typically called and passed the file name, and a path to the file is selected to open the file, the function retrieving a sequence number, i.e., the file handle. The file handle is the only identification for the opened file. To read a block of data from a file, the function ReadFile is called, and the address of the file handle in the memory and the number of bytes to be copied are transferred to the operating system. And after the task is completed, the file is closed by calling the system function.
Step S2041, the frame layer of the mobile terminal obtains information of the folder to be processed and information of the target folder from a media library query of the mobile terminal through the handle of the file to be processed and the path handle of the target folder, wherein the information of the file to be processed comprises: the name of the file to be processed and the path of the file to be processed, and the information of the target folder comprises: path of the target folder.
In the embodiment of the application, if the processing instruction is a delete instruction, the name of the file to be processed and the path of the file to be processed need to be obtained according to the handle of the file to be processed; if the processing instruction is a cutting or copying instruction, the path of the target folder needs to be obtained according to the path handle of the target folder on the basis of obtaining the relevant information of the file to be processed.
Step S2032, if a processing instruction for the folder in the storage space of the mobile terminal sent by the terminal equipment is monitored, based on a media transport protocol, the driver layer of the mobile terminal obtains a to-be-processed folder handle and a target folder path handle corresponding to the processing instruction from the terminal equipment, and transmits the to-be-processed folder handle and the target folder path handle to the frame layer of the mobile terminal.
Step S2042, the frame layer of the mobile terminal queries and obtains information of the folder to be processed and information of the target folder from a media library of the mobile terminal through the folder handle to be processed and the path handle of the target folder, wherein the information of the folder to be processed comprises: the name of the folder to be processed, the path of the folder to be processed, the name of the file stored in the folder to be processed, and the path of the file stored in the folder to be processed, wherein the information of the target folder comprises: path of the target folder.
In this embodiment of the application, when the processing instruction is a delete instruction, the target folder does not exist, that is, information of the to-be-processed folder needs to be obtained, the handle of the to-be-processed folder may be obtained first, and then the name of the to-be-processed folder, the name of the file stored in the to-be-processed folder, and the path of the file stored in the to-be-processed folder are obtained according to the handle of the to-be-processed folder. If the processing instruction is a copy or cut instruction, the path handle of the target folder needs to be obtained, and then the path of the target folder is obtained according to the path handle of the target folder.
By way of example, multiple levels of files may be stored in the folder D to be processed, for example, a file a, a folder D1, a folder D2, a file b and a file c are stored in the folder D1, a file D is stored in the folder D2, then the name of the folder D to be processed is the folder D to be processed, the path of the folder D to be processed, the names a, b, c and D of the files stored in the folder to be processed, and the path of the files stored in the folder to be processed (the path of the files stored in the files to be processed indicates the path of each level of files or folders stored in the folder D).
It should be noted that, the driver layer of the mobile terminal obtains the handle information from the terminal device, and then transfers the handle information to the framework layer of the mobile terminal, and the framework layer of the mobile terminal queries from the media library of the mobile terminal to obtain the relevant information.
Step S205, the driver layer of the mobile terminal processes the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result.
In the embodiment of the application, when the processing instruction is a deletion instruction of the folder to be processed, the file is deleted in the folder to be processed based on the path of the file stored in the folder to be processed;
and deleting the folder to be processed after all the files stored in the folder to be processed are successfully deleted.
When the processing instruction is a copying instruction of the folder to be processed, creating a target folder with the same name as the folder to be processed based on the path of the target folder, and storing the files stored in the folder to be processed in the target folder based on the path of the files stored in the folder to be processed;
when the processing instruction is a cutting instruction of the folder to be processed, creating a target folder with the same name as the folder to be processed based on the path of the target folder, and storing the file stored in the folder to be processed in the target folder based on the path of the file stored in the folder to be processed;
deleting the successfully stored files in the folder to be processed based on the path of the files stored in the folder to be processed;
and deleting the folder to be processed after all the files stored in the folder to be processed are successfully stored in the target folder.
When the processing instruction is a deletion instruction of the file to be processed, deleting the file to be processed based on the path of the folder to be processed;
when the processing instruction is a copying instruction of the file to be processed, creating the file to be processed in a target folder based on the path of the target folder;
and when the processing instruction is a cutting instruction of the file to be processed, creating the file to be processed in the target folder based on the path of the target folder, and deleting the file which is successfully stored based on the path of the file to be processed.
Step S206, after the file to be processed or the folder to be processed corresponding to the processing instruction is processed, the driving layer of the mobile terminal transmits the processing result to the framework layer of the mobile terminal, and the framework layer of the mobile terminal updates the processing result to the media library of the mobile terminal.
Step S207, the driver layer of the mobile terminal sends the processing result to the terminal device based on a media transport protocol, where the processing result is used to instruct the terminal device to update a virtual media library, and the virtual media library is a virtual library mapped to the terminal device by the media library on the mobile terminal.
In the embodiment of the application, the mobile terminal side sends the processing result to the terminal equipment after deleting, cutting or copying the file to be processed, and the terminal equipment side updates the virtual media library. In this way, the media library on the side of the mobile terminal and the virtual media library on the side of the terminal device are still fully corresponding.
And after all the files or folders in the folder to be processed are deleted, or cut, or copied, the mobile terminal side sends the processing result to the terminal equipment, and the terminal equipment side updates the virtual media library. In this way, the media library on the side of the mobile terminal and the virtual media library on the side of the terminal device are still fully corresponding.
It should be noted that, when the processing instruction corresponds to the to-be-processed folder, the deletion operation in this embodiment indicates to delete the to-be-processed folder and all files in the to-be-processed folder, and the copy operation in this embodiment indicates to copy the to-be-processed folder and all files in the to-be-processed folder, and then to paste the to-be-processed folder and all files in the to-be-processed folder to a target folder (for example, a desktop, a root directory, a desktop, or a folder in the root directory). The cutting operation in the embodiment of the present application means that after the folder to be processed and all the files in the folder are cut, the cut folder to be processed and all the files in the folder are also required to be pasted to the target folder, and meanwhile, the folder to be processed under the original path is required to be deleted. For the file to be processed, similarly, the file to be processed is also required to be pasted in the target folder in the copying and cutting operations, and for the cutting operation, the file to be processed in the original path is also required to be deleted.
In this embodiment of the application, after the folder to be processed and the files in the folder to be processed are processed, the processing result is updated to the media library of the mobile terminal, and the processing result is sent to the terminal device, the media library of the mobile terminal is a real embodiment of the files stored in the storage space of the mobile terminal, and the virtual media library of the terminal device is a virtual library mapped to one side of the terminal device by the media library of the mobile terminal, that is, the files stored in the mobile terminal displayed on one side of the terminal device are not real files, but virtual files mapped on the terminal device by the mobile terminal. In order to ensure that the virtual library displayed on the terminal device can actually correspond to the media library on one side of the mobile terminal, the processing result needs to be updated to the media library of the mobile terminal after the to-be-processed folder and the files in the to-be-processed folder are processed, and meanwhile, the processing result is sent to the terminal device, so that the virtual media library displayed on one side of the terminal device completely corresponds to the files stored on one side of the mobile terminal. The user can perform relevant operation in the virtual media library of the terminal equipment, so that real relevant operation is performed on one side of the mobile terminal, after the real relevant operation is performed on the mobile terminal, the operation result is returned to the terminal equipment, and the user on one side of the terminal equipment can perform relevant processing on the file or folder in the storage space of the mobile terminal at any time on one side of the terminal equipment. Similarly, for the file to be processed, after the file to be processed is processed, the processing result is updated to the media library of the mobile terminal, and the processing result is sent to the terminal device.
In addition, the embodiment of the present application is mainly described from the mobile terminal side, when the mobile terminal acquires information from the terminal device or sends information to the terminal device, the information is realized by the driver layer on the mobile terminal side, and the processes of copying, cutting, deleting, and the like of files or folders on the mobile terminal side are also realized by the driver layer on the mobile terminal side. Thus, the processing speed of the file or folder can be improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present application.
Fig. 3 is a schematic block diagram of a mobile terminal according to an embodiment of the present application, and only a portion related to the embodiment of the present application is shown for convenience of description.
The mobile terminal 3 may be a software unit, a hardware unit or a combination of software and hardware unit built in a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, etc., or may be integrated into a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, etc., as an independent pendant.
The mobile terminal 3 includes:
the monitoring unit 31 is configured to monitor, through a driver layer of the mobile terminal, a processing instruction sent by the terminal device for a file or a folder in a storage space of the mobile terminal after the mobile terminal and the terminal device are connected;
the information obtaining unit 32 is configured to, if a processing instruction for a file or a folder in the storage space of the mobile terminal sent by the terminal device is monitored, obtain information of a to-be-processed document or information of the to-be-processed folder corresponding to the processing instruction through a framework layer of the mobile terminal, and transmit the information of the to-be-processed file or the information of the to-be-processed folder corresponding to the processing instruction to a driving layer of the mobile terminal;
and the processing unit 33 is configured to control the driver layer of the mobile terminal to process the to-be-processed file or the to-be-processed folder corresponding to the processing instruction based on the information of the to-be-processed file or the information of the to-be-processed folder corresponding to the processing instruction to obtain a processing result.
Optionally, the mobile terminal 3 further includes:
an updating unit 34, configured to control a driver layer of the mobile terminal to transmit the processing result to a framework layer of the mobile terminal, where the framework layer of the mobile terminal updates the processing result to a media library of the mobile terminal;
an interaction unit 35, configured to control a driver layer of the mobile terminal to send the processing result to the terminal device based on a media transport protocol, where the processing result is used to instruct the terminal device to update a virtual media library, and the virtual media library is a virtual library mapped to the terminal device by the media library on the mobile terminal.
Optionally, the monitoring unit 31 is further configured to:
after a mobile terminal and a terminal device are connected through a USB interface, a drive layer of the mobile terminal monitors a processing instruction of the terminal device to a file or a folder in a storage space of the mobile terminal, which is sent by the terminal device based on a media transmission protocol, wherein the processing instruction comprises: copy instructions and cut instructions.
Optionally, the information obtaining unit 32 is further configured to:
when the processing instruction corresponds to a file to be processed, acquiring information of the file to be processed and information of a target folder corresponding to the processing instruction through a driving layer of the mobile terminal, wherein the information of the file to be processed comprises: the name of the file to be processed and the path of the file to be processed, and the information of the target folder comprises: path of the target folder.
When the processing instruction corresponds to a folder to be processed, acquiring information of the folder to be processed and information of a target folder corresponding to the processing instruction through a driving layer of the mobile terminal, wherein the information of the folder to be processed comprises: the name of the folder to be processed, the path of the folder to be processed, the name of the file stored in the folder to be processed, and the path of the file stored in the folder to be processed, wherein the information of the target folder comprises: path of the target folder.
Optionally, the information obtaining unit 32 further includes:
a handle obtaining module 321, configured to control a driver layer of the mobile terminal to obtain, based on a media transport protocol, a to-be-processed file handle and a target folder path handle corresponding to the processing instruction from the terminal device, and transmit the to-be-processed file handle and the target folder path handle to a framework layer of the mobile terminal;
the query module 322 is configured to control the framework layer of the mobile terminal to query and obtain information of the to-be-processed folder and information of the target folder from a media library of the mobile terminal through the to-be-processed file handle and the target folder path handle;
optionally, the handle obtaining module 321 is further configured to:
based on a media transmission protocol, a driver layer of the mobile terminal acquires a to-be-processed folder handle and a target folder path handle corresponding to the processing instruction from the terminal equipment and transmits the to-be-processed folder handle and the target folder path handle to a framework layer of the mobile terminal;
the query module 322 is further configured to:
and the frame layer of the mobile terminal queries and obtains the information of the folder to be processed and the information of the target folder from a media library of the mobile terminal through the folder handle to be processed and the target folder path handle.
Optionally, the processing unit 33 is further configured to:
when the processing instruction is a copying instruction of the folder to be processed, creating a target folder with the same name as the folder to be processed based on the path of the target folder, and storing the files stored in the folder to be processed in the target folder based on the path of the files stored in the folder to be processed;
when the processing instruction is a cutting instruction of the folder to be processed, creating a target folder with the same name as the folder to be processed based on the path of the target folder, and storing the file stored in the folder to be processed in the target folder based on the path of the file stored in the folder to be processed;
deleting the successfully stored files in the folder to be processed based on the path of the files stored in the folder to be processed;
and deleting the folder to be processed after all the files stored in the folder to be processed are successfully stored in the target folder.
Optionally, the monitoring unit 31 includes:
a version obtaining module 311, configured to obtain a version of an operating system of the terminal device;
the monitoring module 312 is configured to monitor, through a driver layer of the mobile terminal, a processing instruction sent by the terminal device for a file or a folder in a storage space of the mobile terminal if the version of the operating system of the terminal device is a preset version.
It will be apparent to those skilled in the art that, for convenience and simplicity of description, the foregoing functional units and modules are merely illustrated in terms of division, and in practical applications, the foregoing functional allocation may be performed by different functional units and modules as needed, that is, the internal structure of the mobile terminal is divided into different functional units or modules to perform all or part of the above described 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 process of the units and modules in the mobile terminal may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Fig. 4 is a schematic block diagram of a mobile terminal according to another embodiment of the present application. As shown in fig. 4, the mobile terminal 4 of this embodiment includes: one or more processors 40, a memory 41, and a computer program 42 stored in the memory 41 and executable on the processors 40. The processor 40, when executing the computer program 42, implements the steps in the various method embodiments described above, such as the steps S101 to S103 shown in fig. 1. Alternatively, the processor 40, when executing the computer program 42, implements the functions of the modules/units in the above-described mobile terminal embodiments, such as the functions of the modules 31 to 33 shown in fig. 3.
Illustratively, the computer program 42 may be partitioned into one or more modules/units that are stored in the memory 41 and executed by the processor 40 to accomplish the present application. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program 42 in the mobile terminal 4. For example, the computer program 42 may be divided into a monitoring unit, an information acquisition unit, a processing unit.
The monitoring unit is used for monitoring a processing instruction of a file or a folder in the storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal after the mobile terminal is connected with the terminal equipment;
the information acquisition unit is used for acquiring information of a to-be-processed document or information of a to-be-processed folder corresponding to a processing instruction through a framework layer of the mobile terminal and transmitting the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction to a driving layer of the mobile terminal if the processing instruction of the document or the folder in the storage space of the mobile terminal, which is sent by the terminal equipment, is monitored;
and the processing unit is used for controlling the driving layer of the mobile terminal to process the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result.
Other units or modules may refer to the description of the embodiment shown in fig. 3, and are not described herein again.
The mobile terminal includes, but is not limited to, a processor 40, a memory 41. Those skilled in the art will appreciate that fig. 4 is only one example of a mobile terminal 4 and is not intended to limit the mobile terminal 4 and may include more or fewer components than shown, or some components may be combined, or different components, for example, the mobile terminal may also include input devices, output devices, network access devices, buses, etc.
The Processor 40 may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 41 may be an internal storage unit of the mobile terminal 4, such as a hard disk or a memory of the mobile terminal 4. The memory 41 may also be an external storage device of the mobile terminal 4, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, provided on the mobile terminal 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the mobile terminal 4. The memory 41 is used for storing the computer program and other programs and data required by the mobile terminal. The memory 41 may also be used to temporarily store data that has been output or is to be output.
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 mobile terminal and method may be implemented in other ways. For example, the above-described embodiments of the mobile terminal are merely illustrative, and for example, the division of the 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, 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 can be realized by a computer program, which can be stored in a computer-readable storage medium and can realize the steps of the embodiments of the methods described above when the computer program is executed by a processor. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the 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 signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media which may not include electrical carrier signals and telecommunications signals in accordance with legislation and patent practice.
The above-mentioned 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 (9)
1. A file or folder processing method, comprising:
after the mobile terminal is connected with the terminal equipment, monitoring a processing instruction of a file or a folder in a storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal;
if a processing instruction of a file or a folder in the storage space of the mobile terminal sent by the terminal equipment is monitored, acquiring information of a file to be processed or a folder to be processed corresponding to the processing instruction through a frame layer of the mobile terminal, and transmitting the information of the file to be processed or the folder to be processed corresponding to the processing instruction to a driving layer of the mobile terminal;
the drive layer of the mobile terminal processes the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result;
the driving layer of the mobile terminal transmits the processing result to the framework layer of the mobile terminal, and the framework layer of the mobile terminal updates the processing result to a media library of the mobile terminal;
and the drive layer of the mobile terminal sends the processing result to the terminal equipment based on a media transmission protocol, wherein the processing result is used for indicating the terminal equipment to update a virtual media library, and the virtual media library is a virtual library mapped to the terminal equipment by the media library on the mobile terminal.
2. The method for processing the files or folders according to claim 1, wherein the monitoring, by the driver layer of the mobile terminal, the processing instruction sent by the terminal device for the files or folders in the storage space of the mobile terminal after the mobile terminal establishes the connection with the terminal device comprises:
after a mobile terminal and a terminal device are connected through a USB interface, a drive layer of the mobile terminal monitors a processing instruction of the terminal device to a file or a folder in a storage space of the mobile terminal, which is sent by the terminal device based on a media transmission protocol, wherein the processing instruction comprises: copy instructions and cut instructions.
3. The method according to claim 2, wherein the obtaining information of the file to be processed or the folder to be processed corresponding to the processing instruction through the framework layer of the mobile terminal comprises:
when the processing instruction corresponds to a file to be processed, acquiring information of the file to be processed and information of a target folder corresponding to the processing instruction through a driving layer of the mobile terminal, wherein the information of the file to be processed comprises: the name of the file to be processed and the path of the file to be processed, and the information of the target folder comprises: a path of the target folder;
when the processing instruction corresponds to a folder to be processed, acquiring information of the folder to be processed and information of a target folder corresponding to the processing instruction through a driving layer of the mobile terminal, wherein the information of the folder to be processed comprises: the name of the folder to be processed, the path of the folder to be processed, the name of the file stored in the folder to be processed, and the path of the file stored in the folder to be processed, wherein the information of the target folder comprises: path of the target folder.
4. The file or folder processing method according to claim 3, wherein the obtaining, by the driver layer of the mobile terminal, the information of the file to be processed and the information of the target folder corresponding to the processing instruction includes:
based on a media transmission protocol, a driver layer of the mobile terminal acquires a file handle to be processed and a target folder path handle corresponding to the processing instruction from the terminal equipment and transmits the file handle to be processed and the target folder path handle to a framework layer of the mobile terminal;
the frame layer of the mobile terminal queries and obtains information of the folder to be processed and information of the target folder from a media library of the mobile terminal through the handle of the file to be processed and the path handle of the target folder;
the acquiring, by the driver layer of the mobile terminal, the information of the folder to be processed and the information of the target folder corresponding to the processing instruction includes:
based on a media transmission protocol, a driver layer of the mobile terminal acquires a to-be-processed folder handle and a target folder path handle corresponding to the processing instruction from the terminal equipment and transmits the to-be-processed folder handle and the target folder path handle to a framework layer of the mobile terminal;
and the frame layer of the mobile terminal queries and obtains the information of the folder to be processed and the information of the target folder from a media library of the mobile terminal through the folder handle to be processed and the target folder path handle.
5. The file or folder processing method according to claim 3, wherein when the processing instruction is a copy instruction of a folder to be processed, the processing the folder to be processed corresponding to the processing instruction and the files in the folder to be processed based on the information of the folder to be processed corresponding to the processing instruction comprises:
creating a target folder with the same name as the folder to be processed based on the path of the target folder, and storing the files stored in the folder to be processed in the target folder based on the path of the files stored in the folder to be processed;
when the processing instruction is a cutting instruction of a folder to be processed, the processing the folder to be processed corresponding to the processing instruction and the files in the folder to be processed based on the information of the folder to be processed corresponding to the processing instruction further includes:
deleting the successfully stored files in the folder to be processed based on the path of the files stored in the folder to be processed;
and deleting the folder to be processed after all the files stored in the folder to be processed are successfully stored in the target folder.
6. The file or folder processing method according to any one of claims 1 to 5, further comprising, before monitoring, by a driver layer of a mobile terminal, a processing instruction issued by the terminal device for a file or folder in a storage space of the mobile terminal:
acquiring the version of an operating system of the terminal equipment;
and if the version of the operating system of the terminal equipment is a preset version, monitoring a processing instruction of the terminal equipment to the file or the folder in the storage space of the mobile terminal through a driving layer of the mobile terminal.
7. A mobile terminal, comprising:
the monitoring unit is used for monitoring a processing instruction of a file or a folder in the storage space of the mobile terminal, which is sent by the terminal equipment, through a driving layer of the mobile terminal after the mobile terminal is connected with the terminal equipment;
the information acquisition unit is used for acquiring information of a to-be-processed document or information of a to-be-processed folder corresponding to a processing instruction through a framework layer of the mobile terminal and transmitting the information of the to-be-processed document or the information of the to-be-processed folder corresponding to the processing instruction to a driving layer of the mobile terminal if the processing instruction of the document or the folder in the storage space of the mobile terminal, which is sent by the terminal equipment, is monitored;
the processing unit is used for controlling the drive layer of the mobile terminal to process the file to be processed or the folder to be processed corresponding to the processing instruction based on the information of the file to be processed or the information of the folder to be processed corresponding to the processing instruction to obtain a processing result;
the updating unit is used for controlling a driving layer of the mobile terminal to transmit the processing result to a framework layer of the mobile terminal, and the framework layer of the mobile terminal updates the processing result to a media library of the mobile terminal;
and the interaction unit is used for controlling a driving layer of the mobile terminal to send the processing result to the terminal equipment based on a media transmission protocol, wherein the processing result is used for indicating the terminal equipment to update a virtual media library, and the virtual media library is a virtual library mapped to the terminal equipment by the media library on the mobile terminal.
8. A mobile terminal 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 of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by one or more processors, implements the steps of the method according to any one of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811126790.2A CN109376126B (en) | 2018-09-26 | 2018-09-26 | File or folder processing method, mobile terminal and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811126790.2A CN109376126B (en) | 2018-09-26 | 2018-09-26 | File or folder processing method, mobile terminal and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109376126A CN109376126A (en) | 2019-02-22 |
CN109376126B true CN109376126B (en) | 2021-01-15 |
Family
ID=65402704
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811126790.2A Active CN109376126B (en) | 2018-09-26 | 2018-09-26 | File or folder processing method, mobile terminal and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109376126B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110232043B (en) * | 2019-05-20 | 2023-03-14 | 深圳前海达闼云端智能科技有限公司 | Method, system, electronic device and computer storage medium for displaying files |
CN110460668B (en) * | 2019-08-15 | 2022-09-13 | 深圳市盟天科技有限公司 | File uploading method and device, computer equipment and storage medium |
CN112631998B (en) * | 2020-12-18 | 2023-08-25 | 广州鸿金信息科技有限公司 | Folder display method and related equipment |
CN114610239A (en) * | 2022-03-14 | 2022-06-10 | 深圳依时货拉拉科技有限公司 | Method and device for operating file in portable memory by mobile terminal |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
TW200805154A (en) * | 2006-07-10 | 2008-01-16 | Matsushita Electric Tw Co Ltd | Method for downloading file/catalog from electronic apparatus to correspond to physical data file |
CN104765704B (en) * | 2015-03-17 | 2018-06-22 | 苏州佳世达电通有限公司 | A kind of mobile communication device and electronic equipment |
CN106649596A (en) * | 2016-11-24 | 2017-05-10 | 歌尔科技有限公司 | Method and device for displaying folder catalogue in intelligent terminal |
CN107168905B (en) * | 2017-05-11 | 2020-08-21 | Oppo广东移动通信有限公司 | File display method and device, storage medium and mobile terminal |
CN107506494B (en) * | 2017-09-27 | 2019-04-12 | Oppo广东移动通信有限公司 | Document handling method, mobile terminal and computer readable storage medium |
CN107967322B (en) * | 2017-11-23 | 2021-09-21 | 努比亚技术有限公司 | File classification display method, mobile terminal and computer readable storage medium |
-
2018
- 2018-09-26 CN CN201811126790.2A patent/CN109376126B/en active Active
Non-Patent Citations (1)
Title |
---|
"金山手机助手识别与连接模块的设计与实现";曹建华;《中国优秀硕士学位论文全文数据库 信息科技辑》;20170315(第3期);I138-1893 * |
Also Published As
Publication number | Publication date |
---|---|
CN109376126A (en) | 2019-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109376126B (en) | File or folder processing method, mobile terminal and storage medium | |
CN100456303C (en) | File delete method and file open method | |
CN109359091B (en) | File management method, device, terminal and computer readable storage medium | |
CN104699423B (en) | The method and apparatus that drive is bound in linux system | |
KR20190076197A (en) | Apparatus and method for storing data based on blockchain | |
CN108255989B (en) | Picture storage method and device, terminal equipment and computer storage medium | |
CN111694589B (en) | Upgrade package generation method, device, server and computer readable storage medium | |
CN110020266B (en) | Method and device for accessing pictures, computer-readable storage medium and terminal equipment | |
CN110019040B (en) | Folder processing method, mobile terminal and storage medium | |
JPH0887407A (en) | Decentralized development management device | |
CN109656592B (en) | Card management method, device, terminal and computer readable storage medium | |
CN111400091A (en) | Factory setting restoring method, factory setting restoring device and mobile terminal | |
CN110300222B (en) | Short message display method, system, terminal equipment and computer readable storage medium | |
WO2020113421A1 (en) | Method for mounting file system, terminal device, and storage medium | |
CN109298956B (en) | File transmission method and device and terminal equipment | |
CN112015459A (en) | Method and device for upgrading image file, terminal and readable storage medium | |
CN109271543B (en) | Thumbnail display method and device, terminal and computer-readable storage medium | |
CN111143092A (en) | Fault recording data processing method and system and terminal equipment | |
CN109104481B (en) | File integrity detection method, file integrity detection device and terminal equipment | |
CN112527276B (en) | Data updating method and device in visual programming tool and terminal equipment | |
CN112463268A (en) | Application data processing method, device, equipment and storage medium | |
CN107506386B (en) | Data aggregation method and device based on NAS, terminal equipment and storage medium | |
WO2021097622A1 (en) | File processing method, file processing apparatus and terminal device | |
CN108629175B (en) | Access control method and access control device of USB mass storage equipment | |
CN106775456A (en) | A kind of data processing method, apparatus and system |
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 |