CN104915382A - Music playing method and terminal - Google Patents

Music playing method and terminal Download PDF

Info

Publication number
CN104915382A
CN104915382A CN201510257950.7A CN201510257950A CN104915382A CN 104915382 A CN104915382 A CN 104915382A CN 201510257950 A CN201510257950 A CN 201510257950A CN 104915382 A CN104915382 A CN 104915382A
Authority
CN
China
Prior art keywords
local music
described local
music
terminal
url
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.)
Granted
Application number
CN201510257950.7A
Other languages
Chinese (zh)
Other versions
CN104915382B (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.)
Guangdong Oppo Mobile Telecommunications Corp Ltd
Original Assignee
Guangdong Oppo Mobile Telecommunications Corp 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 Guangdong Oppo Mobile Telecommunications Corp Ltd filed Critical Guangdong Oppo Mobile Telecommunications Corp Ltd
Priority to CN201510257950.7A priority Critical patent/CN104915382B/en
Publication of CN104915382A publication Critical patent/CN104915382A/en
Application granted granted Critical
Publication of CN104915382B publication Critical patent/CN104915382B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • 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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9566URL specific, e.g. using aliases, detecting broken or misspelled links

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Telephonic Communication Services (AREA)

Abstract

The embodiment of the invention discloses a music playing method and terminal. The method includes the steps that under the condition of networking, a playing instruction for stored local music is received; the ID of the local music is read; whether the ID of the local music contains the MAC address of the terminal where the local music is located is judged; if yes, an URL of the local music is generated, wherein the URL of the local music carries the IP address of the terminal where the local music is located and the ID of the local music; a playing message containing the URL of the local music is sent to a wireless loudspeaker box so that the loudspeaker box can respond to the playing message and analyze the URL of the local music to obtain the IP address of the terminal where the local music is located and the storage path of the local music, and read the local music from the terminal according to the IP address of the terminal where the local music is located and the storage path of the local music to play the music. By means of the music playing method and terminal, the success rate of playing the local music of the wireless loudspeaker box can be increased.

Description

