File acquisition method and device, storage medium and electronic device

By obtaining and utilizing the target file information of the multimedia file, and directly reading the multimedia file in memory, the problem of low efficiency in reading multimedia files in the prior art is solved, and efficient file reading and encryption and decryption is achieved, which is suitable for Internet of Things devices.

CN119829534APending Publication Date: 2025-04-15QINGDAO HAIER INTELLIGENT HOME APPLIANCE TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411929285.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The efficiency of reading multimedia files in the prior art is low, resulting in large memory resources consumption, slow reading speed, and inconvenient encryption and decryption of multimedia files, which cannot meet the needs of IoT products with tight real-time response and memory resources.

Method used

By obtaining target file information from memory, including file identification, offset address, file length and encrypted compression information, the target multimedia file is read only based on this information in the memory, avoiding directly loading file data into memory.

Benefits of technology

It greatly saves time, improves reading efficiency, solves the problem of low efficiency in reading multimedia files, and supports encryption and decryption of multimedia files, and is suitable for IoT devices with limited memory resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119829534A_ABST
    Figure CN119829534A_ABST
Patent Text Reader

Abstract

The invention discloses a file acquisition method and device, a storage medium and an electronic device, and relates to the technical field of smart home, the file acquisition method comprises the following steps: acquiring target file information from a memory, the target file information comprising target information of each multimedia file stored in the memory, the target information comprises a file identifier, an offset address, a file length and encrypted compression information; the file identifier is used for identifying the multimedia file and has a one-to-one correspondence relationship with the offset address, the file length and the encrypted compression information, the offset address is used for indicating the initial position of the multimedia file in the target storage space of the memory, and the encrypted compression information is used for indicating the encryption and compression conditions of the multimedia file; and reading the target multimedia file in the memory according to the target file information. By the adoption of the scheme, the problem that the efficiency of reading the multimedia file is low is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of smart home technology, and more specifically, to a file acquisition method and device, a storage medium, and an electronic device. Background Art

[0002] At present, with the popularization of storage devices and the development of storage technology, the file size of multimedia files is getting larger and larger, and the forms are becoming more and more diverse.

[0003] In the existing audio storage method, multimedia files are usually stored in the flash memory in the form of original files, which needs to rely on the file system and takes up a large amount of space. A multimedia player is a player that can play a variety of multimedia files. When the multimedia player reads a multimedia file in the flash memory, it needs to first read the fixed data frame of the multimedia file to be read into the memory of the multimedia player, then put it into the decoder for parsing, and finally play it out. In this process, whether reading or parsing the file, it consumes a large amount of memory resources, the file reading speed is relatively slow, the memory space requirement is relatively large, and it is not convenient to encrypt and decrypt the multimedia files, which cannot meet the application of Internet of Things (IOT) products that require real-time response and tight memory resources.

[0004] With regard to the problem of low efficiency in reading multimedia files in the related art, no effective solution has been proposed yet.

[0005] Therefore, it is necessary to improve the related technology to overcome the above-mentioned defects in the related technology. Summary of the invention

[0006] The embodiments of the present application provide a file acquisition method and device, a storage medium, and an electronic device to at least solve the problem of low efficiency in reading multimedia files.

[0007] According to one aspect of an embodiment of the present application, a file acquisition method is provided, comprising: acquiring target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encrypted compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encrypted compression information, the offset address is used to indicate the starting position of the multimedia file in the target storage space in the memory, and the encrypted compression information is used to indicate the encryption and compression status of the multimedia file; and reading the target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0008] In an exemplary embodiment, reading a target multimedia file in the memory according to the target file information includes: when the file identifier of the target multimedia file to be read is the target file identifier, searching the target offset address, target file length, and target encryption compression information corresponding to the target file identifier from the target file information; determining the target file storage address of the target multimedia file in the target storage space according to the target offset address and the target file length; reading target data from the target storage space according to the target file storage address, and processing the target data using the target encryption compression information to obtain the target multimedia file.

[0009] In an exemplary embodiment, the target data is processed using the target encrypted compression information to obtain the target multimedia file, including: determining an encryption algorithm, reference data used in the encryption process, and compression information based on the target encrypted compression information; decrypting the target data using the encryption algorithm and the reference data to obtain intermediate data; and decompressing the intermediate data based on the compression information to obtain the target multimedia file.

