CN112380226A - Data loading method and device, electronic equipment and storage medium - Google Patents

Data loading method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN112380226A
CN112380226A CN202011245920.1A CN202011245920A CN112380226A CN 112380226 A CN112380226 A CN 112380226A CN 202011245920 A CN202011245920 A CN 202011245920A CN 112380226 A CN112380226 A CN 112380226A
Authority
CN
China
Prior art keywords
data
access path
database
determination result
output
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
CN202011245920.1A
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.)
Beijing Wutong Chelian Technology Co Ltd
Original Assignee
Beijing Wutong Chelian 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 Beijing Wutong Chelian Technology Co Ltd filed Critical Beijing Wutong Chelian Technology Co Ltd
Priority to CN202011245920.1A priority Critical patent/CN112380226A/en
Publication of CN112380226A publication Critical patent/CN112380226A/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/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24552Database cache management
    • 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Computing Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a data loading method and device, electronic equipment and a storage medium, which are applied to first equipment. The method comprises the following steps: when detecting that a second device is inserted into a connection interface of the first device, determining an access path for accessing the second device from the first device; querying whether second data associated with the access path is stored in a database of the first device before first data is successfully read from the second device; if the database stores second data associated with the access path, acquiring the second data associated with the access path from the database; outputting the second data on the first device before the first data is successfully read.

Description

