Clock synchronization method of external flash device, electronic device, and storage medium

CN122824853APending Publication Date: 2026-09-25SHEN ZHEN NEEWER TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611309650.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-27
Publication Date
2026-09-25

AI Technical Summary

Technical Problem

然而,移动终端的操作系统调度以及通信链路的传输均存在抖动,使得对时确定的时钟偏移存在误差,而闪光拍摄的闪光持续时间与曝光窗口均以毫秒甚至微秒计,对时误差会直接导致闪光时刻偏离目标时刻,使得闪光无法命中曝光窗口

Benefits of technology

根据本申请提供的外接闪光设备的时钟同步方法,移动终端不再仅依赖其与闪光触发设备之间的单一通信链路进行对时,而是分别基于第一通信链路和第二通信链路这两条相互独立的通信链路,进行第一双向报文校时和第二双向报文校时,得到闪光触发设备相对于移动终端的第一时钟关系以及外接闪光设备相对于移动终端的第二时钟关系,由于两条通信链路相互独立,两条链路上的传输抖动以及两次校时过程中操作系统调度引入的抖动互不相关,任一条链路或任一次校时受到异常抖动干扰时,得到的两路时钟关系之间便会产生可识别的偏差,因此,移动终端能够对第一时钟关系与第二时钟关系进行交叉验证,并在交叉验证结果反映两路时钟关系之间的偏差满足预设置信条件时,才根据两路时钟关系确定可信时钟偏移,而在偏差不满足预设置信条件时丢弃本轮校时结果并重新校时,使得受异常抖动干扰的校时结果能够被识别并剔除,不会直接用于闪光调度,最终确定的可信时钟偏移是经交叉验证确认准确的时钟偏移,从而提高了移动终端与外接闪光设备之间对时结果的可信程度,保证了基于可信时钟偏移调度的闪光时刻能够命中目标时刻,降低了闪光不同步以及拍摄失败的风险。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122824853A_ABST
    Figure CN122824853A_ABST
Patent Text Reader

Abstract

The application relates to the technical field of mobile image shooting, in particular to a clock synchronization method of an external flash device, an electronic device and a storage medium. First two-way message time correction is performed based on a first communication link between a mobile terminal and a flash trigger device, a first clock relationship of the flash trigger device relative to the mobile terminal is determined, second two-way message time correction is performed based on a second communication link between the mobile terminal and an external flash device, a second clock relationship of the external flash device relative to the mobile terminal is determined, the first clock relationship and the second clock relationship are cross-verified, when a deviation between the two clock relationships satisfies a preset trust condition, a trusted clock offset is determined according to the two clock relationships, when the deviation does not satisfy the preset trust condition, the current time correction result is discarded and the two-way time correction is re-performed until the trusted clock offset is determined. The trust degree of the time correction result between the mobile terminal and the external flash device is improved, and the possibility of flash asynchronization is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of mobile image shooting technology, and in particular to a clock synchronization method for an external flash device, an electronic device, and a storage medium. Background Technology

[0002] With the development of mobile imaging technology, the application of collaborative shooting using mobile terminals and external flash devices is becoming increasingly widespread. During collaborative shooting, the mobile terminal triggers the external flash device to fire during the shooting process via a flash triggering device connected to it, thus supplementing the lighting of the scene. Both the mobile terminal and the external flash device operate according to their own clocks. The mobile terminal must first synchronize its clock to determine the clock offset of the flash triggering device relative to its own clock, and then schedule the flash triggering device to fire at the target time based on this clock offset.

[0003] In related technologies, mobile terminals typically interact bidirectionally with flash triggering devices via a communication link. The transmission time of the messages is estimated based on their sending and receiving times to determine the clock offset. However, jitter exists in the mobile terminal's operating system scheduling and the communication link transmission, leading to errors in the clock offset determined by synchronization. Since the flash duration and exposure window in flash photography are measured in milliseconds or even microseconds, synchronization errors directly cause the flash time to deviate from the target time, preventing the flash from hitting the exposure window. Furthermore, the accuracy of the clock offset obtained through synchronization cannot be verified by the mobile terminal. If a synchronization is affected by abnormal jitter and results in a significantly deviated clock offset, this offset will still be directly used for flash scheduling, causing the flash time to deviate greatly from the target time, leading to flash desynchronization or even shooting failure. Therefore, improving the reliability of synchronization results between mobile terminals and external flash devices has become an urgent problem to be solved in the industry. Summary of the Invention

[0004] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a clock synchronization method, electronic device, and storage medium for an external flash device, which can improve the reliability of time synchronization results between a mobile terminal and an external flash device.

[0005] A clock synchronization method for an external flash device according to a first aspect of this application, applied to a mobile terminal, the method comprising: Based on the first communication link between the mobile terminal and the flash triggering device, a first bidirectional message time synchronization is performed to determine the first clock relationship between the flash triggering device and the mobile terminal. Based on the second communication link between the mobile terminal and the external flash device, a second bidirectional message time synchronization is performed to determine the second clock relationship between the external flash device and the mobile terminal; wherein, the first communication link and the second communication link are independent communication links, the flash trigger link refers to the communication link between the flash trigger device and the external flash device, and the flash trigger link is a different communication link from the first communication link and the second communication link, and the flash trigger device is used to trigger the external flash device to flash via the flash trigger link; Cross-validate the first clock relationship and the second clock relationship to obtain the cross-validation results; If the cross-validation results reflect that the deviation between the first clock relationship and the second clock relationship meets the preset confidence conditions, then a reliable clock offset is determined based on the first clock relationship and the second clock relationship. If the cross-validation result reflects that the deviation between the first clock relationship and the second clock relationship does not meet the preset confidence condition, then the time synchronization result corresponding to this round of time synchronization is discarded, and the first bidirectional message time synchronization and the second bidirectional message time synchronization are performed again until the reliable clock offset is determined.

[0006] According to some embodiments of this application, the step of performing a first bidirectional message time synchronization based on the first communication link between the mobile terminal and the flash triggering device to determine the first clock relationship of the flash triggering device relative to the mobile terminal includes: For this round of time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response is received from the flash triggering device; wherein, the synchronization response carries the synchronization sequence number, the request receiving time originating from the flash triggering device, and the device response time; The single clock offset corresponding to this round of time synchronization is determined based on the terminal sending time, the terminal receiving time, the request receiving time, and the device response time; wherein, the terminal receiving time is the time when the mobile terminal receives the synchronization response; For the next round of time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response is received from the flash triggering device until the single clock offset corresponding to each of the multiple rounds of time synchronization is obtained; The first clock relationship is determined based on the single clock offset corresponding to each of the multiple rounds of time synchronization.

[0007] According to some embodiments of this application, determining the single clock offset corresponding to the current time synchronization based on the terminal sending time, the terminal receiving time, the request receiving time, and the device response time includes: The intermediate time on the device side is determined based on the request reception time and the device response time; The terminal-side intermediate time is determined based on the terminal's sending time and receiving time. The deviation between the device-side intermediate time and the terminal-side intermediate time is determined as the single clock offset.

[0008] According to some embodiments of this application, determining the first clock relationship based on the single clock offset corresponding to each of the multiple rounds of time synchronization includes: For each round of time synchronization, the round-trip time is determined based on the terminal sending time and the terminal receiving time, the device processing time is determined based on the request receiving time and the device response time, and the difference between the round-trip time and the device processing time is determined as the link time. The synchronization times are sorted according to the link consumption time corresponding to each synchronization time, and a synchronization time sequence is obtained. According to the preset elimination conditions, some time synchronization rounds in the time synchronization sequence are filtered out, and the single clock offsets corresponding to the remaining time synchronization rounds are determined as multiple candidate clock offsets; The first clock relationship is determined by statistically aggregating multiple candidate clock offsets.

[0009] According to some embodiments of this application, the step of statistically aggregating the plurality of candidate clock offsets to determine the first clock relationship includes: The candidate clock offsets are sorted to obtain a clock offset sequence; The median of the clock offset sequence is determined as the first clock relationship.

[0010] According to some embodiments of this application, before statistically aggregating the multiple candidate clock offsets to determine the first clock relationship, the method further includes: A clock jitter parameter is determined based on the plurality of candidate clock offsets; wherein the clock jitter parameter reflects the degree of dispersion among the plurality of candidate clock offsets; If the clock jitter parameter exceeds the preset jitter threshold, then multiple candidate clock offsets are discarded, and the first bidirectional message time synchronization is performed again. If the clock jitter parameter does not exceed the preset jitter threshold, then the statistical aggregation of multiple candidate clock offsets is performed to determine the first clock relationship.

[0011] According to some embodiments of this application, the cross-validation of the first clock relationship and the second clock relationship includes: Based on the first clock relationship and the second clock relationship, the inter-device clock relationship between the flash triggering device and the external flash device is determined; The device clock relationship is compared with a reference clock relationship to determine the deviation between the first clock relationship and the second clock relationship; wherein the reference clock relationship is determined based on the flash triggering link between the flash triggering device and the external flash device.

[0012] According to some embodiments of this application, determining the reliable clock offset based on the first clock relationship and the second clock relationship includes: The clock offset corresponding to the first clock relationship is determined as the reliable clock offset; wherein, the second communication link is used to transmit the synchronization message of the second bidirectional message synchronization, and is not used to transmit the flash trigger command to trigger the external flash device to flash.

[0013] According to some embodiments of this application, the preset information condition includes: the absolute value of the deviation between the first clock relationship and the second clock relationship does not exceed a preset information threshold.

[0014] According to some embodiments of this application, the first communication link is a wired communication link between the mobile terminal and the flash triggering device, the second communication link is a wireless communication link between the mobile terminal and the external flash device, and the flash triggering link is a wireless radio frequency link between the flash triggering device and the external flash device.

[0015] According to some embodiments of this application, the method further includes: In response to the establishment of a communication connection between the mobile terminal and the flash triggering device and the external flash device, the first bidirectional message time synchronization and the second bidirectional message time synchronization are periodically performed before the flash shooting task is triggered.

[0016] According to some embodiments of this application, the periodic execution of the first bidirectional message time synchronization and the second bidirectional message time synchronization includes: If the mobile terminal is a first system platform, the first clock relationship is determined once every preset round of the first bidirectional message time synchronization. If the mobile terminal is a second system platform, then when the flash shooting task is triggered, the first two-way message time synchronization is performed a preset number of times to determine the first clock relationship.

[0017] According to some embodiments of this application, after determining the reliable clock offset based on the first clock relationship and the second clock relationship, the method further includes: The target device time is determined based on the reliable clock offset and the target time. A scheduled flash command carrying the target device time is sent to the flash triggering device via the first communication link, so that the flash triggering device can trigger the external flash device to flash at the target device time via the flash triggering link.

[0018] According to some embodiments of this application, before determining the target device time based on the reliable clock offset and the target time, the method further includes: The camera of the mobile terminal is controlled to continuously capture image frames, and the timestamp of each image frame is obtained. Based on the image frame timestamp, the target prediction timestamp corresponding to the target frame is predicted and determined, and the target time corresponding to the target prediction timestamp is determined as the target time.

[0019] According to some embodiments of this application, before determining the target device time based on the reliable clock offset and the target time, the method further includes: Obtain the synchronization time corresponding to the most recent determination of the trusted clock offset; If the time interval between the current time and the time synchronization time is less than the preset effective duration, then the most recently determined reliable clock offset is reused; If the time interval between the current time and the time synchronization time is not less than the preset valid duration, then return to perform the first bidirectional message time synchronization and the second bidirectional message time synchronization to redetermine the trusted clock offset.

[0020] According to some embodiments of this application, the method further includes: Count the number of times the time synchronization rounds that continuously fail to meet the preset information conditions are discarded; If the number of dropped messages reaches a preset threshold, the first and second bidirectional message time synchronization will be stopped, and an error message will be output.

[0021] Secondly, embodiments of this application provide an electronic device, including: a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the clock synchronization method for an external flash device as described in any one of the embodiments of the first aspect of this application.

[0022] Thirdly, embodiments of this application provide a computer-readable storage medium storing a program that is executed by a processor to implement the clock synchronization method for an external flash device as described in any one of the embodiments of the first aspect of this application.

