WO2023072028A1 - 音乐缓存方法、装置、电子设备及存储介质 - Google Patents

音乐缓存方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2023072028A1
WO2023072028A1 PCT/CN2022/127239 CN2022127239W WO2023072028A1 WO 2023072028 A1 WO2023072028 A1 WO 2023072028A1 CN 2022127239 W CN2022127239 W CN 2022127239W WO 2023072028 A1 WO2023072028 A1 WO 2023072028A1
Authority
WO
WIPO (PCT)
Prior art keywords
music
cache
target music
ratio
target
Prior art date
Application number
PCT/CN2022/127239
Other languages
English (en)
French (fr)
Inventor
王利伟
高洪伟
吕贵林
陈涛
李颖慧
范莉娟
梁婷
Original Assignee
中国第一汽车股份有限公司
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 中国第一汽车股份有限公司 filed Critical 中国第一汽车股份有限公司
Publication of WO2023072028A1 publication Critical patent/WO2023072028A1/zh

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

Definitions

  • the embodiments of the present application relate to the technical field of music playing, for example, to a music caching method, device, electronic device, and storage medium.
  • the Internet of Vehicles service has gradually entered the life of users.
  • the car entertainment system is a medium that provides services for users, providing users with car listening experience and meeting the music listening needs during driving.
  • the method of playing music through an external U disk in the car entertainment system can no longer meet the user's demand for rich and high-quality music, and network music has gradually been applied in the car scene.
  • online music will involve traffic consumption during the loading process, cache storage after loading, and other conditions.
  • 4th-Generation, 4G fourth-generation mobile communication technology
  • the peak network speed can usually reach 100Mbps, that is, the transmission speed is 12.5MB per second. If you cache 10MB of music, you can complete the entire song within 1s. Music cache.
  • 5th-Generation, 5G the speed will be even faster.
  • the traffic of the in-vehicle entertainment system is less than that of mobile smart devices, and the cache space is relatively small. If the entire song is cached every time you click to play, it will lead to a waste of traffic and a waste of cache space resources when the user performs operations such as song switching.
  • Embodiments of the present application provide a music caching method, device, electronic equipment, and storage medium.
  • the embodiment of the present application provides a music caching method, the method comprising:
  • the target music is cached according to a preset initial cache ratio corresponding to the target music, and the cached target music is played;
  • the target music is cached according to the current playing progress of the target music, the current buffered ratio and the preset subsequent buffered ratio.
  • the embodiment of the present application also provides a music caching device, which includes:
  • the cache judging module is configured to determine whether the target music corresponding to the music playback instruction already exists in the cache list in response to receiving the music playback instruction;
  • the initial cache module is configured to cache the target music according to the preset initial cache ratio corresponding to the target music in response to the target music corresponding to the music playing instruction not existing in the cache list, and play the cached target music;
  • the subsequent caching module is configured to cache the target music according to the current playing progress of the target music, the current buffered ratio and the preset subsequent buffered ratio.
  • the embodiment of the present application further provides an electronic device, the electronic device comprising:
  • processors one or more processors
  • storage means configured to store one or more programs
  • the one or more processors are made to implement the music caching method described in any one of the embodiments of the present application.
  • the embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the music caching method as described in any one of the embodiments of the present application is implemented.
  • FIG. 1 is a schematic flow diagram of a music caching method provided in Embodiment 1 of the present application;
  • FIG. 2 is a schematic flow diagram of a music caching method provided in Embodiment 2 of the present application.
  • FIG. 3 is a schematic structural diagram of a music cache system provided in Embodiment 3 of the present application.
  • FIG. 4 is a schematic flow diagram of a music caching method provided in Embodiment 3 of the present application.
  • FIG. 5 is a schematic structural diagram of a music cache device provided in Embodiment 4 of the present application.
  • FIG. 6 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application.
  • Fig. 1 is a schematic flow chart of a music caching method provided by Embodiment 1 of the present application.
  • This embodiment can cache music during music playback, and the method can be performed by a music caching device, which can be implemented by software and/or Or implemented in the form of hardware, the hardware may be an electronic device, for example, the electronic device may be a mobile terminal, a vehicle-mounted terminal, and the like.
  • the method of this embodiment includes the following steps:
  • 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 each cached data.
  • the music playing instruction is analyzed to determine the target music included in the music playing instruction.
  • the cache list check whether the target music exists, so as to determine whether there is cached data corresponding to the target music in the cache space.
  • the user when the user wants to play the target music, the user may trigger the target music by selecting a trigger, and generate a music playing instruction corresponding to the target music.
  • the preset initial cache ratio may be a preset cache ratio, for example: 10% or 20% of the target music, etc., which may be adjusted according to actual needs.
  • the target music can be initially cached according to the preset initial cache ratio corresponding to the target music, and the target music can be played according to the cached data.
  • the current playing progress may be the current playing ratio of the target music.
  • the current cached ratio may be the ratio of the current cached data to the target music.
  • the preset subsequent cache ratio may be the ratio of the target music that can be cached in the next stage.
  • the current playing progress of the target music is obtained, and the current cache ratio is determined. Furthermore, when the current playback progress reaches the condition for continuing caching, the caching of the preset subsequent caching ratio is performed according to the current caching ratio.
  • the current cached ratio can be determined to determine whether the current cached ratio reaches the preset initial cached ratio. If so, based on the preset initial buffering ratio, the next target music buffering of the preset subsequent buffering ratio can be continued. If not, you can cache to the preset initial cache ratio based on the current cache ratio, and then continue to cache the preset subsequent cache ratio, or you can cache to the preset initial cache ratio based on the current cache ratio, and at the same time, based on the preset initial cache ratio The ratio is cached according to the preset subsequent cache ratio, that is, cached at the same time.
  • the target music corresponding to the music playing instruction already exists in the cache list it also includes: in response to the target music corresponding to the music playing instruction existing in the cache list, Play according to the target music in the cache list.
  • the target music exists in the cache list, it indicates that there is cached data corresponding to the target music stored in the cache space, and there is no need to cache. At this point, the cached data corresponding to the target music in the cache space can be retrieved and played according to the target music in the cache list.
  • the target music corresponding to the music playback instruction when a music playback instruction is received, it is determined whether the target music corresponding to the music playback instruction already exists in the cache list; Cache and play the cached target music; according to the current playback progress of the target music, the current cached ratio and the preset subsequent cache ratio, the target music is cached, which solves the problem of caching the entire song every time you click to play.
  • the waste of storage space and traffic caused by caching the user's listening status realizes the caching of the target music while playing, saving the use of traffic and cache space.
  • FIG. 2 is a schematic flow diagram of a music caching method provided in Embodiment 2 of the present application.
  • this embodiment can refer to this embodiment for the subsequent caching method and the caching method when switching songs. .
  • explanations of terms that are the same as or corresponding to the above embodiments are not repeated here.
  • the method of this embodiment includes the following steps:
  • the preset subsequent buffering threshold may be a preset value used to trigger the next buffering.
  • the cache start point may be a cache start position with a preset subsequent cache ratio.
  • the difference between the current cached ratio and the current playback progress reaches the preset subsequent cache threshold, then determine the cache starting point corresponding to the current cached ratio. Furthermore, caching is performed from the starting point of caching, and the caching ratio is a preset subsequent caching ratio.
  • the preset initial caching ratio may be determined as the caching starting point.
  • the corresponding preset initial caching ratio and preset subsequent caching ratio may be determined according to the current cached ratio, and the starting point of caching may be determined.
  • the preset initial cache ratio is 20%, and the preset subsequent cache ratio is 10%. If the difference between the current cached ratio and the current playback progress reaches the preset subsequent cache threshold, the current cached ratio is 20%, and the preset initial cache ratio of 20% can be used as the starting point for caching. If the difference between the current cached ratio and the current playback progress reaches the preset subsequent cache threshold, and the current cached ratio is 50%, it can be determined that the cache starting point is 50%, that is, 20%+3 ⁇ 10%. If the current cached ratio does not reach the cache starting point, the cache starting point corresponding to the current cached ratio may be determined. For example, if the current cached ratio is 48%, the starting point for caching may be 50%.
  • the current cached ratio does not reach the starting point of the cache, you can wait for the current cached ratio to reach the starting point of the cache, and start subsequent caching from the starting point of the cache, or you can simultaneously cache between the current cached ratio and the starting point of the cache. Subsequent caches starting from the cache start point.
  • the song switching instruction may be an instruction for switching from the target music to the music to be played.
  • the playlist may be a list obtained by integrating 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.
  • a song cut instruction is received during the playing of the target music, it indicates that the user wants to stop the playing of the target music and wants to play the music to be played. At this time, stop the playing and buffering of the target music. And then, it is determined that the next music corresponding to the target music in the play list is the music to be played, and the music to be played is searched in the cache list, if the music to be played is found, then played, if the music to be played is not found, then the Play while buffering.
  • the playing and buffering mode of the music to be played may be the same as that of the target music.
  • the music to be played is not in the playlist, for example: the user triggers a piece of music that is not in the playlist, then the music triggered by the user can be added to the playlist and determined as the music to be played. play music.
  • the playing mode of the music in the playlist can be single loop, sequential playing, random playing, etc., and the music to be played corresponding to the target music can be determined according to the playing mode.
  • the next song buffering threshold may be a playing progress value that triggers buffering of music to be played.
  • the preset initial cache ratio to be played may be the cache ratio for pre-caching the music to be played when the target music is played.
  • the current playback progress reaches the preset next cache threshold, it indicates that the target music is about to be played, and the next music can be pre-cached.
  • the music to be played corresponding to the target music is determined according to the playlist, and the initial cache ratio of the music to be played is preset for the cache to be played.
  • the values of the preset initial cache ratio to be played and the preset initial cache ratio may be the same or different, and may be set according to actual needs.
  • the preset initial cache ratio to be played is less than or equal to the preset initial cache ratio.
  • 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 part of the cached data of the target music.
  • the cache operation is performed on the target music, there is cached data corresponding to the target music, and the target music can be added to the cache list, so that the cached data in the cache space can be called when the target music is played subsequently to play. If the cached data is part of the cached data of the target music, the cached data can be played, and subsequent caches can continue to be cached.
  • the music cache in the cache space is cleaned up.
  • the preset cleaning condition may be a preset condition to trigger cleaning, for example: the music cache in the cache space reaches the cleaning threshold, or the music cache in the cache space has not been called for a duration reaching the non-call duration threshold, etc.
  • the music cache in the cache space is cleaned according to a preset cleaning rule. For example: clean up the music cache according to the first-in-first-out principle, or clean up the music cache whose unused duration reaches the unused duration threshold.
  • a music playback instruction when a music playback instruction is received, it is determined whether the target music corresponding to the music playback instruction already exists in the cache list; Cache and play the cached target music; according to the current playback progress of the target music, the current cached ratio and the preset subsequent cache ratio, cache the target music to perform segmented caching while playing. If a song cut command is received during the music process, the playing and caching of the target music will be stopped, the music to be played will be determined according to the playlist, and the music to be played will be played according to the cached list, so as to avoid the target music when the user does not need the target music. All the music is cached.
  • the playback and cache of the target music will be stopped, and the music to be played will be determined according to the playlist, and the music to be played will be played according to the cache list, so as to be played in advance
  • the music is pre-cached to improve the user experience. It solves the problem of caching the entire song every time you click to play, and the storage space and traffic waste caused by the inability to cache according to the user's listening situation. It realizes the caching of the target music while playing. , which saves the use of traffic and cache space.
  • FIG. 3 is a schematic structural diagram of a music cache system provided in Embodiment 3 of the present application. Wherein, explanations of terms that are the same as or corresponding to the above embodiments are not repeated here.
  • the music cache system includes a cache management module and a playback control module.
  • the cache management module is configured to determine when to cache, to set parameters required by various caches, and to manage cached content.
  • the play control module is configured to receive play instructions, song cut instructions, etc., update the playlist, and play music.
  • the cache management module includes: a pre-cache management submodule, a cache configuration submodule, a cache judgment submodule, a cache execution and interruption submodule, and a cache list submodule.
  • the pre-cache management sub-module is configured to perform cache judgment and initial cache execution for the next music in the playlist.
  • Cache configuration sub-module set to set or get initial cache ratio (preset initial cache ratio), global cache ratio (currently cached ratio), progressive cache ratio (preset follow-up cache ratio), pre-cached previous song playback Progress threshold (preset subsequent cache threshold), pre-cache initial cache ratio (preset initial cache ratio to be played).
  • the caching judging sub-module is set to be responsible for judging whether the caching is performed or terminated.
  • the cache execution and interrupt submodule is set to be responsible for performing cache actions and stop actions.
  • the cache list sub-module is set to be responsible for managing the cache content, including song identification (identity, ID), cache progress, cache cleanup when the cache space is full, etc.
  • the playback control module includes: a playback control submodule, a playlist submodule and a playback output submodule.
  • the play control sub-module is set to be responsible for triggering music play, pause, song cut, etc.
  • the playlist submodule is set to be responsible 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), pre-caching the next song Play progress threshold (preset next song cache threshold).
  • the playback output sub-module is set to output the cached content to the player for sound output and content display output.
  • FIG. 4 is a schematic flowchart of a music caching method provided in Embodiment 3 of the present application. As shown in Figure 4, the method of this embodiment includes the following steps:
  • the song is progressively cached and played through the music cache system, which solves the waste of traffic and cache space caused by the overall cache of the song in the case of high network speed, and realizes that according to the user's playback progress, cut
  • the song operation controls the cache progress to save cache space and traffic.
  • FIG. 5 is a schematic structural diagram of a music caching device provided in Embodiment 4 of the present application.
  • the device includes: a caching judging module 510 , an initial caching module 520 and a subsequent caching module 530 .
  • the cache judging module 510 is configured to determine whether the target music corresponding to the music playback instruction already exists in the cache list when receiving the music playback instruction; if not, the initial cache module 520 is configured to The preset initial cache ratio corresponding to the target music caches the target music, and plays the cached target music; the follow-up cache module 530 is set to be based on the current playback progress, the current cached ratio, and the preset cache ratio of the target music. A subsequent cache ratio is set to cache the target music.
  • the device further includes: a cache play module, configured to play according to the target music in the cache list if yes.
  • the subsequent caching module 530 is further configured to determine the starting point of caching according to the current cached ratio if the difference between the current cached ratio and the current playback progress reaches a preset subsequent cache threshold , cache the target music according to the cache starting point and a preset subsequent cache ratio.
  • the device further includes: a cache list updating module configured to add the target music to the cache list if there is cached data corresponding to the target music.
  • the device also includes: a song-cutting cache module, configured to stop playing and buffering the target music if a song-cutting instruction is received during playing the target music; music, and play the music to be played according to the cache list.
  • a song-cutting cache module configured to stop playing and buffering the target music if a song-cutting instruction is received during playing the target music.
  • the device further includes: a buffering module to be played, configured to obtain the music to be played corresponding to the target music in the playlist when the current playing progress reaches the preset next buffering threshold , and cache the music to be played according to the preset initial cache ratio to be played.
  • a buffering module to be played configured to obtain the music to be played corresponding to the target music in the playlist when the current playing progress reaches the preset next buffering threshold , and cache the music to be played according to the preset initial cache ratio to be played.
  • the device further includes: a music cache cleaning module, configured to clean up the music cache in the cache space if a preset cleaning condition is met.
  • the target music corresponding to the music playback instruction when a music playback instruction is received, it is determined whether the target music corresponding to the music playback instruction already exists in the cache list; Cache and play the cached target music; according to the current playback progress of the target music, the current cached ratio and the preset subsequent cache ratio, the target music is cached, which solves the problem of caching the entire song every time you click to play.
  • the waste of storage space and traffic caused by caching the user's listening status realizes the caching of the target music while playing, saving the use of traffic and cache space.
  • the music caching device provided in the embodiment of the present application can execute the music caching method provided in any embodiment of the present application, and has corresponding functional modules and beneficial effects for executing the method.
  • FIG. 6 is a schematic structural diagram of an electronic device provided in Embodiment 5 of the present application.
  • FIG. 6 shows a block diagram of an exemplary electronic device 60 suitable for implementing the embodiments of the present application.
  • the electronic device 60 shown in FIG. 6 is only an example, and should not limit the functions and scope of use of this embodiment of the present application.
  • electronic device 60 takes the form of a general-purpose computing device.
  • 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 connecting different system components (including the system memory 602 and the processing unit 601 ).
  • Bus 603 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor, or a local bus using any of a variety of bus structures.
  • these architectures include but are not limited to Industry Standard Architecture (Industry Standard Architecture, ISA) bus, Micro Channel Architecture (Micro Channel Architecture, MCA) bus, Enhanced ISA bus, Video Electronics Standards Association (Video Electronics Standards Association, VESA) local bus and peripheral component interconnect (Peripheral Component Interconnect, PCI) bus.
  • Electronic device 60 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 60 and include both volatile and nonvolatile media, removable and non-removable media.
  • System memory 602 may include computer system readable media in the form of volatile memory, such as random access memory (Random Access Memory, RAM) 604 and/or cache 605 .
  • the electronic device 60 may further include other removable/non-removable, volatile/nonvolatile computer system storage media.
  • storage system 606 may be used to read from and write to non-removable, non-volatile magnetic media (not shown in FIG. 6, commonly referred to as a "hard drive").
  • a disk drive for reading and writing to a removable non-volatile disk may be provided, as well as for removable non-volatile disk (such as a compact disc read-only memory (Compact Disc Read-Only Memory, CD-ROM), Digital Versatile Disc Read-Only Memory (DVD-ROM) or other optical media) CD-ROM drive.
  • each drive may be connected to bus 603 via one or more data media interfaces.
  • the system memory 602 may include at least one program product having a set (eg, at least one) of program modules configured to perform the functions of the various embodiments of the present application.
  • a program/utility 608 having a set (at least one) of program modules 607 such as but not limited to, an operating system, one or more application programs, other program modules, and program data, each or some combination of these examples may include the implementation of the network environment.
  • the program module 607 generally executes the functions and/or methods in the embodiments described in this application.
  • the electronic device 60 may also communicate with one or more external devices 609 (such as a keyboard, pointing device, display 610, etc.), communicate with one or more devices that enable a user to interact with the electronic device 60, and/or communicate with Any device (eg, network card, modem, etc.) that enables the electronic device 60 to communicate with one or more other computing devices. Such communication may be performed through an Input/Output (I/O) interface 611 .
  • the electronic device 60 can also communicate with one or more networks (such as a local area network (Local Area Network, LAN), a wide area network (Wide Area Network, WAN) and/or a public network, such as the Internet) through the network adapter 612. As shown in FIG.
  • the network adapter 612 communicates with other modules of the electronic device 60 through the bus 603 .
  • 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, disk arrays (Redundant Arrays of Independent Disks, RAID) systems, tape drives, and data backup storage systems.
  • the processing unit 601 executes various functional applications and data processing by running the programs stored in the system memory 602, such as implementing the music caching method provided by the embodiment of the present application.
  • Embodiment 6 of the present application also provides a storage medium containing computer-executable instructions, the computer-executable instructions are used to execute a music caching method when executed by a computer processor, the method comprising:
  • the target music is cached according to the current playing progress of the target music, the current buffered ratio and the preset subsequent buffered ratio.
  • the storage medium may be a non-transitory storage medium.
  • the computer storage medium in the embodiments of the present application may use 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 electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof.
  • a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
  • a computer readable signal medium may include a data signal carrying computer readable program code in baseband or as part of a carrier wave. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing.
  • a computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. .
  • Program code embodied on a computer readable medium may be transmitted by any appropriate medium, including but not limited to wireless, wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • any appropriate medium including but not limited to wireless, wire, optical cable, radio frequency (Radio Frequency, RF), etc., or any suitable combination of the above.
  • Computer program codes for performing the operations of the embodiments of the present application may be written in one or more programming languages or combinations thereof, the programming languages including object-oriented programming languages—such as Java, Smalltalk, C++, including A conventional procedural programming language - such as "C" or a similar programming language.
  • 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.
  • the remote computer can be connected to the user computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (such as through an Internet service provider). Internet connection).

