USB media file loading methods, systems, storage media, and devices

CN121326850BActive Publication Date: 2026-08-14LINKPLAY TECHNOLOGY INC NANJING
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-10-17
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

首先,由于需要完整遍历文件目录并解析每个可能为媒体文件的头部信息,当USB设备中存有大量文件时,初始化加载过程耗时显著增加,用户往往需要等待数分钟甚至更长时间才能开始浏览或播放内容

Benefits of technology

本发明通过预扫描机制快速统计媒体文件信息,结合历史数据建立时间预测模型,使用户在加载开始前即可了解文件总量与预计完成时间,有效缓解等待焦虑;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121326850B_ABST
    Figure CN121326850B_ABST
Patent Text Reader

Abstract

This invention relates to the field of audio loading technology, and discloses a USB media file loading method, system, storage medium, and device. The method includes: detecting device connection and initiating a pre-scanning process when a USB storage device is inserted into the system; performing a rapid pre-scan on the USB storage device, obtaining basic information about the media files through a lightweight file system traversal algorithm, and counting the number and type of media files; establishing a time prediction model based on the pre-scan results and historical loading data to estimate loading time, and formulating a loading priority strategy; displaying multi-level progress information to the user during the loading process, including overall progress, category progress, and real-time status, and providing dynamically updated remaining time estimates; executing the loading of media files according to the loading priority strategy, and performing result verification and cache management after loading is completed. This achieves intelligent pre-scanning and optimized loading of USB media files, improving the system's usability and user satisfaction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of audio loading technology, and in particular to a method, system, storage medium, and device for loading USB media files. Background Technology

[0002] With the widespread use of digital media content and the continuous increase in the capacity of USB storage devices, users frequently connect storage devices to media playback devices via USB interfaces to access media files such as audio, video, and images stored on them. Traditional USB media file loading methods typically employ a direct traversal loading mechanism, whereby upon detecting a device insertion, the system immediately begins recursively scanning the entire file system, reading file header information one by one to identify supported media formats and extract metadata.

[0003] This traditional loading method has significant limitations. First, because it requires a complete traversal of the file directory and parsing the header information of each potential media file, the initial loading process becomes significantly time-consuming when the USB device contains a large number of files. Users often have to wait several minutes or even longer before they can start browsing or playing content. Even more detrimental to the user experience is that throughout the loading process, the system typically only provides static prompts like "Loading," lacking feedback on crucial status information such as the total number of files, the number loaded, and the remaining time. This opaque approach can easily cause anxiety for users while waiting, and may even lead them to misinterpret the system as malfunctioning and perform unnecessary restarts or unplugging / plugging operations.

[0004] Furthermore, traditional loading mechanisms lack the ability to pre-assess file availability. If a corrupted or unsupported file exists on the device, the system will only detect the error when attempting to load it, causing interruptions or delays in the loading process and impacting overall stability. Simultaneously, because the system does not analyze file type, size, and user preferences, it cannot optimize the loading order and prioritize the content most likely to be accessed by the user, further reducing response efficiency and user experience.

[0005] Therefore, there is an urgent need in the field for a USB media file loading method that can improve loading feedback transparency, enhance loading efficiency, and intelligently predict and optimize file processing order. Summary of the Invention

[0006] The purpose of this invention is to overcome the shortcomings of the prior art and provide a USB media file loading method, system, storage medium and device. By pre-scanning USB devices to quickly count media files, predicting loading time and optimizing loading order based on historical data, and displaying multi-level progress information in real time, the invention significantly improves loading transparency and user experience.

[0007] On the one hand, a method for loading USB media files is provided, including the following steps: S1: Detects the insertion of a USB storage device into the system and initiates the pre-scan process; S2: Perform a fast pre-scan on the USB storage device, obtain the metadata information of the media files by traversing the file system without reading the file content itself, and count the number, type and size distribution of the media files; S3: Based on the pre-scan results and historical loading performance data, establish a time prediction model to estimate loading time and formulate a loading priority strategy; S4: Display multi-level progress information during loading, including overall progress, category progress, and real-time status, and dynamically update the remaining time estimate based on the actual loading speed; S5: Load media files according to priority order, and perform result verification and cache management after loading is completed.