Data loading method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data loading method and apparatus, an electronic device, and a storage medium.
Background
With the rapid development of automobile electronics, the updating of vehicle-mounted systems is also a change day by day, and people also put higher demands on the entertainment of the vehicle-mounted systems. At present, a vehicle-mounted system is usually configured with a music playing device, which includes not only a CD insertion slot for playing songs stored in a DVD or CD, but also a Universal Serial Bus (USB) interface for connecting to an external storage medium and playing songs in the external storage medium.
However, in this way of playing songs in the external storage medium through the USB port, the inserted external storage medium needs to be scanned first, and the songs can be played only after the audio file is scanned, that is, there is a scanning waiting time. For the condition that the data stored in the external storage medium is more, the scanning waiting time is longer, and the user experience is seriously influenced.
Disclosure of Invention
The embodiment of the invention provides a data loading method and device, electronic equipment and a storage medium.
The technical scheme of the embodiment of the invention is realized as follows:
in a first aspect, an embodiment of the present invention provides a data loading method, applied to a first device, including:
when detecting that a second device is inserted into a connection interface of the first device, determining an access path for accessing the second device from the first device;
querying whether second data associated with the access path is stored in a database of the first device before first data is successfully read from the second device;
if the database stores second data associated with the access path, acquiring the second data associated with the access path from the database;
outputting the second data on the first device before the first data is successfully read.
Optionally, the method further comprises:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
Optionally, the method further comprises:
after the first data is successfully read, determining whether the second data is contained in the first data, and obtaining a determination result;
determining whether the second data being output on the first device can be replaced according to the determination result.
Optionally, the determining whether the second data being output on the first device can be replaced according to the determination result includes:
and if the determination result indicates that the second data is not included in the first data, replacing the second data being output on the first device with the first data.
Optionally, the method further comprises:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
Optionally, the determining whether the second data being output on the first device can be replaced according to the determination result further includes:
if the determination result indicates that the second data part is included in the first data, determining third data from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
Optionally, the method further comprises:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
Optionally, the method further comprises:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
In a second aspect, an embodiment of the present invention provides a data loading apparatus, which is applied to a first device, and includes:
the device comprises a detection module, a processing module and a control module, wherein the detection module is used for determining an access path for accessing a second device from a first device when the second device is detected to be inserted into a connection interface of the first device;
the query module is used for querying whether second data associated with the access path is stored in a database of the first equipment or not before the first data is successfully read from the second equipment;
the output module is used for acquiring second data associated with the access path from the database if the second data associated with the access path is stored in the database; outputting the second data on the first device before the first data is successfully read.
Optionally, the output module is further configured to:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
Optionally, the apparatus further comprises:
the determining module is used for determining whether the second data is contained in the first data or not after the first data is successfully read, and obtaining a determination result; determining whether the second data being output on the first device can be replaced according to the determination result.
Optionally, the determining module is further configured to:
and if the determination result indicates that the second data is not included in the first data, replacing the second data being output on the first device with the first data.
Optionally, the determining module is further configured to:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
Optionally, the determining module is further configured to:
if the determination result indicates that the second data part is included in the first data, determining third data from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
Optionally, the determining module is further configured to:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
Optionally, the determining module is further configured to:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
In a third aspect, an embodiment of the present invention provides an electronic device, including:
a memory for storing executable instructions;
and the processor is used for implementing the data loading method provided by one or more of the technical schemes when executing the executable instructions stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions; after being executed by a processor, the computer-executable instructions can implement the data loading method provided by one or more of the technical solutions.
The embodiment of the invention provides a data loading method and device, electronic equipment and a storage medium. Determining an access path for accessing a second device from a first device when the second device is detected to be inserted into a connection interface of the first device; querying whether second data associated with the access path is stored in a database of the first device before the first data is successfully read from the second device; and if the second data associated with the access path is stored in the database of the first equipment, directly acquiring the second data from the database, and outputting the second data on the first equipment before the first data is successfully read from the second equipment. Therefore, by using the technical scheme of the application, data can be output through the first device in a shorter time, and for a user, the scanning waiting time is reduced, so that the response rate is improved, and the user experience is improved.
Drawings
Fig. 1 is a schematic flowchart of a data loading method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data loading apparatus according to an embodiment of the present invention;
fig. 3 is a schematic flowchart of an audio data loading method of a vehicle-mounted terminal according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail with reference to the accompanying drawings, the described embodiments should not be construed as limiting the present invention, and all other embodiments obtained by a person of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
In the following description, reference is made to "some embodiments" which describe a subset of all possible embodiments, but it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict.
In the following description, references to the terms "first \ second \ third" are only to distinguish similar objects and do not denote a particular order, but rather the terms "first \ second \ third" are used to interchange specific orders or sequences, where appropriate, to enable embodiments of the invention described herein to be practiced in other than the order shown or described herein.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to be limiting of the invention.
In the related art, when a user inserts a U disk into a vehicle-mounted terminal, the vehicle-mounted terminal needs to scan the U disk to obtain an audio file stored in the U disk; the user typically waits several seconds from the start of scanning to the identification of the audio file and the start of playing. Moreover, if there are many audio files stored in the usb disk, it may be necessary to wait for tens of seconds to several minutes before all the audio files stored in the usb disk are loaded, which seriously affects user experience.
An embodiment of the present invention provides a data loading method, and fig. 1 is a schematic flow chart of the data loading method provided in the embodiment of the present invention, and as shown in fig. 1, the method is applied to a first device, and includes the following steps:
step 101, when detecting that a second device is inserted into a connection interface of a first device, determining an access path for accessing the second device from the first device;
step 102, before the first data is successfully read from the second equipment, inquiring whether second data associated with the access path is stored in a database of the first equipment;
103, if the database stores second data associated with the access path, acquiring the second data associated with the access path from the database;
and 104, outputting the second data on the first equipment before the first data is successfully read.
Here, the second data includes at least a file name of the file and an access path corresponding to the file.
In the embodiment of the present invention, the connection interface is an interface matched with the second device, for example, various peripheral interfaces such as a USB interface or a bluetooth interface for implementing connection between two devices.
In practical application, after detecting that a second device is accessed through a connection interface, a first device identifies an access path to the second device; and scanning the data on the second equipment, and storing the data into a database after the data stored in the second equipment is successfully read.
In actual implementation, if the first device successfully reads the data stored in the second device, the data is analyzed to obtain a file contained in the data, a file name of the file, and an access path corresponding to the file, and the file, the file name, and the access path corresponding to the file are stored in a database of the first device.
In some embodiments, after detecting access of the second device and successfully reading the first data of the target type from the second device, the first data is stored in the database of the first device.
In practical applications, the target type includes an audio file type, a video file type or an image file type. For example, MP3, MP4, RMVB, JPG, etc. In some embodiments, the first device may be an in-vehicle terminal, and the second device may be an external storage device, for example, a mobile terminal with a storage medium, such as a usb disk, an SD card, a mobile hard disk, or a mobile phone.
In practical application, a vehicle-mounted terminal scans data on an external storage device, identifies a file of a target type to be output by a first device and contained in the data after the data on the external storage device is successfully read, analyzes the file of the target type to obtain a name of the file of the target type and an access path corresponding to the file of the target type, and stores the file of the target type, the name of the file and the access path corresponding to the file into a database of the vehicle-mounted terminal.
In some embodiments, for a wired connection interface, whether a second device is plugged in may be detected by detecting a supply voltage current of the connection interface.
For example, after the vehicle is started, if the vehicle-mounted terminal detects that the voltage and current of the USB port change, it may be determined that the USB port is connected to the external storage device.
In other embodiments, for a wireless connection interface, whether a second device is accessed may be determined by whether a wireless signal is detected.
For example, after the vehicle is started, if the vehicle-mounted terminal detects a bluetooth connection signal, it may be determined that the second device is connected through the bluetooth interface.
In step 102, the first data is data stored in the second device; the second data is data read by the first device from the second device when the second device is last accessed to the first device.
In practical application, before the first device successfully reads the first data stored in the second device, the first device may first query whether the database stores the second data associated with the access path, and if the database stores the second data associated with the access path, the first device may obtain, from the database, the data read by the second device when the second device was last accessed, and output the second data.
In some embodiments, the first device may include a speaker, and the first data and the second data may be audio data; if the database of the first device stores second data associated with the access path; the first device may play the second data through the speaker before successfully reading the first data.
Therefore, when the second data associated with the access path is inquired to be stored in the database of the first device, the first device can output the second data stored in the database before the first data is successfully served, the scanning waiting time is reduced, and the user experience is improved.
Optionally, the method further comprises:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
In practical application, if the database of the first device stores the second data associated with the access path, it is indicated that the second device is accessed to the first device for the first time. The first device needs to wait for the first data to be successfully read from the second device before outputting the first data.
In actual implementation, if the first device successfully reads the first data stored in the second device, the first data is output, then the first data is analyzed to obtain a file contained in the first data, a file name of the file and an access path corresponding to the file, and the file, the file name and the access path corresponding to the file are stored in a database of the first device, so that the second device can obtain the data from the database and output the data when accessing next time.
Optionally, the method further comprises:
after the first data is successfully read, determining whether the second data is contained in the first data, and obtaining a determination result;
determining whether the second data being output on the first device can be replaced according to the determination result.
In practical applications, since the second data is the data read from the second device when the second device last accessed, and the first data is the data stored on the second device, there may be data change in the second device during two accesses. Therefore, after the first device successfully reads the first data, it needs to determine whether the data of the second device is changed by determining whether the second data is included in the first data, so as to determine whether the second data being output from the first device needs to be replaced.
In an embodiment of the present invention, the determination result may include that the second data is not included in the first data, that the second data portion is included in the first data, and that the second data is all included in the first data.
In some embodiments, the second device is accessed through an Application Programming Interface (API) based on second data stored in a database, and whether the second data is included in the first data is determined.
In practical application, the first device queries whether a file name of a file corresponding to the access path in the second device is consistent with a file name corresponding to the second data through an A PI interface based on the access path and the file name corresponding to the second data, and determines whether the data in the second device is changed according to a judgment result.
In some embodiments, if the determination result indicates that the second data is not included in the first data, the second data being output on the first device is replaced with the first data.
In practical applications, if the determination result indicates that the second data is not included in the first data, which indicates that the data of the second device is changed, the second data stored in the database of the first device is unavailable, and the first device replaces the second data being output with the first data.
For example, the second data stored in the database of the first device includes object file a and object file B, and the first data read by the first device from the second device includes object file C, object file D, and object file E. And determining that the second data is not contained in the first data through comparison of the first data and the second data, and the data of the second device is changed. The first device replaces the target file a being played with target file C.
Optionally, the method further comprises:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
In practical application, if the determination result indicates that the second data is not included in the first data, the first device replaces the second data stored in the database and associated with the access path corresponding to the second device with the first data.
In other embodiments, if the determination indicates that the second data portion is included in the first data, third data is determined from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
In this embodiment of the present invention, if the determination result indicates that the second data portion is included in the first data, which indicates that the data of the second device is partially changed, the second data portion stored in the database of the first device is available. The first device needs to recognize the data which is not changed in the second data, and replace the second data which is being output with the data which is not changed.
For example, the second data stored in the database of the first device includes object file a and object file B, and the first data read by the first device from the second device includes object file B, object file C, and object file D. And determining that the second data part is contained in the first data through comparison of the first data and the second data, and the data of the second device is partially changed. The first device identifies a data part which is overlapped in the first data and the second data, wherein the overlapped data part is data which is not changed in the second data (namely a target file B), and the first device replaces the second data which is being played with the target file B.
Optionally, the method further comprises:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
In practical application, if the determination result indicates that the second data part is included in the first data, the first device performs merging processing on the identified third data and the first data, performs deduplication processing on the merged data, and replaces the second data associated with the access path corresponding to the second device, which is stored in the database, with the deduplication processed data.
Optionally, the method further comprises:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
In practical applications, if the determination result indicates that all the second data are included in the first data, it indicates that the data of the second device has not been changed, and all the second data stored in the database of the first device are available. The first device does not need to replace the second data being output. And merging the second data and the first data, performing deduplication processing on the merged data, and replacing the second data which is stored in the database and is associated with the access path corresponding to the second equipment with the deduplication processed data.
In other embodiments, the target data stored in the database of the first device may be determined according to a data amount of the first data of the target type stored by the second device.
In practical application, if the data amount of the first data of the target type stored in the second device is smaller than a first threshold, all the first data of the target type stored in the second device is stored in the database of the first device.
If the data volume of the first data of the target type stored by the second device is larger than the first threshold, storing the first data of the preset data volume output or being output by the first device before the second device is disconnected from the first device into a database of the first device.
Optionally, the method further comprises:
storing the caching time of the second data associated with the access path in the database;
and determining deletable data from the second data according to the caching time.
In practical application, when the second data is stored in the database, the current time is obtained, and the current time is stored in the database as the cache time of the second data. And determining the time length of the second data which is not output or updated by the first equipment according to the difference value between the caching time of the second data and the current time, comparing the time length with a preset time length threshold, and deleting the second data if the time length exceeds the time length threshold, thereby releasing the storage capacity of the database.
Here, the duration threshold may be set according to actual needs, for example, one week or one month.
Optionally, the method further comprises:
if the duration is smaller than a preset duration threshold, sorting the second data according to the caching time to obtain a sorting file;
and if the storage capacity of the first equipment is insufficient, deleting second data associated with the sorting file in the database according to the sorting file.
In practical application, if the time length of the second data which is not output by the first device or is not updated is less than the time length threshold, the second data is sorted according to the time length of the second data which is not output by the first device or is not updated in the sequence from long to short to obtain a sorted file. And when the first equipment executes other functions and the storage capacity is insufficient, deleting the second data associated with the sorting file according to the sequence to release the storage capacity for the first equipment to execute other functions.
For example, the second data includes a file a, a file B, a file C, and a file D, and the second data is sorted in order from long to short according to a duration that the second data is not output or updated by the first device, and is sequentially the file B, the file C, the file a, and the file D. When the first device collects and stores images, the storage capacity is insufficient, the first device preferentially deletes the file B, if the storage capacity is still insufficient, the file C is continuously deleted, and the like is performed until the storage capacity can meet the requirement of the first device for image storage.
Next, an embodiment of the present invention provides a data loading apparatus, as shown in fig. 2, and fig. 2 is a schematic structural diagram of a data loading apparatus 20 provided in an embodiment of the present invention. The device comprises:
a detection module 21, configured to determine, when it is detected that a second device is inserted into a connection interface of the first device, an access path for accessing the second device from the first device;
the query module 22 is configured to query whether second data associated with the access path is stored in a database of the first device before the first data is successfully read from the second device;
the output module 23 is configured to, if the database stores second data associated with the access path, obtain the second data associated with the access path from the database; outputting the second data on the first device before the first data is successfully read.
Optionally, the output module 23 is further configured to:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
Optionally, the apparatus further comprises:
a determining module 24, configured to determine whether the second data is included in the first data after the first data is successfully read, so as to obtain a determination result; determining whether the second data being output on the first device can be replaced according to the determination result.
Optionally, the determining module 24 is further configured to:
and if the determination result indicates that the second data is not included in the first data, replacing the second data being output on the first device with the first data.
Optionally, the determining module 24 is further configured to:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
Optionally, the determining module 24 is further configured to:
if the determination result indicates that the second data part is included in the first data, determining third data from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
Optionally, the determining module 24 is further configured to:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
Optionally, the determining module 24 is further configured to:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
Therefore, when the second data associated with the access path is inquired to be stored in the database of the first device, the first device can output the second data stored in the database before the first data is successfully served, the scanning waiting time is reduced, and the user experience is improved.
With reference to the above embodiments of the present invention, an exemplary application of the embodiments of the present invention in a practical application scenario will be described below. Taking an example of loading a usb disk data by a music APP in a vehicle-mounted terminal, this example provides an audio data loading method for the vehicle-mounted terminal, and as shown in fig. 3, fig. 3 is a schematic flowchart of an audio data loading method for the vehicle-mounted terminal according to an embodiment of the present invention. The method comprises the following specific steps:
step 301, when the vehicle-mounted terminal detects that a USB flash disk is inserted, identifying an access path of the USB flash disk;
step 302, before reading the first audio data stored in the U disk, firstly inquiring whether second audio data associated with the access path is stored in a database of the vehicle-mounted terminal;
step 303, if the second audio data associated with the access path is stored in the database, acquiring the second audio data from the database;
step 304, outputting the second audio data through the music APP of the vehicle-mounted terminal system before the first audio data is successfully read;
step 305, after the first audio data is successfully read, determining whether the second audio data is contained in the first audio data, and determining whether to replace the second audio data output from the music APP of the vehicle-mounted terminal according to a determination result.
In the embodiment of the invention, the vehicle-mounted terminal comprises a connecting socket matched with the USB flash disk, and when the vehicle-mounted terminal detects that the USB flash disk is inserted through the connecting socket, the vehicle-mounted terminal identifies the access path of the USB flash disk; and scanning the data in the U disk, and storing the data into a database after the data in the U disk is successfully read.
In practical application, in order to increase the data retrieval rate, the vehicle-mounted terminal may set a plurality of pages in the database, and store the read data into different pages respectively.
In the embodiment of the present invention, it is assumed that each usb disk is on the same vehicle-mounted terminal, and the information identified each time is the same, for example, the access path of the vehicle-mounted terminal to access the usb disk is the same.
In step 302, the database of the vehicle-mounted terminal may be a cache database associated with the music APP in the vehicle-mounted terminal. The audio data includes at least an access path of the audio file and a name of the audio file.
And the vehicle-mounted terminal determines whether the USB flash disk is inserted for the first time or not by inquiring whether second audio data associated with the access path is stored in a cache database associated with the music APP or not.
If the USB flash disk is inserted for the first time, audio data corresponding to the USB flash disk are not stored in the cache database; and if the USB flash disk is not inserted into the vehicle-mounted terminal for the first time, the audio data read when the USB flash disk is inserted last time is stored in the cache database.
In practical application, if the vehicle-mounted terminal determines that the USB flash disk is not inserted for the first time through inquiry, the audio data read when the USB flash disk is inserted for the last time is obtained from the cache database through the music APP for playing, and then the audio data of the USB flash disk is continuously read.
In other embodiments, if the second audio data associated with the access path is not stored in the database, waiting for the in-vehicle terminal to read the first audio data from the usb disk, and outputting the first audio data through the music APP of the in-vehicle terminal after the first audio data is successfully read.
In practical application, if the vehicle-mounted terminal determines that the USB flash disk is inserted for the first time through inquiry, waiting for the vehicle-mounted terminal to read first audio data in the USB flash disk; and after the vehicle-mounted terminal reads the first audio data, outputting the first audio data through the music APP. And meanwhile, storing the first audio data in a cache database corresponding to the music APP according to an access path.
In step 305, since the second audio data is the audio data read when the usb disk was last inserted; by determining whether the first audio data contains the second audio data, it can be determined whether the data stored in the U disk has changed.
In some embodiments, the in-vehicle terminal compares second audio data stored in a database page with the read first audio data, and if the second audio data is not contained in the first audio data, replaces the second audio data being output on the music APP with the first audio data based on the first audio data; and replacing the second audio data associated with the access path in the database with the first audio data based on the first audio data.
In some embodiments, if the second audio data is contained in the first audio data, the second audio data and the first audio data are merged and subjected to de-duplication processing; and replacing the second audio data associated with the access path in the database with the processed data based on the processed data.
In other embodiments, if the second audio data portion is included in the first audio data, determining, based on the first audio data, overlapping audio data from the second audio data, and replacing the second audio data being output on the music APP with the overlapping audio data; merging and de-duplicating the first audio data and the superposed audio data; and replacing the second audio data associated with the access path in the database with the processed audio data based on the processed audio data.
An embodiment of the present invention further provides an electronic device 40, where the electronic device includes:
a memory for storing executable instructions;
and the processor is used for realizing the data loading method provided by the embodiment of the invention when executing the executable instructions stored in the memory.
The hardware structure of the electronic device 40 according to the embodiment of the present invention is described in detail below, and as shown in fig. 4, fig. 4 is a schematic structural diagram of the electronic device according to the embodiment of the present invention. Electronic devices include, but are not limited to, servers or terminals. The event extraction device includes: the at least one processor 401, the memory 402, and optionally the electronic device 40 may further comprise at least one communication interface 403, and the various components in the electronic device 40 are coupled together by a bus system 404, it being understood that the bus system 404 is used to enable connection communication between these components. The bus system 404 includes a power bus, a control bus, and a status signal bus in addition to a data bus.
It will be appreciated that the memory 402 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced DRAM), Synchronous Dynamic Random Access Memory (SLDRAM), Direct Memory (DRmb Access), and Random Access Memory (DRAM). The described memory for embodiments of the present invention is intended to comprise, without being limited to, these and any other suitable types of memory.
The memory 402 in embodiments of the present invention is used to store various types of data to support the operation of the electronic device 40. Examples of such data include: any computer program for operating on electronic device 40, a program implementing a method of an embodiment of the invention, may be contained in memory 402.
The method disclosed in the above embodiments of the present invention may be applied to the processor 401, or implemented by the processor 401. The processor 401 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 401. The Processor 401 described above may be a general purpose Processor, a Digital Signal Processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 401 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium located in the memory 402, and the processor 401 reads the information in the memory 402 and performs the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, the electronic Device 40 may be implemented by one or more Application Specific Integrated Circuits (ASICs), DSPs, Programmable Logic Devices (PLDs), Complex Programmable Logic Devices (CPLDs), Field Programmable Gate Arrays (FPGAs), general purpose processors, controllers, Micro Controllers (MCUs), microprocessors (microprocessors), or other electronic components for performing the above-described methods.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described device embodiments are merely illustrative, for example, the division of the unit is only a logical functional division, and there may be other division ways in actual implementation, such as: multiple units or components may be combined, or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the coupling, direct coupling or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection between the devices or units may be electrical, mechanical or other forms. 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, that is, 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, all the functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately regarded as one unit, or two or more units may be integrated into one unit; the integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
An embodiment of the present invention further provides a computer storage medium, where a computer program is stored, and after the computer program is executed by a processor, the computer program executes a data loading method provided in one or more of the foregoing technical solutions, for example, the method shown in fig. 1 may be executed.
The computer storage medium provided by the embodiment of the invention comprises: a mobile storage device, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. Alternatively, the computer storage medium may be a non-transitory storage medium. The non-transitory storage medium herein may also be referred to as a non-volatile storage medium.
In some embodiments, the computer-readable storage medium may be memory such as FRAM, ROM, PROM, EP ROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or may be various devices including one or any combination of the above memories. The computer may be a variety of computing devices including intelligent terminals and servers.
In some embodiments, executable instructions may be written in any form of programming language (including compiled or interpreted languages), in the form of programs, software modules, scripts or code, and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
By way of example, executable instructions may correspond, but do not necessarily have to correspond, to files in a file system, and may be stored in a portion of a file that holds other programs or data, such as in one or more scripts in a hypertext Markup Language (H TML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files that store one or more modules, sub-programs, or portions of code).
By way of example, executable instructions may be deployed to be executed on one computing device or on multiple computing devices at one site or distributed across multiple sites and interconnected by a communication network.
The above description is only an example of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, and improvement made within the spirit and scope of the present invention are included in the protection scope of the present invention.

