Time synchronization method of sensor, electronic device, and storage medium

CN117728909BActive Publication Date: 2026-10-13DREAM INNOVATION TECH (SUZHOU) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211100919.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2026-10-13
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

[0005]然而,惯性测量传感器仅能在采集到传感数据的情况下采集运动轨迹信息,信息采集方式受限

Benefits of technology

[0035]本申请提供的技术方案,至少具有以下优点:通过获取第一传感器的驱动组件输出第一驱动信号时生成的驱动帧计数值,第一驱动信号用于驱动第一传感器采集传感数据;响应于获取到第一传感器采集传感数据时输出的第一反馈信号,生成第一反馈信号的信号帧计数值;将驱动帧计数值和信号帧计数值进行比较;在比较结果满足预设要求的情况下,按照基准时间系统的当前基准时间设置传感数据的时间戳,基准时间系统为第二传感器使用的时间系统,第二传感器为需要与第一传感器进行时间同步的传感器;可以解决第二传感器的采集时机、不同传感器采集的传感数据的存储方式不灵活的问题;由于第一传感器采集的传感数据和第二传感器采集的传感数据在时间上同步,因此,即使第一传感器和第二传感器分别采集传感数据,也能够根据各自的时间戳实现同步。这样,无需限制第二传感器的采集时机,且在使用第一传感器采集的传感数据和第二传感器采集的传感数据时,通过各自的时间戳调取即可,无需将第一传感器采集的传感数据和第二传感器采集的传感数据成对存储,可以提高传感数据的采集和存储的灵活性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117728909B_ABST
    Figure CN117728909B_ABST
Patent Text Reader

Abstract

The application relates to a sensor time synchronization method, an electronic device and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: acquiring a driving frame count value generated when a driving component of a first sensor outputs a first driving signal; in response to acquiring a first feedback signal output when the first sensor collects sensing data, generating a signal frame count value of the first feedback signal; comparing the driving frame count value and the signal frame count value; and in the case that the comparison result meets preset requirements, setting a time stamp of the sensing data according to a current reference time of a reference time system, the reference time system being a time system used by a second sensor. The method can solve the problem that the collection time of the second sensor and the storage mode of the sensing data collected by different sensors are not flexible, and improve the flexibility of sensing data collection and storage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of computer technology, specifically relating to time synchronization methods for sensors, electronic devices, and storage media. Background Technology

[0002] Self-moving devices are those that can move autonomously without human intervention. To enable self-movement, self-moving devices are typically equipped with various sensors to collect data for target identification, movement, or obstacle avoidance.

[0003] When using sensor data collected by various sensors, the mobile device needs to use sensor data collected at the same time, or sensor data with a time difference of less than a preset duration. In this case, it is necessary to ensure that the time systems of various sensors are synchronized.

[0004] Taking the time synchronization between the first sensor and the inertial measurement sensor as an example, the traditional time synchronization method includes: sending a synchronization signal to the inertial measurement sensor at the same time as the camera device acquires a frame of sensing data in the video image; when the inertial measurement sensor receives the synchronization signal, it uses the inertial measurement sensor to acquire the motion trajectory information of the camera device; and storing the acquired frame of sensing data, the corresponding timestamp, and the synchronized motion trajectory information into a set of data.

[0005] However, inertial measurement sensors can only acquire motion trajectory information if sensing data is available, limiting the information acquisition method. Furthermore, sensing data and motion trajectory information need to be stored in pairs, further restricting data storage methods. Summary of the Invention

[0006] The technical problems to be solved in this application include:

[0007] To address the aforementioned technical problems, this application provides a time synchronization method for sensors, the method comprising:

[0008] The driving frame count value generated when the driving component of the first sensor outputs the first driving signal is obtained. The first driving signal is used to drive the first sensor to collect sensing data.

[0009] In response to the first feedback signal output by the first sensor when it acquires the sensing data, a signal frame count value of the first feedback signal is generated;

[0010] Compare the drive frame count value and the signal frame count value;