[0008] Further, in step S1, the initialization of the pre-scan process includes: The device insertion signal is captured through the USB event listening mechanism to obtain basic device information, including device ID, manufacturer information, and storage capacity. Perform file system mounting operations on the USB device and verify the device's access permissions; The pre-scan parameters, including scan depth, file type filter, and scan timeout, are dynamically configured based on device capacity and system performance.

[0009] Furthermore, in step S2, the rapid pre-scan achieves lightweight scanning in the following manner: When traversing the file system directory structure, only the basic attribute information and file header identification information of the files are read, and the complete content of the files is not parsed; Quickly identify media files based on file extensions and header information, and record their basic information for classification and statistics, including the number of different types of media files and the total file size; During the pre-scanning process, the remaining scan volume is dynamically estimated based on the ratio of the number of scanned directories to the estimated total number of directories, and the real-time scan progress is fed back to the user.

[0010] Preferably, the traversal of the file system adopts a recursive access to the directory structure, and the recursion level is controlled according to a preset scan depth limit to avoid excessively deep traversal that would lead to excessively long scan time.

[0011] Furthermore, in step S3, establishing the time prediction model includes: Maintain a historical loading database to record file loading performance data under different conditions, including loading performance data corresponding to file type, file size range, and USB device type; The average loading time for different file types is calculated based on historical data, and the total loading time is estimated by combining the number and type of files in the pre-scan results. By conducting small-scale tests on a subset of media files, the dynamic adjustment time prediction model is loaded, the actual reading performance of the current device is measured, and the loading time prediction results are corrected accordingly.

[0012] Preferably, in step S3, determining the loading priority order further includes: Taking into account factors such as user preferences, file type, file access time, and file size; Prioritize loading media types preferred by the user, recently accessed files, and small files to reduce the waiting time for the user to obtain the target content.

[0013] Secondly, step S4 further includes: Displays the overall loading progress percentage calculated based on the ratio of the number of loaded files to the total number of files, the loading progress of each media type, and information on the specific file currently being processed; Based on the time prediction model and the actual loading progress, the display of the remaining loading time is adjusted in real time, and the estimated completion time is recalculated according to the speed of the loaded files. Provides user interaction options, allowing users to cancel the current loading operation or move the loading process to the background.

[0014] Further, in step S5, loading the media file includes: Media files are processed sequentially according to the aforementioned priority order; Monitor for anomalies during loading, including file corruption, read errors, and unexpected device disconnection. Provide clear error messages and handling suggestions when an anomaly is detected, and skip the abnormal file to continue processing subsequent files.

[0015] Preferably, in step S5, the result verification includes: Perform integrity checks and metadata verification on the loaded media files to ensure that the files can be used normally; For audio files, extract and verify tag information; for video files, generate preview thumbnails; for image files, generate thumbnail versions of different sizes to optimize the display effect of various files.

[0016] More preferably, in step S5, the cache management includes: Cache file index information, thumbnails, and metadata to improve the efficiency of subsequent accesses; Optimize cached content based on file access frequency, file size, and storage space limitations, prioritizing the caching of frequently accessed files and small-sized files.

[0017] Specifically, when a previously connected USB device is detected being plugged in again: The device is identified by its device identification information, and cached historical scan data is read. Compare the current file status of the device with cached data to identify newly added, modified, or deleted files; Incremental scanning and loading are performed only on newly added or modified files, and cached data is used to directly display unchanged file information, reducing the time spent on repeated loading.

[0018] Furthermore, the method also includes: After loading is complete, collect user feedback data, including the most frequently accessed file types, playback frequency, and operating habits of users; Based on the collected user data, the parameters of the time prediction model and the loading priority strategy are optimized so that the system can better meet the personalized needs of users as usage time increases.