Claims (18)

1. A data loading method is applied to first equipment and comprises the following steps:
when detecting that a second device is inserted into a connection interface of the first device, determining an access path for accessing the second device from the first device;
querying whether second data associated with the access path is stored in a database of the first device before first data is successfully read from the second device;
if the database stores second data associated with the access path, acquiring the second data associated with the access path from the database;
outputting the second data on the first device before the first data is successfully read.
2. The method of claim 1, further comprising:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
after the first data is successfully read, determining whether the second data is contained in the first data, and obtaining a determination result;
determining whether the second data being output on the first device can be replaced according to the determination result.
4. The method of claim 3, wherein the determining whether the second data being output on the first device can be replaced according to the determination result comprises:
and if the determination result indicates that the second data is not included in the first data, replacing the second data being output on the first device with the first data.
5. The method of claim 4, further comprising:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
6. The method of claim 3, wherein the determining whether the second data being output on the first device can be replaced according to the determination result further comprises:
if the determination result indicates that the second data part is included in the first data, determining third data from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
7. The method of claim 6, further comprising:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
8. The method of claim 3, further comprising:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
9. A data loading device is applied to a first device, and comprises:
the device comprises a detection module, a processing module and a control module, wherein the detection module is used for determining an access path for accessing a second device from a first device when the second device is detected to be inserted into a connection interface of the first device;
the query module is used for querying whether second data associated with the access path is stored in a database of the first equipment or not before the first data is successfully read from the second equipment;
the output module is used for acquiring second data associated with the access path from the database if the second data associated with the access path is stored in the database; outputting the second data on the first device before the first data is successfully read.
10. The apparatus of claim 9, wherein the output module is further configured to:
if the second data associated with the access path is not stored in the database, waiting for the first data to be successfully read from the second equipment;
after the first data is successfully read, outputting the first data on the first device.
11. The apparatus of claim 9 or 10, further comprising:
the determining module is used for determining whether the second data is contained in the first data or not after the first data is successfully read, and obtaining a determination result; determining whether the second data being output on the first device can be replaced according to the determination result.
12. The apparatus of claim 11, wherein the determining module is further configured to:
and if the determination result indicates that the second data is not included in the first data, replacing the second data being output on the first device with the first data.
13. The apparatus of claim 12, wherein the determining module is further configured to:
and if the determination result shows that the second data is not contained in the first data, replacing the second data associated with the access path in the database based on the first data.
14. The apparatus of claim 11, wherein the determining module is further configured to:
if the determination result indicates that the second data part is included in the first data, determining third data from the second data based on the first data; wherein the third data is entirely contained within the first data;
replacing the second data being output on the first device with third data.
15. The apparatus of claim 14, wherein the determining module is further configured to:
if the determined result shows that the second data part is contained in the first data, merging and de-duplicating the third data and the first data;
and updating second data associated with the access path in the database based on the processed data.
16. The apparatus of claim 11, wherein the determining module is further configured to:
if the determination result indicates that the second data is all contained in the first data, not replacing the second data output on the first equipment;
merging and de-duplicating the second data and the first data;
and updating second data associated with the access path in the database based on the processed data.
17. An electronic device, comprising:
a memory for storing executable instructions;
a processor, configured to implement the data loading method according to any one of claims 1 to 8 when executing the executable instructions stored in the memory.
18. A computer-readable storage medium storing executable instructions that, when executed by a processor, implement a data loading method as claimed in any one of claims 1 to 8.
CN202011245920.1A 2020-11-10 2020-11-10 Data loading method and device, electronic equipment and storage medium Pending CN112380226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011245920.1A CN112380226A (en) 2020-11-10 2020-11-10 Data loading method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011245920.1A CN112380226A (en) 2020-11-10 2020-11-10 Data loading method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112380226A true CN112380226A (en) 2021-02-19