[0010] In an exemplary embodiment, the method further includes: in a case where the target file information is not obtained from the memory, sending indication information to the memory, wherein the indication information is used to instruct the memory to determine the target file information of the multimedia file stored in the memory; in a case where response information sent by the memory is obtained, obtaining the target file information from the memory again, wherein the response information is information sent by the memory after successfully determining the target file information of the multimedia file stored in the memory.

[0011] In an exemplary embodiment, after reading the target multimedia file in the memory according to the target file information, the method further includes: determining a file type list, wherein the file types in the file type list are file types of multimedia that the multimedia player allows to play; if the file type of the target multimedia file is not in the file type list, converting the target multimedia file into a multimedia file of the target file type, wherein the target file type is in the file type list.

[0012] In an exemplary embodiment, after reading the target multimedia file in the memory according to the target file information, the method further includes: parsing the target multimedia file by the multimedia player to determine characteristic data of the target multimedia file, wherein the characteristic data includes: bit rate, identifier, sampling rate and number of channels; and playing the target multimedia file based on the characteristic data by the multimedia player.

[0013] In an exemplary embodiment, the method further includes: sending compression reference information to the memory, wherein the compression reference information includes: hardware information of a device using multimedia data, software information of software using multimedia data; and instructing the memory to use the compression reference information to perform compression processing on the multimedia data stored in the memory.

[0014] According to another aspect of an embodiment of the present application, a file acquisition device is provided, comprising: an acquisition module, used to acquire target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encrypted compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encrypted compression information, the offset address is used to indicate the starting position of the multimedia file in the target storage space in the memory, and the encrypted compression information is used to indicate the encryption and compression status of the multimedia file; a reading module, used to read the target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0015] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein the computer program is configured to execute the above-mentioned file acquisition method when running.

[0016] According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, wherein the processor is configured to execute the above-mentioned file acquisition method through the computer program.

[0017] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and the computer program performs the above-mentioned file acquisition method when executed by a processor.

[0018] Through the present application, since in the process of reading files, only the target file information in the memory is read, and the target file information includes the identification, offset address, file length and encryption compression information of each multimedia file stored in the memory, the target multimedia file can be read in the memory only according to the target file information, avoiding the fixed data frame of the target multimedia file being read directly into the memory of the player, greatly saving time and improving efficiency, thereby solving the problem of low efficiency in reading multimedia files. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0020] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0021] Figure 1 is a schematic diagram of a hardware environment of a file acquisition method according to an embodiment of the present application;

[0022] Figure 2 is a flow chart of a file acquisition method according to an embodiment of the present application;

[0023] Figure 3 is a schematic diagram of a storage method of a multimedia file according to an embodiment of the present application;

[0024] Figure 4 is a schematic diagram of a storage format of a multimedia file according to an embodiment of the present application;

[0025] Figure 5 is a schematic diagram of a process of reading a multimedia file according to an embodiment of the present application;

[0026] Figure 6 It is a structural block diagram of a file acquisition device according to an embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] According to one aspect of an embodiment of the present application, a file acquisition method is provided. The file acquisition method is widely used in smart home (Smart Home), smart home, smart home device ecology, smart house (IntelligenceHouse) ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the above-mentioned file acquisition method can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1 As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.

[0030] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.

[0031] In order to solve the above problems, a file acquisition method is provided in this embodiment, including but not limited to being applied to the whole house intelligent digital control application scenario. Figure 2 : is a flowchart of a file acquisition method according to an embodiment of the present application, the process includes the following steps S202-S204:

[0032] Step S202: acquiring target file information from the memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression conditions of the multimedia file;

[0033] Optionally, the execution subject of the embodiment of the present application is a multimedia player.

[0034] Optionally, Figure 3 The diagram illustrates the storage method of multimedia files in the target storage space of the memory. The target storage space of the memory stores not only target file information (Header) but also multiple multimedia files. The target file information includes target information of all multimedia files in the target storage space. Each multimedia file has a file identifier (index), an offset address (Offset), a file length (Length), and encrypted compression information (type). Different multimedia files have different file identifiers. When reading a required multimedia file, the file identifiers of all multimedia files recorded in the target file information are traversed according to the file identifier of the multimedia file to be read. Different multimedia files are stored in different locations in the target storage space, that is, different offset addresses. When the file identifier of the multimedia file to be read is found in the target file information, the offset address, file length and encrypted compression information corresponding to the file identifier are obtained.

