CN108038112B - 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
CN108038112B
CN108038112B CN201710895624.8A CN201710895624A CN108038112B CN 108038112 B CN108038112 B CN 108038112B CN 201710895624 A CN201710895624 A CN 201710895624A CN 108038112 B CN108038112 B CN 108038112B
Authority
CN
China
Prior art keywords
file
newly added
directory
mobile terminal
added file
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.)
Expired - Fee Related
Application number
CN201710895624.8A
Other languages
Chinese (zh)
Other versions
CN108038112A (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 CN201710895624.8A priority Critical patent/CN108038112B/en
Publication of CN108038112A publication Critical patent/CN108038112A/en
Application granted granted Critical
Publication of CN108038112B publication Critical patent/CN108038112B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/188Virtual file systems

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Telephone Function (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application is applicable to the technical field of communication, and provides a file processing method, a mobile terminal and a computer readable storage medium, which comprise the following steps: when detecting that a new file is added to a magnetic disk of a mobile terminal and the mobile terminal and an external device are in a Media Transfer Protocol (MTP) connection mode, acquiring information of the new file; acquiring a second directory ID of the newly added file according to the first directory ID of the newly added file in the information of the newly added file; storing the information of the newly added file to a second directory of the newly added file in a virtual file system of the mobile terminal; receiving display request information; and if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external equipment. By the method and the device, the external equipment can be refreshed in real time when the mobile terminal operates the file.

Description

File processing method, mobile terminal and computer readable storage medium
Technical Field
The present application belongs to the field of communications technologies, and in particular, 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 mobile terminal operates the file, the external device cannot be refreshed in real time.
Therefore, a new technical solution is needed to solve the above technical problems.
Disclosure of Invention
In view of the above, the present application provides a file processing method, a mobile terminal and a computer readable storage medium, so that when the mobile terminal operates a file, real-time refreshing of an external device cannot be realized.
A first aspect of the present application provides a file processing method, including:
when detecting that a new file is added to a magnetic disk of a mobile terminal and the mobile terminal and an external device are in a Media Transfer Protocol (MTP) connection mode, acquiring information of the new file;
acquiring a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, wherein the first directory ID of the newly added file is the ID of a directory of the newly added file in a magnetic disk of the mobile terminal, the second directory ID of the newly added file is the ID of a directory of the newly added file in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal;
storing the information of the newly added file to a second directory of the newly added file in the virtual file system;
receiving display request information, wherein the display request information is transmitted by the external device;
and if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external equipment.
A second aspect of the present application provides a mobile terminal, comprising:
the file information acquisition module is used for acquiring information of a newly added file when the newly added file of a magnetic disk of the mobile terminal is detected and the mobile terminal and the external equipment are in a Media Transfer Protocol (MTP) connection mode;
a directory ID obtaining module, configured to obtain a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, where the first directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a magnetic disk of the mobile terminal, the second directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal;
the file information storage module is used for storing the information of the newly added file into a second directory of the newly added file in the virtual file system;
a request information receiving module, configured to receive display request information, where the display request information is sent by the external device;
and the file information sending module is used for sending the information of the newly added file stored in the virtual file system to the external equipment if the directory ID in the display request information is the second directory ID of the newly added file.
A third aspect of the present application provides a mobile terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the processor implementing the steps of the file processing method according to the first aspect when executing the computer program.
A fourth aspect of the present application provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the steps of the document processing method according to the first aspect described above.
A fifth aspect of the present application provides a computer program product comprising a computer program which, when executed by one or more processors, performs the steps of the document processing method as described in the first aspect above.
Compared with the prior art, the application has the beneficial effects that: when detecting a newly added file of a magnetic disk of a mobile terminal and when the mobile terminal and an external device are in an MTP (multiple time transfer protocol) connection mode, acquiring information of the newly added file, acquiring a second directory ID of the newly added file according to a first directory ID of the newly added file, storing the information of the newly added file into a virtual file system, and sending the information of the newly added file stored in the virtual file system to the external device when receiving display request information containing the second directory ID of the newly added file, so that the external device displays the information of the newly added file under the second directory ID of the newly added file. According to the method and the device, when the file is newly added to the magnetic disk of the mobile terminal, the information of the newly added file is stored in the virtual file system, and then the information of the newly added file stored in the virtual file system is sent to the external equipment, so that the information of the newly added file can be displayed in the second directory of the newly added file of the external equipment, and further, when the file is newly built on the mobile terminal, 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 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 diagram of a network architecture of a document processing system according to an embodiment of the present application;
fig. 2 is a schematic flow chart illustrating an implementation of a file processing method according to a second embodiment of the present application;
fig. 3 is a schematic flow chart illustrating an implementation of a file processing method according to a third embodiment of the present application;
fig. 4 is a schematic diagram of a mobile terminal according to a fourth embodiment of the present application;
fig. 5 is a schematic diagram of a mobile terminal according to a fifth embodiment of the present application;
fig. 6 is a schematic diagram of a mobile terminal according to a sixth 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 particular implementations, the mobile terminals described in embodiments of the present application 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 to the implementation process of the embodiment of the present application.
In order to explain the technical solution described in the present application, the following description will be given by way of specific examples.
Referring to fig. 1, a network architecture diagram of a document processing system according to an embodiment of the present application is shown, and for convenience of description, only a part related to the embodiment of the present application is shown.
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 aim to realize real-time refreshing of the external equipment when a new file is created on the mobile terminal. In the embodiment of the application, when detecting that a new file is added to a magnetic disk of a mobile terminal and the mobile terminal 11 and an external device 12 are in a Media Transfer Protocol (MTP) connection mode, the mobile terminal 11 acquires information of the new file; acquiring a second directory ID of the newly added file according to the first directory ID of the newly added file in the information of the newly added file; storing the information of the newly added file to a second directory of the newly added file in the virtual file system; the mobile terminal 11 receives the display request information sent by the external device 12; if the directory ID in the display request information is the second directory ID of the newly added file, the information of the newly added file stored in the virtual file system is sent to the external device 12.
The first directory ID of the newly added file is the ID of the directory of the newly added file in the magnetic disk of the mobile terminal, the second directory ID of the newly added file is the ID of the directory of the newly added file in the virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal.
Optionally, the mobile terminal 11 uses a sum of the first directory ID of the newly added file and the first preset offset as the second directory ID of the newly added file.
Optionally, the mobile terminal 11 obtains a second file ID of the newly added file according to the first file ID of the newly added file in the information of the newly added file, where the first file ID of the newly added file is an ID of the newly added file in a magnetic disk of the mobile terminal, the second file ID of the newly added file is an ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID.
Optionally, the mobile terminal 11 uses a sum of the first file ID of the newly added file and a second preset offset as the second file ID of the newly added file.
Optionally, the mobile terminal 11 sends, to the external device 12, request information for acquiring a directory ID of a current display interface of the external device 12.
Referring to fig. 2, which is a schematic view of an implementation flow of a file processing method provided in the second embodiment of the present application, 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 a new file of a magnetic disk of a mobile terminal and the mobile terminal and an external device are in a Media Transfer Protocol (MTP) connection mode, acquiring information of the new file.
In the embodiment of the application, when the mobile terminal detects that a new file is added in a magnetic disk of the mobile terminal and the external device are in an MTP (multiple time transfer protocol) connection mode, the mobile terminal is driven by the MTP to update the virtual file system, so that the information of the new file is stored in the virtual file system. The information of the new file includes, but is not limited to, a name, a size, a creation date, a storage path, a first directory ID, a first file ID, and the like of the new file. And the first directory ID of the newly added file is the ID of the directory of the newly added file in the 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 magnetic disk of the mobile terminal.
When the MTP connection is established between the mobile terminal and the external equipment, the external equipment can check 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. Wherein the virtual file system is a database mapped by traversing a disk of the mobile terminal.
Step S202, a second directory ID of the newly added file is obtained according to the first directory ID of the newly added file in the information of the newly added file.
And the second directory ID of the newly added file is the ID of the directory of the newly added file in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing a magnetic disk 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 first file ID) and the file ID of the file in the virtual file system (i.e., the second 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 first directory ID) and the directory ID of the file in the virtual file system (i.e., the second directory ID) may be set to be different.
Step S203, storing the information of the newly added file to a second directory of the newly added file in the virtual file system of the mobile terminal.
In this embodiment of the application, after the mobile terminal performs step S202, the mobile terminal may first detect whether the information of the new file exists in the virtual file system, and if so, no subsequent operation is performed; if not, go to step S203.
Detecting whether the information of the newly added file exists in the virtual file system may be to detect whether the information of the newly added file exists in a directory of which the ID is a second directory ID of the newly added file in the virtual file system, and if so, determining that the information of the newly added file exists in the virtual file system, and not executing subsequent operations; if not, determining that the information of the newly added file does not exist in the virtual file system.
In this embodiment of the application, since the directory ID (first directory ID) and the file ID (first file ID) of the newly added file in the magnetic disk of the mobile terminal are different from the directory ID (second directory ID) and the file ID (second file ID) in the virtual file system, when the information of the newly added file is stored in the directory of the virtual file system whose ID is the second directory ID of the newly added file, the information of the newly added file may be updated at the same time, for example, the first directory ID of the newly added file in the information of the newly added file may be modified to the second directory ID of the newly added file, the first file ID of the newly added file is modified to the second file ID of the newly added file, and the storage path of the newly added file is modified to the storage path in the virtual file system. Other information in the information of the newly added file, such as the name, size, creation date, and the like of the newly added file, may be kept unchanged.
Step S204, receiving display request information, wherein the display request information is sent by the external device.
In this embodiment of the application, after storing information of a newly added file in a directory whose ID is a second directory ID of the newly added file in the virtual file system, the mobile terminal sends request information for acquiring the directory ID of the current display interface of the external device to the external device, and after receiving the request information, the external device feeds back display request information including the directory ID of the current display interface of the external device to the mobile terminal. The directory ID of the current display interface of the external device may refer to the directory ID of the current display interface when the external device views the file in the mobile terminal.
Step S205, if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external device.
In the embodiment of the application, whether the directory ID in the display request information is the second directory ID of the newly added file is detected, if yes, the information of the newly added file is obtained from the virtual file system and sent to the external device, and after the external device receives the information of the newly added file, the information of the newly added file is displayed on a current display interface; and if not, not sending the information of the newly added file to the external equipment, and if subsequently receiving display request information containing the same second directory ID of the newly added file, then sending the information of the newly added file to the external equipment.
According to the method and the device, when the file is newly added to the magnetic disk of the mobile terminal, the information of the newly added file is stored in the virtual file system, and then the information of the newly added file stored in the virtual file system is sent to the external equipment, so that the information of the newly added file can be displayed in the second directory of the newly added file of the external equipment, and further, when the file is newly built on the mobile terminal, the real-time refreshing of the external equipment is realized.
Referring to fig. 3, which is a schematic view of an implementation flow of a file processing method provided in the third embodiment of the present application, 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 a mobile terminal and the mobile terminal and an external device are in a Media Transfer Protocol (MTP) connection mode, acquiring information of the new 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 S302, taking a sum of a first directory ID of the newly added file and a first preset offset in the information of the newly added file as a second directory ID of the newly added file.
The first directory ID of the newly added file is the ID of the directory of the newly added file in the magnetic disk of the mobile terminal, the second directory ID of the newly added file is the ID of the directory of the newly added file in the virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal.
Optionally, the embodiment of the present application further includes:
and acquiring a second file ID of the newly added file according to the first file ID of the newly added file in the information of the newly added file, wherein the first file ID of the newly added file is the ID of the newly added file in a magnetic disk of the mobile terminal, the second file ID of the newly added file is the ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second 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 application may map the file ID (i.e., the second file ID) of the newly added file in the virtual file system to a plurality of directory IDs (i.e., the second directory ID) when the file in the magnetic disk of the mobile terminal is mapped into the virtual file system.
Optionally, the obtaining the second file ID of the newly added file according to the first file ID of the newly added file in the information of the newly added file includes:
and taking the sum of the first file ID of the newly added file and a second preset offset as a second file ID of the newly added file.
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 first file ID) and the file ID of the file in the virtual file system (i.e., the second 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 first directory ID) and the directory ID of the file in the virtual file system (i.e., the second directory ID) may be set to be different.
In order to distinguish the directory to which the newly added file belongs in the magnetic disk of the mobile terminal from the directory to which the newly added file belongs in the virtual file system, the sum of the ID of the directory to which the newly added file belongs in the magnetic disk of the mobile terminal and a first preset offset may be used as the ID of the directory to which the newly added file belongs in the virtual file system. In order to distinguish whether the newly added file is in the magnetic disk of the mobile terminal or the virtual file system, the sum of the ID of the newly added file in the magnetic disk of the mobile terminal (i.e., the first file ID) and a second preset offset may be used as the ID of the newly added file in the virtual file system (i.e., the second file ID).
Step S303, storing the information of the newly added file to a second directory of the newly added file in a virtual file system of the mobile terminal.
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 S304, sending request information for acquiring the directory ID of the current display interface of the external device to the external device.
In step S305, display request information is received.
In this embodiment of the application, after storing information of a newly added file in a directory whose ID is a second directory ID of the newly added file in the virtual file system, the mobile terminal sends request information for acquiring the directory ID of the current display interface of the external device to the external device, and after receiving the request information, the external device feeds back display request information including the directory ID of the current display interface of the external device to the mobile terminal. The directory ID of the current display interface of the external device may refer to the directory ID of the current display interface when the external device views the file in the mobile terminal.
Step S306, if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external device.
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.
According to the method and the device, when the file is newly added to the magnetic disk of the mobile terminal, the information of the newly added file is stored in the virtual file system, and then the information of the newly added file stored in the virtual file system is sent to the external equipment, so that the information of the newly added file can be displayed in the second directory of the newly added file of the external equipment, and further, when the file is newly built on the mobile terminal, the real-time refreshing of the external equipment is realized. And the second file ID of the newly added file corresponds to at least one second directory ID in the virtual file system, so that the newly added file can be displayed in different directories in the external equipment.
Referring to fig. 4, which is a schematic diagram of a mobile terminal provided in the fourth embodiment of the present application, for convenience of description, only the parts related to the embodiment of the present application are shown.
The mobile terminal includes:
the file information obtaining module 41 is configured to obtain information of a newly added file when the newly added file of the magnetic disk of the mobile terminal is detected and the mobile terminal and the external device are in a media transfer protocol MTP connection mode;
a directory ID obtaining module 42, configured to obtain a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, where the first directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a magnetic disk of the mobile terminal, the second directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal;
a file information storage module 43, configured to store information of the newly added file in a second directory of the newly added file in the virtual file system;
a request information receiving module 44, configured to receive display request information, where the display request information is sent by the external device;
a file information sending module 45, configured to send the information of the newly added file stored in the virtual file system to the external device if the directory ID in the display request information is the second directory ID of the newly added file.
Optionally, the catalog ID obtaining module 42 is specifically configured to:
and taking the sum of the first directory ID of the newly added file and the first preset offset as the second directory ID of the newly added file.
Optionally, the mobile terminal further includes:
a file ID obtaining module 46, configured to obtain a second file ID of the newly added file according to a first file ID of the newly added file in the information of the newly added file, where the first file ID of the newly added file is an ID of the newly added file in a disk of the mobile terminal, the second file ID of the newly added file is an ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID;
the file ID obtaining module 46 is specifically configured to:
and taking the sum of the first file ID of the newly added file and a second preset offset as a second file ID of the newly added file.
Optionally, the mobile terminal further includes:
a request information sending module 47, configured to send, to the external device, request information for obtaining a directory ID of a current display interface of the external device.
Fig. 5 is a schematic diagram of a mobile terminal according to a fifth embodiment of the present application. 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 detecting that a new file is added to a magnetic disk of a mobile terminal and the mobile terminal and an external device are in a media transfer protocol MTP connection mode, obtain information of the new file; acquiring a second directory ID of the newly added file according to the first directory ID of the newly added file in the information of the newly added file; storing the information of the newly added file to a second directory of the newly added file in a virtual file system of the mobile terminal; receiving display request information; and if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external equipment.
The first directory ID of the newly added file is the ID of the directory of the newly added file in the magnetic disk of the mobile terminal, the second directory ID of the newly added file is the ID of the directory of the newly added file in the virtual file system, the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal, and the display request information is sent by the external device.
Optionally, the processor 501 is specifically configured to use a sum of a first directory ID of the newly added file and a first preset offset as a second directory ID of the newly added file.
Optionally, the processor 501 is further configured to obtain a second file ID of the newly added file according to the first file ID of the newly added file in the information of the newly added file, where the first file ID of the newly added file is an ID of the newly added file in a disk of the mobile terminal, the second file ID of the newly added file is an ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID.
Optionally, the processor 501 is specifically configured to use a sum of the first file ID of the newly added file and a second preset offset as the second file ID of the newly added file.
Optionally, the processor 501 is further configured to send, to the external device, request information for obtaining a directory ID of a current display interface of 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 newly added file stored in the virtual file system to the external device.
It should be understood that, in the embodiment of the present Application, 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 application may execute the implementation described in the embodiment of the file processing method provided in this embodiment of the present application, or may execute the implementation described in the mobile terminal described in the fourth embodiment of the present application, which is not described herein again.
Fig. 6 is a schematic diagram of a mobile terminal according to a sixth embodiment of the present application. 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 S205 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 file information acquisition module, a directory ID acquisition module, a file information storage module, a request information reception module, a file information transmission module, a file ID acquisition module, and a request information transmission module, each of which functions as follows:
the file information acquisition module is used for acquiring information of a newly added file when the newly added file of a magnetic disk of the mobile terminal is detected and the mobile terminal and the external equipment are in a Media Transfer Protocol (MTP) connection mode;
a directory ID obtaining module, configured to obtain a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, where the first directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a magnetic disk of the mobile terminal, and the second directory ID of the newly added file is an ID of a directory to which the newly added file belongs in the virtual file system;
the file information storage module is used for storing the information of the newly added file into a second directory of the newly added file in the virtual file system, wherein the virtual file system is a database mapped by traversing a magnetic disk of the mobile terminal;
a request information receiving module, configured to receive display request information, where the display request information is sent by the external device;
and the file information sending module is used for sending the information of the newly added file stored in the virtual file system to the external equipment if the directory ID in the display request information is the second directory ID of the newly added file.
Optionally, the directory ID obtaining module is specifically configured to:
and taking the sum of the first directory ID of the newly added file and the first preset offset as the second directory ID of the newly added file.
Optionally, the mobile terminal further includes:
a file ID obtaining module, configured to obtain a second file ID of the newly added file according to a first file ID of the newly added file in the information of the newly added file, where the first file ID of the newly added file is an ID of the newly added file in a disk of the mobile terminal, the second file ID of the newly added file is an ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID;
the file ID acquisition module is specifically configured to:
and taking the sum of the first file ID of the newly added file and a second preset offset as a second file ID of the newly added file.
Optionally, the mobile terminal further includes:
and the request information sending module is used for sending request information for acquiring the directory ID of the current display interface of the external equipment to the external equipment.
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 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 processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed 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 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 application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (8)

