CN113986849A - Music caching method and device, electronic equipment and storage medium - Google Patents

Music caching method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113986849A
CN113986849A CN202111246764.5A CN202111246764A CN113986849A CN 113986849 A CN113986849 A CN 113986849A CN 202111246764 A CN202111246764 A CN 202111246764A CN 113986849 A CN113986849 A CN 113986849A
Authority
CN
China
Prior art keywords
music
caching
playing
target music
cache
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111246764.5A
Other languages
Chinese (zh)
Inventor
王利伟
高洪伟
吕贵林
陈涛
李颖慧
范莉娟
梁婷
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
FAW Group Corp
Original Assignee
FAW Group Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by FAW Group Corp filed Critical FAW Group Corp
Priority to CN202111246764.5A priority Critical patent/CN113986849A/en
Publication of CN113986849A publication Critical patent/CN113986849A/en
Priority to PCT/CN2022/127239 priority patent/WO2023072028A1/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/172Caching, prefetching or hoarding of files
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/10527Audio or video recording; Data buffering arrangements
    • G11B2020/1062Data buffering arrangements, e.g. recording or playback buffers

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Electrophonic Musical Instruments (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

The embodiment of the invention discloses a music caching method, a music caching device, electronic equipment and a storage medium, wherein the method comprises the following steps: when a music playing instruction is received, determining whether target music corresponding to the music playing instruction exists in a cache list or not; if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music; and caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music. Through the technical scheme of the embodiment of the invention, the technical effects of playing and caching the target music simultaneously and saving the flow and the cache space are achieved.

Description

Music caching method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of music playing, in particular to a music caching method and device, electronic equipment and a storage medium.
Background
The car networking service gradually enters the life of users, and the vehicle-mounted entertainment system is a medium for providing service for the users, provides vehicle-mounted hearing experience for the users, and meets the music listening requirement in the driving process.
At present, the mode that a vehicle-mounted entertainment system plays music through an external USB flash disk cannot meet the requirements of users on rich and high-quality music, and network music is gradually applied to vehicle-mounted scenes. However, the network music may involve the problems of traffic consumption during the loading process, cache storage after loading, and the like. In the current 4G network state, the peak value of the network speed can reach 100Mbps, i.e. the transmission speed per second is 12.5MB, and if 10MB of music is cached, the whole music can be cached in 1 s. In a 5G network, the speed is faster.
However, the traffic of the in-vehicle entertainment system is less than that of the mobile intelligent device, and the buffer space is relatively small. If the whole song is cached every time the user clicks to play, when the user performs operations such as song cutting, the waste of flow and the waste of resources of a cache space can be caused.
Disclosure of Invention
The embodiment of the invention provides a music caching method and device, electronic equipment and a storage medium, which are used for realizing the technical effects of playing and caching target music simultaneously and saving flow and cache space.
In a first aspect, an embodiment of the present invention provides a music caching method, where the method includes:
when a music playing instruction is received, determining whether target music corresponding to the music playing instruction exists in a cache list or not;
if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music;
and caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music.
In a second aspect, an embodiment of the present invention further provides a music caching apparatus, where the apparatus includes:
the cache judging module is used for determining whether the target music corresponding to the music playing instruction exists in a cache list or not when the music playing instruction is received;
the initial caching module is used for caching the target music according to a preset initial caching proportion corresponding to the target music and playing the cached target music if the target music is not cached;
and the subsequent caching module is used for caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music.
In a third aspect, an embodiment of the present invention further provides an electronic device, where the electronic device includes:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the music caching method according to any one of the embodiments of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the music caching method according to any one of the embodiments of the present invention.
According to the technical scheme of the embodiment of the invention, when the music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list is determined; if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music; according to the current playing progress, the current cached proportion and the preset subsequent caching proportion of the target music, the target music is cached, the problem that the whole song is cached after being played every time when clicking is solved, and the storage space and the flow are wasted due to the fact that caching can not be conducted according to the listening condition of a user is solved, the technical effects that the target music is played and cached simultaneously, and the flow and the caching space are used are achieved.
Drawings
In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, a brief description is given below of the drawings used in describing the embodiments. It should be clear that the described figures are only views of some of the embodiments of the invention to be described, not all, and that for a person skilled in the art, other figures can be derived from these figures without inventive effort.
Fig. 1 is a flowchart illustrating a music caching method according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a music caching method according to a second embodiment of the present invention;
fig. 3 is a schematic structural diagram of a music cache system according to a third embodiment of the present invention;
fig. 4 is a flowchart illustrating a music caching method according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of a music cache apparatus according to a fourth embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a music caching method according to an embodiment of the present invention, where the embodiment is applicable to a situation where music is cached during music playing, and the method may be executed by a music caching apparatus, where the apparatus may be implemented in a form of software and/or hardware, and the hardware may be an electronic device, and optionally, the electronic device may be a mobile terminal, a vehicle-mounted terminal, and the like.
As shown in fig. 1, the method of this embodiment specifically includes the following steps:
s110, when the music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list or not is determined.
The music playing instruction may be an instruction to play music. The target music may be music that is currently desired to be played. The cache list may be a list of music compositions corresponding to respective cached data.
Specifically, when a music playing instruction is received, the music playing instruction is analyzed to determine target music contained in the music playing instruction. And searching whether the target music exists in the cache list to determine whether cached data corresponding to the target music exists in the cache space.
Optionally, when the user wants to play the target music, the user may trigger the target music by selecting a triggering manner, and generate a music playing instruction corresponding to the target music.
And S120, if not, caching the target music according to the preset initial caching ratio corresponding to the target music, and playing the cached target music.
The preset initial cache proportion may be a preset cache proportion, for example: 10% or 20% of the target music, etc., can be adjusted according to actual requirements.
Specifically, if the target music does not exist in the cache list, it indicates that cached data corresponding to the target music is not stored in the cache space, and caching is required. At this time, the target music may be primarily cached according to a preset initial caching ratio corresponding to the target music, and the target music may be played according to the cached data.
And S130, caching the target music according to the current playing progress, the current cached proportion and the preset subsequent caching proportion of the target music.
Wherein, the current playing progress can be the current playing proportion of the target music. The current cached proportion may be a proportion of the target music occupied by the current cached data. The preset subsequent caching ratio may be a ratio of target music that can be cached in a next stage.
Specifically, in the process of playing the target music, the current playing progress of the target music is obtained, and the current cache proportion is determined. And then, when the current playing progress reaches the condition of continuing caching, caching with a preset subsequent caching ratio according to the current cached ratio.
For example, when the current playing progress of the target music reaches the preset progress, it may indicate that there is a need to continue to cache the target music. At this time, the current cached proportion may be determined, and it may be determined whether the current cached proportion reaches the preset initial cached proportion. If so, continuing to perform the next target music caching with the preset subsequent caching proportion based on the preset initial caching proportion. If not, caching to a preset initial caching ratio based on the current cached ratio, and then continuing caching to preset a subsequent caching ratio, or caching to the preset initial caching ratio based on the current cached ratio, and meanwhile caching according to the preset subsequent caching ratio based on the preset initial caching ratio, namely caching simultaneously.
On the basis of the above embodiment, after determining whether the target music corresponding to the music playing instruction already exists in the cache list, the method further includes: and if so, playing according to the target music in the cache list.
Specifically, if the target music exists in the cache list, it indicates that cached data corresponding to the stored target music exists in the cache space, and caching is not required. At this time, the cached data corresponding to the target music in the cache space according to the target music in the cache list may be retrieved and played.
According to the technical scheme of the embodiment of the invention, when the music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list is determined; if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music; according to the current playing progress, the current cached proportion and the preset subsequent caching proportion of the target music, the target music is cached, the problem that the whole song is cached after being played every time when clicking is solved, and the storage space and the flow are wasted due to the fact that caching can not be conducted according to the listening condition of a user is solved, the technical effects that the target music is played and cached simultaneously, and the flow and the caching space are used are achieved.
Example two
Fig. 2 is a schematic flow chart of a music caching method according to a second embodiment of the present invention, and reference may be made to the technical solution of this embodiment for a subsequent caching manner and a caching manner during song cutting based on the above embodiments. The same or corresponding terms as those in the above embodiments are not explained in detail herein.
As shown in fig. 2, the method of this embodiment specifically includes the following steps:
s210, when a music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list or not is determined.
And S220, if not, caching the target music according to the preset initial caching ratio corresponding to the target music, and playing the cached target music.
And S230, if the difference value between the current cached proportion and the current playing progress reaches a preset subsequent caching threshold value, determining a caching starting point according to the current cached proportion, and caching the target music according to the caching starting point and the preset subsequent caching proportion.
The preset subsequent buffer threshold may be a preset value for triggering the next buffer. The cache start point may be a cache start position at which a subsequent cache ratio is preset.
Specifically, if the difference between the current cached proportion and the current playing progress reaches a preset subsequent caching threshold, determining a caching start point corresponding to the current cached proportion. And then, caching is carried out from the caching starting point, and the caching proportion is the preset subsequent caching proportion.
It should be noted that, when performing subsequent caching for the first time, the preset initial caching ratio may be determined as the caching start point. When subsequent caching is performed for the second time and after the second time, the corresponding preset initial caching proportion and the preset subsequent caching proportion can be determined according to the current cached proportion, and the caching starting point is determined.
Illustratively, the initial cache proportion is preset to be 20%, and the subsequent cache proportion is preset to be 10%. If the current cached proportion is 20% when the difference between the current cached proportion and the current playing progress reaches the preset subsequent caching threshold, the preset initial caching proportion of 20% can be used as the caching starting point. If the current cached proportion is 50% when the difference between the current cached proportion and the current playing progress reaches the preset subsequent caching threshold, the caching starting point can be determined to be 50%, namely 20% +3 × 10%. If the current cached proportion does not reach the cache starting point, the cache starting point corresponding to the current cached proportion can be determined. For example, if the current cached proportion is 48%, the cache starting point may be 50%.
It should be noted that, if the current cached proportion does not reach the cache starting point, the subsequent caching from the cache starting point may be started when the current cached proportion reaches the cache starting point, or the caching from the current cached proportion to the cache starting point and the subsequent caching from the cache starting point may be performed simultaneously.
S240, if a song switching instruction is received in the process of playing the target music, the playing and caching of the target music are stopped, the music to be played is determined according to the playing list, and the music to be played is played according to the caching list.
Wherein, the song-cutting instruction may be an instruction for switching from the target music to the music to be played. The playlist may be a list integrated with music that the user wants to play, such as a song list to be played. The music to be played may be the next music to be played first corresponding to the target music.
Specifically, if a song switching instruction is received in the process of playing the target music, it indicates that the user wants to stop playing the target music and wants to play the music to be played, and at this time, the playing and the caching of the target music are stopped. And then, determining that the next piece of music corresponding to the target music in the play list is the music to be played, searching the music to be played in the cache list, if the music to be played is found, playing, and if the music is not found, playing while caching. The playing and buffering mode for the music to be played may be the same playing and buffering mode as the target music.
It should be noted that, if the music to be played is not music in the playlist, for example: if the user triggers a piece of music that is not in the playlist, the piece of music triggered by the user may be added to the playlist, and the piece of music is determined to be music to be played.
It should be further noted that the playing mode of the music in the playlist may be single track cycle, sequential playing, random playing, etc., and the music to be played corresponding to the target music may be determined according to the playing mode.
And S250, when the current playing progress reaches a preset next cache threshold, acquiring the music to be played corresponding to the target music in the playlist, and caching the music to be played according to a preset initial cache proportion to be played.
Wherein, the next buffer threshold may be a playing progress value for triggering the buffer of the music to be played. The preset initial cache proportion to be played may be a cache proportion for pre-caching the music to be played when the target music is played.
Specifically, when the current playing progress reaches a preset next cache threshold, it indicates that the target music is about to be played, and the next music may be cached in advance. And determining music to be played corresponding to the target music according to the playlist, and caching the music to be played according to a preset initial caching ratio.
It should be noted that the preset initial buffer ratio to be played and the preset initial buffer ratio may be the same or different, and may be set according to actual requirements. In general, the preset initial cache ratio to be played is smaller than or equal to the preset initial cache ratio.
In order to expand the cache list, so that repeated caching is not needed when the target music is played again later, optionally, if cached data corresponding to the target music exists, the target music is added to the cache list.
The cached data may be data cached for the target music, may be all cached data of the target music, or may be partial cached data of the target music.
Specifically, if the target music is cached, cached data corresponding to the target music exists, and the target music may be added to the cache list, so that the cached data in the cache space is called to be played in the subsequent playing of the target music. If the cached data is partial cached data of the target music, the cached data can be played, and the subsequent caching is continued.
In order to clean the cache space in time, optionally, if a preset cleaning condition is met, the music cache in the cache space is cleaned.
The preset cleaning condition may be a preset condition for triggering cleaning, for example: the music cache in the cache space reaches a clearing threshold, or the non-calling time of the music cache in the cache space reaches a non-calling time threshold, and the like.
Specifically, when the music cache in the cache space reaches the preset cleaning condition, the music cache in the cache space is cleaned according to the preset cleaning rule. For example: and cleaning the music cache according to a first-in first-out principle, or cleaning the music cache of which the non-calling time length reaches a non-calling time length threshold value.
According to the technical scheme of the embodiment of the invention, when the music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list is determined; if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music; caching the target music according to the current playing progress, the current cached proportion and the preset subsequent caching proportion of the target music so as to perform segmented caching while playing, stopping playing and caching the target music if a song switching instruction is received in the process of playing the target music, determining the music to be played according to the playlist, playing the music to be played according to the cache list so as to avoid completely caching the target music under the condition that a user does not need the target music, stopping playing and caching the target music if the song switching instruction is received in the process of playing the target music, determining the music to be played according to the playlist, playing the music to be played according to the cache list so as to pre-cache the music to be played in advance, improving the user experience, solving the problems of storage space and flow waste caused by caching the fact that the whole song is cached every time of clicking playing and the caching cannot be performed according to the listening condition of the user, the technical effects of playing and caching the target music at the same time and saving the use of flow and cache space are achieved.
EXAMPLE III
As an optional implementation of the foregoing embodiments, fig. 3 is a schematic structural diagram of a music caching system according to a third embodiment of the present invention. The same or corresponding terms as those in the above embodiments are not explained in detail herein.
The music cache system comprises a cache management module and a play control module.
The cache management module is used for determining when to cache, setting parameters required by various caches and managing cache contents. The playing control module is used for receiving playing instructions, song cutting instructions and the like, updating the playing list and playing music.
The cache management module comprises: the cache management module comprises a pre-cache management sub-module, a cache configuration sub-module, a cache judgment sub-module, a cache execution and interruption sub-module and a cache list sub-module.
The pre-caching management submodule is used for carrying out caching judgment and initial caching execution aiming at the next piece of music in the playlist. The cache configuration submodule is used for setting or acquiring an initial cache proportion (preset initial cache proportion), a global cache proportion (current cached proportion), a progressive cache proportion (preset subsequent cache proportion), a last playing degree threshold value (preset subsequent cache threshold value) of a pre-cache, and a pre-cache initial cache proportion (preset to-be-played initial cache proportion). And the cache judgment submodule is used for judging whether the cache is performed or not and deciding whether the cache is terminated or not. And the cache execution and interruption submodule is used for taking charge of executing cache actions and stopping actions. And the cache list submodule is used for managing cache contents, including song IDs, cache progress, cache cleaning under the condition that a cache space is full and the like.
The play control module includes: a play control sub-module, a play list sub-module and a play output sub-module.
The playing control submodule is used for triggering playing, pausing, song cutting and the like of music. And the playlist submodule is used for recording the playlist, updating the playlist, recording the next song (music to be played) of the current playing content in the playlist, playing progress (current playing progress), and pre-caching the playing progress threshold of the next song (pre-setting a next cache threshold). And the play output submodule is used for outputting the cached content to the player for sound output and content display output.
Fig. 4 is a flowchart illustrating a music caching method according to a third embodiment of the present invention. As shown in fig. 4, the method of this embodiment specifically includes the following steps:
1. and clicking to play song A (target music), and triggering cache judgment by the play control submodule.
2. And judging whether the song A is in the cache list, if so, playing and outputting, and if not, executing step 3.
3. And executing caching according to the initial caching proportion preset in the caching configuration submodule, and playing through the playing output submodule.
4. And judging whether the song cutting operation occurs or not, if so, stopping caching the song A, caching and playing the next song according to the play list, and if not, executing step 5.
5. And performing caching according to the progressive caching proportion in the caching configuration sub-module, and caching and playing the next song according to the pre-caching strategy and the playlist when the playing progress reaches the threshold of the playing progress of the last pre-cached song.
6. And in the process of caching the song A, judging whether the caching of the song A is complete, if so, adding the song A into a caching list, and if not, executing caching according to the progressive caching proportion in the caching configuration submodule.
According to the technical scheme, the songs are progressively cached and played through the music caching system, the problems of flow and cache space waste caused by integral caching of the songs under the condition of high network speed are solved, and the technical effects that the cache progress is controlled by song cutting operation according to the playing progress of a user so as to save the cache space and the flow are achieved.
Example four
Fig. 5 is a schematic structural diagram of a music caching apparatus according to a fourth embodiment of the present invention, including: a cache determination module 510, an initial cache module 520, and a subsequent cache module 530.
The cache determining module 510 is configured to, when a music playing instruction is received, determine whether a target music corresponding to the music playing instruction already exists in a cache list; the initial caching module 520 is configured to, if not, cache the target music according to a preset initial caching ratio corresponding to the target music, and play the cached target music; the subsequent caching module 530 is configured to cache the target music according to the current playing progress of the target music, the current cached proportion, and a preset subsequent caching proportion.
Optionally, the apparatus further comprises: and the cache playing module is used for playing the target music according to the target music in the cache list if the target music is in the cache list.
Optionally, the initial caching module 520 is further configured to determine a caching start point according to the current cached proportion and cache the target music according to the caching start point and a preset subsequent caching proportion when a difference between the current cached proportion and the current playing progress reaches a preset subsequent caching threshold.
Optionally, the apparatus further comprises: and the cache list updating module is used for adding the target music into the cache list if cached data corresponding to the target music exists.
Optionally, the apparatus further comprises: the song-cutting cache module is used for stopping playing and caching of the target music if a song-cutting instruction is received in the process of playing the target music; and determining music to be played according to the play list, and playing the music to be played according to the cache list.
Optionally, the apparatus further comprises: and the to-be-played cache module is used for acquiring the to-be-played music corresponding to the target music in the playlist when the current playing progress reaches a preset next cache threshold value, and caching the to-be-played music according to a preset to-be-played initial cache proportion.
Optionally, the apparatus further comprises: and the music cache cleaning module is used for cleaning the music cache in the cache space if preset cleaning conditions are met.
According to the technical scheme of the embodiment of the invention, when the music playing instruction is received, whether the target music corresponding to the music playing instruction exists in the cache list is determined; if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music; according to the current playing progress, the current cached proportion and the preset subsequent caching proportion of the target music, the target music is cached, the problem that the whole song is cached after being played every time when clicking is solved, and the storage space and the flow are wasted due to the fact that caching can not be conducted according to the listening condition of a user is solved, the technical effects that the target music is played and cached simultaneously, and the flow and the caching space are used are achieved.
The music caching device provided by the embodiment of the invention can execute the music caching method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
It should be noted that, the units and modules included in the apparatus are merely divided according to functional logic, but are not limited to the above division as long as the corresponding functions can be implemented; in addition, specific names of the functional units are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the embodiment of the invention.
EXAMPLE five
Fig. 6 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present invention. FIG. 6 illustrates a block diagram of an exemplary electronic device 60 suitable for use in implementing embodiments of the present invention. The electronic device 60 shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiment of the present invention.
As shown in fig. 6, the electronic device 60 is in the form of a general purpose computing device. The components of the electronic device 60 may include, but are not limited to: one or more processors or processing units 601, a system memory 602, and a bus 603 that couples various system components including the system memory 602 and the processing unit 601.
Bus 603 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, and a processor or local bus using any of a variety of bus architectures. By way of example, such architectures include, but are not limited to, Industry Standard Architecture (ISA) bus, micro-channel architecture (MAC) bus, enhanced ISA bus, Video Electronics Standards Association (VESA) local bus, and Peripheral Component Interconnect (PCI) bus.
Electronic device 60 typically includes a variety of computer system readable media. Such media may be any available media that is accessible by electronic device 60 and includes both volatile and nonvolatile media, removable and non-removable media.
The system memory 602 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM)604 and/or cache memory 605. The electronic device 60 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 606 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive"). Although not shown in FIG. 6, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 603 by one or more data media interfaces. System memory 602 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 608 having a set (at least one) of program modules 607 may be stored, for example, in system memory 602, such program modules 607 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. The program modules 607 generally perform the functions and/or methods of the described embodiments of the invention.
Electronic device 60 may also communicate with one or more external devices 609 (e.g., keyboard, pointing device, display 610, etc.), with one or more devices that enable a user to interact with electronic device 60, and/or with any devices (e.g., network card, modem, etc.) that enable electronic device 60 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 611. Also, the electronic device 60 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via the network adapter 612. As shown, the network adapter 612 communicates with the other modules of the electronic device 60 via the bus 603. It should be appreciated that although not shown in FIG. 6, other hardware and/or software modules may be used in conjunction with electronic device 60, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
The processing unit 601 executes various functional applications and data processing by running programs stored in the system memory 602, for example, implementing a music caching method provided by an embodiment of the present invention.
EXAMPLE six
An embodiment of the present invention further provides a storage medium containing computer-executable instructions, which when executed by a computer processor, perform a music caching method, the method including:
when a music playing instruction is received, determining whether target music corresponding to the music playing instruction exists in a cache list or not;
if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music;
and caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for embodiments of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (10)