[0035] Alternatively, if Figure 4As shown, taking the target file information recording the target information of four multimedia files as an example, the file identifier of the first multimedia file among the four multimedia files is 1, the file identifier of the second multimedia file is 2, the file identifier of the third multimedia file is 3, and the file identifier of the fourth multimedia file is 4, wherein the offset address corresponding to the multimedia file with the file identifier 1 is 1000, the length is 1000, and the compression encryption information is 0, that is, the multimedia file with the file identifier 1 is compressed but not encrypted; the offset address corresponding to the multimedia file with the file identifier 3 is 4500, the length is 1500, and the compression encryption type is 0, that is, the multimedia file with the file identifier 3 is compressed but not encrypted.

[0036] Optionally, when the encryption compression information corresponding to the multimedia file with file identification 1 is 1, the multimedia file with file identification 1 is compressed, and the multimedia file with file identification 1 is encrypted using the first preset encryption algorithm among the preset encryption algorithms; when the encryption compression information corresponding to the multimedia file with file identification 1 is 2, the multimedia file with file identification 1 is compressed, and the multimedia file with file identification 1 is encrypted using the second preset encryption algorithm among the preset encryption algorithms.

[0037] Optionally, the preset encryption algorithm includes but is not limited to: Advanced Encryption Standard (AES), asymmetric encryption algorithm (such as Rivest-Shamir-Adleman, RSA), and Data Encryption Standard (DES).

[0038] It should be noted that, when executing the embodiment of the present application, the file identifier of the multimedia file may not indicate the sequential relationship of multiple multimedia files in the target storage space, but is only used to identify different multimedia files.

[0039] It should be noted that if Figure 3 As shown, multiple multimedia files are compactly stored in the target storage space. By adopting a compact storage solution, the storage space can be used more efficiently and the storage cost can be reduced.

[0040] Step S204: reading a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0041] Optionally, after obtaining the target file information, the multimedia player or system can directly read the target multimedia file from the memory according to the target file information, that is, can directly access the location indicated by the offset address in the target storage space and read the number of bytes specified by the file length without loading the entire file. If the encryption compression information indicates that the file has been compressed, the system will apply an appropriate decompression algorithm; if the file is encrypted, the system will apply a decryption algorithm.

[0042] It should be noted that, through the above steps, the multimedia player can directly locate the storage location of the file in the memory without traversing the entire target storage space, thereby greatly reducing the time for file reading and improving the real-time performance of playback. At the same time, it allows the player and decoder to read and process data directly in the memory, avoiding the need to load the entire file into the memory, significantly improving the efficiency of storage and reading, which is particularly important for devices with limited memory resources (such as IoT devices), and can significantly reduce memory usage. In addition, by using encryption processing when storing files, even if the storage medium is physically stolen or the data is illegally accessed, the multimedia content can be protected from being easily decrypted and used, thereby improving data security. In the process of encryption processing, by defining the encryption compression information of the file, different compression and encryption algorithms can be flexibly selected. After actual use, the encryption and compression methods can be easily adjusted according to changes in real-time security and efficiency requirements, and it has good scalability and adaptability.

[0043] In the above steps, since only the target file information in the memory is read during the file reading process, the target file information includes the identification, offset address, file length and encryption compression information of each multimedia file stored in the memory. The target multimedia file can be read in the memory only according to the target file information, avoiding the fixed data frame of the target multimedia file being directly read into the memory of the player, greatly saving time and improving efficiency, thereby solving the problem of low efficiency in reading multimedia files.

[0044] In an exemplary embodiment, reading the target multimedia file in the memory according to the target file information can be implemented by the following steps S11-S13:

[0045] Step S11: when the file identifier of the target multimedia file to be read is a target file identifier, searching the target offset address, target file length, and target encryption compression information corresponding to the target file identifier from the target file information;

