Clock synchronization method, device, electronic device and readable storage medium
In the sound playback scenario, the information broadcasting and feedback mechanism between the main control device and the equipment to be controlled is calculated and adjusted, and the clock of the equipment to be controlled is solved, the problem that the crystal oscillator time axis of each device cannot ensure the consistent actual playback delay, and the synchronization of the equipment to be controlled and the equipment to be controlled is achieved.
Patent Information
- Application Number
- CN202211269297.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-17
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2042-10-17
AI Technical Summary
In the sound playback scenario, synchronizing the crystal oscillator timeline of each device cannot ensure the consistent actual playback delay, resulting in the inconsistent sound time of different devices being emitted.
The main control device broadcasts information to the equipment to be controlled and receives feedback information, calculates the time axis error and propagation delay of each equipment to be controlled, and adjusts the clock of the equipment to be controlled to maintain synchronization with the clock of the main control device.
The transmitting timeline of the device to be controlled and the main control device is effectively synchronized to ensure that the time of transmitting sound remains consistent, and solve the asynchronous problem caused by inconsistent delays.
Smart Images

Figure CN115833984B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of wireless communications, and in particular to a clock synchronization method, device, electronic device, and readable storage medium. Background Art
[0002] The existing time synchronization function is mainly based on WiFi or other radio technologies. It is relatively mature and can achieve high-precision time synchronization, and the sampling point error after synchronization is small. However, in some scenarios, especially in sound playback scenarios, synchronizing the crystal oscillator time axis of each device is not the ultimate goal, because in actual scenarios, there is still a certain delay between when the device issues a play command and when the player actually plays the ultrasonic wave, and this delay is not equal for different devices. Therefore, even if the crystal oscillator time axis of the device is synchronized, the ultrasonic wave played in the actual scenario may still be out of sync. Summary of the invention
[0003] In order to overcome the problems existing in the related art, the present disclosure provides a clock synchronization method, device, electronic device and readable storage medium.
[0004] According to a first aspect of an embodiment of the present disclosure, there is provided a clock synchronization method, which is applied to a master control device, including: broadcasting information to a device to be controlled, and receiving feedback information of the information; determining a time axis error and a propagation delay corresponding to each device to be controlled through the information and the feedback information; the time axis error is a time axis error between the device to be controlled and the master control device, and the propagation delay is a propagation delay of data on a path between the device to be controlled and the master control device; and controlling the clock of the corresponding device to be controlled to keep it synchronized with the clock of the master control device according to the time axis error and the propagation delay.
[0005] Optionally, the time axis error and propagation delay corresponding to each of the devices to be controlled are determined by the information and the feedback information, including: assigning a corresponding temporary IP address and time slot to each of the devices to be controlled; broadcasting first information to the devices to be controlled according to the temporary IP address, and recording the first time of broadcasting the first information; the first information includes the name of each of the devices to be controlled and the time slot of each of the devices to be controlled; the first information is used to instruct the device to be controlled to send second information to the master control device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information.
[0006] Optionally, the determining of the time axis error and propagation delay corresponding to each of the devices to be controlled by the information and the feedback information also includes: receiving the second information sent by each of the devices to be controlled in response to the first information according to the time slot, and recording the fourth time when the second information is received; receiving the third information sent by each of the devices to be controlled according to the time slot; the third information includes a second time and a third time, the second time being the time when the device to be controlled receives the first information, and the third time being the time when the microphone receives the second information; and calculating the time axis error and the propagation delay corresponding to each of the devices to be controlled according to the first time, the second time, the third time and the fourth time.
[0007] Optionally, the calculation method of the time axis error and the propagation delay includes:
[0008] Delay=[(T2-T1)+(T4-T3)] / 2
[0009] Offset=[(T2-T1)-(T4-T3)] / 2
[0010] Among them, Delay is the propagation delay, Offset is the time axis error, T1 is the first time, T2 is the second time, T3 is the third time, and T4 is the fourth time.
[0011] Optionally, controlling the clock of the corresponding device to be controlled according to the time axis error and the propagation delay to keep it synchronized with the clock of the master control device includes: broadcasting the time axis error and the propagation delay corresponding to each device to be controlled; the time axis error and the propagation delay are used to instruct the device to be controlled to adjust its own time axis; and receiving a confirmation signal of completing clock synchronization sent by each device to be controlled.
[0012] Optionally, the receiving the third information sent by each of the devices to be controlled includes: receiving the third information sent by each of the devices to be controlled via ultrasonic data transmission technology.
[0013] According to a second aspect of an embodiment of the present disclosure, a clock synchronization method is provided, comprising: receiving information broadcast by the master control device, and sending feedback information to the master control device in response to the information, so as to obtain a corresponding time axis error and a propagation delay; the information is generated by the master control device according to the unique identifier in the data packet of each device to be controlled; and controlling the clock of the device to be controlled to keep it synchronized with the clock of the master control device according to the time axis error and the propagation delay.
[0014] Optionally, the method of receiving information broadcast by a master control device and sending feedback information to the master control device in response to the information to obtain the corresponding time axis error and propagation delay includes: receiving first information broadcast by the master control device according to a temporary IP address of the device to be controlled; the first information includes the name of each of the devices to be controlled and the time slot of each of the devices to be controlled; the first information is used to instruct the device to be controlled to send second information to the master control device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information; the temporary IP address is allocated by the master control device according to the unique identifier of the device to be controlled.
[0015] Optionally, the method of receiving information broadcast by a master control device and sending feedback information to the master control device in response to the information to obtain the corresponding time axis error and propagation delay also includes: sending second information to the master control device according to the time slot; the second information is feedback information of the device to be controlled to the first information; the time slot is allocated by the master control device according to the unique identifier of the device to be controlled; sending third information of the device to be controlled to the master control device according to the time slot; the third information includes a second time and a third time; the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone receives the second information; receiving the corresponding time axis error and the propagation delay broadcast by the master control device.
[0016] Optionally, controlling the clock of the device to be controlled to keep it synchronized with the clock of the master device according to the time axis error and the propagation delay includes: adjusting its own time axis according to the received time axis error and the propagation delay to keep it synchronized with the clock of the master device; and sending a confirmation signal of completing the clock synchronization to the master device when the clock synchronization is completed.
[0017] Optionally, sending the second time and the third time of the device to be controlled to the master control device includes: sending the second time and the third time of the device to be controlled to the master control device by using ultrasonic data transmission technology.
[0018] According to a third aspect of an embodiment of the present disclosure, a clock synchronization device is provided, which is applied to a master control device, including: a transmission module, configured to broadcast information to a device to be controlled, and receive feedback information of the information; a first processing module, configured to determine a time axis error and a propagation delay corresponding to each device to be controlled through the information and the feedback information; the time axis error is a time axis error between the device to be controlled and the master control device, and the propagation delay is a propagation delay of data on a path between the device to be controlled and the master control device; a first control module, configured to control the clock of the corresponding device to be controlled to keep it synchronized with the clock of the master control device according to the time axis error and the propagation delay.
[0019] According to a fourth aspect of an embodiment of the present disclosure, there is provided a clock synchronization device, which is applied to a device to be controlled, and includes: a second processing module, configured to obtain a corresponding time axis error and propagation delay by receiving information broadcast by the master control device and sending feedback information to the master control device in response to the information; the information is generated by the master control device according to the unique identifier in the data packet of each device to be controlled; and a second control module, configured to control the clock of the device to be controlled to keep it synchronized with the clock of the master control device according to the time axis error and the propagation delay.
[0020] According to a fifth aspect of an embodiment of the present disclosure, an electronic device is provided, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute the executable instructions to implement the steps of the clock synchronization method provided in the first aspect or the second aspect.
[0021] According to a sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, on which computer program instructions are stored. When the computer program instructions are executed by a processor, the steps of the clock synchronization method provided in the first aspect or the second aspect of the present disclosure are implemented.
[0022] The technical solution provided by the embodiments of the present disclosure may include the following beneficial effects: the master device determines the device to be controlled through a wireless transmission protocol, and determines the time axis error and propagation delay corresponding to each device to be controlled by broadcasting information to the device to be controlled and receiving feedback information of the information, wherein the time axis error is the time axis error between the device to be controlled and the master device, and the propagation delay is the propagation delay of data on the path between the device to be controlled and the master device, and the clock of the corresponding device to be controlled is kept synchronized with the clock of the master device according to the time axis error and the propagation delay; thereby effectively synchronizing the transmitting end time axis of the device to be controlled and the master device instead of the local crystal oscillator time axis, so that the time of sound emission of the device to be controlled and the master device is kept synchronized.
[0023] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.
[0025] Figure 1 It is a schematic diagram of an application scenario of a clock synchronization method shown in an exemplary embodiment of the present disclosure.
[0026] Figure 2 The figure is a flow chart of a clock synchronization method shown in an exemplary embodiment of the present disclosure.
[0027] Figure 3 is a flow chart of another clock synchronization method according to an exemplary embodiment of the present disclosure.
[0028] Figure 4 is a flowchart of sub-step S22 shown in an exemplary embodiment of the present disclosure.
[0029] Figure 5 The figure is a schematic diagram of the communication flow between a master control device and a device to be controlled, shown in an exemplary embodiment of the present disclosure.
[0030] Figure 6 is a flow chart of another clock synchronization method according to an exemplary embodiment of the present disclosure.
[0031] Figure 7 is a flowchart of sub-step S61 shown in an exemplary embodiment of the present disclosure.
[0032] Figure 8 The invention is a block diagram showing a clock synchronization device according to an exemplary embodiment.
[0033] Fig. 9 is a block diagram of another clock synchronization device according to an exemplary embodiment.
[0034] Fig.10 It is a block diagram of a device according to an exemplary embodiment. DETAILED DESCRIPTION
[0035] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0036] It is to be understood that in the present disclosure, "plurality" refers to two or more than two, and other quantifiers are similar thereto. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are in an "or" relationship. The singular forms "a", "the" and "the" are also intended to include plural forms, unless the context clearly indicates other meanings.
[0037] It is further understood that the terms "first", "second", etc. are used to describe various information, but such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other, and do not indicate a specific order or degree of importance. In fact, the expressions "first", "second", etc. can be used interchangeably. For example, without departing from the scope of the present disclosure, the first information can also be referred to as the second information, and similarly, the second information can also be referred to as the first information.
[0038] It is further understood that, although the operations are described in a specific order in the drawings in the embodiments of the present disclosure, it should not be understood as requiring the operations to be performed in the specific order shown or in a serial order, or requiring the execution of all the operations shown to obtain the desired results. In certain environments, multitasking and parallel processing may be advantageous.
[0039] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.
[0040] In some scenarios, especially in sound playback scenarios, synchronizing the crystal oscillator time axis of each device does not enable synchronous playback of each device, because there is a certain delay between the device issuing a playback command and the player actually playing the sound, and this delay is not equal for different devices. For example, in the following scenarios:
[0041] 1. Audio relay;
[0042] There are two independent devices: a mobile phone and a speaker. The mobile phone is playing an audio file and is close to the speaker. After the speaker recognizes that the mobile phone is close, it takes over to play the audio file, and the mobile phone stops playing the audio.
[0043] 2. Full-scenario broadcast control, combining left and right channels between different devices;
[0044] There are two independent devices: a mobile phone and a speaker. The mobile phone plays the left channel of the audio file, and the speaker plays the right channel of the audio file. Considering that there are different delays from when different devices issue a play command to when the play thread actually plays, it is necessary to synchronize the play threads of the two devices.
[0045] 3. Sound collection;
[0046] In some sound collection scenarios, such as sound source production, it is necessary to synchronize the receiving threads of collected sounds from different devices to the playback threads.
[0047] Figure 1 FIG. 1 is a schematic diagram of an application scenario of a clock synchronization method shown in an exemplary embodiment of the present disclosure. Figure 1 As shown, the application scenario includes a system architecture 100, which may include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.
[0048] The terminal devices 101, 102, 103 interact with the server 105 through the network 104 to receive or send information, etc. Various communication client applications may be installed on the terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, reading applications, etc. The terminal devices 101, 102, 103 may be at least one of a smart phone, a laptop computer, a desktop computer, a tablet computer, a smart speaker, and a smart robot.
[0049] It should be noted that the server 105 can be hardware or software. When the server 105 is hardware, it can be implemented as a distributed server 105 cluster consisting of multiple servers 105, or it can be implemented as a single server 105. When the server 105 is software, it can be implemented as multiple software or software modules (for example, software or software modules for providing distributed services), or it can be implemented as a single software or software module. No specific limitation is made here.
[0050] It should also be noted that the clock synchronization method provided in the embodiments of the present disclosure can be executed by a server, or by a terminal device, or by a server and a terminal device in cooperation with each other. Accordingly, the various parts (such as various units, sub-units, modules, and sub-modules) included in the clock synchronization device can be all set in the server, or all set in the terminal device, or can be set in the server and the terminal device respectively.
[0051] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0052] Figure 2 is a flow chart of a clock synchronization method according to an exemplary embodiment. Figure 2 As shown, the clock synchronization method is used for a master control device, and exemplary, it can be selected Figure 1 Any one of the terminal devices shown is used as the master device, and the remaining terminal devices are used as the devices to be controlled. Clock synchronization includes the following steps:
[0053] In step S11, information is broadcast to the device to be controlled, and feedback information of the information is received.
[0054] The master device first determines the device to be controlled through a wireless transmission protocol, and the wireless transmission protocol may be, but is not limited to, Bluetooth, sound wave, WiFi and other wireless transmission protocols. Determining the device to be controlled through the wireless transmission protocol may be to obtain a data packet broadcasted by the device to be controlled through the wireless transmission protocol, and determine the device to be controlled according to a unique identifier in the data packet broadcasted by each device to be controlled, such as an IP address.
[0055] Obtain the data packets broadcast by each device to be controlled, determine the information to be broadcast to the device to be controlled and the feedback information received based on the unique identifier parsed from the data packet, and record the information sending time, information receiving time, feedback information sending time and feedback information receiving time, and obtain the corresponding time axis error and propagation delay based on the information sending time, information receiving time, feedback information sending time and feedback information receiving time.
[0056] In step S12, the time axis error and propagation delay corresponding to each device to be controlled are determined through the information and feedback information.
[0057] The time axis error is the time axis error between the device to be controlled and the master device, and the propagation delay is the propagation delay of data on the path between the device to be controlled and the master device.
[0058] In step S13, the clock of the corresponding device to be controlled is controlled to be synchronized with the clock of the master device according to the time axis error and the propagation delay.
[0059] After the master device calculates the time axis error and propagation delay corresponding to each device to be controlled, it broadcasts the time axis error and propagation delay to the corresponding device to be controlled. The device to be controlled adjusts its own time axis according to the time axis error and propagation delay, so that the clock of the device to be controlled is synchronized with the clock of the master device. This effectively synchronizes the transmitting end time axis of the device to be controlled with the master device instead of the local crystal oscillator time axis, so that the time of sound emission of the device to be controlled and the master device is synchronized.
[0060] See also Figure 3 , Figure 3 The present invention is a flowchart of another clock synchronization method according to an exemplary embodiment of the present invention.
[0061] It should be noted that Figure 3 The clock synchronization method shown is similar to Figure 2 The implementation method of the clock synchronization method shown in the figure is consistent with the content, and is used for a master control device. For example, it can be selected Figure 1 Any one of the terminal devices shown is used as the master control device, and the remaining terminal devices are used as the devices to be controlled. The master control device and the devices to be controlled are not time synchronized, and each terminal device uses an independent sound wave transmitter and an independent sound wave receiver. Since there is an inevitable time axis error between the actual time when the sound wave transmitter of the terminal device transmits the sound wave and the indicated time when the terminal device indicates that the transmitter transmits the sound wave, on the other hand, there is a millisecond error in the Internet time service, which cannot meet the actual production needs. Therefore, even after the time axis is synchronized through the Internet time service or WiFi, the actual time when each terminal device in the distributed network transmits the sound wave is still not uniform. Therefore, it is necessary to synchronize the time axis of each terminal device in the distributed network through a clock synchronization method. Figure 3 For reference not mentioned in Figure 2 The description will not be repeated here. Figure 3 The clock synchronization method shown includes the following steps:
[0062] In step S21, information is broadcast to the device to be controlled, and feedback information of the information is received.
[0063] The master device selected from the terminal devices is used as the synchronization clock source and is regarded as the master end.
[0064] The master control device first determines the device to be controlled through a wireless transmission protocol. The wireless transmission protocol can be but not limited to Bluetooth, sound waves, WiFi and other wireless transmission protocols. Determining the device to be controlled through a wireless transmission protocol includes: obtaining a data packet broadcast by the device to be controlled through a wireless transmission protocol, and determining the device to be controlled according to a unique identifier in the data packet broadcast by each device to be controlled. Exemplarily, the master control device receives a data packet broadcast by each device to be controlled through a wireless transmission protocol, and parses the data packet. The data packet includes a unique identifier of the device to be controlled. The unique identifier is an identifier that can uniquely determine the device to be controlled and is used to distinguish different devices to be controlled. The unique identifier can be but not limited to an IP address, a media access control (MAC) address, etc. Taking the IP address as an example for explanation, the master control device receives the IP address in the data packet broadcast by the device to be controlled. One device to be controlled corresponds to one IP address, so the device to be controlled and the number of devices to be controlled can be determined according to the received IP address.
[0065] Obtain the data packets broadcast by each device to be controlled, determine the information to be broadcast to the device to be controlled and the feedback information received based on the unique identifier parsed from the data packet, and record the information sending time, information receiving time, feedback information sending time and feedback information receiving time, and obtain the corresponding time axis error and propagation delay based on the information sending time, information receiving time, feedback information sending time and feedback information receiving time.
[0066] In step S22, the time axis error and propagation delay corresponding to each device to be controlled are determined through the information and feedback information.
[0067] The time axis error is the time axis error between the device to be controlled and the master device, and the propagation delay is the propagation delay of data on the path between the device to be controlled and the master device.
[0068] It should be noted that step S22 also includes sub-steps S221, S222, S223, S224 and S225. The specific method of obtaining the time axis error and propagation delay will be described in detail in the sub-steps of step S22. Figure 4 , Figure 4 is a flowchart of sub-step S22 shown in an exemplary embodiment of the present disclosure.
[0069] In sub-step S221, a corresponding temporary IP address and time slot are allocated to each device to be controlled.
[0070] After the master device receives the data packets broadcast by each device to be controlled, it parses the unique identifier in the data packet, such as the IP address, determines the device to be controlled and the number of devices to be controlled based on the received IP address, and then allocates a corresponding temporary IP address, sound wave frequency band and time slot to each device to be controlled; it should be noted that the temporary IP address is an address temporarily set by the master device to distinguish each device to be controlled. The characteristic of the temporary IP address is that it is set once and used once, and the temporary IP address occupies less space than the IP address. When transmitting the temporary IP address, the time required is also less than the IP address; the sound wave frequency band is the sound wave frequency band allocated by the master device to each device to be controlled, and each device to be controlled can broadcast information to the master device through different sound wave frequency bands; the time slot is the time slot allocated by the master device to each device to be controlled, so that each device to be controlled can send feedback information to the master device according to the time slot.
[0071] See also Figure 5 , Figure 5 The figure is a schematic diagram of the communication flow between a master control device and a device to be controlled, shown in an exemplary embodiment of the present disclosure. Figure 5The mobile phone in the smart device group can be used as the master control device, and each smart device in the smart device group can be used as a controlled device. The mobile phone and each smart device transmit data through wireless transmission protocols such as Bluetooth, sound waves, and WiFi. When the user opens the mobile phone interface, the mobile phone will send a wake-up signal. The wake-up information is used to wake up each smart device, so that each smart device broadcasts a data packet containing an IP address. The mobile phone traverses all smart devices in the local area network to obtain the IP address of each smart device in the smart device group. Then the mobile phone generates a temporary IP address, sound wave frequency band and time slot based on the IP address of each smart device, and broadcasts the generated temporary IP address, sound wave frequency band and time slot to each smart device.
[0072] In sub-step S222, first information is broadcast to the device to be controlled according to the temporary IP address, and the first time of broadcasting the first information is recorded.
[0073] The master control device broadcasts the first information to each device to be controlled according to the temporary IP address of each device to be controlled, and records the first time of broadcasting the first information; the first information includes the name of each device to be controlled and the time slot of each device to be controlled, so that each device to be controlled can send feedback information of the first information to the master control device according to the time slot, and the name of the device to be controlled can be the temporary IP address of the device to be controlled.
[0074] The first information is used to instruct the controlled device to send the second information to the main control device and the microphone of the controlled device in response to the first information. The second information is the feedback information of the first information, and the microphone is the sound wave transmitter of the controlled device. The controlled device records the time when the controlled device receives the first information as the second time, records the time when the microphone receives the second information as the third time, and sends the second time and the third time to the main control device according to the time slot.
[0075] In sub-step S223, second information sent by each device to be controlled in response to the first information is received according to the time slot, and a fourth time when the second information is received is recorded.
[0076] The main control device receives the second information sent by each device to be controlled in response to the first information, and records the time when the second information is received as the fourth time; the second information is feedback information of the first information, and the second information can be used to instruct the microphone to emit sound waves.
[0077] In sub-step S224, the third information sent by each device to be controlled is received according to the time slot.
[0078] The third information includes a second time and a third time, the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone receives the second information.
[0079] Because each device to be controlled sends the third information to the master device in its own time slot, which is a time division multiplexing method, the master device receives the second time and third time of different devices to be controlled in different time slots. In the time synchronization process, it is ensured that a single device to be controlled is not interfered by the sound waves sent by other devices to be controlled.
[0080] In one embodiment, ultrasonic data transmission technology can be used to receive the third information sent by each device to be controlled, that is, the third information is transmitted using sound waves. Since the devices to be controlled use time division multiplexing to send the third information, the sound waves sent between the devices to be controlled are in different time slots, so that the sound waves of the devices to be controlled do not interfere with each other.
[0081] In sub-step S225, the time axis error and propagation delay corresponding to each device to be controlled are calculated respectively according to the first time, the second time, the third time and the fourth time.
[0082] The calculation of time axis error and propagation delay can be done using a well-known and recognized time synchronization protocol, namely the IEEE1588 time synchronization principle. IEEE 1588 is a precision time protocol (PTP) used to synchronize the clocks of various devices in a computer network. In a local area network, it can control the clock accuracy within the sub-microsecond range, making it suitable for measurement and control systems. Its core synchronization principle is the PTP synchronization principle.
[0083] Based on the IEEE1588 time synchronization principle, the master device calculates the time axis error and propagation delay corresponding to each device to be controlled according to the first time, the second time, the third time and the fourth time. The calculation method includes:
[0084] Delay=[(T2-T1)+(T4-T3)] / 2
[0085] Offset=[(T2-T1)-(T4-T3)] / 2
[0086] Among them, Delay is the propagation delay, Offset is the time axis error, T1 is the first time, T2 is the second time, T3 is the third time, and T4 is the fourth time.
[0087] In step S23, the clock of the corresponding device to be controlled is controlled to be synchronized with the clock of the master device according to the time axis error and the propagation delay.
[0088] After the master device calculates the time axis error and propagation delay corresponding to each device to be controlled, it broadcasts the time axis error and propagation delay to the corresponding device to be controlled. The device to be controlled adjusts its own time axis according to the time axis error and propagation delay so that the clock of the device to be controlled is synchronized with the clock of the master device. After the controlled device completes the clock synchronization, it sends a confirmation signal of completing the clock synchronization to the master device, and the master device receives the confirmation signals of completing the clock synchronization sent by each device to be controlled.
[0089] In one embodiment, ultrasonic data transmission technology can be used to broadcast the time axis error and propagation delay corresponding to the device to be controlled. In actual situations, due to the low efficiency of sound wave transmission, the amount of transmission data in each time slot is only allowed to transmit the time axis error and propagation delay of a single device to be controlled. Therefore, when ultrasonic data transmission technology is used to broadcast the time axis error and propagation delay corresponding to the device to be controlled, the time axis error and propagation delay corresponding to each device to be controlled can only be broadcast according to the time slot.
[0090] In summary, the clock synchronization method provided by the present disclosure includes: the master control device determines the device to be controlled through a wireless transmission protocol, determines the time axis error and propagation delay corresponding to each device to be controlled by broadcasting information to the device to be controlled and receiving feedback information of the information, the time axis error is the time axis error between the device to be controlled and the master control device, the propagation delay is the propagation delay of data on the path between the device to be controlled and the master control device, and controls the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; thereby effectively synchronizing the transmitting end time axis of the device to be controlled and the master control device instead of the local crystal oscillator time axis, so that the time of sound emission of the device to be controlled and the master control device is kept synchronized.
[0091] See also Figure 6 , Figure 6 The present invention is a flowchart of another clock synchronization method according to an exemplary embodiment of the present invention. Figure 6 The clock synchronization method shown is applied to a device to be controlled. For example, Figure 1 Any one of the terminal devices shown is used as a master control device, and the remaining terminal devices are used as controlled devices. The master control device and the controlled devices are not time synchronized, and each terminal device uses an independent sound wave transmitter and an independent sound wave receiver.
[0092] It should be noted that Figure 6 The clock synchronization method shown is similar to Figure 3 The clock synchronization method shown is consistent with the content. Figure 3 The clock synchronization method shown is executed by the master device. Figure 6 The clock synchronization method shown is executed by the device to be controlled. For details not described in this embodiment, please refer to Figure 3 The embodiment shown.
[0093] Figure 6 The clock synchronization method shown includes the following steps:
[0094] In step S61, the corresponding time axis error and propagation delay are obtained by receiving information broadcast by the master control device and sending feedback information to the master control device in response to the information.
[0095] The master device selected from the terminal devices is used as the synchronization clock source and is regarded as the master terminal, and the remaining terminal devices are used as the devices to be controlled.
[0096] The device to be controlled first broadcasts a data packet to the master device through a wireless transmission protocol. The wireless transmission protocol may be, but is not limited to, Bluetooth, sound wave, WiFi and other wireless transmission protocols. The device to be controlled broadcasts a data packet to the master device through a wireless transmission protocol. The data packet includes a unique identifier of the device to be controlled. The unique identifier is an identifier that can uniquely identify the device to be controlled and is used to distinguish different devices to be controlled. The unique identifier may be, but is not limited to, an IP address, a media access control (MAC) address, etc. Take the IP address as an example to illustrate. The device to be controlled broadcasts its own IP address to the master device. The master device receives the IP address broadcast by the device to be controlled. One device to be controlled corresponds to one IP address. Therefore, the master device can determine the device to be controlled and the number of devices to be controlled based on the received IP address.
[0097] The information broadcast by the master control device is generated by the master control device based on the unique identifier in the data packet of each device to be controlled. For example, after receiving the data packet broadcast by each device to be controlled, the master control device parses the unique identifier in the data packet, such as the IP address, determines the device to be controlled and the number of the devices to be controlled based on the received IP address, and generates information to be broadcast to the device to be controlled after determining the device to be controlled. The device to be controlled sends feedback information to the master control device in response to the information, and records the information sending time, information receiving time, feedback information sending time and feedback information receiving time. The corresponding time axis error and propagation delay are obtained based on the information sending time, information receiving time, feedback information sending time and feedback information receiving time. This process will be described in detail in the following sub-steps.
[0098] It should be noted that step S61 also includes sub-steps S611, S612, S613 and S614. The specific method of obtaining the time axis error and the propagation delay will be described in detail in the sub-steps of step S61. Figure 7 , Figure 7 is a flowchart of sub-step S61 shown in an exemplary embodiment of the present disclosure.
[0099] In sub-step S611, first information broadcasted by the master device according to the temporary IP address of the device to be controlled is received.
[0100] Exemplarily, after receiving the data packets broadcast by each device to be controlled, the master device parses the unique identifier in the data packet, such as the IP address, determines the device to be controlled and the number of devices to be controlled according to the received IP address, and generates the first information to be broadcast to the device to be controlled after determining the device to be controlled. The first information includes the temporary IP address, sound wave frequency band and time slot corresponding to each device to be controlled assigned by the master device. It should be noted that the temporary IP address is the address temporarily set by the master device to distinguish each device to be controlled. The characteristic of the temporary IP address is that it is set once and used once, and the temporary IP address occupies less space than the IP address. When transmitting the temporary IP address, the time required is also less than the IP address; the sound wave frequency band is the sound wave frequency band assigned by the master device to each device to be controlled, and each device to be controlled can broadcast information to the master device through different sound wave frequency bands; the time slot is the time slot assigned by the master device to each device to be controlled, so that each device to be controlled can send feedback information of the first information to the master device according to the time slot.
[0101] The master control device broadcasts the first information to each device to be controlled according to the temporary IP address of each device to be controlled, and records the first time of broadcasting the first information; the first information includes the name of each device to be controlled and the time slot of each device to be controlled, and each device to be controlled can send feedback information of the first information to the master control device according to the time slot, and the name of the device to be controlled can be the temporary IP address of the device to be controlled.
[0102] In sub-step S612, second information is sent to the master control device according to the time slot.
[0103] The second information is feedback information of the device to be controlled to the first information. The first information is used to instruct the device to be controlled to send the second information to the main control device and the microphone of the device to be controlled in response to the first information. The second information is feedback information of the first information. The microphone is a sound wave transmitter of the device to be controlled. The second information can be used to instruct the microphone to transmit sound waves. The device to be controlled records the time when the device to be controlled receives the first information as the second time, and records the time when the microphone receives the second information as the third time.
[0104] In sub-step S613, the third information of the device to be controlled is sent to the master device according to the time slot.
[0105] The third information includes a second time and a third time, the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone receives the second information.
[0106] Because each device to be controlled sends the third information to the master device in its own time slot, which is a time division multiplexing method, the master device receives the second time and third time of different devices to be controlled in different time slots. In the time synchronization process, it is ensured that a single device to be controlled is not interfered by the sound waves sent by other devices to be controlled.
[0107] In one embodiment, the device to be controlled can use ultrasonic data transmission technology to send the third information, that is, use sound waves to transmit the third information. Since the device to be controlled uses time division multiplexing to send the third information, the sound waves sent between each device to be controlled are in different time slots, so that the sound waves of each device to be controlled do not interfere with each other.
[0108] In sub-step S614, the corresponding time axis error and propagation delay broadcasted by the master control device are received.
[0109] The master device receives the second time and the third time sent by the controlled device, and calculates the time axis error and propagation delay corresponding to each controlled device in combination with the first time and the fourth time recorded by itself. The calculation process can be seen in Figure 3 In the embodiment shown, the time axis error and propagation delay are then broadcast to the corresponding device to be controlled.
[0110] In step S62, the clock of the device to be controlled is controlled to be synchronized with the clock of the master device according to the time axis error and the propagation delay.
[0111] The device to be controlled adjusts its own time axis according to the time axis error and propagation delay so that the clock of the device to be controlled is synchronized with the clock of the master device. After the device to be controlled completes the clock synchronization, it sends a confirmation signal of the completion of the clock synchronization to the master device, and the master device receives the confirmation signals of the completion of the clock synchronization sent by each device to be controlled.
[0112] In summary, the clock synchronization method provided by the present disclosure includes: the master control device determines the device to be controlled through a wireless transmission protocol, determines the time axis error and propagation delay corresponding to each device to be controlled by broadcasting information to the device to be controlled and receiving feedback information of the information, the time axis error is the time axis error between the device to be controlled and the master control device, the propagation delay is the propagation delay of data on the path between the device to be controlled and the master control device, and controls the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; thereby effectively synchronizing the transmitting end time axis of the device to be controlled and the master control device instead of the local crystal oscillator time axis, so that the time of sound emission of the device to be controlled and the master control device is kept synchronized.
[0113] Figure 8 is a block diagram of a clock synchronization device according to an exemplary embodiment. Figure 8The clock synchronization device 20 is applied to a main control device, and includes a transmission module 201, a first processing module 202 and a first control module 203.
[0114] The transmission module 201 is configured to broadcast information to the device to be controlled and receive feedback information of the information;
[0115] The first processing module 202 is configured to determine the time axis error and propagation delay corresponding to each of the devices to be controlled through the information and the feedback information; the time axis error is the time axis error between the device to be controlled and the master device, and the propagation delay is the propagation delay of data on the path between the device to be controlled and the master device;
[0116] The first control module 203 is configured to control the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay.
[0117] Optionally, the first processing module 202 is further configured to allocate a corresponding temporary IP address and time slot to each of the devices to be controlled;
[0118] Broadcast the first information to the device to be controlled according to the temporary IP address, and record the first time of broadcasting the first information; the first information includes the name of each device to be controlled and the time slot of each device to be controlled; the first information is used to instruct the device to be controlled to send second information to the main control device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information.
[0119] Optionally, the first processing module 202 is further configured to receive the second information sent by each device to be controlled in response to the first information according to the time slot, and record a fourth time when the second information is received;
[0120] receiving the third information sent by each device to be controlled according to the time slot; the third information includes a second time and a third time, the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone receives the second information;
[0121] The time axis error and the propagation delay corresponding to each of the devices to be controlled are calculated respectively according to the first time, the second time, the third time and the fourth time.
[0122] Optionally, the calculation method of the time axis error and the propagation delay includes:
[0123] Delay=[(T2-T1)+(T4-T3)] / 2
[0124] Offset=[(T2-T1)-(T4-T3)] / 2
[0125] Among them, Delay is the propagation delay, Offset is the time axis error, T1 is the first time, T2 is the second time, T3 is the third time, and T4 is the fourth time.
[0126] Optionally, the first control module 203 is further configured to broadcast the time axis error and the propagation delay corresponding to each of the devices to be controlled; the time axis error and the propagation delay are used to instruct the device to be controlled to adjust its own time axis;
[0127] Receive a confirmation signal of completing clock synchronization sent by each of the devices to be controlled.
[0128] Optionally, the first processing module 202 is further configured to receive the third information sent by each of the devices to be controlled through ultrasonic data transmission technology.
[0129] Fig. 9 is a block diagram of another clock synchronization device according to an exemplary embodiment. Fig. 9 The clock synchronization device 30 is applied to a device to be controlled, and includes a second processing module 302 and a second control module 303 .
[0130] The second processing module 302 is configured to obtain the corresponding time axis error and propagation delay by receiving the information broadcast by the master control device and sending feedback information to the master control device in response to the information; the information is generated by the master control device according to the unique identifier in the data packet of each device to be controlled;
[0131] The second control module 303 is configured to control the clock of the device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay.
[0132] Optionally, the second processing module 302 is further configured to receive first information broadcast by the master device according to the temporary IP address of the device to be controlled; the first information includes the name of each device to be controlled and the time slot of each device to be controlled; the first information is used to instruct the device to be controlled to send second information to the master device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information; the temporary IP address is allocated by the master device according to the unique identifier of the device to be controlled;
[0133] Sending second information to the master device according to the time slot; the second information is feedback information of the device to be controlled to the first information; the time slot is allocated by the master device according to the unique identifier of the device to be controlled;
[0134] Sending third information of the device to be controlled to the master device according to the time slot; the third information includes a second time and a third time; the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone receives the second information;
[0135] Receive the corresponding time axis error and the propagation delay broadcast by the master control device.
[0136] Optionally, the second control module 303 is further configured to adjust its own time axis according to the received time axis error and the propagation delay to keep synchronization with the clock of the master control device;
[0137] When the clock synchronization is completed, a confirmation signal of the completion of the clock synchronization is sent to the master control device.
[0138] Optionally, the second processing module 302 is further configured to send the second time and the third time of the device to be controlled to the main control device through ultrasonic data transmission technology.
[0139] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0140] The present disclosure also provides a computer-readable storage medium having computer program instructions stored thereon, and the program instructions, when executed by a processor, implement the steps of the clock synchronization method provided by the present disclosure.
[0141] Fig.10 800 is a block diagram of a device for clock synchronization according to an exemplary embodiment. For example, the device 800 may be the aforementioned master device or the device to be controlled, and the device 800 may be a mobile phone, a computer, a digital broadcast terminal, a message transceiver device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0142] Reference Fig.10 , the device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output interface 812 , a sensor component 814 , and a communication component 816 .
[0143] The processing component 802 generally controls the overall operation of the device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the clock synchronization method described above. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0144] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the device 800, contact data, phone book data, messages, pictures, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0145] The power supply component 806 provides power to the various components of the device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 800.
[0146] The multimedia component 808 includes a screen that provides an output interface between the device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0147] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the device 800 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0148] The input / output interface 812 provides an interface between the processing component 802 and the peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.
[0149] The sensor assembly 814 includes one or more sensors for providing various aspects of the status assessment of the device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the device 800, and the sensor assembly 814 can also detect the position change of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration / deceleration of the device 800, and the temperature change of the device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0150] The communication component 816 is configured to facilitate wired or wireless communication between the device 800 and other devices. The device 800 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0151] In an exemplary embodiment, the apparatus 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above-mentioned clock synchronization method.
[0152] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by the processor 820 of the device 800 to complete the clock synchronization method described above. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0153] In another exemplary embodiment, a computer program product is further provided. The computer program product includes a computer program executable by a programmable device, and the computer program has a code portion for executing the above-mentioned clock synchronization method when executed by the programmable device.
[0154] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the present disclosure. This application is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary technical means in the art that are not disclosed in the present disclosure. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0155] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A clock synchronization method, characterized in that: Applied to a main control device, including: Broadcasting information to the device to be controlled and receiving feedback information of the information; Determine the time axis error and propagation delay corresponding to each of the devices to be controlled by using the information and the feedback information; the time axis error is the time axis error between the device to be controlled and the master control device, and the propagation delay is the propagation delay of data on the path between the device to be controlled and the master control device; Control the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; The determining of the time axis error and propagation delay corresponding to each of the devices to be controlled by using the information and the feedback information includes: Allocate a corresponding temporary IP address and time slot to each of the devices to be controlled; receiving, according to the time slot, the second information sent by each device to be controlled in response to the first information, and recording a fourth time when the second information is received; the first information is information broadcast by the master control device according to the temporary IP address of the device to be controlled; receiving the third information sent by each device to be controlled according to the time slot; the third information includes a second time and a third time, the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone of the device to be controlled receives the second information; The time axis error and the propagation delay corresponding to each of the devices to be controlled are calculated respectively according to the first time, the second time, the third time and the fourth time; the first time is the time for broadcasting the first information.
2. The method according to claim 1, characterized in that The method further comprises: Broadcast the first information to the device to be controlled according to the temporary IP address, and record the first time; the first information includes the name of each device to be controlled and the time slot of each device to be controlled; the first information is used to instruct the device to be controlled to send second information to the main control device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information.
3. The method according to claim 1, characterized in that The calculation method of the time axis error and the propagation delay includes: Delay=[(T2-T1)+(T4-T3)] / 2 Offset=[(T2-T1)-(T4-T3)] / 2 Among them, Delay is the propagation delay, Offset is the time axis error, T1 is the first time, T2 is the second time, T3 is the third time, and T4 is the fourth time.
4. The method according to claim 1, characterized in that: The step of controlling the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay includes: Broadcasting the time axis error and the propagation delay corresponding to each device to be controlled; the time axis error and the propagation delay are used to instruct the device to be controlled to adjust its own time axis; Receive a confirmation signal of completing clock synchronization sent by each of the devices to be controlled.
5. The method according to claim 1, characterized in that The receiving the third information sent by each of the devices to be controlled includes: The third information is received which is sent by each of the devices to be controlled through ultrasonic data transmission technology.
6. A clock synchronization method, characterized in that: Applied to a device to be controlled, including: By receiving information broadcast by the master control device and sending feedback information to the master control device in response to the information, the corresponding time axis error and propagation delay are obtained; the information is generated by the master control device according to the unique identifier in the data packet of each device to be controlled; Control the clock of the device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; The receiving of information broadcast by the master control device and sending feedback information to the master control device in response to the information to obtain the corresponding time axis error and propagation delay includes: Receiving first information broadcasted by the master control device according to the temporary IP address of the device to be controlled; Sending second information to the master device according to a time slot; the second information is feedback information of the device to be controlled to the first information; the time slot is allocated by the master device according to the unique identifier of the device to be controlled; Sending third information of the device to be controlled to the master device according to the time slot; the third information includes a second time and a third time; the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone of the device to be controlled receives the second information; Receive the corresponding time axis error and the propagation delay broadcast by the master control device; the time axis error and the propagation delay are calculated by the master control device according to the first time, the second time, the third time and the fourth time; the first time is the time when the master control device broadcasts the first information, and the fourth time is the time when the master control device receives the second information.
7. The method according to claim 6, characterized in that The first information includes the name of each device to be controlled and the time slot of each device to be controlled; the first information is used to instruct the device to be controlled to send second information to the main control device and the microphone of the device to be controlled in response to the first information, and the second information is feedback information of the first information; the temporary IP address is allocated by the main control device according to the unique identifier of the device to be controlled.
8. The method according to claim 6, characterized in that The step of controlling the clock of the device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay includes: Adjusting its own time axis according to the received time axis error and the propagation delay to keep synchronization with the clock of the master control device; When the clock synchronization is completed, a confirmation signal of the completion of the clock synchronization is sent to the master control device.
9. The method according to claim 6, characterized in that The sending the second time and the third time of the device to be controlled to the master control device comprises: The second time and the third time of the device to be controlled are sent to the main control device through ultrasonic data transmission technology.
10. A clock synchronization device, characterized in that: Applied to a main control device, including: A transmission module, configured to broadcast information to the device to be controlled and receive feedback information of the information; A first processing module is configured to determine a time axis error and a propagation delay corresponding to each of the devices to be controlled through the information and the feedback information; the time axis error is a time axis error between the device to be controlled and the master device, and the propagation delay is a propagation delay of data on a path between the device to be controlled and the master device; A first control module is configured to control the clock of the corresponding device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; Wherein, the first processing module is further configured to: Allocate a corresponding temporary IP address and time slot to each of the devices to be controlled; receiving, according to the time slot, the second information sent by each device to be controlled in response to the first information, and recording a fourth time when the second information is received; the first information is information broadcast by the master control device according to the temporary IP address of the device to be controlled; receiving the third information sent by each device to be controlled according to the time slot; the third information includes a second time and a third time, the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone of the device to be controlled receives the second information; The time axis error and the propagation delay corresponding to each of the devices to be controlled are calculated respectively according to the first time, the second time, the third time and the fourth time; the first time is the time for broadcasting the first information.
11. A clock synchronization device, characterized in that: Applied to a device to be controlled, including: The second processing module is configured to obtain the corresponding time axis error and propagation delay by receiving information broadcast by the master control device and sending feedback information to the master control device in response to the information; the information is generated by the master control device according to the unique identifier in the data packet of each device to be controlled; A second control module is configured to control the clock of the device to be controlled to keep synchronization with the clock of the master control device according to the time axis error and the propagation delay; Wherein, the second processing module is further configured to: Receiving first information broadcasted by the master control device according to the temporary IP address of the device to be controlled; Sending second information to the master device according to a time slot; the second information is feedback information of the device to be controlled to the first information; the time slot is allocated by the master device according to the unique identifier of the device to be controlled; Sending third information of the device to be controlled to the master device according to the time slot; the third information includes a second time and a third time; the second time is the time when the device to be controlled receives the first information, and the third time is the time when the microphone of the device to be controlled receives the second information; Receive the corresponding time axis error and the propagation delay broadcast by the master control device; the time axis error and the propagation delay are calculated by the master control device according to the first time, the second time, the third time and the fourth time; the first time is the time when the master control device broadcasts the first information, and the fourth time is the time when the master control device receives the second information.
12. An electronic device, characterized in that: include: processor; a memory for storing processor-executable instructions; The processor is configured to execute the executable instructions to implement the steps of the method described in any one of claims 1 to 5, or is configured to execute the executable instructions to implement the steps of the method described in any one of claims 6 to 9.
13. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the program instruction is executed by a processor, the steps of the method described in any one of claims 1 to 5 are implemented, or when the program instruction is executed by a processor, the steps of the method described in any one of claims 6 to 9 are implemented.
Citation Information
Patent Citations
Clock synchronization method and system
CN102546071A
Play control method and device, and terminal
CN106411447A