[0023] The clock synchronization method, electronic device, and storage medium for the external flash device according to the embodiments of this application have at least the following beneficial effects: According to the clock synchronization method for external flash devices provided in this application, the mobile terminal no longer relies solely on a single communication link between itself and the flash triggering device for time synchronization. Instead, it performs first bidirectional message time synchronization and second bidirectional message time synchronization based on two independent communication links: a first communication link and a second communication link. This yields a first clock relationship between the flash triggering device and the mobile terminal, and a second clock relationship between the external flash device and the mobile terminal. Since the two communication links are independent, the transmission jitter on the two links and the jitter introduced by the operating system scheduling during the two time synchronization processes are unrelated. If either link or any time synchronization is affected by abnormal jitter, a identifiable deviation will occur between the two clock relationships. Therefore, the mobile terminal can cross-validate the first clock relationship and the second clock relationship. Only when the cross-validation result shows that the deviation between the two clock relationships meets the preset confidence conditions will the reliable clock offset be determined based on the two clock relationships. If the deviation does not meet the preset confidence conditions, the time synchronization result of this round will be discarded and the time will be re-synchronized. This allows the time synchronization result affected by abnormal jitter to be identified and eliminated, and will not be directly used for flash scheduling. The finally determined reliable clock offset is the accurate clock offset confirmed by cross-validation. This improves the reliability of the time synchronization result between the mobile terminal and the external flash device, ensures that the flash time scheduled based on the reliable clock offset can hit the target time, and reduces the risk of flash asynchrony and shooting failure.

[0024] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0025] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 A schematic flowchart illustrating a clock synchronization method for an external flash device provided in an embodiment of this application; Figure 2 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 3 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 4 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 5 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 6 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 7 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 8 This is another schematic flowchart illustrating the clock synchronization method for an external flash device provided in an embodiment of this application; Figure 9 This is a schematic diagram of the hardware structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0026] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.

[0027] In the description of this application, "several" means one or more, "more than" means two or more, "greater than," "less than," and "exceeding" are understood to exclude the stated number, while "above," "below," and "within" are understood to include the stated number. The use of "first" and "second" in the description is merely for distinguishing technical features and should not be construed as indicating or implying relative importance, or implicitly indicating the number of indicated technical features, or implicitly indicating the order of the indicated technical features.

[0028] In the description of this application, it should be understood that the orientation descriptions, such as up, down, left, right, front, and back, are based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.

[0029] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "illustrative embodiment," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0030] In the description of this application, it should be noted that, unless otherwise explicitly defined, terms such as "setting," "installation," and "connection" should be interpreted broadly. Those skilled in the art can reasonably determine the specific meaning of the above terms in this application based on the specific content of the technical solution. Furthermore, the identification of specific steps in the following text does not imply a limitation on the order of steps or execution logic. The execution order and logic between each step should be understood and inferred from the content described in the embodiments.

[0031] This application aims to address at least one of the technical problems existing in the prior art. To this end, this application proposes a clock synchronization method, electronic device, and storage medium for an external flash device, which can improve the reliability of time synchronization results between a mobile terminal and an external flash device.

[0032] The following explanation is based on the accompanying drawings.

[0033] Reference Figure 1 The clock synchronization method for an external flash device according to the embodiments of this application is applied to a mobile terminal. The clock synchronization method for an external flash device according to the embodiments of this application may include: Step S101: Based on the first communication link between the mobile terminal and the flash triggering device, perform the first bidirectional message time synchronization to determine the first clock relationship between the flash triggering device and the mobile terminal. Step S102: Based on the second communication link between the mobile terminal and the external flash device, perform a second bidirectional message time synchronization to determine the second clock relationship between the external flash device and the mobile terminal; wherein, the first communication link and the second communication link are independent communication links, the flash trigger link refers to the communication link between the flash trigger device and the external flash device, and the flash trigger link is a different communication link from the first communication link and the second communication link, and the flash trigger device is used to trigger the external flash device to flash via the flash trigger link; Step S103: Perform cross-validation on the first clock relationship and the second clock relationship to obtain the cross-validation result; Step S104: If the cross-validation results show that the deviation between the first clock relationship and the second clock relationship meets the preset confidence conditions, then determine the reliable clock offset based on the first clock relationship and the second clock relationship. Step S105: If the cross-validation result shows that the deviation between the first clock relationship and the second clock relationship does not meet the preset confidence conditions, then discard the time synchronization result corresponding to this round of time synchronization, and return to re-perform the first bidirectional message time synchronization and the second bidirectional message time synchronization until a reliable clock offset is determined.

[0034] In some embodiments, step S101 involves performing a first bidirectional message time synchronization based on the first communication link between the mobile terminal and the flash triggering device to determine the first clock relationship between the flash triggering device and the mobile terminal. It should be noted that the mobile terminal and the flash triggering device are two independently operating devices, each using its own clock. The starting point and rate of the two clocks may differ, resulting in discrepancies in the clock readings for the same physical moment. The first clock relationship describes this difference. Using this relationship, the mobile terminal can convert its own clock reading to the corresponding time on the flash triggering device's clock. Two-way message time synchronization refers to the mobile terminal exchanging messages with the flash triggering device via the first communication link, using the recorded send and receive times to calculate the difference between the two clocks. Since the calculation utilizes information from both the outbound and return journeys, the impact of the one-way transmission time on the calculation result is reduced. When the mobile terminal schedules the flash triggering device to trigger a flash at the target time, the flash triggering device determines its execution time according to its own clock. After determining the first clock relationship, the mobile terminal can convert the target time to the corresponding time on the flash triggering device's clock and schedule accordingly, thus enabling the flash triggering device to trigger a flash at the target time.

[0035] Reference Figure 2 According to some embodiments of this application, step S101, based on the first communication link between the mobile terminal and the flash triggering device, performs a first bidirectional message time synchronization to determine the first clock relationship between the flash triggering device and the mobile terminal, which may include: Step S201: For this round of time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response returned by the flash triggering device is received; wherein, the synchronization response carries a synchronization sequence number, the request receiving time originating from the flash triggering device, and the device response time; Step S202: Determine the single clock offset corresponding to this round of time synchronization based on the terminal sending time, terminal receiving time, request receiving time, and device response time; wherein, the terminal receiving time is the time when the mobile terminal receives the synchronization response; Step S203: Return to the next round of time synchronization, send a synchronization request carrying the synchronization sequence number and the terminal sending time to the flash triggering device via the first communication link, and receive the synchronization response returned by the flash triggering device, until the single clock offset corresponding to each of the multiple rounds of time synchronization is obtained; Step S204: Determine the first clock relationship based on the single clock offset corresponding to each of the multiple rounds of time synchronization.

[0036] In step S201 of some embodiments, for this time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response returned by the flash triggering device is received; wherein, the synchronization response carries a synchronization sequence number, the request receiving time originating from the flash triggering device, and the device response time; It should be noted that synchronization requests and synchronization responses are two types of messages that appear in pairs on the first communication link. The mobile terminal sends a synchronization request, and the flash triggering device returns a synchronization response after receiving it. One request and one response constitute one round of time synchronization message interaction. The terminal sending time is the time when the mobile terminal sends the synchronization request, recorded according to its own clock. The request receiving time and the device response time are two times recorded by the flash triggering device according to its own clock, corresponding to the time of receiving the synchronization request and the time of sending the synchronization response, respectively. One round of interaction generates four times: two from the mobile terminal's clock and two from the flash triggering device's clock. These four times cover the complete process of message outbound, device-side processing, and message return, and are the raw data required to calculate the difference between the two clocks. The synchronization sequence number is used to identify one round of time synchronization. After receiving the synchronization response, the mobile terminal matches the synchronization response with the previously sent synchronization request according to the synchronization sequence number. Even if the message interactions of multiple rounds of time synchronization are adjacent or even overlapping in time sequence, the four times of each round will not be mismatched.

[0037] It is important to clarify that the synchronization response carries a synchronization sequence number. This sequence number is generated by the mobile terminal when it sends a synchronization request and written into the request message. The flash triggering device returns the sequence number verbatim when it receives the synchronization response. Multiple rounds of time synchronization message exchanges are adjacent or even overlapping in time. After the mobile terminal sends a synchronization request with a certain sequence number, messages with other sequence numbers may exist simultaneously on the link. When the mobile terminal receives a synchronization response, it uses the synchronization sequence number to associate the response with the previously sent synchronization request. Therefore, the terminal's sending time and receiving time in this round of time synchronization are assigned to the same sequence number, preventing mismatch in the four time points. The synchronization sequence number also serves as an additional function for packet loss detection. If a synchronization response with a certain sequence number is not returned for an extended period, the mobile terminal can determine that the message for that round of time synchronization is lost, invalidate the current round, and re-initiate. The four time points of the lost round will not be mixed into subsequent calculations.

[0038] In addition, the synchronization response also carries the request reception time and the device response time, both of which originate from the flash trigger device, i.e., are recorded by the flash trigger device according to its own clock. The request reception time is the moment when the flash trigger device receives the synchronization request, and the device response time is the moment when the flash trigger device sends the synchronization response. The difference between the two moments corresponds to the processing time on the device side. Since the two moments are taken from the same clock, their difference directly reflects the actual processing time on the device side, without involving clock conversion. If one of the moments is estimated by the mobile terminal, the estimated value will be mixed with the link transmission time, and the processing time on the device side cannot be accurately separated from the round-trip time. The calculation of link time and single clock offset will lose its basis. This limitation of originating from the flash trigger device ensures that of the four moments used for calculation, two are taken from the mobile terminal's clock and two are taken from the flash trigger device's clock. Each clock records the event falling on its own side, and the recorded action and event occur on the same device, eliminating cross-device estimation.

[0039] Instead of being sent separately by the flash-triggered device, the two time points are transmitted along with the synchronization response, reducing the number of messages to a simple question and answer. If the two time points were transmitted as independent messages, each time synchronization round would add one message interaction, increasing the link overhead for multi-round time synchronization, and the correspondence between the arrival time of the independent messages and the current time synchronization round would need to be maintained separately. By attaching the request reception time and the device response time to the synchronization response and transmitting them back, the binding relationship between the four time points and a time synchronization round is guaranteed by the message structure itself. When the mobile terminal receives a synchronization response, it has gathered all the device-side time information required for the current time synchronization round.

[0040] In some more specific embodiments, the synchronization response can adopt the message format SYNC:{seq}:{AppSendNs}:{TxReceiveNs}:{TxSendNs}, where seq is the synchronization sequence number, AppSendNs is the terminal sending time returned as is, and TxReceiveNs and TxSendNs are the request receiving time and device response time expressed in nanoseconds, respectively. Using the aforementioned numerical example, the mobile terminal sends a synchronization request with sequence number 7, and the terminal sending time is 1000ms. The flash trigger device receives the request when its own clock reading is 1042ms. After 2ms of device-side processing, it returns a synchronization response at 1044ms. The synchronization response sequentially carries sequence number 7, the returned terminal sending time, the request receiving time of 1042ms, and the device response time of 1044ms. The mobile terminal receives the synchronization response at 1024ms. After matching it with the request according to sequence number 7, the four moments of this round of time synchronization are completed. The processing time on the device side is determined to be 2ms by the difference between 1044ms and 1042ms. This time is taken entirely from the clock of the flash trigger device and does not require any conversion to participate in the calculation of the link time.

[0041] In step S202 of some embodiments, the single clock offset corresponding to this round of time synchronization is determined based on the terminal sending time, the terminal receiving time, the request receiving time, and the device response time; wherein, the terminal receiving time is the time when the mobile terminal receives the synchronization response; It should be noted that a single clock offset is a measurement result of the difference between the clock of the flash trigger device and the clock of the mobile terminal, obtained in this round of time synchronization. The four times obtained in step S201 are taken from two clocks respectively. It is necessary to combine and calculate based on the order and interval relationship of the four times in the message round trip, so that the transmission time of the link cancels each other out in the calculation. The remaining difference reflects the difference between the two clocks. In this embodiment of the application, the original times left by a round of message interaction are processed into an offset value that can be used directly. The word "single" also indicates that this value is only a measurement under the conditions of the current round, which may contain components introduced by the operating system scheduling and link transmission jitter of the current round. Whether it is usable is left to be processed in subsequent steps.