[0046] Optionally, first, the system determines the file identifier of the multimedia file to be read, that is, the target file identifier, and then the system retrieves the target offset address and the target file length corresponding to the target file identifier from the target file information, and these two items of information are used to determine the specific location and data volume of the target multimedia file in the target storage space in the memory. At the same time, the system also reads the target encryption compression information to understand whether the file is compressed and / or encrypted, and the specific compression and encryption algorithms used.

[0047] Step S12: determining a target file storage address of the target multimedia file in the target storage space according to the target offset address and the target file length;

[0048] Optionally, after obtaining the target offset address and the target file length, the system can accurately determine the storage address range of the target multimedia file in the target storage space. The target offset address indicates the starting position of the target multimedia file in the target storage space, and the target file length defines the amount of data to be read from this position. Combining these two parameters, the system can calculate the actual read address range, thereby avoiding reading irrelevant data and improving reading efficiency.

[0049] Step S13: Reading target data from the target storage space according to the target file storage address, and processing the target data using the target encryption compression information to obtain the target multimedia file.

[0050] Optionally, after determining the storage address of the target file, the system can directly read the data at the specified location, i.e., the target data, from the target storage space. If the target encrypted compression information indicates that the data has been compressed, the system will use the corresponding decompression algorithm to restore the data to its original format. If the data is also encrypted, the system will first decrypt the data, then decompress it (if decompression is required), and finally obtain the target multimedia file that can be played. This process avoids the overhead of reading and processing of traditional file systems, and operates directly in the memory, thereby greatly improving the reading speed and reducing memory usage.

[0051] Alternatively, if Figure 4 As shown in the figure, when the file identifier of the target multimedia file is 1, the corresponding offset address is 1000, the length is 1000, and the compression encryption information is 0 (compressed but not encrypted), the steps of reading the target multimedia file are as follows: the system directly reads the data starting from address 1000 in the target storage space, and the read length is 1000 bytes. Because the file is compressed, the read data is the compressed target data, and then the target data is decompressed to obtain the target multimedia file.

[0052] In an exemplary embodiment, the target data is processed using the target encrypted compressed information to obtain the target multimedia file, which can be achieved by the following steps S21-S23:

[0053] Step S21: determining an encryption algorithm, reference data used in the encryption process, and compression information according to the target encrypted compression information;

[0054] Optionally, step S21 is the initialization phase of the decryption and decompression process. The system first checks the target encrypted compressed information, from which the system determines the algorithm used for encryption (e.g., AES, RSA, etc.), reference data that may be used in the encryption process (e.g., keys, initialization vectors, etc.), and compression information (e.g., the compression algorithm used, such as Huffman coding, etc.).

[0055] Step S22: decrypting the target data using the encryption algorithm and the reference data to obtain intermediate data;

[0056] Optionally, after obtaining the encryption algorithm and reference data, the system uses this information to perform a decryption operation on the read target data. Decryption is a reverse encryption process that requires the use of the same algorithm and corresponding key (or reference data) to restore the encrypted data to its original unencrypted state. The decrypted data is called intermediate data because they may still be in a compressed state and require further processing to be fully restored to the original format of the multimedia file.

[0057] Step S23: decompressing the intermediate data based on the compression information to obtain the target multimedia file.

[0058] Optionally, the system uses the compression information obtained from the target encrypted compressed information to decompress the intermediate data, and uses a decompression algorithm to reverse the compression method used when storing it, and restore the intermediate data to its original size and format. After decompression, the system obtains a fully playable, unencrypted and uncompressed target multimedia file, which can then be directly parsed and played.

[0059] It should be noted that, through the above steps, encrypted and compressed multimedia files stored on resource-constrained devices can be processed. By first identifying the encrypted and compressed information, then decrypting the data, and finally decompressing the data, the system can efficiently and accurately restore the content of the multimedia file while ensuring data security and efficient use of storage space.

[0060] In an exemplary embodiment, the method further comprises the following steps S31-S32:

[0061] Step S31: in the case where the target file information is not obtained from the memory, sending indication information to the memory, wherein the indication information is used to instruct the memory to determine the target file information of the multimedia file stored in the memory;

