CN113179441A - Synchronous playing method, device, system and computer equipment - Google Patents

Synchronous playing method, device, system and computer equipment Download PDF

Info

Publication number
CN113179441A
CN113179441A CN202110325464.XA CN202110325464A CN113179441A CN 113179441 A CN113179441 A CN 113179441A CN 202110325464 A CN202110325464 A CN 202110325464A CN 113179441 A CN113179441 A CN 113179441A
Authority
CN
China
Prior art keywords
synchronous playing
network communication
synchronous
playing device
communication round
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
CN202110325464.XA
Other languages
Chinese (zh)
Other versions
CN113179441B (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.)
Colorlight Cloud Technology Co Ltd
Original Assignee
Colorlight Cloud 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 Colorlight Cloud Technology Co Ltd filed Critical Colorlight Cloud Technology Co Ltd
Priority to CN202110325464.XA priority Critical patent/CN113179441B/en
Publication of CN113179441A publication Critical patent/CN113179441A/en
Application granted granted Critical
Publication of CN113179441B publication Critical patent/CN113179441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Abstract

The invention relates to a synchronous playing method, a device and a system, wherein a video stream to be synchronously played is pre-stored in synchronous playing equipment, and the synchronous playing equipment establishes a communication connection relation with a main server; receiving a synchronous playing instruction sent by a main server, transmitting NTP messages in synchronous playing equipment and the main server, calculating a plurality of network communication round-trip time delays, carrying out error processing, obtaining a target network communication round-trip time delay, calculating a target system time difference according to the target network communication round-trip time delay, setting a system clock of each synchronous playing equipment according to the target system time difference, synchronizing the system clock of each synchronous playing equipment with the system clock of the main server, controlling a display screen to play a pre-stored video stream according to the starting playing time indicated in the synchronous playing instruction, improving the synchronous playing effect and realizing the precise synchronization of video playing.

Description

