Music caching method, device, electronic device and storage medium

By determining whether the target music exists in the cache list in the in-vehicle entertainment system, and caches and subsequent caches are cached according to the preset ratio, the problem of waste traffic and cache space in the in-vehicle entertainment system when playing music is solved, and caches are realized while playing. Improve resource utilization efficiency.

CN113986849BActive Publication Date: 2024-12-27CHINA FAW CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

Application Number
CN202111246764.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-26
Publication Date
2024-12-27
Estimated Expiration
2041-10-26

AI Technical Summary

Technical Problem

When playing music in the car entertainment system, the existing technology cannot effectively save traffic and cache space, especially when users frequently cut songs or play them, resulting in waste of resources.

Method used

When receiving music playback instructions, determine whether the target music exists in the cache list. If otherwise, cache is cached according to the preset initial cache ratio, and subsequent cache is performed according to the current playback progress and cached ratio during playback, so as to achieve cache while playing .

Benefits of technology

It effectively saves traffic and cache space, avoids the waste of resources of the entire song every time you click to play, and improves the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113986849B_ABST
    Figure CN113986849B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a music caching method, device, electronic device and storage medium, the method comprising: when receiving a music playing instruction, determining whether the target music corresponding to the music playing instruction already exists in the cache list; if not, caching the target music according to the preset initial cache ratio corresponding to the target music, and playing the cached target music; caching the target music according to the current playing progress of the target music, the current cache ratio and the preset subsequent cache ratio. Through the technical solution of the embodiment of the present invention, the technical effect of caching the target music while playing is achieved, saving the use of traffic and cache space.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the technical field of music playing, and in particular to a music caching method, device, electronic device and storage medium. Background Art

[0002] Internet of Vehicles services have gradually entered the lives of users. The in-car entertainment system is a medium for providing services to users, providing users with an in-car auditory experience and meeting their music listening needs while driving.

[0003] At present, the way of playing music through an external USB flash drive in the in-car entertainment system can no longer meet the user's demand for rich and high-quality music. Online music has gradually been used in the in-car scene. However, online music involves problems such as traffic consumption during the loading process and cache storage after loading. Under the current 4G network state, the peak network speed can usually reach 100Mbps, that is, the transmission speed per second is 12.5MB. If 10MB of music is cached, the entire music can be cached within 1s. Under the 5G network, the speed will be even faster.

[0004] However, the traffic of the in-car 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 the user clicks to play, it will lead to a waste of traffic and cache space resources when the user switches songs. Summary of the invention

[0005] The embodiments of the present invention provide a music caching method, device, electronic device and storage medium to achieve the technical effect of caching target music while playing it, thereby saving traffic and cache space.

[0006] In a first aspect, an embodiment of the present invention provides a music caching method, the method comprising:

[0007] When a music playing instruction is received, determining whether the target music corresponding to the music playing instruction already exists in the cache list;

[0008] If not, caching the target music according to a preset initial cache ratio corresponding to the target music, and playing the cached target music;

[0009] The target music is cached according to the current playing progress of the target music, the current cached ratio and the preset subsequent cache ratio.

[0010] In a second aspect, an embodiment of the present invention further provides a music caching device, the device comprising:

[0011] A cache determination module, for determining, when receiving a music playing instruction, whether the target music corresponding to the music playing instruction already exists in the cache list;

[0012] an initial caching module, for caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music;

[0013] The subsequent caching module is used to cache the target music according to the current playing progress of the target music, the current cached ratio and the preset subsequent cache ratio.

[0014] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0015] one or more processors;

[0016] a storage device for storing one or more programs,

[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the music caching method as described in any one of the embodiments of the present invention.

[0018] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the music caching method as described in any one of the embodiments of the present invention.

[0019] The technical solution of the embodiment of the present invention is as follows: when a music playing instruction is received, it is determined whether the target music corresponding to the music playing instruction already exists in the cache list; if not, 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 cached ratio and the preset subsequent cache ratio, thereby solving the problem of wasting storage space and traffic caused by caching the entire song every time the play is clicked and being unable to cache according to the user's listening situation, and achieving the technical effect of caching the target music while playing, saving traffic and cache space. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] Figure 1A schematic diagram of a flow chart of a music caching method provided in Embodiment 1 of the present invention;

[0022] Figure 2 A schematic diagram of a flow chart of a music caching method provided in Embodiment 2 of the present invention;

[0023] Figure 3 A schematic diagram of the structure of a music caching system provided by Embodiment 3 of the present invention;

[0024] Figure 4 A schematic diagram of a flow chart of a music caching method provided in Embodiment 3 of the present invention;

[0025] Figure 5 A schematic diagram of the structure of a music caching device provided by Embodiment 4 of the present invention;

[0026] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0027] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0028] Embodiment 1

