Time calibration method, device, equipment and medium

The reference clock device sends calibration instructions and broadcast data packets to the smart wearable device, which solves the problem of clock out of synchronization between the smart wearable device, realizes clock synchronization and data time consistency between devices, and supports accurate human feature calculations of smartphones.

CN120583501APending Publication Date: 2025-09-02GOERTEK INC
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202510676760.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-09-02

AI Technical Summary

Technical Problem

The clocks of multiple smart wearable devices are out of synchronization, causing the time of body indicator data to be out of synchronization, affecting the calculation of human characteristics by smartphones.

Method used

The first electronic device providing the reference clock sends a timing command to the second electronic device, instructing it to turn on the broadcast scanning function, and generate and broadcast the timing extension data packet until positive feedback is received to complete clock synchronization.

Benefits of technology

The clock synchronization of multiple smart wearable devices is realized to ensure data time consistency and support smartphones to accurately calculate human characteristics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120583501A_ABST
    Figure CN120583501A_ABST
Patent Text Reader

Abstract

The invention discloses a timing method and device, equipment and a medium, and relates to the technical field of communication. The method is applied to a first electronic device providing a reference clock, the first electronic device is in communication connection with at least two second electronic devices, and the method comprises the steps that for any second electronic device, a timing instruction is sent to the second electronic device based on the communication connection with the second electronic device, the timing instruction is used for indicating the second electronic equipment to start a broadcast scanning function; broadcasting operation is executed, and the broadcasting operation comprises the steps that according to the current clock of the first electronic equipment and the identity label of the first electronic equipment, a time correction expansion data packet is generated, and the time correction expansion data packet is broadcasted in an expansion mode once; and determining that the timing is completed under the condition that positive feedback which is sent by the corresponding second electronic equipment and represents that the timing expansion data packet is scanned is received based on each communication connection. Based on the method, the first electronic device can control clock synchronization of different second electronic devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and more specifically, to a time synchronization method, device, equipment and medium. Background Art

[0002] Currently, a growing number of smart wearable devices, such as smart bracelets, smart watches, and smart rings, can monitor and record users' physical indicators, such as heart rate, heart sounds, and pulse, in real time. Furthermore, multiple smart wearable devices report these recorded physical indicator data to a smartphone, which then compiles and analyzes the data reported by these devices to derive human characteristics that reflect the user's health status, such as stress levels.

[0003] However, because multiple smart wearable devices have their own independent clocks, this can lead to clock asynchrony between them. This, in turn, can cause asynchrony in the physical indicator data reported by these devices, hindering the smartphone's ability to calculate human characteristics. Therefore, ensuring the synchronization of the independent clocks of multiple smart wearable devices has become a pressing technical issue. Summary of the Invention

[0004] One purpose of this application is to provide a new technical solution for time calibration.

[0005] According to a first aspect of the present application, a time calibration method is provided. The method is applied to a first electronic device that provides a reference clock, wherein the first electronic device is communicatively connected to at least two second electronic devices, respectively, and includes:

[0006] For any second electronic device, sending a time calibration instruction to the second electronic device based on the communication connection with the second electronic device, wherein the time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function;

[0007] Performing a broadcast operation, the broadcast operation comprising: generating a time synchronization extension data packet according to a current clock of the first electronic device and an identity identifier of the first electronic device, and broadcasting the time synchronization extension data packet once;

[0008] When positive feedback indicating that the timing synchronization extension data packet has been scanned and sent by the second electronic device is received based on each of the communication connections, it is determined that the timing synchronization is completed.

[0009] Optionally, after the extended broadcast of the timing extension data packet, the method further includes:

[0010] For any second electronic device, a query instruction is sent to the second electronic device based on the communication connection with the second electronic device, where the query instruction is used to instruct the second electronic device to send feedback to the first electronic device on whether the timing extension data packet is received.

[0011] Optionally, the method further includes:

[0012] If the positive feedback sent by the corresponding second electronic device is not received based on each communication connection, the step of repeatedly performing the broadcasting operation is repeated until the positive feedback sent by the corresponding second electronic device is received based on each communication connection.

[0013] Optionally, the extended broadcast of the time synchronization extension data packet once includes:

[0014] Broadcasting a data channel indication on a primary broadcast channel, wherein the data channel indication is used to indicate a target data channel used by the timing extension data packet when broadcasting;

[0015] The timing extension data packet is broadcast once on the target data channel.

[0016] Optionally, before performing the broadcast operation, the method further includes:

[0017] For any second electronic device, the identity of the first electronic device is sent to the second electronic device based on the communication connection with the second electronic device.

[0018] Optionally, performing the broadcast operation includes:

[0019] When the total number of the second electronic devices is less than a preset number, performing a broadcast operation once so that each of the second electronic devices receives the same extended timing data packet;

[0020] When the total number of the second electronic devices is greater than or equal to the preset number, the broadcast operation is performed continuously for a preset number of times, so that the second electronic devices can receive any timing extension data packet.

[0021] Optionally, the method further includes:

[0022] When it is determined that the time calibration is completed, for any of the second electronic devices, a deactivation instruction is sent to the second electronic device based on the communication connection with the second electronic device, instructing the second electronic device to deactivate the broadcast scanning function.

[0023] According to a second aspect of the present application, a time calibration method is provided. The method is applied to a second electronic device that calibrates time based on a reference clock, the second electronic device being communicatively connected to a first electronic device that provides the reference clock, including:

[0024] In case a time calibration instruction sent by the first electronic device is received based on the communication connection, starting a broadcast scanning function;

[0025] determining, based on the identity of the first electronic device, whether a time synchronization extension data packet extendedly broadcast by the first electronic device has been scanned;

[0026] In a case where it is determined that an extended timing data packet broadcast by the first electronic device has been scanned, the local clock of the second electronic device is calibrated according to the current clock of the first electronic device in the extended timing data packet, and positive feedback indicating that the extended timing data packet has been received is sent to the first electronic device based on the communication connection.

[0027] Optionally, the sending, to the first electronic device based on the communication connection, positive feedback indicating receipt of the timing extension data packet includes:

[0028] In a case where a query instruction sent by the first electronic device is received based on the communication connection, positive feedback indicating that the timing extension data packet is received is sent to the first electronic device based on the communication connection.

[0029] Optionally, the determining, based on the identity of the first electronic device, whether an extended timing data packet broadcast by the first electronic device is scanned includes:

[0030] determining, on the primary broadcast channel, whether a data channel indication sent by the first electronic device is received, the data channel indication being used to indicate a target data channel used by the timing extension data packet during extended broadcasting;

[0031] When the primary broadcast channel determines that the data channel indication has been received, determining a target data channel according to the data channel indication;

[0032] According to the identity identifier of the first electronic device, it is determined whether to scan the timing extension data packet extendedly broadcast by the first electronic device on the target data channel.

[0033] Optionally, before determining, based on the identity of the first electronic device, whether an extended timing data packet broadcast by the first electronic device is scanned, the method further includes:

[0034] An identity identifier of the first electronic device sent by the first electronic device is received based on the communication connection.

[0035] Optionally, the method further includes:

[0036] In a case where a deactivation instruction instructing the second electronic device to deactivate the broadcast scanning function is received from the first electronic device based on the communication connection, the broadcast scanning function is deactivated.

[0037] According to a third aspect of the present application, a time calibration device is provided. When the time calibration device is applied to a first electronic device that provides a reference clock, and when the first electronic device is communicatively connected to at least two second electronic devices, the time calibration device includes:

[0038] a first sending module, configured to send a time calibration instruction to any second electronic device based on a communication connection with the second electronic device, wherein the time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function;

[0039] an execution module, configured to execute a broadcast operation, the broadcast operation comprising: generating a time synchronization extension data packet according to a current clock of the first electronic device and an identity identifier of the first electronic device, and broadcasting the time synchronization extension data packet once;

[0040] a determining module, configured to determine that time synchronization is completed when positive feedback indicating that the time synchronization extension data packet has been scanned and sent by the second electronic device is received based on each of the communication connections;

[0041] When the time calibration device is applied to any of the second electronic devices, the device includes:

[0042] an enabling module, configured to enable a broadcast scanning function when a time calibration instruction sent by the first electronic device is received based on the communication connection;

[0043] A second determining module is configured to determine, based on the identity of the first electronic device, whether a time synchronization extension data packet extendedly broadcast by the first electronic device is scanned;

[0044] a timing module configured to, upon determining that a timing extension data packet broadcasted by the first electronic device has been scanned, calibrate a local clock of the second electronic device according to the current clock of the first electronic device in the timing extension data packet;

[0045] The second sending module is configured to send positive feedback indicating that the timing extension data packet has been received to the first electronic device based on the communication connection.

[0046] According to a fourth aspect of the present application, an electronic device is provided. In a case where the electronic device is a first electronic device that provides a reference clock, the first electronic device is communicatively connected to at least two second electronic devices, respectively. The electronic device includes the time calibration device applied to the first electronic device as described in the third aspect. Alternatively, the electronic device includes a memory and a processor, the memory being configured to store computer instructions, and the processor being configured to call the computer instructions from the memory to execute the method described in any one of the first aspects.

[0047] In the case where the electronic device is the second electronic device, the electronic device includes the time calibration device applied to the second electronic device in the third aspect, or the electronic device includes a memory and a processor, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of the second aspects;

[0048] According to a fifth aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the method according to any one of the first and second aspects is implemented.

[0049] The present application provides a time synchronization method, which is applied to a first electronic device that provides a reference clock, wherein the first electronic device is respectively connected to at least two second electronic devices for communication, including: for any second electronic device, sending a time synchronization instruction to the second electronic device based on the communication connection with the second electronic device, wherein the time synchronization instruction is used to instruct the second electronic device to turn on the broadcast scanning function; performing a broadcast operation, wherein the broadcast operation includes: generating a time synchronization extension data packet based on the current clock of the first electronic device and the identity identifier of the first electronic device, and extending the broadcast of the time synchronization extension data packet once; determining that the time synchronization is completed when positive feedback representing the scan to the time synchronization extension data packet sent by the corresponding second electronic device is received based on each communication connection. Based on this method, the first electronic device can control the clock synchronization of different second electronic devices. In the case where the first electronic device is a smart phone and the multiple second electronic devices are multiple smart wearable devices, the individual clock synchronization of the multiple smart wearable devices can be guaranteed based on this method.

[0050] Other features and advantages of the present application will become apparent from the following detailed description of exemplary embodiments of the present application with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments of the application and, together with the description, serve to explain the principles of the application.

[0052] Figure 1This is a schematic diagram of the process of a time calibration method provided by this application Figure 1 ;

[0053] Figure 2 This is a schematic diagram of the process of a time calibration method provided by this application Figure 2 ;

[0054] Figure 3 This is a schematic diagram of the structure of a time calibration device provided by this application. Figure 1 ;

[0055] Figure 4 This is a schematic diagram of the structure of a time calibration device provided by this application. Figure 2 ;

[0056] Figure 5 This is a structural diagram of an electronic device provided by this application. DETAILED DESCRIPTION

[0057] Various exemplary embodiments of the present application will now be described in detail with reference to the accompanying drawings. It should be noted that unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and numerical values ​​set forth in these embodiments do not limit the scope of the present application.

[0058] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.

[0059] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.

[0060] In all examples shown and discussed herein, any specific values ​​should be interpreted as merely exemplary and not limiting. Therefore, other examples of the exemplary embodiments may have different values.

[0061] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.

[0062] This application provides a time synchronization method, in which a first electronic device providing a reference clock synchronizes the time of at least two second electronic devices in communication with the first electronic device, thereby synchronizing the clocks of the second electronic devices. Specifically, the first electronic device serves as the time synchronization device, and the second electronic device serves as the device to be synchronized.

[0063] In one example, the communication connection is a Bluetooth connection, and of course, it can also be other types of communication connections, such as a Wi-Fi connection. The first electronic device is a smart phone, and the at least two second electronic devices are respectively a smart watch and a smart bracelet.

[0064] When the time calibration method provided in this application is applied to a first electronic device, such as Figure 1 As shown, the process includes the following steps S1100 to S1300.

[0065] Step S1100: For any second electronic device, a time calibration instruction is sent to the second electronic device based on the communication connection with the second electronic device.

[0066] The time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function.

[0067] In this embodiment, when the first electronic device establishes communication connections with at least two second electronic devices respectively, the first electronic device can send a timing instruction to the corresponding second electronic device through the communication connection with each second electronic device to instruct the corresponding second electronic device to enable the broadcast scanning function.

[0068] On the basis of the above content, when the time calibration method provided in this application is applied to any second electronic device, such as Figure 2 As shown, it includes the following steps S2100 to S2300.

[0069] Step S2100: When a time calibration instruction is received from the first electronic device based on the communication connection, the broadcast scanning function is enabled.

[0070] In this embodiment, the second electronic device starts a broadcast scanning function after receiving a time calibration instruction sent by the first electronic device based on the communication connection with the first electronic device, so as to wait for time calibration.

[0071] In one embodiment of the present application, the specific implementation of the above-mentioned step S2100 can be: in the case of receiving a time calibration instruction sent by the first electronic device based on the communication connection, a confirmation receipt reply is sent to the first electronic device to confirm the receipt of the time calibration instruction, and the broadcast scanning function is turned on; in the case of not receiving the time calibration instruction sent by the first electronic device based on the communication connection, a confirmation receipt reply is not sent to the first electronic device, and the broadcast scanning function is not turned on. On this basis, when the time calibration method is applied to the first electronic device, the time calibration method provided in the present application further includes, after executing the following step S1100: in the case of receiving a confirmation receipt reply sent by the corresponding second electronic device based on each communication connection, step S1200 is triggered, otherwise step S1100 is repeated until a confirmation receipt reply sent by the corresponding second electronic device is received based on each communication connection. In this way, it can be ensured that the broadcast scanning function is turned on for each second electronic device.

[0072] Step S1200: Execute a broadcast operation.

[0073] The broadcast operation includes the following steps S1210 to S1220.

[0074] Step S1210: Generate a time synchronization extension data packet according to the current clock of the first electronic device and the identity of the first electronic device.

[0075] In this embodiment, the current clock of the first electronic device is recorded as T1. The current clock T1 of the first electronic device is used to represent the reference clock, and the identity of the first electronic device is used for the second electronic device to identify the first electronic device.

[0076] The specific implementation of the above step S1210 is: taking the current clock T1 of the first electronic device and the identity of the first electronic device as valid data; encapsulating the above valid data into an extended data packet according to the data encapsulation format corresponding to the extended broadcast, and recording it as a time calibration extended data packet.

[0077] Step S1220: Extend and broadcast a time synchronization extension data packet.

[0078] It should be noted that when ordinary broadcasting broadcasts data, the same data is broadcast sequentially on different channels. On this basis, if ordinary broadcasting is used to broadcast a time synchronization extension data packet once, then a time synchronization extension data packet will be broadcast sequentially on different channels (channel 37, channel 38 and channel 39 respectively), which will cause the time synchronization extension data packet to be broadcast at different times. At this time, there is a situation where different second electronic devices receive the same time synchronization extension data broadcast at different times. This situation causes the actual current time T2 of the first electronic device when the second electronic device last receives the time synchronization extension data packet to have a large time delay with the current clock T1 of the first electronic device included in the time synchronization extension data packet (the second electronic device synchronizes the time based on the last received time synchronization extension data packet). In order to avoid this problem, in this embodiment, unlike ordinary broadcasting, the above-mentioned step S1200 can achieve that a time synchronization extension data packet is broadcast only once. In this way, it can be ensured that different second electronic devices receive the same time synchronization extension data packet broadcast by the first electronic device at the same time as much as possible. In this way, the time delay between the first electronic device's current time T3 when the second electronic device receives the extended time calibration data packet and the first electronic device's current clock T1 included in the extended time calibration data packet is smaller than the time delay between the first electronic device's actual current time T2 when the second electronic device last received the extended time calibration data packet and the first electronic device's current clock T1 included in the extended time calibration data packet. Based on this, when the second electronic device uses the first electronic device's current clock T1 to calibrate its local clock, the local clock of the second electronic device after calibration is closer to the reference clock provided by the first electronic device.