[0011] If the comparison result meets the preset requirements, the timestamp of the sensing data is set according to the current reference time of the reference time system. The reference time system is the time system used by the second sensor, which is a sensor that needs to be synchronized with the first sensor in time.

[0012] Optionally, setting the timestamp of the sensing data according to the current reference time of the reference time system when the comparison result meets the preset requirements includes:

[0013] If the drive frame count value is the same as the signal frame count value, the timestamp of the sensing data is set to the current reference time;

[0014] or,

[0015] If the difference between the drive frame count value and the signal frame count value is less than a preset value, the timestamp of the sensing data is set to the current reference time.

[0016] Optionally, the method further includes:

[0017] If the comparison result does not meet the preset requirements, the drive frame count value and the signal frame count value are reset, and after the reset, the drive frame count value generated when the first drive signal output by the drive component is obtained is triggered; in response to the first feedback signal output when the first sensor collects the sensing data, the signal frame count value of the first feedback signal is generated; and the drive frame count value and the signal frame count value are compared.

[0018] Optionally, the method further includes:

[0019] The drive component is controlled to output a second drive signal, which is used to drive the first sensor to output a second feedback signal. The duration of the second feedback signal is different from the duration of the clutter signal.

[0020] In response to acquiring the second feedback signal output by the first sensor, the step of triggering the execution of the step of acquiring the drive frame count value generated when the drive component outputs the first drive signal; in response to acquiring the first feedback signal output by the first sensor when collecting the sensing data, the step of generating the signal frame count value of the first feedback signal; and the step of comparing the drive frame count value and the signal frame count value.

[0021] Optionally, the step of triggering the execution of the drive frame count value generated when acquiring the first drive signal output by the drive component in response to acquiring the second feedback signal output by the first sensor; generating the signal frame count value of the first feedback signal in response to acquiring the first feedback signal output by the first sensor when acquiring the sensing data; and comparing the drive frame count value and the signal frame count value includes:

[0022] When the second feedback signal output by the first sensor is obtained and the number of the second feedback signals reaches a preset number, the step of triggering the execution of the drive frame count value generated when the first drive signal output by the drive component is obtained; in response to the first feedback signal output by the first sensor when the sensing data is collected, the step of generating the signal frame count value of the first feedback signal; and the step of comparing the drive frame count value and the signal frame count value.

[0023] Optionally, when the first sensor outputs the sensing data, the driving component sets an initial timestamp for the sensing data, and the time system used by the first sensor is different from the reference time system;

[0024] Setting the timestamp of the sensor data according to the current reference time of the reference time system includes:

[0025] The initial timestamp is modified to the current reference time to obtain the timestamp of the sensing data.

[0026] Optionally, comparing the drive frame count value and the signal frame count value includes:

[0027] If the signal frame count value changes, the drive frame count value and the signal frame count value are compared.

[0028] or,

[0029] If the drive frame count value changes, the drive frame count value and the signal frame count value are compared.

[0030] or,

[0031] The drive frame count value and the signal frame count value are compared at preset intervals.

[0032] Optionally, the first sensor includes a camera, and correspondingly, the first feedback signal includes the exposure signal output by the camera.

[0033] On the other hand, this application provides an electronic device including a processor and a memory connected to the processor; the memory stores a program that, when executed by the processor, is used to implement the sensor time synchronization method provided in the above aspects.

[0034] In another aspect, this application also provides a computer-readable storage medium storing a program that, when executed by a processor, is used to implement the sensor time synchronization method provided in the above aspects.

[0035] The technical solution provided in this application has at least the following advantages: It acquires the drive frame count value generated when the drive component of the first sensor outputs a first drive signal, the first drive signal being used to drive the first sensor to collect sensing data; in response to the first feedback signal output when the first sensor collects sensing data, it generates a signal frame count value for the first feedback signal; it compares the drive frame count value with the signal frame count value; if the comparison result meets preset requirements, it sets the timestamp of the sensing data according to the current reference time of the reference time system, the reference time system being the time system used by the second sensor, and the second sensor being the sensor that needs to be synchronized with the first sensor in time; it can solve the problems of inflexible timing of the second sensor's data acquisition and the storage method of sensing data acquired by different sensors; since the sensing data acquired by the first sensor and the sensing data acquired by the second sensor are synchronized in time, even if the first sensor and the second sensor acquire sensing data separately, they can still achieve synchronization according to their respective timestamps. In this way, there is no need to restrict the timing of the second sensor's data acquisition. Furthermore, when using the sensor data acquired by the first sensor and the sensor data acquired by the second sensor, they can be retrieved using their respective timestamps. There is no need to store the sensor data acquired by the first sensor and the sensor data acquired by the second sensor in pairs, which can improve the flexibility of sensor data acquisition and storage.