[0029] Figure 1 This is a flow chart of a music caching method provided in Embodiment 1 of the present invention. This embodiment is applicable to the situation where music is cached during music playback. The method can be executed by a music caching device, which can be implemented in the form of software and / or hardware. The hardware can be an electronic device. Optionally, the electronic device can be a mobile terminal, a vehicle-mounted terminal, etc.

[0030] like Figure 1 The method of this embodiment specifically includes the following steps:

[0031] S110: When a music playing instruction is received, determine whether the target music corresponding to the music playing instruction already exists in the cache list.

[0032] The music playing instruction may be an instruction for playing music. The target music may be the music that is currently desired to be played. The cache list may be a list of music corresponding to each cached data.

[0033] Specifically, when a music playing instruction is received, the music playing instruction is parsed to determine the target music contained in the music playing instruction. In the cache list, it is searched whether the target music exists to determine whether there is cached data corresponding to the target music in the cache space.

[0034] Optionally, when the user wants to play target music, the user can trigger the target music by selecting a triggering method and generate a music playing instruction corresponding to the target music.

[0035] S120: If not, cache the target music according to a preset initial cache ratio corresponding to the target music, and play the cached target music.

[0036] The preset initial cache ratio may be a pre-set cache ratio, such as 10% or 20% of the target music, etc., and may be adjusted according to actual needs.

[0037] Specifically, if the target music does not exist in the cache list, it indicates that the cache space does not store the cached data corresponding to the target music, and needs to be cached. At this time, the target music can be preliminarily 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.

[0038] S130: Cache the target music according to the current playing progress of the target music, the current cache ratio, and the preset subsequent cache ratio.

[0039] The current playing progress may be the proportion of the target music currently being played. The current cached proportion may be the proportion of the target music currently cached. The preset subsequent cache proportion may be the proportion of the target music that can be cached in the next stage.

[0040] Specifically, during the process of playing the target music, the current playing progress of the target music is obtained, and the current cache ratio is determined. Then, when the current playing progress reaches the condition for continuing to cache, the cache of the preset subsequent cache ratio is performed according to the current cached ratio.

[0041] Exemplarily, when the current playback progress of the target music reaches the preset progress, it can indicate that there is a need to continue caching the target music. At this time, the current cached ratio can be determined to determine whether the current cached ratio has reached the preset initial cache ratio. If so, the target music cache of the next preset subsequent cache ratio can be continued based on the preset initial cache ratio. If not, the cache can be cached to the preset initial cache ratio based on the current cached ratio, and then the preset subsequent cache ratio can be continued to be cached. It can also be cached to the preset initial cache ratio based on the current cached ratio, and at the same time, cache is performed according to the preset subsequent cache ratio based on the preset initial cache ratio, that is, cached simultaneously.

[0042] 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, it also includes: if so, playing according to the target music in the cache list.

[0043] Specifically, if the target music exists in the cache list, it indicates that the cache space has cached data corresponding to the target music, and no cache is required. At this time, the cached data corresponding to the target music in the cache space can be retrieved according to the target music in the cache list and played.

[0044] The technical solution of the embodiment of the present invention is as follows: when a music playing instruction is received, it is determined whether the target music corresponding to the music playing instruction already exists in the cache list; if not, 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 cached ratio and the preset subsequent cache ratio, thereby solving the problem of wasting storage space and traffic caused by caching the entire song every time the play is clicked and being unable to cache according to the user's listening situation, and achieving the technical effect of caching the target music while playing, saving traffic and cache space.

[0045] Embodiment 2

