Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The main solution of the embodiment of the invention is as follows: traversing physical files in the mobile terminal to establish a mapping relation table of file numbers and physical storage paths of the mobile terminal, storing the mapping relation table into a local database, constructing a virtual file tree in a memory of the mobile terminal according to a preset file tree construction rule and the mapping relation table in the local database, and then calling a preset hash algorithm to process the file numbers of each tree node in the virtual file tree to establish a hash table of the virtual file tree; when a file acquisition instruction sent by the PC terminal is monitored, the file number of each physical file is transmitted to the PC terminal, so that the PC terminal can display the files in the mobile terminal based on the file numbers, the hash table and the virtual file tree.
Because the disk space of the mobile terminal for storing the files is larger and larger, and the files to be stored are more and more, the physical storage path for storing the files is more and more complex, and more time of a user is required to be consumed to query the files, so that the user is not convenient to quickly obtain the files, and therefore how to quickly query the files in the mobile terminal on the PC terminal is a problem to be solved urgently at present.
The invention provides a solution, firstly establishing a mapping relation table of file numbers and physical storage paths, constructing a virtual file tree based on the established mapping relation table and file classification, then processing the file numbers of each tree node based on a hash algorithm, establishing a hash table of the virtual file tree, so that after a PC terminal is connected with a mobile terminal, the PC terminal can quickly inquire the file numbers of each child node in the virtual file tree from the hash table based on the file numbers of the physical files sent by the mobile terminal, and quickly acquire the physical storage paths of the files based on the file numbers of each child node, thereby displaying the files in the mobile terminal on the PC terminal in a file classification mode, greatly improving the file acquisition speed, reducing the user waiting time and facilitating the user to quickly acquire the files in the mobile terminal.
In the following description, suffixes such as "module", "component", or "unit" used to denote elements are used only for facilitating the explanation of the present invention, and have no specific meaning in itself. Thus, "module", "component" or "unit" may be used mixedly.
The terminal may be implemented in various forms. For example, the terminal described in the present invention may include a mobile terminal such as a mobile phone, a tablet computer, a notebook computer, a palmtop computer, a Personal Digital Assistant (PDA), a Portable Media Player (PMP), a navigation device, a wearable device, a smart band, a pedometer, and the like, and a fixed terminal such as a Digital TV, a desktop computer, and the like.
The following description will be given by way of example of a mobile terminal, and it will be understood by those skilled in the art that the construction according to the embodiment of the present invention can be applied to a fixed type terminal, in addition to elements particularly used for mobile purposes.
Referring to fig. 1, which is a schematic diagram of a hardware structure of a mobile terminal for implementing various embodiments of the present invention, themobile terminal 100 may include: RF (Radio Frequency)unit 101,WiFi module 102,audio output unit 103, a/V (audio/video)input unit 104,sensor 105,display unit 106,user input unit 107,interface unit 108,memory 109,processor 110, andpower supply 111. Those skilled in the art will appreciate that the mobile terminal architecture shown in fig. 1 is not intended to be limiting of mobile terminals, which may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
The following describes each component of the mobile terminal in detail with reference to fig. 1:
theradio frequency unit 101 may be configured to receive and transmit signals during information transmission and reception or during a call, and specifically, receive downlink information of a base station and then process the downlink information to theprocessor 110; in addition, the uplink data is transmitted to the base station. Typically,radio frequency unit 101 includes, but is not limited to, an antenna, at least one amplifier, a transceiver, a coupler, a low noise amplifier, a duplexer, and the like. In addition, theradio frequency unit 101 can also communicate with a network and other devices through wireless communication. The wireless communication may use any communication standard or protocol, including but not limited to GSM (Global System for Mobile communications), GPRS (General Packet Radio Service), CDMA2000(Code Division Multiple Access 2000), WCDMA (Wideband Code Division Multiple Access), TD-SCDMA (Time Division-Synchronous Code Division Multiple Access), FDD-LTE (Frequency Division duplex Long Term Evolution), and TDD-LTE (Time Division duplex Long Term Evolution).
WiFi belongs to short-distance wireless transmission technology, and the mobile terminal can help a user to receive and send e-mails, browse webpages, access streaming media and the like through theWiFi module 102, and provides wireless broadband internet access for the user. Although fig. 1 shows theWiFi module 102, it is understood that it does not belong to the essential constitution of the mobile terminal, and may be omitted entirely as needed within the scope not changing the essence of the invention.
Theaudio output unit 103 may convert audio data received by theradio frequency unit 101 or theWiFi module 102 or stored in thememory 109 into an audio signal and output as sound when themobile terminal 100 is in a call signal reception mode, a call mode, a recording mode, a voice recognition mode, a broadcast reception mode, or the like. Also, theaudio output unit 103 may also provide audio output related to a specific function performed by the mobile terminal 100 (e.g., a call signal reception sound, a message reception sound, etc.). Theaudio output unit 103 may include a speaker, a buzzer, and the like.
The a/V input unit 104 is used to receive audio or video signals. The a/V input Unit 104 may include a Graphics Processing Unit (GPU) 1041 and amicrophone 1042, theGraphics processor 1041 Processing image data of still pictures or video obtained by an image capturing device (e.g., a camera) in a video capturing mode or an image capturing mode. The processed image frames may be displayed on thedisplay unit 106. The image frames processed by thegraphic processor 1041 may be stored in the memory 109 (or other storage medium) or transmitted via theradio frequency unit 101 or theWiFi module 102. Themicrophone 1042 may receive sounds (audio data) via themicrophone 1042 in a phone call mode, a recording mode, a voice recognition mode, or the like, and may be capable of processing such sounds into audio data. The processed audio (voice) data may be converted into a format output transmittable to a mobile communication base station via theradio frequency unit 101 in case of a phone call mode. Themicrophone 1042 may implement various types of noise cancellation (or suppression) algorithms to cancel (or suppress) noise or interference generated in the course of receiving and transmitting audio signals.
Themobile terminal 100 also includes at least onesensor 105, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor includes an ambient light sensor that can adjust the brightness of thedisplay panel 1061 according to the brightness of ambient light, and a proximity sensor that can turn off thedisplay panel 1061 and/or a backlight when themobile terminal 100 is moved to the ear. As one of the motion sensors, the accelerometer sensor can detect the magnitude of acceleration in each direction (generally, three axes), can detect the magnitude and direction of gravity when stationary, and can be used for applications of recognizing the posture of a mobile phone (such as horizontal and vertical screen switching, related games, magnetometer posture calibration), vibration recognition related functions (such as pedometer and tapping), and the like; as for other sensors such as a fingerprint sensor, a pressure sensor, an iris sensor, a molecular sensor, a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which can be configured on the mobile phone, further description is omitted here.
Thedisplay unit 106 is used to display information input by a user or information provided to the user. TheDisplay unit 106 may include aDisplay panel 1061, and theDisplay panel 1061 may be configured in the form of a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), or the like.
Theuser input unit 107 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function control of the mobile terminal. Specifically, theuser input unit 107 may include atouch panel 1071 andother input devices 1072. Thetouch panel 1071, also referred to as a touch screen, may collect a touch operation performed by a user on or near the touch panel 1071 (e.g., an operation performed by the user on or near thetouch panel 1071 using a finger, a stylus, or any other suitable object or accessory), and drive a corresponding connection device according to a predetermined program. Thetouch panel 1071 may include two parts of a touch detection device and a touch controller. The touch detection device detects the touch direction of a user, detects a signal brought by touch operation and transmits the signal to the touch controller; the touch controller receives touch information from the touch sensing device, converts the touch information into touch point coordinates, sends the touch point coordinates to theprocessor 110, and can receive and execute commands sent by theprocessor 110. In addition, thetouch panel 1071 may be implemented in various types, such as a resistive type, a capacitive type, an infrared ray, and a surface acoustic wave. In addition to thetouch panel 1071, theuser input unit 107 may includeother input devices 1072. In particular,other input devices 1072 may include, but are not limited to, one or more of a physical keyboard, function keys (e.g., volume control keys, switch keys, etc.), a trackball, a mouse, a joystick, and the like, and are not limited to these specific examples.
Further, thetouch panel 1071 may cover thedisplay panel 1061, and when thetouch panel 1071 detects a touch operation thereon or nearby, thetouch panel 1071 transmits the touch operation to theprocessor 110 to determine the type of the touch event, and then theprocessor 110 provides a corresponding visual output on thedisplay panel 1061 according to the type of the touch event. Although thetouch panel 1071 and thedisplay panel 1061 are shown in fig. 1 as two separate components to implement the input and output functions of the mobile terminal, in some embodiments, thetouch panel 1071 and thedisplay panel 1061 may be integrated to implement the input and output functions of the mobile terminal, and is not limited herein.
Theinterface unit 108 serves as an interface through which at least one external device is connected to themobile terminal 100. For example, the external device may include a wired or wireless headset port, an external power supply (or battery charger) port, a wired or wireless data port, a memory card port, a port for connecting a device having an identification module, an audio input/output (I/O) port, a video I/O port, an earphone port, and the like. Theinterface unit 108 may be used to receive input (e.g., data information, power, etc.) from external devices and transmit the received input to one or more elements within themobile terminal 100 or may be used to transmit data between themobile terminal 100 and external devices.
Thememory 109 may be used to store software programs as well as various data. Thememory 109 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. Further, thememory 109 may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device.
Theprocessor 110 is a control center of the mobile terminal, connects various parts of the entire mobile terminal using various interfaces and lines, and performs various functions of the mobile terminal and processes data by operating or executing software programs and/or modules stored in thememory 109 and calling data stored in thememory 109, thereby performing overall monitoring of the mobile terminal.Processor 110 may include one or more processing units; preferably, theprocessor 110 may integrate an application processor, which mainly handles operating systems, user interfaces, application programs, etc., and a modem processor, which mainly handles wireless communications. It will be appreciated that the modem processor described above may not be integrated into theprocessor 110.
Themobile terminal 100 may further include a power supply 111 (e.g., a battery) for supplying power to various components, and preferably, thepower supply 111 may be logically connected to theprocessor 110 via a power management system, so as to manage charging, discharging, and power consumption management functions via the power management system.
Although not shown in fig. 1, themobile terminal 100 may further include a bluetooth module or the like, which is not described in detail herein.
In order to facilitate understanding of the embodiments of the present invention, a communication network system on which the mobile terminal of the present invention is based is described below.
Referring to fig. 2, fig. 2 is an architecture diagram of a communication Network system according to an embodiment of the present invention, where the communication Network system is an LTE system of a universal mobile telecommunications technology, and the LTE system includes a UE (User Equipment) 201, an E-UTRAN (Evolved UMTS Terrestrial Radio Access Network) 202, an EPC (Evolved Packet Core) 203, and anIP service 204 of an operator, which are in communication connection in sequence.
Specifically, the UE201 may be the terminal 100 described above, and is not described herein again.
The E-UTRAN202 includes eNodeB2021 andother eNodeBs 2022, among others. Among them, the eNodeB2021 may be connected with other eNodeB2022 through backhaul (e.g., X2 interface), the eNodeB2021 is connected to the EPC203, and the eNodeB2021 may provide the UE201 access to theEPC 203.
The EPC203 may include an MME (Mobility Management Entity) 2031, an HSS (Home Subscriber Server) 2032,other MMEs 2033, an SGW (Serving gateway) 2034, a PGW (PDN gateway) 2035, and a PCRF (Policy and Charging Rules Function) 2036, and the like. The MME2031 is a control node that handles signaling between the UE201 and the EPC203, and provides bearer and connection management. HSS2032 is used to provide registers to manage functions such as home location register (not shown) and holds subscriber specific information about service characteristics, data rates, etc. All user data may be sent through SGW2034, PGW2035 may provide IP address assignment for UE201 and other functions, and PCRF2036 is a policy and charging control policy decision point for traffic data flow and IP bearer resources, which selects and provides available policy and charging control decisions for a policy and charging enforcement function (not shown).
TheIP services 204 may include the internet, intranets, IMS (IP Multimedia Subsystem), or other IP services, among others.
Although the LTE system is described as an example, it should be understood by those skilled in the art that the present invention is not limited to the LTE system, but may also be applied to other wireless communication systems, such as GSM, CDMA2000, WCDMA, TD-SCDMA, and future new network systems.
Based on the above mobile terminal hardware structure and communication network system, various embodiments of the mobile terminal of the present invention are provided.
Referring to fig. 1, in a first embodiment of the mobile terminal of the present invention, the mobile terminal includes: a memory, a processor, and a document classification display program stored on the memory and executable on the processor, the document classification display program when executed by the processor implementing the steps of:
traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table to a local database;
constructing a virtual file tree in the memory of the mobile terminal according to a preset file tree construction rule and a mapping relation table in the local database;
calling a preset hash algorithm to process the file number of each tree node in the virtual file tree so as to establish a hash table of the virtual file tree;
when a file acquisition instruction sent by the PC terminal is monitored, the file number of each physical file is transmitted to the PC terminal, so that the PC terminal can display the files in the mobile terminal based on the file numbers, the hash table and the virtual file tree.
Further, the file classification display program when executed by the processor further implements the following steps:
traversing the physical files in the mobile terminal to acquire the index information of each physical file;
acquiring a file number and a physical storage path of a corresponding physical file from index information of each physical file;
and performing associated mapping on the file number of each physical file and the physical storage path to establish a mapping relation table of the file number of the mobile terminal and the physical storage path.
Further, the file classification display program when executed by the processor further implements the following steps:
constructing a virtual file classification tree in a memory of the mobile terminal according to a preset file tree construction rule, and determining classification characteristic information of each leaf node in the virtual file classification tree;
acquiring a physical storage path containing the classification characteristic information from a mapping relation table in the local database, and acquiring a file number corresponding to the physical storage path from the mapping relation table;
and taking the file number as a child node of the corresponding leaf node to update the virtual file classification tree, and taking the updated virtual file classification tree as the virtual file tree.
Further, the file classification display program when executed by the processor further implements the following steps:
acquiring the file number of each tree node in the virtual file tree;
calling a preset hash algorithm to process the file number of each tree node so as to obtain a corresponding hash address;
and establishing a hash table according to the file number of each tree node and the hash address corresponding to the file number.
Further, the file classification display program when executed by the processor further implements the following steps:
when a file operation instruction sent by the PC terminal is monitored, acquiring a file number of a file to be operated from the file operation instruction;
acquiring a hash address associated with the file number from the hash table, and acquiring a physical storage path of the file to be operated through the hash address;
and executing the operation corresponding to the file operation instruction on the file to be operated stored in the physical storage path.
Further, the file classification display program when executed by the processor further implements the following steps:
detecting whether the mobile terminal is in a screen-off standby state or not;
and when detecting that the mobile terminal is in a screen-off standby state, executing the step of traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table to a local database.
Further, the file classification display program when executed by the processor further implements the following steps:
when the mobile terminal is detected to be in a screen-off standby state, acquiring the current screen-off time;
determining the current screen-off standby time of the mobile terminal according to a screen-off standby time table in a preset storage area and the current screen-off time;
and when the current screen-off standby time exceeds a preset threshold, executing the step of traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table into a local database.
Further, the file classification display program when executed by the processor further implements the following steps:
acquiring a screen-off standby time length table from a preset storage area, and determining the use time period of the current screen-off time;
and acquiring the screen-off standby time associated with the use time period from the screen-off standby time length table, and taking the screen-off standby time as the current screen-off standby time length of the mobile terminal.
The specific embodiment of the mobile terminal of the present invention is substantially the same as the specific embodiments of the file classification display method described below, and will not be described herein again.
Further, the present invention also provides a file classification display method applied to the mobile terminal shown in fig. 1, referring to fig. 3, and fig. 3 is a flowchart illustrating a first embodiment of the file classification display method according to the present invention.
In this embodiment, the file classification display method includes:
step S101, traversing physical files in the mobile terminal to establish a mapping relation table of file numbers and physical storage paths of the mobile terminal, and storing the mapping relation table to a local database;
the file classification display method is applied to the mobile terminal shown in fig. 1, and the mobile terminal comprises a smart phone, a tablet computer and the like. MTP (Media Transfer Protocol) is a Protocol for displaying files stored in a mobile device, after using the MTP Protocol, a user connects a mobile terminal with a PC terminal through a USB (Universal Serial Bus) connection line, the files stored in the mobile terminal can be browsed at the PC terminal, because the disk space of the mobile terminal for storing the files is larger and more, the physical storage path of the stored files is more and more complex, more time is needed for the user to inquire the files, and the user is not convenient to quickly acquire the files, therefore, the files in the mobile terminal are displayed in a file classification mode, the file tree needs to be reconstructed, so the invention traverses the physical files in the mobile terminal to establish a mapping relation table of the file numbers and the physical storage path of the mobile terminal, and storing the mapping relation table to a local database.
Specifically, referring to fig. 3, fig. 3 is a detailed flowchart of step S101 shown in fig. 2, where step S101 includes:
step S1011, traversing the physical files in the mobile terminal to obtain the index information of each physical file;
the method comprises the steps of traversing each physical file in the mobile terminal, distributing a file number to each physical file in the mobile terminal, writing the file number into index information of the corresponding physical file, distributing the file number to each physical file in the mobile terminal, traversing each physical file in the mobile terminal again to obtain the index information of each physical file, wherein the index information comprises the file number and a physical storage path.
In this embodiment, the rule that a file number is allocated to each physical file in the mobile terminal is that the mobile terminal traverses each physical file, and allocates a positive integer to the physical file obtained by traversing from 1 in sequence, where the allocated positive integer is the file number, for example, if the physical file traversed for the first time is a picture, the file number allocated to the picture is 1, and if the physical file traversed for the second time is a document, the file number allocated to the document is 2, and so on until the physical files in the mobile terminal are all allocated with file numbers. In a specific implementation, when assigning a file number to a physical file in a mobile terminal, the file number may be further assigned based on the file type of the physical file, specifically, the number of the physical file of each file type is calculated, then a file number set is assigned to the physical file of each file type based on the number of the physical file of each file type and the assignment sequence of each file type, that is, each file type corresponds to a file number set, and finally a file number is assigned to the physical file of the corresponding file type based on the file number set of each file type, for example, if the file types are a picture type, a music type, and a document type, and the corresponding file numbers are 5, 7, and 4, and if the assignment sequence is a picture type, a music type, and a document type, the file number set assigned to the physical file of the picture type is [1, 2, 3, 4, 5], and the file number set assigned to the physical file of the music type is [6, 2, 3, 4, 5], 7. 8, 9, 10, 11, 12], and the set of file numbers assigned to the document class physical files is [13, 14, 15, 16 ].
Step S1012, acquiring a file number and a physical storage path of a corresponding physical file from the index information of each physical file;
step S1013, the file number of each physical file is associated and mapped with the physical storage path to establish a mapping relationship table between the file number of the mobile terminal and the physical storage path.
After the mobile terminal obtains the index information of each physical file in a traversing manner, the file number and the physical storage path of the corresponding physical file are obtained from the index information of each physical file, the file number and the physical storage path of each physical file are subjected to associated mapping, so that the mapping relation between the file number and the physical storage path of each physical file is determined, finally, a mapping relation table of the file number and the physical storage path of the mobile terminal is established based on the determined mapping relation between the file number and the physical storage path of each physical file, and the mapping relation table is stored in a local database.
Step S102, constructing a virtual file tree in the memory of the mobile terminal according to a preset file tree construction rule and a mapping relation table in the local database;
after the mobile terminal stores the mapping relation table in the local database, a virtual file tree is constructed in the memory of the mobile terminal according to the preset file tree construction rule and the mapping relation table in the local database. The preset file tree construction rule is that a user name of a mobile terminal is called a root node, each file type is used as a leaf node, and a physical file contained in each file type is used as a child node of the leaf node.
Specifically, referring to fig. 4, fig. 4 is a detailed flowchart of step S102 shown in fig. 2, where step S102 includes:
step S1021, constructing a virtual file classification tree in the memory of the mobile terminal according to a preset file tree construction rule, and determining classification characteristic information of each leaf node in the virtual file classification tree;
the mobile terminal constructs a virtual file classification tree in a memory of the mobile terminal according to a preset file tree construction rule, namely a user name of the mobile terminal is used as a root node, each file type is used as a leaf node, the virtual file classification tree is constructed in the memory of the mobile terminal, and classification characteristic information of each leaf node in the virtual file classification tree is determined, wherein the classification characteristic information comprises classification characteristics such as picture characteristics, music characteristics, document characteristics and video characteristics. In a specific implementation, the physical files in the mobile terminal may be classified based on different file classification rules, where the file classification rules include file format classification rules, file source classification rules, and file application classification rules, where the file format classification rules classify the physical files into pictures, music, videos, and documents based on the formats of the physical files, the file source classification rules classify the physical files into collections, downloads, and bluetooth transmissions based on the sources of the physical files, and the file application classification rules classify the physical files based on the applications to which the physical files belong, such as WeChat, Internet News, Canine, and short messages.
Step S1022, obtaining a physical storage path including the classification feature information from a mapping relationship table in the local database, and obtaining a file number corresponding to the physical storage path from the mapping relationship table;
and step S1023, using the file number as a child node of the corresponding leaf node to update the virtual file classification tree, and using the updated virtual file classification tree as a virtual file tree.
After the mobile terminal constructs a virtual file classification tree and determines the classification characteristic information of each leaf node in the virtual file classification tree, a physical storage path containing the classification characteristic information is obtained from a mapping relation table in a local database, a file number corresponding to the physical storage path is obtained from the mapping relation table, the file number is used as a child node of the corresponding leaf node to update the virtual file classification tree, and the updated virtual file classification tree is used as a virtual file tree. In this embodiment, the classification feature information includes a file extension name, application identification information, source identification information, and the like.
Step S103, calling a preset hash algorithm to process the file number of each tree node in the virtual file tree so as to establish a hash table of the virtual file tree;
after the mobile terminal constructs the virtual file tree, a preset hash algorithm is called to process the file number of each tree node in the virtual file tree so as to establish a hash table of the virtual file tree.
In this embodiment, the step S103 includes:
acquiring the file number of each tree node in the virtual file tree;
calling a preset hash algorithm to process the file number of each tree node so as to obtain a corresponding hash address;
and establishing a hash table according to the file number of each tree node and the hash address corresponding to the file number.
The mobile terminal acquires the file number of each tree node in the virtual file tree, wherein the file numbers of the root node and the leaf node are null, and calls a preset hash algorithm to process the file number of each tree node so as to acquire a corresponding hash address, then establishes a hash table according to the file number of each tree node and the hash address corresponding to the file number, and stores the hash table in a memory of the mobile terminal. It should be noted that the predetermined hash algorithm may be set by a person skilled in the art based on actual situations, and this is not specifically described in this embodiment.
And step S104, when a file acquisition instruction sent by the PC terminal is monitored, transmitting the file number of each physical file to the PC terminal so that the PC terminal can display the files in the mobile terminal based on the file numbers, the hash table and the virtual file tree.
The mobile terminal is connected with a PC terminal through a USB connecting line, the PC terminal displays the drive letter of the mobile terminal, when the PC terminal receives a double-click or an entering operation triggered by a user based on the displayed disc character, a file acquisition instruction is sent to the connected mobile terminal, when monitoring a file acquisition instruction sent by the PC terminal, the mobile terminal transmits the file number of each physical file to the PC terminal, the PC terminal displays the file in the mobile terminal based on the file number, the hash table in the memory and the virtual file tree, concretely, the PC terminal inquires the corresponding tree node from the hash table in the memory based on the file number and acquires the corresponding hash address from the hash table based on the file number, and then acquiring attribute information of the physical file, which contains the physical storage path, based on the hash address, and displaying the corresponding file based on the attribute information and the virtual file tree.
In a specific implementation, the establishing operation of the mapping relation table and the hash table and the establishing operation of the virtual file tree may be performed when the mobile terminal is connected with the PC terminal, or before the mobile terminal is connected with the PC terminal, if the establishing operation is performed before the mobile terminal is connected with the PC terminal, the establishing operation of the mapping relation table, the virtual file tree and the hash table is updated at preset intervals, and when the connection of the mobile terminal and the PC terminal is detected, whether the physical file is updated or not is determined on the basis of the established mapping relation table, the virtual file tree and the hash table, if the physical file is updated, the physical file is updated on the basis of the established mapping relation table, the virtual file tree and the hash table, and if the physical file is not updated, the file on the mobile terminal is displayed on the PC terminal on the basis of the establishing operation of the mapping relation table, the virtual file tree and the hash table.
In this embodiment, the present invention first establishes a mapping relationship table between file numbers and physical storage paths, constructs a virtual file tree based on the established mapping relationship table and file classification, then processes the file numbers of each tree node based on a hash algorithm, establishes a hash table of the virtual file tree, so that after a PC terminal is connected to a mobile terminal, the PC terminal can quickly query the file numbers of each child node in the virtual file tree from the hash table based on the file numbers of the physical files sent by the mobile terminal, and quickly acquire the physical storage paths of the files based on the file numbers of each child node, thereby displaying the files in the mobile terminal on the PC terminal in a file classification manner, greatly improving the file acquisition speed, reducing the user waiting time, and facilitating the user to quickly acquire the files in the mobile terminal.
Further, referring to fig. 5, a second embodiment of the document classification display method of the present invention is proposed based on the foregoing first embodiment, and the difference from the foregoing embodiment is that after the step S104, the document classification display method further includes:
step S105, when a file operation instruction sent by the PC terminal is monitored, acquiring a file number of a file to be operated from the file operation instruction;
step S106, obtaining a hash address associated with the file number from the hash table, and obtaining a physical storage path of the file to be operated through the hash address;
and step S107, executing the operation corresponding to the file operation instruction on the file to be operated stored in the physical storage path.
It should be noted that the present invention proposes a specific way for the PC terminal to operate the file in the mobile terminal based on the above embodiments, and only this is described below, and other embodiments can be referred to.
The mobile terminal is connected with a PC terminal through a USB connecting line, the PC terminal displays files in the mobile terminal in a file classification mode, when the user clicks the displayed file, a file operation instruction is triggered, at the moment, the PC terminal acquires the file number of the physical file, and writes the file number into the file operation instruction, and then sends the file operation instruction to the mobile terminal, when monitoring a file operation instruction sent by the PC terminal, the mobile terminal acquires the file number of a file to be operated from the file operation instruction, and acquiring a hash address associated with the file number from the hash table, acquiring a physical storage path of the file to be operated through the hash address, and finally executing an operation corresponding to the file operation instruction on the file to be operated stored in the physical storage path, wherein the operation on the physical file comprises operations of deleting, modifying, exporting and the like.
In this embodiment, when the PC terminal operates the file in the mobile terminal, the file to be operated can be quickly determined based on the file number and the hash table, and the corresponding operation is performed on the file to be operated, thereby greatly improving the operation speed.
Further, based on the first or second embodiment, a third embodiment of the document classification display method according to the present invention is provided, which is different from the foregoing embodiment in that before step S101, the document classification display method according to the present invention further includes:
detecting whether the mobile terminal is in a screen-off standby state or not;
when detecting that the mobile terminal is in the off-screen standby state, executing step S101, namely traversing the physical file in the mobile terminal to establish a mapping relation table between the file number of the mobile terminal and the physical storage path, and storing the mapping relation table in a local database.
It should be noted that, based on the above embodiments, the present invention provides a specific triggering manner for establishing the mapping relationship table, which is only described below, and other embodiments can be referred to.
Specifically, whether the mobile terminal is in the screen-off standby state is detected, and when the mobile terminal is detected to be in the screen-off standby state, step S101 is executed, that is, a physical file in the mobile terminal is traversed to establish a mapping relation table between a file number of the mobile terminal and a physical storage path, and the mapping relation table is stored in a local database.
In this embodiment, after the step of detecting whether the mobile terminal is in the off-screen standby state, the method further includes:
when the mobile terminal is detected to be in a screen-off standby state, acquiring the current screen-off time;
determining the current screen-off standby time of the mobile terminal according to a screen-off standby time table in a preset storage area and the current screen-off time;
and when the current screen-off standby time exceeds a preset threshold, executing step S101, namely traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and the physical storage path, and storing the mapping relation table to a local database.
Specifically, the method includes the steps of recording the screen-off standby time length of the mobile terminal in each preset use period to establish a screen-off standby time length table of the mobile terminal, storing the screen-off standby time length table into a preset storage area, namely recording the screen-off standby time length of the mobile terminal in each preset use period, storing the recorded screen-off standby time length into a database, calculating the data storage amount in the database at intervals of preset time, judging whether the data storage amount exceeds the preset data storage amount, and finally establishing the screen-off standby time length table according to the screen-off standby time length of the mobile terminal in each preset use period in the database when the data storage amount exceeds the preset data storage amount, wherein the preset use periods comprise early morning, noon, afternoon, late night and half night, and the corresponding time periods are respectively 02:00 to 06:00, 6:00 to 10:00, 10:00 to 14:00, 14:00 to 18:00, 18:00 to 22:00, and 22:00 to 24: 00. It should be noted that the preset usage period may be set by a person skilled in the art based on actual situations, and this embodiment is not particularly limited thereto.
When the mobile terminal is detected to be in a screen-off standby state, acquiring current screen-off time, determining the current screen-off standby time of the mobile terminal according to the screen-off standby time table and the current screen-off time in the preset storage area, and then executing step S101 when the current screen-off standby time exceeds a preset threshold, namely traversing physical files in the mobile terminal to establish a mapping relation table of file numbers and physical storage paths of the mobile terminal, and storing the mapping relation table to a local database.
Specifically, in this embodiment, the step of determining the current screen-off standby duration of the mobile terminal according to the screen-off standby duration table and the current screen-off time in the preset storage area includes:
acquiring a screen-off standby time length table from a preset storage area, and determining the use time period of the current screen-off time;
and acquiring the screen-off standby time associated with the use time period from the screen-off standby time length table, and taking the screen-off standby time as the current screen-off standby time length of the mobile terminal.
The mobile terminal acquires a screen-off standby time length table from a preset storage area, determines the use time period of the current screen-off time, acquires the screen-off standby time length associated with the use time period from the screen-off standby time length table, and takes the screen-off standby time length as the current screen-off standby time length of the mobile terminal.
In this embodiment, after detecting that the mobile terminal is in the off-screen standby state, the mapping relation table, the virtual file tree and the hash table are established, that is, when the mobile terminal is not used by a user, relevant establishing operation and constructing operation are performed, and the establishing speed of the mapping relation table and the hash table and the constructing speed of the virtual file tree are improved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a file classification display program is stored on the computer-readable storage medium, and when executed by a processor, the file classification display program implements the following steps:
traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table to a local database;
constructing a virtual file tree in the memory of the mobile terminal according to a preset file tree construction rule and a mapping relation table in the local database;
calling a preset hash algorithm to process the file number of each tree node in the virtual file tree so as to establish a hash table of the virtual file tree;
when a file acquisition instruction sent by the PC terminal is monitored, the file number of each physical file is transmitted to the PC terminal, so that the PC terminal can display the files in the mobile terminal based on the file numbers, the hash table and the virtual file tree.
Further, the file classification display program when executed by the processor further implements the following steps:
traversing the physical files in the mobile terminal to acquire the index information of each physical file;
acquiring a file number and a physical storage path of a corresponding physical file from index information of each physical file;
and performing associated mapping on the file number of each physical file and the physical storage path to establish a mapping relation table of the file number of the mobile terminal and the physical storage path.
Further, the file classification display program when executed by the processor further implements the following steps:
constructing a virtual file classification tree in a memory of the mobile terminal according to a preset file tree construction rule, and determining classification characteristic information of each leaf node in the virtual file classification tree;
acquiring a physical storage path containing the classification characteristic information from a mapping relation table in the local database, and acquiring a file number corresponding to the physical storage path from the mapping relation table;
and taking the file number as a child node of the corresponding leaf node to update the virtual file classification tree, and taking the updated virtual file classification tree as the virtual file tree.
Further, the file classification display program when executed by the processor further implements the following steps:
acquiring the file number of each tree node in the virtual file tree;
calling a preset hash algorithm to process the file number of each tree node so as to obtain a corresponding hash address;
and establishing a hash table according to the file number of each tree node and the hash address corresponding to the file number.
Further, the file classification display program when executed by the processor further implements the following steps:
when a file operation instruction sent by the PC terminal is monitored, acquiring a file number of a file to be operated from the file operation instruction;
acquiring a hash address associated with the file number from the hash table, and acquiring a physical storage path of the file to be operated through the hash address;
and executing the operation corresponding to the file operation instruction on the file to be operated stored in the physical storage path.
Further, the file classification display program when executed by the processor further implements the following steps:
detecting whether the mobile terminal is in a screen-off standby state or not;
and when detecting that the mobile terminal is in a screen-off standby state, executing the step of traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table to a local database.
Further, the file classification display program when executed by the processor further implements the following steps:
when the mobile terminal is detected to be in a screen-off standby state, acquiring the current screen-off time;
determining the current screen-off standby time of the mobile terminal according to a screen-off standby time table in a preset storage area and the current screen-off time;
and when the current screen-off standby time exceeds a preset threshold, executing the step of traversing the physical file in the mobile terminal to establish a mapping relation table of the file number of the mobile terminal and a physical storage path, and storing the mapping relation table into a local database.
Further, the file classification display program when executed by the processor further implements the following steps:
acquiring a screen-off standby time length table from a preset storage area, and determining the use time period of the current screen-off time;
and acquiring the screen-off standby time associated with the use time period from the screen-off standby time length table, and taking the screen-off standby time as the current screen-off standby time length of the mobile terminal.
The specific embodiment of the computer-readable storage medium of the present invention is substantially the same as the specific embodiments of the file classification display method described above, and is not repeated herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.