[0019] On the other hand, a USB media file loading system is provided, including: The detection and initialization module is used to detect when a USB storage device is inserted into the system and to initialize the pre-scan process. The fast pre-scan execution module is used to quickly pre-scan USB storage devices. It obtains the metadata information of media files by traversing the file system without reading the file content itself, and counts the number, type and size distribution of media files. The loading time prediction and optimization module is used to build a time prediction model based on pre-scan results and historical loading performance data to estimate loading time and formulate loading priority strategies. The visualization and user interaction module is used to display multi-level progress information, including overall progress, category progress, and real-time status, during the loading process, and dynamically update the remaining time estimate based on the actual loading speed. The results optimization and cache management module is used to load media files according to priority, and perform result verification and cache management after loading is completed.

[0020] In addition, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the USB media file loading method described in any of the preceding claims.

[0021] Meanwhile, an electronic device is provided, comprising: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the USB media file loading method described above.

[0022] Compared with the prior art, the beneficial effects of the present invention are: This invention uses a pre-scanning mechanism to quickly collect media file information and combines it with historical data to establish a time prediction model, allowing users to know the total number of files and the estimated completion time before loading begins, effectively alleviating waiting anxiety. This invention intelligently formulates a loading priority strategy based on pre-scan results, prioritizing the processing of commonly used file types and small-sized files, significantly reducing the waiting time for users to obtain target content; This invention provides users with a clear and controllable loading experience by displaying the overall progress, category progress, and current operation status in real time through a multi-level progress display interface, combined with dynamically updated time estimates. This invention identifies corrupt files and incompatible formats in advance during the pre-scanning stage to avoid interruptions during loading; at the same time, it optimizes the efficiency of repeated loading through an intelligent caching mechanism and continuously optimizes system performance using feedback data. This invention enables the system to have self-learning capabilities by collecting user habit data and incorporating it into the loading strategy. This allows the system to dynamically adjust the loading order based on user preferences, thereby continuously improving the user experience. Attached Figure Description

[0023] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of a USB media file loading method according to the present invention; Figure 2 This is a block diagram of a USB media file loading system according to the present invention; Figure 3 This is a schematic diagram of an embodiment of an electronic device according to the present invention. Detailed Implementation

[0024] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0025] This invention utilizes a pre-scanning mechanism to quickly count media files in a USB device, establishes a time prediction model to estimate loading time, formulates an intelligent loading priority strategy, and provides multi-level progress displays and dynamic time estimation during the loading process. Simultaneously, it introduces an exception handling mechanism and an intelligent caching strategy to effectively improve loading transparency, system stability, and user experience, enabling personalized media file loading services.

[0026] The specific embodiments of the present invention will be described below with reference to the accompanying drawings and examples.

[0027] Example 1 Please see Figure 1 The technical solution for a USB media file loading method provided in this embodiment includes the following steps: S1: Detects the insertion of a USB storage device into the system and initiates the pre-scan process; S2: Perform a fast pre-scan on the USB storage device, obtain the metadata information of the media files by traversing the file system without reading the file content itself, and count the number, type and size distribution of the media files; S3: Based on the pre-scan results and historical loading performance data, establish a time prediction model to estimate loading time and formulate a loading priority strategy; S4: Display multi-level progress information during loading, including overall progress, category progress, and real-time status, and dynamically update the remaining time estimate based on the actual loading speed; S5: Load media files according to priority order, and perform result verification and cache management after loading is completed.

[0028] First, step S1, USB device detection and pre-scan initialization, is performed. When a USB storage device is inserted into the system, the USB controller first detects the device connection event. The initialization pre-scan process includes file system mounting and access permission verification, and pre-scan parameter configuration, specifically including: The device insertion signal is captured through the USB event listening mechanism to obtain basic device information, including device ID, manufacturer information, and storage capacity. Perform file system mounting operations on the USB device and verify the device's access permissions to ensure that the device content can be read normally; The pre-scan parameters, including scan depth, file type filter, and scan timeout, are dynamically configured based on device capacity and system performance to optimize scan efficiency.

[0029] Specifically, the system captures device insertion signals through a USB event listening mechanism to obtain basic device information, including device ID, manufacturer information, and storage capacity. In this embodiment, when a user inserts a 32GB USB flash drive, the system will identify the device type as a mass storage device, the file system format as FAT32 or NTFS, and the available space as 30GB, among other information.