Family

ID=74579705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011245920.1A Pending CN112380226A (en) 2020-11-10 2020-11-10 Data loading method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112380226A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113741983A (en) * 2021-07-21 2021-12-03 深圳市智微智能科技股份有限公司 USB device access method, system, terminal and storage medium in android system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856800A (en) * 2012-11-28 2014-06-11 北京数码视讯软件技术发展有限公司 Method and apparatus for set top box to read external connection storage device
CN104133641A (en) * 2014-07-24 2014-11-05 深圳市同洲电子股份有限公司 External storage equipment file deleting method and device
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN107016123A (en) * 2017-04-27 2017-08-04 广东欧珀移动通信有限公司 File management method and terminal device
CN111723054A (en) * 2020-06-29 2020-09-29 湖北亿咖通科技有限公司 Method for accessing external storage device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103856800A (en) * 2012-11-28 2014-06-11 北京数码视讯软件技术发展有限公司 Method and apparatus for set top box to read external connection storage device
CN104133641A (en) * 2014-07-24 2014-11-05 深圳市同洲电子股份有限公司 External storage equipment file deleting method and device
CN104536961A (en) * 2014-11-04 2015-04-22 深圳创维数字技术有限公司 Scanning method and scanning system for local media files
CN107016123A (en) * 2017-04-27 2017-08-04 广东欧珀移动通信有限公司 File management method and terminal device
CN111723054A (en) * 2020-06-29 2020-09-29 湖北亿咖通科技有限公司 Method for accessing external storage device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113741983A (en) * 2021-07-21 2021-12-03 深圳市智微智能科技股份有限公司 USB device access method, system, terminal and storage medium in android system