[0046] Figure 2 This is a flowchart of a music caching method provided in Embodiment 2 of the present invention. This embodiment is based on the above embodiments. For the subsequent caching method and the caching method when switching songs, please refer to the technical solution of this embodiment. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0047] like Figure 2 The method of this embodiment specifically includes the following steps:

[0048] S210: When a music playing instruction is received, determine whether the target music corresponding to the music playing instruction already exists in the cache list.

[0049] S220: If not, cache the target music according to a preset initial cache ratio corresponding to the target music, and play the cached target music.

[0050] S230: If the difference between the current cached ratio and the current playback progress reaches a preset subsequent cache threshold, a cache start point is determined according to the current cached ratio, and the target music is cached according to the cache start point and the preset subsequent cache ratio.

[0051] The preset subsequent cache threshold may be a preset value for triggering the next cache. The cache starting point may be a cache starting position of a preset subsequent cache ratio.

[0052] Specifically, if the difference between the current cached ratio and the current playback progress reaches a preset subsequent cache threshold, a cache start point corresponding to the current cached ratio is determined, and then cache is started from the cache start point, and the cache ratio is a preset subsequent cache ratio.

[0053] It should be noted that when performing subsequent caching for the first time, the preset initial cache ratio may be determined as the cache starting point. When performing subsequent caching for the second time or thereafter, the corresponding preset initial cache ratio and preset subsequent cache ratio may be determined according to the current cached ratio, and the cache starting point may be determined.

[0054] Exemplarily, 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 cache starting point. If the difference between the current cached ratio and the current playback progress reaches the preset subsequent cache threshold, the current cached ratio is 50%, and the cache starting point can be determined to be 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 can be determined. For example, if the current cached ratio is 48%, the cache starting point can be 50%.

[0055] It should be noted that if the current cached ratio has not reached the cache starting point, you can wait until the current cached ratio reaches the cache starting point and start subsequent caching from the cache starting point. You can also simultaneously perform caching between the current cached ratio and the cache starting point and subsequent caching starting from the cache starting point.

[0056] S240: If a song switching instruction is received during 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 play list, and the music to be played is played according to the cache list.

[0057] 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 of music to be played, such as a list of songs to be played, which is a list of music that the user wants to play. The music to be played may be the next music to be played corresponding to the target music.

[0058] Specifically, if a song switching instruction is received during 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. At this time, the playing and caching of the target music are stopped. Then, the next music corresponding to the target music in the play list is determined to be the music to be played, and the music to be played is searched in the cache list. If it is found, it is played. If it is not found, it is played while caching. The playing and caching method for the music to be played can be the same as that for the target music.

[0059] It should be noted that if 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, the music triggered by the user can be added to the playlist and determined as the music to be played.

[0060] It should also be noted that the music in the playlist can be played in a single loop, sequential play, random play, etc., and the music to be played corresponding to the target music can be determined based on the play mode.

[0061] S250: When the current playing progress reaches a preset next song cache threshold, obtain the music to be played corresponding to the target music in the playlist, and cache the music to be played according to a preset initial cache ratio to be played.

[0062] The next cache threshold may be a playback progress value that triggers caching of the music to be played. The preset initial cache ratio to be played may be a cache ratio for pre-caching the music to be played when playing the target music.

[0063] Specifically, when the current playing progress reaches the preset next cache threshold, it indicates that the target music is about to be played, and the next music can be cached in advance. The music to be played corresponding to the target music is determined according to the playlist, and the music to be played is cached at a preset initial cache ratio.

[0064] It should be noted that the values ​​of the preset initial buffer ratio to be played and the preset initial buffer ratio can be the same or different and can be set according to actual needs. Usually, the preset initial buffer ratio to be played is less than or equal to the preset initial buffer ratio.

[0065] In order to expand the cache list so that the target music does not need to be cached again when it is played again in the future, optionally, if there is cached data corresponding to the target music, the target music is added to the cache list.

[0066] The cached data may be data cached for the target music, may be all cached data for the target music, or may be partial cached data for the target music.

[0067] Specifically, if a cache operation is performed on the target music, and there is cached data corresponding to the target music, the target music can be added to the cache list, so that when the target music is played later, the cached data in the cache space can be called for playing. If the cached data is part of the cached data of the target music, the cached data can be played, and the subsequent cache can continue to be cached.

[0068] In order to clean up the cache space in time, optionally, if a preset cleaning condition is met, the music cache in the cache space is cleaned up.

[0069] Among them, the preset cleaning condition can be a pre-set condition for triggering cleaning, for example: the music cache in the cache space reaches a cleaning threshold, or the uncalled time length of the music cache in the cache space reaches an uncalled time length threshold, etc.

[0070] Specifically, when it is detected that the music cache in the cache space reaches a preset cleaning condition, the music cache in the cache space is cleaned according to a preset cleaning rule, for example, the music cache is cleaned according to the first-in-first-out principle, or the music cache whose unused time reaches an unused time threshold is cleaned.

[0071] The technical solution of the embodiment of the present invention is as follows: when a music playing instruction is received, it is determined whether the target music corresponding to the music playing instruction already exists in the cache list; if not, the target music is cached according to the 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 cached ratio and the preset subsequent cache ratio, so as to cache in segments while playing; if a song switching instruction is received during the playing of the target music, the playing and caching of the target music is stopped, the music to be played is determined according to the play list, and the music to be played is played according to the cache list, so as to avoid caching all the target music when the user does not need the target music; if a song switching instruction is received during the playing of the target music, the playing and caching of the target music is stopped, the music to be played is determined according to the play list, and the music to be played is played according to the cache list, so as to pre-cache the music to be played in advance, improve the user experience, solve the problem of wasting storage space and traffic caused by caching the entire song every time the play is clicked, and failing to cache according to the user's listening situation, and achieve the technical effect of caching the target music while playing, saving traffic and cache space.

[0072] Embodiment 3

[0073] As an optional implementation scheme of the above embodiments, Figure 3This is a structural diagram of a music caching system provided by Embodiment 3 of the present invention, wherein the explanations of terms that are the same as or corresponding to the above embodiments are not repeated here.

[0074] The music cache system includes a cache management module and a play control module.

[0075] The cache management module is used to determine when to cache, set various cache parameters, and manage cache content. The playback control module is used to receive playback instructions, song switching instructions, etc., update the playlist, and play music.

[0076] 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.

[0077] Among them, the pre-cache management submodule is used to perform cache judgment and initial cache execution for the next music in the playlist. The cache configuration submodule is used to set or obtain the initial cache ratio (preset initial cache ratio), the global cache ratio (currently cached ratio), the progressive cache ratio (preset subsequent cache ratio), the pre-cached previous playback progress threshold (preset subsequent cache threshold), and the pre-cache initial cache ratio (preset initial cache ratio to be played). The cache judgment submodule is responsible for judging whether the cache is in progress and whether to terminate the decision. The cache execution and interruption submodule is responsible for executing cache actions and stopping actions. The cache list submodule is responsible for managing cache content, including song ID, cache progress, cache cleaning when the cache space is full, etc.

[0078] The play control module includes: a play control submodule, a play list submodule and a play output submodule.

[0079] The playback control submodule is responsible for triggering the playback, pause, song switching, etc. of the music. The playlist submodule is responsible for recording the playlist, updating the playlist, recording the next song (music to be played) of the current playback content in the playlist, the playback progress (current playback progress), and the pre-caching playback progress threshold of the next song (pre-set next song cache threshold). The playback output submodule is used to output the cached content to the player for sound output and content display output.

[0080] Figure 4 FIG. 1 is a flow chart of a music caching method provided by Embodiment 3 of the present invention. Figure 4 The method of this embodiment specifically includes the following steps:

[0081] 1. Click to play song A (target music), and the playback control submodule triggers cache judgment.

[0082] 2. Determine whether song A is in the cache list. If so, play it. If not, execute 3.

[0083] 3. Execute caching through the initial cache ratio preset in the cache configuration submodule, and play through the playback output submodule.

[0084] 4. Determine whether a song switching operation occurs. If so, stop caching song A and cache and play the next song according to the playlist. If not, execute 5.

[0085] 5. Execute caching through the progressive cache ratio in the cache configuration submodule. When the playback progress reaches the pre-cached previous playback progress threshold, cache and play the next song according to the playlist according to the pre-caching strategy.

[0086] 6. During the process of caching song A, determine whether the cache of song A is complete. If so, add song A to the cache list. If not, perform caching through the progressive cache ratio in the cache configuration submodule.

[0087] The technical solution of this embodiment progressively caches and plays songs through a music cache system, thereby solving the problem of waste of traffic and cache space caused by overall caching of songs under high network speed conditions, and achieving the technical effect of controlling the cache progress according to the user's playback progress and song switching operations to save cache space and traffic.

[0088] Embodiment 4

[0089] Figure 5 This is a structural diagram of a music caching device provided in Embodiment 4 of the present invention. The device includes: a cache determination module 510, an initial cache module 520 and a subsequent cache module 530.

[0090] Among them, the cache judgment module 510 is used to determine whether the target music corresponding to the music playback instruction already exists in the cache list when a music playback instruction is received; the initial cache module 520 is used to cache the target music according to a preset initial cache ratio corresponding to the target music, and play the cached target music if not; the subsequent cache module 530 is used to cache the target music according to the current playback progress of the target music, the current cache ratio and the preset subsequent cache ratio.

[0091] Optionally, the device further includes: a cache playback module, configured to play the target music in the cache list.

[0092] Optionally, the initial cache module 520 is also used to determine the cache starting point 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, and cache the target music according to the cache starting point and the preset subsequent cache ratio.

[0093] Optionally, 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.

[0094] Optionally, the device also includes: a song switching cache module, which is used to stop the playback and caching of the target music if a song switching instruction is received during the playback of the target music; determine the music to be played according to the play list, and play the music to be played according to the cache list.

[0095] Optionally, the device also includes: a to-be-played cache module, which is used to obtain the to-be-played music corresponding to the target music in the playlist when the current playback progress reaches a preset next-song cache threshold, and cache the to-be-played music according to a preset to-be-played initial cache ratio.

[0096] Optionally, the device further comprises: a music cache cleaning module, configured to clean up the music cache in the cache space if a preset cleaning condition is met.

[0097] The technical solution of the embodiment of the present invention is as follows: when a music playing instruction is received, it is determined whether the target music corresponding to the music playing instruction already exists in the cache list; if not, 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 cached ratio and the preset subsequent cache ratio, thereby solving the problem of wasting storage space and traffic caused by caching the entire song every time the play is clicked and being unable to cache according to the user's listening situation, and achieving the technical effect of caching the target music while playing, saving traffic and cache space.

[0098] The music caching device provided in the embodiment of the present invention can execute the music caching method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0099] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.

[0100] Embodiment 5

[0101] Figure 6 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Figure 6 A block diagram of an exemplary electronic device 60 suitable for implementing exemplary embodiments of the present invention is shown. Figure 6 The electronic device 60 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0102] like Figure 6 As shown, the electronic device 60 is in the form of a general 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 connecting different system components (including the system memory 602 and the processing unit 601).

[0103] 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. For example, these 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.

[0104] The electronic device 60 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 60, including volatile and non-volatile media, removable and non-removable media.

[0105] 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 / non-volatile computer system storage media. By way of example only, the storage system 606 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 603 via one or more data medium interfaces. The 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 perform the functions of the embodiments of the present invention.

[0106] 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 or some combination may include an implementation of a network environment. Program modules 607 generally perform the functions and / or methods of the embodiments described herein.

[0107] The electronic device 60 may also communicate with one or more external devices 609 (e.g., keyboards, pointing devices, displays 610, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 60, and / or may communicate with any device that enables the electronic device 60 to communicate with one or more other computing devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface 611. Furthermore, the electronic device 60 may also 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 a network adapter 612. As shown, the network adapter 612 communicates with other modules of the electronic device 60 via a bus 603. It should be understood that although Figure 6 Not shown, other hardware and / or software modules may be used in conjunction with the 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.

[0108] 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 in the embodiment of the present invention.

[0109] Embodiment 6

[0110] Embodiment 6 of the present invention further provides a storage medium including computer executable instructions, wherein the computer executable instructions are used to execute a music caching method when executed by a computer processor, the method comprising:

[0111] When a music playing instruction is received, determining whether the target music corresponding to the music playing instruction already exists in the cache list;

[0112] If not, caching the target music according to a preset initial cache ratio corresponding to the target music, and playing the cached target music;

[0113] The target music is cached according to the current playing progress of the target music, the current cached ratio and the preset subsequent cache ratio.

[0114] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0115] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0116] 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.

[0117] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0118] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A music caching method, characterized in that: include: When a music playing instruction is received, determining whether the target music corresponding to the music playing instruction already exists in the cache list; If not, caching the target music according to a preset initial cache ratio corresponding to the target music, and playing the cached target music; The target music is cached according to the current playing progress, the current cached ratio and the preset subsequent cache ratio of the target music; wherein the current playing progress is the current playing ratio of the target music, the current cached ratio is the ratio of the target music occupied by the currently cached data, and the preset subsequent cache ratio is the ratio of the target music to be cached in the next stage; The step of caching the target music according to the current playing progress of the target music, the current cache ratio and the preset subsequent cache ratio includes: If the difference between the current cached ratio and the current playback progress reaches a preset subsequent cache threshold, a cache starting point is determined according to the current cached ratio, and the target music is cached according to the cache starting point and the preset subsequent cache ratio; wherein, when subsequent caching is performed for the first time, a preset initial cache ratio is determined as the cache starting point, and when subsequent caching is performed for the second time and thereafter, a corresponding preset initial cache ratio and a preset subsequent cache ratio are determined according to the current cached ratio, and a cache starting point is determined; Wherein, the music caching method further includes: When the current playing progress reaches a preset next music cache threshold, the music to be played corresponding to the target music in the playlist is obtained, and the music to be played is cached according to a preset initial cache ratio to be played.

2. The method according to claim 1, characterized in that After determining whether the target music corresponding to the music playing instruction already exists in the cache list, the method further includes: If so, the target music in the cache list is played.

3. The method according to claim 1, characterized in that Also includes: If there is cached data corresponding to the target music, the target music is added to the cache list.

4. The method according to claim 1, characterized in that Also includes: If a song switching instruction is received during the playing of the target music, the playing and caching of the target music are stopped; The music to be played is determined according to the play list, and the music to be played is played according to the cache list.

5. The method according to claim 1, characterized in that Also includes: If the preset cleaning condition is met, the music cache in the cache space is cleaned.

6. A music caching device, characterized in that: include: A cache determination module, for determining, when receiving a music playing instruction, whether the target music corresponding to the music playing instruction already exists in the cache list; an initial caching module, for caching the target music according to a preset initial caching ratio corresponding to the target music, and playing the cached target music if no; A subsequent caching module is used to cache the target music according to the current playing progress of the target music, the current cached ratio and the preset subsequent cache ratio; wherein the current playing progress is the current playing ratio of the target music, the current cached ratio is the ratio of the target music occupied by the current cached data, and the preset subsequent cache ratio is the ratio of the target music to be cached in the next stage; Wherein, the subsequent cache module includes: A target music cache unit, for determining a cache starting point according to the current cached ratio, and caching the target music according to the cache starting point and the preset subsequent cache ratio, if the difference between the current cached ratio and the current playback progress reaches a preset subsequent cache threshold; wherein, when the subsequent cache is performed for the first time, the preset initial cache ratio is determined as the cache starting point, and when the subsequent cache is performed for the second time and thereafter, the corresponding preset initial cache ratio and preset subsequent cache ratio are determined according to the current cached ratio, and the cache starting point is determined; Wherein, the device further comprises: The to-be-played cache module is used to obtain the to-be-played music corresponding to the target music in the playlist when the current playing progress reaches the preset next cache threshold, and cache the to-be-played music according to the preset to-be-played initial cache ratio.

7. An electronic device, characterized in that: The electronic device comprises: 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 as described in any one of claims 1-5.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the music caching method as described in any one of claims 1 to 5 is implemented.

Citation Information

Patent Citations

  • Method and device for playing network videos online and smart television

    CN102724584A

  • Method and device for playing multimedia file

    CN104618418A

  • Method for controlling playing synchronizing and intelligent speaker

    CN106326010A

  • Method, system and device for playing music during caching

    CN107958036A

  • Video automatic caching method, terminal and computer readable storage medium

    CN108769787A