[0030] The system mounts the detected USB device using a file system, establishing a communication connection. During mounting, the system verifies the device's access permissions to ensure it can read the device's contents. If the device is password protected or has a file system error, the system prompts the user for appropriate action. In this embodiment, for encrypted USB devices, the system displays a password input dialog box; for devices with corrupted file systems, the system provides repair options.

[0031] The pre-scan parameters are dynamically configured based on device capacity and system performance. These include scan depth (directory level limit), file type filters (list of supported media formats), and scan timeout. In this embodiment, for devices with a capacity of less than 4GB, the system sets no directory depth limit; for devices with a capacity greater than 32GB, the scan depth is limited to 5 levels to avoid excessively long scan times. Media file type filters are also configured, including common audio formats (MP3, WAV, FLAC), video formats (MP4, AVI, MKV), and image formats (JPEG, PNG, GIF).

[0032] Next, step S2, a fast pre-scan, is performed. This fast pre-scan achieves lightweight scanning in the following way: When traversing the file system directory structure, only the basic attribute information and file header identification information of the files are read, and the complete content of the files is not parsed; Quickly identify media files based on file extensions and header information, and record their basic information for classification and statistics, including the number of different types of media files and the total file size; During the pre-scanning process, the remaining scan volume is dynamically estimated based on the ratio of the number of scanned directories to the estimated total number of directories, and the real-time scan progress is fed back to the user.

[0033] The file system traversal adopts a recursive access to the directory structure, and the recursion level is controlled according to the preset scan depth limit to avoid excessively deep traversal that would lead to excessively long scan time.

[0034] Specifically, we employ an optimized depth-first search algorithm to traverse the file system of the USB device. The algorithm starts from the root directory and recursively visits each subdirectory, but only reads basic file attribute information (filename, file size, modification time, file extension), without reading the file content. This lightweight scanning method can quickly obtain file overview information. In this embodiment, when scanning a music folder containing 1000 MP3 files, the pre-scan only needs to read the header information of each file to obtain the filename and size, without parsing audio metadata, thus reducing the scanning time from 30 seconds in the traditional method to 3 seconds.

[0035] During the traversal, the system quickly identifies media files based on file extensions and header information. For each identified media file, the system records its basic information and performs categorized statistics. These statistics include the number of different types of media files (audio, video, images), total file size, and average file size. In this embodiment, the scan results show that the USB device contains 500 audio files (total size 2GB), 200 video files (total size 8GB), and 300 image files (total size 500MB). The system saves this statistical information to a temporary data structure.

[0036] Simultaneously, during the pre-scanning process, the system calculates and updates the scanning progress in real time. Progress calculation is based on the ratio of the number of scanned directories to the estimated total number of directories. Since the exact total number of directories cannot be predicted, the system employs a dynamic estimation method, predicting the remaining scan volume based on the average number of subdirectories in the scanned directories. The formula for this dynamic estimation method is as follows: in, Indicates at a point in time Pre-scan progress percentage, Indicates at a point in time Number of directories that have been scanned. Indicates at a point in time The number of top-level directories that have not yet been scanned or the number of directories known to be to be scanned. The average subdirectory factor is a dynamically adjusted coefficient calculated based on the average number of subdirectories in the scanned directories. It is used to estimate the number of subdirectories that an unscanned directory region may contain.

[0037] This algorithm dynamically estimates the scanning progress and provides real-time feedback, effectively alleviating user anxiety while waiting and significantly improving the visualization and user experience of the operation process.

[0038] In this embodiment, if the first 10 directories contain an average of 5 subdirectories, the system will predict the entire scanning process based on this statistical data. Simultaneously, it will display real-time information to the user such as "Scanning: XXX media files found".

[0039] Next, the loading time prediction and optimization strategy in step S3 is implemented. First, the system maintains a historical loading database, recording file loading performance data under different conditions. Data dimensions include file type, file size, USB device type (USB 2.0 / 3.0), and device read speed. Based on this historical data, the system establishes a time prediction model. In this embodiment, historical data shows that the average loading time for MP3 files is 50 milliseconds per file, and for video files it is 200 milliseconds per file. When the pre-scan detects 500 audio files and 200 video files, the system predicts the loading time to be: 500 × 50 ms + 200 × 200 ms = 65 seconds.

