CN114417050B - Intelligent caching method and device, storage medium and electronic equipment - Google Patents

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

Info

Publication number
CN114417050B
CN114417050B CN202210223055.3A CN202210223055A CN114417050B CN 114417050 B CN114417050 B CN 114417050B CN 202210223055 A CN202210223055 A CN 202210223055A CN 114417050 B CN114417050 B CN 114417050B
Authority
CN
China
Prior art keywords
cached
song
songs
schedule
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210223055.3A
Other languages
Chinese (zh)
Other versions
CN114417050A (en
Inventor
曾德钧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Airsmart Technology Co Ltd
Original Assignee
Shenzhen Airsmart Technology Co Ltd
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 Shenzhen Airsmart Technology Co Ltd filed Critical Shenzhen Airsmart Technology Co Ltd
Priority to CN202210223055.3A priority Critical patent/CN114417050B/en
Publication of CN114417050A publication Critical patent/CN114417050A/en
Application granted granted Critical
Publication of CN114417050B publication Critical patent/CN114417050B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/61Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/68Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/686Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using information manually generated, e.g. tags, keywords, comments, title or artist information, time, location or usage information, user ratings
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The invention discloses an intelligent caching method, an intelligent caching device, a storage medium and electronic equipment. The method comprises the following steps: acquiring a pre-cached song single group, a pre-cached song single number and a task schedule of a user, wherein the task schedule comprises schedule content, schedule starting time and schedule ending time; determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list set according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length; and caching the target songs to be cached in each pre-cached song list in the pre-cached song list into a memory of the playing device according to the first quantity. The invention solves the technical problem that proper songs cannot be played in a network-free state when the task schedule time starts.

Description

Intelligent caching method and device, storage medium and electronic equipment
Technical Field
The invention relates to the field of computers, in particular to an intelligent caching method, an intelligent caching device, a storage medium and electronic equipment.
Background
Along with the improvement of living standard of people, the mental demand is higher and higher, and the music can be played at the beginning of a task schedule, so that the excitation degree of the cerebral cortex of a user can be improved, the fatigue can be relieved, and the emotion can be improved. However, in the prior art, the playing device is extremely dependent on the network, the use place is limited, when the task schedule of the user starts in the environment without network link, the playing device cannot work, cannot play proper music when the task schedule starts, and cannot meet the requirements of the user.
Disclosure of Invention
The embodiment of the invention provides an intelligent caching method, an intelligent caching device, a storage medium and electronic equipment, and aims to at least solve the technical problem that a proper song cannot be played in a network-free state when a task schedule starts.
According to an aspect of an embodiment of the present invention, an intelligent caching method is provided, including: acquiring a single group of pre-cached songs, the single number of the pre-cached songs and a task schedule of a user, wherein the task schedule comprises schedule content, schedule starting time and schedule ending time; determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list set according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length; and caching the target songs to be cached in each pre-cached song list in the pre-cached song list group into a memory of the playing device according to the first quantity.
According to another aspect of the embodiments of the present invention, there is provided an intelligent cache apparatus, including: the system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a single group of pre-cached songs, the single number of the pre-cached songs and a task schedule of a user, and the task schedule comprises schedule content, schedule starting time and schedule ending time; a first determining module, configured to determine, according to a schedule time length from the schedule start time to the schedule end time, a first number of first target songs to be cached in each of the pre-cached song lists in the pre-cached song lists, where a total song duration of the first number of songs is greater than or equal to the schedule time length; and the first caching module is used for caching the target songs to be cached in each pre-cached song list in the pre-cached song list into a memory of the playing device according to the first quantity.
As an optional example, the method further includes: a second obtaining module, configured to obtain a size of a memory of the playback device; a second determining module, configured to determine a second number of second target songs to be cached according to the size of the memory, where a total song capacity of the second target songs is smaller than or equal to the size of the memory; and a first processing module, configured to, when the total duration of the second target song is less than or equal to a product of the schedule time length and a number of pre-cached songs, and when the second number is less than the first number, divide the number of pre-cached songs by the second number, so as to obtain the number of target songs of the songs to be cached in each pre-cached song list.
As an optional example, the method further includes: a third determining module, configured to determine a target time length from a current time to the schedule start time; a third determining module, configured to determine a third number of third target songs according to the current network rate and the target time duration; and a second processing module, configured to divide the third number by the pre-cached number of songs when the total song duration of the third target song is less than or equal to a product of the schedule time length and the pre-cached number of songs, so as to obtain the target song number of the song to be cached in each pre-cached number of songs.
As an optional example, the method further includes: and the second cache module is used for caching the target song in the target song list into the memory of the playing device under the condition that the target song list in the pre-cached song list is selected and cached by the user.
As an optional example, the method further includes: and the first playing module is used for playing the target song when the current time reaches the schedule starting time.
As an optional example, the method further includes: and the clearing module is used for clearing the cache data in the memory of the playing device when the current time reaches the schedule ending time.
As an optional example, the method further includes: a searching module, configured to search whether the requested song exists in a memory of the playing device when the current time is between the schedule start time and the schedule end time and the user requests the song from the playing device; and the second playing module is used for playing the on-demand song in the memory of the playing device under the condition that the search result shows that the on-demand song exists.
According to another aspect of the embodiments of the present invention, there is also provided a storage medium having a computer program stored therein, wherein the computer program executes the above-mentioned intelligent caching method when being executed by a processor.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor is configured to execute the foregoing intelligent caching method through the computer program.
In the embodiment of the invention, a pre-cached single song group is obtained, the pre-cached single song group and a task schedule of a user are adopted, and the task schedule comprises schedule content, schedule starting time and schedule ending time; determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song single group according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length; according to the method for caching the target songs to be cached in each pre-cached song list in the pre-cached song list group into the memory of the playing device, because the target songs to be cached in each pre-cached song list are cached into the memory of the playing device in the method, the purpose that the songs in each pre-cached song list are contained in the content of the playing device is achieved, and the technical problem that the proper songs cannot be played in a network-free state when the task schedule time starts is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention and do not constitute a limitation of the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative intelligent caching method according to an embodiment of the invention;
FIG. 2 is an offline caching schematic diagram of an alternative intelligent caching method according to an embodiment of the invention;
FIG. 3 is an offline playback schematic diagram of an alternative intelligent caching method according to an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an alternative intelligent cache apparatus according to an embodiment of the present invention;
fig. 5 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in other sequences than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to a first aspect of the embodiments of the present invention, there is provided an intelligent caching method, optionally as shown in fig. 1, the method includes:
s102, obtaining a single group of pre-cached songs, the single number of the pre-cached songs and a task schedule of a user, wherein the task schedule comprises schedule content, schedule starting time and schedule ending time;
S104, determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list set according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length;
s106, caching the target songs to be cached in each pre-cached song list in the pre-cached song list group into the memory of the playing device according to the first quantity.
Alternatively, in this embodiment, the pre-cached vocals may be vocals of different categories, there may be one or more of them, and may be work vocals, party vocals, and drive vocals, each of which contains songs associated with a genre of the vocals. The task schedule is a schedule to be made by a user at the future time and comprises task schedule content, task schedule starting time and task schedule ending time, and can be 'party in 1 month and 1 day 9:00 in 2022 to 1 month and 1 day and 11:00 in 2022', wherein the task schedule content is 'party', the task schedule starting time is '1 month and 1 day in 2022 and 9: 00' and the task schedule ending time is '1 month and 1 day in 2022 and 11: 00'. The first number is the number of first target songs that need to be cached per pre-cached song list and may be 1, 10, etc.
Optionally, in this embodiment, the pre-cached song single group to be cached is obtained, and may be a pre-cached song single group selected by a user, or may be a song list group played or collected by the user in the near term, or a song list group including different types of songs is randomly selected, a task schedule created by the user is obtained from an APP, or a task schedule actively uploaded by the user, where the task schedule includes task schedule content, task schedule start time, and task schedule end time, a task schedule time length is obtained according to a time length from the task schedule start time to the task schedule end time, a first number of songs that can be played in the task schedule time length is determined according to the task schedule time length, the first number is determined as the number of first target songs to be cached in each pre-cached song list, and a total song time length of the first number is greater than or equal to the task schedule time length. And finally, caching the first quantity of songs of each pre-cached song list in the pre-cached song single group into a memory of the playing device. For example, the task schedule is acquired as "party at 1 month and 1 day 9:00 in 2022 year to 1 month and 1 day 11:00 in 2022 year, the start time of the task schedule is determined as" 1 month and 1 day 9:00 in 2022 year, "1 month and 1 day 11:00 in 2022 year, the end time of the task schedule is determined as" 11:00 in 2022 year, 1 day and 1 day, the duration of the task schedule is 2 hours, the first number of songs which can be played for 4 minutes in 2 hours in the task schedule is determined as 30 songs according to the approximate duration of each song, and finally the first number of 30 songs in each pre-cached song list in the pre-cached song list group is cached in a memory of the playing device.
Optionally, in this embodiment, because in the above method, the first number of target songs to be cached in each pre-cached song list are cached in the memory of the playing device, the purpose that the songs in each pre-cached song list are in the content of the playing device is achieved, and the technical problem that the appropriate songs cannot be played in a network-free state when the task schedule time starts is further solved.
As an optional example, the method further includes:
acquiring the size of a memory of the playing device;
determining a second quantity of second target songs to be cached according to the size of the memory, wherein the total song capacity of the second target songs is smaller than or equal to the size of the memory;
and under the condition that the total duration of the second target songs is less than or equal to the product of the schedule time length and the number of the pre-cached songs, and under the condition that the second number is less than the first number, dividing the second number by the number of the pre-cached songs to obtain the target song number of the songs to be cached by each pre-cached song.
Optionally, in this embodiment, the size of the memory of the playback device is obtained, where the size of the memory may be 1GB and 8GB, and a second number of songs that can be stored in the maximum memory of the playback device is determined according to the internal size of the playback device and the average size of the memory occupied by one song, and the size of the memory occupied by the second number of songs needs to be smaller than or equal to the size of the memory of the playback device. And under the condition that the total duration of the songs in the second number is less than or equal to the product of the task schedule duration and the number of the pre-cached songs and is less than the first number, the second number is the total number of the songs to be cached, and the number of the songs to be cached in each pre-cached song list is obtained by dividing the second number by the number of the pre-cached song lists. For example, the memory size of the playing device is 100MB, the average size of the memory occupied by one song is 5MB, the second number of songs which can be stored in the memory 100MB of the playing device is 20, when the total time of the songs of the 20 second number is 80 minutes, which is less than 10 hours which is the product of the time of the task schedule 2 hours and the pre-cached song number 5, and is less than the first number 30, the second number 20 is the total number of the songs to be cached, and the number of the songs to be cached in each pre-cached song list is obtained by dividing the second number 20 by the pre-cached song number 5.
As an optional example, the method further includes:
determining a target time length between the current time and the starting time of the schedule;
determining a third number of third target songs according to the current network rate and the target time length;
and dividing the third number of the third target songs by the number of the pre-cached single songs to obtain the number of the target songs to be cached by each pre-cached single song under the condition that the total song duration of the third target songs is less than or equal to the product of the schedule time length and the number of the pre-cached single songs.
Optionally, in this embodiment, the target time length between the current time and the schedule start time is determined according to the schedule start time, and the number of the songs that can be cached in the current network state within the target time length is determined as the third number according to the network rate at which the playing device is currently connected to the network. And when the total duration of the third number of songs is less than or equal to the product of the duration of the task schedule and the number of the pre-cached songs, dividing the third number by the number of the pre-cached songs to obtain the number of the songs to be cached in each pre-cached song list, wherein the third number is the total number of the songs to be cached. For example, the task schedule is "party at 9:00 at 1 month and 1 day at 1 month and 9:00 at 2022 year, 1 month and 1 day at 11:00 at 1 month and 1 day at 2022 year, the current time is 1 month and 1 day at 8:00 at 2022 year, the target time length from 1 month and 1 day at 2022 year and 9:00 at 1 day at the start time of the schedule is 1 hour, the third number of songs that can be cached within 1 hour of the target time length is determined to be 25 according to the network rate of the current connection network, when the total time of 25 songs of the third number is less than or equal to 10 hours which is the product of 2 hours of the task schedule time length and 5 pieces of pre-cached singular, the third number of 25 pieces is the total number of songs to be cached, and the third number of 25 pieces is divided by 5 pieces of pre-cached singular pieces of songs to obtain 5 pieces of songs to be cached within each pre-cached singular song list.
As an optional example, the method further includes:
and under the condition that the target song list in the pre-cache song list is selected to be cached by the user, caching the target song in the target song list into the memory of the playing equipment.
Optionally, in this embodiment, when a song list in the pre-cache song list is selected by the user for caching, the target song in the song list is cached in the memory of the playing device first.
Optionally, in this embodiment, when the user selects a certain song list for caching, all songs in the song list may be cached in the memory. If the memory space is insufficient, the song of the song list is cached until the memory has no remaining space. If the memory has residual space after the user caches a certain song list, other song lists can be cached. And according to the size of the residual space of the memory, caching N songs in each song list of other song lists. The time length of the N songs is larger than the time length from the schedule starting time to the schedule ending time. If the memory space is not enough to cache N songs of each song list of other song lists, M songs are cached in each song list of other song lists according to the memory capacity. M is less than N. M and N are positive integers.
As an optional example, the method further includes:
when the current time reaches the schedule start time, the target song is played.
Optionally, in this embodiment, when the current time reaches the schedule start time in the task schedule, the cached target song is played, at this time, a plurality of song lists are cached, each song list has a plurality of songs, the playing mode may be that all the songs are played randomly, or that a song in a certain song list is played according to the song list, and after the playing of all the songs in the song list is finished, a song in the next song list is played.
If the user selects to cache a song of a song list when the song list is cached, the song selected and cached by the user is played firstly when the song is played. After the songs of the song list are played, the songs of other song lists are played. If the current time reaches the end of the schedule time point, the song may be automatically stopped from playing.
As an optional example, the method further includes:
and when the current time reaches the schedule ending time, clearing the cache data in the memory of the playing equipment.
Optionally, in this embodiment, when the current time reaches the schedule end time in the task schedule, the cache data in the memory of the playing device is cleared, so as to save space and facilitate next caching, and when the target song is selected by the user and is not cleared, the data of the target song is retained in the memory of the playing device.
As an optional example, the method further includes:
when the current time is between the schedule starting time and the schedule ending time and the song is requested by the user, searching whether the requested song exists in the memory of the playing equipment;
and playing the on-demand song in the memory of the playing device under the condition that the search result indicates that the on-demand song exists.
Optionally, in this embodiment, when the current time is between the schedule start time and the schedule end time, and a user requests a song, the user searches in the memory of the playing device first, checks whether the requested song exists, and if so, selects the requested song from the memory of the playing device to play, and if not, checks whether the playing device is connected to a network, and if so, searches for the requested song in the server and plays the requested song. After the song requested by the user is played, the interrupted song can be continuously played from the breakpoint of the song played before the user requests the song.
Optionally, in this embodiment, the present application provides an intelligent caching method, a schematic diagram of offline caching is shown in fig. 2, and a schematic diagram of offline playing is shown in fig. 3, which specifically implement the following processes:
1. When the cloud server receives a cache request of the sound equipment or when a user creates/synchronizes a task schedule through an APP, the sound equipment can automatically request the cloud server to cache an event, and task schedule content, task schedule starting time and task schedule ending time are obtained;
2. acquiring a pre-cached song single group from a server and manually selecting a favorite song list through an APP by a user;
3. determining a first quantity of songs to be played according to the schedule duration from the task schedule starting time to the task schedule ending time, and also determining the quantity of the songs to be cached for each pre-cached song sheet,
or determining a second quantity of the number of the songs which can be cached according to the size of the memory of the playing device, dividing the second quantity by the number of the pre-cached song sheets to obtain the number of the songs to be cached in each pre-cached song sheet,
or determining the third quantity of the number of the songs which can be cached according to the distance duration from the current time to the schedule starting time and the current network rate, dividing the third quantity by the number of the pre-cached songs to obtain the number of the songs to be cached in each pre-cached song list, comparing the first quantity, the second quantity and the third quantity, and taking the minimum quantity of the three as the number of the songs to be cached in each pre-cached song list;
4. The playing equipment caches the songs of the number of the songs to be cached in the memory in each pre-cached song list;
5. when the time reaches the set specified time, namely the schedule starting time, the songs in the cached song list are automatically played, no matter whether the audio equipment is networked or not.
The description is made with reference to an example:
1. the user creates a schedule through the mobile phone APP, namely a party from 1 month and 1 day 9:00 in 2022 to 1 month and 1 day 11:00 in 2022;
2. 5 pieces of pre-cached song number are obtained;
3. the method comprises the steps of determining the first quantity of 30 songs to be played according to the schedule time length 2 hours from the start time of a task schedule 2022, 1 month, 1 day, 9:00 to the end time of the task schedule, 2022, 1 month, 1 day, 11:00, determining the second quantity of the songs to be cached, 20 songs to be cached according to the memory size of a playing device, determining the third quantity of 25 songs to be cached according to the distance time length 1 hour from the current time of 2022, 1 month, 1 day, 8:00 to the start time of the schedule, 2022, 1 month, 1 day, 9:00 and the current network rate, comparing the first quantity, the second quantity and the third quantity, and dividing the minimum second quantity 20 by 5 single numbers of the pre-cached songs to obtain the quantity of the songs to be cached of each pre-cached song list, namely 4 songs.
4. The playing equipment caches 4 songs to be cached in the song list to be cached in the memory;
5. when the time reaches the set specified time, namely, the schedule starting time 022, 1 month, 1 day, 9:00, the songs in the cached song list are automatically played.
In this embodiment, besides the mobile terminal and the playing device of the user, the mobile terminal may further include a smart band. The user can upload the task schedule through mobile terminal, plays the song through playback devices, through intelligent bracelet, can set up the broadcast of buffering song or control song. E.g., last, next, etc.
It should be noted that for simplicity of description, the above-mentioned method embodiments are shown as a series of combinations of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
According to another aspect of the embodiments of the present application, there is also provided an intelligent cache apparatus, as shown in fig. 4, including:
A first obtaining module 402, configured to obtain a pre-cached single song group, a pre-cached single song number, and a task schedule of a user, where the task schedule includes a schedule content, a schedule start time, and a schedule end time;
a first determining module 404, configured to determine a first number of first target songs to be cached in each pre-cached song list in the pre-cached song single group according to a schedule time length from a schedule start time to a schedule end time, where a total song duration of the first number of songs is greater than or equal to the schedule time length;
the first caching module 406 is configured to cache, in accordance with a first quantity, a target song to be cached by each pre-cached song list in the pre-cached song list group in a memory of the playback device.
Alternatively, in this embodiment, the pre-cached vocalists may be vocalists of different categories, one or more of which may be a work vocalist, a party vocalist, or a drive vocalist, each of which contains songs associated with a vocalist type. The task schedule is a schedule to be made by a user at the future time and the task schedule time, and comprises task schedule content, task schedule starting time and task schedule ending time, wherein the task schedule content is ' party ', the task schedule starting time is ' 1 month and 1 day and 11:00 in 2022, and the task schedule ending time is ' 1 month and 1 day and 9:00 in 2022 '. The first number is the number of first target songs that need to be cached per pre-cached song list and may be 1, 10, etc.
Optionally, in this embodiment, the pre-cached song single group to be cached is obtained, and may be a pre-cached song single group selected by a user, or may be a song list group played or collected by the user in the near term, or a song list group including different types of song lists is randomly selected, a task schedule created by the user is obtained from an APP, or a task schedule actively uploaded by the user, where the task schedule includes task schedule content, task schedule start time, and task schedule end time, a task schedule time length is obtained according to a time length from the task schedule start time to the task schedule end time, a first number of songs that can be played in the task schedule time length is determined according to the task schedule time length, the first number is determined as the number of first target songs to be cached in each pre-cached song list, and a total song time length of the first number is greater than or equal to the task schedule time length. And finally, caching the first quantity of songs of each pre-cached song list in the pre-cached song single group into a memory of the playing device. For example, the task schedule is acquired as "party at 1 month and 1 day 9:00 in 2022 year to 1 month and 1 day 11:00 in 2022 year, the start time of the task schedule is determined as" 1 month and 1 day 9:00 in 2022 year, "1 month and 1 day 11:00 in 2022 year, the end time of the task schedule is determined as" 11:00 in 2022 year, 1 day and 1 day, the duration of the task schedule is 2 hours, the first number of songs which can be played for 4 minutes in 2 hours in the task schedule is determined as 30 songs according to the approximate duration of each song, and finally the first number of 30 songs in each pre-cached song list in the pre-cached song list group is cached in a memory of the playing device.
Optionally, in this embodiment, in the method, the first number of target songs to be cached in each pre-cached song list is cached in the memory of the playing device, so that the purpose that the songs in each pre-cached song list are in the content of the playing device is achieved, and the technical problem that the appropriate songs cannot be played in a no-network state when the task schedule time starts is solved.
As an optional example, the method further includes:
the second acquisition module is used for acquiring the size of the memory of the playing equipment;
a second determining module, configured to determine a second number of second target songs to be cached according to the size of the memory, where a total song capacity of the second target songs is smaller than or equal to the size of the memory;
and the first processing module is used for dividing the second number by the number of the pre-cached sings under the condition that the total duration of the second target songs is less than or equal to the product of the schedule time length and the number of the pre-cached sings and the second number is less than the first number to obtain the number of the target songs of the songs to be cached by each pre-cached singing.
Optionally, in this embodiment, the size of the memory of the playback device is obtained, where the size of the memory may be 1GB and 8GB, and a second number of songs that can be stored in the maximum memory of the playback device is determined according to the internal size of the playback device and the average size of the memory occupied by one song, and the size of the memory occupied by the second number of songs needs to be smaller than or equal to the size of the memory of the playback device. And under the condition that the total duration of the songs in the second number is less than or equal to the product of the task schedule duration and the number of the pre-cached songs and is less than the first number, the second number is the total number of the songs to be cached, and the number of the songs to be cached in each pre-cached song list is obtained by dividing the second number by the number of the pre-cached song lists. For example, the memory size of the playing device is 100MB, the average size of the memory occupied by one song is 5MB, the second number of songs which can be stored in the memory 100MB of the playing device is 20, when the total time of the songs of the 20 second number is 80 minutes, which is less than 10 hours which is the product of the time of the task schedule 2 hours and the pre-cached song number 5, and is less than the first number 30, the second number 20 is the total number of the songs to be cached, and the number of the songs to be cached in each pre-cached song list is obtained by dividing the second number 20 by the pre-cached song number 5.
As an optional example, the method further includes:
a third determining module, configured to determine a target time length from the current time to the start time of the schedule;
a third determining module, configured to determine a third number of third target songs according to the current network rate and the target time duration;
and the second processing module is used for dividing the third quantity by the pre-cached song number to obtain the target song quantity of the song to be cached by each pre-cached song list under the condition that the total song duration of the third target song is less than or equal to the product of the schedule time length and the pre-cached song number.
Optionally, in this embodiment, a target time length between the current time and the schedule start time is determined according to the schedule start time, and the number of the songs that can be cached in the current network state within the target time length is determined as the third number according to the network rate at which the playing device is currently connected to the network. And when the total duration of the third number of songs is less than or equal to the product of the duration of the task schedule and the number of the pre-cached songs, dividing the third number by the number of the pre-cached songs to obtain the number of the songs to be cached in each pre-cached song list, wherein the third number is the total number of the songs to be cached. For example, the task schedule is "party at 9:00 on 1 month and 1 day in 2022 year 1 month and 11:00 on 1 day in 2022 year 1 month and 1 day in current time is 1:00 on 1 month and 1 day in 2022 year 1 month and 1 hour in target time length from the start time of the schedule of 1 day 9:00, the third number of songs that can be cached in 1 hour in the target time length is determined to be 25 according to the network rate of the current connection network, when the total time of 25 songs in the third number is 100 minutes and is less than or equal to 10 hours which is the product of 2 hours on the task schedule and 5 songs in the pre-cached singular number, the third number of 25 is the total number of the songs to be cached, and the third number of 25 is divided by 5 songs in the pre-cached singular number of songs to obtain 5 songs in each pre-cached song list.
As an optional example, the method further includes:
and the second cache module is used for caching the target song in the target song list to the memory of the playing device under the condition that the target song list in the pre-cache song list is selected to be cached by the user.
Optionally, in this embodiment, when a song list in the pre-cache song list is selected by the user for caching, the target song in the song list is cached in the memory of the playing device first.
Optionally, in this embodiment, when the user selects a certain song list for caching, all songs in the song list may be cached in the memory. If the memory space is insufficient, the song of the song list is cached until the memory has no remaining space. If the memory has residual space after the user caches a certain song list, other song lists can be cached. And according to the size of the residual space of the memory, caching N songs in each song list of other song lists. The time length of the N songs is larger than the time length from the schedule starting time to the schedule ending time. And if the memory space is not enough to cache N songs of each song list of other song lists, caching M songs of each song list of other song lists according to the memory capacity. M is less than N. M and N are positive integers.
As an optional example, the method further includes:
and the first playing module is used for playing the target song when the current time reaches the schedule starting time.
Optionally, in this embodiment, when the current time reaches the schedule start time in the task schedule, the cached target song is played, at this time, a plurality of song lists are cached, each song list has a plurality of songs, the playing mode may be that all the songs are played randomly, or that a song in a certain song list is played according to the song list, and after the playing of all the songs in the song list is finished, a song in the next song list is played.
If the user selects to cache a song of a song list when the song list is cached, the song selected and cached by the user is played firstly when the song is played. After the songs of the song list are played, the songs of other song lists are played. If the current time reaches the end of the schedule time point, the song may be automatically stopped from playing.
As an optional example, the method further includes:
and the clearing module is used for clearing the cache data in the memory of the playing equipment when the current time reaches the schedule ending time.
Optionally, in this embodiment, when the current time reaches the schedule end time in the task schedule, the cache data in the memory of the playing device is cleared, so as to save space and facilitate next caching, and when the target song is selected by the user and is not cleared, the data of the target song is retained in the memory of the playing device.
As an optional example, the method further includes:
the searching module is used for searching whether the song on demand exists in the memory of the playing equipment under the condition that the current time is between the schedule starting time and the schedule ending time and the song on demand of the playing equipment is requested by a user;
and the second playing module is used for playing the on-demand song in the memory of the playing device under the condition that the search result shows that the on-demand song exists.
Optionally, in this embodiment, when the current time is between the schedule start time and the schedule end time, and the user requests a song, the user searches in the memory of the playing device first, checks whether the requested song exists, and if so, selects the requested song from the memory of the playing device for playing, and if not, checks whether the playing device is connected to the network, and if so, searches for the requested song in the server and plays the requested song. After the user requests the song, the interrupted song can be played continuously from the breakpoint of the song played before the user requests the song.
For other examples of this embodiment, please refer to examples, which are not described herein.
Fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 5, including a processor 502, a communication interface 504, a memory 506, and a communication bus 508, where the processor 502, the communication interface 504, and the memory 506 are communicated with each other via the communication bus 508, and where,
A memory 506 for storing a computer program;
the processor 502, when executing the computer program stored in the memory 506, implements the following steps:
acquiring a pre-cached song single group, a pre-cached song single number and a task schedule of a user, wherein the task schedule comprises schedule content, schedule starting time and schedule ending time;
determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list set according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length;
and caching the target songs to be cached in each pre-cached song list in the pre-cached song list into a memory of the playing device according to the first quantity.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus. The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory, such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the aforementioned processor.
As an example, the memory 506 may include, but is not limited to, the first obtaining module 402, the first determining module 404, and the first caching module 406 of the intelligent caching apparatus. In addition, the module may further include, but is not limited to, other module units in the processing apparatus of the request, which is not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the device implementing the intelligent caching method may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 5 does not limit the structure of the electronic device. For example, the electronic device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to still another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program, when executed by a processor, performs the steps of the intelligent caching method.
Alternatively, in this embodiment, a person skilled in the art may understand that all or part of the steps in the methods of the foregoing embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the description of each embodiment has its own emphasis, and reference may be made to the related description of other embodiments for parts that are not described in detail in a certain embodiment.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (8)

1. An intelligent caching method, comprising:
acquiring a pre-cached song single group, a pre-cached song single number and a task schedule of a user, wherein the task schedule comprises schedule content, schedule starting time and schedule ending time;
determining a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list set according to the schedule time length from the schedule starting time to the schedule ending time, wherein the total song duration of the first number of songs is greater than or equal to the schedule time length;
The method further comprises the following steps: acquiring the size of a memory of the playing device; determining a second quantity of second target songs to be cached according to the size of the memory, wherein the total song capacity of the second target songs is smaller than or equal to the size of the memory; under the condition that the total duration of the second target song is less than or equal to the product of the schedule time length and the number of pre-cached songs, and under the condition that the second number is less than the first number, dividing the second number by the number of pre-cached songs to obtain the number of target songs of the songs to be cached by each pre-cached song; or determining the target time length between the current time and the schedule starting time; determining a third number of third target songs according to the current network rate and the target time length; when the total song duration of the third target song is less than or equal to the product of the schedule time length and the number of pre-cached songs, dividing the third number by the number of pre-cached songs to obtain the target song number of the songs to be cached by each pre-cached song list;
and caching the target songs to be cached in each pre-cached song list in the pre-cached song list into a memory of the playing device according to the first quantity.
2. The method of claim 1, further comprising:
and under the condition that the target song list in the pre-cached song list is selected and cached by the user, caching the target song in the target song list into a memory of the playing device.
3. The method of claim 1, further comprising:
and when the current time reaches the schedule starting time, playing the target song.
4. The method of claim 1, further comprising:
and when the current time reaches the schedule ending time, clearing the cache data in the memory of the playing equipment.
5. The method of claim 1, further comprising:
when the current time is between the schedule starting time and the schedule ending time and the song is requested by the user by the playing equipment, searching whether the song is requested or not in the memory of the playing equipment;
and playing the on-demand song in the memory of the playing equipment under the condition that the search result shows that the on-demand song exists.
6. An intelligent cache apparatus, comprising:
The system comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a pre-cached single song group, a pre-cached single song number and a task schedule of a user, and the task schedule comprises schedule content, schedule starting time and schedule ending time;
a first determining module, configured to determine, according to a schedule time length from the schedule start time to the schedule end time, a first number of first target songs to be cached in each pre-cached song list in the pre-cached song list, where a total song duration of the first number of songs is greater than or equal to the schedule time length;
the device further comprises: acquiring the size of a memory of the playing device; determining a second quantity of second target songs to be cached according to the size of the memory, wherein the total song capacity of the second target songs is smaller than or equal to the size of the memory; under the condition that the total duration of the second target song is less than or equal to the product of the schedule time length and the number of pre-cached songs, and under the condition that the second number is less than the first number, dividing the second number by the number of pre-cached songs to obtain the number of target songs of the songs to be cached by each pre-cached song; or determining the target time length between the current time and the schedule starting time; determining a third number of third target songs according to the current network rate and the target time length; when the total song duration of the third target song is less than or equal to the product of the schedule time length and the number of pre-cached songs, dividing the third number by the number of pre-cached songs to obtain the target song number of the songs to be cached by each pre-cached song list;
And the first caching module is used for caching the target songs to be cached in each pre-cached song list in the pre-cached song list into a memory of the playing device according to the first quantity.
7. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 5.
8. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 5 by means of the computer program.
CN202210223055.3A 2022-03-09 2022-03-09 Intelligent caching method and device, storage medium and electronic equipment Active CN114417050B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210223055.3A CN114417050B (en) 2022-03-09 2022-03-09 Intelligent caching method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210223055.3A CN114417050B (en) 2022-03-09 2022-03-09 Intelligent caching method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN114417050A CN114417050A (en) 2022-04-29
CN114417050B true CN114417050B (en) 2022-06-28

Family

ID=81263075

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210223055.3A Active CN114417050B (en) 2022-03-09 2022-03-09 Intelligent caching method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114417050B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516450A (en) * 2021-07-05 2021-10-19 维沃移动通信(杭州)有限公司 Reminding task generation method and device and electronic equipment
CN113791886A (en) * 2021-09-28 2021-12-14 杭州中河电子器材有限公司 Audio preset task management method and system

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060029109A1 (en) * 2004-08-06 2006-02-09 M-Systems Flash Disk Pioneers Ltd. Playback of downloaded digital audio content on car radios
US7985911B2 (en) * 2007-04-18 2011-07-26 Oppenheimer Harold B Method and apparatus for generating and updating a pre-categorized song database from which consumers may select and then download desired playlists
CN103250130B (en) * 2011-07-11 2018-05-01 邵凯艺 Task execution system, data processing equipment and task distribution apparatus and method
CN103440137B (en) * 2013-09-06 2016-02-10 叶鼎 A kind of simultaneous display plays an instrument the DAB player method of position and system thereof
CN106101825B (en) * 2015-04-30 2019-04-02 北京视联动力国际信息技术有限公司 A kind of method and server of terminal monitoring
CN105933410A (en) * 2016-04-20 2016-09-07 乐视控股(北京)有限公司 Multimedia content providing method and device
CN106254640B (en) * 2016-07-28 2019-11-15 维沃移动通信有限公司 A kind of task start method and mobile terminal based on alarm clock
CN106953970A (en) * 2017-03-14 2017-07-14 广东欧珀移动通信有限公司 Application network resource acts method, device and the audio-frequence player device for broadcasting alarm clock
CN107179678A (en) * 2017-07-19 2017-09-19 无锡西橙创星科技有限公司 A kind of intelligent alarm clock control system and method
CN107911411A (en) * 2017-10-17 2018-04-13 广东广业开元科技有限公司 A kind of mobile phone information system and its processing method based on voice broadcast
CN107911428A (en) * 2017-11-03 2018-04-13 维沃移动通信有限公司 A kind of song method for pushing, device and mobile terminal
CN108563208A (en) * 2018-06-28 2018-09-21 马雷明 Intelligent domestic system and its control method
CN111524494B (en) * 2020-04-27 2023-08-18 腾讯音乐娱乐科技(深圳)有限公司 Remote real-time chorus method and device and storage medium
CN111737414A (en) * 2020-06-04 2020-10-02 腾讯音乐娱乐科技(深圳)有限公司 Song recommendation method and device, server and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113516450A (en) * 2021-07-05 2021-10-19 维沃移动通信(杭州)有限公司 Reminding task generation method and device and electronic equipment
CN113791886A (en) * 2021-09-28 2021-12-14 杭州中河电子器材有限公司 Audio preset task management method and system

Also Published As

Publication number Publication date
CN114417050A (en) 2022-04-29

Similar Documents

Publication Publication Date Title
AU2009201280B2 (en) Auto-selection of media files
CN101208691B (en) Network cache of classification contents
CN105100830B (en) A kind of device and method for being switched fast video source based on video aggregation service
EP2060084A1 (en) Architecture for accessing a data stream by means of a user terminal
US8295205B2 (en) Contact matching of changing content across platforms
CN111246302B (en) Method, device and terminal for downloading data by browser
CN109951662B (en) Video backup method and system
CN107527186B (en) Electronic reading management method and device and terminal equipment
EP2418809A1 (en) Method and apparatus for processing and updating service contents in a distributed file system
CN109767267A (en) A kind of target user's recommended method and device for advertisement dispensing
CN107333163A (en) A kind of method for processing video frequency and device, a kind of terminal and storage medium
US7843941B2 (en) Communication system, server, communication terminal and communication method
CN106095923A (en) A kind of method and system adding data of being on the list in orderly list
CN102789477A (en) File managing apparatus for processing an online storage service
CN111222004B (en) Audio playing method, terminal equipment and vehicle
CN114417050B (en) Intelligent caching method and device, storage medium and electronic equipment
CN111031117B (en) Multimedia file downloading method and related device
CN103699583B (en) A kind of method and electronic equipment for realizing direct broadcast time-shift
CN110032691A (en) Data cached sweep-out method, device and equipment
CN113010790A (en) Content recommendation method, device, server and storage medium
CN105824820A (en) Media file buffer memory method and device
CN104965841A (en) Cover song ranking method and apparatus
CN105915653B (en) Method and device for downloading media file
CN114201639B (en) Task-based intelligent scene recommendation method and device, storage medium and electronic equipment
CN107484040A (en) A kind of method for realizing network acceleration

Legal Events

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