Synchronous playing method, device, system and computer equipment
Technical Field
The present invention relates to the field of synchronous playing, and in particular, to a synchronous playing method, apparatus, system and computer device.
Background
At present, when video streams are played synchronously, a server generally issues the video streams to a master device, then the master device performs video processing operations such as decoding on the video streams, and distributes video frames after the video processing operations such as decoding to a plurality of slave devices connected with the master device through a network, because the communication between the master device and the server is easily affected by the network, when the communication between the master device and the server is disconnected or the master device has problems, all the slave devices cannot achieve the purpose of synchronous playing; the master device needs to perform operations such as decoding the video stream independently and distribute the decoded video stream to each slave device, and thus the calculation pressure carried by the master device is very large; in addition, with the existing arrangement, the master device and the slave device may only be capable of processing video streams with smaller data volume (the capabilities of the master device such as video decoding are limited, because only one master device participates in video processing operations such as video decoding), and for a use scene in which video streams with resolutions of 4k and 8k are used for synchronous playing in an oversized LED display screen level, the arrangement in the prior art may not achieve the processing effect required by human beings. In order to solve the above problems in the prior art, a master device and a slave device are not provided, and a video stream to be played synchronously is directly stored in each playing device, so that an influence of network delay on the synchronous playing is solved, but because there is a difference in system time of each playing device and an error is large when the system time of the playing device is synchronized at present, a problem that the video stream cannot be played synchronously still occurs, and a new technical scheme needs to be found by those skilled in the art to solve the above problems.
Disclosure of Invention
Aiming at the problems, the invention provides a synchronous playing method, which comprises the steps that a plurality of synchronous playing devices are arranged, and the synchronous playing devices are in communication connection with a main server; receiving a synchronous playing instruction sent by a main server, wherein each synchronous playing device sends a plurality of NTP messages to an NTP time server in the main server respectively and receives a plurality of return NTP messages which are sent by the NTP time server and correspond to the plurality of NTP messages one by one; respectively calculating a plurality of network communication round-trip time delays corresponding to each synchronous playing device according to a plurality of returned NTP messages received by each synchronous playing device; respectively calculating the average value or the minimum value of the network communication round-trip delay corresponding to each synchronous playing device according to the plurality of network communication round-trip delays corresponding to each synchronous playing device, taking the average value or the minimum value of the network communication round-trip delay corresponding to each synchronous playing device as the target network communication round-trip delay corresponding to each synchronous playing device, or respectively carrying out linear fitting on the plurality of network communication round-trip delays corresponding to each synchronous playing device according to a preset linear fitting strategy to obtain a fitting curve corresponding to each synchronous playing device, and predicting the target network communication round-trip delay corresponding to each synchronous playing device at the current moment according to the fitting curve corresponding to each synchronous playing device; respectively calculating a target system time difference corresponding to each synchronous playing device according to the target network communication delay corresponding to each synchronous playing device, respectively setting a system clock of each synchronous playing device according to the target system time difference corresponding to each synchronous playing device, and enabling the system clock of each synchronous playing device to be synchronous with the system clock of the main server; and controlling the display screen to play the pre-stored video stream according to the play starting time indicated in the synchronous play instruction.
Further, the returned NTP message includes the time T for the synchronous playing device to send the NTP message1Time T for receiving NTP message by main server2Time T for transmitting back NTP message by NTP time server3And the time T of the synchronous playing device receiving the returned NTP message4(ii) a Calculating a plurality of network communication round-trip time delays corresponding to each synchronous playing device respectively according to a plurality of returned NTP messages received by each synchronous playing device comprises: using the formula Delay ═ T4-T1)-(T3-T2) And respectively calculating a plurality of network communication round-trip Delay corresponding to each synchronous playing device.
Further, calculating the target system time difference corresponding to each synchronized playback device according to the target network communication round-trip delay corresponding to each synchronized playback device includes:
using formulas
Figure BDA0002994477540000031
Or formula
Figure BDA0002994477540000032
And respectively calculating a target system time difference Offset corresponding to each synchronous playing device, wherein delay is the target network communication round-trip delay corresponding to each synchronous playing device.
Further, the method further comprises: presetting an offset queue in each synchronous playing device, and respectively storing a plurality of network communication round-trip delays corresponding to each synchronous playing device into the corresponding offset queues according to the sequence; presetting a data upper limit stored in an offset queue, increasing the newly-increased network communication round-trip delay to the tail of the offset queue if the newly-increased network communication round-trip delay exists after the data stored in the offset queue reaches the data upper limit, and taking the network communication round-trip delay at the head of the offset queue as overdue data to be removed; and calculating the round-trip time delay of the target network communication by using the network communication round-trip time delay stored in the offset queue.
Further, before calculating the target network communication round-trip delay corresponding to each synchronous playing device, the method also comprises the step of eliminating the network communication round-trip delay exceeding a preset delay threshold value from the plurality of network communication round-trip delays corresponding to each synchronous playing device.
Further, before the main server sends the synchronous playing instruction, the method further includes that the main server judges whether the plurality of synchronous playing devices are synchronous according to a preset synchronous playing judgment policy, and the synchronous playing judgment policy includes: judging whether the system time difference between each synchronous playing device and a main server is within a preset time difference range, and if the system time difference between at least one synchronous playing device and the main server is not within the preset time difference range, judging that a plurality of synchronous playing devices are not synchronous; or, in the process of synchronous playing by the plurality of synchronous playing devices, judging whether a newly added synchronous playing device exists, and if the newly added synchronous playing device exists, judging that the plurality of synchronous playing devices and the newly added synchronous playing device are not synchronous.
Furthermore, the synchronous playing device and the main server are arranged in the same wide area network.
The invention also provides a synchronous playing device, which is arranged in the synchronous playing equipment and comprises a communication module, a network communication round-trip delay calculation module, a system time difference calculation module, an error processing module, a clock synchronization module and a playing control module, wherein: the communication module is connected with the network communication round-trip delay calculation module and used for establishing a communication connection relation with the main server, receiving a synchronous playing instruction sent by the main server, sending a plurality of NTP messages to an NTP time server in the main server and receiving a plurality of returned NTP messages which are sent by the NTP time server and correspond to the plurality of NTP messages one by one; the network communication round-trip delay calculation module is connected with the communication module and the error processing module and calculates a plurality of network communication round-trip delays between the main server and the synchronous playing equipment according to a plurality of returned NTP messages; the error processing module is connected with the network communication round-trip delay calculation module and the system time difference calculation module and is used for calculating the average value or the minimum value of the plurality of network communication round-trip delays, taking the average value or the minimum value as the target network communication round-trip delay, or carrying out linear fitting on the plurality of network communication round-trip delays according to a preset linear fitting strategy to obtain a fitting curve, and predicting the target network communication round-trip delay at the current moment according to the fitting curve; the system time difference calculation module is connected with the error processing module and used for calculating the target system time difference between the synchronous playing device and the main server according to the round-trip delay of target network communication, and the clock synchronization module is connected with the system time difference calculation module and the playing control module and used for setting the system clock of the synchronous playing device according to the target system time difference and enabling the system clock of the synchronous playing device to be synchronous with the system clock of the main server;
and the playing control module is used for controlling the display screen to play the pre-stored video stream according to the playing starting time indicated in the synchronous playing instruction after the system clock of the synchronous playing device is synchronous with the system clock of the main server.
The invention also provides a synchronous playing system which comprises a main server and a plurality of synchronous playing devices, wherein each synchronous playing device is connected with a display screen, and the synchronous playing device is arranged in each synchronous playing device.
The invention also provides computer equipment which comprises a memory and a processor, wherein the memory stores computer programs, and the processor realizes the steps of the synchronous playing method when executing the computer programs.
The synchronous playing method, the device and the system provided by the invention at least have the following beneficial effects: the video stream to be synchronously played is stored in the synchronous playing equipment in advance, each synchronous playing equipment decodes the video and the like, other equipment is not needed to decode and is issued to each synchronous playing equipment through a network, the problem that the synchronous playing equipment cannot realize synchronous playing due to network delay is solved, each synchronous playing equipment decodes the video to be synchronously played, and the problem that the processing effect required by a user cannot be achieved for the use scene in which the video stream with the resolution of 4k, 8k and the like is used for synchronous playing in an ultra-large LED display screen level due to the limitation of the decoding capability of the main equipment when the main equipment participates in the video processing operation of video decoding and the like is solved. Meanwhile, a large number of NTP messages are sent between the synchronous playing equipment and the main server, and the obtained multiple network communication round-trip time delays are processed to obtain target network communication round-trip time delays and target system time differences, so that calculation errors are greatly eliminated, the target system time differences calculated by utilizing the target network communication round-trip time delays can more accurately synchronize system clocks of the synchronous playing equipment, and therefore the synchronous playing equipment can be ensured to synchronously play video streams after receiving synchronous playing instructions.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a synchronous playing method according to an embodiment of the present invention;
figure 2 is a schematic diagram of NTP message transmission in an embodiment of the present invention;
FIG. 3 is a flowchart illustrating steps for updating network communication round trip delay in one embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a synchronous playback device according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a synchronized playback system according to an embodiment of the present invention;
301-communication module, 302-network communication round-trip delay calculation module, 303-system time difference calculation module, 304-error processing module, 305-clock synchronization module, 306-play control device, 4-main server, 5-synchronous play device and 6-display screen.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In an embodiment of the present invention, a synchronous playing method is disclosed, an execution subject of the method is a synchronous playing device, specifically as shown in fig. 1, the method includes the following steps:
step S101: and the synchronous playing equipment establishes a communication connection relation with the main server.
In this embodiment, the synchronized playback device refers to a server at the PC end, and the server at the PC end may be connected to a sending card of the display screen to implement communication with the display screen, and control the display screen to play a related video stream. Specifically, in this embodiment, the display screen may be an LED display screen, an OLED display screen, an LCD display screen, and the like, which is not limited in this respect. The number of the synchronous playing devices is at least two, and each synchronous playing device is in communication connection with the main server. The main server can receive a synchronous playing instruction of a user and then send the synchronous playing instruction to each synchronous playing device so as to control the synchronous playing devices to carry out playing synchronization.
Further, in this embodiment, the communication connection between the synchronous playback device and the main server may be a wired connection or a wireless connection, which is not limited in the present invention and can be set by a person skilled in the art according to actual needs in practical applications.
Furthermore, the synchronous playing device and the main server are arranged in the same wide area network.
Step S102: and receiving a synchronous playing instruction sent by the main server, wherein each synchronous playing device respectively sends a plurality of NTP messages to an NTP time server in the main server and receives a plurality of return NTP messages which are sent by the NTP time server and correspond to the plurality of NTP messages one by one.
In this embodiment, the synchronous playing instruction includes a play start time, a play duration, a play end time, a play content (i.e., which video stream is specifically played), and the like, and after receiving the synchronous playing instruction, the synchronous playing device starts to synchronize and sends a plurality of NTP messages to the NTP time server in the main server. Wherein the NTP timeserver can provide accurate time. NTP (Network Time Protocol), which is a Time synchronization Protocol defined by RFC 1305, is used to perform Time synchronization between a distributed Time server and a client. In this embodiment, the NTP message is used to implement time synchronization between the system clocks of the main server and the synchronous playback device, thereby implementing playback synchronization. In this embodiment, in order to accurately determine the system time difference, each synchronization device may send a plurality of NTP messages, for example, 100 NTP messages, to the NTP time server, and each time the synchronization device sends one NTP message, only one returned NTP message may be received.
Specifically, as shown in fig. 2, the synchronous playback device sends an NTP message to the NTP time server, where the NTP message may have its departureSynchronizing time T of playback devices1(that is, the time when the synchronous playing device sends the NTP message), when the NTP time server receives the NTP message, a time stamp T is added to the NTP message2(namely the time that the NTP time server receives the NTP message), when the NTP time server sends the return NTP message to the synchronous playing equipment, a sending timestamp T is added in the return NTP message3(namely the time when the NTP time server sends the returned NTP message), when the synchronous playing equipment receives the returned NTP message, the arrival timestamp T is added to the returned NTP message4(i.e. the time when the synchronous playing device receives the returned NTP message). The timestamp T in the returned NTP message can be utilized subsequently1、T2、T3、T4The network communication round-trip delay between the synchronous playing device and the main server and the target system time difference are calculated. It should be noted that the time stamp T1、T4Is the time of the system clock of the synchronous playing device, the time stamp T2、T3Is the time of the system clock of the master server.
Step S103: and respectively calculating a plurality of network communication round-trip time delays corresponding to each synchronous playing device according to a plurality of returned NTP messages received by each synchronous playing device.
Specifically, the method for calculating the network communication round-trip delay according to the returned NTP message comprises the following steps: obtaining time stamp T in back transmission NTP message1、T2、T3、T4According to the formula Delay ═ T4-T1)-(T3-T2) And obtaining the network communication round-trip Delay between the main server and the synchronous playing device (i.e. the network communication round-trip Delay corresponding to the synchronous playing device). Because each synchronous playing device receives a plurality of returned NTP messages, a plurality of network communication round-trip delays Delay are calculated between each synchronous playing device and the main server correspondingly (i.e. each synchronous playing device corresponds to a plurality of network communication round-trip delays).
More specifically, the principle of the calculation formula of the network communication round trip Delay is as follows:
assuming that the target system time difference between the synchronous playing device and the main server is Offset, the time spent by the synchronous playing device in transmitting the NTP message to the NTP time server is d1, and the time spent by the NTP time server in transmitting the NTP message to the synchronous playing device is d2, the following steps are performed:
T2=T1+Offset+d1;T4=T3-Offset + d 2; the above formula is modified to obtain (T) ═ d1+ d24-T1)-(T3-T2)。
Step S104: respectively calculating the average value or the minimum value of the network communication round-trip delay corresponding to each synchronous playing device according to the plurality of network communication round-trip delays corresponding to each synchronous playing device, taking the average value or the minimum value of the network communication round-trip delay corresponding to each synchronous playing device as the target network communication round-trip delay corresponding to each synchronous playing device, or respectively carrying out linear fitting on the plurality of network communication round-trip delays corresponding to each synchronous playing device according to a preset linear fitting strategy to obtain a fitting curve corresponding to each synchronous playing device, and predicting the target network communication round-trip delay corresponding to each synchronous playing device at the current moment according to the fitting curve corresponding to each synchronous playing device.
In this step, an average value or a minimum value of the multiple network communication round-trip time delays is calculated as a target network communication round-trip time delay or linear fitting is performed by using the multiple network communication round-trip time delays to obtain a fitting curve, and the network communication round-trip time delay at the current moment is obtained according to the fitting curve, so that the calculation error can be effectively reduced.
Specifically, the fitting may be performed by using a plurality of network communication round trip delays and corresponding times thereof to obtain a corresponding relationship curve of the network communication round trip delay and the time, that is, the network communication round trip delay at the current time may be obtained according to the corresponding relationship curve of the network communication round trip delay and the time. In this embodiment, the current time refers to a time when the system clock of the synchronized playback device is adjusted to synchronize the system clock of the synchronized playback device with the system clock of the main server.
Step S105: and respectively calculating a target system time difference corresponding to each synchronous playing device according to the target network communication delay corresponding to each synchronous playing device, and respectively setting a system clock of each synchronous playing device according to the target system time difference corresponding to each synchronous playing device, so that the system clock of each synchronous playing device is synchronous with the system clock of the main server.
Specifically, in this embodiment, calculating the target system time difference corresponding to each synchronized playback device according to the target network communication round-trip delay corresponding to each synchronized playback device includes: using formulas
Figure BDA0002994477540000101
Or formula
Figure BDA0002994477540000102
And respectively calculating a target system time difference Offset corresponding to each synchronous playing device, wherein delay is the target network communication round-trip delay corresponding to each synchronous playing device.
More specifically, in this step, the system clock of each synchronized playback device is respectively set according to the target system time difference corresponding to each synchronized playback device, that is, the current time of each synchronized playback device is obtained, and the adjusted system time is obtained by adding the target system time difference to the current time.
Further, in step S103, T is found2=T1+Offset+d1;T4=T3-Offset + d 2; delay is d1+ d2, thus Offset is T2-T1-d1 or Offset ═ T3-T4+ d2, because d1 and d2 are the round-trip delay of NTP message (network communication round-trip delay), under ideal conditiond1 and d2 are symmetrical (equal), but actually d1 and d2 are asymmetrical (unequal), and since Delay is d1+ d2, the ranges of d1 and d2 are (0, Delay), and Offset can be expressed as:
Offset=T2-T1-d1=T2-T1-Delay/2 or Offset ═ T3-T4+ Delay/2, i.e. d1 or d2 is replaced by Delay/2, where the maximum error of d1 or d2 is ± Delay/2, i.e. the maximum error of Offset is ± Delay/2. Therefore, the Offset value is related to the Delay value, and when the Delay error is reduced or minimized, the Offset error is also reduced. Therefore, in this step, Offset is calculated by using the round-trip delay of the target network communication corresponding to each synchronized playback device, which can effectively reduce the calculation error of Offset, thereby realizing accurate synchronization between the system clock of each synchronized playback device and the system clock of the main server.
Step S106: and controlling the display screen to play the pre-stored video stream according to the play starting time indicated in the synchronous play instruction.
Specifically, in step S105, since the system clock of the synchronized playing device is synchronized with the system clock of the master server, that is, the system clocks of the synchronized playing devices are all the same, after the synchronized playing instruction is received, the display screen is controlled to play the video stream at the corresponding playing start time according to the playing start time in the synchronized playing instruction, so as to achieve synchronization.
More specifically, under the condition that a plurality of synchronous playing devices have played video streams synchronously, a new synchronous playing device is added at the moment, after system clock synchronization is completed between the new synchronous playing device and the main server, the playing start time of the video streams in synchronous playing is obtained, and then the playing start time is subtracted from the current time, so that the played time of the video streams can be calculated, the playing progress bar of the video streams is adjusted according to the played time, the display screen is controlled to play the video streams from the corresponding time position, and the synchronous playing of the newly added synchronous playing device and other synchronous playing devices can be realized.
In the synchronous playing method provided in this embodiment, the video stream to be synchronously played is pre-stored in the synchronous playing device, and decoding by using other devices and issuing through a network are not required, so that the problem that the playing of the video stream cannot be synchronized due to network delay or network communication interruption and the like is avoided. And each synchronous playing device decodes and processes the video which needs to be synchronously played, so that the decoding and other processing are not limited by the decoding capability of the main device, and the processing effect required by a user can be achieved for the use scene of synchronously playing the video streams with the resolution of 4k and 8k in the super-large LED display screen level.
In another embodiment of the present invention, as shown in fig. 3, the method for synchronous playing further includes the following steps of updating the round trip delay of network communication:
step S201: presetting an offset queue in each synchronous playing device, and respectively storing a plurality of network communication round-trip delays between the main server and each synchronous playing device into the corresponding offset queues according to the sequence.
Specifically, in this embodiment, storing in sequence refers to storing in time sequence of obtaining the round trip delay of network communication.
Step S202: presetting the upper limit of data stored in the offset queue, increasing the newly-increased network communication round-trip delay to the tail of the offset queue if the newly-increased network communication round-trip delay exists after the data stored in the offset queue reaches the upper limit of the data, and simultaneously removing the network communication round-trip delay at the head of the offset queue as overdue data.
By the method for introducing the offset queue, the round-trip delay data of network communication is counted, the counting result is more stable, the upper limit of the data stored in the offset queue is set, and the full-load state is obtained when the upper limit is reached; and adding newly added data to the tail of the queue after the full load state is reached, removing the data at the head of the queue in order to maintain the upper limit, taking the removed data as overdue data, and calculating the round-trip time delay of the target network communication by using the round-trip time delay of the network communication stored in the offset queue.
The method provided by the embodiment can be used for realizing the cleaning of the expired data, so that the statistical result of the multiple network communication round-trip time delays is more stable, and meanwhile, the newly obtained multiple network communication round-trip time delays are adopted to calculate the target network communication round-trip time delay, so that the calculation error of the target network communication round-trip time delay can be reduced, the calculation error of the target system time difference is further reduced, and the synchronous playing effect is improved.
In another embodiment of the present invention, before calculating the target network communication round-trip delay corresponding to each synchronized playback device, the method further includes eliminating network communication round-trip delays exceeding a preset delay threshold from the multiple network communication round-trip delays corresponding to each synchronized playback device.
Specifically, in this embodiment, the delay threshold may be set by a person skilled in the art according to actual needs. For example, the delay threshold may be set to 100ms, i.e., if the network communication round trip delay exceeds 100ms, the network communication round trip delay is removed. By the method in the embodiment, some extreme values can be removed, so that a large calculation error caused by the extreme values is avoided. In another embodiment of the present invention, before the master server sends the synchronized playing instruction, the method further includes the master server determining whether the plurality of synchronized playing devices are synchronized according to a preset synchronized playing determination policy, where the synchronized playing determination policy includes:
judging whether the system time difference between each synchronous playing device and the main server is within a preset time difference range, and if the system time difference between at least one synchronous playing device and the main server is not within the preset time difference range, judging that the plurality of synchronous playing devices are not synchronous; or, in the process of synchronous playing by the plurality of synchronous playing devices, judging whether a newly added synchronous playing device exists, and if the newly added synchronous playing device exists, judging that the plurality of synchronous playing devices and the newly added synchronous playing device are not synchronous.
In this embodiment, before synchronization, it is determined whether the current synchronous playback device is synchronized, and only when the current synchronous playback device is not synchronized, the subsequent synchronization step is performed to reduce the amount of computation.
In an embodiment of the present invention, as shown in fig. 4, there is further provided a synchronous playing apparatus, which is disposed in a synchronous playing device, and includes a communication module 301, a network communication round trip delay calculation module 302, a system time difference calculation module 303, an error processing module 304, a clock synchronization module 305, and a playing control module 306, where:
the communication module 301 is connected with the network communication round-trip delay calculation module 302, and is configured to establish a communication connection relationship with the main server, receive a synchronous play instruction sent by the main server, send a plurality of NTP messages to an NTP time server in the main server, and receive a plurality of returned NTP messages sent by the NTP time server and corresponding to the plurality of NTP messages one to one;
and a network communication round-trip delay calculation module 302, connected to the communication module 301 and the error processing module 304, for calculating a plurality of network communication round-trip delays between the main server and the synchronous playback device according to the plurality of returned NTP messages.
The error processing module 304 is connected to the network communication round-trip delay calculation module 302 and the system time difference calculation module 303, and configured to calculate an average value or a minimum value of multiple network communication round-trip delays, use the average value or the minimum value as a target network communication round-trip delay, or perform linear fitting on the multiple network communication round-trip delays according to a preset linear fitting strategy to obtain a fitting curve, and predict the target network communication round-trip delay at the current time according to the fitting curve;
and the system time difference calculating module 303 is connected to the error processing module 304, and is configured to calculate a target system time difference between the synchronous playback device and the main server according to the round-trip delay of the target network communication.
The clock synchronization module 305 is connected to the system time difference calculation module 303 and the playing control module 306, and configured to set a system clock of the synchronized playing device according to the target system time difference, so that the system clock of the synchronized playing device is synchronized with the system clock of the main server.
And the play control module 306 is configured to control the display screen to play the pre-stored video stream according to the play start time indicated in the synchronous play instruction after the system clock of the synchronous play device is synchronized with the system clock of the master server.
The synchronous playing device provided in this embodiment prestores the video stream to be synchronously played in the synchronous playing device, and does not need to be sent to each synchronous playing device via a network, thereby solving the problem that the synchronous playing device cannot realize synchronous playing due to network delay. Meanwhile, when the time difference of the system is calculated, the method greatly eliminates the calculation error, thereby more accurately synchronizing the system clock of each synchronous playing device and ensuring that each synchronous playing device can synchronously play the video stream after receiving the synchronous playing instruction.
In an embodiment of the present invention, a synchronized playing system is further provided, as shown in fig. 5, the system includes a main server 4 and a plurality of synchronized playing devices 5, each synchronized playing device 5 is connected to a display screen 6, and the synchronized playing device is disposed in the synchronized playing device 5.
In an embodiment of the present invention, a computer device is further provided, which includes a memory and a processor, where the memory stores a computer program, and the processor implements the steps of the synchronous playing method when executing the computer program, so as to implement synchronous playing of video streams on multiple display screens.
The terms and expressions used in the specification of the present invention have been set forth for illustrative purposes only and are not meant to be limiting. It will be appreciated by those skilled in the art that changes could be made to the details of the above-described embodiments without departing from the underlying principles thereof. The scope of the invention is, therefore, indicated by the appended claims, in which all terms are intended to be interpreted in their broadest reasonable sense unless otherwise indicated.