[0040] Then, considering the performance differences of different USB devices, the system performs a small-scale test load before starting the formal loading. Five to ten media files of different types are randomly selected for actual loading, and the actual loading speed is measured. Based on the test results, the time prediction model is adjusted. The establishment of the time prediction model includes: Maintain a historical loading database to record file loading performance data under different conditions, including file type, file size, USB device type, and device read speed; Based on historical data, the average loading time for different types of files is calculated, and the total loading time is estimated by combining the number and type of files in the pre-scan results. The dynamically adjusted time prediction model was loaded through small-scale testing. Multiple media files were randomly selected for actual loading measurements, and the predicted time was corrected based on the test results.

[0041] The time prediction model is represented as follows: in, This indicates the predicted total loading time. The number of categories for media files (e.g., audio, video, images). Indicates the first Number of media files (from pre-scan statistics) Indicates the first The average single-file load time for class files, a value retrieved and calculated from a historical load database. The device performance correction factor is a coefficient derived through small-scale testing and used to correct for differences between the current USB device's read speed and its historical average speed.

[0042] This algorithm combines historical data with real-time testing to generate accurate loading time estimates, helping users to manage their waiting time and enhancing system predictability.

[0043] In this embodiment, if the test finds that the actual loading speed of the current USB device is 20% slower than the historical average speed, the system will adjust the predicted time accordingly to 78 seconds (65 seconds × 1.2). This dynamic adjustment mechanism can improve the accuracy of time prediction.

[0044] Secondly, based on the pre-scan results and user preference settings, the system formulates an intelligent loading priority strategy. The formulation of the loading priority strategy further includes: The loading order of media files is determined by taking into account factors such as user preferences, file type, file access time, and file size. Prioritize loading media types that users prefer or recently accessed, as well as small files, so that users can access content they are interested in more quickly.

[0045] The specific priority strategy formula is expressed as follows: in, This indicates the file's priority score; the higher the score, the higher the loading priority. Represents a file type preference index, a Boolean value or weight; This indicates the time (or timestamp) that has elapsed since the file was last accessed; a smaller value indicates that it has been accessed recently. This indicates the file size; the smaller the value, the greater the contribution of this item, thus prioritizing smaller files. , and These are the weighting coefficients for the three indicators mentioned above, used to balance the relative importance of file type, access time, and file size in priority calculation. These coefficients can be preset by the system or adjusted based on user behavior learning.

[0046] This algorithm intelligently calculates the file loading order based on multi-dimensional factors, prioritizing the loading of content that users are most likely to use, thus significantly improving system response speed and user experience.

[0047] In this embodiment, if the user sets audio files as the priority type, the system will load all audio files first, followed by video and image files. This strategy allows users to see and use content of interest more quickly.

[0048] Then, implement the progress visualization and user interaction in step S4. The first step is to display the progress at multiple levels, specifically including: The overall progress display shows the percentage of completion of the entire loading process, calculated based on the ratio of the number of loaded files to the total number of files; The loading progress is displayed separately for different types of files, such as audio, video, and images, including the number of files completed and the number remaining. The real-time status displays information about the specific files currently being loaded, including filename and file type.

[0049] In this embodiment, the interface displays: "Total progress: 45%, Audio files: 300 / 500 completed, Video files: 50 / 200 completed, Currently loading: Holiday_Video.mp4". This detailed progress information allows users to clearly understand the loading status.

[0050] Secondly, based on the aforementioned time prediction algorithm, the system displays an estimate of the remaining loading time to the user. Specifically, the dynamically updated remaining time estimate includes: Based on the time prediction model and the actual loading progress, the display of the remaining loading time is adjusted in real time, and the estimated completion time is recalculated according to the speed of the loaded files. Provide user interaction options, including cancel loading and background loading, to enhance the user's sense of control over the loading process.