[0062] Optionally, when the system attempts to read a multimedia file but cannot find necessary target file information (such as offset address, file length, and encryption compression information), the system sends an indication message to the memory, which tells the memory that it needs to perform a self-scan or analysis to construct or update the target information of the multimedia file.

[0063] Step S32: when the response information sent by the memory is obtained, the target file information is obtained from the memory again, wherein the response information is information sent by the memory after successfully determining the target file information of the multimedia file stored in the memory.

[0064] Optionally, when the memory receives the indication information and successfully reconstructs or determines the target file information of the multimedia file, it will send a response message to the system, indicating that the target file information update has been completed. After receiving the response message, the system will try to obtain the target file information from the memory again. At this time, the information obtained will be the target information of the multimedia file newly generated or updated by the memory, and the system will search for the target information corresponding to the target multimedia file in the updated target file information.

[0065] It should be noted that, through the above steps, it is ensured that even when the target file information is missing, the system can read and process the multimedia file through dynamic updates. This enhances the adaptability of the system in the face of unexpected situations, especially in scenarios where the file system is damaged or the target information of the multimedia file is not correctly initialized. Through the self-management capability of the memory, the system can maintain its normal functions without external intervention or reprogramming.

[0066] In an exemplary embodiment, the method further includes the following steps: when the target file information is obtained but the file identifier of the target multimedia file is not found in the obtained target file information, sending indication information to the memory, wherein the indication information is used to instruct the memory to determine the target file information of the multimedia file stored in the memory.

[0067] It should be noted that through the above steps, the system can detect the incompleteness of multimedia file information in the memory and actively trigger the information update. This means that even if new multimedia files are added or the information of multimedia files is changed, the system can ensure the latest and accuracy of the information through the self-update mechanism of the memory; the updated target file information will contain the complete identifiers of all multimedia files, so that the system can quickly locate when searching for a specific file, avoiding the need to traverse the entire storage space to find multimedia files, thereby significantly improving the search speed and reading efficiency; the process of instructing the memory to update the target file information also ensures that the metadata of the multimedia file can still be correctly maintained and restored even after the system is restarted or powered off, enhancing the security and integrity of the data. For encrypted or compressed stored multimedia files, this feature is even more critical because it ensures that the system can correctly decrypt and decompress the data during subsequent reading and processing; in addition, by requiring the memory to update its internal target file information, the system can more effectively manage and access multimedia files stored in resource-constrained environments. This is particularly important for hardware such as IoT devices and embedded systems, because the storage and computing resources of these devices are limited and need to be efficiently utilized and managed.

[0068] In an exemplary embodiment, after reading the target multimedia file in the memory according to the target file information, the method further includes the following steps S41-S42:

[0069] Step S41: determining a file type list, wherein the file types in the file type list are file types of multimedia that the multimedia player is allowed to play;

[0070] Optionally, in the system, a file type list is first established, which includes multimedia file types that can be recognized and played by the multimedia player. The file type list includes, but is not limited to, audio formats such as MPEG-1 Audio Layer Part 3 or MPEG-2 Audio Layer Part 3 (i.e., MP3), Waveform Audio File Format (WAV), Advanced Audio Coding (AAC), Free Lossless Audio Codec (FLAC), and video formats such as MPEG-4 Part 14 or MPEG-4 AVC / H.264 (MP4), Audio Video Interleave (AVI), and Motion Picture Experts Group (MPEG).

[0071] Step S42: when the file type of the target multimedia file is not in the file type list, converting the target multimedia file into a multimedia file of a target file type, wherein the target file type is in the file type list.

[0072] Optionally, if the system detects that the file type of the target multimedia file is not in the list of file types allowed by the player, the system will automatically perform file type conversion to convert the file type of the target multimedia file to a format supported by the player. For example, if there are only MP3 and WAV in the file type list, but the target file is a FLAC audio file, the system will automatically convert the FLAC file to MP3 or WAV format so that the player can play it normally.

[0073] It should be noted that the above steps ensure that the multimedia player can play all types of multimedia files, even if their original formats are not in the default support list of the player. Through this automatic file type conversion, the flexibility and multimedia processing capabilities of the system are enhanced, the playback failure caused by incompatible file formats is avoided, and the user experience is improved.

