Audio data playing method and device, vehicle and readable storage medium
By building and switching multiple playlists in audio data playback, the problem of the inability to take into account both comprehensiveness and performance requirements during random playback of audio files in the prior art, and a more comprehensive audio file playback and lower processing performance requirements are achieved.
Patent Information
- Application Number
- CN202411487301.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-03-25
AI Technical Summary
In the prior art, when audio files are played randomly, it is difficult to take into account the comprehensiveness of the played audio files and the low performance requirements.
By responding to the random playback request of the target playlist, select part of the music to be played as the first alternative music, build the first playlist, and when it is detected that the number of playbacks reaches the target condition, stop playing and build the second playlist, and continue playing.
It realizes the need for processing performance of audio data playback while ensuring full playback of audio files, avoiding the problem of only part of the music to be played.
Smart Images

Figure CN119690371A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of audio playback technology, and more specifically, to an audio data playback method, device, vehicle and readable storage medium. Background Art
[0002] At present, audio files can be played randomly. However, the existing method for playing audio files randomly is not easy to take into account the comprehensiveness of the played audio files and the low performance requirements. Summary of the invention
[0003] The present application proposes an audio data playing method, device, vehicle and readable storage medium.
[0004] In a first aspect, an embodiment of the present application provides an audio data playback method, comprising: in response to a random playback request for a target playlist, selecting at least part of the music to be played in the target playlist in sequence based on the target playlist as first alternative music, wherein the music to be played in the target playlist other than the first alternative music constitutes an alternative list; performing a random sorting operation on the first alternative music to obtain a first playlist, and playing the first playlist; when it is detected that a first number of the first alternative music that has been played meets a target condition, stopping playing the first playlist; selecting at least part of the music to be played in the alternative list in sequence based on the arrangement order of the alternative list as second alternative music; obtaining target alternative music based on the second alternative music and the first alternative music that has not been played in the first playlist; performing a random sorting operation on the target alternative music to obtain a second playlist, and playing the second playlist.
[0005] Optionally, in a possible implementation manner, the target condition includes being greater than or equal to a specified number.
[0006] Optionally, in a possible implementation manner, the number of music to be played included in the first alternative music is a second number, and the specified number is determined based on the second number.
[0007] Optionally, in a possible implementation manner, the specified number is half of the second number.
[0008] Optionally, in a possible implementation, the randomly sorting operation on the first alternative music to obtain a first playlist, and playing the first playlist includes: randomly sorting the first alternative music to obtain a first playlist, and determining target music based on the arrangement order of the first playlist; playing the target music; when it is detected that the target music is being played, caching data content corresponding to the target music; after detecting that the data content corresponding to the target music has been cached, reading and playing the target music from the cache.
[0009] Optionally, in a possible implementation, after the target alternative music is randomly sorted to obtain a second playlist and the second playlist is played, it also includes: obtaining a third number of music to be played that have been played in the second playlist; when it is detected that the third number meets the target condition, determining whether there is at least one music to be played in the alternative list except the second alternative music; if so, stopping playing the second playlist; forming a new alternative list with the music to be played in the target playlist except the first alternative music and the second alternative music, and returning to execute the step of selecting at least part of the music to be played in the alternative list as the second alternative music based on the arrangement order of the alternative list and subsequent steps, until there is no music to be played in the current alternative list except the second alternative music.
[0010] Optionally, in a possible implementation, the randomly sorting operation on the first alternative music to obtain a first playlist, and playing the first playlist includes: obtaining and caching playback information of the first alternative music; randomly sorting the first alternative music based on the cached playback information to obtain a first playlist, and playing the first playlist based on the cached playback information.
[0011] In a second aspect, an embodiment of the present application further provides an audio data playback device, comprising: a first selection unit, a first playback unit, a detection unit, a second selection unit, a target candidate music determination unit, and a second playback unit. Among them, the first selection unit is used to respond to the random play request for the target play list, and select at least part of the music to be played in the target play list in turn based on the target play list as the first alternative music, and the music to be played in the target play list except the first alternative music constitutes the alternative list; the first playback unit is used to randomly sort the first alternative music to obtain the first play list, and play the first play list; the detection unit is used to stop playing the first play list currently being played when it is detected that the first number of the first alternative music that has been played meets the target condition; the second selection unit is used to sequentially select at least part of the music to be played in the alternative list as the second alternative music based on the arrangement order of the alternative list; the target alternative music determination unit is used to obtain the target alternative music based on the second alternative music and the first alternative music in the first play list except the first alternative music that has been played; the second playback unit is used to randomly sort the target alternative music to obtain the second play list, and play the second play list.
[0012] In a third aspect, an embodiment of the present application further provides a vehicle, comprising a processor, wherein the processor is used to play music based on the method described in the first aspect.
[0013] In a fourth aspect, an embodiment of the present application further provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the method described in the first aspect above.
[0014] The audio data playing method, device, vehicle and readable storage medium provided by the embodiment of the present application, in response to a random play request for a target playlist, select at least part of the music to be played in the target playlist in sequence based on the target playlist as the first alternative music, and the music to be played in the target playlist other than the first alternative music constitutes the alternative list; perform a random sorting operation on the first alternative music to obtain a first playlist, and play the first playlist; when it is detected that the first number of the first alternative music that has been played meets the target condition, stop playing the first playlist; select at least part of the music to be played in the alternative list in sequence based on the arrangement order of the alternative list as the second alternative music; obtain the target alternative music based on the second alternative music and the first alternative music that has not been played in the first playlist; perform a random sorting operation on the target alternative music to obtain a second playlist, and play the second playlist. It can be seen that in the scheme of the present application, the first playlist that is played first only contains at least part of the music to be played, thereby reducing the demand for processing performance of playing audio data. In addition, when it is detected that the first number of first alternative music that has been played meets the target condition, the first playlist is stopped from being played, and then the second playlist is constructed and played, thereby avoiding the problem of only being able to play part of the music to be played in the target playlist, making the played audio files more comprehensive, thereby taking into account the comprehensiveness of the played audio files and the lower performance requirements.
[0015] Other features and advantages of the embodiments of the present application will be described in the subsequent description, and partly become apparent from the description, or can be understood by practicing the embodiments of the present application. The purposes and other advantages of the embodiments of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0017] Figure 1 An application scenario diagram of the audio data playback method provided in an embodiment of the present application is shown;
[0018] Figure 2 A method flow chart of an audio data playback method provided by an embodiment of the present application is shown;
[0019] Figure 3A method flow chart of an audio data playing method provided by another embodiment of the present application is shown;
[0020] Figure 4 A method flow chart of an audio data playing method provided by another embodiment of the present application is shown;
[0021] Figure 5 The structure block diagram of the audio data playback device provided in the embodiment of the present application is shown;
[0022] Figure 6 A schematic diagram of a vehicle provided in an embodiment of the present application is shown;
[0023] Figure 7 A structural block diagram of a computer-readable storage medium provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0024] In order to make those skilled in the art better understand the present application scheme, the technical scheme in the present application embodiment will be clearly and completely described below in conjunction with the drawings in the present application embodiment. Obviously, the described embodiment is only a part of the present application embodiment, rather than all the embodiments. The components of the present application embodiment usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the present application for protection, but merely represents the selected embodiment of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0025] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings. At the same time, in the description of this application, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.
[0026] At present, audio files can be played randomly. However, the existing method for playing audio files randomly is not easy to balance the comprehensiveness of the played audio files and the low performance requirements. How to balance the comprehensiveness of the played audio files and the low performance requirements is a problem to be solved urgently.
[0027] Currently, when audio files in a playlist are randomly played, some audio files in the playlist are obtained from a server, and then the obtained audio files are randomly played.
[0028] Among them, some random algorithms can be used to randomly play audio files. For example, the Shuffle algorithm can be used for random playback. The Shuffle algorithm is also called the shuffle algorithm. The Shuffle algorithm can disrupt the original order of the audio files in the playlist, and then generate a random order that is unrelated to the original order. The playlist is built based on the random order, and then the songs are played according to the list built in the random order, thereby achieving random playback. When the user clicks "Previous", the system can record and return to the previously played audio file.
[0029] For another example, you can also use the Random algorithm to play randomly. The Random algorithm is also called a random number algorithm. The next or previous audio file to be played in the playlist is determined by random number calculation, and then played. The playlist itself is not disrupted, but the song is selected through a random function. At present, the random number generation algorithm is generally implemented based on the linear congruential algorithm, such as the random function implemented by the C language standard library function rand().
[0030] However, the inventors have found in their research that the random playback in the prior art may only play some audio files randomly, which is actually a pseudo-random play. If all the audio files in the playlist are obtained, it will cause the problem of higher requirements for playback performance.
[0031] Therefore, in order to solve or partially solve the above-mentioned problems, the present application provides an audio data playback method, device, vehicle and readable storage medium.
[0032] See also Figure 1 , Figure 1 The application scenario diagram of the audio data playback method provided by the present application is shown, that is, an audio data playback scenario 100. The audio data playback scenario 100 includes a vehicle 110. The vehicle 110 may be configured with a vehicle system, and the vehicle system may include a processor, so that the vehicle 110 can play music by executing the audio data playback method through the processor, and a detailed description can be referred to in subsequent embodiments.
[0033] See also Figure 2 , Figure 2 A method flow chart of an audio data playback method provided by an embodiment of the present application is shown. The audio data playback method can be applied to Figure 1 The audio data playback scenario shown in the figure can be specifically applied to a vehicle, for example, a processor in the vehicle can be used as an execution subject. The audio data playback method specifically includes steps S110 to S160.
[0034] Step S110: In response to a random play request for a target playlist, at least part of the music to be played in the target playlist is selected in sequence based on the target playlist as first alternative music, and the music to be played in the target playlist except the first alternative music constitutes an alternative list.
[0035] For some embodiments, when the audio data playback method is applied to a vehicle, a random playback request can be sent by a user, so that the vehicle can perform subsequent steps in response to the random playback request for the target playlist. Exemplarily, the user can use an electronic device, such as a smart phone, a tablet computer, or a smart wearable device. The electronic device has established a communication connection with the vehicle's on-board system in advance, so that the user can send a random playback request for the target playlist to the vehicle through the electronic device. For example, the electronic device can run an audio playback application, such as an online music playback application, so that the user can select the target playlist through the online music playback application, and then operate the operating controls for random playback of the target playlist, thereby sending a random playback request for the target playlist.
[0036] For some other implementations, the user may also directly control the vehicle's onboard system to directly input a random play request for the target play list to the vehicle. For example, the onboard system may also run an audio playback application, such as an online music playback application, so that the user may directly select the target play list through the online music playback application in the onboard system, and then operate the operation control for randomly playing the target play list, thereby inputting a random play request for the target play list.
[0037] Optionally, the audio data playback method may also be applied to the user's electronic device, so that the user selects a target playlist through the online music playback application, and then operates an operation control for randomly playing the target playlist to generate a random play request for the target playlist.
[0038] It should be noted that the following description will continue with the processor in the vehicle's onboard system as the execution subject of the audio data playback method.
[0039] Among them, the target playlist may include music to be played, and there may be multiple music to be played. It is understandable that after obtaining the random play request for the target playlist, if all the music to be played in the target playlist are obtained and then randomly played, too much data will be obtained in a short time, which will consume more system resources and have a higher demand for performance. In addition, if all the music to be played in the target playlist is directly obtained, it will also cause a large loss to the traffic. Moreover, if too much data is obtained in a short time, it is easy to cause the crash of the application, which reduces the stability of the audio data playback.
[0040] Therefore, in the embodiment provided by the present application, in response to a random play request for a target playlist, at least part of the music to be played in the target playlist can be selected in sequence based on the target playlist as the first candidate music. In other words, the first candidate music includes at least part of the music to be played in the target playlist.
[0041] Exemplarily, the target playlist may include 100 songs to be played, and in response to a random play request for the target playlist, the first 50 songs to be played in the target playlist may be selected in sequence based on the target playlist as the first candidate music.
[0042] In addition, the music to be played in the target playlist other than the first candidate music can constitute the candidate list. Continuing with the above example, after selecting the first 50 pieces of music to be played as the first candidate music, the last 50 pieces of music to be played in the target playlist can constitute the candidate list. Among them, the last 50 pieces of music to be played in the target playlist are also the music to be played other than the first candidate music.
[0043] It is understandable that the music to be played in the target playlist includes the playing information of the music to be played, such as the title of the music to be played, the Uniform Resource Locator (URL) of the song, etc., but generally does not include the data content of the music to be played. Therefore, selecting at least part of the music to be played in the target playlist in turn based on the target playlist may also be to obtain the playing information of at least part of the music to be played.
[0044] Step S120: Randomly sort the first candidate music to obtain a first play list, and play the first play list.
[0045] After obtaining the first candidate music, the first candidate music can be randomly sorted to obtain the first playlist. As can be seen from the above introduction, the first candidate music can include playback information, such as the title of the music to be played, the uniform resource locator URL of the song, etc. Therefore, the first candidate music can be randomly sorted according to the playback information of the first candidate music. The random sorting operation can be implemented by a random algorithm, such as a shuffle algorithm or a random number algorithm, etc. For details, please refer to the above introduction, which will not be repeated here.
[0046] After the music to be played in the first alternative music is randomly sorted, a first playlist can be obtained. That is, the first playlist still includes the music to be played in the first alternative music, but the arrangement order of the music to be played in the first playlist has been processed by the random sorting operation. Therefore, the first playlist can be played, and playing the first playlist can achieve the effect of randomly playing the first alternative music.
[0047] Step S130: when it is detected that the first number of first candidate music that has been played meets the target condition, stop playing the first playlist.
[0048] From the foregoing introduction, it can be seen that the music to be played in the first alternative music is only at least part of the music to be played in the target playlist. Therefore, in order to avoid playing only part of the music to be played in the target playlist, resulting in pseudo-random playback, the first number of first alternative music that has been played can also be detected. When it is detected that a certain number of first alternative music has been played, the first playlist can be paused and a new playlist can be further constructed.
[0049] Specifically, it may be to detect whether the first number meets the target condition, and when it is detected that the first number of the first candidate music that has been played meets the target condition, stop playing the first playlist. The target condition may be determined based on a specified number. For example, when it is detected that the first number is greater than or equal to the specified number, stop playing the first playlist. For a detailed introduction to the target condition, please refer to the subsequent embodiments.
[0050] The first quantity may be detected in real time through the vehicle computer system, so that the real-time first quantity may be obtained.
[0051] Step S140: selecting at least part of the music to be played in the candidate list in sequence based on the arrangement order of the candidate list as second candidate music.
[0052] Furthermore, at least some of the music to be played in the candidate list can be selected as the second candidate music. Specifically, at least some of the music to be played in the candidate list can be selected in sequence based on the arrangement order of the candidate list.
[0053] Continuing with the above example, the alternative playlist may include 50 songs to be played, so that, for example, 30 songs to be played may be selected as the second alternative music.
[0054] Similar to the aforementioned steps, the at least part of the music to be played selected here may be obtained by obtaining the playing information of at least part of the music to be played.
[0055] Step S150: obtaining target alternative music based on the second alternative music and the first alternative music in the first playlist that has not been played.
[0056] Furthermore, in the aforementioned step, when it is detected that the first number of the first candidate music that has been played meets the target condition, the first playlist is stopped from playing, so there may be some first candidate music in the first playlist that has not been played. Therefore, for some implementations, the second candidate music and the first candidate music that has not been played in the first playlist can be used as target candidate music.
[0057] For example, if the first candidate music includes 50 songs to be played, and the first number of the first candidate music that has been played is 25, then the first candidate music that has not been played in the first playlist includes 25; for another example, the second candidate music includes 30 songs to be played. Therefore, the 30 songs to be played included in the second candidate music and the 25 songs to be played in the first playlist that have not been played can be taken as the target candidate music.
[0058] Step S160: Randomly sort the target candidate music to obtain a second playlist, and play the second playlist.
[0059] Further, after obtaining the target candidate music, the target candidate music can be randomly sorted to obtain a second playlist, and the second playlist can be played. Similar to the random sorting of the first candidate music to obtain the first playlist described in the previous step, the target candidate music can be randomly sorted according to the playing information of the target candidate music. The random sorting operation can be implemented by a random algorithm, such as a shuffling algorithm or a random number algorithm.
[0060] The audio data playing method provided in the embodiment of the present application, in response to a random play request for a target playlist, sequentially selects at least part of the music to be played in the target playlist based on the target playlist as the first alternative music, and the music to be played in the target playlist other than the first alternative music constitutes an alternative list; randomly sorts the first alternative music to obtain a first playlist, and plays the first playlist; stops playing the first playlist when it is detected that the first number of the first alternative music that has been played meets the target condition; sequentially selects at least part of the music to be played in the alternative list as the second alternative music based on the arrangement order of the alternative list; obtains the target alternative music based on the second alternative music and the first alternative music that has not been played in the first playlist; randomly sorts the target alternative music to obtain a second playlist, and plays the second playlist. It can be seen that in the scheme of the present application, the first playlist that is played first only contains at least part of the music to be played, thereby reducing the demand for processing performance of playing audio data. In addition, when it is detected that the first number of first alternative music that has been played meets the target condition, the first playlist is stopped from being played, and then the second playlist is constructed and played, thereby avoiding the problem of only being able to play part of the music to be played in the target playlist, making the played audio files more comprehensive, thereby taking into account the comprehensiveness of the played audio files and the lower performance requirements.
[0061] See also Figure 3 , Figure 3 A method flow chart of an audio data playback method provided by an embodiment of the present application is shown. The audio data playback method can be applied to Figure 1 The audio data playback scenario shown in the figure can be specifically applied to a vehicle, for example, a processor in the vehicle can be used as an execution subject. The audio data playback method specifically includes steps S210 to S2110.
[0062] Step S210: In response to a random play request for a target playlist, at least part of the music to be played in the target playlist is selected in sequence based on the target playlist as first alternative music, and the music to be played in the target playlist except the first alternative music constitutes an alternative list.
[0063] Among them, step S210 has been introduced in detail in the above embodiment and will not be repeated here.
[0064] Step S220: Randomly sort the first candidate music to obtain a first play list, and play the first play list.
[0065] In some implementations, during the process of playing the first playlist, the data content of the played music may be cached, thereby further reducing the demand for processing performance.
[0066] Specifically, step S220 may also include steps S221 to S224.
[0067] Step S221: Randomly sort the first candidate music to obtain a first playlist, and determine the target music based on the arrangement order of the first playlist.
[0068] Step S222: Play the target music.
[0069] Step S223: When it is detected that the target music is being played, the data content corresponding to the target music is cached.
[0070] Step S224: after detecting that the data content corresponding to the target music is cached, reading and playing the target music from the cache.
[0071] First, the first candidate music can be randomly sorted to obtain a first playlist, and target music is determined based on the arrangement order of the first playlist, wherein the target music is the next music to be played.
[0072] For some embodiments, the music to be played can be determined as the target music in sequence directly based on the arrangement order of the first playlist. For example, the first music to be played in the arrangement order of the first playlist is first used as the target music. However, after the target music is played, the second music to be played is used as the target music, and so on. For other embodiments, if an operation input by the user is detected during the process of playing the current target music, the new target music can be determined based on the operation. For example, if the user inputs an operation corresponding to the next piece of music, the next adjacent music to be played of the current target music can be used as the new target music based on the arrangement order of the first playlist; for another example, if the user inputs an operation corresponding to the previous piece of music, the previous adjacent music to be played of the current target music can be used as the new target music based on the arrangement order of the first playlist.
[0073] Thus, after determining the target music, the target music can be played. To play the target music, it is actually necessary to obtain the data content corresponding to the target music from the server. It is understandable that in order to facilitate data transmission, the data content corresponding to the target music may be divided into multiple segments, so that the data content of one segment is obtained each time. In other words, in order to fully play the target music, it may be necessary to obtain the data content corresponding to the target music from the server multiple times.
[0074] Therefore, in some embodiments, when the target music is detected to be played, the data content corresponding to the target music can be cached. The cached data content corresponding to the target music is used to indicate that the vehicle system directly obtains the complete data content corresponding to the target music from the server and stores it in the cache of the vehicle system.
[0075] Therefore, after detecting that the data content corresponding to the target music has been cached, the target music can be directly read from the cache and played, avoiding the need to request the server for data content multiple times and reducing the processing performance requirements for playing the target music.
[0076] As can be seen from the above introduction, the first candidate music can be randomly sorted according to the playing information of the first candidate music, so as to obtain the first play list. Therefore, it is necessary to frequently request the playing information of each music to be played in the first candidate music from the server, which will also cause a high demand for playing performance.
[0077] Therefore, in some implementations, the playing information of the first candidate music may be cached first, and then the first playlist may be constructed. Specifically, step S220 may further include step S225 and step S226.
[0078] Step S225: Acquire and cache the playing information of the first candidate music.
[0079] Step S226: performing a random sorting operation on the first candidate music based on the cached playback information to obtain a first play list, and playing the first play list based on the cached playback information.
[0080] Wherein, obtaining and caching the playback information of the first candidate music may be caching the playback information of each music to be played in the first candidate music, and specifically, the playback information of the first candidate music may be cached in the cache of the vehicle system. Thus, the first candidate music may be randomly sorted based on the cached playback information to obtain a first playlist, and the first playlist may be played based on the cached playback information, thereby reducing the access requirements to the server and thus reducing the requirements for processing performance for playback.
[0081] Step S230: when it is detected that the first number of first candidate music that has been played meets the target condition, stop playing the first playlist.
[0082] For some embodiments, the target condition may include being greater than or equal to a specified number. Thus, when it is detected that the first number of the first candidate music that has been played is greater than or equal to a specified number, the first playlist may be stopped from being played.
[0083] The designated number may be a pre-set value, such as 10, 20, 30, etc. Specifically, for example, the user may set the designated number in an audio playback application through an electronic device or a vehicle system.
[0084] In some implementations, the designated number may also be set based on the second number, wherein the second number is the number of music to be played included in the first candidate music. For example, continuing to use the above example as an example for explanation, the second number is 50.
[0085] Exemplarily, the designated number can be set to half of the second number, that is, when the second number is 50, the designated number is 25. Thus, when it is detected that the first number of the first alternative music that has been played is half of the number of the music to be played included in the first alternative music, the first playlist can be stopped from playing.
[0086] Optionally, the specified number may be set as other proportions of the second number, such as 20%, 30%, etc. In practical applications, it may be flexibly set as needed, and the embodiments of the present application do not make any specific limitation.
[0087] Step S240: based on the arrangement order of the candidate list, at least part of the music to be played in the candidate list is selected in sequence as the second candidate music.
[0088] Step S250: obtaining target alternative music based on the second alternative music and the first alternative music in the first playlist that has not been played.
[0089] Step S260: Randomly sort the target candidate music to obtain a second playlist, and play the second playlist.
[0090] Among them, step S240 to step S260 have been introduced in detail in the above embodiments and will not be repeated here.
[0091] Step S270: Obtain a third number of music to be played that has been played in the second playlist.
[0092] Step S280: When it is detected that the third number meets the target condition, it is determined whether there is at least one music to be played in the candidate list in addition to the second candidate music.
[0093] For some implementations, during the process of playing the second playlist, a third number of the music to be played that has been played in the second playlist may also be obtained. The method for obtaining the third number is similar to the method for obtaining the first number, and will not be repeated here.
[0094] It is also possible to determine whether the third number meets the target condition, so that when it is detected that the third number meets the target condition, it is further possible to determine whether the candidate list contains at least one music to be played in addition to the second candidate music. If so, it indicates that there is music to be played in the candidate list that is not included in the constructed first playlist or the second playlist, and the process can jump to step S290; if not, it indicates that all the music to be played in the candidate list has been included in the second playlist, and the process can jump to step S2110.
[0095] Step S290: If it exists, stop playing the second playlist.
[0096] Step S2100: Construct a new alternative list of music to be played except the first alternative music and the second alternative music in the target playlist, and return to execute the process of selecting at least part of the music to be played in the alternative list in sequence based on the arrangement order of the alternative list as the second alternative music and subsequent steps until there is no music to be played except the second alternative music in the current alternative list.
[0097] If there is, the second playlist can be stopped. Then, the music to be played in the target playlist except the first alternative music and the second alternative music is used to form a new alternative list, and the process returns to the step of selecting at least part of the music to be played in the alternative list as the second alternative music based on the arrangement order of the alternative list and the subsequent steps until there is no music to be played in the current alternative list except the second alternative music.
[0098] For example, if the target playlist includes 100 songs to be played, the first alternative music includes 50 songs to be played, and the second alternative music includes 30 songs to be played, then the new alternative list is composed of the 100 songs to be played in the target playlist excluding the 50 songs to be played in the first alternative music and the 30 songs to be played in the second alternative music.
[0099] Thus, it is possible to achieve more comprehensive random playback of all the music to be played in the target playlist, rather than pseudo-random playback of only part of the music to be played.
[0100] Step S2110: If it does not exist, continue playing the second playlist.
[0101] If not present, the second playlist may continue to be played.
[0102] In the embodiment provided by the present application, the data content of the music to be played can be cached. After the data content corresponding to the target music is detected to be cached, the target music can be directly read and played from the cache, avoiding the need to request the data content from the server multiple times, and reducing the demand for processing performance for playing the target music. In addition, the playback information of the first candidate music can be obtained and cached; the first playlist is played based on the cached playback information, reducing the access requirements to the server, thereby reducing the demand for processing performance for playback. Furthermore, the music to be played in the target playlist except the first candidate music and the second candidate music can also be used to form a new candidate list, and return to execute the selection of at least part of the music to be played in the candidate list based on the arrangement order of the candidate list, as the second candidate music and subsequent steps, until there is no music to be played in the current candidate list except the second candidate music. Thus, it is possible to achieve more comprehensive random playback of all the music to be played in the target playlist, rather than pseudo-random playback of only part of the music to be played, and achieve complete random playback of the target playlist.
[0103] See also Figure 4 , Figure 4 A method flow chart of an audio data playback method provided by an embodiment of the present application is shown. The audio data playback method can be applied to Figure 1 The audio data playback scenario shown in the figure can be specifically applied to a vehicle, for example, a processor in the vehicle can be used as an execution subject. The audio data playback method specifically includes steps S310 to S370.
[0104] Step S310: The user starts the music playing application of the vehicle system.
[0105] For example, the user can start the music playing application through the multimedia Media in the vehicle system.
[0106] Step S320: Determine the target playlist.
[0107] In the music playing application, the user can browse multiple lists and then determine a list as a target playlist.
[0108] Step S330: Get the first playlist and play the first playlist.
[0109] Then, at least part of the music to be played in the target playlist can be selected in sequence based on the target playlist as the first candidate music, and the first candidate music is randomly sorted to obtain the first playlist. The playing information of each music to be played in the target playlist can be obtained from the server. The detailed description can be referred to the above embodiment, which will not be repeated here.
[0110] Further, the first playlist may be played.
[0111] Step S340: The first quantity is greater than or equal to the specified quantity.
[0112] When it is detected that the first number is greater than or equal to the specified number, the process may jump to step S350 .
[0113] Step S350: Get a second playlist, play the second playlist, and monitor a third quantity at the same time.
[0114] How to obtain the second playlist can be described in the above-mentioned embodiment, which will not be described in detail here. When playing the second playlist, the third number can be monitored, wherein the third number is used to characterize the number of the music to be played that has been played in the second playlist.
[0115] Step S360: Check whether there is at least one music to be played in the candidate list in addition to the second candidate music.
[0116] Step S370: Stop monitoring the third quantity.
[0117] Further, it can be determined whether there is at least one music to be played in the candidate list in addition to the second candidate music. If so, the process can return to step S350, and the detailed description can refer to the above steps; if not, the process can jump to step S370 to stop monitoring the third number and keep playing the second playlist.
[0118] See also Figure 5 , Figure 5 A structural block diagram of an audio data playback device provided in an embodiment of the present application is shown, and the audio data playback device 500 includes: a first selection unit 510, a first playback unit 520, a detection unit 530, a second selection unit 540, a target alternative music determination unit 550 and a second playback unit 560.
[0119] The first selection unit 510 is used to respond to a random play request for a target playlist, and select at least part of the music to be played in the target playlist in turn based on the target playlist as first alternative music, and the music to be played in the target playlist except the first alternative music constitutes an alternative list.
[0120] The first playing unit 520 is used to perform a random sorting operation on the first candidate music to obtain a first play list, and play the first play list.
[0121] Optionally, the first playback unit 520 can also be used to randomly sort the first alternative music to obtain a first playlist, and determine the target music based on the arrangement order of the first playlist; play the target music; when it is detected that the target music is being played, cache the data content corresponding to the target music; after detecting that the data content corresponding to the target music has been cached, read and play the target music from the cache.
[0122] Optionally, the first playback unit 520 can also be used to obtain and cache playback information of the first candidate music; randomly sort the first candidate music based on the cached playback information to obtain a first playlist, and play the first playlist based on the cached playback information.
[0123] The detection unit 530 is used to stop playing the first playlist currently being played when it is detected that the first number of the first candidate music that has been played meets the target condition.
[0124] Optionally, the target condition includes being greater than or equal to a specified quantity.
[0125] Optionally, the number of music to be played included in the first alternative music is a second number, and the specified number is determined based on the second number.
[0126] Optionally, the specified number is half of the second number.
[0127] The second selection unit 540 is used to select at least part of the music to be played in the candidate list in sequence based on the arrangement order of the candidate list as the second candidate music.
[0128] The target candidate music determining unit 550 is configured to obtain the target candidate music based on the second candidate music and the first candidate music in the first playlist except the first candidate music that has been played.
[0129] The second playing unit 560 is used to perform a random sorting operation on the target candidate music to obtain a second play list, and play the second play list.
[0130] Optionally, the second playback unit 560 can also be used to obtain a third number of music to be played that have been played in the second playlist; when it is detected that the third number meets the target condition, determine whether there is at least one music to be played in the alternative list except the second alternative music; if so, stop playing the second playlist; form a new alternative list with the music to be played in the target playlist except the first alternative music and the second alternative music, and return to execute the selection of at least part of the music to be played in the alternative list based on the arrangement order of the alternative list as the second alternative music and subsequent steps, until there is no music to be played in the current alternative list except the second alternative music.
[0131] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and units can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here.
[0132] In several embodiments provided in the present application, the coupling between the units may be electrical, mechanical or other forms of coupling. In addition, each functional unit in each embodiment of the present application may be integrated into a processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0133] See also Figure 6 , Figure 6 A schematic diagram of a vehicle provided by an embodiment of the present application is shown. The vehicle 600 may be configured with a vehicle system, the vehicle system may include a processor, and the vehicle system may also include a memory and one or more application programs, wherein the processor is electrically connected to the memory, and the one or more programs are configured to execute the method described in each embodiment of the audio data playback method through the processor.
[0134] The processor may include one or more processing cores. The processor uses various interfaces and lines to connect various parts of the entire vehicle system, and executes various functions of the vehicle system and processes data by running or executing instructions, programs, code sets or instruction sets stored in the memory, and calling data stored in the memory. Optionally, the processor can be implemented in at least one hardware form of digital signal processing (DSP), field programmable gate array (FPGA), and programmable logic array (PLA). The processor can integrate one or a combination of a central processing unit (CPU), a graphics processor (GPU), and a modem. Among them, the CPU mainly processes the operating system, user interface, and computer programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor, but may be implemented separately through a communication chip. Specifically, the method described in the above embodiment can be executed by one or more processors.
[0135] For some embodiments, the memory may include a random access memory (RAM) or a read-only memory (ROM). The memory may be used to store instructions, programs, codes, code sets or instruction sets. The memory may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function, instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the vehicle's on-board system during use, etc.
[0136] See also Figure 7 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 700 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.
[0137] The computer readable storage medium 700 can be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 700 includes a non-transitory computer-readable storage medium. The computer readable storage medium 700 has storage space for program code 710 that executes any method step in the above method. These program codes can be read from or written into one or more computer program products. The program code 710 can be compressed, for example, in an appropriate form.
[0138] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for playing audio data, characterized in that: include: In response to a random play request for a target playlist, at least part of the music to be played in the target playlist is selected in sequence based on the target playlist as first candidate music, and the music to be played in the target playlist other than the first candidate music constitutes a candidate list; Randomly sorting the first candidate music to obtain a first playlist, and playing the first playlist; When it is detected that the first number of the first candidate music that has been played meets the target condition, stop playing the first playlist; Selecting at least part of the music to be played in the candidate list in sequence based on the arrangement order of the candidate list as second candidate music; Obtaining target alternative music based on the second alternative music and the first alternative music that is not played in the first playlist; The target candidate music is randomly sorted to obtain a second playlist, and the second playlist is played.
2. The method according to claim 1, characterized in that The target condition includes being greater than or equal to a specified number.
3. The method according to claim 2, characterized in that The number of music to be played included in the first candidate music is a second number, and the specified number is determined based on the second number.
4. The method according to claim 3, characterized in that The specified number is half of the second number.
5. The method according to claim 1, characterized in that The randomly sorting operation is performed on the first candidate music to obtain a first playlist, and the first playlist is played, including: Randomly sorting the first candidate music to obtain a first playlist, and determining target music based on the arrangement order of the first playlist; Playing the target music; When it is detected that the target music is being played, cache the data content corresponding to the target music; After detecting that the data content corresponding to the target music is cached, the target music is read from the cache and played.
6. The method according to claim 1, characterized in that After randomly sorting the target candidate music to obtain a second playlist and playing the second playlist, the method further includes: Obtain a third number of the to-be-played music that has been played in the second playlist; In the case where it is detected that the third number meets the target condition, determining whether the candidate list contains at least one piece of music to be played in addition to the second piece of music; If it exists, stop playing the second playlist; The music to be played in the target playlist except the first alternative music and the second alternative music constitute a new alternative list, and return to execute the process of selecting at least part of the music to be played in the alternative list as the second alternative music based on the arrangement order of the alternative list and subsequent steps until there is no music to be played in the current alternative list except the second alternative music.
7. The method according to claim 1, characterized in that The randomly sorting operation is performed on the first candidate music to obtain a first playlist, and the first playlist is played, including: Acquire and cache the playing information of the first candidate music; The first candidate music is randomly sorted based on the cached playback information to obtain a first playlist, and the first playlist is played based on the cached playback information.
8. An audio data playback device, characterized in that: include: A first selection unit is used for responding to a random play request for a target playlist and sequentially selecting at least part of the music to be played in the target playlist as first candidate music based on the target playlist, wherein the music to be played in the target playlist other than the first candidate music constitutes a candidate list; A first playing unit, configured to perform a random sorting operation on the first candidate music to obtain a first play list, and play the first play list; A detection unit, configured to stop playing the first playlist currently being played if it is detected that a first number of the first candidate music that has been played meets a target condition; A second selection unit, configured to sequentially select at least part of the to-be-played music in the candidate list based on the arrangement order of the candidate list as second candidate music; a target candidate music determining unit, configured to obtain target candidate music based on the second candidate music and first candidate music in the first playlist except the first candidate music that has been played; The second playing unit is used to perform a random sorting operation on the target candidate music to obtain a second play list, and play the second play list.
9. A vehicle, characterized in that: The vehicle comprises a processor for playing music based on the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program codes, which can be called by a processor to execute the method according to any one of claims 1 to 7.