Claims (10)

1. A synchronized playback method, the method comprising:
establishing a communication connection relation between a plurality of synchronous playing devices and a main server;
receiving a synchronous playing instruction sent by the main server, wherein each synchronous playing device sends a plurality of NTP messages to an NTP time server in the main server respectively and receives a plurality of return NTP messages which are sent by the NTP time server and correspond to the plurality of NTP messages one by one;
respectively calculating a plurality of network communication round-trip time delays corresponding to each synchronous playing device according to a plurality of returned NTP messages received by each synchronous playing device;
respectively calculating a network communication round-trip delay average value or a network communication round-trip delay minimum value corresponding to each synchronous playing device according to a plurality of network communication round-trip delays corresponding to each synchronous playing device, taking the network communication round-trip delay average value or the network communication round-trip delay minimum value corresponding to each synchronous playing device as a target network communication round-trip delay corresponding to each synchronous playing device, or respectively carrying out linear fitting on a plurality of network communication round-trip delays corresponding to each synchronous playing device according to a preset linear fitting strategy to obtain a fitting curve corresponding to each synchronous playing device, and predicting the target network communication round-trip delay corresponding to each synchronous playing device at the current moment according to the fitting curve corresponding to each synchronous playing device;
respectively calculating a target system time difference corresponding to each synchronous playing device according to the target network communication round-trip delay corresponding to each synchronous playing device, and respectively setting a system clock of each synchronous playing device according to the target system time difference corresponding to each synchronous playing device to synchronize the system clock of each synchronous playing device with the system clock of the main server;
and controlling a display screen to play the pre-stored video stream according to the play starting time indicated in the synchronous play instruction.
2. The synchronized playback method according to claim 1, wherein the returned NTP message includes a time T when the synchronized playback device sends the NTP message1The time T of the NTP time server for receiving the NTP message2The time T of the NTP time server for sending the returned NTP message3And the time T of the synchronous playing equipment receiving the returned NTP message4
The calculating, according to the plurality of returned NTP messages received by each of the synchronous playback devices, a plurality of network communication round-trip delays corresponding to each of the synchronous playback devices includes:
using the formula Delay ═ T4-T1)-(T3-T2) And respectively calculating a plurality of network communication round-trip Delay corresponding to each synchronous playing device.
3. The synchronized playback method of claim 2, wherein the calculating the target system time difference corresponding to each synchronized playback device according to the target network communication round trip delay corresponding to each synchronized playback device respectively comprises:
using formulas
Figure FDA0002994477530000021
Or formula
Figure FDA0002994477530000022
And respectively calculating a target system time difference Offset corresponding to each synchronous playing device, wherein delay is a target network communication round-trip delay corresponding to each synchronous playing device.
4. The synchronized playback method of claim 1, further comprising:
presetting an offset queue in each synchronous playing device, and respectively storing a plurality of network communication round-trip delays corresponding to each synchronous playing device into the corresponding offset queues according to the sequence;
presetting the upper limit of data stored in the offset queue, and after the data stored in the offset queue reaches the upper limit of the data, if a newly-added network communication round-trip delay exists, adding the newly-added network communication round-trip delay to the tail of the offset queue, and simultaneously removing the network communication round-trip delay at the head of the offset queue as overdue data;
and calculating the round-trip time delay of the target network communication by using the network communication round-trip time delay stored in the offset queue.
5. The synchronized playback method of claim 1, further comprising: before calculating the target network communication round-trip delay corresponding to each synchronous playing device, eliminating the network communication round-trip delay exceeding a preset delay threshold value from the plurality of network communication round-trip delays corresponding to each synchronous playing device.
6. The synchronized playback method according to claim 1, wherein before the master server sends the synchronized playback command, the method further comprises the master server determining whether the plurality of synchronized playback devices are synchronized according to a preset synchronized playback determination policy, where the synchronized playback determination policy includes:
judging whether the system time difference between each synchronous playing device and the main server is within a preset time difference range, and if the system time difference between at least one synchronous playing device and the main server is not within the preset time difference range, judging that the plurality of synchronous playing devices are not synchronous;
or, in the process of synchronous playing by the plurality of synchronous playing devices, judging whether a newly added synchronous playing device exists, and if the newly added synchronous playing device exists, judging that the plurality of synchronous playing devices and the newly added synchronous playing device are not synchronous.
7. The synchronized playback method according to claim 1, wherein the synchronized playback device and the main server are provided in a same wide area network.
8. The utility model provides a synchronous play device, its characterized in that, synchronous play device sets up in synchronous playback equipment, including communication module, network communication round trip delay calculation module, system time difference calculation module, error processing module, clock synchronization module and broadcast control module, wherein:
the communication module is connected with the network communication round-trip delay calculation module and used for establishing a communication connection relation with a main server, receiving a synchronous playing instruction sent by the main server, sending a plurality of NTP messages to an NTP time server in the main server and receiving a plurality of return NTP messages which are sent by the NTP time server and correspond to the plurality of NTP messages one by one;
the network communication round-trip delay calculation module is connected with the communication module and the error processing module, and calculates a plurality of network communication round-trip delays between the main server and the synchronous playing device according to a plurality of returned NTP messages;
the error processing module is connected with the network communication round-trip delay calculation module and the system time difference calculation module, and is used for calculating an average value or a minimum value of a plurality of network communication round-trip delays, taking the average value or the minimum value as a target network communication round-trip delay, or performing linear fitting on the plurality of network communication round-trip delays according to a preset linear fitting strategy to obtain a fitting curve, and predicting the target network communication round-trip delay at the current moment according to the fitting curve;
the system time difference calculating module is connected with the error processing module and used for calculating the target system time difference between the synchronous playing device and the main server according to the target network communication round-trip delay;
the clock synchronization module is connected with the system time difference calculation module and the play control module and used for setting a system clock of the synchronous play equipment according to the target system time difference and enabling the system clock of the synchronous play equipment to be synchronous with the system clock of the main server;
and the playing control module is used for controlling a display screen to play the pre-stored video stream according to the playing starting time indicated in the synchronous playing instruction after the system clock of the synchronous playing device is synchronous with the system clock of the main server.
9. A synchronized playback system, comprising a main server and a plurality of synchronized playback devices, each of which is connected to a display screen, wherein the synchronized playback devices are provided with the synchronized playback apparatus as claimed in claim 8.
10. A computer device comprising a memory in which a computer program is stored and a processor which, when executing the computer program, realizes the synchronized playback method steps of any one of claims 1 to 7.
CN202110325464.XA 2021-03-26 2021-03-26 Synchronous playing method, device, system and computer equipment Active CN113179441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110325464.XA CN113179441B (en) 2021-03-26 2021-03-26 Synchronous playing method, device, system and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110325464.XA CN113179441B (en) 2021-03-26 2021-03-26 Synchronous playing method, device, system and computer equipment