1. A music caching method, comprising:
when a music playing instruction is received, determining whether target music corresponding to the music playing instruction exists in a cache list or not;
if not, caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music;
and caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music.
2. The method of claim 1, wherein after determining whether the target music corresponding to the music playing instruction is already present in the cache list, further comprising:
and if so, playing according to the target music in the cache list.
3. The method according to claim 1, wherein the caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music comprises:
and if the difference value between the current cached proportion and the current playing progress reaches a preset subsequent caching threshold value, determining a caching starting point according to the current cached proportion, and caching the target music according to the caching starting point and the preset subsequent caching proportion.
4. The method of claim 1, further comprising:
and if cached data corresponding to the target music exist, adding the target music to the cache list.
5. The method of claim 1, further comprising:
if a song-cutting instruction is received in the process of playing the target music, stopping playing and caching the target music;
and determining music to be played according to the play list, and playing the music to be played according to the cache list.
6. The method of claim 1, further comprising:
and when the current playing progress reaches a preset next cache threshold value, acquiring the music to be played corresponding to the target music in the playing list, and caching the music to be played according to a preset initial cache proportion to be played.
7. The method of claim 1, further comprising:
and if the preset cleaning condition is met, cleaning the music cache in the cache space.
8. A music buffering device, comprising:
the cache judging module is used for determining whether the target music corresponding to the music playing instruction exists in a cache list or not when the music playing instruction is received;
the initial caching module is used for caching the target music according to a preset initial caching proportion corresponding to the target music and playing the cached target music if the target music is not cached;
and the subsequent caching module is used for caching the target music according to the current playing progress, the current cached proportion and a preset subsequent caching proportion of the target music.
9. An electronic device, characterized in that the electronic device comprises:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the music caching method as recited in any one of claims 1-7.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out a music caching method as claimed in any one of claims 1 to 7.
CN202111246764.5A 2021-10-26 2021-10-26 Music caching method and device, electronic equipment and storage medium Pending CN113986849A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202111246764.5A CN113986849A (en) 2021-10-26 2021-10-26 Music caching method and device, electronic equipment and storage medium
PCT/CN2022/127239 WO2023072028A1 (en) 2021-10-26 2022-10-25 Music caching method and apparatus, and electronic device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111246764.5A CN113986849A (en) 2021-10-26 2021-10-26 Music caching method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113986849A true CN113986849A (en) 2022-01-28