A kind of method for playing music and terminal
Technical field
The present invention relates to communication technical field, be specifically related to a kind of method for playing music and terminal.
Background technology
Along with the fast development of wireless technology, some wireless sound boxes are there are in recent years.Wireless sound box is a kind of novel intelligent appliance equipment, and it can connect the application program (Application, APP) in the terminals such as mobile phone, flat board, notebook computer by network.Wherein, APP can collect URL(uniform resource locator) (the Uniform Resource Locator of local music, URL), this URL comprises Internet protocol (the Internet Protocol of local music place terminal, IP) address, when after local music collection, as the URL of a certain local music that user selects APP to collect, this URL can be pushed to wireless sound box by APP, makes wireless sound box corresponding local music can be found to play from the terminal at this local music place according to this URL.But, when the local music collection time is longer, because the IP address of terminal often changes, cause wireless sound box cannot find the terminal at local music place according to the URL of the local music of APP collection, the local music that APP is collected often cannot be play by wireless sound box, and the broadcasting success ratio of the local music of APP collection is lower.
Summary of the invention
The embodiment of the present invention provides a kind of method for playing music and terminal, can improve the broadcasting success ratio of the local music of terminal collection.
First aspect, provides a kind of method for playing music, comprising:
When networking, receive the play instruction for the local music collected;
Read the mark ID of described local music;
Judge whether the mark ID of described local music comprises the MAC Address of described local music place terminal;
If comprise, generate the URL of described local music, the URL of described local music carries the IP address of described local music place terminal and the mark ID of described local music;
The broadcasting message comprising the URL of described local music is sent to wireless sound box, with the URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the store path of described local music, read described local music according to the IP address of described local music place terminal and the store path of described local music from described terminal and play.
In the first possible implementation of first aspect, before the play instruction of described reception for local music, described method also comprises:
Receive the collection instruction for local music;
For described local music assigned identification codes, described identification code generates according to the store path of described local music;
Obtain the MAC Address of described local music place terminal;
The MAC Address of described local music place terminal and the identification code of described local music are combined, generates the mark ID of described local music;
The mark ID of described local music is collected in terminal memory.
In conjunction with the first possible implementation of first aspect, in the implementation that the second of first aspect is possible, after the mark ID of the described local music of described judgement comprises the MAC Address of described local music place terminal, described method also comprises:
Resolve the identification code of described local music, obtain the store path of described local music;
Judge that whether the store path of described local music is consistent with the current store path of described local music;
If consistent, perform the step of the URL of the described local music of described generation.
In conjunction with the implementation that the second of first aspect is possible, in the third possible implementation of first aspect, described method also comprises:
If the current store path of the store path of described local music and described local music is inconsistent, revise the identification code of described local music, obtain the new logo code of described local music, the new logo code of described local music generates according to the current store path of described local music;
Generate the new URL of described local music, described new URL comprises the IP address of described local music place terminal and the new logo ID of described local music, described new logo ID comprise the MAC Address of described local music place terminal and the new logo code of described local music;
The broadcasting message of the new URL comprising described local music is sent to described wireless sound box, with the new URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the current store path of described local music, read described local music according to the current store path of described local music from described terminal and play.
In conjunction with first aspect, in the 4th kind of possible implementation of first aspect, described method also comprises:
If the mark ID of described local music does not comprise the MAC Address of described local music place terminal, from network, search for network URL corresponding to described local music and described network URL is pushed to described wireless sound box, to search for according to described network URL to make described wireless sound box and play described local music.
Second aspect, provides a kind of music player, comprising:
First receiving element, for when networking, receives the play instruction for the local music collected;
Reading unit, for reading the mark ID of described local music;
First judging unit, for judging whether the mark ID of described local music comprises the MAC Address of described local music place terminal;
First generation unit, for when described first judging unit judged result is for being, generates the URL of described local music, and the URL of described local music carries the IP address of described local music place terminal and the mark ID of described local music;
First transmitting element, broadcasting message for the URL by comprising described local music is sent to wireless sound box, with the URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the store path of described local music, read described local music according to the IP address of described local music place terminal and the store path of described local music from described terminal and play.
In the first possible implementation of second aspect, described terminal also comprises:
Second receiving element, for receiving the collection instruction for local music;
Allocation units, for being described local music assigned identification codes, described identification code generates according to the store path of described local music;
Acquiring unit, for obtaining the MAC Address of described local music place terminal;
Second generation unit, for the MAC Address of described local music place terminal and the identification code of described local music being combined, generates the mark ID of described local music;
Collection unit, for being collected in terminal memory by the mark ID of described local music.
In conjunction with the first possible implementation of second aspect, in the implementation that the second of second aspect is possible, after described first judging unit judges that the mark ID of described local music comprises the MAC Address of described local music place terminal, described terminal also comprises:
Resolution unit, for resolving the identification code of described local music, obtains the store path of described local music;
Second judging unit, for judging that whether the store path of described local music is consistent with the current store path of described local music;
When described second judging unit judged result is for being, trigger the URL that described generation unit generates described local music.
In conjunction with the implementation that the second of second aspect is possible, in the third possible implementation of second aspect, described terminal also comprises:
Amendment unit, for when described second judging unit judged result is no, revises the identification code of described local music, obtains the new logo code of described local music, and the new logo code of described local music generates according to the current store path of described local music;
3rd generation unit, for generating the new URL of described local music, described new URL comprises the IP address of described local music place terminal and the new logo ID of described local music, described new logo ID comprise the MAC Address of described local music place terminal and the new logo code of described local music;
Second transmitting element, for the broadcasting message of the new URL comprising described local music is sent to described wireless sound box, with the new URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the current store path of described local music, read described local music according to the current store path of described local music from described terminal and play.
In conjunction with second aspect, in the 4th kind of possible implementation of second aspect, described terminal also comprises:
Push unit, for when described first judging unit judged result is no, from network, search for network URL corresponding to described local music and described network URL is pushed to described wireless sound box, to search for according to described network URL to make described wireless sound box and play described local music.
In technique scheme, when networking, receive the play instruction for the local music collected; Read the mark ID of local music; Judge whether the mark ID of local music comprises the MAC Address of local music place terminal; If comprise, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music; The broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.The local music of collection compared to existing technology cannot be play due to IP address of terminal change, the present invention generates when playing the local music of collection the URL comprising local music place terminal current IP address in real time, thus can improve the broadcasting success ratio of the local music of terminal collection.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is a kind of network architecture schematic diagram disclosed in the embodiment of the present invention;
Fig. 2 is the process flow diagram of a kind of method for playing music disclosed in the embodiment of the present invention;
Fig. 3 is the process flow diagram of another kind of method for playing music disclosed in the embodiment of the present invention;
Fig. 4 is the process flow diagram of another kind of method for playing music disclosed in the embodiment of the present invention;
Fig. 5 is the structural representation of a kind of music player disclosed in the embodiment of the present invention;
Fig. 6 is the structural representation of another kind of music player disclosed in the embodiment of the present invention;
Fig. 7 is the structural representation of another kind of music player disclosed in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in embodiment of the present invention, the technical scheme in embodiment of the present invention is clearly and completely described.Obviously, described embodiment is a part of embodiment of the present invention, instead of whole embodiment.Based on the embodiment in the present invention, the every other embodiment that those of ordinary skill in the art obtain under the prerequisite not making creative work, all should belong to the scope of protection of the invention.
The embodiment of the present invention provides a kind of method for playing music and terminal, can improve the broadcasting success ratio of the local music of terminal collection.Below be described in detail respectively.
The terminal described in the embodiment of the present invention can comprise: mobile phone, panel computer or walkman etc., and above-mentioned terminal is only citing, and non exhaustive, including but not limited to above-mentioned terminal.
In order to better understand a kind of method for playing music and terminal disclosed in the embodiment of the present invention, first the network architecture that the embodiment of the present invention is suitable for is described below.Refer to Fig. 1, Fig. 1 is a kind of network architecture schematic diagram disclosed in the embodiment of the present invention.In the network architecture shown in Fig. 1, can comprise terminal and wireless sound box, wherein, terminal can (as WI-FI, bluetooth) and wireless sound box communicate to connect to wirelessly.In the network architecture shown in Fig. 1, terminal can comprise cell phone, panel computer, personal digital assistant (PersonalDigital Assistant, PDA), mobile internet device (Mobile Internet Device, MID), each Terminal Type such as Intelligent worn device (as intelligent watch, Intelligent bracelet), the embodiment of the present invention is not construed as limiting.By implementing the network architecture shown in Fig. 1, the success ratio that the local music that can improve terminal collection is play at wireless sound box.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses a kind of method for playing music.Refer to Fig. 2, Fig. 2 is the process flow diagram of a kind of method for playing music disclosed in the embodiment of the present invention.As shown in Figure 2, the method for playing music described in the present embodiment can comprise the following steps:
S201, when networking, receives the play instruction for the local music collected.
In the embodiment of the present invention, local music can be the audio file being stored in terminal, and the form of audio file includes but not limited to MP3 format, WMA form, WAV form, APE form, FLAC form etc.The local music collected can be the local music that terminal APP has collected.
S202, reads the mark ID of local music.
In the embodiment of the present invention, the MAC Address of mark ID by local music place terminal of local music and the identification code combination producing of local music, the Hash codes that the store path of local music can be generated is as the identification code of local music.The mark ID form of local music can be: the Hash codes of the store path generation of MAC Address/local music, this Hash codes is generated according to certain algorithm by the store path of local music.
S203, judges whether the mark ID of local music comprises the MAC Address of local music place terminal.If so, perform step S204 ~ step S205, if not, perform step S206.
In the embodiment of the present invention, if the local music of collection comprises the MAC Address of local music place terminal, show that this local music is collected by this local music place terminal, the mark ID of this local music is legal; If the local music of collection does not comprise the MAC Address of local music place terminal, show that this local music is not collected by this local music place terminal, showing that the mark ID of this local music is unknown, is illegal.By judging whether the mark ID of local music comprises the MAC Address of local music place terminal, the security of the local music of terminal collection can be improved.
S204, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
In the embodiment of the present invention, if the mark ID of local music comprises the MAC Address of local music place terminal, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.After judging that local music is by the collection of local music place terminal, the URL of local music comprises the current IP address of local music place terminal, when playing the local music of collection, the URL of real-time generation local music, ensure that the IP address of local music place terminal is up-to-date IP address, thus the success ratio that the local music that can improve terminal collection is play.
S205, the broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
In the embodiment of the present invention, the broadcasting message comprising the URL of local music is sent to wireless sound box, wireless sound box responds this broadcasting message, resolve the URL of local music, obtain the IP address of local music place terminal and the store path of local music, find the terminal at local music place according to the IP address of local music place terminal, the store path according to local music reads local music from the terminal at local music place and plays.Wherein, store path according to local music reads local music and plays can comprise from the terminal at local music place: the store path according to local music searches this local music from the terminal at local music place, and local music can be transferred to wireless sound box by streaming media mode and play by the terminal at this local music place.Implement the embodiment of the present invention, wireless sound box is searched this local music according to the URL of local music from local music place terminal and plays, because the IP address of the local music place terminal comprised in the URL of this local music produces, so the success ratio that wireless sound box plays this local music according to the IP address of this local music place terminal from terminal is higher when playing this local music.
S206, searches for network URL corresponding to local music and network URL is pushed to wireless sound box from network, to search for and play local music to make wireless sound box according to network URL.
In the embodiment of the present invention, when the mark ID of local music does not comprise the MAC Address of local music place terminal, show this local music do not collected or this local music illegal, terminal is then searched for network URL corresponding to local music and network URL is pushed to wireless sound box from network, to search for and play local music to make wireless sound box according to network URL.Wherein, network URL corresponding to search local music can search for according to the music information of local music, finds the network URL mated the most, and this network URL is pushed wireless sound box, to search for and play local music to make wireless sound box according to network URL.
In the embodiment of the present invention, when networking, terminal receives the play instruction for the local music collected; Read the mark ID of local music; Judge whether the mark ID of local music comprises the MAC Address of local music place terminal; If do not comprise, from network, search for network URL corresponding to local music and network URL is pushed to wireless sound box, to search for according to network URL to make wireless sound box and play local music; If comprise, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music; The broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.Implement the embodiment of the present invention, the broadcasting success ratio of the local music of terminal collection can be improved.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses another kind of method for playing music.Refer to Fig. 3, Fig. 3 is the process flow diagram of another kind of method for playing music disclosed in the embodiment of the present invention.As shown in Figure 3, the method for playing music described in the present embodiment can comprise the following steps:
S301, receives the collection instruction for local music.
In the embodiment of the present invention, before the local music playing collection, first in the terminal at local music place, collect local music, can by the APP of local music place terminal collects local music.Such as, when the terminal at local music place collects local music, user selects the local music needing collection on the APP of terminal, and terminal receives the collection instruction for local music.
S302, be local music assigned identification codes, identification code generates according to the store path of local music.
In the embodiment of the present invention, after reception is for the collection instruction of local music, terminal is local music assigned identification codes, and the Hash codes that the store path of local music can be generated is as the identification code of local music.
S303, obtains the MAC Address of local music place terminal.
In the embodiment of the present invention, MAC (Media Access Control or Medium Access Control) address, also claim physical address or hardware address, the MAC Address of terminal just secures after terminal is dispatched from the factory.
S304, combines the MAC Address of local music place terminal and the identification code of local music, generates the mark ID of local music.
In the embodiment of the present invention, the MAC Address of local music place terminal and the identification code of local music combine by terminal, generate the mark ID of local music, and this local music can be made to have a unique mark ID.The mark ID form of this local music can be: the Hash codes of the store path generation of MAC Address/local music, this Hash codes is generated according to certain algorithm by the store path of this local music.
S305, is collected in terminal memory by the mark ID of local music.
In the embodiment of the present invention, the mark ID of local music is collected in terminal memory, shows that the mark ID of local music collects successfully.
S306, when networking, receives the play instruction for the local music collected.
S307, reads the mark ID of local music.
S308, judges whether the mark ID of local music comprises the MAC Address of local music place terminal.
S309, if comprise, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
S310, the broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
Step S306 in the embodiment of the present invention ~ step S310 can consult step S201 ~ step S205 in the embodiment described by Fig. 2, and the embodiment of the present invention repeats no more.
In the embodiment of the present invention, terminal receives the collection instruction for local music; For local music assigned identification codes, identification code generates according to the store path of local music; Obtain the MAC Address of local music place terminal; The MAC Address of local music place terminal and the identification code of local music are combined, generates the mark ID of local music; The mark ID of local music is collected in terminal memory; When networking, receive the play instruction for the local music collected; Read the mark ID of local music; Judge whether the mark ID of local music comprises the MAC Address of local music place terminal; If comprise, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music; The broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.The real-time embodiment of the present invention, can improve the broadcasting success ratio of the local music of terminal collection.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses another kind of method for playing music.Refer to Fig. 4, Fig. 4 is the process flow diagram of another kind of method for playing music disclosed in the embodiment of the present invention.As shown in Figure 4, the method for playing music described in the present embodiment can comprise the following steps:
S401, receives the collection instruction for local music.
S402, be local music assigned identification codes, identification code generates according to the store path of local music.
S403, obtains the MAC Address of local music place terminal.
S404, combines the MAC Address of local music place terminal and the identification code of local music, generates the mark ID of local music.
S405, is collected in terminal memory by the mark ID of local music.
S406, when networking, receives the play instruction for the local music collected.
S407, reads the mark ID of local music.
S408, judges whether the mark ID of local music comprises the MAC Address of local music place terminal.
S409, if comprise, resolves the identification code of local music, obtains the store path of local music.
In the embodiment of the present invention, when the mark ID of local music comprises the MAC Address of local music place terminal, the identification code of terminal parses local music, obtains the store path of local music.
S410, judges that whether the store path of local music is consistent with the current store path of local music.If consistent, perform step S411 ~ step S412, if inconsistent, perform step S413 ~ step S415.
In the embodiment of the present invention, if the store path of local music is consistent with the current store path of local music, then generate the URL comprising the store path of local music, if the current store path of the store path of local music and local music is inconsistent, then generate the URL comprising the current store path of local music.By judging that whether the store path of local music is consistent with the current store path of local music, can ensure that the URL of the local music generated comprises the store path of current local music, prevent the store path due to local music from sending change and cause wireless sound box to play local music.
S411, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
S412, the broadcasting message comprising the URL of local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
S413, the identification code of amendment local music, obtains the new logo code of local music, and the new logo code of local music generates according to the current store path of local music.
In the embodiment of the present invention, when the store path of local music and the current store path of local music inconsistent time, the identification code of amendment local music, obtains the new logo code of local music, the current store path of local music can be generated the new logo code of local music by Hash codes.
S414, generate the new URL of local music, new URL comprises the IP address of local music place terminal and the new logo ID of local music, new logo ID comprise the MAC Address of local music place terminal and the new logo code of local music.
S415, the broadcasting message of the new URL comprising local music is sent to wireless sound box, the new URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the current store path of local music, read local music according to the current store path of local music from terminal and play.
Step S401 in the embodiment of the present invention ~ step S408 can consult step S301 ~ step S308 in the embodiment described by Fig. 3, step S411 ~ step S412 can consult step S309 ~ step S310 in the embodiment described by Fig. 3, and the embodiment of the present invention repeats no more.
In the embodiment of the present invention, when playing the local music of collection, if the store path of the local music of terminal collection changes, again the current store path of local music can be obtained, can ensure that the URL of the local music generated comprises the store path of current local music, improve the broadcasting success ratio of the local music of terminal collection, prevent the store path due to local music from sending change and cause wireless sound box to play local music.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses a kind of music player.Refer to Fig. 5, Fig. 5 is the structural representation of a kind of music player disclosed in the embodiment of the present invention.As shown in Figure 5, the music player described in the present embodiment can comprise:
First receiving element 501, for when networking, receives the play instruction for the local music collected.
In the embodiment of the present invention, the first receiving element 501 receives the play instruction for the local music collected.Wherein, local music can be the audio file being stored in terminal, the form of audio file includes but not limited to MP3 format, WMA form, WAV form, APE form, FLAC form etc., and the local music collected can be the local music that terminal APP has collected.
Reading unit 502, for reading the mark ID of local music.
In the embodiment of the present invention, reading unit 502 reads the mark ID of local music.Wherein, the MAC Address of mark ID by local music place terminal of local music and the identification code combination producing of local music, the Hash codes that the store path of local music can be generated is as the identification code of local music, the mark ID form of local music can be: the Hash codes of the store path generation of MAC Address/local music, this Hash codes is generated according to certain algorithm by the store path of local music.
First judging unit 503, for judging whether the mark ID of local music comprises the MAC Address of local music place terminal.
In the embodiment of the present invention, the first judging unit 503 judges whether the mark ID of local music comprises the MAC Address of local music place terminal.If the local music of collection comprises the MAC Address of local music place terminal, show that this local music is collected by this local music place terminal, the mark ID of this local music is legal; If the local music of collection does not comprise the MAC Address of local music place terminal, show that this local music is not collected by this local music place terminal, showing that the mark ID of this local music is unknown, is illegal.By judging whether the mark ID of local music comprises the MAC Address of local music place terminal, the security of the local music of terminal collection can be improved.
First generation unit 504, for when the first judging unit 503 judged result is for being, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
In the embodiment of the present invention, if the mark ID of local music comprises the MAC Address of local music place terminal, the first generation unit 504 generates the URL of local music, and the URL of local music carries the IP address of local music place terminal and the mark ID of local music.After the first judging unit 503 judges that local music is by the collection of local music place terminal, first generation unit 504 generates the URL of local music, the URL of local music comprises the current IP address of local music place terminal, when playing the local music of collection, the URL of real-time generation local music, ensure that the IP address of local music place terminal is up-to-date IP address, thus the success ratio that the local music that can improve terminal collection is play.
First transmitting element 505, broadcasting message for the URL by comprising local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
In the embodiment of the present invention, the broadcasting message comprising the URL of local music is sent to wireless sound box by the first transmitting element 505, wireless sound box responds this broadcasting message, resolve the URL of local music, obtain the IP address of local music place terminal and the store path of local music, find the terminal at local music place according to the IP address of local music place terminal, the store path according to local music reads local music from the terminal at local music place and plays.Wherein, store path according to local music reads local music and plays can comprise from the terminal at local music place: the store path according to local music searches this local music from the terminal at local music place, and local music can be transferred to wireless sound box by streaming media mode and play by the terminal at this local music place.Implement the embodiment of the present invention, wireless sound box is searched this local music according to the URL of local music from local music place terminal and plays, because the IP address of the local music place terminal comprised in the URL of this local music produces, so the success ratio that wireless sound box plays this local music according to the IP address of this local music place terminal from terminal is higher when playing this local music.
Push unit 506, for when the first judging unit 503 judged result is no, searches for network URL corresponding to local music and network URL is pushed to wireless sound box from network, to search for and play local music to make wireless sound box according to network URL.
In the embodiment of the present invention, when the mark ID of local music does not comprise the MAC Address of local music place terminal, show this local music do not collected or this local music illegal, push unit 506 is searched for network URL corresponding to local music and network URL is pushed to wireless sound box from network, to search for and play local music to make wireless sound box according to network URL.Wherein, network URL corresponding to search local music can search for according to the music information of local music, finds the network URL mated the most, and this network URL is pushed wireless sound box, to search for and play local music to make wireless sound box according to network URL.
In the embodiment of the present invention, when networking, the first receiving element 501 receives the play instruction for the local music collected; Reading unit 502 reads the mark ID of local music; First judging unit 503 judges whether the mark ID of local music comprises the MAC Address of local music place terminal; If do not comprise, push unit 506 is searched for network URL corresponding to local music and network URL is pushed to wireless sound box from network, to search for and play local music to make wireless sound box according to network URL; If comprise, the first generation unit 504 generates the URL of local music, and the URL of local music carries the IP address of local music place terminal and the mark ID of local music; The broadcasting message comprising the URL of local music is sent to wireless sound box by the first transmitting element 505, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.Implement the embodiment of the present invention, the broadcasting success ratio of the local music of terminal collection can be improved.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses another kind of music player.Refer to Fig. 6, Fig. 6 is the structural representation of another kind of music player disclosed in the embodiment of the present invention.As shown in Figure 6, the music player described in the present embodiment can comprise:
Second receiving element 507, for receiving the collection instruction for local music.
In the embodiment of the present invention, the second receiving element 507 receives the collection instruction for local music.Wherein, before the local music playing collection, first in the terminal at local music place, collect local music, can by the APP of local music place terminal collects local music.Such as, when the terminal at local music place collects local music, user selects the local music needing collection on the APP of terminal, and terminal receives the collection instruction for local music.
Allocation units 508, for being local music assigned identification codes, identification code generates according to the store path of local music.
In the embodiment of the present invention, after reception is for the collection instruction of local music, allocation units 508 are local music assigned identification codes, and the Hash codes that the store path of local music can be generated is as the identification code of local music.
Acquiring unit 509, for obtaining the MAC Address of local music place terminal.
In the embodiment of the present invention, acquiring unit 509 obtains the MAC Address of local music place terminal.Wherein, MAC (Media Access Control or Medium Access Control) address, also claim physical address or hardware address, the MAC Address of terminal just secures after terminal is dispatched from the factory.
Second generation unit 510, for the MAC Address of local music place terminal and the identification code of local music being combined, generates the mark ID of local music.
In the embodiment of the present invention, the MAC Address of local music place terminal and the identification code of local music combine by the second generation unit 510, generate the mark ID of local music, and this local music can be made to have a unique mark ID.The mark ID form of this local music can be: the Hash codes of the store path generation of MAC Address/local music, this Hash codes is generated according to certain algorithm by the store path of this local music.
Collection unit 511, for being collected in terminal memory by the mark ID of local music.
In the embodiment of the present invention, the mark ID of local music is collected in terminal memory by collection unit 511, shows that the mark ID of local music collects successfully.
First receiving element 501, for when networking, receives the play instruction for the local music collected.
Reading unit 502, for reading the mark ID of local music.
First judging unit 503, for judging whether the mark ID of local music comprises the MAC Address of local music place terminal.
First generation unit 504, for when the first judging unit 503 judged result is for being, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
First transmitting element 505, broadcasting message for the URL by comprising local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
The first receiving element 501 in the embodiment of the present invention, reading unit 502, first judging unit 503, first generation unit 504 and the first transmitting element 505 can be shown in Figure 5 terminal, the embodiment of the present invention repeats no more.
In the embodiment of the present invention, the second receiving element 507 receives the collection instruction for local music; Allocation units 508 are local music assigned identification codes, and identification code generates according to the store path of local music; Acquiring unit 509 obtains the MAC Address of local music place terminal; The MAC Address of local music place terminal and the identification code of local music combine by the second generation unit 510, generate the mark ID of local music; The mark ID of local music is collected in terminal memory by collection unit 511; When networking, the first receiving element 501 receives the play instruction for the local music collected; Reading unit 502 reads the mark ID of local music; First judging unit 503 judges whether the mark ID of local music comprises the MAC Address of local music place terminal; If comprise, the first generation unit 504 generates the URL of local music, and the URL of local music carries the IP address of local music place terminal and the mark ID of local music; The broadcasting message comprising the URL of local music is sent to wireless sound box by the first transmitting element 505, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.The real-time embodiment of the present invention, can improve the broadcasting success ratio of the local music of terminal collection.
Based on the network architecture shown in Fig. 1, the embodiment of the invention discloses another kind of music player.Refer to Fig. 7, Fig. 7 is the structural representation of another kind of music player disclosed in the embodiment of the present invention.As shown in Figure 7, the music player described in the present embodiment can comprise:
Second receiving element 507, for receiving the collection instruction for local music.
Allocation units 508, for being local music assigned identification codes, identification code generates according to the store path of local music.
Acquiring unit 509, for obtaining the MAC Address of local music place terminal.
Second generation unit 510, for the MAC Address of local music place terminal and the identification code of local music being combined, generates the mark ID of local music.
Collection unit 511, for being collected in terminal memory by the mark ID of local music.
First receiving element 501, for when networking, receives the play instruction for the local music collected.
Reading unit 502, for reading the mark ID of local music.
First judging unit 503, for judging whether the mark ID of local music comprises the MAC Address of local music place terminal.
Resolution unit 512, for when the first judging unit 503 judged result is for being, resolving the identification code of local music, obtaining the store path of local music.
In the embodiment of the present invention, when the mark ID of local music comprises the MAC Address of local music place terminal, resolution unit 512 resolves the identification code of local music, obtains the store path of local music.
Second judging unit 513, for judging that whether the store path of local music is consistent with the current store path of local music.
In the embodiment of the present invention, the second judging unit 513 judges that whether the store path of local music is consistent with the current store path of local music.Wherein, if the store path of local music is consistent with the current store path of local music, then generate the URL comprising the store path of local music, if the current store path of the store path of local music and local music is inconsistent, then generate the URL comprising the current store path of local music.Second judging unit 513 judges that whether the store path of local music is consistent with the current store path of local music, can ensure that the URL of the local music generated comprises the store path of current local music, prevent the store path due to local music from sending change and cause wireless sound box to play local music.
First generation unit 504, also for when the second judging unit 513 judged result is for being, generate the URL of local music, the URL of local music carries the IP address of local music place terminal and the mark ID of local music.
First transmitting element 505, broadcasting message for the URL by comprising local music is sent to wireless sound box, the URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the store path of local music, read local music according to the IP address of local music place terminal and the store path of local music from terminal and play.
Amendment unit 514, for when the second judging unit 513 judged result is no, the identification code of amendment local music, obtains the new logo code of local music, and the new logo code of local music generates according to the current store path of local music.
In the embodiment of the present invention, when the store path of local music and the current store path of local music inconsistent time, amendment unit 514 revises the identification code of local music, obtain the new logo code of local music, the current store path of local music can be generated the new logo code of local music by Hash codes.
3rd generation unit 515, for generating the new URL of local music, new URL comprises the IP address of local music place terminal and the new logo ID of local music, new logo ID comprise the MAC Address of local music place terminal and the new logo code of local music.
Second transmitting element 516, for the broadcasting message of the new URL comprising local music is sent to wireless sound box, the new URL playing message parse local music is responded to make wireless sound box, obtain the IP address of local music place terminal and the current store path of local music, read local music according to the current store path of local music from terminal and play.
The second receiving element 507 in the embodiment of the present invention, allocation units 508, acquiring unit 509, second generation unit 510, collection unit 511, first receiving element 501, reading unit 502, first judging unit 503, first generation unit 504 and the first transmitting element 505 can be shown in Figure 6 terminal, the embodiment of the present invention repeats no more.
In the embodiment of the present invention, when playing the local music of collection, if the store path of the local music of terminal collection changes, again the current store path of local music can be obtained, can ensure that the URL of the local music generated comprises the store path of current local music, improve the broadcasting success ratio of the local music of terminal collection, prevent the store path due to local music from sending change and cause wireless sound box to play local music.
One of ordinary skill in the art will appreciate that all or part of step in the various methods of above-described embodiment is that the hardware that can carry out instruction relevant by program has come, this program can be stored in a computer-readable recording medium, storage medium can comprise: flash disk, ROM (read-only memory) (Read-Only Memory, ROM), random access device (Random Access Memory, RAM), disk or CD etc.
A kind of method for playing music provided the embodiment of the present invention above and terminal are described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.