1. A file processing method, characterized in that the file processing method comprises:
when detecting a newly added file of a magnetic disk of a mobile terminal and when the mobile terminal and an external device are in a Media Transfer Protocol (MTP) connection mode, acquiring information of the newly added file, wherein the information of the newly added file comprises the name, the size, the creation date, a storage path, a first directory ID and a first file ID of the newly added file;
acquiring a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, wherein the first directory ID of the newly added file is the ID of a directory of the newly added file in a magnetic disk of the mobile terminal, the second directory ID of the newly added file is the ID of a directory of the newly added file in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal;
detecting whether the information of the newly added file exists in a directory with the ID being the second directory ID of the newly added file in the virtual file system, if not, determining that the information of the newly added file does not exist in the virtual file system, and storing the information of the newly added file in the second directory of the newly added file in the virtual file system;
sending request information for acquiring the directory ID of the current display interface of the external equipment to the external equipment;
receiving display request information, wherein the display request information is fed back by the external equipment after the external equipment receives request information which is sent by the mobile terminal and used for acquiring the directory ID of the current display interface of the external equipment;
and if the directory ID in the display request information is the second directory ID of the newly added file, sending the information of the newly added file stored in the virtual file system to the external equipment.
2. The file processing method according to claim 1, wherein said obtaining the second directory ID of the newly added file based on the first directory ID of the newly added file in the information of the newly added file comprises:
and taking the sum of the first directory ID of the newly added file and the first preset offset as the second directory ID of the newly added file.
3. The document processing method according to claim 1, wherein the document processing method further comprises:
and acquiring a second file ID of the newly added file according to the first file ID of the newly added file in the information of the newly added file, wherein the first file ID of the newly added file is the ID of the newly added file in a magnetic disk of the mobile terminal, the second file ID of the newly added file is the ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID.
4. The file processing method according to claim 3, wherein the obtaining of the second file ID of the newly added file from the first file ID of the newly added file in the information of the newly added file comprises:
and taking the sum of the first file ID of the newly added file and a second preset offset as a second file ID of the newly added file.
5. A mobile terminal, characterized in that the mobile terminal comprises:
the file information acquisition module is used for acquiring information of a newly added file when the newly added file of a magnetic disk of the mobile terminal is detected and the mobile terminal and the external equipment are in a Media Transfer Protocol (MTP) connection mode, wherein the information of the newly added file comprises the name, the size, the creation date, the storage path, a first directory ID and a first file ID of the newly added file;
a directory ID obtaining module, configured to obtain a second directory ID of the newly added file according to a first directory ID of the newly added file in the information of the newly added file, where the first directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a magnetic disk of the mobile terminal, the second directory ID of the newly added file is an ID of a directory to which the newly added file belongs in a virtual file system of the mobile terminal, and the virtual file system is a database mapped by traversing the magnetic disk of the mobile terminal;
the file information storage module is used for detecting whether the information of the newly added file exists in a directory with the ID being the second directory ID of the newly added file in the virtual file system, if not, determining that the information of the newly added file does not exist in the virtual file system, and storing the information of the newly added file in a second directory of the newly added file in the virtual file system;
the request information sending module is used for sending request information for acquiring the directory ID of the current display interface of the external equipment to the external equipment;
the display request information is fed back by the external equipment after receiving the request information which is sent by the mobile terminal and used for acquiring the directory ID of the current display interface of the external equipment;
and the file information sending module is used for sending the information of the newly added file stored in the virtual file system to the external equipment if the directory ID in the display request information is the second directory ID of the newly added file.
6. The mobile terminal of claim 5, wherein the directory ID acquisition module is specifically configured to:
taking the sum of the first directory ID of the newly added file and a first preset offset as a second directory ID of the newly added file;
the mobile terminal further includes:
a file ID obtaining module, configured to obtain a second file ID of the newly added file according to a first file ID of the newly added file in the information of the newly added file, where the first file ID of the newly added file is an ID of the newly added file in a disk of the mobile terminal, the second file ID of the newly added file is an ID of the newly added file in the virtual file system, and the second file ID of the newly added file in the virtual file system corresponds to at least one second directory ID;
the file ID acquisition module is specifically configured to:
and taking the sum of the first file ID of the newly added file and a second preset offset as a second file ID of the newly added file.
7. A mobile terminal comprising a memory, a processor and a computer program stored in said memory and executable on said processor, characterized in that said processor implements the steps of the file processing method according to any of claims 1 to 4 when executing said computer program.
8. A computer-readable storage medium, in which a computer program is stored, which, when being executed by a processor, carries out the steps of the file processing method according to any one of claims 1 to 4.
CN201710895624.8A 2017-09-28 2017-09-28 File processing method, mobile terminal and computer readable storage medium Expired - Fee Related CN108038112B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710895624.8A CN108038112B (en) 2017-09-28 2017-09-28 File processing method, mobile terminal and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710895624.8A CN108038112B (en) 2017-09-28 2017-09-28 File processing method, mobile terminal and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN108038112A CN108038112A (en) 2018-05-15
CN108038112B true CN108038112B (en) 2020-01-10