[0074] In an exemplary embodiment, after reading the target multimedia file in the memory according to the target file information, the method further includes the following steps S51-S52:

[0075] Step S51: parsing the target multimedia file through the multimedia player to determine feature data of the target multimedia file, wherein the feature data includes: bit rate, identifier, sampling rate and number of channels;

[0076] Optionally, after acquiring the target multimedia file, the audio decoder in the multimedia player will further parse the target multimedia file. The decoder parses the bit rate, identifier, sampling rate and number of channels of the target multimedia file according to the format of the audio data (such as MP3), thereby obtaining a playable audio stream corresponding to the target multimedia file.

[0077] Step S52: Play the target multimedia file based on the characteristic data through the multimedia player.

[0078] Optionally, after parsing and obtaining the characteristic data of the target multimedia file, the multimedia player will use this information to configure the playback parameters to adapt to the characteristics of the file. For example, the multimedia player will adjust the reading speed of the data stream according to the bit rate, set the audio playback parameters according to the sampling rate and the number of channels, and identify and use the correct decoder according to the identifier.

[0079] It should be noted that, through the above steps, the system can not only understand the structure and characteristics of multimedia files, but also perform intelligent playback configuration based on this information, ensuring smooth playback and optimization of audio and video quality.

[0080] In an exemplary embodiment, the method further includes the following steps S71-S72:

[0081] Step S71: Sending compression reference information to the memory, wherein the compression reference information includes: hardware information of a device using multimedia data, and software information of software using multimedia data;

[0082] Optionally, the multimedia data includes the multimedia file.

[0083] Optionally, hardware information includes the device's processor type, memory size, storage capacity, decoding capabilities, etc., which are critical to determining the complexity of the compression algorithm and the compression ratio that can be achieved. Software information includes the version of the multimedia player, supported encoding formats, decoder performance, etc., which helps determine whether the compression format is compatible with the player and the efficiency of the player in processing compressed data.

[0084] Step S72: instruct the memory to use the compression reference information to perform compression processing on the multimedia data stored in the memory.

[0085] Optionally, based on the compression reference information collected in step S71, the system will instruct the memory to perform targeted compression processing on the multimedia data therein. This means that the compression algorithm will be adjusted according to the hardware performance of the device and the compatibility of the software to achieve the best compression effect, while ensuring that the data can be smoothly decompressed and played on the target device. For example, if the device has a low processor performance but a large memory, the compression algorithm may choose a compression method with low computational complexity but occupies more memory; conversely, if the device has limited memory but a powerful processor, the compression algorithm may choose a computationally intensive solution but with less memory usage. In addition, if the playback software supports a specific compression format, the compression process will give priority to that format to ensure smooth decoding and playback of the data.

[0086] It should be noted that the above steps constitute a dynamic multimedia data compression process, which can optimize the compression parameters according to the hardware and software characteristics of the receiving device, so as to find the best balance between storage and transmission efficiency and playback quality. This intelligent compression method is particularly important for resource-constrained devices, such as mobile devices or IoT devices, because it can help reduce data storage requirements while maintaining the smoothness of user experience and the high quality of multimedia content.

[0087] In an exemplary embodiment, the method further includes the following steps: instructing the memory to record a designated file identifier in the target file information whose access times exceed a preset threshold; and pre-storing the multimedia file with the designated file identifier in the local cache.

[0088] Obviously, the above described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. In order to better understand the above method, the above process is described below in combination with the embodiments, but it is not used to limit the technical solution of the embodiments of the present invention. Specifically, take reading one of the multimedia files, that is, the audio file, as an example:

[0089] In the embodiments of the present application, a compact storage solution is firstly adopted, which greatly reduces the storage space, greatly reduces the reading and parsing time of files, increases the real-time performance of audio playback, and can adopt compression and encryption and decryption to improve the security of files.

[0090] 1. The sorting process is as follows:

[0091] 1. Store the MP3 files used by audio files (such as doorbells used by door lock devices) in the flash memory of the product according to the audio compression storage algorithm;

[0092] 2. When the player plays the audio file, it searches the header file of the compressed file (i.e. the target file information) to find the storage address of the specified audio file;

[0093] 3. Directly decode the audio file and play it through a digital-to-analog converter (DAC).

[0094] 2. Audio file storage solution:

