CN111723054A - Method for accessing external storage device - Google Patents

Method for accessing external storage device Download PDF

Info

Publication number
CN111723054A
CN111723054A CN202010604461.5A CN202010604461A CN111723054A CN 111723054 A CN111723054 A CN 111723054A CN 202010604461 A CN202010604461 A CN 202010604461A CN 111723054 A CN111723054 A CN 111723054A
Authority
CN
China
Prior art keywords
file
mapping relation
path
information
external storage
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.)
Pending
Application number
CN202010604461.5A
Other languages
Chinese (zh)
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.)
Ecarx Hubei Tech Co Ltd
Original Assignee
Hubei Ecarx Technology Co 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 Hubei Ecarx Technology Co Ltd filed Critical Hubei Ecarx Technology Co Ltd
Priority to CN202010604461.5A priority Critical patent/CN111723054A/en
Publication of CN111723054A publication Critical patent/CN111723054A/en
Pending legal-status Critical Current

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/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • G06F16/168Details of user interfaces specifically adapted to file systems, e.g. browsing and visualisation, 2d or 3d GUIs
    • 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/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2379Updates performed during online database operations; commit processing

Abstract

The invention provides a method for accessing an external storage device, which is applied to a terminal and comprises the following steps: acquiring parameter information of a node corresponding to an interface connected with external storage equipment; matching a preset channel path corresponding to the node according to the parameter information, and mounting the external storage device on the channel path; determining file information and a file storage path of each file belonging to a preset category; judging whether the mapping relation between the file information of each file belonging to the preset type and the file storage path is recorded in a database of the terminal; if not, storing the mapping relation between the file information and the file storage path of the file into a corresponding mapping relation table in the database for the file of which the mapping relation between the file information and the file storage path is not recorded in the database; and informing the application layer database of the terminal of the existence of data updating, and reading each file information of a preset type from the mapping relation table by the upper layer application and displaying the file information on an application interface of the upper layer application.

Description