Abstract

本申请实施例公开了一种音乐缓存方法、装置、电子设备及存储介质,该方法包括:响应于接收到音乐播放指令,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。

Description

音乐缓存方法、装置、电子设备及存储介质
本申请要求在2021年10月26日提交中国专利局、申请号为202111246764.5的中国专利申请的优先权,以上申请的全部内容通过引用结合在本申请中。
技术领域
本申请实施例涉及音乐播放技术领域,例如涉及一种音乐缓存方法、装置、电子设备及存储介质。
背景技术
车联网服务已渐渐进入用户的生活,车载娱乐系统是为用户提供服务的媒介,为用户提供车载听觉体验,满足行车过程中的音乐收听需求。
车载娱乐系统通过外接U盘来播放音乐的方式已无法满足用户对丰富及高品质音乐的需求,网络音乐已逐渐应用在车载场景下。但是,网络音乐会涉及加载过程的流量消耗,加载后的缓存存储等状况。在第四代移动通信技术(4th-Generation,4G)网络状态下,通常网速峰值可达到100Mbps,即每秒的传输速度是12.5MB,如果缓存10MB的音乐,在1s内即可完成整首音乐的缓存。在第五代移动通信技术(5th-Generation,5G)网络下,速度则会更快。
但是,车载娱乐系统的流量较于移动智能设备都是较少的,缓存空间也相对较小。如果每次点击播放就缓存整首歌曲,在用户出现切歌等操作时,会导致流量的浪费和缓存空间的资源浪费。
发明内容
本申请实施例提供了一种音乐缓存方法、装置、电子设备及存储介质。
第一方面,本申请实施例提供了一种音乐缓存方法,该方法包括:
响应于接收到音乐播放指令,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;
响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;
根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
第二方面,本申请实施例还提供了一种音乐缓存装置,该装置包括:
缓存判断模块,设置为响应于接收到音乐播放指令,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;
初始缓存模块,设置为响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;
后续缓存模块,设置为根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
第三方面,本申请实施例还提供了一种电子设备,所述电子设备包括:
一个或多个处理器;
存储装置,设置为存储一个或多个程序,
当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如本申请实施例任一所述的音乐缓存方法。
第四方面,本申请实施例还提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现如本申请实施例任一所述的音乐缓存方法。
附图说明
图1为本申请实施例一所提供的一种音乐缓存方法的流程示意图;
图2为本申请实施例二所提供的一种音乐缓存方法的流程示意图;
图3为本申请实施例三所提供的一种音乐缓存系统的结构示意图;
图4为本申请实施例三所提供的一种音乐缓存方法的流程示意图;
图5为本申请实施例四所提供的一种音乐缓存装置的结构示意图;
图6为本申请实施例五所提供的一种电子设备的结构示意图。
具体实施方式
实施例一
图1为本申请实施例一所提供的一种音乐缓存方法的流程示意图,本实施例可以在音乐播放时对音乐进行缓存,该方法可以由音乐缓存装置来执行,该装置可以通过软件和/或硬件的形式实现,该硬件可以是电子设备,例如,电子设备可以是移动终端,车载终端等。
如图1所述,本实施例的方法包括如下步骤:
S110、当接收到音乐播放指令时,确定与音乐播放指令相对应的目标音乐 是否已存在于缓存列表中。
其中,音乐播放指令可以是进行音乐播放的指令。目标音乐可以是当前想要播放的音乐。缓存列表可以是各个已缓存数据所对应的音乐组成的列表。
例如,当接收到音乐播放指令时,对音乐播放指令进行解析确定音乐播放指令中包含的目标音乐。在缓存列表中,查找是否存在目标音乐,以确定缓存空间中是否存在与目标音乐相对应的已缓存数据。
在一实施例中,当用户想要播放目标音乐时,可以通过选择触发的方式,触发目标音乐,并生成与目标音乐相对应的音乐播放指令。
S120、响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与目标音乐对应的预设初始缓存比例对目标音乐进行缓存,并播放已缓存的目标音乐。
其中,预设初始缓存比例可以是预先设定的缓存比例,例如:目标音乐的10%或20%等,可以根据实际需求进行调整。
例如,若目标音乐不存在于缓存列表中,则表明缓存空间中没有存储目标音乐所对应的已缓存数据,需要进行缓存。此时,可以根据目标音乐对应的预设初始缓存比例对目标音乐进行初步的缓存,并根据缓存的数据播放目标音乐。
S130、根据目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对目标音乐进行缓存。
其中,当前播放进度可以是目标音乐当前播放的比例。当前已缓存比例可以是当前已缓存数据所占的目标音乐的比例。预设后续缓存比例可以是接下来的阶段可以进行缓存的目标音乐的比例。
例如,在播放目标音乐的过程中,获取目标音乐的当前播放进度,并确定当前缓存比例。进而,当当前播放进度达到继续缓存的条件时,根据当前已缓存比例进行预设后续缓存比例的缓存。
示例性的,当目标音乐的当前播放进度达到预设进度时,可以表明存在继续对目标音乐进行缓存的需求。此时,可以确定当前已缓存比例,确定当前已缓存比例是否达到预设初始缓存比例。若是,则可以基于预设初始缓存比例,继续进行接下来的预设后续缓存比例的目标音乐缓存。若否,则可以基于当前已缓存比例,缓存至预设初始缓存比例,再继续缓存预设后续缓存比例,也可以基于当前已缓存比例缓存至预设初始缓存比例,同时,基于预设初始缓存比例根据预设后续缓存比例进行缓存,即同时缓存。
在上述实施例的基础上,在确定与音乐播放指令相对应的目标音乐是否已 存在于缓存列表中之后,还包括:响应于与所述音乐播放指令相对应的目标音乐存在于缓存列表中,根据缓存列表中的目标音乐进行播放。
例如,若目标音乐存在于缓存列表中,则表明缓存空间中有存储目标音乐所对应的已缓存数据,无需进行缓存。此时,可以根据缓存列表中的目标音乐调取缓存空间中与目标音乐相对应的已缓存数据,并进行播放。
本申请实施例,通过当接收到音乐播放指令时,确定与音乐播放指令相对应的目标音乐是否已存在于缓存列表中;若否,则根据与目标音乐对应的预设初始缓存比例对目标音乐进行缓存,并播放已缓存的目标音乐;根据目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对目标音乐进行缓存,解决了每次点击播放就缓存整首歌曲,无法根据用户的收听情况进行缓存导致的存储空间和流量浪费的状况,实现了对目标音乐进行边播放边缓存,节省了流量和缓存空间的使用。
实施例二
图2为本申请实施例二所提供的一种音乐缓存方法的流程示意图,本实施例在上述各实施例的基础上,针对后续缓存的方式,以及切歌时的缓存方式可参见本实施例。其中,与上述各实施例相同或相应的术语的解释在此不再赘述。
如图2所述,本实施例的方法包括如下步骤:
S210、当接收到音乐播放指令时,确定与音乐播放指令相对应的目标音乐是否已存在于缓存列表中。
S220、响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与目标音乐对应的预设初始缓存比例对目标音乐进行缓存,并播放已缓存的目标音乐。
S230、若当前已缓存比例与当前播放进度的差值达到预设后续缓存阈值时,则根据当前已缓存比例确定缓存起始点,根据缓存起始点以及预设后续缓存比例对目标音乐进行缓存。
其中,预设后续缓存阈值可以是预先设定的用于触发接下来的缓存的数值。缓存起始点可以是预设后续缓存比例的缓存起始位置。
若当前已缓存比例与当前播放进度的差值达到预设后续缓存阈值时,则确定与当前已缓存比例相对应的缓存起始点。进而,从缓存起始点开始进行缓存,缓存比例为预设后续缓存比例。
例如,在第一次进行后续缓存时,可以是确定预设初始缓存比例为缓存起 始点。在第二次以及第二次之后进行后续缓存时,可以是根据当前已缓存比例确定对应的预设初始缓存比例以及预设后续缓存比例,并确定缓存起始点。
示例性的,预设初始缓存比例20%,预设后续缓存比例为10%。若当前已缓存比例与当前播放进度的差值达到预设后续缓存阈值时,当前已缓存比例为20%,则可以将预设初始缓存比例20%作为缓存起始点。若当前已缓存比例与当前播放进度的差值达到预设后续缓存阈值时,当前已缓存比例为50%,则可以确定缓存起始点为50%,即20%+3×10%。若当前已缓存比例未达到缓存起始点,则可以确定当前已缓存比例对应的缓存起始点。例如,当前已缓存比例为48%,则缓存起始点可以是50%。
若当前已缓存比例未达到缓存起始点,则可以等待当前已缓存比例达到缓存起始点时,从缓存起始点开始后续缓存,也可以同时进行当前已缓存比例到缓存起始点之间的缓存以及从缓存起始点开始的后续缓存。
S240、若在播放目标音乐的过程中接收到切歌指令,则停止目标音乐的播放和缓存,根据播放列表确定待播放音乐,并根据缓存列表,播放待播放音乐。
其中,切歌指令可以是用于从目标音乐切换至待播放音乐的指令。播放列表可以是待播放歌单等将用户想要播放的音乐整合得到的列表。待播放音乐可以是目标音乐所对应的下一首要播放的音乐。
例如,若在播放目标音乐的过程中接收到切歌指令,则表明用户想要停止目标音乐的播放,并想要播放待播放音乐,此时,停止目标音乐的播放和缓存。进而,确定播放列表中与目标音乐相对应的下一首音乐为待播放音乐,并在缓存列表中查找待播放音乐,若找到待播放音乐,则进行播放,若未找到待播放音乐,则边缓存边播放。针对待播放音乐的播放和缓存方式可以是与目标音乐相同的播放和缓存方式。
需要说明的是,若待播放音乐不是播放列表中的音乐,例如:用户触发了一首不在播放列表中的音乐,则可以将用户触发的音乐添加至播放列表中,并确定该首音乐为待播放音乐。
还需要说明的是,播放列表中音乐的播放方式可以是单曲循环,顺序播放和随机播放等,可以根据播放方式确定与目标音乐相对应的待播放音乐。
S250、当当前播放进度达到预设下一首缓存阈值时,获取播放列表中与目标音乐相对应的待播放音乐,并根据预设待播放初始缓存比例对待播放音乐进行缓存。
其中,下一首缓存阈值可以是触发缓存待播放音乐的播放进度值。预设待 播放初始缓存比例可以是在播放目标音乐时,对待播放音乐进行预缓存的缓存比例。
例如,当当前播放进度达到预设下一首缓存阈值时,表明目标音乐即将播放完毕,可以预先缓存下一首音乐。根据播放列表确定与目标音乐相对应的待播放音乐,针对待播放音乐进行预设待播放初始缓存比例的缓存。
例如,预设待播放初始缓存比例和预设初始缓存比例的数值可以是相同的,也可以是不同的,可以根据实际需求设定。通常情况下,预设待播放初始缓存比例小于或等于预设初始缓存比例。
为了对缓存列表进行扩充,以便后续再次播放目标音乐时不用重复缓存,例如,若存在与目标音乐相对应的已缓存数据,则将目标音乐添加至缓存列表中。
其中,已缓存数据可以是针对目标音乐缓存的数据,可以是目标音乐的全部缓存数据,也可以是目标音乐的部分缓存数据。
例如,若针对目标音乐进行了缓存操作,则存在与目标音乐相对应的已缓存数据,可以将目标音乐添加至缓存列表中,以便在后续对目标音乐进行播放时调用缓存空间中的已缓存数据进行播放。若已缓存数据是目标音乐的部分缓存数据,则可以播放已缓存数据,并继续缓存后续的缓存。
为了能够及时对缓存空间进行清理,例如,若满足预设清理条件时,对缓存空间中的音乐缓存进行清理。
其中,预设清理条件可以是预先设置的触发清理的条件,例如:缓存空间中的音乐缓存达到清理阈值,或者,缓存空间中的音乐缓存的未调用时长达到未调用时长阈值等。
例如,当检测到缓存空间中的音乐缓存达到预设清理条件时,根据预先设定的清理规则对缓存空间中的音乐缓存进行清理。例如:根据先进先出原则对音乐缓存进行清理,或者,将未调用时长达到未调用时长阈值的音乐缓存进行清理。
本申请实施例,通过当接收到音乐播放指令时,确定与音乐播放指令相对应的目标音乐是否已存在于缓存列表中;若否,则根据与目标音乐对应的预设初始缓存比例对目标音乐进行缓存,并播放已缓存的目标音乐;根据目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对目标音乐进行缓存,以在播放的同时进行分段缓存,若在播放目标音乐的过程中接收到切歌指令,则停止目标音乐的播放和缓存,根据播放列表确定待播放音乐,并根据缓 存列表,播放待播放音乐,以避免在用户不需要目标音乐的情况下对目标音乐进行全部缓存,若在播放目标音乐的过程中接收到切歌指令,则停止目标音乐的播放和缓存,根据播放列表确定待播放音乐,并根据缓存列表,播放待播放音乐,以提前对待播放音乐进行预缓存,提高用户体验度,解决了每次点击播放就缓存整首歌曲,无法根据用户的收听情况进行缓存导致的存储空间和流量浪费的状况,实现了对目标音乐进行边播放边缓存,节省了流量和缓存空间的使用。
实施例三
图3为本申请实施例三所提供的一种音乐缓存系统的结构示意图。其中,与上述各实施例相同或相应的术语的解释在此不再赘述。
音乐缓存系统包括缓存管理模块以及播放控制模块。
其中,缓存管理模块设置为确定何时进行缓存,对各种缓存所需的参数进行设置,并对缓存内容进行管理。播放控制模块设置为接收播放指令、切歌指令等,对播放列表进行更新,以及播放音乐。
缓存管理模块包括:预缓存管理子模块、缓存配置子模块、缓存判断子模块、缓存执行和中断子模块以及缓存列表子模块。
其中,预缓存管理子模块设置为针对播放列表中的下一首音乐,进行缓存判断和初始缓存执行。缓存配置子模块,设置为设置或获取初始缓存比例(预设初始缓存比例)、全局缓存比例(当前已缓存比例)、递进缓存比例(预设后续缓存比例)、预缓存的上一首播放进度阈值(预设后续缓存阈值)、预缓存初始缓存比例(预设待播放初始缓存比例)。缓存判断子模块,设置为负责判断缓存是否进行,是否终止的决策。缓存执行和中断子模块,设置为负责执行缓存动作和停止动作。缓存列表子模块,设置为负责管理缓存内容,包括歌曲标识(identity,ID)、缓存进度、缓存空间已满情况下的缓存清理等。
播放控制模块包括:播放控制子模块、播放列表子模块以及播放输出子模块。
其中,播放控制子模块,设置为负责触发音乐的播放、暂停、切歌等。播放列表子模块,设置为负责记录播放列表、更新播放列表、记录播放列表中的当前播放内容的下一首歌曲(待播放音乐)、播放进度(当前播放进度)、预缓存下一首歌曲的播放进度阈值(预设下一首缓存阈值)。播放输出子模块,设置为将已缓存的内容输出到播放器进行声音输出和内容展示输出。
图4为本申请实施例三所提供的一种音乐缓存方法的流程示意图。如图4所述,本实施例的方法包括如下步骤:
1、点击播放歌曲A(目标音乐),播放控制子模块触发缓存判断。
2、判断歌曲A是否在缓存列表中,若歌曲A在缓存列表中,则进行播放输出,若歌曲A不在缓存列表中,则执行3。
3、通过缓存配置子模块中预设的初始缓存比例执行缓存,并通过播放输出子模块进行播放。
4、判断是否出现切歌操作,若出现切歌操作,则停止对歌曲A的缓存,并根据播放列表对下一首歌曲进行缓存和播放,若未出现切歌操作,则执行5。
5、通过缓存配置子模块中的递进缓存比例执行缓存,当播放进度达到预缓存的上一首播放进度阈值时,按照预缓存策略根据播放列表对下一首歌曲进行缓存和播放。
6、在缓存歌曲A的过程中,判断歌曲A的缓存是否完整,若歌曲A的缓存完整,则将歌曲A加入缓存列表中,若歌曲A的缓存不完整,则通过缓存配置子模块中的递进缓存比例执行缓存。
本实施例,通过音乐缓存系统对歌曲进行递进缓存和播放,解决了在高网速情况下对歌曲进行整体缓存带来的流量和缓存空间浪费的状况,实现了根据用户的播放进度,切歌操作对缓存进度进行控制,以节省缓存空间和流量。
实施例四
图5为本申请实施例四所提供的一种音乐缓存装置的结构示意图,该装置包括:缓存判断模块510、初始缓存模块520以及后续缓存模块530。
其中,缓存判断模块510,设置为当接收到音乐播放指令时,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;初始缓存模块520,设置为若否,则根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;后续缓存模块530,设置为根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
在一实施例中,所述装置还包括:缓存播放模块,设置为若是,则根据所述缓存列表中的目标音乐进行播放。
在一实施例中,后续缓存模块530,还设置为若所述当前已缓存比例与所述当前播放进度的差值达到预设后续缓存阈值时,则根据所述当前已缓存比例确 定缓存起始点,根据所述缓存起始点以及预设后续缓存比例对所述目标音乐进行缓存。
在一实施例中,所述装置还包括:缓存列表更新模块,设置为若存在与所述目标音乐相对应的已缓存数据,则将所述目标音乐添加至所述缓存列表中。
在一实施例中,所述装置还包括:切歌缓存模块,设置为若在播放目标音乐的过程中接收到切歌指令,则停止所述目标音乐的播放和缓存;根据播放列表确定待播放音乐,并根据所述缓存列表,播放所述待播放音乐。
在一实施例中,所述装置还包括:待播放缓存模块,设置为当所述当前播放进度达到预设下一首缓存阈值时,获取播放列表中与所述目标音乐相对应的待播放音乐,并根据预设待播放初始缓存比例对所述待播放音乐进行缓存。
在一实施例中,所述装置还包括:音乐缓存清理模块,设置为若满足预设清理条件时,对所述缓存空间中的音乐缓存进行清理。
本申请实施例,通过当接收到音乐播放指令时,确定与音乐播放指令相对应的目标音乐是否已存在于缓存列表中;若否,则根据与目标音乐对应的预设初始缓存比例对目标音乐进行缓存,并播放已缓存的目标音乐;根据目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对目标音乐进行缓存,解决了每次点击播放就缓存整首歌曲,无法根据用户的收听情况进行缓存导致的存储空间和流量浪费的状况,实现了对目标音乐进行边播放边缓存,节省了流量和缓存空间的使用。
本申请实施例所提供的音乐缓存装置可执行本申请任意实施例所提供的音乐缓存方法,具备执行方法相应的功能模块和有益效果。
上述装置所包括的各个单元和模块只是按照功能逻辑进行划分的,但并不局限于上述的划分,只要能够实现相应的功能即可;另外,各功能单元的具体名称也只是为了便于相互区分,并不用于限制本申请实施例的保护范围。
实施例五
图6为本申请实施例五所提供的一种电子设备的结构示意图。图6示出了适于用来实现本申请实施例实施方式的示例性电子设备60的框图。图6显示的电子设备60仅仅是一个示例,不应对本申请实施例的功能和使用范围带来任何限制。
如图6所示,电子设备60以通用计算设备的形式表现。电子设备60的组件可以包括但不限于:一个或者多个处理器或者处理单元601,系统存储器602, 连接不同系统组件(包括系统存储器602和处理单元601)的总线603。
总线603表示几类总线结构中的一种或多种,包括存储器总线或者存储器控制器,外围总线,图形加速端口,处理器或者使用多种总线结构中的任意总线结构的局域总线。举例来说,这些体系结构包括但不限于工业标准体系结构(Industry Standard Architecture,ISA)总线,微通道体系结构(Micro Channel Architecture,MCA)总线,增强型ISA总线、视频电子标准协会(Video Electronics Standards Association,VESA)局域总线以及外围组件互连(Peripheral Component Interconnect,PCI)总线。
电子设备60典型地包括多种计算机系统可读介质。这些介质可以是任何能够被电子设备60访问的可用介质,包括易失性和非易失性介质,可移动的和不可移动的介质。
系统存储器602可以包括易失性存储器形式的计算机系统可读介质,例如随机存取存储器(Random Access Memory,RAM)604和/或高速缓存605。电子设备60可以进一步包括其它可移动/不可移动的、易失性/非易失性计算机系统存储介质。仅作为举例,存储系统606可以用于读写不可移动的、非易失性磁介质(图6未显示,通常称为“硬盘驱动器”)。尽管图6中未示出,可以提供用于对可移动非易失性磁盘(例如“软盘”)读写的磁盘驱动器,以及对可移动非易失性光盘(例如紧凑型光盘只读储存器(Compact Disc Read-Only Memory,CD-ROM),数字通用光盘只读储存器(Digital Versatile Disc Read-Only Memory,DVD-ROM)或者其它光介质)读写的光盘驱动器。在这些情况下,每个驱动器可以通过一个或者多个数据介质接口与总线603相连。系统存储器602可以包括至少一个程序产品,该程序产品具有一组(例如至少一个)程序模块,这些程序模块被配置以执行本申请各实施例的功能。
具有一组(至少一个)程序模块607的程序/实用工具608,可以存储在例如系统存储器602中,这样的程序模块607包括但不限于操作系统、一个或者多个应用程序、其它程序模块以及程序数据,这些示例中的每一个或某种组合中可能包括网络环境的实现。程序模块607通常执行本申请所描述的实施例中的功能和/或方法。
电子设备60也可以与一个或多个外部设备609(例如键盘、指向设备、显示器610等)通信,还可与一个或者多个使得用户能与该电子设备60交互的设备通信,和/或与使得该电子设备60能与一个或多个其它计算设备进行通信的任何设备(例如网卡,调制解调器等等)通信。这种通信可以通过输入/输出 (Input/Output,I/O)接口611进行。并且,电子设备60还可以通过网络适配器612与一个或者多个网络(例如局域网(Local Area Network,LAN),广域网(Wide Area Network,WAN)和/或公共网络,例如因特网)通信。如图6所示,网络适配器612通过总线603与电子设备60的其它模块通信。应当明白,尽管图6中未示出,可以结合电子设备60使用其它硬件和/或软件模块,包括但不限于:微代码、设备驱动器、冗余处理单元、外部磁盘驱动阵列、磁盘阵列(Redundant Arrays of Independent Disks,RAID)系统、磁带驱动器以及数据备份存储系统等。
处理单元601通过运行存储在系统存储器602中的程序,从而执行各种功能应用以及数据处理,例如实现本申请实施例所提供的音乐缓存方法。
实施例六
本申请实施例六还提供一种包含计算机可执行指令的存储介质,所述计算机可执行指令在由计算机处理器执行时用于执行一种音乐缓存方法,该方法包括:
当接收到音乐播放指令时,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;
若否,则根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;
根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
存储介质可以是非暂态(non-transitory)存储介质。
本申请实施例的计算机存储介质,可以采用一个或多个计算机可读的介质的任意组合。计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子(非穷举的列表)包括:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机存取存储器(Random Access Memory,RAM)、只读存储器(ROM)、可擦式可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)或闪存、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本文件中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可 以被指令执行系统、装置或者器件使用或者与其结合使用。
计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。
计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括——但不限于无线、电线、光缆、射频(Radio Frequency,RF)等等,或者上述的任意合适的组合。
可以以一种或多种程序设计语言或其组合来编写用于执行本申请实施例操作的计算机程序代码,所述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言——诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。
因此,虽然通过以上实施例对本申请进行了说明,但是本申请不仅仅限于以上实施例,在不脱离本发明构思的情况下,还可以包括更多其他等效实施例,而本申请的范围由所附的权利要求范围决定。

Claims (10)

  1. 一种音乐缓存方法,包括:
    响应于接收到音乐播放指令,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;
    响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;
    根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
  2. 根据权利要求1所述的方法,在所述确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中之后,还包括:
    响应于与所述音乐播放指令相对应的目标音乐存在于缓存列表中,根据所述缓存列表中的目标音乐进行播放。
  3. 根据权利要求1所述的方法,其中,所述根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存,包括:
    响应于所述当前已缓存比例与所述当前播放进度的差值达到预设后续缓存阈值,根据所述当前已缓存比例确定缓存起始点,根据所述缓存起始点以及预设后续缓存比例对所述目标音乐进行缓存。
  4. 根据权利要求1所述的方法,还包括:
    响应于存在与所述目标音乐相对应的已缓存数据,将所述目标音乐添加至所述缓存列表中。
  5. 根据权利要求1所述的方法,还包括:
    响应于在播放目标音乐的过程中接收到切歌指令,停止所述目标音乐的播放和缓存;
    根据播放列表确定待播放音乐,并根据所述缓存列表,播放所述待播放音乐。
  6. 根据权利要求1所述的方法,还包括:
    响应于所述当前播放进度达到预设下一首缓存阈值,获取播放列表中与所述目标音乐相对应的待播放音乐,并根据预设待播放初始缓存比例对所述待播放音乐进行缓存。
  7. 根据权利要求1所述的方法,还包括:
    响应于满足预设清理条件,对缓存空间中的音乐缓存进行清理。
  8. 一种音乐缓存装置,包括:
    缓存判断模块,设置为响应于接收到音乐播放指令,确定与所述音乐播放指令相对应的目标音乐是否已存在于缓存列表中;
    初始缓存模块,设置为响应于与所述音乐播放指令相对应的目标音乐不存在于缓存列表中,根据与所述目标音乐对应的预设初始缓存比例对所述目标音乐进行缓存,并播放已缓存的目标音乐;
    后续缓存模块,设置为根据所述目标音乐的当前播放进度、当前已缓存比例以及预设后续缓存比例,对所述目标音乐进行缓存。
  9. 一种电子设备,所述电子设备包括:
    一个或多个处理器;
    存储装置,设置为存储一个或多个程序,
    当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1-7中任一所述的音乐缓存方法。
  10. 一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-7中任一所述的音乐缓存方法。
