Equipment synchronization method and device, equipment and storage medium
By synchronizing time between master and slave devices, the problem that device control and task execution cannot maintain time consistency is solved, and synchronous communication and time consistency between devices are achieved.
Patent Information
- Application Number
- CN202411619570.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-13
AI Technical Summary
In the prior art, there is a lack of a reasonable equipment synchronization mechanism between the master and slave devices, which cannot ensure synchronous communication between the equipment, resulting in the inability to maintain the time consistency of equipment control and task execution between the master and slave devices.
By obtaining the count value currently recorded by the first clock module set, the master device sends a synchronization calibration request to the slave device, and after receiving the confirmation message, it calculates and sends the delay value, so that the slave device can update the count value of its clock module, thereby realizing time synchronization between the master device and the slave device.
Time synchronization between the master and slave devices is realized, ensuring synchronous communication between devices, so that device control and task execution between master and slave devices can be kept in a consistent time.
Smart Images

Figure CN119576071A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of device communication technology, and in particular, to a device synchronization method, apparatus, device and storage medium. Background Art
[0002] At present, multi-device collaboration is increasingly being used in all walks of life. Among them, multiple devices can include master devices and slave devices. For example, a master device needs to control multiple slave devices to work in sequence to ensure a smooth and efficient production process. For another example, a master device needs to work with multiple slave devices at the same time to complete data output for a specific scenario.
[0003] However, the related technology lacks a reasonable device synchronization mechanism between the master device and the slave device, and cannot guarantee synchronous communication between the devices. It is easy for the device control and task execution between the master device and the slave device to fail to maintain time consistency, which needs to be improved. Summary of the invention
[0004] The embodiments of the present application provide a device synchronization method, apparatus, device and storage medium, which solve the problem in the related art that there is a lack of a reasonable device synchronization mechanism between the master device and the slave device, the synchronous communication between the devices cannot be guaranteed, and the device control and task execution between the master device and the slave device cannot maintain time consistency. The method realizes time synchronization between the master device and the slave device, guarantees synchronous communication between the devices, and enables the device control and task execution between the master device and the slave device to maintain time consistency.
[0005] In a first aspect, an embodiment of the present application provides a device synchronization method, which is applied to a master device, and the method includes:
[0006] Acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting at a preset time interval after the master device is powered on;
[0007] Sending a synchronization calibration request to a slave device, so that the slave device feeds back a confirmation message;
[0008] When the confirmation message is received, obtaining a second count value currently recorded by the first clock module, and calculating a delay value based on the second count value and the first count value;
[0009] The second count value and the delay value are sent to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting according to the preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
[0010] In a second aspect, an embodiment of the present application further provides a device synchronization method, which is applied to a slave device, and the method includes:
[0011] In the case of receiving a synchronization calibration request sent by a master device, sending a confirmation message to the master device, so that the master device obtains a second count value currently recorded by the first clock module when receiving the confirmation message, calculates a delay value based on the second count value and a first count value currently recorded by the first clock module obtained when sending the synchronization calibration request, and sends the second count value and the delay value;
[0012] When the second count value and the delay value are received from the master device, the second count value and the delay value are added to obtain a reference count value, and the count value currently recorded by the set second clock module is updated to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
[0013] In a third aspect, an embodiment of the present application further provides a device synchronization apparatus, including:
[0014] An acquisition module is configured to acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting at a preset time interval after the master device is powered on;
[0015] A request sending module, configured to send a synchronization calibration request to a slave device, so that the slave device feeds back a confirmation message;
[0016] a delay calculation module configured to, upon receiving the confirmation message, obtain a second count value currently recorded by the first clock module, and calculate a delay value based on the second count value and the first count value;
[0017] A clock synchronization module is configured to send the second count value and the delay value to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting according to the preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
[0018] In a fourth aspect, an embodiment of the present application further provides a device synchronization apparatus, including:
[0019] A confirmation message sending module is configured to send a confirmation message to the master device when receiving a synchronization calibration request sent by the master device, so that the master device obtains a second count value currently recorded by the first clock module when receiving the confirmation message, calculates a delay value based on the second count value and a first count value currently recorded by the first clock module obtained when sending the synchronization calibration request, and sends the second count value and the delay value;
[0020] The clock synchronization module is configured to, upon receiving the second count value and the delay value sent by the master device, add the second count value and the delay value to obtain a reference count value, and update the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
[0021] In a fifth aspect, an embodiment of the present application further provides an electronic device, the device comprising:
[0022] one or more processors;
[0023] a storage device configured to store one or more programs,
[0024] When the one or more programs are executed by the one or more processors, the one or more processors implement the device synchronization method described in the embodiment of the present application.
[0025] In a sixth aspect, an embodiment of the present application further provides a non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are configured to execute the device synchronization method described in the embodiment of the present application.
[0026] In an embodiment of the present application, by obtaining the first count value currently recorded by the set first clock module, the first clock module starts counting at a preset time interval after the master device is powered on; a synchronization calibration request is sent to the slave device so that the slave device feeds back a confirmation message; when the confirmation message is received, the second count value currently recorded by the first clock module is obtained, and a delay value is calculated based on the second count value and the first count value; the second count value and the delay value are sent to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and the count value currently recorded by the set second clock module is updated to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value. In the above scheme, the master device sends a synchronization calibration request to the slave device, and when receiving a confirmation message, subtracts the second count value from the first count value to obtain the delay value, thereby effectively measuring the communication delay time between the master device and the slave device. The master device sends the second count value and the delay value to the slave device, thereby providing the slave device with a benchmark reference time and a communication delay time, which are used for the slave device to update its own benchmark reference time, complete time synchronization with the master device, and ensure synchronous communication between devices. Synchronization operations can be performed based on the reference count value, so that the device control and task execution between the master device and the slave device can maintain time consistency. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 A flow chart of a device synchronization method provided in an embodiment of the present application;
[0028] Figure 2 A flowchart of a device synchronization method including a specific process of notifying a slave device to execute a first target task event provided by an embodiment of the present application;
[0029] Figure 3 A flowchart of a device synchronization method including a specific process of issuing a control instruction to a slave device provided in an embodiment of the present application;
[0030] Figure 4 A flowchart of a device synchronization method including a specific process of synchronizing a target data output rate provided in an embodiment of the present application;
[0031] Figure 5 A flowchart of a device synchronization method including a specific process of comparing a delay value with a preset delay threshold provided in an embodiment of the present application;
[0032] Figure 6 A flowchart of another device synchronization method provided in an embodiment of the present application;
[0033] Figure 7A structural block diagram of a device synchronization apparatus provided in an embodiment of the present application;
[0034] Figure 8 A structural block diagram of another device synchronization apparatus provided in an embodiment of the present application;
[0035] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] The embodiments of the present application are further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the embodiments of the present application, rather than to limit the embodiments of the present application. It should also be noted that, for ease of description, only parts related to the embodiments of the present application are shown in the accompanying drawings, rather than all structures.
[0037] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0038] The device synchronization method provided in the embodiment of the present application is used for time synchronization between multiple devices, so that the device control and task execution between the master device and the slave device can keep the time consistent. Specific application scenarios may include: industrial automation, smart home, etc. Taking industrial automation as an example, the master device can be a controller, the slave device can be an actuator, and the controller can control multiple actuators to complete specific actions or operations in sequence. Taking smart home as an example, the master device and the slave device can be a paired first smart speaker and a second smart speaker, respectively, and the first smart speaker and the second smart speaker can perform the same audio output at the same time node. Of course, the several application scenarios listed above are only exemplary and explanatory. In actual applications, the device synchronization method can also be used in device synchronization in other scenarios, and the embodiment of the present application does not limit this. The present application aims to provide a device synchronization method to solve the problem that there is a lack of a reasonable device synchronization mechanism between the master device and the slave device in the related technology, and the synchronous communication between the devices cannot be guaranteed, and the device control and task execution between the master device and the slave device cannot keep the time consistent.
[0039] In the device synchronization method provided in the embodiment of the present application, the executor of each step can be a master device, which refers to an electronic device that has data calculation, processing and storage capabilities, and has initiative and control rights in the communication or control system. It can actively initiate communication requests or control instructions, and manage slave devices to complete corresponding tasks. The embodiment of the present application does not limit this.
[0040] Figure 1 The flowchart of a device synchronization method provided in an embodiment of the present application can be implemented with the master device as the execution subject. Figure 1 As shown, the device synchronization method specifically includes the following steps:
[0041] Step S101: Acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting according to a preset time interval after the master device is powered on.
[0042] Among them, the first clock module is set inside the main device, and starts counting according to the preset time interval after the main device is powered on, so as to provide the main device with the real-time reference time after the device is powered on. For example, the preset time interval is 1 microsecond. After the main device is powered on, the first clock module starts counting. If the first count value currently recorded by the first clock module is 1000, the current reference time of the main device is 1 millisecond. If the second count value currently recorded by the first clock module is 2000, the current reference time of the main device is 2 milliseconds. It can be understood that the current reference time is the accumulated time relative to the initial moment when the main device is powered on. Of course, the value of the specific preset time interval can be adaptively set by the developer according to the time accuracy requirements of the actual application scenario, and this application does not limit it here.
[0043] Step S102: Send a synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message.
[0044] After the master device and the slave device establish a connection based on the device communication protocol, the master device can send a synchronization calibration request to the slave device to notify the slave device to perform time synchronization calibration. The synchronization calibration request may include a slave device identifier and a synchronization calibration identifier. Optionally, the number of slave devices may be one or more. After receiving the synchronization calibration request, the slave device may feed back a confirmation message to the master device in response to the synchronization calibration request sent by the master device, which is equivalent to notifying the master device that it can enter the synchronization calibration phase.
[0045] Step S103: when a confirmation message is received, obtain a second count value currently recorded by the first clock module, and calculate a delay value based on the second count value and the first count value.
[0046] Among them, if the master device receives the confirmation message, it can be regarded as the slave device entering the synchronization calibration stage normally. By obtaining the second count value currently recorded by the first clock module, the master device can obtain the current reference time when the confirmation message is received, and combined with the first count value corresponding to the time when the synchronization calibration request is sent, the delay value of the communication between the master device and the slave device can be calculated. For example, the preset time interval is 1 microsecond, the first count value is 2000, and the second timing value is 7000. The first count value and the second count value can be subtracted to obtain an interval value of 5000, which is equivalent to the time interval from the master device sending the synchronization calibration request to receiving the confirmation message fed back by the slave device is 5 milliseconds. Considering that the time interval is a two-way transmission and reception process of information between the master device and the slave device, the interval value can be divided by 2 to obtain a delay value of 2500, which is used to estimate the delay time from the master device starting to send the synchronization calibration request to the slave device receiving the synchronization calibration request, that is, 2.5 milliseconds. Therefore, based on the delay value calculated based on the second count value and the first count value, the communication delay between the master device and the slave device can be reasonably determined. Optionally, when there are multiple slave devices, the master device can obtain different second count values based on the confirmation message fed back by each slave device, and calculate the delay value corresponding to each slave device based on the second count value and the first count value corresponding to each slave device.
[0047] Step S104, sending a second count value and a delay value to the slave device, so that the slave device adds the second count value and the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations of the slave device based on the reference count value.
[0048] Among them, during the initialization stage of the device, since the power-on time of the master device and the slave device may be different, the slave device may be powered on earlier than the master device or the master device may be powered on earlier than the slave device. Therefore, the counts of the first clock module and the second clock module may be out of sync, which will cause the real-time reference time of the two to be different, making it impossible for the device control and task execution between the master device and the slave device to keep the time consistent. For example, the current count value of the first clock module built into the master device is a1, and the current count value of the second clock module built into the slave device is a2. If the two agree to reach the count value a3 and execute the same task at the same time, then due to the difference between a3-a2 and a3-a1, the master device and the slave device will execute the task at different times, which will cause an abnormal situation of asynchronous execution. Therefore, the master device can send the second count value and delay value to the slave device, so that the slave device can adjust the real-time reference time between the two devices to be synchronized. It is worth noting that the second count value represents the data sending time of the master device, that is, the current reference time corresponding to the master device sending data, and the delay value represents the delay time for the data sent by the master device to reach the slave device. The second count value and the delay value are added to obtain the reference count value, which represents the current reference time of the master device when the data arrives at the slave device. Therefore, the slave device updates the count value currently recorded by the second clock module to the reference count value, which is equivalent to adjusting to the same reference time as the master device, wherein the second clock module is set inside the slave device, and starts counting according to the same preset time interval as the master device after the slave device is powered on, and is used to provide the slave device with the real-time reference time after the device is powered on. Among them, the first clock module and the second clock module keep the same preset time interval for counting, which can eliminate the counting error that may be caused by different preset time intervals, ensure the consistency of the counting time granularity, and facilitate the synchronization of the equipment. For example, the second count value obtained by the master device is b1, and the corresponding current reference time is t1, and the calculated delay value is d1. When the current reference time is t1, the master device sends the second count value and delay value to the slave device. When the slave device receives the second count value and delay value, due to the communication delay, the current count value corresponding to the master device should be updated to b1+d1, and the corresponding current reference time is t2. Then, the slave device adds the received second count value and the delay value to obtain a reference count value of b1+d1, which is consistent with the current count value corresponding to the master device. Therefore, the slave device can update the count value currently recorded by the second clock module to the reference count value b1+d1, which is equivalent to changing its own current reference time to t2, which is consistent with the master device, and achieves the purpose of time synchronization. Optionally, when there are multiple slave devices, the master device can send the corresponding second count value and delay value to each slave device, so that multiple slave devices can update the count value currently recorded by the set second clock module to the reference count value, and keep the reference reference time consistent with the master device.
[0049] In the above, by obtaining the first count value currently recorded by the set first clock module, the first clock module starts to count according to the preset time interval after the master device is powered on; a synchronization calibration request is sent to the slave device so that the slave device feeds back a confirmation message; when the confirmation message is received, the second count value currently recorded by the first clock module is obtained, and a delay value is calculated based on the second count value and the first count value; the second count value and the delay value are sent to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and the count value currently recorded by the set second clock module is updated to the reference count value, and the second clock module starts to count according to the preset time interval after the slave device is powered on, which is used for the slave device to perform synchronization operations based on the reference count value. In the above scheme, the master device sends a synchronization calibration request to the slave device, and when receiving a confirmation message, subtracts the second count value from the first count value to obtain the delay value, thereby effectively measuring the communication delay time between the master device and the slave device. The master device sends the second count value and the delay value to the slave device, thereby providing the slave device with a benchmark reference time and a communication delay time, which are used for the slave device to update its own benchmark reference time, complete time synchronization with the master device, and ensure synchronous communication between devices. Synchronization operations can be performed based on the reference count value, so that the device control and task execution between the master device and the slave device can maintain time consistency.
[0050] Figure 2 A flowchart of a device synchronization method including a specific process of notifying a slave device to execute a first target task event is provided in an embodiment of the present application, such as Figure 2 As shown, the device synchronization method specifically includes the following steps:
[0051] Step S201: Acquire a first count value currently recorded by a set first clock module, and the first clock module starts counting according to a preset time interval after the master device is powered on.
[0052] Step S202: Send a synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message.
[0053] Step S203: when receiving the confirmation message, obtain the second count value currently recorded by the first clock module, and calculate the delay value based on the second count value and the first count value.
[0054] Step S204, sending a second count value and a delay value to the slave device, so that the slave device adds the second count value and the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations based on the reference count value.
[0055] Step S205: upon receiving the first target task information sent by the external terminal, obtaining the third count value currently recorded by the first clock module, wherein the first target task information includes the first target task event and the first execution waiting time.
[0056] Among them, the external terminal can be a host computer, user terminal or background server connected to the main device, and can send the target task to be executed to the main device. If the main device receives the first target task information sent by the external terminal, it can obtain the third count value currently recorded by the first clock module, which is equivalent to determining the current reference time when the first target task information is received. The first target task event can be a specific action or data output operation that the master device and the slave device need to perform simultaneously. For example, the master device and the slave device are paired car audio systems and need to play the same audio at the same time. For example, the master device and the slave device are advertising screens and need to play the same video synchronously. The first execution waiting time can be the buffer time before the first target task event is executed. For example, the first execution waiting time is 5 minutes, which can be regarded as the master device and the slave device need to wait for 5 minutes based on the current reference time before executing the first target task event.
[0057] Step S206: determining a first target count value according to the first execution waiting time, the preset time interval and the third count value.
[0058] In one embodiment, the specific implementation steps of determining the first target count value according to the first execution waiting time, the preset time interval and the third count value are as follows:
[0059] Based on a preset time interval, converting the first execution waiting time into a first incremental count value;
[0060] The first incremental count value is added to the third count value to obtain a first target count value.
[0061] Among them, since the master device determines the current reference time through the count value of the first clock module, it is necessary to convert the first execution waiting time into a count value form and deduce the target count value. Specifically, the preset time interval is the unit time required for the count value to increase by 1, so it can be determined how many preset time intervals the first execution waiting time contains, and then the first incremental count value is determined, and the first incremental count value is added to the third count value to obtain the first target count value, and the first target count value can represent the target reference time for executing the first target task event.
[0062] In a specific implementation, the first execution waiting time and the preset time interval have the same time unit, and the first execution waiting time can be divided by the preset time interval to obtain the first incremental count value. For example, the first execution waiting time is 20 microseconds, the preset time interval is 2 microseconds, and the third count value is 100, then the first incremental count value can be calculated to be 20÷2=10, and the first target count value is 100+10=110, which is equivalent to the master device or the slave device needing to execute the first target task event when the clock module counts to 110.
[0063] In another specific embodiment, the time units of the first execution waiting time and the preset time interval are different, and the first execution waiting time needs to be converted into time units first, and then divided by the preset time interval to obtain the first incremental count value. For example, the first execution waiting time is 2 milliseconds, the preset time interval is 2 microseconds, and the third count value is 1000. Then the calculation result of converting the first execution waiting time into microsecond units is 2000 microseconds, and the first incremental count value can be calculated to be 2000÷2=1000, and the first target count value is 1000+1000=2000, which is equivalent to the master device or the slave device needing to execute the first target task event when the clock module counts to 2000.
[0064] Step S207: Send the first target task event and the first target count value to the slave device, so that the slave device executes the first target task event when the timing of the second clock module reaches the first target count value.
[0065] Among them, since the master device and the slave device have completed time synchronization after steps 201 to 204, the real-time count values of the first clock module and the second clock module are consistent. Therefore, for the master device and the slave device, the first target count value corresponds to the same target reference time, and there will be no deviation in the task execution time.
[0066] As described above, the master device determines the first target count value based on the first execution waiting time, the preset time interval and the third count value, and can accurately convert the first execution waiting time into a count value representing the reference time after both parties complete time synchronization. By sending the first target task event and the first target count value to the slave device, the slave device can accurately execute the first target task event after the first execution waiting time, which is beneficial for the master device and the slave device to synchronously execute the first target task event.
[0067] Figure 3 A flowchart of a device synchronization method including a specific process of issuing a control instruction to a slave device is provided in an embodiment of the present application, such as Figure 3 As shown, the device synchronization method specifically includes the following steps:
[0068] Step S301: Acquire a first count value currently recorded by a set first clock module, and the first clock module starts counting according to a preset time interval after the master device is powered on.
[0069] Step S302: Send a synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message.
[0070] Step S303: when receiving the confirmation message, obtain the second count value currently recorded by the first clock module, and calculate the delay value based on the second count value and the first count value.
[0071] Step S304, send a second count value and a delay value to the slave device, so that the slave device adds the second count value and the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations based on the reference count value.
[0072] Step S305: upon receiving the second target task information sent by the external terminal, obtaining the fourth count value currently recorded by the first clock module, wherein the second target task information includes a second target task event and a second execution waiting time.
[0073] Among them, if the master device receives the second target task information sent by the external terminal, it can obtain the fourth count value currently recorded by the first clock module, which is equivalent to determining the current reference time when the second target task information is received. The second target task event can be that the master device needs to control the slave device to perform a specific action or operation. For example, the master device is a controller and the slave device is a robotic arm. The master device needs to issue a control instruction at a specific time to control the robotic arm to move. The second execution waiting time can be the buffer time before the second target task event is executed. For example, the second execution waiting time is 1 minute, which can be regarded as the master device needs to wait for 1 minute based on the current reference time before sending a control instruction corresponding to the second target task event to the slave device.
[0074] Step S306: Generate a control instruction corresponding to the slave device according to the second target task event, and determine the second target count value according to the second execution waiting time, the preset time interval, the delay value and the fourth count value.
[0075] The master device can generate a control instruction corresponding to the slave device according to the second target task event. The control instruction is control information recognizable by the slave device and is used to notify the slave device to perform a specific action or operation.
[0076] In one embodiment, the specific implementation steps of determining the second target count value according to the second execution waiting time, the preset time interval, the delay value and the fourth count value are as follows:
[0077] Based on a preset time interval, converting the second execution waiting time into a second incremental count value;
[0078] Subtracting the second incremental count value from the delay value to obtain a target incremental count value;
[0079] The target incremental count value is added to the fourth count value to obtain a second target count value.
[0080] Among them, since the master device determines the current reference time through the count value of the first clock module, it is necessary to convert the second execution waiting time into a count value form and deduce the target count value. Specifically, the preset time interval is the unit time required for the count value to increase by 1, so it can be determined how many preset time intervals the second execution waiting time contains, and then the second incremental count value is determined. Due to the communication delay between the master device and the slave device, if the second incremental count value is directly added to the fourth count value to obtain the target count value, and the master device sends a control instruction to the slave device when the target count value is reached, then there will be a delay in the slave device actually receiving the control instruction, so that the master device cannot accurately control the slave device at the time node corresponding to the second execution waiting time. Therefore, after obtaining the second incremental count value, it is necessary to subtract the second incremental count value from the delay value to obtain the target incremental count value, and add the target incremental count value to the fourth count value to obtain the second target count value. When the master device reaches the second target count value, it sends a control instruction to the slave device, which is equivalent to sending the control instruction to the slave device in advance in consideration of the communication delay. Then, the delay of the slave device actually receiving the control instruction will be offset, so that the master device can accurately control the slave device at the time node corresponding to the second execution waiting time. For example, the second execution waiting time is 50 microseconds, the preset time interval is 1 microsecond, the delay value is 5, and the fourth count value is 100. Then the second incremental count value is calculated to be 50. If the master device sends a control instruction to the slave device when the count value reaches 100+50=150, due to the communication delay between the master device and the slave device, the slave device does not actually receive the control instruction when the count value reaches 150, but receives the control instruction when the count value reaches 150+5=155, and a control delay will occur. Therefore, after calculating the second incremental count value, the second incremental count value can be subtracted from the delay value to obtain the target incremental count value 45, and the second target count value is 100+45=145. Then, when the master device reaches the second target count value 145, it sends a control instruction to the slave device. Taking into account the communication delay, the slave device actually receives the control instruction when the count value reaches 150, which satisfies the master device to accurately control the slave device at the time node corresponding to the second execution waiting time (50 microseconds).
[0081] In a specific embodiment, the second execution waiting time and the preset time interval have the same time unit, and the second execution waiting time can be divided by the preset time interval to obtain the second incremental count value. In another specific embodiment, the second execution waiting time and the preset time interval have different time units, and the second execution waiting time needs to be converted into a time unit first, and then divided by the preset time interval to obtain the second incremental count value.
[0082] Step S307: When the timing of the first clock module reaches the second target count value, a control instruction is sent to the slave device.
[0083] As described above, the master device determines the second target count value based on the second execution waiting time, the preset time interval, the delay value and the fourth count value, which can effectively take into account the communication delay between the two parties, and accurately convert the second execution waiting time into a count value representing the reference time after the two parties complete the time synchronization. By sending a control instruction to the slave device when the second target count value is reached, the control timing requirements of the target task can be accurately met to control the slave device, thereby avoiding time deviation in the control effect of the master device on the slave device.
[0084] Figure 4 A flowchart of a device synchronization method including a specific process of synchronizing a target data output rate is provided in an embodiment of the present application, such as Figure 4 As shown, the device synchronization method specifically includes the following steps:
[0085] Step S401: Acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting according to a preset time interval after the master device is powered on.
[0086] Step S402: Send a synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message;
[0087] Step S403: when a confirmation message is received, obtain the second count value currently recorded by the first clock module, and calculate the delay value based on the second count value and the first count value.
[0088] Step S404, send the second count value and the delay value to the slave device, so that the slave device adds the second count value and the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations based on the reference count value.
[0089] Step S405: Acquire the set target data output rate, and send the target data output rate to the slave device, so that the slave device updates the currently set data output rate to the target data output rate.
[0090] Among them, in addition to synchronizing time, the synchronization calibration process of the master device and the slave device can also synchronize the target data output rate, so that the master device and the slave device can achieve the purpose of synchronous data output. The master device can send the currently set target data output rate to the slave device, so that the slave device can update the currently set data output rate to the target data output rate, thereby, the master device and the slave device can maintain the same data output rate to perform related operations. For example, the master device and the slave device can be paired smart speakers. If the audio data output rates of the two are different, then the phenomenon of music playback being out of sync will occur, affecting the user experience. Therefore, the slave device updates the audio data output rate to the target audio data output rate currently set by the master device, which can ensure that the two synchronize music playback. For another example, the master device and the slave device can be smart panels distributed in different locations at the same location, and need to play the same promotional video at the same time. If the video data output rates of the two are different, then the phenomenon of video playback being out of sync will occur, affecting the promotional effect.
[0091] As described above, the master device sends the target data output rate to the slave device so that the slave device keeps its own data output rate consistent, thereby ensuring that both parties output data synchronously and guaranteeing the effect of synchronous operation.
[0092] Figure 5 A flowchart of a device synchronization method including a specific process of comparing a delay value with a preset delay threshold is provided in an embodiment of the present application, such as Figure 5 As shown, the device synchronization method specifically includes the following steps:
[0093] Step S501: Acquire a first count value currently recorded by a set first clock module, and the first clock module starts counting according to a preset time interval after the master device is powered on.
[0094] Step S502: Send a synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message.
[0095] Step S503: when a confirmation message is received, obtain the second count value currently recorded by the first clock module, and calculate the delay value based on the second count value and the first count value.
[0096] Step S504: compare the delay value with a preset delay threshold.
[0097] Among them, if there are problems such as abnormal fluctuations in network conditions and abnormal status of slave devices, the master device may calculate a large delay value, which cannot correctly represent the communication delay between the master device and the slave device. If time synchronization is performed based on this delay value, subsequent synchronization operations will be abnormal. Therefore, a preset delay threshold can be set based on empirical data of actual application scenarios. If the delay value is within the range of 0 to the preset delay threshold, the delay value can be regarded as a normal value. If the delay value exceeds the range specified by the preset delay threshold, the delay value can be regarded as an abnormal value.
[0098] Step S505: When the delay value is greater than or equal to the preset delay threshold, resend the synchronization calibration request to the slave device, so that the slave device feeds back a confirmation message again.
[0099] Among them, if the delay value is greater than or equal to the preset delay threshold, it can be regarded as an abnormal delay value. The master device can try to resend the synchronization calibration request to the slave device so that the slave device can re-feed back the confirmation message. If the network condition or the slave device status returns to normal, the recalculated delay value is within the range specified by the preset delay threshold, and the second count value and delay value can be sent to the slave device. If the network condition or the slave device status cannot return to normal, and the calculated delay value still exceeds the range specified by the preset delay threshold, the master device can output an abnormal message to the system background or user terminal to remind relevant personnel to conduct abnormality investigation.
[0100] Step S506: When the delay value is less than a preset delay threshold, a second count value and a delay value are sent to the slave device, so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations based on the reference count value.
[0101] As mentioned above, by comparing the delay value with the preset delay threshold, it can be effectively determined whether the delay value is within the normal value range. If the delay value is greater than or equal to the preset delay threshold, it can be regarded as an abnormal delay value, and a synchronization calibration request is resent to the slave device to redetermine the delay value. If the delay value is less than the preset delay threshold, it can be regarded as a normal calculation to obtain the communication delay information of both parties, thereby ensuring that subsequent slave devices can accurately synchronize time.
[0102] Figure 6 This is a flowchart of another device synchronization method provided in an embodiment of the present application. The device synchronization method can be implemented with a slave device as the execution subject. Figure 6 As shown, the device synchronization method specifically includes the following steps:
[0103] Step S601: When a synchronization calibration request is received from a master device, a confirmation message is sent to the master device, so that when the master device receives the confirmation message, it obtains the second count value currently recorded by the first clock module, calculates the delay value based on the second count value and the first count value currently recorded by the first clock module obtained when the synchronization calibration request is sent, and sends the second count value and the delay value.
[0104] Step S602: When receiving the second count value and delay value sent by the master device, add the second count value and the delay value to obtain a reference count value, and update the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so as to perform synchronization operations based on the reference count value.
[0105] In the above scheme, the slave device can obtain the benchmark reference time and communication delay time used for device time synchronization by receiving the second count value and delay value sent by the master device. By updating the count value currently recorded by the set second clock module to the reference count value, the update of its own benchmark reference time is realized, and the time synchronization with the master device is completed. Synchronous communication between devices is guaranteed, which is conducive to subsequent synchronization operations based on the reference count value, so that the device control and task execution between the master device and the slave device can maintain time consistency.
[0106] In one embodiment, Figure 6 The device synchronization method provided in the embodiment shown further includes:
[0107] In case of receiving the first target task event and the first target count value sent by the master device, the first target task event is executed when the second clock module reaches the first target count value.
[0108] In one embodiment, Figure 6 The device synchronization method provided in the embodiment shown further includes:
[0109] When the target data output rate sent by the master device is received, the currently set data output rate is updated to the target data output rate.
[0110] Figure 7 This is a structural block diagram of a device synchronization apparatus provided in an embodiment of the present application. The apparatus is configured to execute the device synchronization method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 7 As shown, the device specifically includes:
[0111] An acquisition module 101 is configured to acquire a first count value currently recorded by a set first clock module, where the first clock module starts counting at a preset time interval after the master device is powered on;
[0112] The request sending module 102 is configured to send a synchronization calibration request to the slave device so that the slave device feeds back a confirmation message;
[0113] The delay calculation module 103 is configured to obtain the second count value currently recorded by the first clock module when receiving the confirmation message, and calculate the delay value based on the second count value and the first count value;
[0114] The clock synchronization module 104 is configured to send a second count value and a delay value to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, and is used for the slave device to perform synchronization operations based on the reference count value.
[0115] In the above, by obtaining the first count value currently recorded by the set first clock module, the first clock module starts to count according to the preset time interval after the master device is powered on; a synchronization calibration request is sent to the slave device so that the slave device feeds back a confirmation message; when the confirmation message is received, the second count value currently recorded by the first clock module is obtained, and a delay value is calculated based on the second count value and the first count value; the second count value and the delay value are sent to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and the count value currently recorded by the set second clock module is updated to the reference count value, and the second clock module starts to count according to the preset time interval after the slave device is powered on, which is used for the slave device to perform synchronization operations based on the reference count value. In the above scheme, the master device sends a synchronization calibration request to the slave device, and when receiving a confirmation message, subtracts the second count value from the first count value to obtain the delay value, thereby effectively measuring the communication delay time between the master device and the slave device. The master device sends the second count value and the delay value to the slave device, thereby providing the slave device with a benchmark reference time and a communication delay time, which are used for the slave device to update its own benchmark reference time, complete time synchronization with the master device, and ensure synchronous communication between devices. Synchronization operations can be performed based on the reference count value, so that the device control and task execution between the master device and the slave device can maintain time consistency.
[0116] In a possible embodiment, it further includes a first synchronization operation module configured to:
[0117] Upon receiving first target task information sent by an external terminal, obtaining a third count value currently recorded by the first clock module, wherein the first target task information includes a first target task event and a first execution waiting time;
[0118] determining a first target count value according to the first execution waiting time, the preset time interval and the third count value;
[0119] A first target task event and a first target count value are sent to the slave device, so that the slave device executes the first target task event when the timing of the second clock module reaches the first target count value.
[0120] In a possible embodiment, the first synchronization operation module is further configured to:
[0121] Based on a preset time interval, converting the first execution waiting time into a first incremental count value;
[0122] The first incremental count value is added to the third count value to obtain a first target count value.
[0123] In a possible embodiment, a second synchronization operation module is further included, configured to:
[0124] When receiving the second target task information sent by the external terminal, obtaining the fourth count value currently recorded by the first clock module, the second target task information including the second target task event and the second execution waiting time;
[0125] Generate a control instruction corresponding to the slave device according to the second target task event, and determine a second target count value according to the second execution waiting time, the preset time interval, the delay value and the fourth count value;
[0126] When the timing of the first clock module reaches the second target count value, a control instruction is sent to the slave device.
[0127] In a possible embodiment, the second synchronization operation module is further configured to:
[0128] Based on a preset time interval, converting the second execution waiting time into a second incremental count value;
[0129] Subtracting the second incremental count value from the delay value to obtain a target incremental count value;
[0130] The target incremental count value is added to the fourth count value to obtain a second target count value.
[0131] In a possible embodiment, it further includes a data output rate synchronization module configured as follows:
[0132] The set target data output rate is obtained, and the target data output rate is sent to the slave device, so that the slave device updates the currently set data output rate to the target data output rate.
[0133] In a possible embodiment, it further includes a delay value comparison module configured as follows:
[0134] Compare the delay value with a preset delay threshold;
[0135] Recalibrate the module, configure it as:
[0136] When the delay value is greater than or equal to the preset delay threshold, the synchronization calibration request is resent to the slave device, so that the slave device feeds back a confirmation message again.
[0137] Correspondingly, the clock synchronization module 104 is further configured as follows:
[0138] When the delay value is less than the preset delay threshold, the second count value and the delay value are sent to the slave device.
[0139] Figure 8 This is a structural block diagram of another device synchronization device provided in an embodiment of the present application. The device is configured to execute the device synchronization method provided in the above embodiment and has the corresponding functional modules and beneficial effects of the execution method. Figure 8 As shown, the device specifically includes:
[0140] The confirmation message sending module 201 is configured to send a confirmation message to the master device when receiving the synchronization calibration request sent by the master device, so that the master device obtains the second count value currently recorded by the first clock module when receiving the confirmation message, calculates the delay value based on the second count value and the first count value currently recorded by the first clock module obtained when sending the synchronization calibration request, and sends the second count value and the delay value;
[0141] The clock synchronization module 202 is configured to, upon receiving the second count value and delay value sent by the master device, add the second count value to the delay value to obtain a reference count value, and update the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, and is used for the slave device to perform synchronization operations based on the reference count value.
[0142] As mentioned above, the slave device can obtain the benchmark reference time and communication delay time for device time synchronization by receiving the second count value and delay value sent by the master device. By updating the count value currently recorded by the set second clock module to the reference count value, the update of its own benchmark reference time is realized, and the time synchronization with the master device is completed. The synchronous communication between devices is guaranteed, which is conducive to the subsequent synchronization operations based on the reference count value, so that the device control and task execution between the master device and the slave device can maintain time consistency.
[0143] In a possible embodiment, it further includes a task event execution module configured to:
[0144] In case of receiving the first target task event and the first target count value sent by the master device, the first target task event is executed when the second clock module reaches the first target count value.
[0145] In a possible embodiment, an output rate update module is further included, configured as follows:
[0146] When the target data output rate sent by the master device is received, the currently set data output rate is updated to the target data output rate.
[0147] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application is shown in FIG. Fig. 9 As shown, the device includes a processor 301, a memory 302, an input device 303 and an output device 304; the number of processors 301 in the device can be one or more. Fig. 9 A processor 301 is taken as an example; the processor 301, memory 302, input device 303 and output device 304 in the device can be connected by a bus or other means. Fig. 9 The example of connecting through a bus is taken. The memory 302, as a computer-readable storage medium, can be configured to store software programs, computer executable programs and modules, such as program instructions / modules corresponding to the device synchronization method in the embodiment of the present application. The processor 301 executes various functional applications and data processing of the device by running the software programs, instructions and modules stored in the memory 302, that is, implements the above-mentioned device synchronization method. The input device 303 can be configured to receive input digital or character information, and generate key signal input related to user settings and function control of the device. The output device 304 may include a display device such as a display screen.
[0148] The electronic device provided above can be used to execute the device synchronization method provided in any of the above embodiments, and has corresponding functions and beneficial effects.
[0149] An embodiment of the present application also provides a non-volatile storage medium containing computer executable instructions, which, when executed by a computer processor, is configured to execute a device synchronization method described in the above embodiment, which includes: obtaining a first count value currently recorded by a set first clock module, and the first clock module starts counting at a preset time interval after the master device is powered on; sending a synchronization calibration request to the slave device so that the slave device feeds back a confirmation message; when the confirmation message is received, obtaining a second count value currently recorded by the first clock module, and calculating a delay value based on the second count value and the first count value; sending the second count value and the delay value to the slave device, so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value, and the second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
[0150] Storage medium - any of various types of memory devices or storage devices. The term "storage medium" is intended to include: installation media, such as CD-ROM, floppy disk or tape device; computer system memory or random access memory, such as DRAM, DDR RAM, SRAM, EDO RAM, Rambus RAM, etc.; non-volatile memory, such as flash memory, magnetic media, or optical storage; registers or other similar types of memory elements, etc. Storage media may also include other types of memory or combinations thereof. In addition, the storage medium may be located in the first computer system in which the program is executed, or may be located in a different second computer system, which is connected to the first computer system via a network (such as the Internet). The second computer system can provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected via a network). The storage medium may store program instructions (e.g., embodied as a computer program) that can be executed by one or more processors.
[0151] Of course, the storage medium containing computer executable instructions provided in the embodiment of the present application, whose computer executable instructions are not limited to the above device synchronization method, can also execute related operations in the device synchronization method provided in any embodiment of the present application.
[0152] It is worth noting that in the embodiment of the above-mentioned device synchronization device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not configured to limit the protection scope of the embodiments of the present application.
[0153] It should be noted that the numbering of each step in this scheme is only used to describe the overall design framework of this scheme, and does not represent the necessary order relationship between the steps. On the basis that the overall implementation process conforms to the overall design framework of this scheme, it belongs to the protection scope of this scheme, and the order of precedence in the form of text when describing is not an exclusive limitation on the specific implementation process of this scheme. It should be understood by those skilled in the art that the embodiments of the present application can be provided as methods, systems, or computer program products. In a typical configuration, a computing device includes one or more processors (CPU), an input / output interface, a network interface, and a memory. The memory may include non-permanent memory in a computer-readable medium, a random access memory (RAM) and / or a non-volatile memory in the form of a read-only memory (ROM) or a flash memory (fl ash RAM). The memory is an example of a computer-readable medium.
[0154] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0155] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A device synchronization method, applied to a master device, characterized in that: include: Acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting at a preset time interval after the master device is powered on; Sending a synchronization calibration request to a slave device, so that the slave device feeds back a confirmation message; When the confirmation message is received, obtaining a second count value currently recorded by the first clock module, and calculating a delay value based on the second count value and the first count value; The second count value and the delay value are sent to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting according to the preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
2. The device synchronization method according to claim 1, characterized in that: After sending the second count value and the delay value to the slave device, the method further includes: Upon receiving first target task information sent by an external terminal, obtaining a third count value currently recorded by the first clock module, wherein the first target task information includes a first target task event and a first execution waiting time; determining a first target count value according to the first execution waiting time, the preset time interval and the third count value; The first target task event and the first target count value are sent to the slave device, so that the slave device executes the first target task event when the timing of the second clock module reaches the first target count value.
3. The device synchronization method according to claim 2, characterized in that: The determining the first target count value according to the first execution waiting time, the preset time interval and the third count value includes: Based on the preset time interval, converting the first execution waiting time into a first incremental count value; The first incremental count value is added to the third count value to obtain a first target count value.
4. The device synchronization method according to claim 1, characterized in that: After sending the second count value and the delay value to the slave device, the method further includes: Upon receiving second target task information sent by an external terminal, acquiring a fourth count value currently recorded by the first clock module, wherein the second target task information includes a second target task event and a second execution waiting time; Generate a control instruction corresponding to the slave device according to the second target task event, and determine a second target count value according to the second execution waiting time, the preset time interval, the delay value and the fourth count value; When the timing of the first clock module reaches the second target count value, the control instruction is sent to the slave device.
5. The device synchronization method according to claim 4, characterized in that: The determining the second target count value according to the second execution waiting time, the preset time interval, the delay value and the fourth count value includes: Based on the preset time interval, converting the second execution waiting time into a second incremental count value; Subtracting the second incremental count value from the delay value to obtain a target incremental count value; The target incremental count value is added to the fourth count value to obtain a second target count value.
6. The device synchronization method according to claim 1, characterized in that: After sending the second count value and the delay value to the slave device, the method further includes: A set target data output rate is acquired, and the target data output rate is sent to the slave device, so that the slave device updates the currently set data output rate to the target data output rate.
7. The device synchronization method according to claim 1, characterized in that: Before sending the second count value and the delay value to the slave device, the method further includes: Comparing the delay value with a preset delay threshold; When the delay value is greater than or equal to the preset delay threshold, resending the synchronization calibration request to the slave device so that the slave device feeds back a confirmation message again; Correspondingly, sending the second count value and the delay value to the slave device includes: When the delay value is less than the preset delay threshold, the second count value and the delay value are sent to the slave device.
8. A device synchronization method, applied to a slave device, characterized in that: include: In the case of receiving a synchronization calibration request sent by a master device, sending a confirmation message to the master device, so that the master device obtains a second count value currently recorded by the first clock module when receiving the confirmation message, calculates a delay value based on the second count value and a first count value currently recorded by the first clock module obtained when sending the synchronization calibration request, and sends the second count value and the delay value; When the second count value and the delay value are received from the master device, the second count value and the delay value are added to obtain a reference count value, and the count value currently recorded by the set second clock module is updated to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
9. The device synchronization method according to claim 8, characterized in that: Also includes: In a case where the first target task event and the first target count value sent by the master device are received, when the second clock module reaches the first target count value, the first target task event is executed.
10. The device synchronization method according to claim 8, characterized in that: Also includes: When the target data output rate sent by the master device is received, the currently set data output rate is updated to the target data output rate.
11. A device synchronization apparatus, characterized in that: include: An acquisition module is configured to acquire a first count value currently recorded by a set first clock module, wherein the first clock module starts counting at a preset time interval after the master device is powered on; A request sending module, configured to send a synchronization calibration request to a slave device, so that the slave device feeds back a confirmation message; a delay calculation module configured to, upon receiving the confirmation message, obtain a second count value currently recorded by the first clock module, and calculate a delay value based on the second count value and the first count value; A clock synchronization module is configured to send the second count value and the delay value to the slave device so that the slave device adds the second count value to the delay value to obtain a reference count value, and updates the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting according to the preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
12. A device synchronization apparatus, characterized in that: include: A confirmation message sending module is configured to send a confirmation message to the master device when receiving a synchronization calibration request sent by the master device, so that the master device obtains a second count value currently recorded by the first clock module when receiving the confirmation message, calculates a delay value based on the second count value and a first count value currently recorded by the first clock module obtained when sending the synchronization calibration request, and sends the second count value and the delay value; The clock synchronization module is configured to, upon receiving the second count value and the delay value sent by the master device, add the second count value and the delay value to obtain a reference count value, and update the count value currently recorded by the set second clock module to the reference count value. The second clock module starts counting at a preset time interval after the slave device is powered on, so that the slave device performs synchronization operations based on the reference count value.
13. An electronic device, comprising: one or more processors; A storage device configured to store one or more programs, when the one or more programs are executed by the one or more processors, enables the one or more processors to implement the device synchronization method described in any one of claims 1-10.
14. A non-volatile storage medium storing computer executable instructions, wherein the computer executable instructions are configured to execute the device synchronization method according to any one of claims 1 to 10 when executed by a computer processor.
Citation Information
Patent Citations
Subscriber station, time division multiplexing system and transmission timing control method suitable for wireless communication in synchronous ptomp scheme
CN101345610A
Time synchronization for clocks separated by a communication link
CN112041829A
Global clock synchronous transmission method
CN113138623A
Clock synchronization method, device, system and equipment and storage medium
CN115801168A
Systems and methods for improving clock synchronization between master and slave devices
US9760114B1