[0095] Figure 3 An optional way of storing audio files is shown as follows:

[0096] 1. The audio file includes an audio header file and an audio entity file. The audio file header file (i.e., the target file information) includes an audio number (i.e., the file identifier), an audio offset address (pointing to the actual storage address of the audio), a total audio length (for decoder decoding), and an audio compression type (i.e., the encryption compression information, for extended data compression and encryption).

[0097] 2. The actual stored audio files are Figure 4For example, if the audio with audio number 1 is played, the corresponding audio offset is 1000, the length is 1000, and the compression encryption type is 0 (compressed but not encrypted). If the audio with audio number 3 is read, the corresponding offset is 4500, the length is 1500, and the compression encryption type is 0 (compressed but not encrypted).

[0098] 3. Audio file reading and parsing process:

[0099] like Figure 5 As shown, the player will retrieve the actual address where the real audio file (MP3 file) is stored through the header file of the compressed file. The player will then parse the real audio file based on its actual storage address and the compression encryption method. Finally, the audio player will parse the bit rate, identifier, sampling rate, number of channels, etc. of the audio file and play it.

[0100] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, or network device, etc.) to execute the methods of each embodiment of the present application.

[0101] In this embodiment, a file acquisition device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0102] Figure 6 : is a structural block diagram of a file acquisition device according to an embodiment of the present application, the device comprising:

[0103] The acquisition module 62 is used to acquire target file information from the memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: file identifier, offset address, file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate the starting position of the multimedia file in the target storage space in the memory, and the encryption and compression information is used to indicate the encryption and compression status of the multimedia file;

[0104] The reading module 64 is configured to read a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0105] The above-mentioned device only reads the target file information in the memory during the process of reading the file. The target file information includes the identification, offset address, file length and encryption compression information of each multimedia file stored in the memory. The target multimedia file can be read in the memory only according to the target file information, avoiding the fixed data frame of the target multimedia file being directly read into the memory of the player, greatly saving time and improving efficiency, thereby solving the problem of low efficiency in reading multimedia files.

[0106] In an exemplary embodiment, the reading module 64 is also used to, when the file identifier of the target multimedia file to be read is the target file identifier, search for the target offset address, target file length, and target encryption compression information corresponding to the target file identifier from the target file information; determine the target file storage address of the target multimedia file in the target storage space according to the target offset address and the target file length; read the target data from the target storage space according to the target file storage address, and process the target data using the target encryption compression information to obtain the target multimedia file.

[0107] In an exemplary embodiment, the reading module 64 is also used to determine the encryption algorithm, reference data and compression information used in the encryption process according to the target encrypted compression information; use the encryption algorithm and the reference data to decrypt the target data to obtain intermediate data; and decompress the intermediate data based on the compression information to obtain the target multimedia file.

[0108] In an exemplary embodiment, the above-mentioned device also includes: a sending module, which is used to send indication information to the memory when the target file information is not obtained from the memory, wherein the indication information is used to instruct the memory to determine the target file information of the multimedia file stored in the memory; an acquisition module 62, which is also used to acquire the target file information from the memory again when response information sent by the memory is acquired, wherein the response information is information sent by the memory after successfully determining the target file information of the multimedia file stored in the memory.

[0109] In an exemplary embodiment, the above-mentioned device also includes: a determination module, which is used to determine a file type list after reading the target multimedia file in the memory according to the target file information, wherein the file types in the file type list are file types of multimedia allowed to be played by the multimedia player; the above-mentioned device also includes: a conversion module, which is used to convert the target multimedia file into a multimedia file of a target file type when the file type of the target multimedia file is not in the file type list, wherein the target file type is in the file type list.

[0110] In an exemplary embodiment, the above-mentioned device also includes: a playback module, which is used to parse the target multimedia file through the multimedia player after reading the target multimedia file in the memory according to the target file information, and determine the characteristic data of the target multimedia file, wherein the characteristic data includes: bit rate, identifier, sampling rate and number of channels; and play the target multimedia file based on the characteristic data through the multimedia player.

[0111] In an exemplary embodiment, the sending module is also used to send compression reference information to the memory, wherein the compression reference information includes: hardware information of a device using multimedia data, software information of software using multimedia data; and instruct the memory to use the compression reference information to compress the multimedia data stored in the memory.

