Time synchronization method, device, storage medium and slave device

By segmenting and adjusting the time error of the slave device, high-precision time synchronization is achieved, solving the problem of discontinuous time code synchronization in existing technologies and ensuring time signal synchronization between devices.

CN118400477BActive Publication Date: 2025-01-10APUTURE IMAGING IND CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202410823198.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2025-01-10
Estimated Expiration
2044-06-25

AI Technical Summary

Technical Problem

Existing time code synchronization methods are not accurate enough, causing devices to be unable to recognize them, and the output time signal waveform is discontinuous, affecting time synchronization between devices.

Method used

By determining the time error between the master and slave devices, it is divided into multiple sub-time errors, and the pulse width is adjusted in the slave device's time signal to synchronize the slave device's time signal with the master device's time signal.

Benefits of technology

It improves the accuracy of time synchronization, avoids situations where the device cannot recognize the timecode waveform, and ensures the continuity of the time signal.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118400477B_ABST
    Figure CN118400477B_ABST
Patent Text Reader

Abstract

The present application discloses a time synchronization method, device, storage medium and slave, the method comprising: determining a first time signal corresponding to the time information according to the time information of the received host, and determining the first moment information corresponding to the start synchronization moment in the first time signal, obtaining a second time signal in the slave, and determining the second moment information corresponding to the start synchronization moment in the second time signal; determining the time error between the first moment information and the second moment information; determining the signal parameter of the second time signal, dividing the time error into a plurality of sub-time errors according to the signal parameter; adjusting the second time signal of the slave after the start synchronization moment according to the plurality of sub-time errors, so that the second time signal is synchronized with the first time signal. The present application can avoid the situation that the device cannot be recognized due to the sudden change of the signal in the slave, and can also improve the accuracy of time synchronization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of time synchronization, and in particular to a time synchronization method, device, storage medium and slave. Background Art

[0002] Time code is the time code recorded for each frame of an image when the camera records the image signal. All current digital cameras have a time code function. Time code is mainly used to meet the need to calibrate time between different devices, such as matching the image and sound at the same time in the camera and recorder, recording the lines at the corresponding time when shooting a movie, so that the actors can dub according to the timeline later, or splicing videos, etc.

[0003] Since there are certain errors in the frequency of time calculation of different devices, when the time code is not synchronized or the error is large after synchronization, the device will not be able to recognize it. The current time code synchronization method is not accurate, and the waveform corresponding to the time signal output during synchronization is discontinuous, which will cause the device to be unable to recognize it. Summary of the invention

[0004] The embodiments of the present application provide a time synchronization method, device, storage medium and slave device, which can improve the accuracy of time synchronization, and the waveform corresponding to the time signal output by the method is continuous, avoiding the situation where the device cannot recognize it.

[0005] The embodiment of the present application provides a time synchronization method, which is applied to a slave machine, including:

[0006] Determine a first time signal corresponding to the time information according to the received time information of the host, and determine first time information corresponding to the start synchronization moment in the first time signal, obtain a second time signal in the slave, and determine second time information corresponding to the start synchronization moment in the second time signal;

[0007] Determining a time error between the first moment information and the second moment information;

[0008] determining a signal parameter of the second time signal, and dividing the time error into a plurality of sub-time errors according to the signal parameter;

[0009] The second time signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal.

[0010] The embodiment of the present application also provides a time code synchronization device, which includes an information receiving module, an error determination module and a synchronization module;

[0011] The information receiving and determining module is used to receive the time information of the host, determine the first time signal corresponding to the time information according to the received time information of the host, and determine the first time information corresponding to the start synchronization moment in the first time signal; obtain the second time signal in the slave, and determine the second time information corresponding to the start synchronization moment in the second time signal;

[0012] The error determination module is used to determine a time error between the first moment information and the second moment information, and determine a signal parameter of the second time signal, and divide the time error into a plurality of sub-time errors according to the signal parameter;

[0013] The synchronization module is used to adjust the second time signal of the slave after the synchronization start time according to a plurality of sub-time errors, so that the second time signal is synchronized with the first time signal.

[0014] The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute any of the above-mentioned time synchronization methods.

[0015] An embodiment of the present application also provides a slave machine, including a processor and a memory, wherein the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used for the steps in any of the above-mentioned time synchronization methods.

[0016] The time synchronization method, device, storage medium and slave provided by the present application determine the time error between the first moment information of the host at the start of synchronization and the second moment information of the slave at the start of synchronization, and divide the time error into multiple sub-time errors and add them to the second time signal of the slave, so that the second time signal of the slave is synchronized with the first time signal of the host. This method slows down the change of the second time signal of the slave by dividing the time error into multiple sub-time errors, avoids the situation where the slave cannot recognize the device due to a sudden signal change, and can also improve the accuracy of time synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The technical solution and other beneficial effects of the present application will be made apparent by describing in detail the specific implementation methods of the present application in conjunction with the accompanying drawings.

[0018] Figure 1 A schematic diagram of a scenario for applying the time synchronization method provided in an embodiment of the present application.

[0019] Figure 2 This is a principle example diagram of the time synchronization method in the related technology provided in the embodiment of the present application.

[0020] Figure 3A flowchart of a time synchronization method provided in an embodiment of the present application.

[0021] Figure 4 A schematic diagram of the principles of a time synchronization method provided in an embodiment of the present application.

[0022] Figure 5 A schematic diagram of the structure of a time code synchronization device provided in an embodiment of the present application.

[0023] Figure 6 A schematic diagram of the structure of a slave device provided in an embodiment of the present application.

[0024] Figure 7 Another structural schematic diagram of a slave device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0025] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0026] The embodiments of the present application provide a time synchronization method, device, storage medium and slave. Any time synchronization device provided in the embodiments of the present application can be integrated in a slave, which can be connected to a photographic device, a recording device, etc. respectively, and the slave synchronizes the time of the photographic device and the recording device.

[0027] See also Figure 1 , Figure 1 This is a schematic diagram of a scenario for applying the time synchronization method provided in an embodiment of the present application. The scenario may include multiple photographic devices, multiple recording devices, a host and multiple slaves. A host is connected to a photographic device, and multiple recording devices are respectively connected to multiple slaves. Figure 1The system shown in FIG. 1 includes a host A, a photographing device A connected to the host A, a slave B, a photographing device B connected to the slave B, a recording device, and a slave C connected to the recording device. By synchronizing the time of the slave B with the host A, the screen playback between the photographing device A and the photographing device B can be synchronized, and by synchronizing the time of the slave C with the host A, the recording of the recording device and the screen playback of the photographing device A can be synchronized. Host A is connected to slave B and / or slave C by wire, and host A is used to send the time information of host A to host B and / or slave C, and host B and / or slave C are used to determine the first time signal corresponding to the time information according to the received time information of the host, and determine the first moment information corresponding to the start synchronization moment in the first time signal, obtain the second time signal in the slave, and determine the second moment information corresponding to the start synchronization moment in the second time signal; determine the time error between the first moment information and the second moment information; determine the signal parameter of the second time signal, and divide the time error into multiple sub-time errors according to the signal parameter; adjust the second time signal of the slave after the start synchronization moment according to the multiple sub-time errors, so that the second time signal is synchronized with the first time signal. After the time synchronization is completed, slave B and / or slave C sends the synchronized time code to the corresponding camera device B and / or recording device C through wireless communication.

[0028] It should be noted that Figure 1 The system scenario diagram shown is only an example. The server and scenario described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. It is known to those skilled in the art that with the evolution of the system and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is also applicable to similar technical problems. The following are detailed descriptions. It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0029] See also Figure 2 , Figure 2It is a schematic diagram of the principle of the time synchronization method in the related art provided by the embodiment of the present application. Since the actual operating frequency of the chip of the host and the slave cannot be exactly the same, there will be an error in the time counting between the host and the slave, and this error will increase with the increase of time. Therefore, we need to adopt a real-time synchronization mechanism. Before this error increases to a level sufficient to affect the accuracy of the time code, a synchronization is performed to make the error start from 0, so that the error will not affect the accuracy of the time code. And since there is a certain error in the frequency of the calculation time of different devices, if only synchronized once, then this error will gradually increase with the accumulation of time. If periodic synchronization is performed, all errors in the cycle will be accumulated in the previous frame of synchronization, resulting in a discontinuous time code waveform output by the hardware in the device, which may cause problems such as the inability of devices such as cameras to recognize.

[0030] exist Figure 2 In the figure, waveform a is the square wave signal corresponding to the time signal of the host, and waveform b is the square wave signal corresponding to the time signal of the slave. It can be seen that waveform a and waveform b are not synchronized at the beginning. The general practice is to find the time error x between waveform a and waveform b at the beginning of the waveform (when waveform b is equivalent to waveform a in advance, x is a positive value, and when waveform b is equivalent to waveform a delayed, x is a negative value), and directly apply x to the square wave signal of waveform b at the current moment, that is, the pulse width of the high-level signal corresponding to waveform b at the current moment is added to the error time x of waveform b relative to waveform a. Then, starting from the falling edge moment of this high-level signal (the moment t1 in the figure, that is, the synchronization moment), waveform c is synchronized with waveform a in time. However, this method is that the slave directly synchronizes when it receives the synchronization moment t1 of the host, which will cause the previously accumulated error time x to be instantly eliminated, which will cause the waveform to be discontinuous. From the figure, we can see that the waveform of the output waveform b of the slave directly changes greatly when the synchronization moment t1 arrives, which is not conducive to the recognition of the time code waveform by devices such as cameras. There is a possibility of recognition failure, which will cause the device to drop offline.

[0031] Therefore, in order to prevent the device from being offline due to the inability to recognize the time code waveform during time synchronization, this application provides a time synchronization method, which is applied to the slave device. Figure 3 , Figure 3 : is a flow chart of a time synchronization method provided in an embodiment of the present application, the method specifically includes:

[0032] S1, determine the first time signal corresponding to the time information according to the time information received from the host, and determine the first moment information corresponding to the start synchronization moment in the first time signal, obtain the second time signal in the slave, and determine the second moment information corresponding to the start synchronization moment in the second time signal.

[0033] It should be noted that timecode is a method of accurately marking video frames in a shot. It works by counting the exact number of video frames from the first to the last. When counting frames, the timecode assigns a unique identifier to each frame, but it is not a continuous integer. Each frame has a label that contains the value of: hours: minutes: seconds: frames.

[0034] In one embodiment, a timer is provided in the master and the slave, and the timer is used to send multiple sets of square wave signals, each set of square wave signals represents a unit time, and when the timer sends 160 sets of square wave signals, the time code changes by one frame, for example, from 10 hours 10 minutes 10 seconds 10 frames to 10 hours 10 minutes 10 seconds 11 frames. When the time codes of the two devices are not synchronized, the time codes need to be synchronized by adjusting the square wave signals sent by the timers.

[0035] Figure 4 A schematic diagram of the principle of a time synchronization method provided in an embodiment of the present application is shown as follows: Figure 4 As shown, in step S1, it is necessary to first receive the time information of the host to determine the first time signal corresponding to the time information. In one embodiment, the first time signal and the second time signal can be described by square wave signals. The first time signal corresponds to the first square wave signal a1 sent by the timer in the host (the first square wave signal a1 is one of the multiple groups of square wave signals sent by the timer). The host sends the time information to the slave, and the first time signal corresponding to the time information can be determined according to the time information, and the first moment information corresponding to the start synchronization moment in the first time signal can be determined. The time information includes the time period information corresponding to the high level signal in the first square wave signal a1 and the time period information corresponding to the low level signal, for example, x1 time-x2 time is the first high level signal, x3 time-x4 time is the first low level signal, x5 time-x6 time is the second high level signal, x7 time-x8 time is the second low level signal, and so on. Similarly, the second time signal corresponds to the second square wave signal c sent by the timer in the slave. At the start synchronization moment, the first moment information corresponding to the first time signal and the second moment information corresponding to the second time signal are determined.

[0036] In one embodiment, the method for determining the start synchronization time is: determining the first rising edge signal of the first group of square wave signals in a frame of the host's time code, and the time corresponding to the rising edge signal is the start synchronization time.

[0037] In one embodiment, considering that a certain transmission time is required between the time information of the host being sent out by the host and the time information of the host being received by the slave, the slave needs to calculate the transmission time according to the data transmission rate and automatically compensate the transmission time. After compensation, at the start of synchronization, the time corresponding to the host is the first time information, and the time corresponding to the slave is the second time information. The error between the first time information and the second time information only includes the error of the timer of the host and the timer of the slave.

[0038] In one embodiment, the host and the slave are connected by wire, and the host sends the host time information to the slave through wired communication. Wireless communication, such as 2.4G wireless communication, can be used for the host to send the host time code to the device and the slave to send the slave time code to the device to be synchronized.

[0039] S2: Determine a time error between the first moment information and the second moment information.

[0040] In one embodiment, since a group of square wave signals is one time unit and one frame includes 160 time units, the time period corresponding to a high level signal in a group of square wave signals is even smaller, basically at the microsecond level. Figure 3 As shown, the first square wave signal a1 corresponds to the first time signal of the host, the second square wave signal c corresponds to the original second time signal of the slave, and the square wave signal b1 corresponds to the synchronized second time signal. The first moment information is moment t1, which is 0, and the second moment information is moment t2, which is assumed to be 5us, so the time error is -5us. When the time error is greater than 0, it means that the slave is ahead of the host in time, and when the time error is less than 0, it means that the slave is delayed in time relative to the host.

[0041] S3, determining a signal parameter of the second time signal, and dividing the time error into a plurality of sub-time errors according to the signal parameter.

[0042] In one embodiment, the number of high-level signals in the second square wave signal c is determined, and the time error is divided into a plurality of sub-time errors according to the number of high-level signals.

[0043] In an embodiment, the time error may be evenly divided into a plurality of sub-time errors, or the time error may be divided into a plurality of sub-time errors according to a random number.

[0044] In one embodiment, the number of sub-time error divisions can be determined based on the number of square waves in the second square wave signal corresponding to the second time signal, or the number of sub-time error divisions can be customized, wherein when the number of sub-time error divisions is customized, the number needs to be greater than 1 and less than or equal to the number of square waves in the second square wave signal corresponding to the second time signal.

[0045] In one embodiment, the multiple sub-time errors may be equal or unequal. When the multiple sub-time errors are unequal, they may be segmented in order from large to small, or in order from small to large, or a sequence is randomly generated and segmented according to the data in the sequence, which are not listed here one by one.

[0046] In one embodiment, before step S3, the time synchronization method further includes:

[0047] Setting a first preset time, and when the time error is greater than the first preset time, determining that the error between the second time signal of the slave and the first time signal of the master exceeds an error threshold;

[0048] When the error between the second time information of the slave and the first time information of the host exceeds the error threshold, the timer in the slave is restarted, and the timer in the slave re-sends the corresponding square wave signal to redetermine the second time signal.

[0049] The re-determined second time signal is synchronized with the first time signal again according to the re-determined second time signal.

[0050] S4, adjusting the second time signal of the slave after the synchronization start moment according to the multiple sub-time errors, so that the second time signal is synchronized with the first time signal.

[0051] In one embodiment, the second time signal corresponding to the slave within the second preset time after the start synchronization moment is adjusted according to the multiple sub-time errors, so that the second time signal at the second preset time is synchronized with the first time signal when the second preset time is reached. The second preset time refers to the time period from the start synchronization moment to different completion moments.

[0052] In one embodiment, a second square wave signal corresponding to the second time signal is obtained, and the pulse width of the second square wave signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors, so that the second time signal is synchronized with the first time signal.

[0053] In one embodiment, the time period corresponding to the high level in the second square wave signal is identified, and after the synchronization starts, the sub-time error is added to the time period corresponding to the high level signal in the second square wave signal to increase or decrease the pulse width of each high level signal in the square wave signal. The sub-time error can be added to any time point in the corresponding time period in the second square wave signal, but will not change the width of the pulse signal before the high level signal. After the sub-time error is added, the rising edge time of the high level signal is the same as the rising edge time of the high level signal before the sub-time error is added, and what is changed is the falling edge time of the high level signal and the time of the level signal after the high level signal.

[0054] In a preferred embodiment, the falling edge moment in the second square wave signal is identified, and after the start synchronization moment, a sub-time error is added to the falling edge moment in the second square wave signal to increase or decrease the pulse width of each high level signal in the square wave signal. Adding the sub-time error to the falling edge moment in the second square wave signal is the most direct way.

[0055] In one embodiment, when the number of sub-time errors is the same as the number of high-level signals of the second square wave signal, a sub-time error may be added to each high-level signal in the second square wave signal, or may not be added to each high-level signal, but may be inserted at intervals. For example, when there are 40 sub-time errors and the second square wave signal includes 40 high-level signals, one sub-time error may be added to each high-level signal, or 20 high-level signals from the 40 high-level signals may be selected at intervals, and 2 sub-time errors may be added to each of the 20 high-level signals, or any number of high-level signals may be selected from the 40 high-level signals, and the 40 sub-time errors may be randomly added to any number of selected high-level signals, which are not listed here one by one.

[0056] In one embodiment, when the number of sub-time errors is different from the number of high-level signals of the second square wave signal, they may be added in an intermittent manner, for example, one high-level signal may be intermitted in sequence, or different numbers of high-level signals may be intermitted.

[0057] After the above synchronization operation, if Figure 3 As shown, the square wave signal b1 completes this synchronization at time t4. For another example, the time error has been calculated to be -5us, and the number of high levels in the second square wave signal c is 50, then the time error -5us is equally divided into 50 parts to obtain 50 sub-time errors (or divided into other parts in other ways), each sub-time error is -0.1us, then, after the second square wave signal starts synchronization, it will be able to complete the synchronization of the second time signal after 50 high levels.

[0058] In one embodiment, the slave also needs to receive the synchronization interval sent by the host. After the slave completes the current time synchronization, when the synchronization interval is reached again, the slave performs time synchronization again.

[0059] During time synchronization, the present application divides the time error into multiple sub-time errors and adds them to each high-level signal in the second square wave signal of the slave, thereby adjusting the pulse width of the second square wave signal. This synchronization method realizes the synchronization function without causing discontinuity in the second square wave signal. After the second square wave signal is synchronized, the time code output by the slave and the time code output by the host are also synchronized.

[0060] According to the method described in the above embodiment, this embodiment will be further described from the perspective of a time synchronization device. The time code synchronization device can be implemented as an independent entity or integrated in a slave machine. The slave machine can be connected to a photographic device, a recording device, etc. respectively. The slave machine synchronizes the time of the photographic device and the recording device.

[0061] See also Figure 5 , Figure 5 The time synchronization device provided by the embodiment of the present application is specifically described, which is applied to a slave. The time synchronization device may include: an information receiving module 101, an error determination module 102 and a synchronization module 303. Among them:

[0062] The information receiving and determining module is used to receive the time information of the host, determine the first time signal corresponding to the time information according to the received time information of the host, and determine the first time information corresponding to the start synchronization moment in the first time signal; obtain the second time signal in the slave, and determine the second time information corresponding to the start synchronization moment in the second time signal;

[0063] The error determination module is used to determine the time error between the first moment information and the second moment information, and determine the signal parameter of the second time signal, and divide the time error into a plurality of sub-time errors according to the signal parameter;

[0064] The synchronization module is used to adjust the second time signal of the slave after the start synchronization moment according to the multiple sub-time errors, so that the second time signal is synchronized with the first time signal.

[0065] During specific implementation, the above modules and / or units can be implemented as independent entities, or can be arbitrarily combined to be implemented as the same or several entities. The specific implementation of the above modules and / or units can refer to the previous method embodiments. The specific beneficial effects that can be achieved can also refer to the beneficial effects in the previous method embodiments, which will not be repeated here.

[0066] In addition, the embodiment of the present application also provides a slave device, such as Figure 6 As shown, the slave device 200 includes a processor 201 and a memory 202. The processor 201 is electrically connected to the memory 202.

[0067] Processor 201 is the control center of slave 200. It uses various interfaces and lines to connect various parts of the entire slave. It executes various functions of the slave and processes data by running or loading instructions stored in memory 202 and calling data stored in memory 202, thereby monitoring the slave as a whole.

[0068] In this embodiment, the processor 201 in the slave 200 will load instructions corresponding to one or more application processes into the memory 202 according to the following steps, and the processor 201 will run the instructions stored in the memory 202 to implement various functions:

[0069] Determine a first time signal corresponding to the time information according to the received time information of the host, and determine first time information corresponding to the start synchronization moment in the first time signal, obtain a second time signal in the slave, and determine second time information corresponding to the start synchronization moment in the second time signal;

[0070] Determining a time error between the first moment information and the second moment information;

[0071] determining a signal parameter of the second time signal, and dividing the time error into a plurality of sub-time errors according to the signal parameter;

[0072] The second time signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal.

[0073] The slave machine can implement the steps in any embodiment of the time synchronization method provided in the embodiments of the present application, and therefore can achieve the beneficial effects that can be achieved by any time synchronization method provided in the embodiments of the present invention. For details, please refer to the previous embodiments and will not be repeated here.

[0074] Figure 7 The specific structural block diagram of the slave provided by the embodiment of the present invention is shown, and the slave can be used to implement the time synchronization method provided in the above embodiment. The slave can be connected to a photographic device, a recording device, etc. respectively, and the slave synchronizes the time of the photographic device and the recording device.

[0075] The RF circuit 310 is used to receive and send electromagnetic waves, realize the mutual conversion between electromagnetic waves and electrical signals, and thus communicate with a communication network or other devices. The RF circuit 310 may include various existing circuit elements for performing these functions, such as antennas, radio frequency transceivers, digital signal processors, encryption / decryption chips, user identity module (SIM) cards, memories, etc. The RF circuit 310 can communicate with various networks such as the Internet, corporate intranets, wireless networks, or communicate with other devices through wireless networks. The above-mentioned wireless networks may include cellular telephone networks, wireless local area networks, or metropolitan area networks. The above-mentioned wireless networks may use various communication standards, protocols and technologies, including but not limited to Global System for Mobile Communication (GSM), Enhanced Data GSM Environment (EDGE), Wideband Code Division Multiple Access (WCDMA), Code Division Access (CDMA), Time Division Multiple Access (TDMA), Wireless Fidelity (Wi-Fi) (such as Institute of Electrical and Electronics Engineers standards IEEE 802.11a, IEEE 802.11b, IEEE802.11g and / or IEEE802.11n), Voice over Internet Protocol (VoIP), Worldwide Interoperability for Microwave Access (Wi-Max), other protocols for email, instant messaging and short messages, and any other suitable communication protocols, even those that have not yet been developed.

[0076] The memory 320 can be used to store software programs and modules, such as the corresponding program instructions / modules in the above-mentioned embodiments. The processor 380 executes various functional applications and data processing by running the software programs and modules stored in the memory 320. The memory 320 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 320 may further include a memory remotely arranged relative to the processor 380, and these remote memories may be connected to the slave 300 via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0077] The input unit 330 can be used to receive input digital or character information, and generate keyboard and mouse input related to user settings and function control. Specifically, the input unit 330 may include a touch-sensitive surface 331 and other input devices 332. The touch-sensitive surface 331, also known as a touch display screen (touch screen) or a touchpad, can collect user touch operations on or near it (such as operations performed by users using fingers, styluses, or any other suitable objects or accessories on or near the touch-sensitive surface 331), and drive corresponding connection devices according to a pre-set program. Optionally, the touch-sensitive surface 331 may include a touch detection device and a touch controller. The touch detection device detects the user's touch position, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into touch point coordinates, and then sends it to the processor 380, and can receive and execute commands sent by the processor 380. In addition, the touch-sensitive surface 331 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the touch-sensitive surface 331, the input unit 330 may further include other input devices 332. Specifically, the other input devices 332 may include but are not limited to one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), and the like.

[0078] The display unit 340 can be used to display information input by the user or information provided to the user and various graphical user interfaces of the slave 300, which can be composed of graphics, text, icons, videos and any combination thereof. The display unit 320 may include a display panel 321, and optionally, the display panel 321 may be configured in the form of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), etc. Further, the touch-sensitive surface 331 may cover the display panel 321, and when the touch-sensitive surface 331 detects a touch operation on or near it, it is transmitted to the processor 380 to determine the type of the touch event, and then the processor 380 provides a corresponding visual output on the display panel 321 according to the type of the touch event. Although in the figure, the touch-sensitive surface 331 and the display panel 321 are implemented as two independent components to implement the input and output functions, it can be understood that the touch-sensitive surface 331 is integrated with the display panel 321 to implement the input and output functions.

[0079] The slave 300 may further include at least one sensor 330, such as a light sensor, a motion sensor, and other sensors. Specifically, the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 321 according to the brightness of the ambient light, and the proximity sensor may generate an interrupt when the flip cover is closed or closed.

[0080] The audio circuit 360, the speaker 361, and the microphone 362 can provide an audio interface between the user and the slave 300. The audio circuit 360 can transmit the electrical signal converted from the received audio data to the speaker 361, which is converted into a sound signal for output; on the other hand, the microphone 362 converts the collected sound signal into an electrical signal, which is received by the audio circuit 360 and converted into audio data, and then the audio data is output to the processor 380 for processing, and then sent to another terminal through the RF circuit 310, or the audio data is output to the memory 320 for further processing. The audio circuit 360 may also include an earplug jack to provide communication between an external headset and the slave 300.

[0081] The slave 300 can help the user receive requests, send information, etc. through the transmission module 370 (such as a Wi-Fi module), which provides the user with wireless broadband Internet access. Although the transmission module 370 is shown in the figure, it is understandable that it is not a necessary component of the slave 300 and can be omitted as needed without changing the essence of the invention.

[0082] The processor 380 is the control center of the slave 300, and uses various interfaces and lines to connect various parts of the entire mobile phone. By running or executing software programs and / or modules stored in the memory 320, and calling data stored in the memory 320, it executes various functions of the slave 300 and processes data, thereby monitoring the slave as a whole. Optionally, the processor 380 may include one or more processing cores; in some embodiments, the processor 380 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It can be understood that the above-mentioned modem processor may not be integrated into the processor 380.

[0083] The slave 300 also includes a power supply 390 (such as a battery) for supplying power to various components. In some embodiments, the power supply can be logically connected to the processor 380 through a power management system, so that the power management system can manage charging, discharging, and power consumption management. The power supply 390 can also include any components such as one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, and power status indicators.

[0084] Specifically in this embodiment, the display unit of the slave device is a touch screen display, and the mobile terminal further includes a memory and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by one or more processors. The one or more programs include instructions for performing the following operations:

[0085] Determine a first time signal corresponding to the time information according to the received time information of the host, and determine first time information corresponding to the start synchronization moment in the first time signal, obtain a second time signal in the slave, and determine second time information corresponding to the start synchronization moment in the second time signal;

[0086] Determining a time error between the first moment information and the second moment information;

[0087] determining a signal parameter of the second time signal, and dividing the time error into a plurality of sub-time errors according to the signal parameter;

[0088] The second time signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal.

[0089] In specific implementation, the above modules can be implemented as independent entities, or can be arbitrarily combined and implemented as the same or several entities. The specific implementation of the above modules can be found in the previous method embodiments, which will not be repeated here.

[0090] Those skilled in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructions, or by controlling related hardware through instructions, and the instructions can be stored in a computer-readable storage medium and loaded and executed by a processor. To this end, an embodiment of the present invention provides a storage medium, which stores multiple instructions, and the instructions can be loaded by a processor to execute the steps of any embodiment of the time synchronization method provided in the embodiment of the present invention.

[0091] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0092] Since the instructions stored in the storage medium can execute the steps in any embodiment of the time synchronization method provided in the embodiments of the present invention, the beneficial effects that can be achieved by any time synchronization method provided in the embodiments of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0093] The above is a detailed introduction to a time synchronization method, device, storage medium and slave provided in the embodiments of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for technical personnel in this field, according to the ideas of the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A time synchronization method, applied to a slave, characterized in that: include: Determine a first time signal corresponding to the time information according to the received time information of the host, and determine first time information corresponding to the start synchronization moment in the first time signal, obtain a second time signal in the slave, and determine second time information corresponding to the start synchronization moment in the second time signal; Determining a time error between the first moment information and the second moment information; determining a signal parameter of the second time signal, and dividing the time error into a plurality of sub-time errors according to the signal parameter; adjusting the second time signal of the slave after the synchronization start time according to the plurality of sub-time errors so that the second time signal is synchronized with the first time signal; The first time signal and the second time signal are described by a square wave signal, and the second time signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal, including: obtaining a second square wave signal corresponding to the second time signal; increasing or decreasing the pulse width of each high-level signal in the second square wave signal of the slave after the start synchronization moment according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal, wherein a sub-time error is added to the pulse width of each high-level signal in the second square wave signal; The signal parameter of the second time signal includes the number of high-level signals in the second square wave signal, and the determining the signal parameter of the second time signal and dividing the time error into a plurality of sub-time errors according to the signal parameter includes: determining the number of high-level signals in the second square wave signal according to the second square wave signal corresponding to the second time signal; and dividing the time error into a plurality of sub-time errors having the same number as the high-level signals in the second square wave signal according to the number of high-level signals in the second square wave signal; The slave includes a timer, and the timer is used to emit the second square wave signal. Before the step of determining the signal parameters of the second time signal and dividing the time error into multiple sub-time errors according to the signal parameters, it also includes: setting a first preset time, and when the time error is greater than the first preset time, determining that the error between the second time signal of the slave and the first time signal of the host exceeds an error threshold; when the error between the second moment information of the slave and the first moment information of the host exceeds the error threshold, restarting the timer in the slave, and the timer in the slave re-emitting the corresponding square wave signal to redetermine the second time signal.

2. The time synchronization method according to claim 1, characterized in that: The method of increasing or decreasing the pulse width of each high level signal in the second square wave signal of the slave after the start synchronization moment according to the plurality of sub-time errors comprises: Identify a time period corresponding to a high level signal in the second square wave signal; After the start synchronization moment, the sub-time error is added to the corresponding time period in the second square wave signal to increase or decrease the pulse width of each high-level signal in the second square wave signal.

3. The time synchronization method according to claim 1, characterized in that: The method of increasing or decreasing the pulse width of each high level signal in the second square wave signal of the slave after the start synchronization moment according to the plurality of sub-time errors comprises: Identifying a falling edge moment in the second square wave signal; After the start synchronization moment, the sub-time error is added to the falling edge moment in the second square wave signal to increase or decrease the pulse width of each high level signal in the second square wave signal.

4. The time synchronization method according to claim 1, characterized in that: Before the step of determining the first time signal corresponding to the time information according to the received time information of the host, the method further includes: The synchronization interval time sent by the host is received, and when the slave completes the current time synchronization and reaches the synchronization interval time again, the slave performs time synchronization again.

5. A time synchronization device, characterized in that: It includes an information receiving and determining module, an error determining module and a synchronization module; The information receiving and determining module is used to receive the time information of the host, determine the first time signal corresponding to the time information according to the received time information of the host, and determine the first time information corresponding to the start synchronization time in the first time signal; Acquire a second time signal in the slave, and determine second time information corresponding to the start synchronization time in the second time signal; The error determination module is used to determine a time error between the first moment information and the second moment information, and determine a signal parameter of the second time signal, and divide the time error into a plurality of sub-time errors according to the signal parameter; The synchronization module is used to adjust the second time signal of the slave after the synchronization start time according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal; The first time signal and the second time signal are described by a square wave signal, and the second time signal of the slave after the start synchronization moment is adjusted according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal, including: obtaining a second square wave signal corresponding to the second time signal; increasing or decreasing the pulse width of each high-level signal in the second square wave signal of the slave after the start synchronization moment according to a plurality of sub-time errors so that the second time signal is synchronized with the first time signal, wherein a sub-time error is added to the pulse width of each high-level signal in the second square wave signal; The signal parameter of the second time signal includes the number of high-level signals in the second square wave signal, and the determining the signal parameter of the second time signal and dividing the time error into a plurality of sub-time errors according to the signal parameter includes: determining the number of high-level signals in the second square wave signal according to the second square wave signal corresponding to the second time signal; and dividing the time error into a plurality of sub-time errors having the same number as the high-level signals in the second square wave signal according to the number of high-level signals in the second square wave signal; The slave includes a timer, and the timer is used to emit the second square wave signal. Before the step of determining the signal parameters of the second time signal and dividing the time error into multiple sub-time errors according to the signal parameters, it also includes: setting a first preset time, and when the time error is greater than the first preset time, determining that the error between the second time signal of the slave and the first time signal of the host exceeds an error threshold; when the error between the second moment information of the slave and the first moment information of the host exceeds the error threshold, restarting the timer in the slave, and the timer in the slave re-emitting the corresponding square wave signal to redetermine the second time signal.

6. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the time synchronization method according to any one of claims 1 to 4.

7. A slave device, characterized in that: It comprises a processor and a memory, the processor is electrically connected to the memory, the memory is used to store instructions and data, and the processor is used to execute the steps in the time synchronization method described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Multi-camera signal synchronization method and device

    CN114520854A