[0036] In addition, the timestamp of the first sensor's sensing data is set according to the current reference time of the reference time system only when the comparison result of the driving frame count value and the signal frame count value meets the preset requirements. On the one hand, this ensures that the time systems corresponding to the first sensor and the second sensor are consistent. On the other hand, the timestamp of the sensor is set only when the sensing data collected by the first sensor can be time-synchronized, thus saving time synchronization resources.

[0037] In addition, if the comparison result does not meet the preset requirements, resetting the drive frame count value and the signal frame count value can ensure that the sensor data with timestamps set according to the reference time system are all synchronized sensor data, thus ensuring the effectiveness of sensor data time synchronization.

[0038] In addition, by controlling the drive component to output a second drive signal before comparing the drive frame count value with the signal frame count value, so as to drive the first sensor to output a second feedback signal; and only after obtaining the second feedback signal output by the first sensor, the drive frame count value and the signal frame count value are obtained and compared, the problem of inaccurate signal frame count value can be avoided, and the accuracy of time synchronization can be guaranteed, thereby ensuring the accuracy of time synchronization. Attached Figure Description

[0039] To more clearly illustrate the technical solutions in the specific embodiments of this application or the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0040] Figure 1 This is a schematic diagram of the structure of a self-moving device provided in one embodiment of this application;

[0041] Figure 2 This is a flowchart of a sensor time synchronization method provided in one embodiment of this application;

[0042] Figure 3 This is a block diagram of a sensor time synchronization device provided in one embodiment of this application;

[0043] Figure 4 This is a block diagram of an electronic device provided in one embodiment of this application. Detailed Implementation

[0044] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. The application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features in the embodiments of this application can be combined with each other.

[0045] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0046] In this application, unless otherwise stated, directional terms such as "upper," "lower," "top," and "bottom" are generally used in relation to the direction shown in the accompanying drawings, or in relation to the vertical, perpendicular, or gravitational direction of the component itself; similarly, for ease of understanding and description, "inner" and "outer" refer to the inner and outer contours of each component itself, but the above directional terms are not intended to limit this application.

[0047] Figure 1 This is a schematic diagram of the structure of a self-moving device provided in one embodiment of this application. Self-moving devices include, but are not limited to, robot vacuums, robot mops, or food delivery robots, etc. This embodiment does not limit the implementation method of the self-moving device. Figure 1 It is known that the self-moving device includes: a first sensor 110, a second sensor 120, and a controller 130.

[0048] The first sensor 110 refers to a sensor that needs to be driven by a driving component during operation, such as a camera or a lidar sensor.

[0049] Generally, the controller 130 is connected to the first sensor 110 via a drive component. The drive component can be software installed in the controller 130 or the first sensor 110, or it can be hardware integrated within or separate from the controller 130, or it can be hardware integrated within or separate from the first sensor 110, or it can be a combination of software and hardware. This embodiment does not limit the implementation method of the drive component.

[0050] In this embodiment, the output terminal of the first sensor 110 is also connected to the controller 130 to receive the feedback signal output by the first sensor 110 during operation. For example, if the controller 130 is a microcontroller unit (MCU), the output terminal of the first sensor 110 is also connected to the synchronization pin of the MCU to enable the controller to receive the feedback signal output by the first sensor.

[0051] Taking the first sensor 110 as a camera as an example, the feedback signal includes the exposure signal output by the camera. The process of the camera acquiring a frame of image data includes two stages: exposure and readout. When the camera's exposure occurs, it outputs a frame of exposure signal, and then reads out the captured image data. At this time, since the output terminal of the first sensor 110 is connected to the synchronization pin of the MCU, the MCU can obtain the exposure signal output by the camera.