[0051] In this embodiment, the system initially displays "Estimated remaining time: 2 minutes and 30 seconds." As loading progresses, the system updates this estimate based on the actual loading speed, potentially adjusting it to "Estimated remaining time: 2 minutes and 10 seconds." "Cancel loading" and "Load in the background" options are also provided to enhance the user's sense of control.

[0052] Then, step S5 is performed to load the media file, including: Media files are loaded in order according to the loading priority strategy, starting with high-priority files and processing them step by step. Monitor for anomalies during loading, including file corruption, read errors, and unexpected device disconnection, and provide clear error messages and handling suggestions to ensure a stable loading process.

[0053] Specifically, during the loading process, the system monitors for various possible anomalies, including file corruption, read errors, and unexpected device disconnection. For each anomaly, the system provides clear error messages and handling suggestions. In this embodiment, when a corrupted video file is encountered, the system displays "File Movie.avi is corrupted, skip loading" and continues processing other files. When a USB device is unexpectedly disconnected, the system saves the information of the loaded files and prompts the user to reconnect the device to continue loading. This intelligent anomaly handling mechanism ensures the stability of the loading process and the continuity of the user experience.

[0054] After all media files are loaded, the loading results are optimized and cached. The first step is to verify and organize the loading results. Step S5 involves verifying the results, including: Perform integrity checks and metadata verification on the loaded media files to ensure that the files can be used normally; For audio files, extract and verify ID3 tag information; for video files, generate preview thumbnails; for image files, generate thumbnail versions of different sizes to optimize file display.

[0055] In this embodiment, for an MP3 file, the system verifies the integrity of its audio stream, extracts metadata such as song title, artist, and album, and marks it as "unknown artist" or "unknown album" when metadata is missing.

[0056] Secondly, to improve the efficiency of subsequent accesses, the system implements an intelligent caching strategy, which includes: Cache file index information, thumbnails, and metadata to improve the efficiency of subsequent accesses; Optimize cached content based on file access frequency, file size, and storage space limitations, prioritizing the caching of frequently accessed files and small-sized files.

[0057] When a previously connected USB device is detected being plugged in again: The device is identified by its device identification information, and cached historical scan data is read. Compare the current file status of the device with cached data to identify newly added, modified, or deleted files; Incremental scanning and loading are performed only on newly added or modified files, and cached data is used to directly display unchanged file information, reducing the time spent on repeated loading.

[0058] In this embodiment, the system prioritizes caching the complete content of audio files smaller than 5MB, while for large video files, it only caches the first 30 seconds of preview footage and thumbnails. The cached data is stored in the system's high-speed storage area. When the user inserts the same USB device again, the system can quickly recognize and use the cached data, significantly reducing reloading time.

[0059] In addition, the method also includes: After loading is complete, collect user feedback data, including the most frequently accessed file types, playback frequency, and operating habits of users; Optimize the time prediction model and loading priority strategy based on feedback data, and use machine learning methods to make the system more intelligent and personalized as usage time increases.

[0060] Specifically, after loading, the system collects user feedback data, including the user's most frequently accessed file types, playback frequency, and operating habits. This data is used to optimize subsequent prediction algorithms and loading strategies. For example, if the system finds that a user has spent 90% of their time playing audio files in the past month, it will automatically increase the priority of audio files during the next loading. Simultaneously, the system records the difference between the actual loading time and the predicted time, continuously improving the accuracy of the time prediction model. This machine learning approach allows the system to become more intelligent and personalized as usage time increases.

[0061] In summary, through the detailed technical solutions described above, this invention achieves intelligent pre-scanning and optimized loading of USB media files, significantly improving user experience and enhancing system usability and user satisfaction. It not only addresses the shortcomings of traditional loading methods but also provides users with a superior user experience through intelligent and personalized design.