Family

ID=62093265

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710895624.8A Expired - Fee Related CN108038112B (en) 2017-09-28 2017-09-28 File processing method, mobile terminal and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN108038112B (en)

Families Citing this family (8)

* 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
CN109617883A (en) * 2018-12-20 2019-04-12 努比亚技术有限公司 A kind of mobile terminal and its with computer shared file method, apparatus and storage medium
CN109656880A (en) * 2018-12-20 2019-04-19 努比亚技术有限公司 A kind of mirror file system decoupling method and device, mobile terminal and storage medium
CN109819034A (en) * 2019-01-25 2019-05-28 平安科技(深圳)有限公司 File uploading method, device, terminal and storage medium
CN112394969B (en) * 2019-08-14 2023-04-28 华为技术有限公司 Patch release method, server and terminal equipment
WO2021155491A1 (en) * 2020-02-04 2021-08-12 Qualcomm Incorporated Data transfer with media transfer protocol (mtp) over universal serial bus (usb)
CN111488620A (en) * 2020-04-17 2020-08-04 上海闻泰电子科技有限公司 File processing method and device, mobile terminal and storage medium
CN111629421B (en) * 2020-05-20 2022-06-07 上海连尚网络科技有限公司 Method and equipment for managing wireless access point

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424207A (en) * 2013-08-22 2015-03-18 北京奇虎科技有限公司 New-file reminding method and device
CN104777965A (en) * 2015-03-20 2015-07-15 广东欧珀移动通信有限公司 Document list processing method, mobile terminal and system
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106326229B (en) * 2015-06-17 2020-04-03 百富计算机技术(深圳)有限公司 File storage method and device of embedded system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104424207A (en) * 2013-08-22 2015-03-18 北京奇虎科技有限公司 New-file reminding method and device
CN104777965A (en) * 2015-03-20 2015-07-15 广东欧珀移动通信有限公司 Document list processing method, mobile terminal and system
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