[0052] In the case that the first sensor 110 is another type of sensor, the feedback signal can also be the sensing data collected by the first sensor 110. This embodiment does not limit the implementation method of the feedback signal.

[0053] Each time the driving component drives the first sensor 110 to collect sensing data, it sets a timestamp for the sensing data according to the driving component's time system.

[0054] The second sensor 120 is a sensor that needs to be time-synchronized with the first sensor. Generally, the second sensor 120 can acquire sensing data without being driven by a driver component. For example, in an inertial measurement unit (IMU), the second sensor 120 is connected to the controller 130 so that the controller 130 can acquire the sensing data acquired by the second sensor 120.

[0055] Schematic, the controller 130 is connected to the second sensor 120 via a serial port to read the sensing data collected by the second sensor 120 via the serial port and to set a timestamp for the sensing data according to the reference time system.

[0056] Optionally, the reference time system is the time system used by the controller 130. The reference time system is usually different from the time system used by the drive components. In this case, the timestamps of the sensing data collected by the first sensor and the sensing data collected by the second sensor use different time systems. When comparing or fusing the sensing data, errors will occur, causing the comparison or fusion algorithm to fail.

[0057] Based on this, in this embodiment, the controller 130 sets the timestamp of the first sensor according to a reference time system. Specifically, the controller 130 is used to: acquire the drive frame count value generated when the drive component of the first sensor outputs a first drive signal, the first drive signal being used to drive the first sensor to collect sensing data; in response to acquiring the first feedback signal output when the first sensor collects sensing data, generate a signal frame count value of the first feedback signal; compare the drive frame count value and the signal frame count value; and, if the comparison result meets preset requirements, set the timestamp of the sensing data according to the current reference time of the reference time system, the reference time system being the time system used by the second sensor.

[0058] In this embodiment, the controller operates two counters. One counter increments its count by 1 each time the drive component outputs a drive signal (including the first drive signal) to obtain the drive frame count value. The other counter increments its count by 1 when a feedback signal (including the first feedback signal) is received to obtain the signal frame count value.

[0059] Because there may be delays in the driving component's drive to the first sensor to collect sensing data, or blockages may occur when the controller reads the sensing data, the drive frame count value and the signal frame count value may be inconsistent. Therefore, even if the sensing data collected by the first sensor and the sensing data collected by the second sensor are synchronized in the time system, this inconsistency may still lead to time asynchrony between the sensing data collected by the first sensor and the sensing data collected by the second sensor. Therefore, in this embodiment, the timestamp of the first sensor's sensing data is set according to the current reference time of the reference time system only if the comparison result of the drive frame count value and the signal frame count value meets the preset requirements. This ensures that the time systems corresponding to the first sensor and the second sensor are consistent, and also saves time synchronization resources by setting the timestamp of the sensor only when the sensing data collected by the first sensor can be time-synchronized.

[0060] Furthermore, since the sensing data collected by the first sensor and the second sensor are synchronized in time, they can be synchronized based on their respective timestamps even if they collect data separately. This eliminates the need to restrict the timing of the second sensor's data collection, and the data can be retrieved using their respective timestamps, eliminating the need to store the data in pairs. This improves the flexibility of sensing data acquisition and storage.

[0061] The time synchronization method for sensors provided in this application will be described below. The following embodiments demonstrate the application of this method... Figure 1 The method described is specifically used in the controller of the self-moving device. In actual implementation, this method can also be used in other devices that are connected to the self-moving device, such as user terminals or servers. User terminals include, but are not limited to, mobile phones, computers, tablets, wearable devices, etc. This embodiment does not limit the implementation methods of other devices or user terminals.

[0062] The communication connection can be wired or wireless. The wireless communication method can be short-range communication or wireless communication, etc. This embodiment does not limit the communication method between the cleaning equipment and other equipment.

[0063] Figure 2 This is a flowchart of a sensor time synchronization method provided in one embodiment of this application. The method includes at least the following steps:

[0064] Step 201: Obtain the drive frame count value generated when the drive component of the first sensor outputs the first drive signal.

[0065] The first driving signal is used to drive the first sensor to collect sensing data.

[0066] The controller controls the drive component to output a first drive signal to trigger the first sensor to collect sensing data. At this time, the controller can monitor whether the drive component outputs the first drive signal and generate a drive frame count value when it detects that the drive component outputs the first drive signal.

[0067] The controller is equipped with a first counter corresponding to the drive signal, which is initialized to 0. Accordingly, the drive frame count value is obtained by: responding to the first drive signal output by the drive component, triggering the value of the first counter to increment by 1, thereby obtaining the drive frame count value.

[0068] Step 202: In response to the first feedback signal output when the first sensor acquires sensing data, generate a signal frame count value for the first feedback signal.

[0069] The controller is equipped with a second counter corresponding to the feedback signal, which is initialized to 0. Accordingly, the signal frame count value for generating the first feedback signal is obtained by: in response to the first feedback signal, triggering the value of the second counter to increment by 1, thus obtaining the signal frame count value.

[0070] Step 203: Compare the drive frame count value and the signal frame count value.

[0071] Ideally, each time the drive component outputs a drive signal, the controller receives the corresponding feedback signal. That is, the drive frame count and the signal frame count should be equal. However, in real-world applications, due to the influence of the drive component or hardware devices, there may be a delay between sending the drive signal and receiving the feedback signal. In this case, the drive frame count and the signal frame count may differ, which could cause the sensing data collected by the first sensor to become out of sync with the sensing data collected by the second sensor. Therefore, it is necessary to compare the drive frame count and the signal frame count.

[0072] Optionally, the drive frame count value and the signal frame count value can be compared, including but not limited to the following methods:

[0073] The first method involves comparing the drive frame count value with the signal frame count value when the signal frame count value changes.

[0074] At this time, after the second counter completes the increment operation, the controller compares the updated signal frame count value with the current drive frame count value.

[0075] The second method involves comparing the drive frame count value with the signal frame count value when the drive frame count value changes.

[0076] At this time, after the first counter completes the increment operation, the controller compares the updated signal drive frame count value with the current signal frame count value.

[0077] The third method: compare the drive frame count value and the signal frame count value at preset intervals.

[0078] In other embodiments, the controller may also compare the drive frame count value and the signal frame count value based on comparison instructions sent by other devices. This embodiment does not limit the timing of the comparison between the drive frame count value and the signal frame count value.

[0079] Step 204: If the comparison result meets the preset requirements, set the timestamp of the sensor data according to the current reference time of the reference time system. The reference time system is the time system used by the second sensor, which is a sensor that needs to be synchronized with the first sensor in time.

[0080] In one example, the preset requirement includes that the drive frame count value and the signal frame count value are the same. In this case, if the comparison result meets the preset requirement, the timestamp of the sensor data is set according to the current reference time of the reference time system, including: if the drive frame count value and the signal frame count value are the same, setting the timestamp of the sensor data to the current reference time.

[0081] In another example, the preset requirement includes that the difference between the drive frame count value and the signal frame count value is less than a preset value. This preset value is pre-stored in the self-moving device and can be 1 frame or 2 frames, etc. This embodiment does not limit the value of the preset value. In this case, if the comparison result meets the preset requirement, the timestamp of the sensor data is set according to the current reference time of the reference time system. This includes setting the timestamp of the sensor data to the current reference time when the difference between the drive frame count value and the signal frame count value is less than the preset value.

[0082] Optionally, different models of the first sensor correspond to different preset values. The self-moving device can also obtain the model of the first sensor and determine the preset value based on that model.

[0083] When the first sensor outputs sensing data, the driving component sets an initial timestamp for the sensing data, and the time system used by the first sensor is different from the reference time system. At this time, setting the timestamp of the sensing data according to the current reference time of the reference time system includes: modifying the initial timestamp to the current reference time to obtain the timestamp of the sensing data.