[0079] With respect to the above-mentioned step S1210, the time synchronization method applied to the second electronic device provided in the present application executes the following step S2200.

[0080] Step S2200: Determine whether an extended timing data packet broadcast by the first electronic device is scanned based on the identity of the first electronic device.

[0081] In this embodiment, the second electronic device pre-stores the identity of the first electronic device. The second electronic device uses the pre-stored identity of the first electronic device to filter the scanned broadcast packets. If the scanned broadcast packet includes an identity that is identical to the pre-stored identity of the first electronic device, it is determined that a timing extension data packet has been scanned and that the scanned broadcast packet is a timing extension data packet of the extended broadcast of the first television device. Based on this, the second electronic device proceeds to perform the following step S2300.

[0082] Step S2300, when it is determined based on the identity of the first electronic device that the extended broadcast timing data packet of the first electronic device has been scanned, calibrate the local clock of the second electronic device based on the current clock of the first electronic device in the extended timing data packet, and send positive feedback indicating that the extended timing data packet has been received to the first electronic device based on the communication connection.

[0083] In this embodiment, when the second electronic device scans the extended time synchronization data packet broadcast by the first electronic device, it parses the current clock T1 of the first electronic device from the extended time synchronization data packet and uses the current clock T1 of the first electronic device as the local clock of the second electronic device. In this way, the time synchronization of the second electronic device by the first electronic device is completed. It should be noted that there is a delay from the time when the first electronic device extends the broadcast of the extended time synchronization data packet to the time when the second electronic device scans the extended time synchronization data packet, but under the broadcast mechanism, the aforementioned delay is very small and can be ignored. Therefore, the second electronic device can directly use the current clock T1 of the first electronic device as the local clock of the second electronic device to realize the time synchronization of the second electronic device by the first electronic device.

[0084] It can be understood that if each second electronic device scans the extended time synchronization data packet of the first electronic device, based on the above step S2300, each second electronic device uses the current clock T1 of the first electronic device in the same extended time synchronization data packet as the local clock in the second electronic device. At this time, different second electronic devices achieve clock synchronization. On this basis, it can be seen that the second electronic device needs to inform the first electronic device whether it has scanned the extended time synchronization data packet of the first electronic device, so that the first electronic device can determine whether each second electronic device has scanned the extended time synchronization data packet of the first electronic device and further complete the clock synchronization of different second electronic devices, and then determine whether to end the time synchronization of the second electronic device. Based on this, when the second electronic device determines that the extended time synchronization data packet of the first electronic device has been scanned according to the identity identifier of the first electronic device, it sends positive feedback to the first electronic device based on the communication connection to indicate that the extended time synchronization data packet has been received.

[0085] Of course, there is also a situation where the second electronic device fails to scan the extended time synchronization data packet broadcast by the first electronic device for some reason. When the second electronic device fails to scan the extended time synchronization data packet broadcast by the first electronic device within the preset time duration after receiving the time synchronization indication, it does not send positive feedback to the first electronic device based on the communication connection to indicate that the extended time synchronization data packet has been received, or sends negative feedback to the first electronic device based on the communication connection to indicate that the extended time synchronization data packet has not been received. The preset time duration is the normal time duration from the second electronic device receiving the time synchronization indication to the second electronic device scanning the extended time synchronization data packet, which can be determined based on experience or experiments.

[0086] Corresponding to the above step S2300, the time synchronization method applied to the first electronic device provided in the present application further includes the following step S1300.

[0087] Step S1300 : When positive feedback indicating that an extended data packet has been scanned and sent by the corresponding second electronic device is received based on each communication connection, it is determined that the time synchronization is completed.

[0088] Based on the above step S2300, it can be known that after the second electronic device scans the time synchronization extension data packet, it calibrates the local clock according to the current clock T1 of the first electronic device in the time synchronization extension data packet. Therefore, based on the fact that each communication connection receives positive feedback representing the scanning of the time synchronization broadcast packet sent by the corresponding second electronic device, it is determined that each second electronic device has scanned the time synchronization extension data packet, and each second electronic device has calibrated the local clock according to the current clock T1 of the first electronic device in the time synchronization extension data packet, thereby determining that the clocks of different second electronic devices are synchronized. Therefore, based on the fact that each communication connection receives positive feedback representing the scanning of the extended data packet sent by the corresponding second electronic device, it is determined that the time synchronization is completed.

[0089] Corresponding to the above step S1300, when no positive feedback is received from the corresponding second electronic device based on each communication connection, the time synchronization method applied to the first electronic device provided in the present application further includes the following step S1400.

[0090] Step S1400 : if positive feedback sent by the corresponding second electronic device is not received based on each communication connection, repeat the broadcasting operation until positive feedback sent by the corresponding second electronic device is received based on each communication connection.

