CN110557454A - Method for realizing synchronous playing of multiple machines based on cloud network music player - Google Patents

Method for realizing synchronous playing of multiple machines based on cloud network music player Download PDF

Info

Publication number
CN110557454A
CN110557454A CN201910852796.6A CN201910852796A CN110557454A CN 110557454 A CN110557454 A CN 110557454A CN 201910852796 A CN201910852796 A CN 201910852796A CN 110557454 A CN110557454 A CN 110557454A
Authority
CN
China
Prior art keywords
player
music
jumping
music data
time
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
CN201910852796.6A
Other languages
Chinese (zh)
Other versions
CN110557454B (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.)
Guangzhou Hedong Technology Co Ltd
Original Assignee
Guangzhou Hedong Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Hedong Technology Co Ltd filed Critical Guangzhou Hedong Technology Co Ltd
Priority to CN201910852796.6A priority Critical patent/CN110557454B/en
Publication of CN110557454A publication Critical patent/CN110557454A/en
Application granted granted Critical
Publication of CN110557454B publication Critical patent/CN110557454B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/611Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Reverberation, Karaoke And Other Acoustics (AREA)

Abstract

the invention discloses a method for realizing multi-machine synchronous playing based on a cloud network music player, which is characterized in that only one player is allocated as a host machine in a local area network, other players are slave machines, when the main player is started, the URI address of the cloud end is read from a prestored list, an HTTP client end is opened and is connected with a cloud server through the URI address, after the connection is successful, the HTTP client end actively acquires an audio list, and the appointed downloading of music corresponding to the cloud end of the audio list is selected, when a music data frame is cached, and a certain data frame is reached, the main player opens a multicast function and sends a time-cut synchronization message. And after receiving the time-truncated synchronous message, the slave player immediately processes and waits for receiving the music data frame of the master player, and when the music data frames of the master player and the slave player are equal, the master player sends a playing instruction to enable the slave player to play the music together.

Description