[0112] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium includes a stored program, wherein the computer program is configured to execute the above-mentioned file acquisition method when running.

[0113] Optionally, in this embodiment, the storage medium may be configured to store a computer program for performing the following steps:

[0114] S1, obtaining target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression status of the multimedia file;

[0115] S2: Read a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0116] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0117] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0118] An embodiment of the present application further provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, wherein the processor is configured to execute the above-mentioned file acquisition method through the computer program.

[0119] Optionally, in this embodiment, the electronic device may be configured to perform the following steps through a computer program:

[0120] S1, obtaining target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression status of the multimedia file;

[0121] S2: Read a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0122] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0123] According to another aspect of the embodiments of the present application, a computer program product is provided, including a computer program, and the computer program performs the above-mentioned file acquisition method when executed by a processor.

[0124] Optionally, in this embodiment, the computer program product may be configured to perform the following steps through a computer program:

[0125] S1, obtaining target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression status of the multimedia file;

[0126] S2: Read a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

[0127] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0128] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0129] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A file acquisition method, characterized in that: include: Acquire target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression conditions of the multimedia file; A target multimedia file is read in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

2. The method according to claim 1, characterized in that Reading a target multimedia file in the memory according to the target file information includes: In a case where the file identifier of the target multimedia file to be read is a target file identifier, searching the target offset address, the target file length, and the target encryption compression information corresponding to the target file identifier from the target file information; Determine a target file storage address of the target multimedia file in the target storage space according to the target offset address and the target file length; The target data is read from the target storage space according to the target file storage address, and the target data is processed using the target encryption compression information to obtain the target multimedia file.

3. The method according to claim 2, characterized in that The target data is processed using the target encrypted compressed information to obtain the target multimedia file, including: Determining an encryption algorithm, reference data used in the encryption process, and compression information according to the target encrypted compression information; Decrypt the target data using the encryption algorithm and the reference data to obtain intermediate data; The intermediate data is decompressed based on the compression information to obtain the target multimedia file.

4. The method according to claim 1, characterized in that The method further comprises: In the case where the target file information is not obtained from the memory, sending indication information to the memory, wherein the indication information is used to instruct the memory to determine the target file information of the multimedia file stored in the memory; In case of obtaining the response information sent by the memory, the target file information is obtained from the memory again, wherein the response information is information sent by the memory after successfully determining the target file information of the multimedia file stored in the memory.

5. The method according to claim 1, characterized in that After reading the target multimedia file in the memory according to the target file information, the method further includes: Determine a file type list, wherein the file types in the file type list are file types of multimedia that the multimedia player is allowed to play; In a case where the file type of the target multimedia file is not in the file type list, the target multimedia file is converted into a multimedia file of a target file type, wherein the target file type is in the file type list.

6. The method according to claim 1, characterized in that After reading the target multimedia file in the memory according to the target file information, the method further includes: The target multimedia file is parsed by the multimedia player to determine feature data of the target multimedia file, wherein the feature data includes: bit rate, identifier, sampling rate and number of channels; the target multimedia file is parsed by the multimedia player based on the feature data The target multimedia file is played according to the characteristic data.

7. The method according to claim 1, characterized in that The method further comprises: Sending compressed reference information to the memory, wherein the compressed reference information includes: hardware information of a device using the multimedia data, and software information of software using the multimedia data; The memory is instructed to use the compression reference information to perform compression processing on the multimedia data stored in the memory.

8. A file acquisition device, characterized in that: include: an acquisition module, configured to acquire target file information from a memory, wherein the target file information includes target information of each multimedia file stored in the memory, and the target information includes: a file identifier, an offset address, a file length, and encryption and compression information; the file identifier is used to identify the multimedia file, and has a one-to-one correspondence with the offset address, the file length, and the encryption and compression information; the offset address is used to indicate a starting position of the multimedia file in a target storage space in the memory, and the encryption and compression information is used to indicate encryption and compression conditions of the multimedia file; A reading module is used to read a target multimedia file in the memory according to the target file information, wherein the multimedia files stored in the memory include the target multimedia file.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 7 when executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.