[0091] Taking the total number of second electronic devices as 5 as an example, if the first electronic device receives less than 5 positive feedbacks based on 5 communication connections, it is determined that the positive feedback sent by at least one second electronic device based on the corresponding communication connection has not been received. At this time, there is at least one second electronic device among the 5 second electronic devices that has not been calibrated, and cannot maintain clock synchronization with other second electronic devices, that is, the clock synchronization between different second electronic devices has not been completed. At this time, the first electronic device repeats the above step S1200 until it receives positive feedback sent by the corresponding second electronic device based on each communication connection. It should be noted that when the above step S1300 is repeatedly executed, the current clock of the first electronic device encapsulated in the time synchronization extension data packet will no longer be the current clock T1, but the current clock T4 of the first electronic device when the above step S1300 is repeated.

[0092] Based on the above content, the present application provides a time synchronization method, which is applied to a first electronic device that provides a reference clock, and the first electronic device is respectively connected to at least two second electronic devices for communication, including: for any second electronic device, sending a time synchronization instruction to the second electronic device based on the communication connection with the second electronic device, wherein the time synchronization instruction is used to instruct the second electronic device to turn on the broadcast scanning function; performing a broadcast operation, the broadcast operation including: generating a time synchronization extension data packet based on the current clock of the first electronic device and the identity of the first electronic device, and extending the broadcast of the time synchronization extension data packet once; determining that the time synchronization is completed when positive feedback representing the scan to the time synchronization extension data packet sent by the corresponding second electronic device is received based on each communication connection. Based on this method, the first electronic device can control the clock synchronization of different second electronic devices. In the case where the first electronic device is a smart phone and the multiple second electronic devices are multiple smart wearable devices, the individual clock synchronization of the multiple smart wearable devices can be guaranteed based on this method.

[0093] Based on any of the above embodiments, the time synchronization method for a first electronic device provided in the present application further includes the following step S1600 after the above step S1300.

[0094] Step S1600: When it is determined that the time calibration is completed, for any second electronic device, a shut-down instruction is sent to the second electronic device based on the communication connection with the second electronic device, instructing the second electronic device to shut down the broadcast scanning function.

[0095] In this embodiment, if the time calibration is completed, it is determined that the second electronic device does not need to continue to enable the broadcast scanning function. At this time, based on the communication connection with each second electronic device, a shutdown instruction is sent to the corresponding second electronic device to instruct the second electronic device to disable the broadcast scanning function.

[0096] Corresponding to the above step S1600, the time synchronization method for the second electronic device provided in the present application further includes the following step S2400 after the above step S2300.

[0097] Step S2400: When a deactivation instruction instructing the second electronic device to deactivate the broadcast scanning function is received from the first electronic device based on the communication connection, the broadcast scanning function is deactivated.

[0098] Through the above step S2400, the second electronic device can turn off the broadcast scanning function after the time calibration is completed, thereby avoiding the waste of power consumption caused by the second electronic device meaninglessly turning on the broadcast scanning function.

[0099] In one embodiment of the present application, when there are too many second electronic devices, if the first electronic device broadcasts an extended timing data packet, there is a high probability (e.g., 70%) that multiple second electronic devices will not be able to scan the extended timing data packet. This will cause the first electronic device to repeat the above step S1200 multiple times, thereby resulting in a long time to complete the timing method provided by the present application and low timing efficiency. In order to solve this problem, the above step S1200 is specifically implemented through the following steps S1230 and S1240.

[0100] Step S1230: When the total number of second electronic devices is less than a preset number, a broadcast operation is performed so that each second electronic device receives the same timing extension data packet.

[0101] In this embodiment, the preset number is the minimum total number of second electronic devices required for the first electronic device to extend the broadcast of a time synchronization extension data packet once, with a high probability (e.g., 70%) that all of them will not be able to scan the time synchronization extension data packet. On this basis, if the total number of second electronic devices is less than the preset number, it indicates that there is a high probability that all of the second electronic devices will be able to scan the time synchronization extension data packet. In this case, the first electronic device performs the broadcast operation, thereby extending the broadcast of the time synchronization extension data packet once.

[0102] The preset number may be determined based on experience or experiments. In one example, the preset number is 10.

[0103] Step S1240: When the total number of second electronic devices is greater than or equal to a preset number, the broadcast operation is performed continuously for a preset number of times, so that the second electronic devices can receive any timing extension data packet.

[0104] In this embodiment, if the total number of second electronic devices is greater than or equal to the preset number, it means that it is highly likely that the second electronic devices cannot all scan the timing extension data packet. In this case, the broadcast operation is performed a preset number of times to extend the broadcast of the timing extension data packet by the preset number of times.

[0105] The preset number of broadcast operations is the number of broadcast operations that ensures that a predetermined number of second electronic devices scan the timing extension data packet with a high probability. The preset number of broadcast operations can be set based on experience or experimentation. In one example, the preset number of broadcast operations is 3.

[0106] It should be noted that, taking a preset number of three times as an example, based on step S1240, the first electronic device sequentially broadcasts extended time synchronization data packets, each designated as a first extended time synchronization data packet, a second extended time synchronization data packet, and a third extended time synchronization data packet. The first extended time synchronization data packet includes the first electronic device's identity and its current clock, T1; the second extended time synchronization data packet includes the first electronic device's identity and its current clock, T5; and the third extended time synchronization data packet includes the first electronic device's identity and its current clock, T6. After executing step S1200, the second electronic device scans one of the first, second, and third extended time synchronization data packets and adjusts its time based on the first electronic device's current clock as contained in the scanned extended time synchronization data packet, with the current clock of the first electronic device as the last scanned extended time synchronization data packet serving as the time reference. Based on this, the maximum deviation between the local clocks of the two electronic devices is T6 - T1. However, T6 - T1 represents the delay incurred when performing the broadcast operation twice in a row. Under the broadcast mechanism, this delay is very short and negligible.