method for realizing synchronous playing of multiple machines based on cloud network music player
Technical Field
the invention relates to the technical field of smart homes, in particular to a method for realizing multi-machine synchronous playing based on a cloud network music player.
background
With the technical development of smart homes, smart homes are gradually entering thousands of households. The intelligent home is characterized in that various devices in the home, such as audio and video devices, lighting systems, curtain control, air conditioner control, security systems, digital cinema systems, audio and video servers, video cabinet systems, network home appliances and the like, are connected together through an internet of things technology, and multiple functions and means such as home appliance control, lighting control, telephone remote control, indoor and outdoor remote control, anti-theft alarm, environment monitoring, heating and ventilation control, infrared forwarding, programmable timing control and the like are provided. Compared with the traditional home, the intelligent home has the traditional general functions, integrates the functions of building, network communication, information household appliance and equipment automation, provides an all-around information interaction function, and even saves funds for various energy expenses.
in the application of smart home, background music is more and more applied, and the demand function is more and more abundant, and more at present use local broadcasting system function to realize a plurality of regions simultaneous broadcast, and this also brings independent region broadcast and can not realize, and along with the wide application of smart home, background music realizes that multizone broadcast and independent region broadcast function are indispensable, and this paper has proposed based on high in the clouds network audio player, and this scheme mainly solves multizone and independent region simultaneous broadcast music function. Disclosure of Invention
in view of the above, in order to solve the above problems in the prior art, the present invention provides a method for implementing multi-player synchronous playing based on a cloud-end network music player.
The invention solves the problems through the following technical means:
A method for realizing multi-machine synchronous playing based on a cloud network music player comprises a main player and a plurality of slave players, wherein:
the main player realizes the following processes:
Step S101, reading a URI address of a prestored cloud;
Step S102, creating an HTTP client;
step S103: connecting the cloud service, if the connection is successful, jumping to the step S104, otherwise, waiting;
step S104, acquiring an audio list;
step S105, starting to download music;
step S106, caching music data frames;
step S107: creating a multicast thread;
step S108, sending a time-cut message;
Step S109, creating a thread for sending the music data frame;
step S110: sequentially transmitting the music data frames; when a certain cache is reached, sending a playing instruction;
step S111: starting audio decoding;
Step S112: until the decoding is finished;
The slave player realizes the following flow:
step S201, a multicast thread is established;
Step S202, monitoring the multicast port, if data exists, jumping to S203, otherwise, monitoring all the time;
step S203: verifying whether the message is correct, if so, jumping to S204, otherwise, jumping to S202;
step S204: judging whether the message is time-truncated, if so, jumping to S205;
step S205: synchronizing time truncation;
step S206: creating a thread for receiving music data frames;
step S207: caching the music data frame all the time;
Step S208: judging whether the instruction is played, if so, jumping to S209;
step S209: starting audio decoding;
step S210, until the decoding is finished.
compared with the prior art, the invention has the beneficial effects that at least:
The method for realizing multi-machine synchronous playing based on the cloud network music player effectively solves the problem that the music can be played simultaneously in a plurality of areas and independent areas.
drawings
in order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flow chart of a main player implementation of the present invention;
Fig. 2 is a flow chart of the slave player implementation of the present invention.
Detailed Description
in order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. It should be noted that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and all other embodiments obtained by those skilled in the art without any inventive work based on the embodiments of the present invention belong to the protection scope of the present invention.
the invention realizes the synchronous playing of a plurality of players, the invention refers to that only one player is allocated as a host in a local area network, other players are slaves, when the main player is started, the URI address of a cloud is read from a prestored list, an HTTP client is opened and is connected with a cloud server through the URI address, after the connection is successful, the HTTP client actively acquires an audio list and selects the appointed downloading of the audio list to the music corresponding to the cloud, when a music data frame is cached and reaches a certain data frame, the main player opens a multicast function and sends a time interception synchronization message. And after receiving the time-truncated synchronous message, the slave player immediately processes and waits for receiving the music data frame of the master player, and when the music data frames of the master player and the slave player are equal, the master player sends a playing instruction to enable the slave player to play the music together.
The method for realizing multi-zone and independent zone playing in the smart home comprises the following steps: the master and slave players are assigned up to 16 zone numbers 1, 2.. 16, respectively. Multi-region playing: when the master player selects area code 1 to play, the master player can use the multicast port to send the area code 1 to the network in real time, and all the slaves with the area code 1 can play following. And (3) playing in the independent area: the slave player in area code 1 can play independently without being affected by the host playing.
the invention discloses a method for realizing multi-machine synchronous playing based on a cloud network music player, which comprises a main player and a plurality of slave players, wherein:
1. The main player implementation flow is as follows (as shown in fig. 1):
And S101, reading the URI address of the prestored cloud.
step S102, creating the HTTP client.
Step S103: and connecting the cloud service, and jumping to the step S104 if the connection is successful, or waiting.
step S104, acquiring an audio list.
in step S105, music starts to be downloaded.
And step S106, buffering the music data frames.
step S107: a multicast thread is created.
Step S108, the time cut message is sent.
Step S109 is to create a thread for sending a music data frame.
Step S110: the music data frames are transmitted in sequence. And when a certain cache is reached, sending a playing instruction.
Step S111: audio decoding is started.
Step S112: until the decoding is finished.
The slave player realizes the flow as follows (as shown in figure 2)
in step S201, a multicast thread is created.
Step S202, monitoring the multicast port, if the multicast port has data, jumping to S203, otherwise, monitoring all the time.
Step S203: and verifying whether the message is correct, if so, jumping to S204, otherwise, jumping to S202.
Step S204: and judging whether the message is time-truncated, and if so, jumping to S205.
Step S205: the synchronous time is cut off, and the synchronous time is cut off,
step S206: a thread is created that receives frames of music data.
step S207: music data frames are always buffered.
Step S208: and judging whether the instruction is played, and if so, jumping to S209.
Step S209: audio decoding is started.
Step S210, until the decoding is finished.
the above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (1)

1. a method for realizing multi-machine synchronous playing based on a cloud network music player is characterized by comprising a main player and a plurality of slave players, wherein:
The main player realizes the following processes:
Step S101, reading a URI address of a prestored cloud;
Step S102, creating an HTTP client;
step S103: connecting the cloud service, if the connection is successful, jumping to the step S104, otherwise, waiting;
step S104, acquiring an audio list;
step S105, starting to download music;
Step S106, caching music data frames;
Step S107: creating a multicast thread;
step S108, sending a time-cut message;
Step S109, creating a thread for sending the music data frame;
step S110: sequentially transmitting the music data frames; when a certain cache is reached, sending a playing instruction;
Step S111: starting audio decoding;
Step S112: until the decoding is finished;
the slave player realizes the following flow:
Step S201, a multicast thread is established;
step S202, monitoring the multicast port, if data exists, jumping to S203, otherwise, monitoring all the time;
Step S203: verifying whether the message is correct, if so, jumping to S204, otherwise, jumping to S202;
step S204: judging whether the message is time-truncated, if so, jumping to S205;
step S205: synchronizing time truncation;
Step S206: creating a thread for receiving music data frames;
step S207: caching the music data frame all the time;
Step S208: judging whether the instruction is played, if so, jumping to S209;
Step S209: starting audio decoding;
Step S210, until the decoding is finished.
CN201910852796.6A 2019-09-10 2019-09-10 Method for realizing synchronous playing of multiple machines based on cloud network music player Active CN110557454B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910852796.6A CN110557454B (en) 2019-09-10 2019-09-10 Method for realizing synchronous playing of multiple machines based on cloud network music player

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910852796.6A CN110557454B (en) 2019-09-10 2019-09-10 Method for realizing synchronous playing of multiple machines based on cloud network music player

Publications (2)

Publication Number Publication Date
CN110557454A true CN110557454A (en) 2019-12-10
CN110557454B CN110557454B (en) 2022-07-05

Family

ID=68739774

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910852796.6A Active CN110557454B (en) 2019-09-10 2019-09-10 Method for realizing synchronous playing of multiple machines based on cloud network music player

Country Status (1)

Country Link
CN (1) CN110557454B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200461A (en) * 2013-01-14 2013-07-10 易程(苏州)智能系统有限公司 Multiple-player-terminal synchronized playing system and playing method
KR101600891B1 (en) * 2014-10-17 2016-03-09 쿨사인 주식회사 Synchronization method and system for audio and video of a plurality terminal
CN106507142A (en) * 2016-12-26 2017-03-15 余焰 A kind of synchronous broadcast method of non-Streaming Media audio-video document, device
CN107105337A (en) * 2017-02-27 2017-08-29 深圳市卓翼科技股份有限公司 Radio multimedium playing method and device
CN109151987A (en) * 2018-07-03 2019-01-04 珠海全志科技股份有限公司 A kind of method that more room audio groups are played simultaneously in WLAN
CN110062311A (en) * 2019-06-01 2019-07-26 厦门市思芯微科技有限公司 A kind of intelligent sound box system by the more room music playback functions of local area network

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103200461A (en) * 2013-01-14 2013-07-10 易程(苏州)智能系统有限公司 Multiple-player-terminal synchronized playing system and playing method
KR101600891B1 (en) * 2014-10-17 2016-03-09 쿨사인 주식회사 Synchronization method and system for audio and video of a plurality terminal
CN106507142A (en) * 2016-12-26 2017-03-15 余焰 A kind of synchronous broadcast method of non-Streaming Media audio-video document, device
CN107105337A (en) * 2017-02-27 2017-08-29 深圳市卓翼科技股份有限公司 Radio multimedium playing method and device
CN109151987A (en) * 2018-07-03 2019-01-04 珠海全志科技股份有限公司 A kind of method that more room audio groups are played simultaneously in WLAN
CN110062311A (en) * 2019-06-01 2019-07-26 厦门市思芯微科技有限公司 A kind of intelligent sound box system by the more room music playback functions of local area network

Also Published As

Publication number Publication date
CN110557454B (en) 2022-07-05

Similar Documents

Publication Publication Date Title
AU2022259837B2 (en) Systems and methods for networked music playback
US11979639B2 (en) First-screen navigation with channel surfing, backdrop reviewing and content peeking
CN1836402B (en) Home network system and configuration system
EP3506031A1 (en) Smart household control method, apparatus and system
CN105652675A (en) Control method for intelligent household equipment, device, terminal and system
CN111665737B (en) Smart home scene control method and system
CN109799716B (en) Scene pushing method and device and intelligent home system
CN104934050A (en) Audio networking playing method and system based on wireless network
JP2011253566A (en) Method, system, and computer program product for setup of multi-device control
CN105527953A (en) Intelligent household control system
CN104704483B (en) System and method for the playback for managing streaming digital content
CN104635501A (en) Intelligent home control method and system
CN103391277A (en) Media playing method, device and system
CN102298590B (en) Home interconnected information display system and method, and display terminals and server for the same
CN105791064A (en) Cooperation processing method for messages in local area network, and device
CN110557454B (en) Method for realizing synchronous playing of multiple machines based on cloud network music player
WO2024016539A1 (en) Device control method and apparatus, and storage medium and electronic apparatus
CN112311633A (en) Distribution network control method, distribution network control device, household appliance and storage medium
CN113452589B (en) Wide area network intelligent home remote control system and working method thereof
CN115277280A (en) Control method of intelligent household equipment and control method of server
CN108322372A (en) Smart home is wirelessly connected hardware bridge device
US20150149523A1 (en) Network system, constant connection method, communication method,electronic device, constant connection server, application server, and program
CN110324139B (en) Data broadcasting method for smart home
KR100729623B1 (en) Method for controlling home-device and home-device control apparatus using the same
CN112601108A (en) Streaming media playing method and system

Legal Events

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