Family

ID=79741511

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111246764.5A Pending CN113986849A (en) 2021-10-26 2021-10-26 Music caching method and device, electronic equipment and storage medium

Country Status (2)

Country Link
CN (1) CN113986849A (en)
WO (1) WO2023072028A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023072028A1 (en) * 2021-10-26 2023-05-04 中国第一汽车股份有限公司 Music caching method and apparatus, and electronic device and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7797064B2 (en) * 2002-12-13 2010-09-14 Stephen Loomis Apparatus and method for skipping songs without delay
CN108111866A (en) * 2016-11-24 2018-06-01 法乐第(北京)网络科技有限公司 The control method and system of audio and video playing
CN108287680A (en) * 2018-02-12 2018-07-17 宁夏灵智科技有限公司 Method for playing music, device, electronic equipment and storage medium
CN112804579B (en) * 2019-11-14 2023-02-28 上海哔哩哔哩科技有限公司 Video playing method and device, computer equipment and readable storage medium
CN112752117B (en) * 2020-12-30 2023-03-28 百果园技术(新加坡)有限公司 Video caching method, device, equipment and storage medium
CN113986849A (en) * 2021-10-26 2022-01-28 中国第一汽车股份有限公司 Music caching method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2023072028A1 (en) * 2021-10-26 2023-05-04 中国第一汽车股份有限公司 Music caching method and apparatus, and electronic device and storage medium