Publications (2)

Publication Number Publication Date
CN113179441A true CN113179441A (en) 2021-07-27
CN113179441B CN113179441B (en) 2023-06-30

Family

ID=76922427

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110325464.XA Active CN113179441B (en) 2021-03-26 2021-03-26 Synchronous playing method, device, system and computer equipment

Country Status (1)

Country Link
CN (1) CN113179441B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596547A (en) * 2021-07-29 2021-11-02 海信电子科技(武汉)有限公司 Display device, synchronous playing method and system
CN114143584A (en) * 2021-09-29 2022-03-04 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114339328A (en) * 2021-12-31 2022-04-12 杭州当虹科技股份有限公司 Method and system for realizing timestamp synchronization service
CN114785717A (en) * 2022-04-20 2022-07-22 中国第一汽车股份有限公司 Method, apparatus, device and medium for determining maximum time delay of time-sensitive network
CN115297364A (en) * 2022-07-27 2022-11-04 北京奇艺世纪科技有限公司 Method and system for determining cloud game video transmission time delay and electronic equipment
CN115314745A (en) * 2022-07-29 2022-11-08 山东浪潮超高清智能科技有限公司 Streaming media synchronization method
CN115314744A (en) * 2022-07-01 2022-11-08 深圳市丝路蓝创意展示有限公司 Synchronous playing method, device, equipment and storage medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101453308A (en) * 2008-12-31 2009-06-10 华为技术有限公司 IP clock packet processing method, equipment and system
CN101459502A (en) * 2007-12-13 2009-06-17 华为技术有限公司 Method and apparatus for network clock synchronization
CN102938676A (en) * 2011-08-16 2013-02-20 中兴通讯股份有限公司 Method, device and system for processing time synchronization
CN103441832A (en) * 2013-08-22 2013-12-11 瑞斯康达科技发展股份有限公司 Clock synchronization method, system and equipment based on PTP
CN103929293A (en) * 2013-01-15 2014-07-16 电子科技大学 Asymmetrically-delayed time synchronization method and system
CN106130710A (en) * 2016-06-29 2016-11-16 北京东土科技股份有限公司 A kind of clock synchronizing method and system
CN106788836A (en) * 2016-04-06 2017-05-31 新华三技术有限公司 The synchronous method and device of a kind of system time
CN107770569A (en) * 2016-08-18 2018-03-06 北京光子互动科技有限公司 Multimedia synchronous broadcast method, apparatus and system
CN109842603A (en) * 2017-11-29 2019-06-04 北京通号国铁城市轨道技术有限公司 A kind of method for synchronizing time and device
CN110784747A (en) * 2019-12-06 2020-02-11 成都新潮传媒集团有限公司 Synchronous playing method of advertisement player

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459502A (en) * 2007-12-13 2009-06-17 华为技术有限公司 Method and apparatus for network clock synchronization
CN101453308A (en) * 2008-12-31 2009-06-10 华为技术有限公司 IP clock packet processing method, equipment and system
CN102938676A (en) * 2011-08-16 2013-02-20 中兴通讯股份有限公司 Method, device and system for processing time synchronization
CN103929293A (en) * 2013-01-15 2014-07-16 电子科技大学 Asymmetrically-delayed time synchronization method and system
CN103441832A (en) * 2013-08-22 2013-12-11 瑞斯康达科技发展股份有限公司 Clock synchronization method, system and equipment based on PTP
CN106788836A (en) * 2016-04-06 2017-05-31 新华三技术有限公司 The synchronous method and device of a kind of system time
CN106130710A (en) * 2016-06-29 2016-11-16 北京东土科技股份有限公司 A kind of clock synchronizing method and system
CN107770569A (en) * 2016-08-18 2018-03-06 北京光子互动科技有限公司 Multimedia synchronous broadcast method, apparatus and system
CN109842603A (en) * 2017-11-29 2019-06-04 北京通号国铁城市轨道技术有限公司 A kind of method for synchronizing time and device
CN110784747A (en) * 2019-12-06 2020-02-11 成都新潮传媒集团有限公司 Synchronous playing method of advertisement player

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113596547A (en) * 2021-07-29 2021-11-02 海信电子科技(武汉)有限公司 Display device, synchronous playing method and system
CN114143584A (en) * 2021-09-29 2022-03-04 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114143584B (en) * 2021-09-29 2024-03-26 杭州当虹科技股份有限公司 Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114339328A (en) * 2021-12-31 2022-04-12 杭州当虹科技股份有限公司 Method and system for realizing timestamp synchronization service
CN114339328B (en) * 2021-12-31 2023-09-01 杭州当虹科技股份有限公司 Method and system for realizing time stamp synchronous service
CN114785717A (en) * 2022-04-20 2022-07-22 中国第一汽车股份有限公司 Method, apparatus, device and medium for determining maximum time delay of time-sensitive network
CN115314744A (en) * 2022-07-01 2022-11-08 深圳市丝路蓝创意展示有限公司 Synchronous playing method, device, equipment and storage medium
CN115297364A (en) * 2022-07-27 2022-11-04 北京奇艺世纪科技有限公司 Method and system for determining cloud game video transmission time delay and electronic equipment
CN115297364B (en) * 2022-07-27 2024-01-23 北京奇艺世纪科技有限公司 Cloud game video transmission time delay determining method, cloud game video transmission time delay determining system and electronic equipment
CN115314745A (en) * 2022-07-29 2022-11-08 山东浪潮超高清智能科技有限公司 Streaming media synchronization method
CN115314745B (en) * 2022-07-29 2023-08-11 山东浪潮超高清智能科技有限公司 Streaming media synchronization method

Also Published As

Publication number Publication date
CN113179441B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN113179441B (en) Synchronous playing method, device, system and computer equipment
US11801442B2 (en) Synchronization and offset of VSYNC between peer-to-peer gaming devices
WO2007041917A1 (en) Apparatus and method for stream synchronization of multimedia real time transmission in packet network
US10855763B2 (en) Method and apparatus for synchronizing applications' consumption of remote data
CN113225598A (en) Method, device and equipment for synchronizing audio and video of mobile terminal and storage medium
Montagud et al. Enhanced adaptive RTCP-based Inter-Destination Multimedia Synchronization approach for distributed applications
WO2013189435A2 (en) Processing method, system, and related device based on play state information synchronization
Boronat et al. Master selection policies for inter-destination multimedia synchronization in distributed applications
CN114143584B (en) Broadcasting system and method for realizing synchronous broadcasting among multiple terminals
CN114339328B (en) Method and system for realizing time stamp synchronous service
US11259069B1 (en) Synchronized video player
CN116983618A (en) Position synchronization method and device
CN110677710A (en) Synchronous control method and terminal control system of multimedia terminal

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