PCT/CN2022/127239 2021-10-26 2022-10-25 音乐缓存方法、装置、电子设备及存储介质 WO2023072028A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111246764.5 2021-10-26
CN202111246764.5A CN113986849A (zh) 2021-10-26 2021-10-26 音乐缓存方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2023072028A1 true WO2023072028A1 (zh) 2023-05-04

Family

ID=79741511

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/127239 WO2023072028A1 (zh) 2021-10-26 2022-10-25 音乐缓存方法、装置、电子设备及存储介质

Country Status (2)

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

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113986849A (zh) * 2021-10-26 2022-01-28 中国第一汽车股份有限公司 音乐缓存方法、装置、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040138948A1 (en) * 2002-12-13 2004-07-15 Stephen Loomis Apparatus and method for skipping songs without delay
CN108111866A (zh) * 2016-11-24 2018-06-01 法乐第(北京)网络科技有限公司 音视频播放的控制方法及系统
CN108287680A (zh) * 2018-02-12 2018-07-17 宁夏灵智科技有限公司 音乐播放方法、装置、电子设备及存储介质
CN112752117A (zh) * 2020-12-30 2021-05-04 百果园技术(新加坡)有限公司 一种视频缓存方法、装置、设备及存储介质
CN112804579A (zh) * 2019-11-14 2021-05-14 上海哔哩哔哩科技有限公司 视频播放方法、装置、计算机设备和可读存储介质
CN113986849A (zh) * 2021-10-26 2022-01-28 中国第一汽车股份有限公司 音乐缓存方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040138948A1 (en) * 2002-12-13 2004-07-15 Stephen Loomis Apparatus and method for skipping songs without delay
CN108111866A (zh) * 2016-11-24 2018-06-01 法乐第(北京)网络科技有限公司 音视频播放的控制方法及系统
CN108287680A (zh) * 2018-02-12 2018-07-17 宁夏灵智科技有限公司 音乐播放方法、装置、电子设备及存储介质
CN112804579A (zh) * 2019-11-14 2021-05-14 上海哔哩哔哩科技有限公司 视频播放方法、装置、计算机设备和可读存储介质
CN112752117A (zh) * 2020-12-30 2021-05-04 百果园技术(新加坡)有限公司 一种视频缓存方法、装置、设备及存储介质
CN113986849A (zh) * 2021-10-26 2022-01-28 中国第一汽车股份有限公司 音乐缓存方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN113986849A (zh) 2022-01-28