Also Published As

Publication number Publication date
WO2023072028A1 (en) 2023-05-04

Similar Documents

Publication Publication Date Title
US20190066671A1 (en) Far-field speech awaking method, device and terminal device
US20070157268A1 (en) Portable media device with improved video acceleration capabilities
KR20080021691A (en) Gpu timeline with render-ahead queue
MX2012001100A (en) Adaptive streaming for digital content distribution.
CN112333476B (en) Video loading method and device
US20240118864A1 (en) Method and device for mixedly playing a program
CN109599133B (en) Language audio track switching method and device, computer equipment and storage medium
WO2023072028A1 (en) Music caching method and apparatus, and electronic device and storage medium
WO2020044086A1 (en) File transfer and play method and apparatus, and device/terminal/server
US20110167345A1 (en) Method and apparatus for selective media download and playback
US20150261685A1 (en) Systems and methods for background destaging storage tracks
CN114416012A (en) Audio continuous playing method and device
US8116887B2 (en) Apparatus and method for performing auxiliary functions when electronics are switched to hold
US20150312369A1 (en) Checkpoints for media buffering
WO2023029821A1 (en) Video buffer playing method and apparatus, and electronic device and storage medium
CN110087168B (en) Audio reverberation processing method, device, equipment and storage medium
CN112437352B (en) Video merging and playing method and device
CN113778370A (en) Voice message playing method and device, electronic equipment and storage medium
US20060090040A1 (en) Techniques to improve cache performance
US10169115B1 (en) Predicting exhausted storage for a blocking API
CN115480728A (en) Audio playing method and device, terminal equipment and storage medium
JP2021175176A (en) Method, apparatus, program, and non-temporary computer readable storage medium for detecting echo delay
CN109271334B (en) Data access system and method
CN112817769B (en) Game resource dynamic caching method and device, storage medium and electronic equipment
CN115037986B (en) Video self-adaptive playing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination