A method and device for controlling synchronized playing of a slave device

By using the time synchronization and clock correction mechanism of the master control device, the problem of asynchronous playback of slave control devices when the network environment is unstable is solved, thereby achieving high synchronization and improved user experience.

CN116614658BActive Publication Date: 2026-02-03HISENSE VISUAL TECH CO LTD
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202210117773.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-08
Publication Date
2026-02-03
Estimated Expiration
2042-02-08

AI Technical Summary

Technical Problem

In situations with poor network conditions or inconsistent processing capabilities among slave devices, multiple slave devices may struggle to synchronously play the audio and video content of the master device, leading to asynchronous playback issues. This problem is particularly pronounced when there are a large number of slave devices that are close together.

Method used

The master control device synchronizes the time of each slave control device by sending a connection response message, calculates and sends a clock correction message to calibrate the target average transmission delay, and then carries the execution time of the current playback instruction and the audio and video progress offset in the playback instruction to achieve synchronous playback of the slave control devices.

Benefits of technology

By performing multiple cumulative calibration processes, the time difference between slave devices is reduced, ensuring synchronized playback of audio and video and improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116614658B_ABST
    Figure CN116614658B_ABST
Patent Text Reader

Abstract

The application relates to the audio and video technical field, and provides a method and equipment for controlling synchronous playing of slave control devices, which realizes synchronous playing of target audio and video through multi-stage time calibration. Specifically, after each slave control device is connected with a master control device, the self time of each slave control device is set as the current time of the master control device, so that preliminary unified calibration of the time is completed; then, before synchronous playing of the target audio and video, each slave control device respectively corrects the target clock deviation of the self according to the target average transmission time delay determined by the master control device, so that clock calibration before playing of the target audio and video is completed, and the synchronism of audio and video playing is improved; when playing of the target audio and video is performed, each slave control device further corrects according to the corrected target clock deviation, the execution time of the current playing instruction carried by a playing instruction and the progress offset of the target audio and video, so that the time difference between the slave control devices is eliminated, and the target audio and video can be accurately and synchronously played.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of audio and video technology, and in particular to a method and device for controlling slave devices to synchronously play. BACKGROUND

[0002] In some scenarios (such as teaching, large-scale lectures, meetings, etc.), a master device often needs to control one or more slave devices to synchronously play audio and video content of the master device.

[0003] Currently, in a scheme in which a master device controls one or more slave devices to synchronously play the same audio and video (such as playing and pausing the same audio and video), the scheme is affected by network factors and device processing capabilities. When the network environment is poor, or the processing capabilities of the slave devices are inconsistent, or the parallel forwarding capability of a service center is poor, the slave devices receive the control instructions sent by the master device at different times, and thus the slave devices execute the control instructions at different times, thereby failing to synchronously play the same audio and video. When the number of slave devices is large, the slave devices are close to each other, and the slave devices perform sound externalization, the problem of unsynchronized playing is more obvious. SUMMARY

[0004] Embodiments of the present application provide a method and device for controlling slave devices to synchronously play, to improve the synchronization of playing of one or more slave devices.

[0005] In a first aspect, embodiments of the present application provide a method for controlling slave devices to synchronously play, applied to a master device, and including:

[0006] In response to a connection request of at least one slave device, a connection response message is sent to the at least one slave device, the connection response message carrying a current time of the master device, so that the at least one slave device respectively sets its own time to the current time of the master device according to the connection response message;

[0007] Before the at least one slave device synchronously plays a target audio and video, a clock correction message is sent to the at least one slave device, the clock correction message carrying a target average transmission time delay, so that the at least one slave device respectively determines a target clock deviation of itself according to the target average transmission time delay;

[0008] In response to a playing operation of the target audio and video, a playing instruction is sent to the at least one slave device, the playing instruction carrying an execution time of a current playing instruction and a progress offset of the target audio and video, so that the at least one slave device synchronously plays the target audio and video according to the target clock deviation, the execution time of the current playing instruction, and the progress offset of the target audio and video.

[0009] Secondly, embodiments of this application provide a method for controlling synchronous playback of slave devices, applied to at least one slave device, including:

[0010] Receive the connection response message sent by the master control device in response to the connection request, and set the current time of the master control device carried in the connection response message to its own time;

[0011] Before synchronously playing the target audio and video, the system receives a clock correction message carrying the target average transmission delay sent by the main control device, and determines its own target clock deviation based on the target average transmission delay.

[0012] Receive the playback command sent by the main control device for the target audio and video, the playback command carrying the execution time of the current playback command and the progress offset of the target audio and video;

[0013] The target audio and video are played synchronously based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video.

[0014] Thirdly, embodiments of this application provide a master control device, including a processor, a memory, an audio / video player, and a communication interface, wherein the communication interface, the audio / video player, the memory, and the processor are connected via a bus.

[0015] The audio and video player is used to play the target audio and video;

[0016] The communication interface is used to communicate with at least one slave device;

[0017] The memory stores a computer program, and the processor performs the following operations according to the computer program:

[0018] In response to a connection request from at least one slave device, a connection response message is sent to each of the slave devices, the connection response message carrying the current time of the master device, so that each of the slave devices sets its own time to the current time of the master device according to the connection response message;

[0019] Before at least one of the slave devices synchronously plays the target audio and video, a clock correction message is sent to at least one of the slave devices respectively. The clock correction message carries the target average transmission delay, so that at least one of the slave devices can determine its own target clock deviation according to the target average transmission delay.

[0020] In response to a playback operation of the target audio / video, a playback command is sent to at least one of the slave devices. The playback command carries the execution time of the current playback command and the progress offset of the target audio / video, so that at least one of the slave devices can synchronously play the target audio / video according to the target clock offset, the execution time of the current playback command, and the progress offset of the target audio / video.

[0021] Fourthly, embodiments of this application provide a slave device, including a processor, a memory, an audio / video player, and a communication interface, wherein the communication interface, the audio / video player, the memory, and the processor are connected via a bus.

[0022] The audio and video player is used to play the target audio and video;

[0023] The communication interface is used to communicate with the main control device;

[0024] The memory stores a computer program, and the processor performs the following operations according to the computer program:

[0025] Receive the connection response message sent by the master control device in response to the connection request, and set the current time of the master control device carried in the connection response message to its own time;

[0026] Before synchronously playing the target audio and video, the system receives a clock correction message carrying the target average transmission delay sent by the main control device, and determines its own target clock deviation based on the target average transmission delay.

[0027] Receive the playback command sent by the main control device for the target audio and video, the playback command carrying the execution time of the current playback command and the progress offset of the target audio and video;

[0028] The target audio and video are played synchronously based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video.

[0029] Fifthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions for causing a computer to execute a method for controlling a slave device to play synchronously.

[0030] In the above embodiments of this application, after the master control device and at least one slave control device establish a connection, the master control device sends a connection response message to each slave control device. Each slave control device sets the current time of the master control device carried in the connection response message to its own time, thereby making the time of each slave control device basically consistent with the time of the master control device, which facilitates clock correction. Before synchronously playing the target audio and video, the master control device sends a clock correction message carrying the target average transmission delay to each slave control device. Each slave control device determines its own target clock deviation based on the target average transmission delay, thereby completing the clock correction before the target audio and video is played, improving the synchronization of audio and video playback. When playing the target audio and video, the master control device sends a playback command to each slave control device. Each slave control device further corrects itself based on the target clock deviation carried in the playback command, as well as the execution time of the current playback command and the progress offset of the target audio and video, thereby eliminating the time difference between the slave control devices and enabling each slave control device to accurately play the target audio and video synchronously. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1A An exemplary diagram illustrating an application scenario provided in an embodiment of this application is shown;

[0033] Figure 1B An exemplary diagram illustrating another application scenario provided by an embodiment of this application is shown;

[0034] Figure 2 An exemplary illustration shows a method flow for controlling synchronous playback of slave devices implemented on the master control device side according to an embodiment of this application;

[0035] Figure 3 An exemplary illustration shows the flow of a method for determining the target average transmission delay provided in an embodiment of this application;

[0036] Figure 4 An exemplary illustration shows a method flow for controlling synchronous playback of slave devices implemented on the slave device side according to an embodiment of this application;

[0037] Figure 5 An exemplary illustration shows the method flow for synchronously playing target audio and video provided in an embodiment of this application;

[0038] Figure 6A The initial calibration process for each slave device provided in the embodiments of this application is illustrated by way of example;

[0039] Figure 6B An exemplary embodiment of the calibration process before audio and video playback provided in this application is shown;

[0040] Figure 6C This application provides an exemplary embodiment of a synchronized audio and video playback process.

[0041] Figure 7 An exemplary structural diagram of a master control device provided in an embodiment of this application is shown;

[0042] Figure 8 An exemplary structural diagram of a master control device provided in an embodiment of this application is shown. Detailed Implementation

[0043] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.

[0044] Due to various factors, it is difficult for one or more slave devices to synchronously play audio and video played by the master device. Currently, most solutions for synchronizing playback across slave devices insert a delayed timestamp into the playback command sent by the master device. Upon receiving the playback command, each slave device then plays the audio and video uniformly based on the timestamp. This method is highly dependent on the clock accuracy of each device (including the master and slave devices). In actual testing, each device's clock has a deviation, ranging from tens to hundreds or even thousands of milliseconds. Therefore, if the clock deviation between the master and slave devices is significant, this method not only fails to achieve synchronous playback of the master device's audio and video but also exacerbates the desynchronization problem.

[0045] In view of this, embodiments of this application provide a method and apparatus for controlling synchronized playback of slave devices. This method performs clock calibration after the slave devices and master device establish a connection, and before and during synchronized audio and video playback. The calibration takes into account the influence of the network environment. Through repeated cumulative calibrations, synchronized playback of all slave devices is achieved. This method is suitable for scenarios with high sensitivity to synchronized audio and video playback, reducing inconsistencies in synchronized playback of multiple slave devices to a seamless level, thereby improving the user experience.

[0046] The method for controlling slave devices to play synchronously provided in this application is applicable to interactive scenarios where a master device needs to simultaneously control at least one slave device to play the same (local or online) audio and video. See also Figure 1A This is a schematic diagram of an application scenario provided by an embodiment of this application. Figure 1A In this system, the master control device 100 and at least one slave control device 300 (including but not limited to 301-303) communicate through the server 200. The master control device 100 is equipped with a control application and can send control commands (such as play commands, pause commands, etc.). The server 200 is used to forward the control commands to each slave control device. After receiving the control commands, the slave control device 300 synchronously plays the audio and video played by the master control device 100 according to the control commands.

[0047] In some embodiments, the master control device 100 and at least one slave control device 300 can communicate directly, see [link to relevant documentation]. Figure 1B The master control device 100 sends control commands to at least one slave control device 300, and the slave control device 300 synchronously plays the audio and video played by the master control device 100 according to the control commands.

[0048] like Figure 1A and Figure 1B In the application scenario shown, the master control device and the slave control devices can be connected to the same local area network. Optionally, the master control device 100 sends control commands via broadcast, so that all slave control devices 100 connected to the local area network can receive and respond to the control commands in a very short time, without needing to specify the identifier of a specific slave control device 300.

[0049] like Figure 1A and Figure 1B In the application scenario shown, the master control device and the slave control device can be connected to the same wide area network. Optionally, when sending control commands, the master control device 100 needs to specify the identifier of a specific slave control device 300, so that only the specified slave control devices can receive the control command and respond.

[0050] It needs to be explained that, Figure 1A and Figure 1B This is just one example. In addition to a smart TV, the slave device 100 can also be a laptop, desktop computer, smartphone, tablet, VR device, etc. Similarly, the slave device 300 can also be a smart TV, laptop, desktop computer, smartphone, tablet, etc., in addition to a VR device. The server 200 can be a standalone cloud server or a server cluster.

[0051] Based on the above application scenarios Figure 2 An exemplary flowchart of a method for controlling a slave device to play synchronously, provided in an embodiment of this application, is shown. This process is executed by the master device and mainly includes the following steps:

[0052] S201: In response to a connection request from at least one slave device, a connection response message is sent to at least one slave device respectively. The connection response message carries the current time of the master device, so that at least one slave device sets its own time to the current time of the master device according to the connection response message.

[0053] In one optional implementation, during S201, after at least one slave device and the master device connect to the same network, the at least one slave device sends a connection request to the master device. Upon receiving the connection request, the master device includes its current time in the connection response message and forwards it to the at least one slave device through the service center. After receiving the connection response message, each slave device sets its own time to the current time of the master device, thereby achieving initial unification of the time among the slave devices.

[0054] In S201, each slave device aligns its own time with the current time of the master device based on the connection response message. However, since the influence of network factors is not considered, the time at which each slave device receives the connection response message may be inconsistent. Thus, even after each slave device calibrates its own time based on the connection response message, it cannot be guaranteed that the time of each slave device is completely consistent. Therefore, it is necessary to mitigate the influence of network factors.

[0055] S202: Before at least one slave device synchronously plays the target audio and video, a clock correction message is sent to at least one slave device respectively. The clock correction message carries the target average transmission delay, so that at least one slave device can determine its own target clock deviation according to the target average transmission delay.

[0056] To mitigate the impact of network factors, network transmission latency needs to be considered. This application's embodiments employ an additive calculation method when calculating transmission latency, thereby improving the accuracy of latency calculation. See details... Figure 3 :

[0057] S2021: In response to each switching operation on the audio / video playback page, perform the following operations: send a network test message to the service center and receive a network test response message returned by the service center; determine the current network transmission latency based on the sending time of the network test message and the receiving time of the network test response message.

[0058] In the embodiments of this application, each time the main control device switches to the audio / video playback page, it calculates the current network transmission delay by sending a timestamped network test message to the service center and receiving a timestamped network test response message returned by the service center. Specifically, the current transmission delay, denoted as curNetDelay, is obtained by subtracting the sending time of the network test message from the receiving time of the network test response message.

[0059] S2022: Determine the target average transmission delay based on the current transmission delay and the previously determined average transmission delay.

[0060] In S2022, the formula for calculating the target average transmission delay, averageNetDelay, is:

[0061] averageNetDelay=(averageNetDelay′+curNetDelay) / 2 Formula 1

[0062] Here, averageNetDelay′ represents the average transmission delay determined in the last iteration. Optionally, its initial value is 0.

[0063] The target average transmission delay determined by the embodiment of this application through multiple accumulations not only takes into account the influence of the current network environment, but also the influence of the historical network environment, and eliminates the interference of accidental factors on the target average transmission delay, ensuring the stability of the network environment and making the calculation of the target average transmission delay more accurate.

[0064] Optionally, in order to eliminate interference from abnormal networks, after executing S2021 and before executing S2022, the accuracy of the target average transmission delay calculation can be further improved by determining whether the current transmission delay is valid.

[0065] Specifically, the difference between the current transmission delay and the previously determined average transmission delay is calculated. If the difference is greater than the upper limit of the preset delay threshold, or less than the lower limit of the preset delay threshold, it indicates that the current transmission delay error is large and the current transmission delay should be discarded, i.e., it should not be included in the cumulative calculation of the target average transmission delay.

[0066] It should be noted that the number of times the target average transmission delay is accumulated can be set according to actual needs, and this application embodiment does not impose any limiting requirements.

[0067] In one optional implementation, after the target average transmission delay is determined, during step S202, the master control device immediately broadcasts a clock correction message carrying the target average transmission delay. Upon receiving the clock correction message, each slave control device in the network determines its own target clock deviation based on the target average transmission delay.

[0068] Optionally, when the main control device uses the Android system, the clock calibration message content is as follows:

[0069] averageNetDelay=averageNetDelay;

[0070] masterClock=System.currentTimeMillis().

[0071] The currentTimeMillis() function is used to obtain the current time of the Android system.

[0072] S203: In response to the playback operation of the target audio and video, a playback command is sent to at least one slave device. The playback command carries the execution time of the current playback command and the progress offset of the target audio and video, so that at least one slave device can synchronously play the target audio and video according to the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video.

[0073] In the embodiments of this application, when the master control device plays the target audio and video, it sends playback instructions to each slave control device. Considering the impact of network transmission latency, each slave control device needs to play the target audio and video relatively consistently upon receiving the playback instructions. Therefore, when sending the playback instructions, the master control device carries the execution time of the current playback instructions and the progress offset of the target audio and video, so that the slave control devices can synchronously play the same audio and video content based on the average transmission latency of the target and the received playback instructions.

[0074] The execution time of the current playback command, denoted as starAt, represents the execution time of the playback command after the target's average transmission delay. starAt = msg.timeStamp + averageNetDelay, where msg.timeStamp represents the current time of the master device, which is the time the playback command was sent. The progress offset of the target audio / video represents the current playback progress of the target audio / video after the target's average transmission delay, denoted as offset. offset = curPlayProgress_master + averageNetDelay, where curPlayProgress_master represents the current playback progress of the target audio / video.

[0075] It should be noted that for non-play commands, such as pause commands, starAt does not need to be included.

[0076] Typically, audio and video playback has two states: initial playback and resumption from a paused state. For the initial playback state, considering the influence of various slave device system factors, the ability of the audio / video player to start playback after initialization may vary. Therefore, when the target audio / video is in initial playback, playback commands are repeatedly sent to ensure that the audio / video players on each slave device play the same target audio / video content synchronously after initialization. Optionally, the repetition number can be 3 to 5 times.

[0077] In specific implementation, when the target audio and video are initially playing, when executing S203, the master control device repeatedly sends the playback command to each slave control device multiple times, and the time interval between each playback command is Nms, where 200ms≤N≤500ms.

[0078] Optionally, during the playback of the target audio and video, the synchronous playback of each slave device is also affected by network factors, and real-time network transmission latency needs to be considered. Therefore, in the embodiments of this application, when the master device sends a playback command, it also carries the current time of the master device, denoted as msg.timeStamp, which can represent the time when the playback command was sent from the master device. msg.timeStamp is used to update the corrected target clock deviation during the playback of the target audio and video.

[0079] It should be noted that the current time of the master control device is different in different messages and instructions, and the current time of the master control device changes automatically with the system time.

[0080] In the method of controlling the synchronous playback of slave devices executed on the master control device side, timestamps are carried in the messages and instructions sent after the connection is established, before the audio and video playback, and during the audio and video playback, so that each slave control device performs multiple time calibrations, thereby synchronously playing the same content of the target audio and video.

[0081] Corresponding to the main control equipment side, Figure 4 An exemplary embodiment of this application provides a method flow for controlling synchronous playback of slave devices. This process is executed by at least one slave device and mainly includes the following steps:

[0082] S401: Receive the connection response message sent by the master device in response to the connection request, and set the current time of the master device carried in the connection response message to its own time.

[0083] In one optional implementation, after the slave device and the master device connect to the same network, the slave device sends a connection request to the master device through a service center. Upon receiving the connection request, the master device sends a connection response message to the slave device through the service center. This connection response message carries the master device's current time, i.e., the time when the master device sent the connection response message. Upon receiving the connection response message, the slave device sets its own time to the master device's current time, thus completing the initial time synchronization.

[0084] After executing S401, the time of each slave device is uniformly set to the current time of the master device. However, since the influence of network factors is not considered, the time when each slave device receives the connection response message may be inconsistent. Therefore, even after each slave device calibrates its own time according to the connection response message, it cannot be guaranteed that the time of each slave device is completely consistent. Thus, it is necessary to weaken the influence of network factors.

[0085] S402: Before synchronously playing the target audio and video, receive a clock correction message sent by the master control device carrying the target average transmission delay, and determine its own target clock deviation based on the target average transmission delay.

[0086] In the embodiments of this application, before each slave device synchronously plays the target audio and video, in order to mitigate the impact of network factors, the master device determines the target average transmission delay each time and sends the target average transmission delay in a clock correction message to each slave device. The method for determining the target average transmission delay and the content of the clock correction message are described in the aforementioned embodiments and will not be repeated here.

[0087] Each time a slave device receives a clock correction message, it determines its own target clock deviation based on the target average transmission delay. Specifically, first, the slave device determines its real-time deviation based on the time the master device sends the clock correction message and the slave device's current time; then, based on the real-time deviation and the target average transmission delay, it corrects its initial clock deviation to obtain the target clock deviation.

[0088] Taking a clock calibration process as an example, assuming the sending time of the clock calibration message is denoted as masterClock and the current time of the slave device is denoted as slaveClock, then the real-time deviation realDevation = masterClock - slaveClock, and the target clock deviation clockDevation = (clockDevation′ + averageNetDelay + realDevation) / 2, where clockDevation′ is the clock deviation determined in the previous calibration. Optionally, the initial value of clockDevation′ is 0.

[0089] After each clock calibration is completed, each slave device sends its calibration result to the master device through the service center. The master device displays the result, and the controller understands the clock calibration status of each slave device based on the calibration result displayed by the master device. When the preset requirements are met, the target video is played.

[0090] S403: Receives playback instructions sent by the master control device for the target audio and video. The playback instructions carry the execution time of the current playback instructions and the progress offset of the target audio and video.

[0091] In S403, the master control device responds to the playback operation of the target audio / video by sending a playback command to each slave control device. The playback command carries the execution time `starAt` and the progress offset of the target audio / video. Upon receiving the playback command, each slave control device synchronously plays the same target audio / video content according to `starAt` and `offset`.

[0092] Optionally, considering the impact of network factors during the target audio and video playback process, and to improve the synchronization of each slave device, the current time of the master device (msg.timeStamp) can be carried in the playback command to correct the clock of each slave device in real time. In this case, the current time of the master device is the time when the playback command was issued.

[0093] S404: Play the target audio and video synchronously based on the target clock offset, the execution time of the current playback command, and the progress offset of the target audio and video.

[0094] In the embodiments of this application, after receiving a playback command, each slave device parses the playback command to obtain the execution time starAt of the current playback command and the progress offset offset of the target audio and video. Based on starAt and offset, the target audio and video with the same content are played synchronously. See details... Figure 5 :

[0095] S4041: Calculate the second execution time based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device.

[0096] Specifically, the formula for calculating the second execution time, timeToStar, is as follows:

[0097] timeToStar=starAt-(slaveClock+clockDevation) Formula 2

[0098] Here, slaveClock represents the current time of the slave device, which changes with the system time.

[0099] S4042: Determine if the second execution time is greater than 0. If yes, execute S4043; otherwise, execute S4044.

[0100] When timeToStar is greater than 0, it means that the playback command has taken less time to transmit over the network than expected, and the playback command needs to be executed after a delay of timeToStar. When timeToStar is less than or equal to 0, it means that the playback command has taken longer to transmit over the network than the target average transmission time, and the execution time has been missed, so the playback command needs to be executed immediately.

[0101] S4043: Use the progress offset of the target audio / video as the target playback progress.

[0102] When timeToStar is greater than 0, it indicates that a delay of timeToStar is needed before executing the playback command. At this time, each slave device will determine the target playback progress offset of the target audio and video to be the target playback progress of the target video when the playback command is executed, that is:

[0103] setTo = offset;

[0104] Here, setTo represents the target playback progress.

[0105] S4044: Determine the target playback progress based on the progress offset of the target audio and video and the second execution time.

[0106] When timeToStar is less than or equal to 0, it indicates that the playback command needs to be executed immediately. At this time, each slave device determines the target playback progress based on the progress offset of the target audio and video and the second execution time, that is:

[0107] setTo = offset - timeToStar.

[0108] S4045: Determine the progress difference between the target playback progress and its own playback progress.

[0109] Each slave device sends an execution command to the audio / video player, which carries the target playback progress. The audio / video player, based on its own playback progress, determines the progress difference between the two, using the following formula:

[0110] seekDelta=curPlayProgress_slave-setTo Formula 3

[0111] Here, curPlayProgress_slave represents the playback progress of the audio / video player on the slave device, and seekDelta represents the difference between the target playback progress and the playback progress of the audio / video player on the slave device.

[0112] S4046: Determine whether the progress difference is within the preset range. If yes, execute S4047; otherwise, execute S4048.

[0113] When the progress difference is within the preset range, it means that the playback progress of the audio / video player in the slave device is basically consistent with the playback progress of the audio / video player in the master device, and the audio / video player in the slave device can play immediately according to the execution command; when the progress difference is not within the preset range, it means that the playback progress of the audio / video player in the slave device is significantly different from the playback progress of the audio / video player in the master device, and the audio / video player in the slave device needs to play with a delay.

[0114] Optionally, the preset value range is [-10ms, 10ms].

[0115] S4047: Play the audio video immediately according to your playback progress.

[0116] By controlling the progress deviation between each slave device and the master device to within 10ms, the performance of playback command execution is guaranteed, so that users will not feel the phenomenon of asynchronous playback and the user experience is improved.

[0117] S4048: After a second execution time delay, play the target audio and video based on the progress difference.

[0118] When the progress difference is not within the preset range, the clock deviation between each slave device and the master device is reduced by delaying the execution time of the playback command by timeToStar. This ensures that when each slave device plays the target audio and video according to seekDelta, the user will not feel the phenomenon of asynchronous playback, thus improving the user experience.

[0119] Optionally, when the playback command carries the current time (msg.timeStamp) of the master device, the slave devices can also update the target clock offset based on msg.timeStamp during the target audio / video playback. Specifically, each slave device calculates the command transmission time based on its own current time, the target clock offset, and the current time of the master device, using the following formula:

[0120] msgTransTime=slaveClock+clockDevation-msg.timeStamp Formula 4

[0121] Here, slaveClock represents the current time of the slave device itself, which is the time when the playback command is received; clockDevation represents the target clock deviation; and msg.timeStamp represents the current time of the master device, which is the time when the playback command is sent.

[0122] Since clockDevation takes into account the average transmission delay caused by network factors, the msgTransTime of a single playback command is also a relatively average transmission time. In cases of network anomalies, it may be negative, requiring calibration of the target clock deviation. Therefore, after calculating msgTransTime, each slave device further determines whether msgTransTime is less than 0. If so, clockDevation is updated based on msgTransTime; otherwise, clockDevation remains unchanged. The update formula for clockDevation is as follows:

[0123] clockDevation=clockDevation-2*msgTransTime Formula 5

[0124] In the embodiments of this application, during the playback of the target audio and video, the target clock deviation of each slave device is further calibrated by using the current time of the master device carried by the playback command, thereby improving the synchronization of each slave device.

[0125] The method for controlling the synchronous playback of slave devices provided in this application embodiment mainly performs clock calibration in three stages. The first stage is the stage of establishing a connection between each slave device and the master device. In this stage, each slave device sets its own time to the current time of the master device (i.e., the time when the connection response message is sent), thereby completing the initial unification of the time of each slave device. The second stage is the network testing stage. In this stage, the master device determines the average latency (i.e., the target average transmission latency) of the impact of network factors on message and instruction transmission through the interaction process with the service center. The target average transmission latency considers not only the current network environment but also the historical network environment, thereby avoiding the impact of sudden network anomalies on clock calibration and improving the accuracy of calibration. The third stage is the target audio and video playback stage. In this stage, each slave device further calibrates the target clock deviation according to the single transmission time of the playback instruction, and determines the actual execution time of the playback instruction and the target playback progress based on the calibrated target clock deviation, thereby achieving synchronous playback of the same target audio and video. Through the above three-stage cumulative calibration process, the embodiments of this application can achieve synchronized playback of audio and video in a seamless manner, with strong synchronization, effectively reducing the inconsistency of each slave device, and improving the user experience under one-to-many control.

[0126] The following example uses a smart TV as the master control device and a VR device as the slave control device to describe the method flow for controlling synchronous playback on the slave control device provided in this application from the perspective of their interaction. (See also...) Figure 6A to Figure 6C .

[0127] Figure 6A The process of initially unifying the time across various VR devices includes the following steps.

[0128] S601: The VR device sends a connection request to the smart TV.

[0129] S602: After receiving a connection request, the smart TV device sends a connection response message, which carries the current time of the smart TV.

[0130] S603: After receiving the connection response message, the VR device sets its own time to the current time of the smart TV carried in the connection response message.

[0131] See Figure 6B This is the clock calibration process before the target audio / video playback. This process calculates the average transmission latency of the network by accumulating multiple times. Each time the smart TV switches to the audio / video playback page, it performs the following operations:

[0132] S604: The smart TV sends a network test message to the server.

[0133] In this step, the network test message carries a timestamp, which can represent the time when the network test message was sent.

[0134] S605: The smart TV receives the network test response message returned by the server.

[0135] In this step, the network test response message also carries a timestamp, which can characterize the time when the network test response message was received.

[0136] S606: The smart TV determines the current network transmission latency based on the sending time of the network test message and the receiving time of the network test response message.

[0137] Specifically, the current transmission delay curNetDelay = the time to receive the network test response message - the time to send the network test message.

[0138] S607: The smart TV determines whether the current transmission delay is valid. If it is valid, it executes S608; otherwise, it discards the current transmission delay.

[0139] In this step, the smart TV can determine whether the current transmission delay is valid by calculating the delay difference between the current transmission delay and the previously determined average transmission delay. Specifically, if the delay difference is greater than the lower limit of the preset delay threshold and less than the upper limit of the preset delay threshold, it indicates that the current transmission delay error is small and the current transmission delay is valid, and step S608 is executed; otherwise, the current transmission delay is invalid and is discarded directly, meaning it is not included in the cumulative calculation of the target average transmission delay.

[0140] S608: The smart TV determines the target average transmission latency based on the current transmission latency and the previously determined average transmission latency.

[0141] Wherein, the target average transmission delay averageNetDelay = (averageNetDelay′ + curNetDelay) / 2.

[0142] S609: The smart TV sends a clock correction message to the VR device, and the clock correction message carries the target average transmission latency.

[0143] S610: After receiving the clock correction message, the VR device determines the real-time deviation based on the sending time of the clock correction message and the current time of the VR device, and corrects its own initial clock deviation based on the real-time deviation and the target average transmission delay to obtain the target clock deviation.

[0144] Wherein, real-time deviation realDevation = masterClock - slaveClock, and target clock deviation clockDevation = (clockDevation′ + averageNetDelay + realDevation) / 2. Here, masterClock represents the current time of the smart TV when the clock correction message is sent, i.e., the sending time of the clock correction message; slaveClock represents the current time of the VR device when the clock correction message is received, i.e., the receiving time of the clock correction message; and clockDevation′ is the clock deviation determined by the previous correction.

[0145] S611: VR devices report target clock deviations to smart TVs.

[0146] In this step, the VR device reports the corrected target clock deviation to the VR device so that the VR device can determine whether the correction requirements are met based on the reported results.

[0147] S612: Target clock deviation reported by the smart TV display VR device.

[0148] In this step, the smart TV displays the target clock deviation reported by the VR device. Based on the display results, the controller determines whether the target clock deviation of each VR device meets the correction requirements. If not, the correction continues until the correction requirements are met.

[0149] The above S604 to S612 are the time calibration process before the target audio and video are played. This calibration process weakens the impact of network transmission latency on synchronous playback and improves the synchronization of each VR device.

[0150] See Figure 6CDuring the playback of the target audio and video, the target clock deviation was further calibrated, and based on the calibrated target clock deviation, the actual execution time of the playback command and the target playback progress were determined, thereby synchronizing the playback of the same target audio and video content. This mainly includes the following steps:

[0151] S613: The smart TV responds to the playback operation of the target audio and video, determines whether the target audio and video is being played for the first time. If not, it executes S614; if so, it executes S615.

[0152] S614: The smart TV sends a playback command to the VR device.

[0153] In this step, the playback command carries the execution time of the current playback command, the progress offset of the target audio / video, and the current time of the smart TV. Specifically, the execution time of the current playback command, starAt, is equal to msg.timeStamp + averageNetDelay, where msg.timeStamp represents the current time of the smart TV, which is the time the playback command was sent. The progress offset of the target audio / video, offset, is equal to curPlayProgress_master + averageNetDelay, where curPlayProgress_master represents the current playback progress of the target audio / video on the smart TV.

[0154] S615: The smart TV repeatedly sends playback commands to the VR device.

[0155] In this step, the time interval between each playback command is Nms, where 200ms ≤ N ≤ 500ms. Furthermore, the timestamp carried by each playback command automatically increments as the system time changes. That is, each playback command carries the same content, but the values ​​of that content are different. The content carried by each playback command is detailed in S614 and will not be repeated here.

[0156] S616: The VR device parses the received playback command to obtain the execution time of the current playback command, the progress offset of the target audio and video, and the current time of the smart TV (i.e., the time when the playback command was sent).

[0157] S617: The VR device calculates the instruction transmission time based on the VR device's current time, the target clock offset, and the smart TV's current time.

[0158] Wherein, the instruction transmission time msgTransTime = slaveClock + clockDevation - msg.timeStamp, where slaveClock represents the current time of the VR device, i.e. the time of receiving the playback instruction, msg.timeStamp represents the current time of the smart TV, i.e. the time of sending the playback instruction, and clockDevation represents the target clock deviation.

[0159] S618: The VR device determines whether the instruction transmission time is less than 0. If yes, execute S619; otherwise, execute S620.

[0160] Since clockDevation takes into account the average transmission latency affected by network factors, the msgTransTime of a single playback command is also a relatively average transmission time. In cases of network anomalies, it may be negative, in which case the target clock deviation needs to be calibrated.

[0161] S619: The VR device updates the target clock offset based on the instruction transmission time.

[0162] The updated result of the target clock deviation is clockDevation = clockDevation - 2 * msgTransTime.

[0163] S620: The VR device calculates the second execution time based on the execution time of the current playback instruction, the target clock deviation, and the current time of the VR device.

[0164] In this step, the second execution time is the actual execution time of the playback command, and the calculation formula is: timeToStar=starAt-(slaveClock+clockDevation).

[0165] S621: The VR device determines whether the second execution time is greater than 0. If yes, proceed to S622; otherwise, proceed to S623.

[0166] S622: Use the progress offset of the target audio and video as the target playback progress.

[0167] When timeToStar > 0, it means that the playback command needs to be executed after a delay of timeToStar. At this time, the target playback progress setTo = offset.

[0168] S623: Determine the target playback progress based on the progress offset of the target audio and video and the second execution time.

[0169] When timeToStar≤0, it means that the playback command needs to be executed immediately. In this case, the target playback progress setTo = offset - timeToStar.

[0170] S624: The VR device determines the progress difference between the target playback progress and its own playback progress.

[0171] In S624, the VR device sends the target playback progress to its own audio / video player in the execution command. The audio / video player determines the progress difference based on its own playback progress and the target playback progress.

[0172] Specifically, the formula for calculating the progress difference is: seekDelta = curPlayProgress_slave - setTo, where curPlayProgress_slave represents the playback progress of the audio / video player in the VR device, and seekDelta represents the progress difference between the target playback progress and the playback progress of the audio / video player in the VR device.

[0173] S625: The VR device determines whether the progress difference is within the preset range. If it is, execute S626; otherwise, execute S627.

[0174] When the progress difference is within the preset range, it means that the playback progress of the audio and video player in the VR device is basically consistent with the playback progress of the audio and video player in the smart TV, and the audio and video player in the VR device can play immediately according to the execution command; when the progress difference is not within the preset range, it means that the playback progress of the audio and video player in the VR device is significantly different from the playback progress of the audio and video player in the smart TV, and the audio and video player in the VR device needs to delay playback.

[0175] Optionally, the preset value range is [-10ms, 10ms].

[0176] S626: Play the target audio and video immediately according to its own playback progress.

[0177] By controlling the progress deviation between the VR device and the smart TV to within 10ms, the performance of playback command execution is guaranteed, so that users will not feel the phenomenon of asynchronous playback and improve the user experience.

[0178] S627: After the second execution time is delayed, play the target audio and video based on the progress difference.

[0179] When the progress difference is not within the preset range, the clock deviation between each VR device and the smart TV is reduced by delaying the execution time of the playback command by timeToStar. This ensures that when each VR device plays the target audio and video according to seekDelta, the user will not feel the phenomenon of asynchronous playback, thus improving the user experience.

[0180] Based on the same technical concept, this application provides a master control device that can execute the synchronous playback method steps implemented on the master control device side in the aforementioned embodiments and achieve the same effect.

[0181] See Figure 7 The diagram shows the structure of the main control device provided in this application embodiment, which mainly includes a processor 701, a memory 702, an audio / video player 703, and a communication interface 704. The communication interface 704, the audio / video player 703, the memory 702, and the processor 701 are connected via a bus 705.

[0182] The communication interface 704 is used to communicate with slave devices, including data transmission and reception and message transmission and reception;

[0183] The 703 audio / video player is used to play target audio and video;

[0184] The memory 702 stores a computer program, and the processor 701 performs the following operations according to the computer program stored in the memory 702:

[0185] In response to a connection request from at least one slave device, a connection response message is sent to at least one slave device respectively. The connection response message carries the current time of the master device, so that at least one slave device sets its own time to the current time of the master device according to the connection response message.

[0186] Before at least one slave device synchronously plays the target audio and video, a clock correction message is sent to at least one slave device. The clock correction message carries the target average transmission delay, so that at least one slave device can determine its own target clock deviation based on the target average transmission delay.

[0187] In response to the playback operation of the target audio and video, a playback command is sent to at least one slave device. The playback command carries the execution time of the current playback command and the progress offset of the target audio and video, so that at least one slave device can synchronously play the target audio and video according to the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video.

[0188] Optionally, when the target audio / video is in the initial playback state, the processor 701 sends a first playback command to at least one slave device, specifically as follows:

[0189] Playback commands are repeatedly sent to at least one slave device, with a time interval of Nms between each transmission of a playback command, where 200ms ≤ N ≤ 500ms.

[0190] Optionally, the playback command also carries the current time of the master control device, which is used to update the corrected target clock deviation.

[0191] Optionally, before sending clock correction messages to at least one slave device, the processor 701 determines the target average transmission delay in the following manner:

[0192] For each switch operation on the audio / video playback page, perform the following operations:

[0193] Send a network test message to the service center and receive a network test response message from the service center. Determine the current transmission latency of the network based on the sending time of the network test message and the receiving time of the network test response message.

[0194] The target average transmission delay is determined based on the current transmission delay and the previously determined average transmission delay.

[0195] It should be noted that, Figure 7 This is just one example; in addition to the hardware described above, it also includes conventional hardware for interactive devices used for audio and video playback, such as displays, audio processors, video processors, image processors, etc. The audio / video player 703 can be replaced by separate video and audio players.

[0196] Based on the same technical concept, this application provides a slave control device that can execute the synchronous playback method steps implemented on the slave control device side in the aforementioned embodiments and achieve the same effect.

[0197] See Figure 8 The diagram shows the structure of the slave device provided in this application embodiment, which mainly includes a processor 801, a memory 802, an audio / video player 803, and a communication interface 804. The communication interface 804, the audio / video player 803, the memory 802, and the processor 801 are connected via a bus 805.

[0198] The communication interface 804 is used to communicate with the main control device, including data transmission and reception and message transmission and reception;

[0199] The 803 audio / video player is used to play target audio and video;

[0200] The memory 802 stores a computer program, and the processor 801 performs the following operations according to the computer program stored in the memory 802:

[0201] Receive the connection response message sent by the master device in response to the connection request, and set the current time of the master device carried in the connection response message to its own time;

[0202] Before synchronously playing the target audio and video, it receives a clock correction message sent by the master control device, which carries the target's average transmission delay, and determines its own target clock deviation based on the target's average transmission delay.

[0203] Receive playback instructions sent by the main control device for the target audio and video. The playback instructions carry the execution time of the current playback instructions and the progress offset of the target audio and video.

[0204] Based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video, the target audio and video are played synchronously.

[0205] Optionally, the processor 801 synchronously plays the target audio and video based on the target clock offset, the execution time of the current playback instruction, and the progress offset of the target audio and video. Specifically, the operation is as follows:

[0206] Calculate the second execution time based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device;

[0207] If the second execution time is greater than 0, the progress offset of the target audio and video is used as the target playback progress; otherwise, the target playback progress is determined based on the progress offset of the target audio and video and the second execution time.

[0208] Determine the difference between the target playback progress and the current playback progress;

[0209] If the progress difference is within the preset range, the target audio and video will be played immediately according to its own playback progress; otherwise, after a second execution time delay, the target audio and video will be played according to the progress difference.

[0210] Optionally, if the playback command also carries the current time of the master device, then before calculating the second execution time, processor 801 also executes:

[0211] Calculate the instruction transmission time based on the current time of the slave device, the target clock deviation, and the current time of the master device;

[0212] When the instruction transmission time is less than 0, the target clock offset is updated according to the instruction transmission time.

[0213] Optionally, the processor 801 determines its own target clock deviation based on the target's average transmission delay, specifically as follows:

[0214] The real-time deviation is determined based on the time of the clock correction message transmission and the current time of the slave device.

[0215] Based on the real-time deviation and the target's average transmission delay, the initial clock deviation is corrected to obtain the target clock deviation.

[0216] It should be noted that, Figure 8 This is just one example; in addition to the hardware described above, it also includes conventional hardware for interactive devices used for audio and video playback, such as displays, audio processors, video processors, image processors, etc. The audio / video player 803 can be replaced by separate video and audio players.

[0217] Examples of this application Figure 7 and Figure 8 The processor involved can be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. The processor can also be a combination that implements computational functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc. The memory can be integrated into the processor or disposed separately from the processor.

[0218] This application also provides a computer-readable storage medium for storing instructions that, when executed, can perform the methods of the foregoing embodiments.

[0219] This application also provides a computer program product for storing a computer program that performs the methods described in the foregoing embodiments.

[0220] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

[0221] For ease of explanation, the above description has been provided in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or to limit the embodiments to the specific forms disclosed above. Various modifications and variations can be obtained based on the above teachings. The selection and description of the above embodiments are for the purpose of better explaining the principles and practical applications, thereby enabling those skilled in the art to better utilize the described embodiments and various different variations of embodiments suitable for specific use considerations.

Claims

1. A method for controlling the synchronous playback of slave devices, characterized in that, Applied to at least one slave device, including: Receive the connection response message sent by the master control device in response to the connection request, and set the current time of the master control device carried in the connection response message to its own time; Before synchronously playing the target audio and video, the system receives a clock correction message carrying the target average transmission delay sent by the main control device, and determines its own target clock deviation based on the target average transmission delay. The system receives a playback command sent by the main control device for the target audio and video. The playback command carries the execution time of the current playback command and the progress offset of the target audio and video. The execution time of the current playback command is determined based on the sending time of the playback command sent by the main control device and the target average transmission delay. The progress offset of the target audio and video is determined based on the current playback progress of the target audio and video and the target average transmission delay when the main control device sends the playback command. Based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video, the target audio and video are played synchronously. The step of synchronously playing the target audio and video based on the target clock offset, the execution time of the current playback command, and the progress offset of the target audio and video includes: The second execution time is calculated based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device; the second execution time represents the difference between the transmission time of the playback instruction in the network and the expected transmission time, which is determined based on the execution time of the current playback instruction. If the second execution time is greater than 0, the progress offset of the target audio and video is taken as the target playback progress; otherwise, the target playback progress is determined based on the progress offset of the target audio and video and the second execution time. Determine the progress difference between the target playback progress and its own playback progress; If the progress difference is within a preset range, the target audio and video will be played immediately according to its own playback progress; otherwise, after a delay of the second execution time, the target audio and video will be played according to the progress difference.

2. The method as described in claim 1, characterized in that, If the playback command also carries the current time of the main control device, then before calculating the second execution time, the method further includes: The instruction transmission time is calculated based on the current time of the slave device, the target clock deviation, and the current time of the master device. When the instruction transmission time is less than 0, the target clock offset is updated according to the instruction transmission time.

3. The method as described in claim 1 or 2, characterized in that, The step of determining its own target clock deviation based on the target average transmission delay includes: The real-time deviation is determined based on the sending time of the clock correction message and the current time of the slave device; Based on the real-time deviation and the target average transmission delay, the initial clock deviation is corrected to obtain the target clock deviation.

4. A method for controlling the synchronous playback of slave devices, characterized in that, Applied to main control equipment, including: In response to a connection request from at least one slave device, a connection response message is sent to each of the slave devices, the connection response message carrying the current time of the master device, so that each of the slave devices sets its own time to the current time of the master device according to the connection response message; Before at least one of the slave devices synchronously plays the target audio and video, a clock correction message is sent to at least one of the slave devices respectively. The clock correction message carries the target average transmission delay, so that at least one of the slave devices can determine its own target clock deviation according to the target average transmission delay. In response to a playback operation of the target audio / video, a playback command is sent to at least one of the slave devices. The playback command carries the execution time of the current playback command and the progress offset of the target audio / video, so that at least one of the slave devices synchronously plays the target audio / video based on the target clock offset, the execution time of the current playback command, and the progress offset of the target audio / video. The execution time of the current playback command is determined based on the sending time of the playback command by the master device and the target average transmission delay. The progress offset of the target audio / video is determined based on the current playback progress of the target audio / video and the target average transmission delay when the master device sends the playback command. The slave device synchronously plays the target audio and video based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video, including: The second execution time is calculated based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device; the second execution time represents the difference between the transmission time of the playback instruction in the network and the expected transmission time, which is determined based on the execution time of the current playback instruction. If the second execution time is greater than 0, the progress offset of the target audio and video is taken as the target playback progress; otherwise, the target playback progress is determined based on the progress offset of the target audio and video and the second execution time. Determine the progress difference between the target playback progress and its own playback progress; If the progress difference is within a preset range, the target audio and video will be played immediately according to its own playback progress; otherwise, after a delay of the second execution time, the target audio and video will be played according to the progress difference.

5. The method as described in claim 4, characterized in that, When the target audio / video is in the initial playback state, sending a first playback command to at least one of the slave devices includes: The playback command is repeatedly sent to at least one of the slave devices multiple times, with a time interval of Nms and 200ms between each transmission of the playback command. N 500ms.

6. The method as described in claim 4, characterized in that, The playback command also carries the current time of the main control device, which is used to update the corrected target clock deviation.

7. The method as described in claim 4, characterized in that, Before sending clock correction messages to at least one of the slave devices, the target average transmission delay is determined by the following method: For each switch operation on the audio / video playback page, perform the following operations: Send a network test message to the service center and receive a network test response message returned by the service center. Determine the current transmission latency of the network based on the sending time of the network test message and the receiving time of the network test response message. The target average transmission delay is determined based on the current transmission delay and the previously determined average transmission delay.

8. A slave control device, characterized in that, It includes a processor, a memory, an audio / video player, and a communication interface, wherein the communication interface, the audio / video player, the memory, and the processor are connected via a bus. The audio and video player is used to play the target audio and video; The communication interface is used to communicate with the main control device; The memory stores a computer program, and the processor performs the following operations according to the computer program: Receive the connection response message sent by the master control device in response to the connection request, and set the current time of the master control device carried in the connection response message to its own time; Before synchronously playing the target audio and video, the system receives a clock correction message carrying the target average transmission delay sent by the main control device, and determines its own target clock deviation based on the target average transmission delay. The system receives a playback command sent by the main control device for the target audio and video. The playback command carries the execution time of the current playback command and the progress offset of the target audio and video. The execution time of the current playback command is determined based on the sending time of the playback command sent by the main control device and the target average transmission delay. The progress offset of the target audio and video is determined based on the current playback progress of the target audio and video and the target average transmission delay when the main control device sends the playback command. Based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video, the target audio and video are played synchronously. The processor synchronously plays the target audio and video based on the target clock offset, the execution time of the current playback instruction, and the progress offset of the target audio and video. Specifically, the operation is as follows: The second execution time is calculated based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device; the second execution time represents the difference between the transmission time of the playback instruction in the network and the expected transmission time, which is determined based on the execution time of the current playback instruction. If the second execution time is greater than 0, the progress offset of the target audio and video is taken as the target playback progress; otherwise, the target playback progress is determined based on the progress offset of the target audio and video and the second execution time. Determine the progress difference between the target playback progress and its own playback progress; If the progress difference is within a preset range, the target audio and video will be played immediately according to its own playback progress; otherwise, after a delay of the second execution time, the target audio and video will be played according to the progress difference.

9. A master control device, characterized in that, It includes a processor, a memory, an audio / video player, and a communication interface, wherein the communication interface, the audio / video player, the memory, and the processor are connected via a bus. The communication interface is used to communicate with at least one slave device; The audio and video player is used to play the target audio and video; The memory stores a computer program, and the processor performs the following operations according to the computer program: In response to a connection request from at least one slave device, a connection response message is sent to each of the slave devices, the connection response message carrying the current time of the master device, so that each of the slave devices sets its own time to the current time of the master device according to the connection response message; Before at least one of the slave devices synchronously plays the target audio and video, a clock correction message is sent to at least one of the slave devices respectively. The clock correction message carries the target average transmission delay, so that at least one of the slave devices can determine its own target clock deviation according to the target average transmission delay. In response to a playback operation of the target audio / video, a playback command is sent to at least one of the slave devices. The playback command carries the execution time of the current playback command and the progress offset of the target audio / video, so that at least one of the slave devices synchronously plays the target audio / video based on the target clock offset, the execution time of the current playback command, and the progress offset of the target audio / video. The execution time of the current playback command is determined based on the sending time of the playback command by the master device and the target average transmission delay. The progress offset of the target audio / video is determined based on the current playback progress of the target audio / video and the target average transmission delay when the master device sends the playback command. The slave device synchronously plays the target audio and video based on the target clock deviation, the execution time of the current playback command, and the progress offset of the target audio and video. Specifically, the operation is as follows: The second execution time is calculated based on the execution time of the current playback instruction, the target clock deviation, and the current time of the slave device; the second execution time represents the difference between the transmission time of the playback instruction in the network and the expected transmission time, which is determined based on the execution time of the current playback instruction. If the second execution time is greater than 0, the progress offset of the target audio and video is taken as the target playback progress; otherwise, the target playback progress is determined based on the progress offset of the target audio and video and the second execution time. Determine the progress difference between the target playback progress and its own playback progress; If the progress difference is within a preset range, the target audio and video will be played immediately according to its own playback progress; otherwise, after a delay of the second execution time, the target audio and video will be played according to the progress difference.

Citation Information

Patent Citations

  • Method for synchronously playing multiple playing devices and playing device

    CN108200457A

  • Method and system for video synchronization among multiple devices

    CN111954050A

  • Synchronous playing method, device and system and computer equipment

    CN113179441A

  • Lip synchronous method for multimedia real-time transmission in packet network and apparatus thereof

    CN1949879A