Similar Documents

Publication Publication Date Title
EP3389044B1 (en) Management layer for multiple intelligent personal assistant services
US20190066671A1 (en) Far-field speech awaking method, device and terminal device
US7720985B2 (en) Content receiving apparatus and content receiving method
US7568057B2 (en) Method and apparatus for maintaining synchronization of audio in a computing system
JP2019185011A (ja) アプリケーションプログラムをウェイクアップする処理方法、装置及び記憶媒体
CN109240107B (zh) 一种电器设备的控制方法、装置、电器设备和介质
JP2020079921A (ja) 音声インタラクション実現方法、装置、コンピュータデバイス及びプログラム
JP2009502050A (ja) レンダリング済待ち行列を伴うgpuタイムライン
CN111177453B (zh) 控制音频播放的方法、装置、设备及计算机可读存储介质
EP1860555A2 (en) Media subsystem, method and computer program product for adaptive media buffering
CN112333476B (zh) 一种视频加载方法及装置
WO2023072028A1 (zh) 音乐缓存方法、装置、电子设备及存储介质
US20200241835A1 (en) Method and apparatus of audio/video switching
CN111402877A (zh) 基于车载多音区的降噪方法、装置、设备和介质
CN109599133B (zh) 语言音轨的切换方法、装置、计算机设备及存储介质
US20240118864A1 (en) Method and device for mixedly playing a program
WO2020044086A1 (zh) 一种文件传输与播放的方法、装置和设备/终端/服务器
CN113672748A (zh) 多媒体信息播放方法及装置
WO2022134997A1 (zh) 视频跳转播放方法、装置、终端设备及存储介质
CN114416012A (zh) 音频续播方法及装置
CN108182930B (zh) 音效处理方法、设备及音视频点播系统
US20080147918A1 (en) Method and apparatus for maintaining synchronization of audio in a computing system
WO2023029821A1 (zh) 视频缓存播放方法、装置、电子设备及存储介质
US20150312369A1 (en) Checkpoints for media buffering
WO2004092967A1 (ja) 対話装置、対話方法及び対話プログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22885905

Country of ref document: EP

Kind code of ref document: A1