[0084] Optionally, if the comparison result does not meet the preset requirements, the drive frame count value and the signal frame count value are reset, and after the reset, the drive frame count value generated when the first drive signal is obtained from the drive component is triggered; in response to the first feedback signal output when the first sensor collects sensing data, the signal frame count value of the first feedback signal is generated; and the drive frame count value and the signal frame count value are compared.

[0085] The reset is similar to a soft restart of the controller. At this time, the drive frame count and signal frame count are reset to their initial values, such as 0. Even if there were no received exposure signals before the reset, the controller will not receive them after the reset.

[0086] In summary, the sensor time synchronization method provided in this embodiment obtains the drive frame count value generated when the drive component of the first sensor outputs the first drive signal, the first drive signal being used to drive the first sensor to collect sensing data; in response to obtaining the first feedback signal output when the first sensor collects sensing data, a signal frame count value of the first feedback signal is generated; the drive frame count value and the signal frame count value are compared; if the comparison result meets preset requirements, the timestamp of the sensing data is set according to the current reference time of the reference time system, the reference time system being the time system used by the second sensor, the second sensor being the sensor that needs to be time synchronized with the first sensor; this can solve the problems of the second sensor's acquisition timing and the inflexible storage method of sensing data collected by different sensors; since the sensing data collected by the first sensor and the sensing data collected by the second sensor are synchronized in time, even if the first sensor and the second sensor collect sensing data separately, they can still achieve synchronization according to their respective timestamps. In this way, there is no need to restrict the timing of the second sensor's data acquisition. Furthermore, when using the sensor data acquired by the first sensor and the sensor data acquired by the second sensor, they can be retrieved using their respective timestamps. There is no need to store the sensor data acquired by the first sensor and the sensor data acquired by the second sensor in pairs, which can improve the flexibility of sensor data acquisition and storage.

[0087] In addition, the timestamp of the first sensor's sensing data is set according to the current reference time of the reference time system only when the comparison result of the driving frame count value and the signal frame count value meets the preset requirements. On the one hand, this ensures that the time systems corresponding to the first sensor and the second sensor are consistent. On the other hand, the timestamp of the sensor is set only when the sensing data collected by the first sensor can be time-synchronized, thus saving time synchronization resources.

[0088] In addition, if the comparison result does not meet the preset requirements, resetting the drive frame count value and the signal frame count value can ensure that the sensor data with timestamps set according to the reference time system are all synchronized sensor data, thus ensuring the effectiveness of sensor data time synchronization.

[0089] During the initial period after the driver component starts up, the output driver signal is unstable. At this time, the feedback signal generated by the driver signal may contain noise. The duration of the noise signal may be the same as the duration of the feedback signal. In this case, the self-moving device may mistakenly identify the noise signal as the feedback signal and count the noise signal, resulting in inaccurate signal frame count values.

[0090] Optionally, based on the above-mentioned technical problems, in this embodiment, the self-moving device further controls the driving component to output a second driving signal, which is used to drive the first sensor to output a second feedback signal. The signal duration of the second feedback signal is different from the duration of the clutter signal.

[0091] Taking the feedback signal as the exposure signal as an example, the duration of the exposure signal (i.e. the first exposure signal) output by the traditional first sensor at each moment is 30 milliseconds (ms). However, in this embodiment, the second driving signal is output before the first driving signal is output. The duration of the second exposure signal triggered by the second driving signal is 50ms. In this way, the second exposure signal can be distinguished from the noise signal based on the duration, thereby determining whether the second exposure signal has been received.

[0092] At this time, in response to the acquisition of the second feedback signal output by the first sensor, indicating the start of time synchronization, the following steps are triggered: acquiring the drive frame count value generated when the drive component outputs the first drive signal; generating the signal frame count value of the first feedback signal when the first sensor collects sensing data; and comparing the drive frame count value and the signal frame count value. That is, in response to the acquisition of the second feedback signal output by the first sensor, the above steps 201-204 are triggered.

[0093] In other words, the second feedback signal is used to indicate the start of time synchronization.