[0042] According to some specific embodiments of this application, step S202, which determines the single clock offset corresponding to this round of time synchronization based on the terminal sending time, terminal receiving time, request receiving time, and device response time, may include: Determine the intermediate time on the device side based on the request reception time and the device response time; The intermediate time on the terminal side is determined based on the terminal's sending time and receiving time; The deviation between the intermediate time on the device side and the intermediate time on the terminal side is defined as a single clock offset.

[0043] It should be noted that both the request reception time and the device response time are taken from the clock of the flash trigger device. The former corresponds to the moment when the flash trigger device receives the synchronization request, and the latter corresponds to the moment when the flash trigger device sends the synchronization response. Therefore, the time interval between the two falls entirely in the middle of the message round-trip interaction, that is, the device-side processing process after the synchronization request arrives and before the synchronization response is sent. The device-side intermediate time is the reading on the flash trigger device's clock at the midpoint of this time interval. As one implementation method, the average of the request reception time and the device response time can be taken as the device-side intermediate time. The consideration for taking the intermediate time point is that the dividing point between the message outbound and return time is located within this time interval. The outbound and return are roughly symmetrical about this time interval, and the intermediate time point is the anchor point of this symmetry on the device side.

[0044] It should be noted that both the terminal sending time and the terminal receiving time are taken from the mobile terminal's clock, corresponding to the time when the synchronization request is sent and the time when the synchronization response arrives, respectively. The time period between them covers the complete round-trip process of message outbound, device-side processing, and message return. The terminal-side intermediate time is the reading on the mobile terminal's clock at the midpoint of this round-trip time period. As one implementation, the average of the terminal sending time and the terminal receiving time can be taken as the terminal-side intermediate time. Under the condition that the outbound time and the return time are equal, the midpoint of the round-trip time period and the midpoint of the device-side processing time period correspond to the same physical time. That is to say, the terminal-side intermediate time and the device-side intermediate time are the respective readings of two clocks at the same physical time.

[0045] It should be noted that the intermediate time on the device side is taken from the clock of the flash trigger device, while the intermediate time on the terminal side is taken from the clock of the mobile terminal. Since both correspond to the same physical time, the difference between them represents the difference between the flash trigger device's clock and the mobile terminal's clock, and can be directly used as a single clock offset. The request reception time exceeds the terminal transmission time by including both the clock difference and the outbound transmission time. The device response time exceeds the terminal reception time by including both the clock difference and the return transmission time. Under the condition that the outbound and return transmission times are equal, the transmission times in the two sets of differences have opposite signs. After calculating the intermediate time and subtracting them, the transmission times cancel each other out, leaving only the clock difference. In actual links, the outbound and return transmission times are not strictly equal; their difference remains as an error in the single clock offset. This explains why a single clock offset needs to be accumulated over multiple rounds before being synthesized, rather than being a fixed value in one round.

[0046] In some specific embodiments, the clock of the flash trigger device is 30ms ahead of the mobile terminal's clock. The mobile terminal sends a synchronization request when its own clock reading is 1000ms. The synchronization request reaches the flash trigger device 12ms after transmission through the first communication link, at which point the flash trigger device's clock reading is 1042ms, and the request reception time is 1042ms. After 2ms of device-side processing, the flash trigger device returns a synchronization response, with a device response time of 1044ms. The synchronization response reaches the mobile terminal 10ms after transmission through the first communication link, at which point the mobile terminal's clock reading is 1024ms, and the terminal reception time is 1024ms. The device-side intermediate time is the average of 1042ms and 1044ms, which is 1043ms, and the terminal-side intermediate time is the average of 1000ms and 1024ms, which is 1012ms. The deviation between the two is 31ms, and this single clock offset is determined to be 31ms. Compared to the actual clock difference of 30ms, this round of measurement has an error of 1ms. This error originates from the 2ms difference between the outbound and return times of 12ms and 10ms respectively. The greater the difference in outbound and return times, the greater the error remaining in a single clock offset. In actual time synchronization, the transmission time of the link fluctuates between rounds, and the differences in outbound and return times in each round increase and decrease accordingly. The direction and magnitude of the error in a single clock offset across multiple rounds are thus dispersed. This provides the condition for converging the time synchronization error to 1 to 2ms after multi-round synthesis.

[0047] In some more specific embodiments, the four moments of the i-th round of time synchronization can be collected as follows: When the mobile terminal sends a synchronization request via the first communication link, it records the terminal's transmission time under its own clock: ; Here, nowA() represents reading the current clock value of the mobile terminal. When the flash-triggered device receives a synchronization request, it records the request reception time on its own clock. ; When the flash-triggered device returns a synchronization response, it records the device response time using its own clock. ; Here, nowT() represents reading the current clock reading of the flash trigger device. When the mobile terminal receives a synchronization response, it records the terminal's reception time according to its own clock: ; As one implementation method, the synchronization request can adopt the message format SYNC:{seq}:{AppSendNs}, where seq is the synchronization sequence number and AppSendNs is the terminal sending time expressed in nanoseconds; the synchronization response can adopt the message format SYNC:{seq}:{AppSendNs}:{TxReceiveNs}:{TxSendNs}, which, along with the synchronization sequence number and the terminal sending time, also includes the request receiving time and the device response time. The mobile terminal pairs the synchronization response with the synchronization request based on the synchronization sequence number.

[0048] The calculation of a single clock offset is based on two intermediate moments. The terminal-side intermediate moment is the reading on the mobile terminal's clock at the midpoint of the message round-trip time, expressed as: ; The device-side midpoint time is the reading on the clock of the flash trigger device at the midpoint of the device-side processing period, expressed as: ; Under the condition that the outbound and return times are equal, the two intermediate times correspond to the same physical time. A single clock offset is the deviation between the two intermediate times, expressed as: ; The expansion can be represented as: ; After obtaining the clock offset, the time conversion relationship between the two clocks can be expressed as: ; in, The time displayed on the mobile terminal's clock. This refers to the reading at the same physical moment under the clock of the flash trigger device. This conversion relationship can also be expressed as: ; Among them, TxClockOffset is the clock offset corresponding to the first clock relationship.

[0049] In some embodiments, step S203 returns to sending a synchronization request carrying a synchronization sequence number and the terminal sending time to the flash triggering device via the first communication link for the next round of time synchronization, and receiving the synchronization response returned by the flash triggering device, until the single clock offset corresponding to each of the multiple rounds of time synchronization is obtained; It should be noted that in this embodiment, the next round of time synchronization is performed, and the specific time synchronization method is defined in steps S201 to S202. It should be understood that each round yields a single clock offset, and multiple rounds yield multiple single clock offsets. The reason for multiple rounds of time synchronization is that operating system scheduling jitter and link transmission jitter are sporadic. In multiple rounds of time synchronization, often only some rounds are affected by interference. Multiple single clock offsets may contain both interfered and undisturbed measurements. A single measurement cannot distinguish whether a round is affected by interference, while multiple measurements allow subsequent steps to compare and select, providing a data basis for mitigating the impact of jitter.

[0050] In some embodiments, step S204 determines the first clock relationship based on the single clock offset corresponding to each of the multiple rounds of time synchronization.

[0051] It should be noted that the embodiments of this application comprehensively process multiple single clock offsets to obtain the first clock relationship finally adopted in this round of time synchronization. Each single clock offset is affected by the jitter of its respective round. If any one of them is randomly selected as the time synchronization result, the possibility of obtaining a measurement subject to interference cannot be ruled out. After combining multiple single clock offsets, the influence of jitter in individual rounds is diluted by the measurements of most rounds, resulting in a more stable first clock relationship than any single clock offset. In the embodiments of this application, steps S201 to S204 sequentially complete one round of interactive data acquisition, single-round offset calculation, multiple rounds of repeated accumulation, and multi-round result synthesis. The first clock relationship required in step S101 is thus determined based on multiple measurements, and its reliability is higher than that determined by a single measurement.

[0052] Reference Figure 3 According to some embodiments of this application, step S204, based on the single clock offset corresponding to each of the multiple rounds of time synchronization, determines the first clock relationship, which may include: Step S301: For each round of time synchronization, determine the round-trip time based on the terminal sending time and the terminal receiving time, determine the device processing time based on the request receiving time and the device response time, and determine the difference between the round-trip time and the device processing time as the link time. Step S302: Sort the time synchronization of each round according to the link consumption time corresponding to each round of time synchronization to obtain the time synchronization sequence; Step S303: Filter out some time synchronization cycles in the time synchronization sequence according to the preset rejection conditions, and determine the single clock offsets corresponding to the remaining time synchronization cycles as multiple candidate clock offsets; Step S304: Statistically aggregate multiple candidate clock offsets to determine the first clock relationship.

[0053] In step S301 of some embodiments, for each round of time synchronization, the round-trip time is determined based on the terminal sending time and the terminal receiving time, the device processing time is determined based on the request receiving time and the device response time, and the difference between the round-trip time and the device processing time is determined as the link time. It should be noted that the round-trip time is the difference between the terminal's receiving time and the terminal's sending time, corresponding to the complete time period from the issuance of the synchronization request to the arrival of the synchronization response. This time period consists of three parts: message outbound transmission, device-side processing, and message return transmission. The device processing time is the difference between the device response time and the request receiving time, corresponding to the device-side processing part. Subtracting the device processing time from the round-trip time leaves the total transmission time consumed on the link for both outbound and return transmissions, which is determined as the link time in this embodiment. The four time points used for the link time have already been obtained in the message interaction in step S201, and determining the link time does not introduce additional message interaction. The link time reflects the actual status of the link when round-robin synchronization is performed. When the link experiences queuing, congestion, or operating system scheduling delays, the link time for that round will increase significantly. These conditions are the source of errors mixed into a single clock offset. Therefore, the link time can be used as an indicator to measure the measurement quality of that round for subsequent steps.

[0054] In some embodiments, step S302 involves sorting the round-matching times according to the link time corresponding to each round-matching time to obtain a time-matching sequence; It should be noted that the time synchronization sequence is an ordered sequence obtained by arranging multiple rounds of time synchronization according to the duration of their respective links. Originally, the measurements from each round of time synchronization were a batch of data piled up chronologically, with varying link conditions, making it impossible to distinguish between them. After sorting by link duration, rounds with better link conditions and rounds with worse link conditions cluster at opposite ends of the sequence, with the quality of each round of measurements presented in positional order within the sequence. This embodiment does not change the measurement data of any single round; it merely rearranges the time synchronization data of each round, creating conditions for subsequent selection of rounds of time synchronization based on their sequence position.

[0055] In step S303 of some embodiments, some time synchronization rounds in the time synchronization sequence are filtered out according to preset elimination conditions, and the single clock offsets corresponding to the remaining time synchronization rounds are determined as multiple candidate clock offsets; It should be noted that the preset rejection criteria are pre-set conditions used to filter out some time synchronization rounds from the time synchronization sequence. Combined with the sorting in step S302, rounds with excessive link latency are concentrated at one end of the time synchronization sequence. After filtering out some rounds at that end, the rounds that are excluded are precisely those with poor link conditions and are more likely to contain larger errors in a single clock offset. The single clock offsets corresponding to the remaining time synchronization rounds are determined as multiple candidate clock offsets. The word "candidate" indicates that these offsets have undergone a round of quality screening and are qualified to participate in the final determination. The purpose of this embodiment is to narrow the measurement range. Occasional severe jitter in multiple time synchronization rounds is excluded along with the filtered rounds, and the remaining candidate clock offsets are generally less affected by interference. Therefore, the possibility of the first clock relationship obtained based on this being affected by individual abnormal rounds is reduced.

[0056] In some more specific embodiments, the round-trip time of the i-th time synchronization round can be expressed as: ; The processing time of the equipment can be expressed as: ; Link latency is the difference between round-trip time and device processing time. ; This represents the total transmission time spent on the link for both outbound and return journeys of the message. After sorting each round of time synchronization by link duration, as one implementation method, the preset rejection criteria can be: ; in, () indicates taking the time consumption of each round of the link as 1. ρ quantile, where ρ is a preset rejection ratio, can be 20%, meaning that approximately 20% of the timing rounds with the highest link latency are rejected, and the remaining rounds enter set I. The single clock offset corresponding to each timing round in set I represents multiple candidate clock offsets. The advantage of rejection by quantile is that the number of rejections adapts to the total number of timing rounds; more rounds result in a larger absolute number of rejections, and fewer rounds result in a smaller absolute number of rejections, maintaining consistency between the rejection intensity and the sample size.