Claims (10)

1. a method for playing music, is characterized in that, comprising:
When networking, receive the play instruction for the local music collected;
Read the mark ID of described local music;
Judge whether the mark ID of described local music comprises the MAC Address of described local music place terminal;
If comprise, generate the URL of described local music, the URL of described local music carries the IP address of described local music place terminal and the mark ID of described local music;
The broadcasting message comprising the URL of described local music is sent to wireless sound box, with the URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the store path of described local music, read described local music according to the IP address of described local music place terminal and the store path of described local music from described terminal and play.
2. method according to claim 1, is characterized in that, before the play instruction of described reception for local music, described method also comprises:
Receive the collection instruction for local music;
For described local music assigned identification codes, described identification code generates according to the store path of described local music;
Obtain the MAC Address of described local music place terminal;
The MAC Address of described local music place terminal and the identification code of described local music are combined, generates the mark ID of described local music;
The mark ID of described local music is collected in terminal memory.
3. method according to claim 2, is characterized in that, after the mark ID of the described local music of described judgement comprises the MAC Address of described local music place terminal, described method also comprises:
Resolve the identification code of described local music, obtain the store path of described local music;
Judge that whether the store path of described local music is consistent with the current store path of described local music;
If consistent, perform the step of the URL of the described local music of described generation.
4. method according to claim 3, is characterized in that, described method also comprises:
If the current store path of the store path of described local music and described local music is inconsistent, revise the identification code of described local music, obtain the new logo code of described local music, the new logo code of described local music generates according to the current store path of described local music;
Generate the new URL of described local music, described new URL comprises the IP address of described local music place terminal and the new logo ID of described local music, described new logo ID comprise the MAC Address of described local music place terminal and the new logo code of described local music;
The broadcasting message of the new URL comprising described local music is sent to described wireless sound box, with the new URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the current store path of described local music, read described local music according to the current store path of described local music from described terminal and play.
5. method according to claim 1, is characterized in that, described method also comprises:
If the mark ID of described local music does not comprise the MAC Address of described local music place terminal, from network, search for network URL corresponding to described local music and described network URL is pushed to described wireless sound box, to search for according to described network URL to make described wireless sound box and play described local music.
6. a music player, is characterized in that, comprising:
First receiving element, for when networking, receives the play instruction for the local music collected;
Reading unit, for reading the mark ID of described local music;
First judging unit, for judging whether the mark ID of described local music comprises the MAC Address of described local music place terminal;
First generation unit, for when described first judging unit judged result is for being, generates the URL of described local music, and the URL of described local music carries the IP address of described local music place terminal and the mark ID of described local music;
First transmitting element, broadcasting message for the URL by comprising described local music is sent to wireless sound box, with the URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the store path of described local music, read described local music according to the IP address of described local music place terminal and the store path of described local music from described terminal and play.
7. terminal according to claim 6, is characterized in that, before described first receiving element receives the play instruction for local music, described terminal also comprises:
Second receiving element, for receiving the collection instruction for local music;
Allocation units, for being described local music assigned identification codes, described identification code generates according to the store path of described local music;
Acquiring unit, for obtaining the MAC Address of described local music place terminal;
Second generation unit, for the MAC Address of described local music place terminal and the identification code of described local music being combined, generates the mark ID of described local music;
Collection unit, for being collected in terminal memory by the mark ID of described local music.
8. terminal according to claim 7, is characterized in that, after described first judging unit judges that the mark ID of described local music comprises the MAC Address of described local music place terminal, described terminal also comprises:
Resolution unit, for resolving the identification code of described local music, obtains the store path of described local music;
Second judging unit, for judging that whether the store path of described local music is consistent with the current store path of described local music;
When described second judging unit judged result is for being, trigger the URL that described generation unit generates described local music.
9. terminal according to claim 8, is characterized in that, described terminal also comprises:
Amendment unit, for when described second judging unit judged result is no, revises the identification code of described local music, obtains the new logo code of described local music, and the new logo code of described local music generates according to the current store path of described local music;
3rd generation unit, for generating the new URL of described local music, described new URL comprises the IP address of described local music place terminal and the new logo ID of described local music, described new logo ID comprise the MAC Address of described local music place terminal and the new logo code of described local music;
Second transmitting element, for the broadcasting message of the new URL comprising described local music is sent to described wireless sound box, with the new URL making described wireless sound box respond local music described in described broadcasting message parse, obtain the IP address of described local music place terminal and the current store path of described local music, read described local music according to the current store path of described local music from described terminal and play.
10. terminal according to claim 6, is characterized in that, described terminal also comprises:
Push unit, for when described first judging unit judged result is no, from network, search for network URL corresponding to described local music and described network URL is pushed to described wireless sound box, to search for according to described network URL to make described wireless sound box and play described local music.
CN201510257950.7A 2015-05-18 2015-05-18 A kind of method for playing music and terminal Active CN104915382B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510257950.7A CN104915382B (en) 2015-05-18 2015-05-18 A kind of method for playing music and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510257950.7A CN104915382B (en) 2015-05-18 2015-05-18 A kind of method for playing music and terminal

