Disclosure of Invention
An object of the present application is to provide a method and a terminal for playing a song, which can solve the above technical problems, and can automatically switch a playing source to play a song when a user plays a song, without manually switching the playing source by the user, thereby improving user experience.
In order to solve the above technical problem, the present application provides a method for playing a song, which is applied to a terminal and includes:
acquiring song information of a song to be played;
searching a playing source of the song to be played according to the song information;
and playing the song to be played according to the playing source.
Wherein, the searching the playing source of the song to be played according to the song information comprises:
sending a play source query request to a cloud server, wherein the play source query request comprises the song information, so that the cloud server returns a query result according to the song information, and the song information and the corresponding play source information are stored in the cloud server;
and if the query result contains the playing source information, taking the playing source corresponding to the playing source information as the playing source of the song to be played.
Wherein, the searching the playing source of the song to be played according to the song information further comprises:
if the query result does not contain the playing source information, searching the playing source of the song to be played from song playing software installed in the terminal according to the song information;
and determining the playing source of the song to be played according to the searching result.
Wherein, the searching the playing source of the song to be played according to the song information comprises:
searching a playing source of the song to be played from song playing software installed in the terminal according to the song information;
and determining the playing source of the song to be played according to the searching result.
Wherein, the determining the playing source of the song to be played according to the search result includes:
if the only song playing software is found, the found song playing software is used as the playing source of the song to be played;
and if the searched song playing software is not unique, determining one song playing software as the playing source of the song to be played according to a preset rule.
Wherein, the determining the playing source of the song to be played according to the search result further comprises:
if the song playing software is not found, sending a playing source searching request to a cloud server, wherein the playing source searching request comprises the song information, so that the cloud server returns a searching result according to the song information;
and taking the playing source corresponding to the playing source information in the search result as the playing source of the song to be played.
Wherein, the playing source is song playing software, and the playing the song to be played according to the playing source comprises:
and controlling corresponding song playing software to play the song to be played.
Wherein, after the song to be played is played according to the playing source, the method further comprises:
and if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
Wherein, the playing the song to be played according to the playing source includes:
if the playing source is song playing software installed in the terminal, controlling the song playing software to play the song to be played;
if the playing source is song playing software which is not installed in the terminal, the song playing software is prompted to be installed, and the song playing software is controlled to play the song to be played after the song playing software is successfully installed.
The present application also provides a terminal, which includes a memory and a processor, where the memory stores at least one program instruction, and the processor implements the method for playing songs as described above by loading and executing the at least one program instruction.
According to the method and the terminal for playing the songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the method, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved.
The foregoing description is only an overview of the technical solutions of the present application, and in order to make the technical means of the present application more clearly understood, the present application may be implemented in accordance with the content of the description, and in order to make the above and other objects, features, and advantages of the present application more clearly understood, the following preferred embodiments are described in detail with reference to the accompanying drawings.
Detailed Description
To further illustrate the technical means and effects of the present application for achieving the purpose of subscribing applications, the following detailed description is provided with reference to the accompanying drawings and preferred embodiments for specific implementation manners, methods, steps, structures, features and effects of the positioning method of the mobile terminal, the vehicle-mounted terminal and the mobile terminal according to the present application.
The foregoing and other technical matters, features and effects of the present application will be apparent from the following detailed description of preferred embodiments, which is to be read in connection with the accompanying drawings. While the present application is susceptible to particular embodiments and features, it is to be understood that various changes, modifications and substitutions may be made therein without departing from the spirit and scope of the present application.
Fig. 1 is a flowchart illustrating a method of playing a song according to a first embodiment. Referring to fig. 1, the method for playing a song according to the embodiment is applied to a terminal, where the terminal may be a mobile terminal or a vehicle-mounted terminal, and the method for playing a song includes:
step 110, acquiring song information of a song to be played;
step 120, searching a playing source of the song to be played according to the song information;
and step 130, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates a plurality of song playing software, so that songs to be played can be searched and played through the song playing software or a playing server corresponding to the song playing software, different song playing software is also different playing sources, the playing sources include the song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is a playing source of the a song, and if the a song can be found and played in the webpage platform of the B software, the B software is also a playing source of the a song.
In step 110, when the user selects the song playlist to play, the terminal sequentially obtains song information of the songs to be played in the song playlist according to the playing progress, where the song information includes, but is not limited to, a song title, a singer, an album, and the like. The song playlist may contain one or more songs, for example, the user may play the historical songs directly or may retrieve certain songs, the songs to be played currently, i.e., the songs in the playlist.
In step 120, the broadcast source may be searched by the cloud server or in the terminal. In the terminal, the playing source can be confirmed by sequentially communicating with the song playing software installed in the terminal in a polling mode, so that the playing source is confirmed when the song playing software is found. In actual implementation, after communication with each piece of song playing software installed in the terminal is performed, all playing sources capable of playing songs to be played are determined, and then a suitable playing source is selected from the playing sources, for example, the song playing software with a high user use frequency is selected from the playing sources to play, or the song playing software with the largest number of times of playing songs to be played is selected from the playing sources to play.
In step 130, after the play source is found, if the play source is the song play software installed in the terminal, the song play software is controlled to play the song to be played, if the play source is the song play software not installed in the terminal, the installation of the song play software is prompted, and the song play software is controlled to play the song to be played after the song play software is successfully installed. In practical implementation, if the playing source is song playing software not installed in the terminal, the user can also be prompted to select to jump to the corresponding webpage platform to play the song or install the song playing software to play the song, if the user selects to jump to the corresponding webpage platform, the user jumps to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user may set a default processing mode when the playback source is the song playback software that is not installed in the terminal, for example, the default processing mode is to jump to a web platform corresponding to the playback source for playback.
Through the mode, when the user plays the song list, the terminal can be dynamically switched to different playing sources to play according to the current song to be played, the user does not need to manually switch the playing sources to find and play the song, and therefore the song listening experience of the user is optimized.
In one embodiment, after the song to be played is played according to the playing source, the method further includes:
and if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
The song information and the corresponding playing source information are stored in the cloud server, so that the playing source can be confirmed without executing all searching steps when the same song is played again, the resource consumption is reduced, and the playing efficiency is improved.
According to the method for playing the songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the method, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved.
Fig. 2 is a flowchart illustrating a method of playing a song according to a second embodiment. Referring to fig. 2, the method for playing songs of the present embodiment includes:
step 210, acquiring song information of a song to be played;
step 220, sending a broadcast source query request to a cloud server, wherein the broadcast source query request comprises song information, so that the cloud server returns a query result according to the song information, and the song information and the corresponding broadcast source information are stored in the cloud server;
step 230, determining whether the query result includes the broadcast source information, if yes, executing step 240; otherwise, executing step 250;
step 240, taking the playing source corresponding to the playing source information as the playing source of the song to be played, and executing step 270;
step 250, searching a playing source of the song to be played from the song playing software installed in the terminal according to the song information;
step 260, determining a playing source of the song to be played according to the search result;
and 270, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates a plurality of song playing software, so that songs to be played can be searched and played through the song playing software or a playing server corresponding to the song playing software, different song playing software is also different playing sources, the playing sources include the song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is a playing source of the a song, and if the a song can be found and played in the webpage platform of the B software, the B software is also a playing source of the a song.
In step 210, when the user selects the song playlist to play, the terminal sequentially obtains song information of the songs to be played in the song playlist according to the playing progress, where the song information includes, but is not limited to, a song name, a singer, an album, and the like. The song playlist may contain one or more songs, for example, the user may play the historical songs directly or may retrieve certain songs, the songs to be played currently, i.e., the songs in the playlist.
In step 220, the cloud server stores the song information and the corresponding play source information, which are stored after the corresponding song is played, so that if the song information in the play source query request is stored in the cloud server, the query result returned by the cloud server will contain the play source information, otherwise, the query result will not contain the play source information.
In step 240, if the query result includes the playback source information, the playback source corresponding to the playback source information is directly used as the playback source of the song to be played, the playback source found according to the query request is the song playback software installed in the terminal, and step 270 is further executed to control the song playback software to play the song to be played.
In step 250, if the query result does not include the information of the playback source, the playback source of the song to be played is searched from the song playback software installed in the terminal according to the song information. In the terminal, the playing sources can be confirmed by sequentially communicating with the song playing software installed in the terminal in a polling mode, and all the playing sources capable of playing the songs to be played can be confirmed after communicating with each song playing software installed in the terminal.
In step 260, if the unique song playing software is found, the found song playing software is used as a playing source of the song to be played, for example, the song playing software capable of playing the song to be played is found during polling. And if the searched song playing software is not unique, determining one of the song playing software as the playing source of the song to be played according to a preset rule, wherein the preset rule includes but is not limited to using the song playing software with the highest use frequency as the playing source, or using the song playing software with the highest playing frequency of the song to be played as the playing source. If the song playing software is not found, sending a playing source searching request to the cloud server, wherein the playing source searching request comprises song information, so that the cloud server returns a searching result according to the song information, a playing source corresponding to the playing source information in the searching result is used as a playing source of the song to be played, and the playing source searched according to the playing source searching request is the song playing software which is not installed in the terminal. Thus, in step 270, if the playing source is the song playing software installed in the terminal, the song playing software is controlled to play the song to be played, if the playing source is the song playing software not installed in the terminal, the installation of the song playing software is prompted, and the song playing software is controlled to play the song to be played after the song playing software is successfully installed.
In practical implementation, if the playing source is song playing software not installed in the terminal, the user can also be prompted to select to jump to the corresponding webpage platform to play the song or install the song playing software to play the song, if the user selects to jump to the corresponding webpage platform, the user jumps to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user may set a default processing mode when the playback source is the song playback software that is not installed in the terminal, for example, the default processing mode is to jump to a web platform corresponding to the playback source for playback.
Through the mode, when the user plays the song list, the terminal can be dynamically switched to different playing sources to play according to the current song to be played, the user does not need to manually switch the playing sources to find and play the song, and therefore the song listening experience of the user is optimized.
In one embodiment, after the song to be played is played according to the playing source, the method further includes:
and if the song information and the corresponding playing source information are not stored in the cloud server, sending the song information and the corresponding playing source information to the cloud server for storage.
The song information and the corresponding playing source information are stored in the cloud server, so that the playing source can be confirmed without executing all searching steps when the same song is played again, the resource consumption is reduced, and the playing efficiency is improved.
According to the method for playing the songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the method, the playing source can be automatically switched to play the song when the user plays the song, the user does not need to manually switch the playing source, and the user experience is improved. In addition, when the playing source is searched, the available playing source is firstly inquired at the cloud end, and the playing source can be confirmed without executing all searching steps when the same song is played, so that the resource consumption is reduced, and the playing efficiency is improved.
Fig. 3 is a flowchart illustrating a method of playing a song according to a third embodiment. Referring to fig. 3, the method for playing songs of the present embodiment includes:
step 310, acquiring song information of a song to be played;
step 320, searching a playing source of the song to be played from the song playing software installed in the terminal according to the song information;
step 330, determining a playing source of the song to be played according to the search result;
and step 340, playing the song to be played according to the playing source.
The embodiment is implemented by software installed on a terminal, and the software aggregates a plurality of song playing software, so that songs to be played can be searched and played through the song playing software or a playing server corresponding to the song playing software, different song playing software is also different playing sources, the playing sources include the song playing software or a webpage platform corresponding to the song playing software, for example, if a song can be found and played in B software, the B software is a playing source of the a song, and if the a song can be found and played in the webpage platform of the B software, the B software is also a playing source of the a song.
In step 310, when the user selects the song playlist to play, the terminal sequentially obtains song information of the songs to be played in the song playlist according to the playing progress, where the song information includes, but is not limited to, a song title, a singer, an album, and the like. The song playlist may contain one or more songs, for example, the user may play the historical songs directly or may retrieve certain songs, the songs to be played currently, i.e., the songs in the playlist.
In step 320, in the terminal, the terminal may sequentially communicate with the song playing software installed in the terminal in a polling manner to confirm the playing source, and may also communicate with each song playing software installed in the terminal to determine all the playing sources that can play the song to be played.
In step 330, if the unique song playing software is found, the found song playing software is used as a playing source of the song to be played, for example, the song playing software capable of playing the song to be played is found during polling. And if the searched song playing software is not unique, determining one of the song playing software as the playing source of the song to be played according to a preset rule, wherein the preset rule includes but is not limited to using the song playing software with the highest use frequency as the playing source, or using the song playing software with the highest playing frequency of the song to be played as the playing source. If the song playing software is not found, sending a playing source searching request to the cloud server, wherein the playing source searching request comprises song information, so that the cloud server returns a searching result according to the song information, a playing source corresponding to the playing source information in the searching result is used as a playing source of the song to be played, and the playing source searched according to the playing source searching request is the song playing software which is not installed in the terminal.
In step 340, if the playing source is the song playing software installed in the terminal, the song playing software is controlled to play the song to be played, if the playing source is the song playing software not installed in the terminal, the installation of the song playing software is prompted, and the song playing software is controlled to play the song to be played after the song playing software is successfully installed. In practical implementation, if the playing source is song playing software not installed in the terminal, the user can also be prompted to select to jump to the corresponding webpage platform to play the song or install the song playing software to play the song, if the user selects to jump to the corresponding webpage platform, the user jumps to the webpage platform corresponding to the playing source to play the song to be played, and if the user selects to install the song playing software, the song playing software is controlled to play the song to be played after the song playing software is successfully installed. The user may set a default processing mode when the playback source is the song playback software that is not installed in the terminal, for example, the default processing mode is to jump to a web platform corresponding to the playback source for playback.
According to the method for playing the songs, after the terminal obtains the song information of the songs to be played, the playing source of the songs to be played is searched according to the song information, and the songs to be played are played according to the playing source. By the method, when the user plays the song list, the terminal can be dynamically switched to different playing sources for playing according to the current song to be played, and the user does not need to manually switch the playing sources for finding and playing, so that the song listening experience of the user is optimized.
Fourth embodiment
Fig. 4 is one of the structural diagrams of the terminal shown according to the fourth embodiment. Referring to fig. 4, the terminal 10 of the present embodiment includes a memory 102 and a processor 106, where the memory 102 is configured to store at least one program instruction, and the processor 106 is configured to implement the method for playing songs according to the above embodiment by loading and executing the at least one program instruction.
Referring to fig. 5, in actual implementation, the terminal 10 includes a memory 102, a memory controller 104, one or more processors 106 (only one of which is shown), a peripheral interface 108, a radio frequency module 150, a positioning module 112, a camera module 114, an audio module 116, a screen 118, and a key module 160. These components communicate with each other via one or more communication buses/signal lines 122.
It will be appreciated that the configuration shown in FIG. 5 is merely illustrative and that terminal 10 may include more or fewer components than shown in FIG. 5 or may have a different configuration than shown in FIG. 5. The components shown in fig. 5 may be implemented in hardware, software, or a combination thereof.
The memory 102 may be used to store software programs and modules, such as program instructions/modules corresponding to the method for playing songs in the embodiment of the present application, and the processor 106 executes various functional applications and data processing by executing the software programs and modules stored in the storage controller 104, so as to implement the above-mentioned method for playing songs.
The memory 102 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 102 may further include memory located remotely from the processor 106, which may be connected to the terminal 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof. Access to the memory 102 by the processor 106, and possibly other components, may be under the control of the memory controller 104.
Peripheral interface 108 couples various input/output devices to the CPU and memory 102. The processor 106 executes various software, instructions within the memory 102 to perform various functions of the terminal 10 and to perform data processing.
In some embodiments, the peripheral interface 108, the processor 106, and the memory controller 104 may be implemented in a single chip. In other examples, they may be implemented separately from the individual chips.
The rf module 150 is used for receiving and transmitting electromagnetic waves, and implementing interconversion between the electromagnetic waves and electrical signals, so as to communicate with a communication network or other devices. Rf module 150 may include various existing circuit elements for performing these functions, such as an antenna, a radio frequency transceiver, a digital signal processor, an encryption/decryption chip, a Subscriber Identity Module (SIM) card, memory, and so forth. The rf module 150 may communicate with various networks such as the internet, an intranet, a wireless network, or with other devices via a wireless network. The wireless network may comprise a cellular telephone network, a wireless local area network, or a metropolitan area network. The Wireless network may use various Communication standards, protocols, and technologies, including, but not limited to, Global System for Mobile Communication (GSM), Enhanced Mobile Communication (Enhanced Data GSM Environment, EDGE), wideband Code division multiple Access (W-CDMA), Code Division Multiple Access (CDMA), Time Division Multiple Access (TDMA), bluetooth, Wireless Fidelity (WiFi) (e.g., Institute of Electrical and Electronics Engineers (IEEE) standard IEEE802.11 a, IEEE802.11 b, IEEE802.1 g, and/or IEEE802.11 n), Voice over internet protocol (VoIP), world wide mail Access (Wireless for Microwave, Mobile telecommunications), Wi-Max, and any other suitable protocols for instant messaging, and may even include those protocols that have not yet been developed.
The positioning module 112 is used for acquiring the current position of the terminal 10. Examples of the positioning module 112 include, but are not limited to, a global positioning satellite system (GPS), a wireless local area network-based positioning technology, or a mobile communication network-based positioning technology.
The camera module 114 is used to take a picture or video. The pictures or videos taken may be stored in the memory 102 and transmitted through the radio frequency module 150.
Audio module 116 provides an audio interface to a user that may include one or more microphones, one or more speakers, and audio circuitry. The audio circuitry receives audio data from the peripheral interface 108, converts the audio data to electrical information, and transmits the electrical information to the speaker. The speaker converts the electrical information into sound waves that the human ear can hear. The audio circuitry also receives electrical information from the microphone, converts the electrical information to voice data, and transmits the voice data to the peripheral interface 108 for further processing. The audio data may be retrieved from the memory 102 or through the radio frequency module 150. In addition, the audio data may also be stored in the memory 102 or transmitted through the radio frequency module 150. In some examples, the audio module 116 may also include an earphone jack for providing an audio interface to a headset or other device.
The screen 118 provides an output interface between the terminal 10 and the user. In particular, screen 118 displays video output to the user, the content of which may include text, graphics, video, and any combination thereof. Some of the output results are for some of the user interface objects. It is understood that the screen 118 may also include a touch screen. The touch screen provides both an output and an input interface between the terminal 10 and a user. In addition to displaying video output to users, touch screens also receive user input, such as user clicks, swipes, and other gesture operations, so that user interface objects respond to these user input. The technique of detecting user input may be based on resistive, capacitive, or any other possible touch detection technique. Specific examples of touch screen display units include, but are not limited to, liquid crystal displays or light emitting polymer displays.
The key module 160 also provides an interface for user input to the terminal 10, and the user can press different keys to cause the terminal 10 to perform different functions.
Although the present application has been described with reference to a preferred embodiment, it should be understood that various changes, substitutions and alterations can be made herein without departing from the spirit and scope of the application, and all changes, substitutions and alterations that fall within the spirit and scope of the application are to be understood as being included within the following description of the preferred embodiment.