[0057] Reference Figure 4 According to some embodiments of this application, before step S304 statistically aggregates multiple candidate clock offsets to determine the first clock relationship, the clock synchronization method for an external flash device in this application embodiment may further include: Step S401: Determine the clock jitter parameter based on multiple candidate clock offsets; wherein the clock jitter parameter reflects the degree of dispersion among multiple candidate clock offsets. Step S402: If the clock jitter parameter exceeds the preset jitter threshold, discard multiple candidate clock offsets and return to perform the first bidirectional message time synchronization again. Step S403: If the clock jitter parameter does not exceed the preset jitter threshold, then perform statistical aggregation on multiple candidate clock offsets to determine the first clock relationship.

[0058] In step S401 of some embodiments, a clock jitter parameter is determined based on multiple candidate clock offsets; wherein the clock jitter parameter reflects the degree of dispersion among the multiple candidate clock offsets. It's important to note that dispersion describes the magnitude of the difference between each pair of candidate clock offsets. The closer the candidate clock offsets are to each other, the smaller the dispersion; conversely, the more distant they are, the larger the dispersion. The reason for introducing this parameter stems from the limitations of the screening process. Sort by link duration and filter out the end rounds, which can eliminate rounds with exceptionally long link durations, provided that most rounds are functioning normally and only a few rounds happen to experience jitter. If the link is continuously interfered with over a period of time, the link duration for each time synchronization round will increase. After filtering out the rounds with the longest durations, the remaining rounds still all originate from the period of interference, and the corresponding candidate clock offsets remain scattered. For this situation where a whole batch of measurements fails, screening alone cannot identify it. The clock jitter parameter summarizes the overall dispersion of multiple candidate clock offsets into a single value, precisely to identify this situation.

[0059] In some embodiments, step S402 involves discarding multiple candidate clock offsets and returning to perform the first bidirectional message time synchronization again if the clock jitter parameter exceeds a preset jitter threshold. It should be noted that the preset jitter threshold is a pre-set numerical limit used to determine whether the degree of dispersion is acceptable. When the clock jitter parameter exceeds the preset jitter threshold, there is no densely distributed distribution of measurement values ​​among the multiple candidate clock offsets. Statistical aggregation cannot find a representative value, and aggregation cannot make the first clock relationship approximate the true clock difference. Therefore, this batch of candidate clock offsets is discarded as a whole, and the mobile terminal returns to re-perform the first bidirectional message time synchronization. The continuous interference of the link generally fluctuates over time, and the time segment where the time synchronization is performed is likely to be in a phase where interference weakens. Replacing the failed old measurements with a new batch of measurements is more likely to yield a usable first clock relationship than forcibly aggregating the failed old measurements.

[0060] In step S403 of some embodiments, if the clock jitter parameter does not exceed a preset jitter threshold, statistical aggregation of multiple candidate clock offsets is performed to determine the first clock relationship.

[0061] It should be noted that when the clock jitter parameter does not exceed the preset jitter threshold, multiple candidate clock offsets are densely distributed near the actual clock difference, and statistical aggregation has a clear basis for value selection. When aggregation is performed at this time, the resulting first clock relationship corresponds to the location of the dense distribution of measured values. Steps S401 to S403 have different division of labor from the screening stage. The screening stage examines the link time round by round, excluding individual abnormal rounds. This embodiment examines the overall distribution of the retained rounds, excluding the entire batch of failed measurements. After both checks are passed, the reliability of the first clock relationship obtained by aggregation has two levels of basis: round by round and the entire batch.

[0062] In some more specific embodiments, the mobile terminal completes 10 rounds of time synchronization via the first communication link. After filtering out rounds with excessive link latency, seven candidate clock offsets are obtained, namely 26.2ms, 28.5ms, 30.1ms, 33.8ms, 36.4ms, 38.9ms, and 41.2ms, with a preset jitter threshold of 5ms. The difference between the maximum and minimum values ​​of the candidate clock offsets is 15ms, exceeding the preset jitter threshold. Therefore, this batch of candidate clock offsets is discarded, and the mobile terminal returns to perform the first bidirectional message time synchronization again. When the Bluetooth link is interfered with by surrounding wireless devices, the deviation of each round of synchronization can be amplified to a range of ±20 to 30ms. The above distribution reflects this situation. Even if the median of 33.8ms is taken as the aggregation result, it is still far from the actual clock difference. If the time is recalibrated, seven candidate clock offsets can be obtained, namely 28.9ms, 29.7ms, 30.4ms, 30.8ms, 31.1ms, 31.6ms, and 33.5ms. The difference between the maximum and minimum values ​​is 4.6ms, which does not exceed the preset jitter threshold. After statistical aggregation, the first clock relationship is determined to be 30.8ms, and the error between this and the actual clock difference of 30ms is 0.8ms. The time synchronization error converges to within 1 to 2ms.

[0063] In some embodiments, step S304 involves statistically aggregating multiple candidate clock offsets to determine a first clock relationship.

[0064] It should be noted that statistical aggregation performs statistical processing on multiple candidate clock offsets, deriving a single adopted value from multiple measurements; this adopted value is the first clock relationship. While the candidate clock offsets are of relatively good quality after screening, each round of measurements still retains minor errors of varying direction and magnitude. Statistical aggregation utilizes the mutual checks and balances between multiple measurements to further cancel out these residual errors in each direction, resulting in a first clock relationship that is closer to the true clock difference than any single candidate clock offset. Furthermore, the first clock relationship is determined as a single numerical value, which the mobile terminal can directly use when performing flash scheduling, eliminating the need to reprocess a batch of measurement data each time.

[0065] According to some embodiments of this application, statistically aggregating multiple candidate clock offsets to determine a first clock relationship may include: Multiple candidate clock offsets are sorted to obtain a clock offset sequence; The median of the clock offset sequence is used to determine the first clock relationship.

[0066] It's important to note that the median is the candidate clock offset located in the middle of the clock offset sequence. Half of the candidate clock offsets in the sequence are no greater than it, and the other half are no less than it. The reason for choosing the median as the primary clock relationship is that it only depends on the position of the sequence and is independent of the specific values ​​of the measurements at the ends. Even if there are residual measurements with significant deviations at the ends of the sequence, no matter how large the deviation, it will not shift the median. Therefore, the aggregation result remains insensitive to residual outliers. If the average value were used for aggregation, any outlier measurement would participate in the calculation with its entire deviation, dragging the aggregation result away from the position of most measurements. The average value is less robust than the median in this regard. Furthermore, most undisturbed measurements are concentrated near the true clock difference; the measurements in the middle of the sequence are inherently closest to the true value, and taking the median captures this most concentrated position.

[0067] In some more specific embodiments, the mobile terminal performs 10 rounds of time synchronization for the first communication link, completing the entire process within 150ms. After sorting the link time and filtering out rounds with excessively long link times, seven candidate clock offsets remain. The resulting clock offset sequence is 28.9ms, 29.7ms, 30.4ms, 30.8ms, 31.1ms, 31.6ms, and 33.5ms, respectively. The clock of the flash trigger device is 30ms faster than the clock of the mobile terminal. The 28.9ms and 33.5ms at the ends of the sequence reflect the deviation introduced by the asymmetry between the outbound and return times of the current round. The median is the fourth candidate clock offset of 30.8ms. The first clock relationship is thus determined to be 30.8ms, with an error of 0.8ms between this and the actual clock difference of 30ms. If the average of the seven candidate clock offsets is taken, the result is 30.86ms. The error is also amplified after being pulled by 33.5ms. The larger the residual deviation in the time calibration cycle, the more obvious the average value is pulled away. The median always falls at the position where the measurement values ​​are most concentrated, and the time calibration error thus converges to a level within 1 to 2ms.

[0068] The first clock relationship is the median of the candidate clock offsets: ; As an alternative implementation, the first clock relationship can also be the average of multiple candidate clock offsets: ; Where |I| represents the number of time synchronization cycles in set I. A weighted average can also be used; the weight of each candidate clock offset can be expressed as: ; Where ε is a preset small value used to prevent weight divergence when link latency is close to zero. The weighted average can be expressed as: ; It should be understood that the weighted average approach assigns weights to each round's calibration time based on the link latency. Rounds with shorter link latencies have better measurement quality and thus receive higher weights, resulting in an aggregation result that favors rounds with better measurement quality. Among the three aggregation methods, the median is the most insensitive to residual outliers, the average is the simplest to calculate, and the weighted average retains information from all rounds. In actual products, one of these methods can be chosen.

[0069] In some more specific embodiments, the clock jitter parameter can be taken as the value of the median absolute deviation of the candidate clock offset after being corrected for a consistency coefficient: ; in, The median is the median of multiple candidate clock offsets, and the coefficient 1.4826 scales this statistic to the standard deviation. The median absolute deviation measures dispersion with the median as the center. The center of the measurement is not affected by residual outliers at both ends of the sequence, thus making the estimation of dispersion robust.

[0070] Pre-aggregation validity testing can also include multiple conditions: ; in, This is the preset minimum number of rounds. To preset the jitter threshold, This is the preset upper limit for link latency.

[0071] The first condition requires a sufficient number of remaining time synchronization rounds after elimination; statistical aggregation becomes meaningless when the sample size is too small. The second condition is the jitter test in step S402. The third condition requires that at least one round in all rounds has a sufficiently small link latency; if the link latency of all rounds is too high, it indicates that the overall link condition is poor, and even if the dispersion is not large, the measured clock offset may deviate from the true value overall. If any of the three conditions is not met, the candidate clock offsets in this batch are discarded and the first bidirectional message time synchronization is performed again.

[0072] In step S102 of some embodiments, a second bidirectional message time synchronization is performed based on the second communication link between the mobile terminal and the external flash device to determine the second clock relationship between the external flash device and the mobile terminal; wherein, the first communication link and the second communication link are independent communication links, the flash trigger link refers to the communication link between the flash trigger device and the external flash device, and the flash trigger link is a different communication link from the first communication link and the second communication link, and the flash trigger device is used to trigger the external flash device to flash via the flash trigger link; It should be noted that the time synchronization principle of the second bidirectional message time synchronization is the same as that of the first bidirectional message time synchronization. The difference is that the time synchronization object is changed from the flash trigger device to an external flash device. The resulting second clock relationship describes the difference between the clock of the external flash device and the clock of the mobile terminal. In the shooting system composed of the mobile terminal, the flash trigger device, and the external flash device, the external flash device is ultimately responsible for performing the flash action. The trigger command actually flows through the flash trigger link between the flash trigger device and the external flash device. The second communication link between the mobile terminal and the external flash device does not bear the transmission of the trigger command. The first communication link and the second communication link are independent of each other. The transmission jitter on the two links has its own source and is unrelated to each other. The jitter introduced by the operating system scheduling during the two time synchronization processes is also independent of each other. If the mobile terminal only synchronizes time with the flash trigger device through the first communication link, it is impossible to determine whether the first clock relationship obtained is accurate. After adding time synchronization on the second communication link in this embodiment, the mobile terminal obtains two clock relationships from different sources.

[0073] According to some embodiments of this application, the first communication link is a wired communication link between the mobile terminal and the flash triggering device, the second communication link is a wireless communication link between the mobile terminal and the external flash device, and the flash triggering link is a wireless radio frequency link between the flash triggering device and the external flash device.

[0074] It should be noted that the first communication link uses a wired connection. As one implementation method, the flash triggering device is plugged into the mobile terminal via a universal serial bus interface. Wired links offer short and stable transmission times, and the transmission and reception times of messages at both ends of the link are less affected by external factors. When performing the first bidirectional message time synchronization via the first communication link, the link jitter component mixed into a single clock offset is minimal, resulting in a highly accurate first clock relationship. The clock of the flash triggering device is the final clock upon which flash scheduling relies. After the flash reservation command is sent to the flash triggering device via the first communication link, the flash triggering device determines the execution time according to its own clock. The accuracy of the first clock relationship directly determines the accuracy of the flash timing. By arranging the most stable wired link as the source of the first clock relationship, the clock relationship upon which scheduling is based is therefore established on the same link as the scheduling execution. The transmission characteristics of the synchronization link and the scheduling link are consistent, and there are no conversion gaps caused by link differences when using the synchronization result for scheduling.

[0075] On the other hand, the second communication link uses a wireless connection. As one implementation, the mobile terminal communicates with the external flash device via Bluetooth. Bluetooth link transmission time fluctuates significantly; messages may queue and wait for the transmission window, and there may be intervals of tens of milliseconds between adjacent transmissions. The error introduced by link jitter can reach ±20 to 30 ms. The accuracy of the second clock relationship obtained through the second communication link is limited on its own. In this embodiment, the second clock relationship does not undertake flash scheduling tasks; its purpose is to cross-verify with the first clock relationship. Jitter has limited impact on its verification effectiveness, as explained in the cross-verification section. The error sources of the two time synchronization paths are independent of each other. Even if the second clock relationship itself has errors, whether its deviation from the first clock relationship is abnormal can still be identified. Cross-verification requires the two time synchronization links to be independent. Bluetooth links and wired links differ in transmission medium, protocol stack, and scheduling method, which precisely meets the independence requirement. The mobile terminal and the external flash device usually already have a Bluetooth connection for parameter configuration; reusing this connection for the second bidirectional message time synchronization does not add additional hardware or connection overhead.

[0076] On the other hand, the flash trigger link uses a wireless radio frequency link between the flash trigger device and the external flash device as an implementation method, operating on a proprietary radio frequency protocol in the 2.4GHz band. The flash trigger link is the link through which the trigger command actually flows. Its transmission characteristics determine the delay from the issuance to the execution of the trigger command. This radio frequency link uses a point-to-point proprietary protocol, with low and successively stable transmission latency. The latency fluctuation is on the order of microseconds, negligible compared to the jitter on the order of tens of milliseconds in Bluetooth links. In long-term actual operation, flash anomalies caused by this link are rare. The transmission delay of the trigger command on the flash trigger link is almost constant. The accuracy of the flash timing is almost entirely determined by the moment when the flash trigger device executes the trigger command, which in turn is determined by a reliable clock offset. This link characteristic makes improving the reliability of the timing results crucial for solving the flash synchronization problem.

[0077] It should be understood that among the three links, the wired link, which has the most stable transmission, is responsible for transmitting the time synchronization and scheduling instructions used for scheduling. The Bluetooth link, which is independent of the wired link, provides the comparison measurements required for cross-validation. The wireless radio frequency link, with a near-constant delay, is dedicated to triggering execution. The three stages of time synchronization, verification, and triggering fall on the links that match their respective requirements.

[0078] In some embodiments, step S103 involves cross-validating the first clock relationship and the second clock relationship to obtain the cross-validation result. It should be noted that cross-validation refers to comparing the first and second clock relationships obtained from two time synchronizations under the same clock reference to examine whether they match. The cross-validation result reflects the degree of match between the two. Regardless of the accuracy of a single time synchronization, the numerical form of the clock relationship is the same, and the numerical value alone cannot identify whether errors introduced by abnormal jitter have been introduced. When two independent measurement results are compared together, the situation changes. The jitter sources of the two links are unrelated, and the possibility of both time synchronizations being subjected to abnormal interference of the same direction and amplitude in the same round is very low. Therefore, if the two clock relationships match, the credibility of both being free from abnormal interference is high; conversely, if there is a significant discrepancy, at least one time synchronization has been interfered with. Through the embodiments of this application, the previously undetermined question of whether the time synchronization result is reliable is transformed into the question of whether two independent measurement results match, which can be verified by setting criteria. The cross-validation result provides a basis for judgment in subsequent branch processing.

[0079] According to some embodiments of this application, step S103, which cross-validates the first clock relationship and the second clock relationship, may include: Based on the first clock relationship and the second clock relationship, the inter-device clock relationship between the flash triggering device and the external flash device is determined; The clock relationship between devices is compared with the reference clock relationship to determine the deviation between the first clock relationship and the second clock relationship; wherein, the reference clock relationship is determined based on the flash triggering link between the flash triggering device and the external flash device.

[0080] It should be noted that the first clock relationship describes the difference between the flash trigger device's clock and the mobile terminal's clock, while the second clock relationship describes the difference between the external flash device's clock and the mobile terminal's clock. Both are referenced to the mobile terminal's clock. The inter-device clock relationship describes the difference between the flash trigger device's clock and the external flash device's clock. Using the mobile terminal's clock as a common reference, the two clock relationships are converted according to their respective relationships with the common reference to obtain the direct relationship between the two device clocks. If this conversion is not performed, each clock relationship describes the difference from the mobile terminal's clock perspective, making direct comparison impossible. After conversion to an inter-device clock relationship, the two time synchronization results become the same comparison object. The question of whether the first and second clock relationships match becomes the question of whether the inter-device clock relationship can withstand comparison.

[0081] It should be noted that the reference clock relationship is another measurement of the difference between the clock of the flash triggering device and the clock of the external flash device. While it describes the same object as the inter-device clock relationship, its source is different. The inter-device clock relationship is indirectly converted from the first and second clock relationships, and the errors introduced by both time synchronization paths are all aggregated in it. The reference clock relationship is determined based on the flash triggering link, which directly connects the flash triggering device and the external flash device. The determination process does not involve the mobile terminal, nor does it involve the synchronization message exchange on the first and second communication links. Its error source is independent of the inter-device clock relationship. Comparing two measurements describing the same object from different sources reveals the deviation between the first and second clock relationships. When the comparison results are consistent, the reliability of the two indirectly converted clock relationships being free from abnormal interference is high. When the comparison results show significant discrepancies, at least one of the two time synchronization paths has been interfered with. Cross-validation thus becomes a comparison between two independent measurements of the same object, providing specific and executable judgment criteria.

[0082] In some specific embodiments, the clock of the flash trigger device is 30ms faster than the mobile terminal's clock, and the clock of the external flash device is 55ms faster than the mobile terminal's clock. When both time synchronizations are normal, the first clock relationship is determined to be 30.8ms after multiple rounds of synthesis, and the second clock relationship is determined to be 55.6ms. The inter-device clock relationship is the difference between the two, which is 24.8ms. The flash trigger device exchanges synchronization messages with the external flash device through the flash trigger link, and the determined reference clock relationship is 25.0ms, which is basically consistent with the actual inter-device clock difference of 25ms. The deviation between the inter-device clock relationship and the reference clock relationship is 0.2ms. If the Bluetooth link is interfered with in a certain round of time synchronization, the second clock relationship is measured as 78.2ms, and the inter-device clock relationship is calculated as 47.4ms. The deviation from the reference clock relationship of 25.0ms reaches 22.4ms, which is significantly beyond the acceptable range. The interference in this round of time synchronization is thus identified. When the Bluetooth link is interfered with, the deviation is on the order of ±20 to 30 ms, while the error of the reference clock relationship is on the order of several microseconds. The difference between the two is huge. Once the deviation is abnormal, it can be clearly attributed to the two-way time synchronization through the mobile terminal, and will not be misjudged as coming from the reference side.

[0083] In step S104 of some embodiments, if the cross-validation result reflects that the deviation between the first clock relationship and the second clock relationship meets the preset confidence condition, then the reliable clock offset is determined according to the first clock relationship and the second clock relationship. It should be noted that the pre-set information condition is a criterion used to determine whether the deviation between the two clock relationships is within an acceptable range. If the deviation meets the pre-set information condition, it indicates that the clock relationships obtained from the two clock synchronizations in this round are consistent and have not been significantly affected by abnormal jitter. The reliable clock offset is a clock offset that has been verified and confirmed to be reliable and can be used for flash scheduling. It is determined based on the consistent first clock relationship and the second clock relationship, and thus inherits the reliability of this round of synchronization. The purpose of this application embodiment is to set the admission conditions for the synchronization results of flash scheduling. The synchronization results that have been cross-verified and are consistent can be transformed into the scheduling basis. The clock offset entering the scheduling stage has verified reliability, and the flash trigger time calculated by the mobile terminal based on the reliable clock offset can accurately hit the target time.

[0084] According to some embodiments of this application, the preset information condition may include: the absolute value of the deviation between the first clock relationship and the second clock relationship does not exceed a preset information threshold.

[0085] It should be noted that the deviation between the first and second clock relationships is the difference obtained by comparing the two clock relationships. It can be positive or negative. The comparison of the absolute value of the deviation boils down to a comparison with a numerical limit. The preset information threshold is this limit. Regardless of which side the deviation leans towards, as long as the absolute value does not exceed the preset information threshold, the preset information condition is satisfied. There are two references for the value of the preset information threshold. For example, when both time synchronizations are normal, their respective residual errors converge to within 1 to 2 ms after multiple rounds of integration, and the deviation formed by their superposition is also within a few milliseconds. When either time synchronization is subjected to abnormal interference, the jitter of wireless links such as Bluetooth is on the order of ±20 to 30 ms, and the deviation jumps to tens of milliseconds. The deviations in the two situations differ significantly. Setting the preset information threshold between a few milliseconds and tens of milliseconds allows for a clean distinction between the two situations. In addition, the value of the preset signal threshold can also be commensurate with the accuracy requirements of flash shooting. The common exposure window of the shooting scene is usually a few milliseconds. The timing error must be controlled within this scale so that the flash can hit the exposure window. Therefore, the preset signal threshold should not be relaxed to the scale of the exposure window.

[0086] In some more specific embodiments, the preset signal threshold is set to 5ms. When both time synchronizations are normal, the clock relationship between the devices is 24.8ms, the reference clock relationship is 25.0ms, and the absolute value of the deviation is 0.2ms, which does not exceed the preset signal threshold, thus satisfying the preset signal condition. In a time synchronization round where the Bluetooth link is interfered with, the absolute value of the deviation reaches 22.4ms, exceeding the preset signal threshold, and the preset signal condition is not satisfied; therefore, this time synchronization round is discarded. The judgment results for both scenarios clearly fall on one side of the threshold, and there is no middle ground between the normal and interfered scenarios.

[0087] According to some embodiments of this application, determining the reliable clock offset based on the first clock relationship and the second clock relationship in step S104 may include: The clock offset corresponding to the first clock relationship is determined as the reliable clock offset; wherein, the second communication link is used to transmit the synchronization message of the second bidirectional message synchronization, and is not used to transmit the flash trigger command to trigger the external flash device to flash.

[0088] It should be noted that the purpose of the reliable clock offset is to convert the trigger execution time on the flash triggering device side. The flash reservation command is sent to the flash triggering device via the first communication link. The flash triggering device determines the execution time according to its own clock. The scheduling relies on the difference between the clock of the flash triggering device and the clock of the mobile terminal, that is, the clock offset corresponding to the first clock relationship, which is taken as the reliable clock offset. The scheduling conversion directly falls on the clock where the scheduling execution occurs. The first communication link is a wired link. The synchronization message and the flash reservation command flow through the same link. The link characteristics measured during synchronization are consistent with the link characteristics during scheduling. The reliable clock offset does not have a conversion gap introduced by the link difference when used for scheduling. If the second clock relationship is used for scheduling, it is necessary to go through the inter-device clock relationship again to convert to the clock of the flash triggering device. An extra layer of transmission means an extra layer of error accumulation. Moreover, the second communication link is a Bluetooth link, and the transmission jitter is on the order of tens of milliseconds. Its synchronization result is inherently less accurate than that of the wired link.

[0089] Furthermore, the fact that the second communication link does not transmit flash trigger commands defines the scope of the second clock relationship. The second clock relationship participates in cross-validation, and once the validation is successful, its mission is complete; any inherent errors will not enter the flash scheduling stage. The flash trigger command is actually transmitted through the flash trigger link, which has low latency and is successively stable. Jitter on the second communication link, regardless of its magnitude, is irrelevant to the flash timing. If the transmission jitter of the Bluetooth link directly affects the scheduling stage, the flash timing will drift by tens of milliseconds depending on the message queuing status, making shooting impossible. The link division of labor in this embodiment isolates the link with the greatest jitter outside the scheduling stage, allowing it to only play a role in the transmission of synchronization time messages where timing errors are insensitive and their errors can be identified through cross-validation.

[0090] In some more specific embodiments, the reliable clock offset is taken as the first clock relationship of 30.8ms. After the mobile terminal determines the target time, it adds 30.8ms to the target time to convert it into the time corresponding to the clock of the flash triggering device, generates a flash reservation command and sends it through the first communication link. At this time, the flash triggering device triggers the external flash device to flash through the flash triggering link. The transmission delay of the trigger command on the flash triggering link is on the order of several microseconds. The deviation between the flash time and the target time is mainly composed of the error of the reliable clock offset of 0.8ms, which is within the range of the common exposure window, and the flash hits the exposure process of the target frame.

[0091] Reference Figure 5 According to some embodiments of this application, after determining the reliable clock offset based on the first clock relationship and the second clock relationship in step S104, the clock synchronization method for the external flash device in this application embodiment may further include: Step S501: Determine the target device time based on the reliable clock offset and the target time; Step S502: Send a scheduled flash command carrying the target device time to the flash triggering device via the first communication link, so that the flash triggering device can trigger the external flash device to flash at the target device time via the flash triggering link.

[0092] Reference Figure 6 According to some embodiments of this application, before step S501 determines the target device time based on the reliable clock offset and the target time, the clock synchronization method for the external flash device in this application embodiment may further include: Step S601: Control the camera of the mobile terminal to continuously acquire image frames and obtain the image frame timestamp corresponding to each image frame. Step S602: Based on the image frame timestamp, predict and determine the target prediction timestamp corresponding to the target frame, and determine the target time corresponding to the target prediction timestamp as the target time.

[0093] In step S601 of some embodiments, the camera of the mobile terminal is controlled to continuously capture image frames to obtain the image frame timestamps corresponding to each image frame. It's important to note that continuous image frame acquisition is the process by which a mobile terminal's camera outputs image frames one by one according to a certain frame period. The image frame timestamp marks the acquisition time of each image frame and is taken from the mobile terminal's internal monotonic clock. This clock only increases and never decreases, unaffected by system time adjustments; the image frame timestamp and the mobile terminal's clock are on the same timing benchmark. Although the frame period is set by the acquisition parameters, the actual frame output rhythm of the camera is affected by sensor readout and processor scheduling, resulting in fluctuations between frames. The theoretical frame period cannot replace the actual frame output time. The image frame timestamp records the actual frame output time frame by frame, thus preserving the actual frame output rhythm in data form. Subsequent predictions are based on the image frame timestamps, not the theoretical frame period.

[0094] In some embodiments, step S602 involves predicting and determining the target prediction timestamp corresponding to the target frame based on the image frame timestamp, and determining the target time corresponding to the target prediction timestamp as the target time.

[0095] It's important to note that the target frame is the image frame planned for capture with flash illumination. When the target device time is determined, the target frame has not yet been captured, and its actual timestamp does not yet exist. The predicted target timestamp is a predicted value for the target frame's capture time, derived from the timestamps of the already captured image frames. The actual frame intervals of the captured frames reflect the current true frame output rhythm. Following this rhythm, the capture time of the target frame is predicted. Prediction is necessary; flash scheduling requires lead time. The determination of the reliable clock offset, the conversion of the target device time, the issuance of the flash reservation command, and the timely waiting of the flash triggering device all need to be completed before the target frame arrives. If scheduling is attempted after the target frame's actual timestamp is generated, the flash will never be able to catch up with the frame's exposure. The target time corresponding to the predicted target timestamp is determined as the target time, and the expected flash time is thus aligned with the target frame's predicted capture time, clearly indicating that the flash illumination target is the exposure process of the target frame.

[0096] In some specific embodiments, the mobile terminal's camera continuously captures images at a rate of approximately 30 frames per second. The measured timestamps of adjacent image frames are 4800.0ms, 4833.4ms, and 4866.7ms, respectively. The actual frame interval fluctuates slightly around 33ms. Using the most recent actual frame interval as the basis, the predicted timestamp of the target frame three frames later is predicted to be 4966.7ms. This predicted timestamp corresponds to the target time. A scheduling margin of approximately 100ms is allowed between the prediction completion and the arrival of the target frame. The reuse or re-determination of the reliable clock offset, the conversion of the target device time, and the advance issuance of the flash reservation command can all be completed within this margin. The flash triggering device triggers the flash via the flash triggering link at the target device time, and the flash falls within the exposure process of the target frame. The actual timestamp of the target frame may differ from the predicted timestamp by within milliseconds. This difference, combined with the error of the reliable clock offset, still falls within the range of the common exposure window.

[0097] In some more specific embodiments, the acquisition time of the target frame is predicted sequentially according to the frame period, as follows: ; in, The image frame timestamp is the most recently acquired image frame, FrameDuration is the frame period, and LeadFrames is the number of lead frames, i.e., the number of frames between the target frame and the most recently acquired frame. The value of the lead frame is commensurate with the scheduling lead, allowing time for completing time synchronization and reuse judgment, target device time conversion, issuance of the flash reservation command, and waiting for the flash triggering device to keep time. The target time is corrected based on the predicted frame time. ; Among them, FlashTriggerOffset is the flash trigger offset, which is used to align the flash moment with the desired position during the exposure process of the target frame; FlashSyncShift is the flash synchronization compensation amount, which is used to correct the systematic synchronization error obtained by calibration; and CommandOffset is the user-adjustable offset amount.

[0098] In some more specific embodiments, there is a fixed delay between the flash triggering link being issued and the actual flash being emitted by the external flash device, with the total delay being:

[0099] Where RfAirDelay is the air propagation time of the radio frequency signal, FlashRxDelay is the reception and processing time of the external flash device, and FlashTriggerDelay is the triggering execution time of the external flash device. To ensure the actual flash time is aligned with the target device's time, the flash triggering device sends a trigger command in advance; the radio frequency transmission time is: ; Right now: ; UserRfAdjust represents the user's adjustment amount.

[0100] As an implementation method, the delay compensation takes the default value DefaultRfCompensation= As another implementation method, values ​​are obtained by looking up a table based on the RF channel and the model of the external flash device: ; Different models of external flash devices have different processing and trigger execution times. A lookup table method is used to match the compensation amount with the device. If the external flash device automatically keeps time according to the target device's time, then RfSendAtTx = TargetTx can be simplified.

[0101] Reference Figure 7 According to some embodiments of this application, before step S501 determines the target device time based on the reliable clock offset and the target time, the clock synchronization method for the external flash device in this application embodiment may further include: Step S701: Obtain the synchronization time corresponding to the most recent confirmed reliable clock offset; Step S702: If the time interval between the current time and the time synchronization time is less than the preset effective duration, then the most recently determined reliable clock offset is reused. Step S703: If the time interval between the current time and the time synchronization time is not less than the preset valid duration, then return to perform the first bidirectional message time synchronization and the second bidirectional message time synchronization to redetermine the reliable clock offset.

[0102] In some embodiments, step S701 involves obtaining the synchronization time corresponding to the most recent determination of the reliable clock offset; It's important to note that the time synchronization point is the moment when the most recent reliable clock offset was determined. The reliable clock offset is not permanently valid once determined. The mobile terminal and the flash trigger device each have their own independent crystal oscillators. The crystal oscillator frequency fluctuates slowly with factors such as temperature and voltage, resulting in a slight difference in the timing rates of the two clocks. This clock difference drifts slowly over time. The further back in time the offset was determined, the greater the discrepancy between the reliable clock offset and the current true clock. The time synchronization point provides a starting point for assessing this discrepancy. The longer the time interval between the current moment and the time synchronization point, the more drift accumulates, and the staleness of the reliable clock offset can be quantified.

[0103] In step S702 of some embodiments, if the time interval between the current time and the time synchronization time is less than a preset effective duration, the most recently determined reliable clock offset is reused. It should be noted that the preset effective duration is a pre-set time limit within which the reliable clock offset is allowed to continue to be used. Within the effective duration, the accumulated amount of clock drift is less than the time synchronization accuracy requirement, and the difference between the most recently determined reliable clock offset and the current real clock can be ignored. Direct reuse does not affect the accuracy of the flash timing. The overhead saved by reuse is real. If two-way time synchronization and cross-validation were to be re-performed before each shot, one round of time synchronization itself would take more than 100 milliseconds. When shooting multiple photos consecutively, the time synchronization overhead would accumulate with each shot, thus slowing down the shooting pace. Reuse allows each shot within the effective duration to directly use the existing reliable clock offset, and the saved time synchronization overhead is converted into shooting response speed.

[0104] In some embodiments, step S703 involves returning to perform the first bidirectional message time synchronization and the second bidirectional message time synchronization if the time interval between the current time and the time synchronization time is not less than a preset valid duration, in order to redetermine the reliable clock offset.

[0105] It should be noted that when the time interval is not less than the preset effective duration, the accumulation of clock drift becomes significant. Using an outdated reliable clock offset will introduce this drift into the conversion of the target device's time, causing the flash timing to deviate from the target time. In this case, a return to dual-path time synchronization and cross-validation is performed. The newly determined reliable clock offset reflects the current clock difference, and the outdated data is replaced by the new data. The preset effective duration thus clearly defines the division of labor between multiplexing and re-synchronization: within the effective duration, multiplexing is used to improve speed; outside the effective duration, re-synchronization is used to improve accuracy, thus balancing shooting response speed and flash synchronization accuracy.

[0106] In some more specific embodiments, the crystal oscillator frequency deviation is measured in parts per million (ppm), and the relative drift between the two clocks accumulates to approximately 1 ms within 30 seconds, with a preset effective duration of 30 seconds. The user continuously takes multiple photos, with intervals between adjacent shots of several seconds. The time interval between each shot and the most recent time synchronization is less than 30 seconds. The reliable clock offset is reused sequentially, saving approximately 150 ms of time synchronization for each shot, and the shooting response is unaffected by time synchronization overhead. If shooting is interrupted for more than 30 seconds and then resumed with a time interval not less than the preset effective duration, the mobile terminal returns to perform the first and second bidirectional message time synchronizations. After cross-validation to re-determine the reliable clock offset, the target device time is calculated again, and drift accumulation is not included in the flash scheduling.

[0107] In some embodiments, step S501 involves determining the target device time based on the reliable clock offset and the target time. It should be noted that the target time is the expected moment when the external flash device will fire, measured under the mobile terminal's clock. The mobile terminal determines the target time based on the shooting process. The flash triggering device is the executor of the flash triggering command, and it determines the execution time according to its own clock. The reading of the target time under the mobile terminal's clock cannot be directly used by the flash triggering device. The target device time is the reading corresponding to the target time under the flash triggering device's clock. Adding the target time to the reliable clock offset completes the conversion between the two clocks. The reliable clock offset is cross-validated to be reliable. The accuracy of the converted target device time in pointing to the same physical moment is consistent with the accuracy of the reliable clock offset. The full value of the reliable clock offset is realized in the embodiments of this application. The work done in the early stages of two-way time synchronization, cross-validation, and discarding and resynchronizing is all to ensure that the clock offset on which this conversion is based can withstand trust.

[0108] In some embodiments, step S502 involves sending a scheduled flash command carrying the target device time to the flash triggering device via the first communication link, so that the flash triggering device can trigger an external flash device to flash at the target device time via the flash triggering link.

[0109] It's important to note that the scheduled flash command is a pre-issued flash trigger instruction that carries the target device's time. Upon receiving this command, the flash triggering device waits according to its own clock. When its own clock reaches the target device's time, it triggers the external flashing device to fire via the flash triggering link. The term "schedule" refers to the method of determining the execution time. The flash time is determined by the event that the flash triggering device's clock reaches the target device's time, not by the arrival time of the scheduled flash command. When the scheduled flash command arrives on the first communication link, and the duration of its transmission, does not affect the flash time. The advance issuance allows sufficient time for the command to arrive. If a method of triggering upon receiving the command were used, the flash time would drift with the command transmission time. Even with a wired first communication link, transmission time fluctuates, making the accuracy of the flash time impossible. The flash trigger link has low transmission delay and is successively stable. Once the trigger command is issued, the flash is executed after a delay of several microseconds. The deviation between the flash time and the target device time consists of two parts: the error of the reliable clock offset and the delay of the flash trigger link. The former is within 1 to 2 ms, and the latter can be ignored. The accuracy of the flash time is thus guaranteed end-to-end.

[0110] In some more specific embodiments, the mobile terminal determines the target time as its own clock reading of 5000ms, with a reliable clock offset of 30.8ms, and the target device time is determined to be 5030.8ms. The mobile terminal sends a pre-determined flash command carrying 5030.8ms to the flash triggering device via the first communication link. Upon receiving this command, the flash triggering device continuously compares its own clock reading. When its own clock reading reaches 5030.8ms, it sends a trigger command to the external flash device via the flash triggering link. The external flash device begins flashing after a transmission delay on the order of microseconds. The actual deviation between the flash time and the target time is approximately 0.8ms. The common exposure window of the shooting scene is several milliseconds, and the flash duration is tens of microseconds. The flash falls within the exposure window, ensuring complete flash illumination for the target frame's exposure process.

[0111] In some more specific embodiments, the target time can be represented as: ; Where AppNow is the current reading of the mobile terminal's clock, LeadTime is the reserved scheduling lead time, CapturePredictOffset is the offset corresponding to image frame acquisition and prediction, and UserAdjustOffset is the user-adjusted offset. The target device time can be expressed as: ; That is, by adding a reliable clock offset to the target time, the clock of the mobile terminal is converted to the clock of the flash trigger device.

[0112] The scheduled flash command can be expressed as: The message format of SCHEDULE:{seq}:{TargetTxNs}:{channel}:{group}:{power} is delivered via the first communication link, wherein seq is the command sequence number, TargetTxNs is the target device time expressed in nanoseconds, channel is the radio frequency channel, group is the flash grouping, and power is the flash power. A scheduled flash command completes the reservation of the trigger time and completes the configuration of flash parameters at the same time.

[0113] After receiving the scheduled flash command, the flash trigger device performs timing verification. The flash trigger device reads the current reading of its own clock, expressed as: ; The remaining time is calculated and expressed as: ; If Remain<MinLead, that is, the remaining time is less than the minimum advance, the flash trigger device reports LATE:{seq}:{RemainNs} via the first communication link to inform the mobile terminal that the current reservation cannot be executed in time; the minimum advance can be expressed as: ; wherein CommandParse is the command parsing time consumption, TimerArm is the timer loading time consumption, RfPrepare is the radio frequency preparation time consumption, and SafetyMargin is the safety margin. If Remain≥MinLead, the flash trigger device enters timing waiting. Timing verification exposes the failed reservation in advance before the shooting action occurs, and the mobile terminal can rearrange the target time after receiving the LATE report, avoiding that the flash miss fire is only detected at the moment of shooting.

[0114] In some specific embodiments, the flash trigger device compensates for the fixed delay of the flash trigger link when determining the radio frequency transmission time. There is a fixed delay between the triggering instruction being issued and the actual flashing of the external flash device in the flash trigger link, and the total delay can be expressed as: ; wherein RfAirDelay is the air propagation time consumption of the radio frequency signal between the flash trigger device and the external flash device, FlashRxDelay is the time consumption for the external flash device to receive and parse the trigger instruction, and FlashTriggerDelay is the trigger execution time consumption from the completion of parsing to the actual start of flashing of the external flash device. To align the actual flashing time with the target device time, the flash trigger device advances the issuing time of the trigger instruction, and the radio frequency transmission time can be expressed as: ; namely: ; wherein UserRfAdjust is a user adjustment amount, which is for users to manually correct the flash time according to actual shooting effects. After compensation, the fixed delay on the flash trigger link is deducted in advance, the actual flash starting time of the external flash device is aligned with the target device time, and the accuracy of the flash time is not affected by the fixed delay of the link.

[0115] As an implementation manner, the delay compensation adopts a default value, and DefaultRfCompensation= , the three delays are set according to typical device parameters.

[0116] As another implementation manner, values are obtained by looking up a table according to the radio frequency channel and the model of the external flash device: ; wherein channel is a radio frequency channel, flashModel is the model of the external flash device, different models of external flash devices have different time consumption for receiving, processing and executing triggering, and the table look-up mode enables the compensation amount to match the actually connected device. If the external flash device has the capability of keeping time by itself according to the target device time, the flash trigger device can also directly obtain RfSendAtTx=TargetTx without delay compensation, deliver the trigger instruction to the external flash device in advance, and the external flash device starts flashing by itself at the target device time, so the responsibility of delay compensation is transferred to the external flash device side accordingly.

[0117] In some specific embodiments, after the flash trigger device determines the radio frequency transmission time, it executes timing triggering. The flash trigger device calculates the remaining radio frequency time: ; wherein nowT() represents reading the current reading of the clock of the flash trigger device.

[0118] if RfRemain < MinTimerArm, that is, the remaining radio frequency time is less than the minimum loading time consumption of the timer, the flash trigger device reports LATE:{seq}:{RfRemainNs} via the first communication link to inform the mobile terminal that the current trigger cannot be executed on time; If RfRemain ≥ MinTimerArm, the flash trigger device calls arm_rf_timer_at_ns(RfSendAtTxNs) to load a hardware timer. When the timer reaches the RF transmission time, an interrupt is triggered, and the flash trigger device sends an RF_FIRE_NOW:{seq}:{channel}:{group}:{power} trigger command via the flash trigger link. Timed triggering is accomplished by a hardware timer, and the timing accuracy does not depend on processor polling. The flash trigger device performing other tasks during the waiting period does not affect the accuracy of the trigger timing.

[0119] In some more specific embodiments, the flash triggering device records the execution status and reports it to the mobile terminal after issuing the trigger command. The flash triggering device records the actual time when the trigger command is issued: ; The first communication link reports FIRED:{seq}:{RfActualSendTxNs}, where seq is the command sequence number and RfActualSendTxNs is the actual transmission time expressed in nanoseconds. The mobile terminal matches the report with the previously sent scheduled flash command based on the command sequence number. The transmission error can be expressed as: ; RfSendError > 0 indicates that the actual transmission time is later than the radio frequency transmission time, while RfSendError < 0 indicates that it is earlier. Based on the transmission error, the estimated flash time can be expressed as: ; The estimated flash error can be expressed as: ; Among them, the estimated flash error reflects the actual execution accuracy of this flash. After the mobile terminal obtains this value, it has a quantitative conclusion on whether the flash hit the target frame in the exposure process. This conclusion can be viewed by the user and can also be used for subsequent shooting correction and compensation.

[0120] In some more specific embodiments, the analysis of transmission errors can be performed using the mobile terminal's clock. This involves converting the actual transmission time back to the mobile terminal's clock: ; in, As a reliable clock offset, the transmission error value under the mobile terminal's clock is: ; It should be noted that the derivation results show that the value of the transmission error under the clock of the mobile terminal is consistent with the value under the clock of the flash triggering device. The measurement of the transmission error is independent of which clock is used. The error conclusions drawn by the mobile terminal side and the flash triggering device side for the same execution are consistent. There is no conversion gap introduced by clock difference when the two sides exchange error data.

[0121] In step S105 of some embodiments, if the cross-validation result reflects that the deviation between the first clock relationship and the second clock relationship does not meet the preset confidence conditions, the time synchronization result corresponding to this round of time synchronization is discarded, and the first bidirectional message time synchronization and the second bidirectional message time synchronization are performed again until a reliable clock offset is determined.

[0122] It should be noted that if the cross-validation results show that the deviation between the first and second clock relationships does not meet the preset reliability conditions, it indicates that at least one of the two time synchronization paths in this round has been abnormally interfered with. The mobile terminal cannot identify which path is interfered with, nor can it recover the accurate clock relationship from the interfered results. Therefore, the time synchronization result corresponding to this round is discarded as a whole, and the process is repeated for two-way time synchronization. Both operating system scheduling jitter and link transmission jitter are sporadic and random. Interference in this round does not mean that interference will occur in the next round. The two clock relationships in the new time synchronization round are likely to match. After repeating several rounds, the reliable clock offset can be determined. The interfered time synchronization results are identified and removed, and no longer enter the flash scheduling stage. The cost of discarding and resynchronizing is a small amount of time overhead, and resynchronization brings reliability.

[0123] According to some embodiments of this application, the clock synchronization method for an external flash device in this application may further include: Count the number of times the synchronization rounds fail to meet the preset signal conditions consecutively; If the number of dropped messages reaches the preset threshold, the first and second bidirectional message time synchronization will be stopped, and an error message will be output.

[0124] It should be noted that the number of drops is a cumulative record of the dropped events in each time synchronization round, and only consecutive drops are counted. Once a time synchronization round meets the preset information conditions, the cumulative record is cleared and recounted. The handling of cross-validation failing to meet the preset information conditions is to drop the data and resynchronize. Occasional jitter can be recovered through resynchronization, and sporadic drops are normal. However, several consecutive drops indicate that the anomaly is no longer sporadic. Conditions such as continuous strong interference to the link, poor device connection, or abnormal device clocks can all cause the time synchronization result to continuously fail verification. In this case, continuing to resynchronize only repeats the same failure. The number of consecutive drops distinguishes between sporadic drops and persistent anomalies. When the number of drops is small, it is classified as sporadic; when the number of drops accumulates to a certain level, the conclusion of persistent anomaly can be established. Therefore, the number of drops is the condition for triggering subsequent processing.

[0125] It should be noted that the preset threshold number of drops is a pre-set limit for determining if an abnormality has become persistent. Its value should be higher than the normal range for occasional drops. Occasional jitter can cause at most a few consecutive drops in a single time synchronization cycle. Once the preset threshold number is exceeded, the conclusion that the threshold has been reached can rule out occasional situations. After the number of drops reaches the preset threshold, both time synchronization channels stop, and futile resynchronization will not continue. Simultaneously, an abnormality message is output to the user, informing them that time synchronization cannot be completed. The inability to complete time synchronization means that the reliable clock offset cannot be determined, flash scheduling loses its basis, and continuing to shoot will result in flash asynchrony. Stopping time synchronization and prompting the user allows the user to check equipment connections, adjust equipment position, or move away from interference sources before shooting. Re-initiating time synchronization after the user has addressed the abnormality is preferable to allowing flash asynchrony to occur.

[0126] In some more specific embodiments, a single round of two-way time synchronization is completed within 150ms. Occasional jitter-induced consecutive drops generally do not exceed five or six rounds, with a preset threshold of 10 drops. When the Bluetooth link between the mobile terminal and the external flash device is continuously interfered with, the time synchronization deviation in each round continuously falls within ±20 to 30ms. If the absolute value of the deviation continuously exceeds a preset threshold of 5ms, the number of drops accumulates round by round. When the preset threshold is reached in the 10th round, approximately 1.5 seconds have elapsed since the start of time synchronization. The mobile terminal then stops the first and second bidirectional message time synchronizations and outputs an error message on the shooting interface, indicating a connection error with the external flash device. After seeing the message, the user can re-establish the Bluetooth connection or move the mobile terminal away from the interference source and initiate time synchronization again. Once the time synchronization returns to normal, the number of drops is reset to zero, and flash shooting can continue.

[0127] According to some embodiments of this application, the clock synchronization method for an external flash device in this application may further include: In response to the establishment of a communication connection between the mobile terminal and the flash triggering device and the external flash device, the first two-way message time synchronization and the second two-way message time synchronization are periodically performed before the flash shooting task is triggered.

[0128] It should be noted that the embodiments of this application limit the timing and execution rhythm of time synchronization. The timing is when the mobile terminal establishes a communication connection with the flash triggering device and the external flash device. Once the three-way connection is ready, time synchronization begins immediately, without waiting for the user to initiate shooting. This arrangement firstly gains advance time. The first and second bidirectional message time synchronizations each require multiple rounds of message interaction. Including cross-verification and possible time dropping and resynchronization, it takes a certain amount of time to determine a reliable clock offset. This entire process is arranged to be completed before shooting is triggered. When the user presses the shooting button, the reliable clock offset is already ready, and the shooting response is not delayed by the time synchronization process.