[0094] Optionally, to further improve the accuracy of determining the start of time synchronization, the self-moving device may, when it acquires the second feedback signal output by the first sensor and the number of the second feedback signals reaches a preset number, trigger the following steps: acquiring the drive frame count value generated when the drive component outputs the first drive signal; generating the signal frame count value of the first feedback signal in response to acquiring the first feedback signal output when the first sensor collects sensing data; and comparing the drive frame count value with the signal frame count value.

[0095] The preset quantity is stored in the self-moving device. The preset quantity can be 2 frames or 3 frames, etc. This embodiment does not limit the value of the preset quantity.

[0096] The count value of the second feedback signal can also be implemented using a second counter corresponding to the feedback signal. That is, the count value of the second counter is compared with the count value of the first counter only after the count value of the second counter reaches a preset number. In other embodiments, the count value of the second feedback signal can also be implemented using an additional counter. This embodiment does not limit the implementation method of the count value of the second feedback signal.

[0097] In this embodiment, by controlling the driving component to output a second driving signal before comparing the driving frame count value with the signal frame count value, so as to drive the first sensor to output a second feedback signal; and only after obtaining the second feedback signal output by the first sensor, the driving frame count value and the signal frame count value are obtained and compared, the problem of inaccurate obtained signal frame count value can be avoided, and the accuracy of time synchronization can be guaranteed, thereby ensuring the accuracy of time synchronization.

[0098] Figure 3 This is a block diagram of a sensor time synchronization device provided in one embodiment of this application. The device includes at least the following modules: a first acquisition module 310, a second acquisition module 320, a counting comparison module 330, and a time synchronization module 340.

[0099] The first acquisition module 310 is used to acquire the drive frame count value generated when the drive component of the first sensor outputs the first drive signal, wherein the first drive signal is used to drive the first sensor to collect sensing data.

[0100] The second acquisition module 320 is used to generate a signal frame count value of the first feedback signal in response to the first feedback signal output when the first sensor collects the sensing data;

[0101] The counting comparison module 330 is used to compare the driving frame count value and the signal frame count value;

[0102] The time synchronization module 340 is used to set the timestamp of the sensing data according to the current reference time of the reference time system when the comparison result meets the preset requirements. The reference time system is the time system used by the second sensor, and the second sensor is the sensor that needs to be time synchronized with the first sensor.

[0103] For relevant details, please refer to the above embodiments.

[0104] It should be noted that the time synchronization device for the sensor provided in the above embodiments is only illustrated by the division of the above functional modules when performing sensor time synchronization. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the sensor time synchronization device can be divided into different functional modules to complete all or part of the functions described above.

[0105] Furthermore, the time synchronization device for the sensor and the time synchronization method for the sensor provided in the above embodiments belong to the same concept, and their specific implementation process can be found in the method embodiments, which will not be repeated here.

[0106] Figure 4 This is a block diagram of an electronic device according to an embodiment of this application. The electronic device includes... Figure 1 The self-moving device shown includes at least a processor 401 and a memory 402.

[0107] Processor 401 may include one or more processing cores, such as a quad-core processor or an octa-core processor. Processor 401 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 401 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 401 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the screen. In some embodiments, processor 401 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.

[0108] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 402 are used to store at least one instruction, which is executed by the processor 401 to implement the sensor time synchronization method provided in the method embodiments of this application.

[0109] In some embodiments, the electronic device may also optionally include: a peripheral device interface and at least one peripheral device. The processor 401, memory 402, and peripheral device interface can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface via a bus, signal line, or circuit board. Indicatively, peripheral devices include, but are not limited to: radio frequency circuitry, a touch display screen, audio circuitry, and a power supply.

[0110] Of course, electronic devices may also include fewer or more components, and this embodiment does not limit this.

[0111] Optionally, this application also provides a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the sensor time synchronization method of the above method embodiments.

[0112] Optionally, this application also provides a computer product including a computer-readable storage medium storing a program that is loaded and executed by a processor to implement the sensor time synchronization method of the above method embodiments.

[0113] The technical features of the embodiments described above can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification. The embodiments described above only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of the invention patent. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.

[0114] Obviously, the embodiments described above are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, those skilled in the art can make other variations or modifications without creative effort, and all such variations or modifications should fall within the scope of protection of this application.