[0062] On the other hand, this embodiment also provides a USB media file loading system, such as Figure 2 As shown, it includes: The detection and initialization module is used to detect when a USB storage device is inserted into the system and to initialize the pre-scan process. The fast pre-scan execution module is used to quickly pre-scan USB storage devices. It obtains the metadata information of media files by traversing the file system without reading the file content itself, and counts the number, type and size distribution of media files. The loading time prediction and optimization module is used to build a time prediction model based on pre-scan results and historical loading performance data to estimate loading time and formulate loading priority strategies. The visualization and user interaction module is used to display multi-level progress information, including overall progress, category progress, and real-time status, during the loading process, and dynamically update the remaining time estimate based on the actual loading speed. The results optimization and cache management module is used to load media files according to priority, and perform result verification and cache management after loading is completed.

[0063] It should be noted that the steps in the USB media file loading method provided in this embodiment can be implemented based on the corresponding modules in the USB media file loading system. Those skilled in the art can refer to the technical solution of the system to implement the steps of the method. That is, the embodiments in the system can be understood as preferred examples of implementing the method, and will not be elaborated here.

[0064] This embodiment also provides an electronic device, such as... Figure 3As shown, the electronic device includes a processor 14 and a memory 13. The memory 13 stores machine-executable instructions that can be executed by the processor 14, which executes the machine-executable instructions to implement the above-described audio control method.

[0065] Furthermore, Figure 3 The electronic device shown also includes a bus 12 and a communication interface 11, with the processor 14, the communication interface 11 and the memory 13 connected via the bus 12.

[0066] The memory 13 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 11 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 12 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0067] Processor 14 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 14 or by instructions in software form. Processor 14 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in this embodiment. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this embodiment can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software modules can reside in random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, or other mature storage media in the art. The storage medium is located in memory 13. The processor 14 reads the information in memory 13 and combines it with its hardware to complete the steps of the audio control method.

[0068] This disclosure also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, storing a computer program that, when run on a computer, causes the computer to perform the steps of an audio control method.

[0069] Finally, it should be noted that the above description is only a preferred embodiment of the present invention, and the scope of protection of the present invention is not limited to the above embodiments. All technical solutions falling within the scope of the present invention's concept are within the scope of protection of the present invention. It should be pointed out that for those skilled in the art, any improvements and modifications made without departing from the principle of the present invention should also be considered within the scope of protection of the present invention.

[0070] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

Claims

1. A method for loading USB media files, characterized in that, Includes the following steps: S1: Detects the insertion of a USB storage device into the system and initiates the pre-scan process; S2: Perform a fast pre-scan on the USB storage device, obtain the metadata information of the media files by traversing the file system without reading the file content itself, and count the number, type and size distribution of the media files; S3: Based on the pre-scan results and historical loading performance data, establish a time prediction model to estimate loading time and formulate a loading priority strategy. Establishing the time prediction model further includes: Maintain a historical loading database to record file loading performance data under different conditions, including loading performance data corresponding to file type, file size range, and USB device type; The average loading time for different file types is calculated based on historical data, and the total loading time is estimated by combining the number and type of files in the pre-scan results. By conducting small-scale tests on a subset of media files, the dynamic adjustment time prediction model was loaded to measure the actual reading performance of the current device, and the loading time prediction results were corrected accordingly. S4: Display multi-level progress information during loading, including overall progress, category progress, and real-time status, and dynamically update the remaining time estimate based on the actual loading speed; S5: Load media files according to priority order, and perform result verification and cache management after loading is completed.

2. The USB media file loading method according to claim 1, characterized in that, In step S1, the initialization pre-scan process includes: The device insertion signal is captured through the USB event listening mechanism to obtain basic device information, including device ID, manufacturer information, and storage capacity. Perform file system mounting operations on the USB device and verify the device's access permissions; The pre-scan parameters, including scan depth, file type filter, and scan timeout, are dynamically configured based on device capacity and system performance.

3. The USB media file loading method according to claim 1, characterized in that, In step S2, the fast pre-scan achieves lightweight scanning in the following way: When traversing the file system directory structure, only the basic attribute information and file header identification information of the files are read, and the complete content of the files is not parsed; Quickly identify media files based on file extensions and header information, and record their basic information for classification and statistics, including the number of different types of media files and the total file size; During the pre-scanning process, the remaining scan volume is dynamically estimated based on the ratio of the number of scanned directories to the estimated total number of directories, and the real-time scan progress is fed back to the user.