Publications (2)

Publication Number Publication Date
CN104915382A true CN104915382A (en) 2015-09-16
CN104915382B CN104915382B (en) 2018-07-06

Family

ID=54084445

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510257950.7A Active CN104915382B (en) 2015-05-18 2015-05-18 A kind of method for playing music and terminal

Country Status (1)

Country Link
CN (1) CN104915382B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760436A (en) * 2016-02-02 2016-07-13 广东欧珀移动通信有限公司 Audio data processing method and device
CN106205658A (en) * 2016-06-28 2016-12-07 广州三星通信技术研究有限公司 The method and apparatus that multimedia file is play is controlled at electric terminal or earphone

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104185039A (en) * 2013-05-27 2014-12-03 腾讯科技(深圳)有限公司 Method and device for audio and video synchronous playing
CN104240735A (en) * 2014-05-23 2014-12-24 杭州联汇数字科技有限公司 Intelligent loudspeaker box audio playing method and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104185039A (en) * 2013-05-27 2014-12-03 腾讯科技(深圳)有限公司 Method and device for audio and video synchronous playing
CN104240735A (en) * 2014-05-23 2014-12-24 杭州联汇数字科技有限公司 Intelligent loudspeaker box audio playing method and system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105760436A (en) * 2016-02-02 2016-07-13 广东欧珀移动通信有限公司 Audio data processing method and device
CN105760436B (en) * 2016-02-02 2019-07-16 Oppo广东移动通信有限公司 The processing method and processing device of audio data
CN106205658A (en) * 2016-06-28 2016-12-07 广州三星通信技术研究有限公司 The method and apparatus that multimedia file is play is controlled at electric terminal or earphone