[0107] Based on any of the above embodiments, for the above step S1220, in order to determine whether each second electronic device has scanned the timing extension data packet extended and broadcast by the first electronic device based on the above step S1220, the first electronic device continues to execute the following step S1250 after the above step S1220.

[0108] Step S1250: For any second electronic device, a query instruction is sent to the second electronic device based on the communication connection with the second electronic device.

[0109] The query instruction is used to instruct the second electronic device to send feedback to the first electronic device on whether the timing extension data packet is received.

[0110] In this embodiment, after the first electronic device broadcasts the extended timing data packet once, it sends a query instruction to each second electronic device to determine whether each second electronic device has scanned the extended timing data packet.

[0111] Corresponding to the above-mentioned step S1250, in the time synchronization method applied to the second electronic device provided in this application, the positive feedback indicating the receipt of the time synchronization extension data packet is sent to the first electronic device based on the communication connection in step S2300, which is specifically implemented by the following step S2310.

[0112] Step S2310: When a query instruction is received from the first electronic device based on the communication connection, positive feedback indicating that the timing extension data packet is received is sent to the first electronic device based on the communication connection.

[0113] In one embodiment of the present application, the above-mentioned step S1220 is specifically implemented through the following steps S1221 and S122.

[0114] Step S1221: broadcast a data channel indication on a primary broadcast channel.

[0115] The data channel indication is used to indicate the target data channel used by the timing extension data packet during broadcasting.

[0116] Step S1222: broadcast a timing extension data packet on the target data channel.

[0117] In this embodiment, a specific implementation method of extending the broadcast of a time synchronization extension data packet is provided.

[0118] Corresponding to the above-mentioned steps S1221 and S1222, in the time synchronization method applied to the second electronic device provided by the present application, step S2200 is specifically implemented through the following steps S2210 to S2230.

[0119] Step S2210: determining whether a data channel indication sent by the first electronic device is received on the primary broadcast channel, where the data channel indication is used to indicate a target data channel used by the timing extension data packet during extended broadcasting.

[0120] Step S2220: When the primary broadcast channel receives the data channel indication, determine the target data channel according to the data channel indication;

[0121] Step S2230: Determine, based on the identity of the first electronic device, whether to scan the target data channel for the extended timing data packet broadcast by the first electronic device.

[0122] Based on the above steps S2210 to S2230, the second electronic device can scan the timing extension data packet extended broadcast by the first electronic device.

[0123] In one embodiment of the present application, the first electronic device notifies the second electronic device of its own identity in advance. Based on this, the time synchronization method for the first electronic device provided in the present application further includes the following step S1260 before the above step S1200.

[0124] Step S1260: For any second electronic device, the identity of the first electronic device is sent to the second electronic device based on the communication connection with the second electronic device.

[0125] Corresponding to the above step S1260, the time synchronization method applied to the second electronic device provided by the present application further includes the following step S2240 before the above step S2200.

[0126] Step S2240: Receive the identity of the first electronic device sent by the first electronic device based on the communication connection.

[0127] Based on the above step S2240, the second electronic device can obtain the identity of the first electronic device based on the communication connection with the first electronic device.

[0128] like Figure 3 As shown, the present application further provides a time calibration device 300, which is applied to a first electronic device that provides a reference clock. When the first electronic device is communicatively connected to at least two second electronic devices, the time calibration device 300 includes:

[0129] A first sending module 310 is configured to send a time calibration instruction to any second electronic device based on a communication connection with the second electronic device, wherein the time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function;

[0130] An execution module 320 is configured to execute a broadcast operation, wherein the broadcast operation includes: generating a time synchronization extension data packet according to a current clock of the first electronic device and an identity identifier of the first electronic device, and broadcasting the time synchronization extension data packet once;

[0131] The first determining module 330 is configured to determine that the time synchronization is completed when positive feedback indicating that the time synchronization extension data packet sent by the second electronic device has been scanned is received based on each of the communication connections.

[0132] In one embodiment of the present application, the first sending module 310 is also used to send a query instruction to any second electronic device based on the communication connection with the second electronic device, and the query instruction is used to instruct the second electronic device to send feedback to the first electronic device on whether the timing extension data packet is received.

[0133] In one embodiment of the present application, the execution module 320 is also used to repeat the steps of the broadcast operation until the positive feedback sent by the corresponding second electronic device is received based on each communication connection, if the positive feedback sent by the corresponding second electronic device is not received based on each communication connection.

[0134] In one embodiment of the present application, the execution module 320 is specifically configured to broadcast a data channel indication on a primary broadcast channel, where the data channel indication is used to indicate a target data channel used by the timing extension data packet when broadcasting;

[0135] The timing extension data packet is broadcast once on the target data channel.

[0136] In one embodiment of the present application, the first sending module 310 is further configured to send the identity of the first electronic device to any second electronic device based on the communication connection with the second electronic device.

[0137] In one embodiment of the present application, the execution module 320 is specifically configured to, when the total number of the second electronic devices is less than a preset number, perform a broadcast operation so that each of the second electronic devices receives the same extended timing data packet;

[0138] When the total number of the second electronic devices is greater than or equal to the preset number, the broadcast operation is performed continuously for a preset number of times, so that the second electronic devices can receive any timing extension data packet.