4. The USB media file loading method according to claim 3, characterized in that, The file system traversal adopts a recursive access to the directory structure, and the recursion level is controlled according to the preset scan depth limit to avoid excessively deep traversal that would lead to excessively long scan time.

5. The USB media file loading method according to claim 1, characterized in that, In step S3, determining the loading priority order further includes: Taking into account factors such as user preferences, file type, file access time, and file size; Prioritize loading media types preferred by the user, recently accessed files, and small files to reduce the waiting time for the user to obtain the target content.

6. The USB media file loading method according to claim 1, characterized in that, Step S4 further includes: Displays the overall loading progress percentage calculated based on the ratio of the number of loaded files to the total number of files, the loading progress of each media type, and information on the specific file currently being processed; Based on the time prediction model and the actual loading progress, the display of the remaining loading time is adjusted in real time, and the estimated completion time is recalculated according to the speed of the loaded files. Provides user interaction options, allowing users to cancel the current loading operation or move the loading process to the background.

7. The USB media file loading method according to claim 1, characterized in that, In step S5, loading the media file includes: Media files are processed sequentially according to the aforementioned priority order; Monitor for anomalies during loading, including file corruption, read errors, and unexpected device disconnection. Provide clear error messages and handling suggestions when an anomaly is detected, and skip the abnormal file to continue processing subsequent files.

8. The USB media file loading method according to claim 1, characterized in that, In step S5, the result verification includes: Perform integrity checks and metadata verification on the loaded media files to ensure that the files can be used normally; For audio files, extract and verify tag information; for video files, generate preview thumbnails; for image files, generate thumbnail versions of different sizes to optimize the display effect of various files.

9. The USB media file loading method according to claim 1, characterized in that, In step S5, the cache management includes: Cache file index information, thumbnails, and metadata to improve the efficiency of subsequent accesses; Optimize cached content based on file access frequency, file size, and storage space limitations, prioritizing the caching of frequently accessed files and small-sized files.

10. The USB media file loading method according to claim 9, characterized in that, When a previously connected USB device is detected being plugged in again: The device is identified by its device identification information, and cached historical scan data is read. Compare the current file status of the device with cached data to identify newly added, modified, or deleted files; Incremental scanning and loading are performed only on newly added or modified files, and cached data is used to directly display unchanged file information, reducing the time spent on repeated loading.

11. The USB media file loading method according to claim 1, characterized in that, The method further includes: After loading is complete, collect user feedback data, including the most frequently accessed file types, playback frequency, and operating habits of users; Based on the collected user data, the parameters of the time prediction model and the loading priority strategy are optimized so that the system can better meet the personalized needs of users as usage time increases.

12. A USB media file loading system, characterized in that, include: The detection and initialization module is used to detect when a USB storage device is inserted into the system and to initialize the pre-scan process. The fast pre-scan execution module is used to quickly pre-scan USB storage devices. It obtains the metadata information of media files by traversing the file system without reading the file content itself, and counts the number, type and size distribution of media files. The loading time prediction and optimization module is used to build a time prediction model based on pre-scan results and historical loading performance data to estimate loading time and formulate loading priority strategies. The building of the time prediction model further includes: Maintain a historical loading database to record file loading performance data under different conditions, including loading performance data corresponding to file type, file size range, and USB device type; The average loading time for different file types is calculated based on historical data, and the total loading time is estimated by combining the number and type of files in the pre-scan results. By conducting small-scale tests on a subset of media files, the dynamic adjustment time prediction model was loaded to measure the actual reading performance of the current device, and the loading time prediction results were corrected accordingly. The visualization and user interaction module is used to display multi-level progress information, including overall progress, category progress, and real-time status, during the loading process, and dynamically update the remaining time estimate based on the actual loading speed. The results optimization and cache management module is used to load media files according to priority, and perform result verification and cache management after loading is completed.

13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the USB media file loading method as described in any one of claims 1-11.

14. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the USB media file loading method as described in any one of claims 1-11.

Citation Information

Patent Citations

  • File scanning method and terminal equipment

    CN114328401A

  • Method for rapidly scanning directory file of USB flash disk

    CN114637725A