CN104915382B - A kind of method for playing music and terminal - Google Patents
A kind of method for playing music and terminal Download PDFInfo
- Publication number
- CN104915382B CN104915382B CN201510257950.7A CN201510257950A CN104915382B CN 104915382 B CN104915382 B CN 104915382B CN 201510257950 A CN201510257950 A CN 201510257950A CN 104915382 B CN104915382 B CN 104915382B
- Authority
- CN
- China
- Prior art keywords
- local music
- music
- terminal
- local
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/955—Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
- G06F16/9566—URL specific, e.g. using aliases, detecting broken or misspelled links
Abstract
The embodiment of the invention discloses a kind of method for playing music and terminal, this method includes:In networking, receive for the play instruction of local music collected;Read the mark ID of local music;Judge whether the mark ID of local music includes the MAC Address of terminal where local music;If comprising the URL of local music is generated, the IP address of terminal and the mark ID of local music where the URL of local music carries local music;The broadcasting message of URL comprising local music is sent to wireless sound box, so that wireless sound box response plays the URL of message parsing local music, the IP address of terminal and the store path of local music where obtaining local music, the IP address of terminal and the store path of local music read local music from terminal and play according to where local music.Implement the embodiment of the present invention, the success rate that wireless sound box plays local music can be improved.
Description
Technical field
The present invention relates to fields of communication technology, and in particular to a kind of method for playing music and terminal.
Background technology
With the fast development of wireless technology, occur some wireless sound boxes in recent years.Wireless sound box is a kind of novel
Intelligent appliance equipment, it can pass through the application program in the terminals such as network connection mobile phone, tablet, laptop
(Application, APP).Wherein, APP can collect uniform resource locator (the Uniform Resource of local music
Locator, URL), Internet protocol (Internet Protocol, IP) address of terminal where which includes local music, when
After local music collection, as the URL of a certain local music that user selects APP to collect, APP can push to the URL
Wireless sound box so that wireless sound box can be found according to the terminal where the URL from the local music corresponding local music into
Row plays.However, when the local music collection time is longer, since the IP address of terminal often changes, cause wireless
Speaker can not according to APP collect local music URL find local music where terminal so that APP collection this rock noise
Pleasure can not often be played out by wireless sound box, and the broadcasting success rate of the local music of APP collections is relatively low.
Invention content
The embodiment of the present invention provides a kind of method for playing music and terminal, can improve broadcasting for the local music that terminal is collected
Put success rate.
In a first aspect, a kind of method for playing music is provided, including:
In networking, receive for the play instruction of local music collected;
Read the mark ID of the local music;
Judge whether the mark ID of the local music includes the MAC Address of terminal where the local music;
If comprising the URL of the local music is generated, the URL carryings local music place of the local music is eventually
The mark ID of the IP address at end and the local music;
The broadcasting message of URL comprising the local music is sent to wireless sound box, so that the wireless sound box responds
The URL for playing message and parsing the local music, the IP address of terminal and the local where obtaining the local music
The store path of music, according to the IP address of terminal where the local music and the store path of the local music from described
Terminal reads the local music and plays.
In the first possible realization method of first aspect, it is described receive for local music play instruction it
Before, the method further includes:
The collection received for local music instructs;
For the local music assigned identification codes, the identification code is generated according to the store path of the local music;
The MAC Address of terminal where obtaining the local music;
The MAC Address of terminal where the local music with the identification code of the local music is combined, generates described
The mark ID of ground music;
The mark ID of the local music is collected in terminal memory.
The possible realization method of with reference to first aspect the first, in second of possible realization method of first aspect
In, after the MAC Address of terminal where the mark ID for judging the local music includes the local music, the method
It further includes:
The identification code of the local music is parsed, obtains the store path of the local music;
Judge whether the store path of the local music is consistent with the currently stored path of the local music;
If consistent, the step of performing the URL of the generation local music.
Second of possible realization method with reference to first aspect, in the third possible realization method of first aspect
In, the method further includes:
If the store path of the local music and the currently stored path of the local music are inconsistent, described is changed
The identification code of ground music obtains the new logo code of the local music, and the new logo code of the local music is according to the local
The currently stored coordinates measurement of music;
The new URL of the local music is generated, the IP address of terminal and institute where the new URL includes the local music
State the new logo ID of local music, the MAC Address of terminal where the new logo ID includes the local music and the local
The new logo code of music;
The broadcasting message of new URL comprising the local music is sent to the wireless sound box, so that the wireless sound
The case response new URL for playing message and parsing the local music, the IP address of terminal where obtaining the local music and
The currently stored path of the local music reads described according to the currently stored path of the local music from the terminal
Ground music simultaneously plays.
With reference to first aspect, in the 4th kind of possible realization method of first aspect, the method further includes:
If the MAC Address of terminal, is searched from network where the mark ID of the local music does not include the local music
The network URL is simultaneously pushed to the wireless sound box by the corresponding network URL of Suo Suoshu local musics, so that the wireless sound box
It is searched for according to the network URL and plays the local music.
Second aspect provides a kind of music player, including:
First receiving unit, in networking, receiving for the play instruction of local music collected;
Reading unit, for reading the mark ID of the local music;
First judging unit, for judging the mark ID of the local music whether comprising terminal where the local music
MAC Address;
First generation unit, for when the first judging unit judging result is when being, generates the local music
URL, the URL of the local music carry the local music place IP address of terminal and the mark ID of the local music;
First transmitting element, for the broadcasting message for the URL for including the local music to be sent to wireless sound box, so that
The wireless sound box response URL for playing message and parsing the local music, terminal where obtaining the local music
The store path of IP address and the local music, the IP address of terminal and the local music according to where the local music
Store path read the local music from the terminal and play.
In the first possible realization method of second aspect, the terminal further includes:
Second receiving unit, the collection for receiving for local music instruct;
Allocation unit, for for the local music assigned identification codes, the identification code to be deposited according to the local music
Store up coordinates measurement;
Acquiring unit, for obtaining the MAC Address of local music place terminal;
Second generation unit, for by the mark of the MAC Address of terminal where the local music and the local music
Code character is closed, and generates the mark ID of the local music;
Unit is collected, for the mark ID of the local music to be collected in terminal memory.
With reference to the first possible realization method of second aspect, in second of possible realization method of second aspect
In, first judging unit judges that the mark ID of the local music includes the MAC Address of local music place terminal
Later, the terminal further includes:
Resolution unit for parsing the identification code of the local music, obtains the store path of the local music;
Second judgment unit, for judging the currently stored road of the store path of the local music and the local music
Whether diameter is consistent;
When the second judgment unit judging result generates the local music when being, to trigger the generation unit
URL。
With reference to second of possible realization method of second aspect, in the third possible realization method of second aspect
In, the terminal further includes:
Unit is changed, for when the second judgment unit judging result is no, changing the mark of the local music
Code, obtains the new logo code of the local music, and the new logo code of the local music is deposited according to the current of the local music
Store up coordinates measurement;
Third generation unit, for generating the new URL of the local music, the new URL includes the local music institute
In the IP address of terminal and the new logo ID of the local music, terminal where the new logo ID includes the local music
The new logo code of MAC Address and the local music;
Second transmitting element, for the broadcasting message for the new URL for including the local music to be sent to the wireless sound
Case, so that the wireless sound box response new URL for playing message and parsing the local music, obtains the local music institute
In the IP address of terminal and the currently stored path of the local music, according to the currently stored path of the local music from institute
Terminal is stated to read the local music and play.
With reference to second aspect, in the 4th kind of possible realization method of second aspect, the terminal further includes:
Push unit, for when the first judging unit judging result is no, described rock noise to be searched for from network
The network URL is simultaneously pushed to the wireless sound box by happy corresponding network URL, so that the wireless sound box is according to the network
URL is searched for and is played the local music.
In above-mentioned technical proposal, in networking, receive for the play instruction of local music collected;Read this rock noise
Happy mark ID;Judge whether the mark ID of local music includes the MAC Address of terminal where local music;If comprising generation
The URL of local music, the URL of local music carry the local music place IP address of terminal and the mark ID of local music;It will
The broadcasting message of URL comprising local music is sent to wireless sound box, so that wireless sound box response, which plays message, parses this rock noise
Happy URL, the IP address of terminal and the store path of local music where obtaining local music, the terminal according to where local music
IP address and the store path of local music read and local music and play from terminal.The local of middle collection compared with prior art
Music can not be played since IP address of terminal changes, and the present invention is generated in real time in the local music for playing collection comprising local
The URL of terminal current IP address where music, so as to improve the broadcasting success rate of the local music of terminal collection.
Description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, to embodiment or will show below
There is attached drawing needed in technology description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this
Some embodiments of invention, for those of ordinary skill in the art, without creative efforts, can be with
Other attached drawings are obtained according to these attached drawings.
Fig. 1 is a kind of network architecture schematic diagram disclosed by the embodiments of the present invention;
Fig. 2 is a kind of flow chart of method for playing music disclosed by the embodiments of the present invention;
Fig. 3 is the flow chart of another method for playing music disclosed by the embodiments of the present invention;
Fig. 4 is the flow chart of another method for playing music disclosed by the embodiments of the present invention;
Fig. 5 is a kind of structure diagram of music player disclosed by the embodiments of the present invention;
Fig. 6 is the structure diagram of another music player disclosed by the embodiments of the present invention;
Fig. 7 is the structure diagram of another music player disclosed by the embodiments of the present invention.
Specific embodiment
Below in conjunction with the attached drawing in embodiment of the present invention, the technical solution in embodiment of the present invention is carried out clear
Chu is fully described by.Obviously, described embodiment is a part of embodiment of the present invention rather than whole embodiment party
Formula.Based on the embodiment in the present invention, those of ordinary skill in the art are obtained under the premise of creative work is not made
The every other embodiment obtained, should all 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 broadcasting for the local music that terminal is collected
Put success rate.It is described in detail separately below.
Terminal described in the embodiment of the present invention may include:Mobile phone, tablet computer or walkman etc., above-mentioned terminal are only
Citing, and it is non exhaustive, including but not limited to above-mentioned terminal.
In order to be best understood from a kind of method for playing music disclosed by the embodiments of the present invention and terminal, below first to of the invention real
The network architecture that example is applicable in is applied to be described.Referring to Fig. 1, Fig. 1 is a kind of network architecture signal disclosed by the embodiments of the present invention
Figure.In network architecture shown in Fig. 1, terminal and wireless sound box can be included, wherein, terminal can wirelessly (such as
WI-FI, bluetooth) it is communicated to connect with wireless sound box.In network architecture shown in Fig. 1, terminal can include cell phone, tablet
Computer, personal digital assistant (Personal Digital Assistant, PDA), mobile internet device (Mobile
Internet Device, MID), intelligent wearable device (such as smartwatch, Intelligent bracelet) each Terminal Type, the embodiment of the present invention
It is not construed as limiting.By implementing network architecture shown in FIG. 1, it can improve what the local music that terminal is collected was played in wireless sound box
Success rate.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses a kind of method for playing music.Referring to Fig. 2, figure
2 be a kind of flow chart of method for playing music disclosed by the embodiments of the present invention.As shown in Fig. 2, the sound described in the present embodiment
Happy playback method may comprise steps of:
S201 in networking, is received for the play instruction of local music collected.
In the embodiment of the present invention, local music can be stored in the audio file of terminal, and the form of audio file includes
But it is not limited to MP3 format, WMA forms, WAV forms, APE forms, FLAC forms etc..The local music collected can be terminal
The local music that APP has been collected.
S202 reads the mark ID of local music.
In the embodiment of the present invention, the MAC Address and local music of mark ID terminals where local music of local music
Identification code combination producing, can using the store path of local music generate Hash codes as local music identification code.This
The mark ID forms of ground music can be:The Hash codes of the store path generation of MAC Address/local music, the Hash codes are by this
The store path of ground music is generated according to certain algorithm.
S203, judges whether the mark ID of local music includes the MAC Address of terminal where local music.If so, it performs
Step S204~step S205, if it is not, performing step S206.
In the embodiment of the present invention, if the local music of collection includes the MAC Address of local music place terminal, show this
Music terminal where the local music in ground is collected, and the mark ID of the local music is legal;If the local music of collection is not
The MAC Address of terminal where local music is included, shows that the local music not collect where the local music by terminal, shows this
The mark ID of local music is unknown, is illegal.By judging the mark ID of local music whether comprising local music
The MAC Address of place terminal can improve the safety of the local music of terminal collection.
S204, generates the URL of local music, and the URL of local music carries the IP address and sheet of local music place terminal
The mark ID of ground music.
In the embodiment of the present invention, if the mark ID of local music includes the MAC Address of local music place terminal, generation is originally
The URL of ground music, the URL of local music carry the local music place IP address of terminal and the mark ID of local music.When sentencing
After the terminal collection where local music of disconnected local music, the URL of local music includes the current IP of local music place terminal
Address in the local music for playing collection, generates the URL of local music, terminal where ensure that local music in real time
IP address is newest IP address, the success rate that the local music so as to improve terminal collection plays.
The broadcasting message of URL comprising local music is sent to wireless sound box by S205, so that wireless sound box response plays
Message parses the URL of local music, the IP address of terminal and the store path of local music where obtaining local music, according to this
The IP address of terminal where ground music and the store path of local music read local music from terminal and play.
In the embodiment of the present invention, the broadcasting message of the URL comprising local music is sent to wireless sound box, wireless sound box is rung
Message should be played, parses the URL of local music, the IP address of terminal and the storage road of local music where obtaining local music
Diameter, the terminal where the IP address of terminal finds local music according to where local music, according to the store path of local music
Local music is read from the terminal where local music and is played.Wherein, according to the store path of local music from local music
The terminal at place, which reads local music and plays, to be included:End according to where the store path from local music of local music
The local music is searched at end, and local music can be transmitted to nothing by the terminal where the local music by streaming media mode
Line speaker plays out.Implement the embodiment of the present invention, wireless sound box is looked into according to the URL of local music from terminal where local music
It looks for the local music and plays, since the IP address of local music place terminal included in the URL of the local music is to broadcast
Put what is generated during the local music, so wireless sound box IP address of terminal according to where the local music is played from terminal and is somebody's turn to do
The success rate of local music is higher.
S206 searches for the corresponding network URL of local music from network and network URL is pushed to wireless sound box, so that
Wireless sound box is searched for according to network URL and plays local music.
In the embodiment of the present invention, when the MAC Address of terminal where the mark ID of local music does not include local music, table
The bright local music is not collected or the local music is illegal, and terminal then searches for the corresponding network of local music from network
Network URL is simultaneously pushed to wireless sound box by URL, so that wireless sound box is searched for according to network URL and plays local music.Wherein,
The corresponding network URL of search local music can be scanned for according to the music information of local music, find net the most matched
Network URL, and network URL is pushed into wireless sound box, so that wireless sound box is searched for according to network URL and plays local music.
In the embodiment of the present invention, in networking, terminal is received for the play instruction of local music collected;Read this
The mark ID of ground music;Judge whether the mark ID of local music includes the MAC Address of terminal where local music;If it does not wrap
Contain, the corresponding network URL of local music is searched for from network and network URL is pushed into wireless sound box, so that wireless sound box root
It is searched for according to network URL and plays local music;If comprising the URL of local music is generated, the URL of local music carries this rock noise
The IP address of terminal and the mark ID of local music where happy;The broadcasting message of URL comprising local music is sent to wirelessly
Speaker so that wireless sound box response play message parsing local music URL, obtain local music where terminal IP address and
The store path of local music, the IP address of terminal and the store path of local music are read from terminal according to where local music
Local music simultaneously plays.Implement the embodiment of the present invention, the broadcasting success rate of the local music of terminal collection can be improved.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses another method for playing music.Referring to Fig. 3,
Fig. 3 is the flow chart of another method for playing music disclosed by the embodiments of the present invention.As shown in figure 3, described in the present embodiment
Method for playing music may comprise steps of:
S301, the collection received for local music instruct.
In the embodiment of the present invention, before the local music for playing collection, received in the terminal where local music first
Local music is hidden, local music can be collected on the APP by terminal where local music.For example, where local music
When local music is collected in terminal, user selects the local music for needing to collect on the APP of terminal, and terminal is received for local
The collection instruction of music.
S302, is local music assigned identification codes, and identification code is generated according to the store path of local music.
In the embodiment of the present invention, after the collection instruction for local music is received, terminal is local music allocation identification
Code, can be using the Hash codes that the store path of local music generates as the identification code of local music.
S303, the MAC Address of terminal where obtaining local music.
In the embodiment of the present invention, MAC (Media Access Control or Medium Access Control)
Location, also referred to as physical address or hardware address, the MAC Address of terminal just secure after terminal manufacture.
The MAC Address of terminal where local music with the identification code of local music is combined, generates local music by S304
Identify ID.
In the embodiment of the present invention, terminal combines the MAC Address of terminal where local music with the identification code of local music,
The mark ID of local music is generated, can causing local music tool, there are one unique mark ID.The mark of the local music
ID forms can be:The Hash codes of the store path generation of MAC Address/local music, the Hash codes are deposited by the local music
Path is stored up to be generated according to certain algorithm.
The mark ID of local music is collected in terminal memory by S305.
In the embodiment of the present invention, the mark ID of local music is collected in terminal memory, shows the mark of local music
ID is collected successfully.
S306 in networking, is received for the play instruction of local music collected.
S307 reads the mark ID of local music.
S308, judges whether the mark ID of local music includes the MAC Address of terminal where local music.
S309, if comprising the URL of local music is generated, the URL of local music is with carrying the IP of local music place terminal
Location and the mark ID of local music.
The broadcasting message of URL comprising local music is sent to wireless sound box by S310, so that wireless sound box response plays
Message parses the URL of local music, the IP address of terminal and the store path of local music where obtaining local music, according to this
The IP address of terminal where ground music and the store path of local music read local music from terminal and play.
Step S306~step S310 in the embodiment of the present invention can refer to step S201 in Fig. 2 described embodiments
~step S205, the embodiment of the present invention repeat no more.
In the embodiment of the present invention, terminal receives the collection instruction for local music;For local music assigned identification codes, mark
Know code to be generated according to the store path of local music;The MAC Address of terminal where obtaining local music;It will be whole where local music
The MAC Address at end is combined with the identification code of local music, generates the mark ID of local music;The mark ID of local music is collected
In terminal memory;In networking, receive for the play instruction of local music collected;Read the mark of local music
ID;Judge whether the mark ID of local music includes the MAC Address of terminal where local music;If comprising local music is generated
URL, the IP address of terminal and the mark ID of local music where the URL of local music carries local music;It will include local
The broadcasting message of the URL of music is sent to wireless sound box, so that wireless sound box response plays the URL of message parsing local music,
The IP address of terminal and the store path of local music where obtaining local music, the IP address of terminal according to where local music
Local music is read from terminal and play with the store path of local music.The real-time embodiment of the present invention can improve terminal receipts
The broadcasting success rate of the local music of Tibetan.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses another method for playing music.Referring to Fig. 4,
Fig. 4 is the flow chart of another method for playing music disclosed by the embodiments of the present invention.As shown in figure 4, described in the present embodiment
Method for playing music may comprise steps of:
S401, the collection received for local music instruct.
S402, is local music assigned identification codes, and identification code is generated according to the store path of local music.
S403, the MAC Address of terminal where obtaining local music.
The MAC Address of terminal where local music with the identification code of local music is combined, generates local music by S404
Identify ID.
The mark ID of local music is collected in terminal memory by S405.
S406 in networking, is received for the play instruction of local music collected.
S407 reads the mark ID of local music.
S408, judges whether the mark ID of local music includes the MAC Address of terminal where local music.
S409, if comprising parsing the identification code of local music, obtaining the store path of local music.
In the embodiment of the present invention, when the MAC Address of terminal where the mark ID of local music includes local music, terminal
The identification code of local music is parsed, obtains the store path of local music.
S410, judge local music store path and local music currently stored path it is whether consistent.If consistent, hold
Row step S411~step S412 if inconsistent, performs step S413~step S415.
In the embodiment of the present invention, if the store path of local music is consistent with the currently stored path of local music, give birth to
Into the URL of the store path comprising local music, if the currently stored path of the store path of local music and local music is not
Unanimously, then the URL in the currently stored path comprising local music is generated.By the store path and this rock noise that judge local music
Whether happy currently stored path is consistent, it is ensured that the URL of the local music of generation includes the storage road of current local music
Diameter, preventing the store path due to local music from sending variation causes wireless sound box that can not play local music.
S411, generates the URL of local music, and the URL of local music carries the IP address and sheet of local music place terminal
The mark ID of ground music.
The broadcasting message of URL comprising local music is sent to wireless sound box by S412, so that wireless sound box response plays
Message parses the URL of local music, the IP address of terminal and the store path of local music where obtaining local music, according to this
The IP address of terminal where ground music and the store path of local music read local music from terminal and play.
S413 changes the identification code of local music, obtains the new logo code of local music, the new logo code root of local music
According to the currently stored coordinates measurement of local music.
In the embodiment of the present invention, when the store path of local music and the inconsistent currently stored path of local music,
The identification code of local music is changed, the new logo code of local music is obtained, the currently stored path of local music can be passed through
Hash codes generate the new logo code of local music.
S414 generates the new URL of local music, the IP address and local music of terminal where new URL includes local music
New logo ID, new logo ID includes the MAC Address of terminal and the new logo code of local music where local music.
The broadcasting message of new URL comprising local music is sent to wireless sound box by S415, so that wireless sound box response is broadcast
The new URL of message parsing local music is put, the IP address of terminal and the currently stored road of local music where obtaining local music
Diameter reads local music from terminal according to the currently stored path of local music and plays.
Step S401~step S408 in the embodiment of the present invention can refer to step S301 in Fig. 3 described embodiments
~step S308, step S411~step S412 can refer to step S309~step S310 in Fig. 3 described embodiments, this
Inventive embodiments repeat no more.
In the embodiment of the present invention, in the local music for playing collection, if the store path of the local music of terminal collection
It changes, the currently stored path of local music can be reacquired, it is ensured that the URL of the local music of generation, which is included, to be worked as
The store path of preceding local music improves the broadcasting success rate of the local music of terminal collection, prevents depositing due to local music
Storage path, which sends variation, causes wireless sound box that can not play local music.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses a kind of music players.Referring to Fig. 5, figure
5 be a kind of structure diagram of music player disclosed by the embodiments of the present invention.As shown in figure 5, described in the present embodiment
Music player can include:
First receiving unit 501, in networking, receiving for the play instruction of local music collected.
In the embodiment of the present invention, the first receiving unit 501 is received for the play instruction of local music collected.Its
In, local music can be stored in the audio file of terminal, and the form of audio file includes but not limited to MP3 format, WMA lattice
Formula, WAV forms, APE forms, FLAC forms etc., the local music collected can be the local musics that terminal APP has been 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 mark ID of local music
The MAC Address of terminal and the identification code combination producing of local music where local music, can be by the storage road of local music
Identification code of the Hash codes of diameter generation as local music, the mark ID forms of local music can be:MAC Address/this rock noise
The Hash codes of happy store path generation, the Hash codes are generated by the store path of local music according to certain algorithm.
Whether the first judging unit 503, the mark ID for judging local music include the MAC of terminal where local music
Address.
In the embodiment of the present invention, whether the first judging unit 503 judges the mark ID of local music comprising local music institute
In the MAC Address of terminal.The MAC Address of terminal, shows the local music where if the local music of collection includes local music
The terminal collection where the local music, the mark ID of the local music is legal;If the local music of collection does not include this
The MAC Address of terminal where ground music shows that the local music not collect where the local music by terminal, shows this rock noise
Happy mark ID is unknown, is illegal.By judging the mark ID of local music whether comprising whole where local music
The MAC Address at end can improve the safety of the local music of terminal collection.
First generation unit 504, for when 503 judging result of the first judging unit is when being, generates local music
URL, the URL of local music carry the local music place IP address of terminal and the mark ID of local music.
In the embodiment of the present invention, if the mark ID of local music includes the MAC Address of local music place terminal, the first life
The URL of local music is generated into unit 504, the URL of local music carries the IP address and this rock noise of local music place terminal
Happy mark ID.After the first judging unit 503 judges local music terminal collection where local music, the first generation unit
The URL of 504 generation local musics, the URL of local music include the current IP address of local music place terminal, are collected playing
Local music when, generate the URL of local music in real time, the IP address that ensure that terminal where local music is newest IP
Address, the success rate that the local music so as to improve terminal collection plays.
First transmitting element 505, for the broadcasting message for the URL for including local music to be sent to wireless sound box, so that
Wireless sound box response plays the URL of message parsing local music, the IP address and local music of terminal where obtaining local music
Store path, local music is read from terminal according to the IP address of terminal where local music and the store path of local music
And it plays.
In the embodiment of the present invention, the broadcasting message of the URL comprising local music is sent to wirelessly by the first transmitting element 505
Speaker, wireless sound box respond the broadcasting message, parse the URL of local music, the IP address of terminal where obtaining local music and
The store path of local music, the terminal where the IP address of terminal finds local music according to where local music, according to this
Terminal where the store path from local music of ground music reads local music and plays.Wherein, depositing according to local music
Terminal where storage path from local music, which reads local music and plays, to be included:According to the store path of local music from
Terminal where local music searches the local music, and the terminal where the local music can be incited somebody to action by streaming media mode
Local music is transmitted to wireless sound box and plays out.Implement the embodiment of the present invention, wireless sound box is according to the URL of local music from originally
Terminal where ground music is searched the local music and is played, since the local music place included in the URL of the local music is whole
The IP address at end is generated when playing the local music, so wireless sound box is according to the IP of terminal where the local music
The success rate that location plays the local music from terminal is higher.
Push unit 506, for when 503 judging result of the first judging unit is no, local music to be searched for from network
Network URL is simultaneously pushed to wireless sound box by corresponding network URL, so that wireless sound box is searched for according to network URL and plays local
Music.
In the embodiment of the present invention, when the MAC Address of terminal where the mark ID of local music does not include local music, table
The bright local music is not collected or the local music is illegal, and push unit 506 searches for local music correspondence from network
Network URL and network URL is pushed into wireless sound box so that wireless sound box is searched for according to network URL and plays local music.
Wherein, the corresponding network URL of search local music can be scanned for according to the music information of local music, found and matched the most
Network URL, and by network URL push wireless sound box so that wireless sound box is searched for according to network URL and plays this rock noise
It is happy.
In the embodiment of the present invention, in networking, the first receiving unit 501 is received for the broadcasting of local music collected
Instruction;Reading unit 502 reads the mark ID of local music;First judging unit 503 judge local music mark ID whether
Include the MAC Address of terminal where local music;If not including, it is corresponding that push unit 506 searches for local music from network
Network URL is simultaneously pushed to wireless sound box by network URL, so that wireless sound box is searched for according to network URL and plays local music;If
Comprising the first generation unit 504 generates the URL of local music, and the URL of local music is with carrying the IP of local music place terminal
Location and the mark ID of local music;The broadcasting message of URL comprising local music is sent to wireless sound by the first transmitting element 505
Case so that wireless sound box response plays the URL that message parses local music, obtains the IP address of terminal where local music and this
The store path of ground music, the IP address of terminal and the store path of local music read this from terminal according to where local music
Ground music simultaneously plays.Implement the embodiment of the present invention, the broadcasting success rate of the local music of terminal collection can be improved.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses another music players.Referring to Fig. 6,
Fig. 6 is the structure diagram of another music player disclosed by the embodiments of the present invention.As shown in fig. 6, institute in the present embodiment
The music player of description can include:
Second receiving unit 507, the collection for receiving for local music instruct.
In the embodiment of the present invention, the second receiving unit 507 receives the collection instruction for local music.Wherein, it is playing
Before the local music of collection, local music is collected in the terminal where local music first, local music institute can be passed through
Local music is collected on the APP of terminal.For example, when collecting local music in the terminal where local music, user is at end
Selection needs the local music collected on the APP at end, and terminal receives the collection instruction for local music.
Allocation unit 508, for for local music assigned identification codes, identification code to be given birth to according to the store path of local music
Into.
In the embodiment of the present invention, after the collection instruction for local music is received, allocation unit 508 is local music point
It, can be using the Hash codes that the store path of local music generates as the identification code of local music with identification code.
Acquiring unit 509, for obtaining the MAC Address of local music place terminal.
In the embodiment of the present invention, the MAC Address of terminal where acquiring unit 509 obtains local music.Wherein, MAC
(Media Access Control either Medium Access Control) address also referred to as physical address or hardware address,
The MAC Address of terminal just secures after terminal manufacture.
Second generation unit 510, for by the MAC Address of terminal where local music and the code group of local music
It closes, generates the mark ID of local music.
In the embodiment of the present invention, the second generation unit 510 is by the MAC Address of terminal where local music and local music
Identification code combines, and generates the mark ID of local music, and can causing local music tool, there are one unique mark ID.The local
The mark ID forms of music can be:The Hash codes of the store path generation of MAC Address/local music, the Hash codes are by this
The store path of ground music is generated according to certain algorithm.
Unit 511 is collected, for the mark ID of local music to be collected in terminal memory.
In the embodiment of the present invention, the mark ID of local music is collected in terminal memory by collection unit 511, shows local
The mark ID of music is collected successfully.
First receiving unit 501, in networking, receiving for the play instruction of local music collected.
Reading unit 502, for reading the mark ID of local music.
Whether the first judging unit 503, the mark ID for judging local music include the MAC of terminal where local music
Address.
First generation unit 504, for when 503 judging result of the first judging unit is when being, generates local music
URL, the URL of local music carry the local music place IP address of terminal and the mark ID of local music.
First transmitting element 505, for the broadcasting message for the URL for including local music to be sent to wireless sound box, so that
Wireless sound box response plays the URL of message parsing local music, the IP address and local music of terminal where obtaining local music
Store path, local music is read from terminal according to the IP address of terminal where local music and the store path of local music
And it plays.
The first receiving unit 501, reading unit 502, the generation of the first judging unit 503, first in the embodiment of the present invention
504 and first transmitting element 505 of unit may refer to terminal shown in fig. 5, and the embodiment of the present invention repeats no more.
In the embodiment of the present invention, the second receiving unit 507 receives the collection instruction for local music;Allocation unit 508
For local music assigned identification codes, identification code is generated according to the store path of local music;Acquiring unit 509 obtains local music
The MAC Address of place terminal;Second generation unit 510 is by the MAC Address of terminal where local music and the mark of local music
Code character is closed, and generates the mark ID of local music;The mark ID of local music is collected in terminal memory by collection unit 511;
During networking, the first receiving unit 501 is received for the play instruction of local music collected;Reading unit 502 reads local
The mark ID of music;First judging unit 503 judges whether the mark ID of local music includes the MAC of terminal where local music
Address;If comprising the first generation unit 504 generates the URL of local music, and the URL of local music carries local music place eventually
The IP address at end and the mark ID of local music;First transmitting element 505 sends the broadcasting message of the URL comprising local music
To wireless sound box, so that wireless sound box response plays the URL of message parsing local music, the IP of terminal where obtaining local music
Address and the store path of local music, according to the IP address of terminal where local music and the store path of local music from end
It reads local music and plays in end.The real-time embodiment of the present invention can improve the broadcasting success rate of the local music of terminal collection.
Based on network architecture shown in FIG. 1, the embodiment of the invention discloses another music players.Referring to Fig. 7,
Fig. 7 is the structure diagram of another music player disclosed by the embodiments of the present invention.As shown in fig. 7, institute in the present embodiment
The music player of description can include:
Second receiving unit 507, the collection for receiving for local music instruct.
Allocation unit 508, for for local music assigned identification codes, identification code to be given birth to according to the store path of local music
Into.
Acquiring unit 509, for obtaining the MAC Address of local music place terminal.
Second generation unit 510, for by the MAC Address of terminal where local music and the code group of local music
It closes, generates the mark ID of local music.
Unit 511 is collected, for the mark ID of local music to be collected in terminal memory.
First receiving unit 501, in networking, receiving for the play instruction of local music collected.
Reading unit 502, for reading the mark ID of local music.
Whether the first judging unit 503, the mark ID for judging local music include the MAC of terminal where local music
Address.
Resolution unit 512, for when 503 judging result of the first judging unit is to be, parsing the identification code of local music,
Obtain the store path of local music.
In the embodiment of the present invention, when the MAC Address of terminal where the mark ID of local music includes local music, parsing
Unit 512 parses the identification code of local music, obtains the store path of local music.
Second judgment unit 513, the currently stored path for judging the store path of local music and local music are
It is no consistent.
In the embodiment of the present invention, second judgment unit 513 judge local music store path and local music it is current
Whether store path is consistent.Wherein, it if the store path of local music is consistent with the currently stored path of local music, generates
The URL of store path comprising local music, if the currently stored path of the store path of local music and local music is differed
It causes, then the URL in currently stored path of the generation comprising local music.Second judgment unit 513 judges the storage road of local music
Whether the currently stored path of diameter and local music is consistent, it is ensured that the URL of the local music of generation includes this current rock noise
Happy store path, preventing the store path due to local music from sending variation causes wireless sound box that can not play local music.
First generation unit 504 is additionally operable to when 513 judging result of second judgment unit is when being, generates local music
URL, the URL of local music carry the local music place IP address of terminal and the mark ID of local music.
First transmitting element 505, for the broadcasting message for the URL for including local music to be sent to wireless sound box, so that
Wireless sound box response plays the URL of message parsing local music, the IP address and local music of terminal where obtaining local music
Store path, local music is read from terminal according to the IP address of terminal where local music and the store path of local music
And it plays.
Unit 514 is changed, for when 513 judging result of second judgment unit is no, changing the identification code of local music,
Obtain the new logo code of local music, the new logo code of local music is according to the currently stored coordinates measurement of local music.
In the embodiment of the present invention, when the store path of local music and the inconsistent currently stored path of local music,
The identification code that unit 514 changes local music is changed, obtains the new logo code of local music, the current of local music can be deposited
Store up the new logo code that path generates local music by Hash codes.
Third generation unit 515, for generating the new URL of local music, the IP of terminal where new URL includes local music
The MAC Address of terminal where address and the new logo ID of local music, new logo ID include local music and local music it is new
Identification code.
Second transmitting element 516, for the broadcasting message for the new URL for including local music to be sent to wireless sound box, with
Wireless sound box response is made to play the new URL of message parsing local music, the IP address of terminal and local where obtaining local music
The currently stored path of music is read local music from terminal according to the currently stored path of local music and is played.
The second receiving unit 507 in the embodiment of the present invention, allocation unit 508, acquiring unit 509, the second generation unit
510th, unit 511, the first receiving unit 501, reading unit 502, the first judging unit 503,504 and of the first generation unit are collected
First transmitting element 505 may refer to terminal shown in fig. 6, and the embodiment of the present invention repeats no more.
In the embodiment of the present invention, in the local music for playing collection, if the store path of the local music of terminal collection
It changes, the currently stored path of local music can be reacquired, it is ensured that the URL of the local music of generation, which is included, to be worked as
The store path of preceding local music improves the broadcasting success rate of the local music of terminal collection, prevents depositing due to local music
Storage path, which sends variation, causes wireless sound box that can not 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 can
It is completed with instructing relevant hardware by program, which can be stored in a computer readable storage medium, storage
Medium can include:Flash disk, 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 and terminal provided above to the embodiment of the present invention is described in detail, herein
It applies specific case to be expounded the principle of the present invention and embodiment, the explanation of above example is only intended to help
Understand the method and its core concept of the present invention;Meanwhile for those of ordinary skill in the art, thought according to the present invention,
There will be changes in specific embodiments and applications, in conclusion the content of the present specification should not be construed as to this
The limitation of invention.
Claims (10)
1. a kind of method for playing music, which is characterized in that including:
In networking, receive for the play instruction of local music collected;
Read the mark ID of the local music;
Judge whether the mark ID of the local music includes the MAC Address of terminal where the local music;
If comprising the URL of the local music is generated, terminal where the URL of the local music carries the local music
The mark ID of current IP address and the local music;
The broadcasting message of URL comprising the local music is sent to wireless sound box, so that described in wireless sound box response
The URL that message parses the local music is played, the current IP address of terminal and the local where obtaining the local music
The store path of music, according to the current IP address of terminal where the local music and the store path of the local music from
The terminal reads the local music and plays.
2. according to the method described in claim 1, it is characterized in that, it is described receive for local music play instruction before,
The method further includes:
The collection received for local music instructs;
For the local music assigned identification codes, the identification code is generated according to the store path of the local music;
The MAC Address of terminal where obtaining the local music;
The MAC Address of terminal where the local music with the identification code of the local music is combined, generates described rock noise
Happy mark ID;
The mark ID of the local music is collected in terminal memory.
3. according to the method described in claim 2, it is characterized in that, the mark ID for judging the local music is comprising described
After the MAC Address of terminal where local music, the method further includes:
The identification code of the local music is parsed, obtains the store path of the local music;
Judge whether the store path of the local music is consistent with the currently stored path of the local music;
If consistent, the step of performing the URL of the generation local music.
4. according to the method described in claim 3, it is characterized in that, the method further includes:
If the store path of the local music and the currently stored path of the local music are inconsistent, described rock noise is changed
Happy identification code obtains the new logo code of the local music, and the new logo code of the local music is according to the local music
Currently stored coordinates measurement;
Generate the new URL of the local music, IP address and described of the new URL including terminal where the local music
The new logo ID of ground music, the MAC Address of terminal where the new logo ID includes the local music and the local music
New logo code;
The broadcasting message of new URL comprising the local music is sent to the wireless sound box, so that the wireless sound box is rung
The broadcasting message is answered to parse the new URL of the local music, the IP address of terminal where obtaining the local music and described
Described rock noise is read in the currently stored path of local music according to the currently stored path of the local music from the terminal
Find pleasure in and play.
5. according to the method described in claim 1, it is characterized in that, the method further includes:
If the MAC Address of terminal, searches for institute from network where the mark ID of the local music does not include the local music
State the corresponding network URL of local music and the network URL pushed into the wireless sound box so that the wireless sound box according to
The network URL is searched for and is played the local music.
6. a kind of music player, which is characterized in that including:
First receiving unit, in networking, receiving for the play instruction of local music collected;
Reading unit, for reading the mark ID of the local music;
First judging unit, for judging the mark ID of the local music whether comprising terminal where the local music
MAC Address;
First generation unit, for when the first judging unit judging result is to be, generating the URL of the local music,
The current IP address of terminal and the mark ID of the local music where the URL of the local music carries the local music;
First transmitting element, for the broadcasting message for the URL for including the local music to be sent to wireless sound box, so that described
The wireless sound box response URL for playing message and parsing the local music, terminal is current where obtaining the local music
The store path of IP address and the local music, the current IP address of terminal and the local according to where the local music
The store path of music reads the local music from the terminal and plays.
7. terminal according to claim 6, which is characterized in that first receiving unit receives broadcasting for local music
Before putting instruction, the terminal further includes:
Second receiving unit, the collection for receiving for local music instruct;
Allocation unit, for for the local music assigned identification codes, the identification code is according to the storage road of the local music
Diameter generates;
Acquiring unit, for obtaining the MAC Address of local music place terminal;
Second generation unit, for by the code group of the MAC Address of terminal where the local music and the local music
It closes, generates the mark ID of the local music;
Unit is collected, for the mark ID of the local music to be collected in terminal memory.
8. terminal according to claim 7, which is characterized in that first judging unit judges the mark of the local music
After the MAC Address for knowing terminal where ID includes the local music, the terminal further includes:
Resolution unit for parsing the identification code of the local music, obtains the store path of the local music;
Second judgment unit, for judging that the store path of the local music is with the currently stored path of the local music
It is no consistent;
When the second judgment unit judging result is when being, triggers the URL that the generation unit generates the local music.
9. terminal according to claim 8, which is characterized in that the terminal further includes:
Unit is changed, for when the second judgment unit judging result is no, changing the identification code of the local music, obtaining
Take the new logo code of the local music, the new logo code of the local music is according to the currently stored path of the local music
Generation;
Third generation unit, for generating the new URL of the local music, the new URL includes local music place eventually
The new logo ID of the IP address at end and the local music, the MAC of terminal where the new logo ID includes the local music
Address and the new logo code of the local music;
Second transmitting element, for the broadcasting message for the new URL for including the local music to be sent to the wireless sound box, with
Make the wireless sound box response new URL for playing message and parsing the local music, obtain the local music place eventually
The currently stored path of the IP address at end and the local music, according to the currently stored path of the local music from the end
It reads the local music and plays in end.
10. terminal according to claim 6, which is characterized in that the terminal further includes:
Push unit, for when the first judging unit judging result is no, the local music pair to be searched for from network
The network URL is simultaneously pushed to the wireless sound box by the network URL that answers, so that the wireless sound box is according to the network URL
It searches for and plays the local music.
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 CN104915382A (en) | 2015-09-16 |
CN104915382B true 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) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
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 |
Citations (2)
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 |
-
2015
- 2015-05-18 CN CN201510257950.7A patent/CN104915382B/en active Active
Patent Citations (2)
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 |
Also Published As
Publication number | Publication date |
---|---|
CN104915382A (en) | 2015-09-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109246671B (en) | Data transmission method, device and system | |
CN103607678B (en) | A kind of wireless synchronization audio amplifier | |
CN104918069B (en) | One kind plays scenario reduction method, system, playback terminal and control terminal | |
CN102917119A (en) | Method and system for processing music by mobile terminal according to voice recognition | |
JP2009003552A (en) | Communication terminal | |
CN101778170A (en) | Method and device for music playing of mobile terminal | |
RU2007119308A (en) | PRESENTED RINGTONE SEGMENTS IN THE SOURCE OF THE AUDIO SIGNAL | |
CN106599173A (en) | Lyric matching method and terminal | |
CN102340583A (en) | Method for pre-requesting songs in karaoke hall through mobile phone | |
CN107331378A (en) | Microphone | |
CN104915382B (en) | A kind of method for playing music and terminal | |
CN105120528A (en) | A method, apparatus and system for carrying out configuration setting between devices | |
CN106095385A (en) | A kind of audio method to set up and mobile terminal | |
CN106293602A (en) | Voice data control method for playing back in earphone and equipment | |
CN104966526B (en) | A kind of shuffle method and device | |
CN105338059B (en) | A kind of method of data synchronization and mobile terminal | |
CN106024035A (en) | Audio processing method and terminal | |
JP2010049526A (en) | Mobile electronic apparatus, content playback device, content acquisition method, content whereabouts notification method, content acquisition program, content whereabouts notification method, and content use system | |
CN106126165A (en) | A kind of audio stream processing method and mobile terminal | |
CN104167216B (en) | A kind of audio file sharing method, device and audio amplifier | |
CN106653068A (en) | Audio data playing method, device and terminal | |
CN105005612B (en) | A kind of acquisition methods and mobile terminal of music file | |
CN105070303B (en) | A kind of audio amplifier group technology and terminal | |
CN104200826B (en) | Audio signal playing method for mobile terminal and mobile terminal | |
CN106303616A (en) | A kind of control method for playing back, device and terminal |
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 | ||
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. |