[0139] In one embodiment of the present application, the first sending module 310 is further used to, when it is determined that the time calibration is completed, send a shutdown instruction to any second electronic device based on the communication connection with the second electronic device, instructing the second electronic device to turn off the broadcast scanning function.

[0140] like Figure 4 As shown, the present application further provides another time calibration device 400, which is applied to any second electronic device and includes:

[0141] An enabling module 410, configured to enable a broadcast scanning function when a time calibration instruction sent by the first electronic device is received based on the communication connection;

[0142] A second determining module 420 is configured to determine, based on the identity of the first electronic device, whether a timing extension data packet broadcast by the first electronic device is scanned;

[0143] a time calibration module 430 configured to, upon determining that a time calibration extended data packet broadcast by the first electronic device has been scanned, calibrate a local clock of the second electronic device according to the current clock of the first electronic device in the time calibration extended data packet;

[0144] The second sending module 440 is configured to send positive feedback indicating that the timing extension data packet has been received to the first electronic device based on the communication connection.

[0145] In one embodiment of the present application, the second sending module 440 is specifically configured to send positive feedback indicating receipt of the timing extension data packet to the first electronic device based on the communication connection when a query instruction sent by the first electronic device is received based on the communication connection.

[0146] In one embodiment of the present application, the second determining module 420 is specifically configured to determine whether a data channel indication sent by the first electronic device is received on the primary broadcast channel, the data channel indication being used to indicate a target data channel used by the timing extension data packet during the extended broadcast;

[0147] When the primary broadcast channel determines that the data channel indication has been received, determining a target data channel according to the data channel indication;

[0148] According to the identity identifier of the first electronic device, it is determined whether to scan the timing extension data packet extendedly broadcast by the first electronic device on the target data channel.

[0149] In one embodiment of the present application, the time calibration device 400 further includes:

[0150] The receiving module is configured to receive the identity of the first electronic device sent by the first electronic device based on the communication connection.

[0151] In one embodiment of the present application, the time calibration device 400 further includes:

[0152] The closing module is configured to close the broadcast scanning function when a closing instruction instructing the second electronic device to close the broadcast scanning function is received from the first electronic device based on the communication connection.

[0153] The present application also provides an electronic device, in which, when the electronic device is a first electronic device providing a reference clock, the first electronic device is communicatively connected to at least two second electronic devices respectively, and the electronic device includes the time calibration device 300 as applied to the first electronic device, or Figure 5As shown, the electronic device 500 includes a memory 510 and a processor 520, the memory 510 is used to store computer instructions, and the processor 520 is used to call the computer instructions from the memory to execute any one of the methods in the embodiment of the time synchronization method applied to the first electronic device;

[0154] In the case where the electronic device is the second electronic device, the electronic device includes a time calibration device 400 applied to the second electronic device, or, as Figure 5 As shown, the electronic device includes a memory 510 and a processor 520, the memory 510 is used to store computer instructions, and the processor 520 is used to call the computer instructions from the memory 510 to execute a method as described in any one of the embodiments of the time synchronization method applied to the second electronic device.

[0155] The present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the computer program implements any one of the methods provided in the above method embodiments.

[0156] The present application may be a system, method and / or computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present application.

[0157] A computer-readable storage medium can be a tangible device that can hold and store instructions for use by an instruction execution device. A computer-readable storage medium can be, for example, but not limited to, an electrical storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanical encoding device, such as a punch card or a raised structure in a groove on which instructions are stored, and any suitable combination thereof. As used herein, a computer-readable storage medium is not to be construed as a transient signal per se, such as a radio wave or other freely propagating electromagnetic wave, an electromagnetic wave propagating through a waveguide or other transmission medium (e.g., a light pulse through a fiber optic cable), or an electrical signal transmitted through an electrical wire.

[0158] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions to be stored in the computer-readable storage medium in each computing / processing device.

[0159] The computer program instructions for performing the operation of the present application can be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data or source code or object code written in any combination of one or more programming languages, wherein the programming language includes object-oriented programming languages ​​such as Smalltalk, C++, and conventional procedural programming languages ​​such as "C" language or similar programming languages. Computer-readable program instructions can be executed completely on the user's computer, partially on the user's computer, executed as an independent software package, partially on the user's computer and partially on a remote computer, or executed completely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer by any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (such as by using an Internet service provider to connect to the Internet). In certain embodiments, by utilizing the state information of computer-readable program instructions to personalize electronic circuits, such as programmable logic circuits, field programmable gate arrays (FPGAs) or programmable logic arrays (PLAs), the electronic circuits can execute computer-readable program instructions, thereby realizing various aspects of the present application.

[0160] Various aspects of the present application are described herein with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It should be understood that each block of the flowcharts and / or block diagrams, and combinations of blocks in the flowcharts and / or block diagrams, can be implemented by computer-readable program instructions.

[0161] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processor of the computer or other programmable data processing device, a device is generated that implements the functions / actions specified in one or more blocks in the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium, where these instructions cause the computer, programmable data processing device, and / or other device to operate in a specific manner. Thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing various aspects of the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0162] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0163] The flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the systems, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a part of a module, program segment or instruction, and the part of the module, program segment or instruction contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system that performs the specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions. It is well known to those skilled in the art that implementation by hardware, implementation by software, and implementation by a combination of software and hardware are all equivalent.