Also Published As

Publication number Publication date
CN104915382B (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN105025051A (en) Cloud-side voice service providing method and system
CN104092723B (en) Document down loading method, Apparatus and system
CN104205890A (en) Wireless communication device, communication system, and communication method
CN102149046B (en) Wireless Telecom Equipment and wireless communications method
CN105451300B (en) A kind of method for connecting network and mobile device
JP2021521489A (en) Business data processing method, equipment and related equipment
CN109743745B (en) Mobile network access type identification method and device, electronic equipment and storage medium
CN103618792A (en) Data stream identification method and device
CN105338059A (en) Data synchronization method and mobile terminal
CN104754132A (en) Electronic device and method of determining operating mode of electronic device
CN104837178A (en) Network accessing method and device
CN105095410A (en) Setting method, mobile terminal, server and system of song menu
CN113286284A (en) Connection control method, device, equipment and medium for terminal and Bluetooth equipment
CN106599173A (en) Lyric matching method and terminal
CN105049999A (en) Demonstration method of sound box subgroups, local server, mobile terminal and system
CN104915382A (en) Music playing method and terminal
CN105703987B (en) A kind of audio-video frequency playing system control method and device
CN104966526A (en) Random play method and apparatus
CN102065479B (en) Radio communication system, device and method
CN107146609B (en) Switching method and device of playing resources and intelligent equipment
CN105120392A (en) Method of creating sound box grouping and mobile terminal
CN104978981B (en) A kind of music shuffle method and device
CN106095132A (en) Playback equipment keypress function method to set up and device
CN106303616A (en) A kind of control method for playing back, device and terminal
CN105760436A (en) Audio data processing method and device

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee after: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

Address before: Changan town in Guangdong province Dongguan 523860 usha Beach Road No. 18

Patentee before: GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP., Ltd.

CP01 Change in the name or title of a patent holder