[0129] It should be noted that periodic execution addresses clock drift. The clocks of the two devices are driven by independent crystal oscillators. Slight differences in timing rates cause the clock offset to change slowly over time, and a previously determined reliable clock offset gradually becomes outdated. Periodic execution of two-way time synchronization continuously refreshes the reliable clock offset, keeping its staleness within the interval between adjacent synchronizations. Whenever a shooting task is triggered, the most recent synchronization is not far in the past, ensuring that the clock offset used for reuse or conversion remains fresh. Furthermore, the rhythm of periodic time synchronization can be arranged more leisurely. The interval between adjacent cycles is set according to the rate of drift accumulation, avoiding both excessively frequent synchronizations that consume communication and computing resources and excessively sparse ones that allow the offset to become outdated. The synchronization overhead is thus diluted throughout the entire connection period.

[0130] It should be understood that the embodiments of this application can be connected with the aforementioned embodiments of effective duration reuse. Periodic time synchronization ensures that the most recent time synchronization time is continuously moved forward. The time interval between the current time and the time synchronization time when shooting is triggered usually falls within the preset effective duration. Reusing branches becomes the norm, and resynchronizing branches are only executed occasionally when the shooting interval exceeds the preset effective duration, thereby further reducing the time synchronization overhead.

[0131] In some specific embodiments, after the mobile terminal connects to the flash triggering device via a Universal Serial Bus interface and to an external flash device via Bluetooth, the mobile terminal automatically begins periodically performing two-way time synchronization. Each cycle completes one round of multi-round message interaction and cross-verification, all within 150ms, with intervals between adjacent cycles. The user can initiate flash shooting at any time after the connection is established. The time interval between the most recently determined reliable clock offset and the current time is less than a preset effective duration of 30 seconds. The shooting directly reuses this reliable clock offset. The time from pressing the shooting button to issuing the scheduled flash command does not include a time synchronization step, and the shooting response time is unaffected. In low-light environments, the user connects the device first and then composes the shot. The time used for composing and framing is precisely utilized by the periodic time synchronization, which is completed without the user's awareness.

[0132] Reference Figure 8 According to some embodiments of this application, periodically performing first bidirectional message time synchronization and second bidirectional message time synchronization may include: Step S801: If the mobile terminal is the first system platform, the first clock relationship is determined once every preset round of first bidirectional message time synchronization. Step S802: If the mobile terminal is a second system platform, when the flash shooting task is triggered, the first bidirectional message time synchronization is performed a preset number of times to determine the first clock relationship.

[0133] In step S801 of some embodiments, if the mobile terminal is a first system platform, a first clock relationship is determined once every preset round of first bidirectional message time synchronization; It should be noted that the first system platform, represented by Android, allows applications to intensively organize message interactions. Each message round trip has a short time, and a preset number of rounds of bidirectional message time synchronization can be executed continuously within a time synchronization cycle. The preset number of rounds is commensurate with the data requirements for statistical aggregation. Link time consumption sorting and elimination, as well as candidate clock offset aggregation, are both based on a certain sample size. The preset number of rounds ensures that sufficient single clock offsets are accumulated in each cycle, and the first clock relationship is determined once within each cycle. The time synchronization results are refreshed continuously with each cycle. The time synchronization rhythm on this platform is continuous and intensive, with multiple rounds of interaction completed in a short time, limiting the impact on the shooting process and communication resources.

[0134] In step S802 of some embodiments, if the mobile terminal is a second system platform, a first bidirectional message time synchronization is performed a preset number of times when the flash shooting task is triggered, so as to determine the first clock relationship.

[0135] It should be noted that the second system platform, represented by the iOS platform, employs a different Bluetooth communication scheduling strategy than the first system platform. Message round trips are limited by system scheduling, resulting in longer processing times and a rhythm not controlled by the application. This makes it difficult to implement intensive, periodic, multi-round time synchronization during the connection period, thus reducing the preset number of rounds compared to the first system platform. Time synchronization is instead performed when a flash shooting task is triggered, with the trigger time adjacent to the shooting time. At this point, the determined clock offset has almost no drift accumulation and is the least outdated, perfectly meeting the shooting requirement for clock offset freshness. The time synchronization rhythm on the second system platform is triggered on demand, without consuming communication resources under normal circumstances. When a shooting task is triggered, a smaller number of message exchanges determine the initial clock relationship. Although the number of exchanges is small, cross-validation and discarding / re-synchronizing processes are still performed as usual, ensuring the reliability of the time synchronization result.

[0136] It should be understood that the two steps coexist because the platform capabilities differ while the accuracy requirements are consistent. The first system platform utilizes its intensive interaction capabilities to achieve robust statistical aggregation through multiple rounds of accumulation; the second system platform, within its interaction limitations, uses triggering moments close to the shooting time to achieve fresh clock offsets. The two rhythms are set according to the platform conditions, and the final determined first clock relationship serves the same accuracy target, ensuring that the flash synchronization effect remains consistent on both platforms.

[0137] In some more specific embodiments, when the mobile terminal is an Android platform, the first bidirectional message time synchronization is executed 10 times consecutively in each time synchronization cycle, and the entire process is completed within 150ms. The first clock relationship is determined by sorting and eliminating links based on their time consumption and aggregating the median. During the cycle interval, clock drift accumulates slowly, and the time synchronization result of the next cycle refreshes it. When the mobile terminal is an iOS platform, Bluetooth message round trips are scheduled by the system, and the time consumption of a single round trip is significantly longer than that of the Android platform. No periodic time synchronization is organized during the connection. When the user triggers a flash shooting task, the mobile terminal executes the first bidirectional message time synchronization 3 times consecutively. The first clock relationship is determined based on the time information of the 3 interactions, and then used for the conversion of the target device's time. Time synchronization and shooting are closely linked, and the time interval from the determination of clock offset to its use is measured in milliseconds, so the drift effect can be ignored.

[0138] Reference Figure 9 , Figure 9 This illustration shows the hardware structure of an electronic device according to another embodiment. The electronic device may include: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 902 can be implemented as a read-only memory (ROM), static storage device, dynamic storage device, or random access memory (RAM). The memory 902 can store the operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901 to execute the clock synchronization method of the external flash device in the embodiments of this application. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0139] This application also provides a computer program product, which includes a computer program. The processor of a computer device reads and executes the computer program, causing the computer device to perform the clock synchronization method for the external flash device described above.

[0140] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “including,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatuses.

[0141] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0142] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0143] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0144] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0145] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0146] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium may include: a USB flash drive, a portable hard drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and other media capable of storing program code.

[0147] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.

[0148] The above is a detailed description of the embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A clock synchronization method for an external flash device, characterized in that, Applied to a mobile terminal, the method includes: Based on the first communication link between the mobile terminal and the flash triggering device, a first bidirectional message time synchronization is performed to determine the first clock relationship between the flash triggering device and the mobile terminal. Based on the second communication link between the mobile terminal and the external flash device, a second bidirectional message time synchronization is performed to determine the second clock relationship between the external flash device and the mobile terminal; wherein, the first communication link and the second communication link are independent communication links, the flash trigger link refers to the communication link between the flash trigger device and the external flash device, and the flash trigger link is a different communication link from the first communication link and the second communication link, and the flash trigger device is used to trigger the external flash device to flash via the flash trigger link; Cross-validate the first clock relationship and the second clock relationship to obtain the cross-validation results; If the cross-validation results reflect that the deviation between the first clock relationship and the second clock relationship meets the preset confidence conditions, then a reliable clock offset is determined based on the first clock relationship and the second clock relationship. If the cross-validation result reflects that the deviation between the first clock relationship and the second clock relationship does not meet the preset confidence condition, then the time synchronization result corresponding to this round of time synchronization is discarded, and the first bidirectional message time synchronization and the second bidirectional message time synchronization are performed again until the reliable clock offset is determined.

2. The clock synchronization method for an external flash device according to claim 1, characterized in that, The step of performing a first bidirectional message time synchronization based on the first communication link between the mobile terminal and the flash triggering device to determine the first clock relationship of the flash triggering device relative to the mobile terminal includes: For this round of time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response is received from the flash triggering device; wherein, the synchronization response carries the synchronization sequence number, the request receiving time originating from the flash triggering device, and the device response time; The single clock offset corresponding to this round of time synchronization is determined based on the terminal sending time, the terminal receiving time, the request receiving time, and the device response time; wherein, the terminal receiving time is the time when the mobile terminal receives the synchronization response; For the next round of time synchronization, a synchronization request carrying a synchronization sequence number and the terminal sending time is sent to the flash triggering device via the first communication link, and a synchronization response is received from the flash triggering device until the single clock offset corresponding to each of the multiple rounds of time synchronization is obtained; The first clock relationship is determined based on the single clock offset corresponding to each of the multiple rounds of time synchronization.

3. The clock synchronization method for an external flash device according to claim 2, characterized in that, The step of determining the single clock offset corresponding to this round of time synchronization based on the terminal sending time, terminal receiving time, request receiving time, and device response time includes: The intermediate time on the device side is determined based on the request reception time and the device response time; The terminal-side intermediate time is determined based on the terminal's sending time and receiving time. The deviation between the device-side intermediate time and the terminal-side intermediate time is determined as the single clock offset.

4. The clock synchronization method for an external flash device according to claim 3, characterized in that, The step of determining the first clock relationship based on the single clock offset corresponding to each of the multiple rounds of time synchronization includes: For each round of time synchronization, the round-trip time is determined based on the terminal sending time and the terminal receiving time, the device processing time is determined based on the request receiving time and the device response time, and the difference between the round-trip time and the device processing time is determined as the link time. The synchronization times are sorted according to the link consumption time corresponding to each synchronization time, and a synchronization time sequence is obtained. According to the preset elimination conditions, some time synchronization rounds in the time synchronization sequence are filtered out, and the single clock offsets corresponding to the remaining time synchronization rounds are determined as multiple candidate clock offsets; The first clock relationship is determined by statistically aggregating multiple candidate clock offsets.

5. The clock synchronization method for an external flash device according to claim 1, characterized in that, The cross-validation of the first clock relationship and the second clock relationship includes: Based on the first clock relationship and the second clock relationship, the inter-device clock relationship between the flash triggering device and the external flash device is determined; The device clock relationship is compared with a reference clock relationship to determine the deviation between the first clock relationship and the second clock relationship; wherein the reference clock relationship is determined based on the flash triggering link between the flash triggering device and the external flash device.

6. The clock synchronization method for an external flash device according to claim 5, characterized in that, The step of determining the reliable clock offset based on the first clock relationship and the second clock relationship includes: The clock offset corresponding to the first clock relationship is determined as the reliable clock offset; wherein, the second communication link is used to transmit the synchronization message of the second bidirectional message synchronization, and is not used to transmit the flash trigger command to trigger the external flash device to flash.

7. The clock synchronization method for an external flash device according to claim 1, characterized in that, After determining the reliable clock offset based on the first clock relationship and the second clock relationship, the method further includes: The camera of the mobile terminal is controlled to continuously capture image frames, and the timestamp of each image frame is obtained. Based on the image frame timestamp, the target prediction timestamp corresponding to the target frame is predicted and determined, and the target time corresponding to the target prediction timestamp is determined as the target time. The target device time is determined based on the trusted clock offset and the target time. A scheduled flash command carrying the target device time is sent to the flash triggering device via the first communication link, so that the flash triggering device can trigger the external flash device to flash at the target device time via the flash triggering link.

8. The clock synchronization method for an external flash device according to claim 1, characterized in that, After determining the reliable clock offset based on the first clock relationship and the second clock relationship, the method further includes: The target device time is determined based on the trusted clock offset and the target time. A scheduled flash command carrying the target device time is sent to the flash triggering device via the first communication link, so that the flash triggering device can trigger the external flash device to flash at the target device time via the flash triggering link.

9. An electronic device, characterized in that, It includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the clock synchronization method for an external flash device as described in any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, implements the clock synchronization method for an external flash device as described in any one of claims 1 to 8.