Also Published As

Publication number Publication date
CN108038112A (en) 2018-05-15

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
CN110225104B (en) Data acquisition method and device and terminal equipment
CN108400868B (en) Seed key storage method and device and mobile terminal
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
US20190107929A1 (en) Method and device for loading content of page, and electronic device
CN107506494B (en) Document handling method, mobile terminal and computer readable storage medium
CN107679222B (en) Picture processing method, mobile terminal and computer readable storage medium
CN107609119B (en) File processing method, mobile terminal and computer readable storage medium
US10345895B2 (en) Hand and finger line grid for hand based interactions
CN109104481B (en) File integrity detection method, file integrity detection device and terminal equipment
CN106775835B (en) Method, server and terminal for acquiring upgrade file
CN109271266B (en) File transmission method and device and terminal equipment
CN109298956B (en) File transmission method and device and terminal equipment
CN108521460B (en) Information pushing method and device, mobile terminal and computer readable storage medium
CN110874729B (en) Switching method and switching device for electronic red packet identification strategy and mobile terminal
CN111352357B (en) Robot control method and device and terminal equipment
CN110245016B (en) Data processing method, system, device and terminal equipment
CN110688035B (en) Photo album processing method, photo album processing device and mobile terminal
CN108595569B (en) File path copying method, file path copying device and mobile terminal
CN108985758B (en) Data processing method, data processing system and terminal equipment
CN112015459A (en) Method and device for upgrading image file, terminal and readable storage medium
CN107969012B (en) Network access method, mobile terminal and computer readable storage medium
CN110855822A (en) Strange number remarking method, strange number remarking device and mobile terminal

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: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

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

Applicant before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS Corp.,Ltd.

GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200110