Method for accessing external storage device
Technical Field
The invention relates to the technical field of computers, in particular to a method for accessing an external storage device.
Background
In the prior art, a traditional central control on a vehicle uses a USB vehicle machine to read media and interact data, the USB interface is determined to be not suitable for expanding functions and is generally limited to listening to songs and charging, and further a user basically does not use the USB interface and the USB interface is in a waste state.
In order to solve the above problems, an OTG HUB is adopted in the prior art, but in the actual use process of the OTG HUB chip, the storage path is randomly generated, which does not bring more improvement to the use of the user.
Disclosure of Invention
In view of the above, the present invention has been made to provide a method of accessing an external storage device that overcomes or at least partially solves the above-mentioned problems.
According to an aspect of the present invention, there is provided a method of accessing an external storage device, including:
acquiring parameter information of a node corresponding to an interface connected with external storage equipment;
matching a preset channel path corresponding to the node according to the parameter information, and mounting the external storage device on the channel path, wherein the channel path is communicated with the node and the terminal;
scanning files belonging to a preset category on the external storage device through the channel path, and determining file information and a file storage path of each file belonging to the preset category;
judging whether the mapping relation between the file information of each file belonging to the preset type and the file storage path is recorded in a database of the terminal;
if not, storing the mapping relation between the file information and the file storage path of the file into a corresponding mapping relation table in the database for the file of which the mapping relation between the file information and the file storage path is not recorded in the database;
and informing an application layer of the terminal that data updating exists in the database, and reading each file information of the preset type from the mapping relation table by an upper layer application and displaying the file information on an application interface of the upper layer application.
Optionally, the method further comprises:
and receiving the operation of the user on the files belonging to the preset type in the external storage equipment, and saving the operation record corresponding to the operation as data in file information in the mapping relation table between the file information corresponding to the file and the storage path.
Optionally, the operation record comprises at least one of: collecting and classifying;
the preset category includes at least one of: music, video, pictures, maps;
the file information includes at least one of: file type, file name, file size.
Optionally, when a storage path of a file belonging to a preset category in the external storage device is changed, a new storage path is updated into a mapping relationship between file information corresponding to the file and a file storage path in the mapping relationship table.
Optionally, the node is located on a HUB chip connected to the terminal, and the parameter information of any node on the HUB chip is generated according to the device model of the HUB chip and the number of nodes on the HUB chip.
According to another aspect of the present invention, there is also provided an electronic device, characterized by comprising a processor and a memory, wherein at least one instruction, at least one program, a set of codes, or a set of instructions is stored in the memory, and the at least one instruction, the at least one program, the set of codes, or the set of instructions is loaded and executed by the processor to implement the method according to any one of the above.
According to yet another aspect of the invention, there is also provided a computer storage medium having stored therein at least one instruction, at least one program, set of code or set of instructions to be loaded by a processor and to carry out a method according to any preceding claim.
In the scheme provided by the invention, after parameter information of a node corresponding to an interface connected with an external storage device is acquired, a preset channel path corresponding to the node is matched according to the parameter information and the external storage device is mounted on the channel path, so that files belonging to a preset type on the external storage device are scanned through the channel path, file information and a file storage path of each file belonging to the preset type are determined, whether the file information and the file storage path of each file belonging to the preset type are recorded in a database of a terminal is judged, if not, for files of which the file information and the file storage path are not recorded in the database, the mapping relation between the file information and the file storage path is stored in a corresponding mapping relation table in the database, and the application layer of the terminal is informed that data updating exists in the mapping relation table, and reading each file information of a preset category by the upper layer application and displaying the file information on an application interface of the upper layer application. Based on the scheme provided by the invention, the storage path is fixed, and the file information and the file storage path of the preset type of files in the external storage device are recorded in the mapping relation table of the database of the terminal, so that a user can perform various interactive operations, such as collection and classification, on the files in the external storage device, and more improvement is brought to the use of the user.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
The above and other objects, advantages and features of the present invention will become more apparent to those skilled in the art from the following detailed description of specific embodiments thereof, taken in conjunction with the accompanying drawings.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a flow diagram illustrating a method for accessing an external storage device according to an embodiment of the invention;
fig. 2 is a flowchart illustrating a method of accessing an external storage device according to a preferred embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
It should be noted that the technical features of the embodiments and alternative embodiments of the present invention may be combined with each other without conflict.
Fig. 1 is a flowchart illustrating a method of accessing an external storage device according to an embodiment of the present invention. As shown in fig. 1, the method for accessing an external storage device according to the present invention may include at least the following steps:
step S102: acquiring parameter information of a node corresponding to an interface connected with external storage equipment;
step S104: matching a preset channel path corresponding to the node according to the parameter information, and mounting an external storage device on the channel path, wherein the channel path is communicated with the node and the terminal;
step S106: scanning files belonging to a preset category on the external storage device through a channel path, and determining file information and a file storage path of each file belonging to the preset category;
step S108: judging whether the mapping relation between the file information of each file belonging to the preset type and the file storage path is recorded in a database of the terminal;
step S110: if not, storing the mapping relation between the file information and the file storage path of each file in a corresponding mapping relation table in the database for the files of which the mapping relation between the file information and the file storage path is not recorded in the database;
step S112: and informing the application layer database of the terminal of the existence of data updating, and reading each file information of a preset type from the mapping relation table by the upper layer application and displaying the file information on an application interface of the upper layer application.
The node in the above step S102 and step S104 is a node corresponding to an interface where the terminal is connected to the external storage device, the terminal may be directly connected to the external storage device through a USB interface thereon, or the terminal may be connected to an interface where the external storage device is connected through an interface on an external USB HUB, and the parameter information of the node may be determined according to information of the interface, such as an interface type and a protocol related to the interface.
After the external storage device is inserted into an interface on the HUB chip, a kernel (system bottom kernel) of the terminal recognizes and then throws a uevent (event) onto a hall (Hardware Abstraction Layer), obtains devpath (parameter information of a node) according to the uevent, matches a preset channel path corresponding to the node according to the parameter information of the node corresponding to the interface, the channel path communicates the node and the terminal, and files in the external storage device connected to the interface corresponding to the node can be scanned through the channel path.
Based on the scheme provided by the invention, the storage path is fixed, and the file information of the preset type of files in the external storage equipment and the mapping relation of the file storage path are recorded in the mapping relation table of the database of the terminal, so that a user can perform various interactive operations on the files in the external storage equipment, such as collection and classification, more improvement is brought to the use of the user, and the user experience is improved.
After the external storage device is mounted on the corresponding channel path in step S104, in step S106, the files belonging to the preset category on the external storage device are scanned through the channel path, and the file information and the file storage path of each file belonging to the preset category are determined.
In some embodiments of the invention, the predetermined category includes at least one of: music, video, pictures, maps. The file information includes at least one of: file type, file name, file size.
After determining the file information and the file storage path of each file belonging to the preset category, in step S108, it is determined whether the mapping relationship between the file information and the file storage path of each file belonging to the preset category is recorded in the database of the terminal.
If not, in step S110, for the files whose mapping relationship between the file information and the file storage path is not recorded in the database, the mapping relationship between the file information and the file storage path of each file is stored in the corresponding mapping relationship table in the database.
For example, the external storage device includes music "Jiangnan" whose storage path is "D: \ M: \ music", and after judging that the file information and the file storage path of the music "Jiangnan" are not stored in the database of the terminal, the mapping relationship between the file information and the file storage path of the music "Jiangnan" is stored in the corresponding mapping relationship table in the database of the terminal.
After the database is updated, in step S112, the application layer database of the terminal is notified that there is data update, and then the upper layer application reads information of each file in the preset category from the mapping relationship table and displays the information on the application interface.
The upper layer application may include at least one of a music player, a video player, a navigation application, and a picture browser. After the terminal database is updated, at least one application of the music player, the video player, the navigation application and the picture browser can read corresponding data from the mapping relation table and display the data on an application interface of the application. Such as music players reading music, video players reading video.
Fig. 2 is a flowchart illustrating a method of accessing an external storage device according to a preferred embodiment of the present invention. As shown in fig. 2, in a preferred embodiment of the present invention, after step S112, the method further includes:
step S114: receiving an operation of a user on a file belonging to a preset type in the external storage device, and storing an operation record corresponding to the operation as data in file information in a mapping relation table between the file information corresponding to the file and a file storage path.
Wherein, the operation record can comprise at least one of collection and classification. For example, when a user performs a collection operation on music "south of the river" in the external storage device, the corresponding collected operation record is stored as data of file information in the mapping relationship between the file information corresponding to the music "south of the river" and the file storage path in the mapping relationship table, so that when the user opens the music "south of the river" again from the external storage device, the application interface of the music player displays the operation record of "collection". The effect of recording the portable operation of the user is achieved.
In addition, when the storage path of the file belonging to the preset type in the external storage device is changed, the new storage path can be updated to the mapping relation between the file information corresponding to the file and the file storage path in the mapping relation table, so that the influence on the database reading performance due to more and more data in the database can be avoided.
According to another aspect of the present invention, there is also provided an electronic device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement the method according to any of the embodiments described above.
According to yet another aspect of the present invention, there is also provided a computer readable storage medium having stored therein at least one instruction, at least one program, set of code or set of instructions, which is loaded by a processor and which performs a method as described in any one of the above embodiments.
The invention provides a method for accessing an external storage device applied to a terminal, which is based on the scheme provided by the invention, the mapping relation between the file information of a preset type of files in the external storage device and the file storage path is recorded in the mapping relation table of a database of the terminal by fixing the storage path, so that a user can perform various interactive operations, such as collection and classification, on the files in the external storage device, and more improvement is brought to the use of the user; in addition, when the storage path of the file belonging to the preset type in the external storage device is changed, the new storage path can be updated to the mapping relation between the file information corresponding to the file and the file storage path in the mapping relation table, so that the influence on the database reading performance due to more and more data in the database can be avoided.
It is clear to those skilled in the art that the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and for the sake of brevity, further description is omitted here.
In addition, the functional units in the embodiments of the present invention may be physically independent of each other, two or more functional units may be integrated together, or all the functional units may be integrated in one processing unit. The integrated functional units may be implemented in the form of hardware, or in the form of software or firmware.
Those of ordinary skill in the art will understand that: the integrated functional units, if implemented in software and sold or used as a stand-alone product, may be stored in a computer readable storage medium. 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 and includes instructions for causing a computing device (e.g., a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention when the instructions are executed. And the aforementioned storage medium includes: u disk, removable hard disk, Read Only Memory (ROM), Random Access Memory (RAM), magnetic or optical disk, and other various media capable of storing program code.
Alternatively, all or part of the steps of implementing the foregoing method embodiments may be implemented by hardware (such as a computing device, e.g., a personal computer, a server, or a network device) associated with program instructions, which may be stored in a computer-readable storage medium, and when the program instructions are executed by a processor of the computing device, the computing device executes all or part of the steps of the method according to the embodiments of the present invention.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments can be modified or some or all of the technical features can be equivalently replaced within the spirit and principle of the present invention; such modifications or substitutions do not depart from the scope of the present invention.

Claims (7)

1. A method for accessing an external storage device is applied to a terminal and comprises the following steps:
acquiring parameter information of a node corresponding to an interface connected with external storage equipment;
matching a preset channel path corresponding to the node according to the parameter information, and mounting the external storage device on the channel path, wherein the channel path is communicated with the node and the terminal;
scanning files belonging to a preset category on the external storage device through the channel path, and determining file information and a file storage path of each file belonging to the preset category;
judging whether the mapping relation between the file information of each file belonging to the preset type and the file storage path is recorded in a database of the terminal;
if not, storing the mapping relation between the file information and the file storage path of the file into a corresponding mapping relation table in the database for the file of which the mapping relation between the file information and the file storage path is not recorded in the database;
and informing an application layer of the terminal that data updating exists in the database, and reading each file information of the preset type from the mapping relation table by an upper layer application and displaying the file information on an application interface of the upper layer application.
2. The method of claim 1, wherein the method further comprises:
and receiving the operation of the user on the files belonging to the preset type in the external storage equipment, and saving the operation records corresponding to the operation as data in file information in the mapping relation between the file information corresponding to the files and the file storage path in the mapping relation table.
3. The method of claim 2, wherein,
the operation record comprises at least one of the following: collecting and classifying;
the preset category includes at least one of: music, video, pictures, maps;
the file information includes at least one of: file type, file name, file size.
4. The method according to any one of claims 1 to 3, wherein,
and when the storage path of the file belonging to the preset type in the external storage equipment is changed, updating a new storage path into the mapping relation between the file information corresponding to the file and the file storage path in the mapping relation table.
5. The method according to any one of claims 1 to 3,
the node is located on a HUB chip connected with the terminal, and the parameter information of any node on the HUB chip is generated according to the equipment model of the HUB chip and the number of nodes on the HUB chip.
6. An electronic device comprising a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, the at least one instruction, the at least one program, the set of codes, or the set of instructions being loaded and executed by the processor to implement the method of any one of claims 1-5.
7. A computer readable storage medium having stored therein at least one instruction, at least one program, set of code or instructions, which is loaded by a processor and which performs the method of any one of claims 1 to 5.
CN202010604461.5A 2020-06-29 2020-06-29 Method for accessing external storage device Pending CN111723054A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010604461.5A CN111723054A (en) 2020-06-29 2020-06-29 Method for accessing external storage device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010604461.5A CN111723054A (en) 2020-06-29 2020-06-29 Method for accessing external storage device

Publications (1)

Publication Number Publication Date
CN111723054A true CN111723054A (en) 2020-09-29

Family

ID=72569491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010604461.5A Pending CN111723054A (en) 2020-06-29 2020-06-29 Method for accessing external storage device

Country Status (1)

Country Link
CN (1) CN111723054A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143332A1 (en) * 2004-12-24 2006-06-29 Shuichi Yagi Storage system and method of storage system path control
US20140040310A1 (en) * 2012-08-01 2014-02-06 Oracle International Corporation Query-level access to external petabyte-scale distributed file systems
CN103856800A (en) * 2012-11-28 2014-06-11 北京数码视讯软件技术发展有限公司 Method and apparatus for set top box to read external connection storage device
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN106528690A (en) * 2016-10-31 2017-03-22 维沃移动通信有限公司 Method for accessing storage medium by application and mobile terminal

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060143332A1 (en) * 2004-12-24 2006-06-29 Shuichi Yagi Storage system and method of storage system path control
US20140040310A1 (en) * 2012-08-01 2014-02-06 Oracle International Corporation Query-level access to external petabyte-scale distributed file systems
CN103856800A (en) * 2012-11-28 2014-06-11 北京数码视讯软件技术发展有限公司 Method and apparatus for set top box to read external connection storage device
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN106528690A (en) * 2016-10-31 2017-03-22 维沃移动通信有限公司 Method for accessing storage medium by application and mobile terminal

Similar Documents

Publication Publication Date Title
US20030038971A1 (en) Printing device with reader for removable media storage container
CN103646044A (en) Mobile terminal identification method and device
CN108932286B (en) Data query method and device
CN109918678B (en) Method and device for identifying field meaning
CN104750839A (en) Data recommendation method, terminal and server
CN114564620A (en) Graph data storage method and system and computer equipment
KR100858157B1 (en) System and merhod for map uapdate, storage medium recording that method program, user termianl
CN114548059A (en) Method and device for managing structured data, storage medium and electronic equipment
CN109408723A (en) A kind of method for pushing and device
CN101593114B (en) Device driven by USB video class (UVC) application automatic replacing system
CN111723054A (en) Method for accessing external storage device
US7461204B2 (en) Method to store and retrieve memory card usage information
CN111782946A (en) Book friend recommendation method, calculation device and computer storage medium
CN101379490A (en) Storage profile generation for network-connected portable storage devices
CN106383796A (en) Host operation system type identification method and system
US20220342849A1 (en) System and method for managing a plurality of data storage devices
CN104424298B (en) A kind of information-pushing method and electronic equipment
CN108053255A (en) The method and device of a kind of information processing
CN110119743B (en) Picture identification method, server and computer readable storage medium
CN113342762A (en) Intelligent processing method and related device for shared messages of friends of merchants
CN108521527B (en) Ticket difference detection method, system, computer storage medium and computer equipment
JP3872261B2 (en) Information providing apparatus, information providing system, and information providing method
CN112036133A (en) File saving method and device, electronic equipment and storage medium
CN114840743B (en) Model recommendation method and device, electronic equipment and readable storage medium
CN100382000C (en) Electronic apparatus for managing changeable storage medium, method thereof and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right

Effective date of registration: 20220322

Address after: 430051 No. b1336, chuanggu startup area, taizihu cultural Digital Creative Industry Park, No. 18, Shenlong Avenue, Wuhan Economic and Technological Development Zone, Wuhan, Hubei Province

Applicant after: Yikatong (Hubei) Technology Co.,Ltd.

Address before: No.c101, chuanggu start up area, taizihu cultural Digital Industrial Park, No.18 Shenlong Avenue, Wuhan Economic Development Zone, Hubei Province

Applicant before: HUBEI ECARX TECHNOLOGY Co.,Ltd.

TA01 Transfer of patent application right
RJ01 Rejection of invention patent application after publication

Application publication date: 20200929

RJ01 Rejection of invention patent application after publication