CN107609119B - File processing method, mobile terminal and computer readable storage medium - Google Patents

File processing method, mobile terminal and computer readable storage medium Download PDF

Info

Publication number
CN107609119B
CN107609119B CN201710823637.4A CN201710823637A CN107609119B CN 107609119 B CN107609119 B CN 107609119B CN 201710823637 A CN201710823637 A CN 201710823637A CN 107609119 B CN107609119 B CN 107609119B
Authority
CN
China
Prior art keywords
file
directory
subdirectory
mobile terminal
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
Application number
CN201710823637.4A
Other languages
Chinese (zh)
Other versions
CN107609119A (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 CN201710823637.4A priority Critical patent/CN107609119B/en
Publication of CN107609119A publication Critical patent/CN107609119A/en
Application granted granted Critical
Publication of CN107609119B publication Critical patent/CN107609119B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

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

Abstract

The invention is applicable to the technical field of communication, and provides a file processing method, a mobile terminal and a computer readable storage medium, comprising the following steps: when detecting a newly added file in a virtual file system of the mobile terminal, acquiring a first file ID of the newly added file; sending an event of successfully acquiring the first file ID to external equipment; receiving a first directory ID fed back by the external equipment, and acquiring a first subdirectory ID and a first file ID of a first directory according to the first directory ID; acquiring a second subdirectory ID corresponding to the first subdirectory ID according to the first subdirectory ID, and acquiring a second file ID corresponding to the first file ID according to the first file ID; acquiring the information of the subdirectories according to the ID of the second subdirectory and acquiring the information of the file according to the ID of the second file; and sending the information of the subdirectory and the information of the file to the external equipment. The invention can realize the real-time refreshing of the external equipment when the external equipment operates the file in the mobile terminal.

Description

File processing method, mobile terminal and computer readable storage medium
Technical Field
The invention belongs to the technical field of communication, and particularly relates to a file processing method, a mobile terminal and a computer readable storage medium.
Background
With the rapid development of mobile terminals, the functions of the mobile terminals are more and more diversified, and more files (such as pictures, audio and video files, and the like) are stored in the mobile terminals. In order to more conveniently manage files stored in a mobile terminal, the mobile terminal is generally connected with an external device (e.g., a computer) to manage the files stored in the mobile terminal through the external device. However, when the external device operates the file in the mobile terminal, the mobile terminal will update accordingly, but the external device cannot refresh in real time.
Therefore, a new technical solution is needed to solve the above technical problems.
Disclosure of Invention
In view of this, embodiments of the present invention provide a file processing method, a mobile terminal, and a computer-readable storage medium, so as to implement real-time refreshing of an external device when the external device operates a file in the mobile terminal.
A first aspect of an embodiment of the present invention provides a file processing method, where the file processing method includes:
when detecting a newly added file in a virtual file system of a mobile terminal, acquiring a first file ID of the newly added file, wherein the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal, and the first file ID of the newly added file is the ID of the newly created file in the virtual file system;
sending an event of successfully acquiring the first file ID of the new file to an external device connected with the mobile terminal;
receiving a first directory ID fed back by the external equipment, and acquiring a first subdirectory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, wherein the first directory ID is the directory ID of an interface where the external equipment creates the newly added file, the first subdirectory ID of the first directory is the ID of a subdirectory under the first directory in the virtual file system, and the first file ID of the first directory is the ID of a file under the first directory in the virtual file system;
acquiring a second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory, and acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory, wherein the second subdirectory ID is the ID of the subdirectory under the first directory when the subdirectory is displayed in a magnetic disk of the mobile terminal, and the second file ID is the ID of the file under the first directory when the file under the first directory is displayed in the magnetic disk of the mobile terminal;
acquiring information of the subdirectory according to the second subdirectory ID, and acquiring information of the file according to the second file ID, wherein the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
and sending the information of the subdirectory and the information of the file to the external equipment.
A second aspect of an embodiment of the present invention provides a mobile terminal, including:
the mobile terminal comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first file ID of a newly added file when the newly added file in a virtual file system of the mobile terminal is detected, the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal, and the first file ID of the newly added file is the ID of the newly added file in the virtual file system;
the first sending module is used for sending an event of successfully obtaining the first file ID of the new file to an external device connected with the mobile terminal;
the processing module is configured to receive a first directory ID fed back by the external device, and acquire a first sub-directory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, where the first directory ID is a directory ID of an interface where the external device creates the newly added file, the first sub-directory ID of the first directory is an ID of a sub-directory in the first directory in the virtual file system, and the first file ID of the first directory is an ID of a file in the first directory in the virtual file system;
a second obtaining module, configured to obtain, according to a first sub-directory ID of the first directory, a second sub-directory ID corresponding to the first sub-directory ID of the first directory, and obtain, according to the first file ID of the first directory, a second file ID corresponding to the first file ID of the first directory, where the second sub-directory ID is an ID of a sub-directory in the first directory when the sub-directory is displayed in a disk of the mobile terminal, and the second file ID is an ID of a file in the first directory when the file in the first directory is displayed in the disk of the mobile terminal;
a third obtaining module, configured to obtain information of the subdirectory according to the second subdirectory ID, and obtain information of the file according to the second file ID, where the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
and the second sending module is used for sending the information of the subdirectory and the information of the file to the external equipment.
A third aspect of embodiments of the present invention 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 file processing method according to the first aspect when executing the computer program.
A fourth aspect of embodiments of the present invention provides a computer-readable storage medium, which stores a computer program that, when executed by a processor, implements the steps of the file processing method according to the first aspect.
A fifth aspect of embodiments of the present invention provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the file processing method according to the first aspect described above.
Compared with the prior art, the embodiment of the invention has the following beneficial effects: when detecting a newly added file in a virtual file system of a mobile terminal, the embodiment of the invention acquires a first file ID of the newly added file, sends an event of successfully acquiring the first file ID of the newly added file to an external device, receives a first directory ID fed back by the external device, acquires a first subdirectory ID and a first file ID of the first directory according to the first directory ID, further acquires a second subdirectory ID corresponding to the first subdirectory ID and a second file ID corresponding to the first file ID, so as to acquire information of the subdirectory through the second subdirectory ID, acquire information of the file through the second file ID, and sends the information of the subdirectory and the information of the file to the external device, so that the external device displays the information of the subdirectory and the information of the file under the first directory. According to the embodiment of the invention, when the file is newly added in the virtual file system of the mobile terminal, the query operation of the external equipment is triggered, and the subdirectory and the file which are to be displayed on the current display interface of the external equipment are queried, so that all subdirectories and files of the directory can be displayed under the directory of the newly built file in the external equipment, and the real-time refreshing of the external equipment is realized.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, 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 invention, 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 diagram of a network architecture of a document processing system according to an embodiment of the present invention;
fig. 2 is a schematic flow chart illustrating an implementation of a file processing method according to a second embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating an implementation of a file processing method according to a third embodiment of the present invention;
fig. 4 is a schematic diagram of a mobile terminal according to a fourth embodiment of the present invention;
fig. 5 is a schematic diagram of a mobile terminal according to a fifth embodiment of the present invention;
fig. 6 is a schematic diagram of a mobile terminal according to a sixth embodiment of the present invention.
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 invention. It will be apparent, however, to one skilled in the art that the present invention 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 invention 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 invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention 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 particular implementations, mobile terminals described in embodiments of the invention include, but are not limited to, other portable devices such as mobile phones, laptop computers, or tablet computers having touch sensitive surfaces (e.g., touch screen displays and/or touch pads). It should also be understood that in some embodiments, the device is not a portable communication device, but is a desktop computer having a touch-sensitive surface (e.g., a touch screen display and/or touchpad).
In the discussion that follows, a mobile terminal that includes a display and a touch-sensitive surface is described. However, it should be understood that the mobile terminal may include one or more other physical user interface devices such as a physical keyboard, mouse, and/or joystick.
The mobile terminal supports various applications, such as one or more of the following: a drawing application, a presentation application, a word processing application, a website creation application, a disc burning application, a spreadsheet application, a gaming application, a telephone application, a video conferencing application, an email application, an instant messaging application, an exercise support application, a photo management application, a digital camera application, a web browsing application, a digital music player application, and/or a digital video player application.
Various applications that may be executed on the mobile terminal may use at least one common physical user interface device, such as a touch-sensitive surface. One or more functions of the touch-sensitive surface and corresponding information displayed on the terminal can be adjusted and/or changed between applications and/or within respective applications. In this way, a common physical architecture (e.g., touch-sensitive surface) of the terminal can support various applications with user interfaces that are intuitive and transparent to the user.
It should be understood that, the sequence numbers of the steps in this embodiment do not mean the execution sequence, and the execution sequence of each process should be determined by the function and the inherent logic of the process, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
In order to explain the technical means of the present invention, the following description will be given by way of specific examples.
Fig. 1 is a network architecture diagram of a file processing system according to an embodiment of the present invention, and only the parts related to the embodiment of the present invention are shown for convenience of description.
As shown in fig. 1, the file processing system includes a mobile terminal 11 and an external device 12. The external device 12 refers to a device that can be connected to the mobile terminal 11 through an external interface on the mobile terminal 11, for example, a device connected through a USB. The mobile terminal 11 may be connected to the external device 12 through a USB, so that the mobile terminal 11 and the external device 12 are in a Media Transfer Protocol (MTP) connection mode, because MTP can be implemented on the USB.
The method and the device achieve real-time refreshing of the external device when the external device operates the file in the mobile terminal. In the embodiment of the present invention, when detecting a newly added file in a virtual file system of a mobile terminal 11, a mobile terminal 11 obtains a first file ID of the newly added file, and sends an event that the first file ID of the newly added file is successfully obtained to an external device 12 connected to the mobile terminal 11, the external device 12 feeds back a first directory ID to the mobile terminal 11 after receiving the event that the first file ID of the newly added file is successfully obtained, the mobile terminal 11 obtains a first subdirectory ID and a first file ID of the first directory from the virtual file system according to the first directory ID after receiving the first directory ID, obtains a second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory, and obtains a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory, the mobile terminal 11 obtains the information of the subdirectory according to the second subdirectory ID, obtains the information of the file according to the second file ID, and sends the information of the subdirectory and the information of the file to the external device 12, and the external device 12 displays the information of the subdirectory and the information of the file in the first directory after receiving the information of the subdirectory and the information of the file, thereby realizing the real-time refreshing of the external device 12.
Wherein the virtual file system is a database mapped by traversing a disk of a mobile terminal, a first file ID of the newly-added file is an ID of the newly-added file in the virtual file system, the first directory ID is a directory ID of an interface where the newly-added file is created by the external device, a first subdirectory ID of the first directory is an ID of a subdirectory under the first directory in the virtual file system, the first file ID of the first directory is an ID of a file under the first directory in the virtual file system, the second subdirectory ID is an ID of a subdirectory under the first directory when the subdirectory under the first directory is displayed in the disk of the mobile terminal, the second file ID is an ID of a file under the first directory when the file is displayed in the disk of the mobile terminal, and the second subdirectory ID belongs to information of the subdirectory, the second file ID belongs to information of the file.
Optionally, the first file ID of the newly created file in the virtual file system of the mobile terminal 11 corresponds to at least one first directory ID.
Optionally, before obtaining the first file ID of the newly added file, the mobile terminal 11 controls the mobile terminal to update the virtual file system when detecting that the newly added file is stored in the magnetic disk of the mobile terminal.
Optionally, the mobile terminal 11 uses a difference between the first sub-directory ID of the first directory and a first preset offset as the second sub-directory ID, and uses a difference between the first file ID of the first directory and a second preset offset as the second file ID.
Referring to fig. 2, which is a schematic diagram of an implementation flow of a file processing method provided in the second embodiment of the present invention, where the file processing method is applied to a mobile terminal, as shown in the figure, the file processing method may include the following steps:
step S201, when detecting that a new file is added to a virtual file system of the mobile terminal, acquiring a first file ID of the new file.
The virtual file system is a database mapped by traversing a disk of the mobile terminal, and the first file ID of the newly-added file is the ID of the newly-added file in the virtual file system.
Optionally, the mobile terminal and the external device are in a media transfer protocol MTP connection mode.
In the embodiment of the invention, when the MTP connection is established between the mobile terminal and the external equipment, the external equipment can check the files in the mobile terminal. The external device does not directly access the file in the disk of the mobile terminal, but accesses the file in the virtual file system mapped by the disk of the mobile terminal, that is, when the external device operates the file in the mobile terminal displayed by the external device, the external device operates the file in the virtual file system of the mobile terminal. In order to better distinguish whether the ID and directory ID of a file are the ID in the disk of the mobile terminal or the ID in the virtual file system, for the same file, the file ID of the file in the disk of the mobile terminal (i.e., the second file ID) and the file ID of the file in the virtual file system (i.e., the first file ID) may be set to be different, and the directory ID of the file in the disk of the mobile terminal (i.e., the second directory ID) and the directory ID of the file in the virtual file system (i.e., the first directory ID) may be set to be different.
Optionally, the first file ID of the newly created file in the virtual file system corresponds to at least one first directory ID.
Since one file in the magnetic disk of the mobile terminal is usually stored in one directory, in order to display one file in a different directory when the external device displays the file in the mobile terminal, the embodiment of the present invention may map the file ID (i.e., the first file ID) of the newly created file in the virtual file system to a plurality of directory IDs (i.e., the first directory ID) when the file in the magnetic disk of the mobile terminal is mapped into the virtual file system.
Step S202, an event of successfully acquiring the first file ID of the new file is sent to an external device connected with the mobile terminal.
In the embodiment of the present invention, the mobile terminal sends an event that the first file ID of the new file is successfully acquired to the external device, so as to trigger the external device to acquire the first directory ID of the currently displayed interface of the external device according to the currently displayed interface of the external device, and send the first directory ID to the mobile terminal. In the embodiment of the present invention, when the external device creates a new file, the mobile terminal is updated (that is, the new file is added to the mobile terminal), and then the external device is refreshed in real time.
Step S203, receiving the first directory ID fed back by the external device, and acquiring a first subdirectory ID and a first file ID of the first directory from the virtual file system according to the first directory ID.
The first directory ID is a directory ID of an interface where the new file is created by the external device, that is, the first directory ID is an ID of a directory to which the new file belongs in a file of the mobile terminal displayed by the external device or an ID of a directory to which the new file belongs in the virtual file system. The first subdirectory ID of the first directory is an ID of a subdirectory under the first directory in the virtual file system, and the first file ID of the first directory is an ID of a file under the first directory in the virtual file system.
When the external device accesses a file in the mobile terminal, the external device actually accesses the file in the virtual file system of the mobile terminal, that is, the file in the mobile terminal displayed by the external device corresponds to the file in the virtual file system, and according to the first directory ID fed back by the external device, all the subdirectory IDs and file IDs under the first directory, that is, all the subdirectory IDs and file IDs of the directory to which the newly-created file belongs in the virtual system, can be acquired from the virtual file system.
Step S204, a second subdirectory ID corresponding to the first subdirectory ID of the first directory is obtained according to the first subdirectory ID of the first directory, and a second file ID corresponding to the first file ID of the first directory is obtained according to the first file ID of the first directory.
The second sub-directory ID is an ID of a sub-directory under the first directory when the sub-directory is displayed in a disk of the mobile terminal, and the second file ID is an ID of a file under the first directory when the file is displayed in a disk of the mobile terminal.
Optionally, the obtaining a second sub-directory ID corresponding to the first sub-directory ID of the first directory according to the first sub-directory ID of the first directory includes:
taking the difference value between the first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID;
acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory comprises:
and taking the difference value between the first file ID of the first directory and a second preset offset as the second file ID.
In order to distinguish all subdirectories and files of the directory to which the newly created file belongs in the virtual file system from all subdirectories and files of the directory to which the newly created file belongs in the disk of the mobile terminal, a difference value between a subdirectory ID of the directory to which the newly created file belongs in the virtual file system and a first preset offset value can be used as a subdirectory ID of the directory to which the newly created file belongs in the disk of the mobile terminal, and a difference value between a file ID of the directory to which the newly created file belongs in the virtual file system and a second preset offset value can be used as a file ID of the directory to which the newly created file belongs in the disk of the mobile terminal.
Step S205, obtaining the information of the subdirectory according to the second subdirectory ID, and obtaining the information of the file according to the second file ID.
Wherein the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file.
In the embodiment of the present invention, the information of the subdirectory includes, but is not limited to, a name, a size, a creation date, a storage path, a second subdirectory ID of the subdirectory, and the like of the subdirectory. The information of the file includes, but is not limited to, the name, size, creation date, storage path, second file ID, etc. of the new file.
Step S206, the information of the subdirectory and the information of the file are sent to the external equipment.
In this embodiment of the present invention, after receiving the information of the sub-directory and the information of the file sent by the mobile terminal, the external device may display the information of the sub-directory and the information of the file in a directory to which a new file of the external device belongs.
According to the embodiment of the invention, when the file is newly added in the virtual file system of the mobile terminal, the query operation of the external equipment is triggered, and the subdirectory and the file which are to be displayed on the current display interface of the external equipment are queried, so that all subdirectories and files of the directory can be displayed under the directory of the newly built file in the external equipment, and the real-time refreshing of the external equipment is realized.
Referring to fig. 3, which is a schematic diagram of an implementation flow of a file processing method provided in the third embodiment of the present invention, where the file processing method is applied to a mobile terminal, as shown in the figure, the file processing method may include the following steps:
step S301, when detecting a new file of a magnetic disk of the mobile terminal, controlling the mobile terminal to update a virtual file system.
In the embodiment of the invention, when the mobile terminal detects that the disk of the mobile terminal has the newly added file, the mobile terminal is driven by the MTP to update the virtual file system, so that the newly added file is added in the virtual file system.
Step S302, when detecting that the newly added file is newly added in the virtual file system, acquiring a first file ID of the newly added file.
The step is the same as step S201, and reference may be made to the related description of step S201, which is not repeated herein.
Step S303, sending the event of successfully acquiring the first file ID of the new file to the external device connected to the mobile terminal.
The step is the same as step S202, and reference may be made to the related description of step S202, which is not repeated herein.
Step S304, receiving the first directory ID fed back by the external device, and acquiring the first subdirectory ID and the first file ID of the first directory from the virtual file system according to the first directory ID.
The step is the same as step S203, and reference may be specifically made to the related description of step S203, which is not repeated herein.
Step S305, acquiring a second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory, and acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory.
The step is the same as step S204, and reference may be made to the related description of step S204, which is not repeated herein.
Step S306, the information of the subdirectory is obtained according to the second subdirectory ID, and the information of the file is obtained according to the second file ID.
The step is the same as step S205, and reference may be made to the related description of step S205, which is not repeated herein.
Step S307, sending the information of the subdirectory and the information of the file to the external device.
The step is the same as step S206, and reference may be made to the related description of step S206, which is not repeated herein.
According to the embodiment of the invention, when the new disk of the mobile terminal is newly built, the query operation of the external equipment is triggered to query the subdirectories and files which are to be displayed on the current display interface of the external equipment, so that all subdirectories and files of the directory can be displayed under the directory of the newly built files in the external equipment, and the real-time refreshing of the external equipment is further realized.
Fig. 4 is a schematic diagram of a mobile terminal according to a fourth embodiment of the present invention, and for convenience of description, only the parts related to the embodiment of the present invention are shown.
The mobile terminal includes:
a first obtaining module 41, configured to, when a new file in a virtual file system of a mobile terminal is detected, obtain a first file ID of the new file, where the virtual file system is obtained by traversing a database mapped to a disk of the mobile terminal, and the first file ID of the new file is an ID of the new file in the virtual file system;
a first sending module 42, configured to send an event that the first file ID of the new file is successfully obtained to an external device connected to the mobile terminal;
a processing module 43, configured to receive a first directory ID fed back by the external device, and obtain a first sub-directory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, where the first directory ID is a directory ID of an interface where the external device creates the newly added file, the first sub-directory ID of the first directory is an ID of a sub-directory in the first directory in the virtual file system, and the first file ID of the first directory is an ID of a file in the first directory in the virtual file system;
a second obtaining module 44, configured to obtain, according to a first sub-directory ID of the first directory, a second sub-directory ID corresponding to the first sub-directory ID of the first directory, and obtain, according to a first file ID of the first directory, a second file ID corresponding to the first file ID of the first directory, where the second sub-directory ID is an ID of a sub-directory in the first directory when the sub-directory is displayed in a disk of the mobile terminal, and the second file ID is an ID of a file in the first directory when the file in the first directory is displayed in a disk of the mobile terminal;
a third obtaining module 45, configured to obtain information of the subdirectory according to the second subdirectory ID, and obtain information of the file according to the second file ID, where the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
a second sending module 46, configured to send the information of the subdirectory and the information of the file to the external device.
Optionally, the first file ID of the newly created file in the virtual file system corresponds to at least one first directory ID;
optionally, the mobile terminal further includes:
the control module 47 is configured to control the mobile terminal to update the virtual file system when detecting that a new file is added to a magnetic disk of the mobile terminal;
optionally, the first obtaining module 41 includes:
a first obtaining unit, configured to use a difference between a first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID;
and the second obtaining unit is used for taking a difference value between the first file ID of the first directory and a second preset offset as the second file ID.
Optionally, the mobile terminal and the external device are in a media transfer protocol MTP connection mode.
Fig. 5 is a schematic diagram of a mobile terminal according to a fifth embodiment of the present invention. The mobile terminal as shown in the figure may include: one or more processors 501 (only one shown); one or more input devices 502 (only one shown), one or more output devices 503 (only one shown), and a memory 504. The processor 501, the input device 502, the output device 503, and the memory 504 are connected by a bus 505. The memory 504 is used for storing instructions and the processor 501 is used for executing the instructions stored by the memory 504. Wherein:
the processor 501 is configured to, when a new file in a virtual file system of a mobile terminal is detected, obtain a first file ID of the new file, where the virtual file system is obtained by traversing a database mapped to a disk of the mobile terminal, and the first file ID of the new file is an ID of the new file in the virtual file system; sending an event of successfully acquiring the first file ID of the new file to an external device connected with the mobile terminal; receiving a first directory ID fed back by the external equipment, and acquiring a first subdirectory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, wherein the first directory ID is the directory ID of an interface where the external equipment creates the newly added file, the first subdirectory ID of the first directory is the ID of a subdirectory under the first directory in the virtual file system, and the first file ID of the first directory is the ID of a file under the first directory in the virtual file system; acquiring a second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory, and acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory, wherein the second subdirectory ID is the ID of the subdirectory under the first directory when the subdirectory is displayed in a magnetic disk of the mobile terminal, and the second file ID is the ID of the file under the first directory when the file under the first directory is displayed in the magnetic disk of the mobile terminal; acquiring information of the subdirectory according to the second subdirectory ID, and acquiring information of the file according to the second file ID, wherein the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file; and sending the information of the subdirectory and the information of the file to the external equipment.
Optionally, the first file ID of the newly created file in the virtual file system corresponds to at least one first directory ID.
Optionally, the processor 501 is further configured to control the mobile terminal to update the virtual file system when detecting that a new file is added to the disk of the mobile terminal.
Optionally, the processor 501 is specifically configured to use a difference between a first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID; and taking the difference value between the first file ID of the first directory and a second preset offset as the second file ID.
Optionally, the mobile terminal and the external device are in a media transfer protocol MTP connection mode.
The output device 503 is configured to communicate with the external device.
The memory 504 is used for storing software programs and modules. The processor 501 executes various functional applications and data processing by executing software programs and modules stored in the memory 504 to transmit information of the subdirectory and information of the file to the external device.
It should be understood that, in the embodiment of the present invention, the Processor 501 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 502 may include a touch pad, a fingerprint sensor (for collecting fingerprint information of a user and direction information of the fingerprint), a microphone, a data receiving interface, and the like. The output device 503 may include a display (LCD, etc.), a speaker, a data transmission interface, and the like.
The memory 504 may include a read-only memory and a random access memory, and provides instructions and data to the processor 501. A portion of the memory 504 may also include non-volatile random access memory. For example, the memory 504 may also store device type information.
In a specific implementation, the processor 501, the input device 502, the output device 503, and the memory 504 described in this embodiment of the present invention may execute the implementation described in the embodiment of the file processing method provided in this embodiment of the present invention, or may execute the implementation described in the mobile terminal described in the fourth embodiment of the present invention, which is not described herein again.
Fig. 6 is a schematic diagram of a mobile terminal according to a sixth embodiment of the present invention. As shown in fig. 6, the mobile terminal 6 of this embodiment includes: a processor 60, a memory 61 and a computer program 62 stored in said memory 61 and executable on said processor 60. The processor 60, when executing the computer program 62, implements the steps in the various file processing method embodiments described above, such as the steps S201 to S206 shown in fig. 2. Alternatively, the processor 60, when executing the computer program 62, implements the functions of the modules/units in the above-described device embodiments, such as the functions of the modules 41 to 47 shown in fig. 4.
Illustratively, the computer program 62 may be partitioned into one or more modules/units that are stored in the memory 61 and executed by the processor 60 to implement the present invention. 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 62 in the mobile terminal 6. For example, the computer program 62 may be divided into a first obtaining module, a first sending module, a processing module, a second obtaining module, a third obtaining module, a second sending module, and a control module, and each module has the following specific functions:
the mobile terminal comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first file ID of a newly added file when the newly added file in a virtual file system of the mobile terminal is detected, the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal, and the first file ID of the newly added file is the ID of the newly added file in the virtual file system;
the first sending module is used for sending an event of successfully obtaining the first file ID of the new file to an external device connected with the mobile terminal;
the processing module is configured to receive a first directory ID fed back by the external device, and acquire a first sub-directory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, where the first directory ID is a directory ID of an interface where the external device creates the newly added file, the first sub-directory ID of the first directory is an ID of a sub-directory in the first directory in the virtual file system, and the first file ID of the first directory is an ID of a file in the first directory in the virtual file system;
a second obtaining module, configured to obtain, according to a first sub-directory ID of the first directory, a second sub-directory ID corresponding to the first sub-directory ID of the first directory, and obtain, according to the first file ID of the first directory, a second file ID corresponding to the first file ID of the first directory, where the second sub-directory ID is an ID of a sub-directory in the first directory when the sub-directory is displayed in a disk of the mobile terminal, and the second file ID is an ID of a file in the first directory when the file in the first directory is displayed in the disk of the mobile terminal;
a third obtaining module, configured to obtain information of the subdirectory according to the second subdirectory ID, and obtain information of the file according to the second file ID, where the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
and the second sending module is used for sending the information of the subdirectory and the information of the file to the external equipment.
Optionally, the first file ID of the newly created file in the virtual file system corresponds to at least one first directory ID;
optionally, the mobile terminal further includes:
the control module is used for controlling the mobile terminal to update the virtual file system when detecting a newly added file of a magnetic disk of the mobile terminal;
optionally, the first obtaining module includes:
a first obtaining unit, configured to use a difference between a first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID;
and the second obtaining unit is used for taking a difference value between the first file ID of the first directory and a second preset offset as the second file ID.
Optionally, the mobile terminal and the external device are in a media transfer protocol MTP connection mode.
The mobile terminal 6 may be a desktop computer, a notebook, a palm computer, a cloud server, or other computing devices. The mobile terminal may include, but is not limited to, a processor 60, a memory 61. Those skilled in the art will appreciate that fig. 6 is merely an example of a mobile terminal 6 and is not intended to limit the mobile terminal 6 and may include more or fewer components than those shown, or some components may be combined, or different components, e.g., the mobile terminal may also include input-output devices, network access devices, buses, etc.
The processor 60 may be a central processing unit CPU, but may also be other general purpose processors, digital signal processors DSP, application specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory 61 may be an internal storage unit of the mobile terminal 6, such as a hard disk or a memory of the mobile terminal 6. The memory 61 may also be an external storage device of the mobile terminal 6, 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 6. Further, the memory 61 may also include both an internal storage unit and an external storage device of the mobile terminal 6. The memory 61 is used for storing the computer program and other programs and data required by the mobile terminal. The memory 61 may also be used to temporarily store data that has been output or is to be output. 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 function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform 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 invention.
In the embodiments provided in the present invention, 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 invention 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 of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. 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 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 does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will 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 invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. A file processing method, characterized in that the file processing method comprises:
when detecting a newly added file of a magnetic disk of a mobile terminal, controlling the mobile terminal to update a virtual file system;
when detecting a newly added file in a virtual file system of a mobile terminal, acquiring a first file ID of the newly added file, wherein the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal, and the first file ID of the newly added file is the ID of the newly added file in the virtual file system;
sending an event of successfully acquiring the first file ID of the newly added file to an external device connected with the mobile terminal;
receiving a first directory ID fed back by the external equipment, and acquiring a first subdirectory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, wherein the first directory ID is the directory ID of an interface where the external equipment creates the newly added file, the first subdirectory ID of the first directory is the ID of a subdirectory under the first directory in the virtual file system, and the first file ID of the first directory is the ID of a file under the first directory in the virtual file system;
acquiring a second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory, and acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory, wherein the second subdirectory ID is the ID of the subdirectory under the first directory when the subdirectory is displayed in a magnetic disk of the mobile terminal, and the second file ID is the ID of the file under the first directory when the file under the first directory is displayed in the magnetic disk of the mobile terminal; the second subdirectory ID is different from the first subdirectory ID, and the second file ID is also different from the first file ID;
acquiring information of the subdirectory according to the second subdirectory ID, and acquiring information of the file according to the second file ID, wherein the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
and sending the information of the subdirectory and the information of the file to the external equipment.
2. The file processing method according to claim 1, wherein the first file ID of the newly added file corresponds to at least one first directory ID in the virtual file system.
3. The file processing method according to claim 1, wherein obtaining the second subdirectory ID corresponding to the first subdirectory ID of the first directory according to the first subdirectory ID of the first directory comprises:
taking the difference value between the first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID;
acquiring a second file ID corresponding to the first file ID of the first directory according to the first file ID of the first directory comprises:
and taking the difference value between the first file ID of the first directory and a second preset offset as the second file ID.
4. The file processing method according to any of claims 1 to 3, wherein the mobile terminal and the external device are in a Media Transfer Protocol (MTP) connection mode.
5. A mobile terminal, characterized in that the mobile terminal comprises:
the control module is used for controlling the mobile terminal to update the virtual file system when detecting a newly added file of a magnetic disk of the mobile terminal;
the mobile terminal comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first file ID of a newly added file when the newly added file in a virtual file system of the mobile terminal is detected, the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal, and the first file ID of the newly added file is the ID of the newly added file in the virtual file system;
the first sending module is used for sending an event of successfully obtaining the first file ID of the newly added file to an external device connected with the mobile terminal;
the processing module is configured to receive a first directory ID fed back by the external device, and acquire a first sub-directory ID and a first file ID of the first directory from the virtual file system according to the first directory ID, where the first directory ID is a directory ID of an interface where the external device creates the newly added file, the first sub-directory ID of the first directory is an ID of a sub-directory in the first directory in the virtual file system, and the first file ID of the first directory is an ID of a file in the first directory in the virtual file system;
a second obtaining module, configured to obtain, according to a first sub-directory ID of the first directory, a second sub-directory ID corresponding to the first sub-directory ID of the first directory, and obtain, according to the first file ID of the first directory, a second file ID corresponding to the first file ID of the first directory, where the second sub-directory ID is an ID of a sub-directory in the first directory when the sub-directory is displayed in a disk of the mobile terminal, and the second file ID is an ID of a file in the first directory when the file in the first directory is displayed in the disk of the mobile terminal; the second subdirectory ID is different from the first subdirectory ID, and the second file ID is also different from the first file ID;
a third obtaining module, configured to obtain information of the subdirectory according to the second subdirectory ID, and obtain information of the file according to the second file ID, where the second subdirectory ID belongs to the information of the subdirectory, and the second file ID belongs to the information of the file;
and the second sending module is used for sending the information of the subdirectory and the information of the file to the external equipment.
6. The mobile terminal of claim 5, wherein the first file ID of the newly added file corresponds to at least one first directory ID in the virtual file system;
the first obtaining module comprises:
a first obtaining unit, configured to use a difference between a first subdirectory ID of the first directory and a first preset offset as the second subdirectory ID;
and the second obtaining unit is used for taking a difference value between the first file ID of the first directory and a second preset offset as the second file ID.
7. The mobile terminal according to claim 5 or 6, wherein the mobile terminal and the external device are in a media transfer protocol, MTP, connection mode.
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 file processing method according to any one of claims 1 to 4.
CN201710823637.4A 2017-09-13 2017-09-13 File processing method, mobile terminal and computer readable storage medium Active CN107609119B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710823637.4A CN107609119B (en) 2017-09-13 2017-09-13 File processing method, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710823637.4A CN107609119B (en) 2017-09-13 2017-09-13 File processing method, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN107609119A CN107609119A (en) 2018-01-19
CN107609119B true CN107609119B (en) 2020-01-24

Family

ID=61064112

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710823637.4A Active CN107609119B (en) 2017-09-13 2017-09-13 File processing method, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN107609119B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110019040B (en) * 2018-09-26 2022-04-12 Oppo广东移动通信有限公司 Folder processing method, mobile terminal and storage medium
CN111913914B (en) * 2020-08-20 2024-04-30 珠海奔图电子有限公司 File processing method and device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227818A (en) * 2013-03-27 2013-07-31 福建伊时代信息科技股份有限公司 Terminal, server, file transferring method, file storage management system and file storage management method
CN106095851A (en) * 2016-06-03 2016-11-09 广东欧珀移动通信有限公司 A kind of catalogue file display packing, device and mobile terminal
CN106649596A (en) * 2016-11-24 2017-05-10 歌尔科技有限公司 Method and device for displaying folder catalogue in intelligent terminal
CN106775488A (en) * 2016-12-27 2017-05-31 维沃移动通信有限公司 The storage method and mobile terminal of a kind of file

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103227818A (en) * 2013-03-27 2013-07-31 福建伊时代信息科技股份有限公司 Terminal, server, file transferring method, file storage management system and file storage management method
CN106095851A (en) * 2016-06-03 2016-11-09 广东欧珀移动通信有限公司 A kind of catalogue file display packing, device and mobile terminal
CN106649596A (en) * 2016-11-24 2017-05-10 歌尔科技有限公司 Method and device for displaying folder catalogue in intelligent terminal
CN106775488A (en) * 2016-12-27 2017-05-31 维沃移动通信有限公司 The storage method and mobile terminal of a kind of file

Also Published As

Publication number Publication date
CN107609119A (en) 2018-01-19

Similar Documents

Publication Publication Date Title
CN108038112B (en) File processing method, mobile terminal and computer readable storage medium
CN107451244B (en) Folder naming method, mobile terminal and computer readable storage medium
CN108400868B (en) Seed key storage method and device and mobile terminal
CN107193598B (en) Application starting method, mobile terminal and computer readable storage medium
CN110286768B (en) Virtual object display method, terminal device and computer-readable storage medium
CN111142650B (en) Screen brightness adjusting method, screen brightness adjusting device and terminal
CN107506494B (en) Document handling method, mobile terminal and computer readable storage medium
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
CN107679222B (en) Picture processing method, mobile terminal and computer readable storage medium
US10359838B2 (en) Hand and finger line grid for hand based interactions
CN107783932B (en) Information processing method of calculator, mobile terminal and computer readable storage medium
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN109271266B (en) File transmission method and device and terminal equipment
CN108521460B (en) Information pushing method and device, mobile terminal and computer readable storage medium
CN109298956B (en) File transmission method and device and terminal equipment
CN109492249B (en) Rapid generation method and device of design drawing and terminal equipment
CN108469938B (en) Electronic book reading reminding method and device and terminal equipment
CN110688035B (en) Photo album processing method, photo album processing device and mobile terminal
CN110245016B (en) Data processing method, system, device and terminal equipment
CN108595569B (en) File path copying method, file path copying device and mobile terminal
CN110874730B (en) Information processing method, information processing device and mobile terminal
CN112596725A (en) Grading method and grading device for programming works, terminal equipment and storage medium
CN112015459A (en) Method and device for upgrading image file, terminal and readable storage medium
CN111352357A (en) Robot control method and device and terminal equipment

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant after: OPPO Guangdong Mobile Communications Co., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Applicant before: Guangdong Opel Mobile Communications Co., Ltd.

GR01 Patent grant
GR01 Patent grant