[0164] The embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terms used herein are selected to best explain the principles of the embodiments, practical applications, or technical improvements to technologies in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein. The scope of this application is defined by the appended claims.

Claims

1. A time calibration method, characterized in that: The method is applied to a first electronic device that provides a reference clock, wherein the first electronic device is communicatively connected to at least two second electronic devices respectively, and includes: For any second electronic device, sending a time calibration instruction to the second electronic device based on the communication connection with the second electronic device, wherein the time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function; Performing a broadcast operation, the broadcast operation comprising: generating a time synchronization extension data packet according to a current clock of the first electronic device and an identity identifier of the first electronic device, and broadcasting the time synchronization extension data packet once; When positive feedback indicating that the timing synchronization extension data packet has been scanned and sent by the second electronic device is received based on each of the communication connections, it is determined that the timing synchronization is completed.

2. The method according to claim 1, characterized in that After the extended broadcast of the timing extension data packet, the method further includes: For any second electronic device, a query instruction is sent to the second electronic device based on the communication connection with the second electronic device, where the query instruction is used to instruct the second electronic device to send feedback to the first electronic device on whether the timing extension data packet is received.

3. The method according to claim 1, characterized in that The method further comprises: If the positive feedback sent by the corresponding second electronic device is not received based on each communication connection, the step of repeatedly performing the broadcasting operation is repeated until the positive feedback sent by the corresponding second electronic device is received based on each communication connection.

4. The method according to claim 1, wherein The extended broadcast of the time calibration extension data packet includes: Broadcasting a data channel indication on a primary broadcast channel, wherein the data channel indication is used to indicate a target data channel used by the timing extension data packet when broadcasting; The timing extension data packet is broadcast once on the target data channel.

5. The method according to claim 1, wherein Before performing the broadcast operation, the method further includes: For any second electronic device, the identity of the first electronic device is sent to the second electronic device based on the communication connection with the second electronic device.

6. The method according to claim 1, wherein The performing of the broadcast operation includes: When the total number of the second electronic devices is less than a preset number, performing a broadcast operation so that each of the second electronic devices receives the same extended timing data packet; When the total number of the second electronic devices is greater than or equal to the preset number, the broadcast operation is performed continuously for a preset number of times, so that the second electronic devices can receive any timing extension data packet.

7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: When it is determined that the time calibration is completed, for any of the second electronic devices, a deactivation instruction is sent to the second electronic device based on the communication connection with the second electronic device, instructing the second electronic device to deactivate the broadcast scanning function.

8. A time calibration method, characterized in that: The method is applied to a second electronic device that calibrates time according to a reference clock, wherein the second electronic device is communicatively connected to a first electronic device that provides the reference clock, and includes: In case a time calibration instruction sent by the first electronic device is received based on the communication connection, starting a broadcast scanning function; determining, based on the identity of the first electronic device, whether a time synchronization extension data packet extendedly broadcast by the first electronic device has been scanned; In a case where it is determined that an extended timing data packet broadcast by the first electronic device has been scanned, the local clock of the second electronic device is calibrated according to the current clock of the first electronic device in the extended timing data packet, and positive feedback indicating that the extended timing data packet has been received is sent to the first electronic device based on the communication connection.

9. A time calibration device, characterized in that: In the case where the time calibration device is applied to a first electronic device that provides a reference clock, and the first electronic device is communicatively connected to at least two second electronic devices respectively, the time calibration device includes: a first sending module, configured to send a time calibration instruction to any second electronic device based on a communication connection with the second electronic device, wherein the time calibration instruction is used to instruct the second electronic device to enable a broadcast scanning function; an execution module, configured to execute a broadcast operation, the broadcast operation comprising: generating a time synchronization extension data packet according to a current clock of the first electronic device and an identity identifier of the first electronic device, and broadcasting the time synchronization extension data packet once; A first determining module is configured to determine that time synchronization is completed when positive feedback indicating that the time synchronization extension data packet has been scanned and sent by the second electronic device is received based on each of the communication connections; When the time calibration device is applied to any of the second electronic devices, the device includes: an enabling module, configured to enable a broadcast scanning function when a time calibration instruction sent by the first electronic device is received based on the communication connection; A second determining module is configured to determine, based on the identity of the first electronic device, whether a time synchronization extension data packet extendedly broadcast by the first electronic device is scanned; a timing module configured to, upon determining that a timing extension data packet broadcasted by the first electronic device has been scanned, calibrate a local clock of the second electronic device according to the current clock of the first electronic device in the timing extension data packet; The second sending module is configured to send positive feedback indicating that the timing extension data packet has been received to the first electronic device based on the communication connection.

10. An electronic device, characterized in that: In a case where the electronic device is a first electronic device that provides a reference clock, the first electronic device is communicatively connected to at least two second electronic devices respectively, and the electronic device includes the time calibration device applied to the first electronic device as claimed in claim 9, or the electronic device includes a memory and a processor, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method according to any one of claims 1 to 7; In the case where the electronic device is the second electronic device, the electronic device includes the time calibration device applied to the second electronic device as claimed in claim 9, or the electronic device includes a memory and a processor, the memory is used to store computer instructions, and the processor is used to call the computer instructions from the memory to execute the method as claimed in claim 8.

Citation Information

Cited By

  • Time calibration device and method

    CN119828437A

  • Time calibration device and method

    CN119828437B