Similar Documents

Publication Publication Date Title
US10140113B2 (en) Data processing method and device of preset application after upgrading
US7743292B2 (en) Apparatus and method for memory card testing
US20080140736A1 (en) Hardware-Initiated Automated Back-Up of Data from an Internal Memory of a Hand-Portable Electronic Device
JP4777426B2 (en) Apparatus, system and method for accessing persistent files in NON-EXECUTE-IN-PLACE flash memory
CN111984597B (en) File storage method, device, equipment and medium
EP2857990A1 (en) File information previewing method and system
US8332584B2 (en) Method of combining and managing file systems for memory space and a computer system
CN101847101A (en) Method for automatically mounting USB storage device under embedded Linux
CN109496292A (en) A kind of disk management method, disk management device and electronic equipment
CN112380226A (en) Data loading method and device, electronic equipment and storage medium
CN112379835B (en) OOB area data extraction method, terminal device and storage medium
CN103838782B (en) A kind of method and device realized file scan and preserved
CN114816240A (en) Data writing method and data reading method
CN110019527B (en) Slave library reading method, related device and equipment
CN106933499B (en) Method and device for improving performance of MLC flash memory system
US20140119706A1 (en) Image recording system, image recorder, and data accessing method
US7996430B2 (en) File retrieval device and file retrieval method
CN113901010A (en) Android application package compression method and device
CN111625254A (en) File processing method, device, terminal and storage medium
CN112463178A (en) File system programming method and terminal of embedded equipment
KR102445798B1 (en) A System for Storing Multimedia Data and a method therefore
CN112328327B (en) Configuration partition arrangement method and device
US20070126746A1 (en) Managing information in mobile communication terminal
CN101689205A (en) Digital media player and method for avoiding refreshing a database of metadata associated with digital media content and for providing an improved user experience
CN118606007A (en) Application image creation method, device, server, medium and product

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