Claims

1. A time synchronization method for a sensor, characterized in that, The method includes: The driving frame count value generated when the driving component of the first sensor outputs the first driving signal is obtained. The first driving signal is used to drive the first sensor to collect sensing data. In response to the first feedback signal output by the first sensor when it acquires the sensing data, a signal frame count value of the first feedback signal is generated; Compare the drive frame count value and the signal frame count value; If the comparison result meets the preset requirements, the timestamp of the sensing data is set according to the current reference time of the reference time system. The reference time system is the time system used by the second sensor, which is a sensor that needs to synchronize its time with the first sensor. Wherein, setting the timestamp of the sensing data according to the current reference time of the reference time system when the comparison result meets the preset requirements includes: If the drive frame count value is the same as the signal frame count value, the timestamp of the sensing data is set to the current reference time; or, If the difference between the drive frame count value and the signal frame count value is less than a preset value, the timestamp of the sensing data is set to the current reference time.

2. The method according to claim 1, characterized in that, The method further includes: If the comparison result does not meet the preset requirements, the drive frame count value and the signal frame count value are reset, and after the reset, the drive frame count value generated when the first drive signal output by the drive component is obtained is triggered; in response to the first feedback signal output when the first sensor collects the sensing data, the signal frame count value of the first feedback signal is generated; and the drive frame count value and the signal frame count value are compared.

3. The method according to claim 1, characterized in that, The method further includes: The drive component is controlled to output a second drive signal, which is used to drive the first sensor to output a second feedback signal. The duration of the second feedback signal is different from the duration of the clutter signal. In response to acquiring the second feedback signal output by the first sensor, the step of triggering the execution of the step of acquiring the drive frame count value generated when the drive component outputs the first drive signal; in response to acquiring the first feedback signal output by the first sensor when collecting the sensing data, the step of generating the signal frame count value of the first feedback signal; and the step of comparing the drive frame count value and the signal frame count value.

4. The method according to claim 3, characterized in that, In response to acquiring the second feedback signal output by the first sensor, the driver frame count value generated when acquiring the first driving signal output by the driving component is triggered; in response to acquiring the first feedback signal output by the first sensor when collecting the sensing data, the signal frame count value of the first feedback signal is generated. The step of comparing the drive frame count value and the signal frame count value includes: When the second feedback signal output by the first sensor is obtained and the number of the second feedback signals reaches a preset number, the drive frame count value generated when the first drive signal output by the drive component is obtained is triggered; in response to the first feedback signal output by the first sensor when collecting the sensing data, the signal frame count value of the first feedback signal is generated. The step of comparing the drive frame count value and the signal frame count value.

5. The method according to any one of claims 1 to 4, characterized in that, When the first sensor outputs the sensing data, the driving component sets an initial timestamp for the sensing data, and the time system used by the first sensor is different from the reference time system. Setting the timestamp of the sensor data according to the current reference time of the reference time system includes: The initial timestamp is modified to the current reference time to obtain the timestamp of the sensing data.

6. The method according to any one of claims 1 to 4, characterized in that, The step of comparing the drive frame count value and the signal frame count value includes: If the signal frame count value changes, the drive frame count value and the signal frame count value are compared. or, If the drive frame count value changes, the drive frame count value and the signal frame count value are compared. or, The drive frame count value and the signal frame count value are compared at preset intervals.

7. The method according to any one of claims 1 to 4, characterized in that, The first sensor includes a camera, and correspondingly, the first feedback signal includes the exposure signal output by the camera.

8. An electronic device, characterized in that, The electronic device includes a memory and a processor connected to the memory, the memory storing a program that, when executed by the processor, is used to implement the time synchronization method for the sensor as described in any one of claims 1 to 7.

9. A computer-readable storage medium, characterized in that, The storage medium stores a program that, when executed by a processor, is used to implement the time synchronization method for the sensor as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Watch and method for synchronizing time thereof

    CN104503222A

  • Multi-sensor time synchronization method and device, electronic equipment and storage medium

    CN113890668A