Time Synchronization Method, Multi-Sensor System and Movable Platform

Connecting the master sensor and slave sensor through the serial bus is achieved, time synchronization between sensors is solved, time synchronization problems in multi-sensor systems are improved, and the accuracy and cost-effectiveness of data fusion are improved.

CN112119365BActive Publication Date: 2025-05-27SZ ZHUOYU TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN201980031054.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-07-10
Publication Date
2025-05-27
Estimated Expiration
2039-07-10

AI Technical Summary

Technical Problem

In applications such as drones, multiple sensors need to achieve time synchronization in order to accurately integrate data, but the prior art is difficult to effectively achieve time synchronization between sensors.

Method used

The main sensor and slave sensor are connected through the serial bus. The main sensor obtains the current time data and sends it to the slave sensor through the serial bus. After receiving the time data from the slave sensor, its local time is updated.

Benefits of technology

High-precision time synchronization between sensors is achieved, cost reduction, simplified wiring and installation, and has a low dependence on specific hardware.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112119365B_ABST
    Figure CN112119365B_ABST
Patent Text Reader

Abstract

A time synchronization method, a multi-sensor system and a mobile platform, the method comprising: a master sensor acquiring current time data of the master sensor; the master sensor sending the time data to a slave sensor through a serial port bus; the serial port bus being used to connect the master sensor and the slave sensor; after receiving the time data through the serial port bus, the slave sensor updating the local time of the slave sensor according to the time data. Applying the embodiments of the present invention can ensure the time synchronization accuracy of sensors and meet service requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technologies, and in particular, to a time synchronization method, a multi-sensor system, and a mobile platform. Background Art

[0002] Unmanned aerial vehicles (UAVs), such as drones, have been developed for various fields, including consumer applications and industrial applications. For example, drones can be maneuvered for entertainment, photography / videography, surveillance, delivery, or other applications. Obviously, the applications of drones have extended all aspects of personal life.

[0003] With the popularization of UAVs, the number of sensors deployed on UAVs is also increasing. For example, cameras, IMUs (Inertial Measurement Units), lidars, etc. In some application scenarios, it is necessary to obtain sensor data at the same moment and fuse these sensor data. For example, fuse the data collected by the camera at time A with the data collected by the IMU at time A.

[0004] Obviously, in order to accurately fuse data, each sensor needs to ensure time synchronization. In this way, the sensor data at the same moment can be fused. Therefore, there is an urgent need for a time synchronization method that can achieve time synchronization between sensors. Summary of the Invention

[0005] The present invention provides a time synchronization method, a multi-sensor system, and a mobile platform, which can achieve time synchronization between various sensors and meet service requirements.

[0006] In a first aspect of the present invention, a time synchronization method is provided, which is applied to a hardware device. The hardware device includes a plurality of sensors; one of the sensors is a master sensor, and the other sensors are slave sensors. The master sensor and the slave sensors are connected through a serial bus. The method includes:

[0007] The master sensor obtains the current time data of the master sensor.

[0008] The master sensor sends the time data to the slave sensors through the serial bus; wherein, the serial bus is used to connect the master sensor and the slave sensors.

[0009] After receiving the time data through the serial bus, the slave sensors update their local times according to the time data.

[0010] In a second aspect of the present invention, a multi-sensor system is provided. The multi-sensor system includes a plurality of sensors; one of the sensors is a master sensor, and the other sensors are slave sensors. The master sensor and the slave sensors are connected through a serial bus.

[0011] The master sensor is configured to obtain the current time data of the master sensor and send the time data to the slave sensors through the serial bus.

[0012] The slave sensors are configured to update the local time of the slave sensors according to the time data after receiving the time data through the serial bus.

[0013] In a third aspect of the present invention, a multi-sensor system is provided. The multi-sensor system includes a plurality of sensors; one of the sensors is a master sensor, and the other sensors are slave sensors. The master sensor and the slave sensors are connected through a serial bus.

[0014] The master sensor includes a first processor and a first memory; the first memory is configured to store first computer instructions executable by the first processor.

[0015] The slave sensors include a second processor and a second memory; the second memory is configured to store second computer instructions executable by the second processor.

[0016] The first processor is configured to read the first computer instructions from the first memory to implement: obtaining the current time data of the master sensor and sending the time data to the slave sensors through the serial bus; the second processor is configured to read the second computer instructions from the second memory to implement: updating the local time of the slave sensors according to the time data after receiving the time data through the serial bus.

[0017] In a fourth aspect of the present invention, a mobile platform is provided, including:

[0018] A body;

[0019] A power system disposed on the body, the power system being configured to provide power for the mobile platform; and the above multi-sensor system.

[0020] In a fifth aspect of the present invention, a time synchronization method is provided, which is applied to a sensor. The method includes:

[0021] Receiving time data sent through a serial bus;

[0022] Updating the local time of the sensor according to the time data.

[0023] In a sixth aspect of the present invention, a sensor is provided, including a processor;

[0024] The processor is configured to receive time data sent through a serial bus;

[0025] Update the local time of the sensor according to the time data.

[0026] In a seventh aspect of the present invention, a machine-readable storage medium is provided, on which computer instructions are stored. When the computer instructions are executed, the above-mentioned time synchronization method is implemented.

[0027] Based on the above technical solutions, in the embodiments of the present invention, the master sensor can send time data to the slave sensor through the serial bus. After receiving the time data through the serial bus, the slave sensor updates the local time of the slave sensor according to the time data. The above method synchronizes time data through the serial bus, which can ensure the time synchronization accuracy of the sensor, meet the service requirements, greatly reduce the cost of the synchronization method, is very convenient for board making and installation wiring, and has low dependence on specific hardware. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for describing the embodiments of the present invention or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings of the embodiments of the present invention.

[0029] Figure 1 It is a schematic connection diagram of a serial bus in an implementation manner;

[0030] Figure 2 It is a schematic diagram of an embodiment of a time synchronization method in an implementation manner;

[0031] Figure 3 It is a schematic diagram of an embodiment of a time synchronization method in another implementation manner;

[0032] Figure 4 It is a schematic diagram of two RS485 buses in an implementation manner;

[0033] Figure 5 It is a schematic diagram of an embodiment of a time synchronization method in another implementation manner;

[0034] Figure 6 It is a schematic diagram of an RS485 bus in an implementation manner;

[0035] Figure 7 It is a schematic diagram of a first redundancy design in an implementation manner;

[0036] Figure 8 It is a schematic diagram of the second redundancy design in an implementation manner;

[0037] Figure 9 It is a schematic diagram of the third redundancy design in an implementation manner;

[0038] Figure 10 It is a block diagram of an embodiment of a hardware device in an implementation manner. Detailed implementation manners

[0039] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without making creative efforts shall fall within the protection scope of the present invention. In addition, without conflict, the following embodiments and the features in the embodiments may be combined with each other.

[0040] The terms used in the present invention are only for the purpose of describing specific embodiments, rather than limiting the present invention. The singular forms of "a", "the" and "said" used in the present invention and the claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should be understood that the term "and / or" used herein refers to any or all possible combinations including one or more of the associated listed items.

[0041] Although the terms first, second, third, etc. may be used in the present invention to describe various information, such information should not be limited to these terms. These terms are used to distinguish information of the same type from each other. For example, without departing from the scope of the present invention, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, in addition, the word "if" used may be interpreted as "when", or "while", or "in response to determining".

[0042] Embodiment 1:

[0043] A time synchronization method is proposed in an embodiment of the present invention, which can be applied to a hardware device. The hardware device may include multiple sensors; one of the sensors is the main sensor, and the other sensors are slave sensors. The number of slave sensors is at least one, and the main sensor is connected to the slave sensors through a serial bus. See Figure 1 As shown, it is a schematic diagram of the main sensor and the slave sensors connected through a serial bus, that is, the main sensor is connected to each slave sensor through a serial bus.

[0044] Optionally, for the multiple sensors, one sensor among the multiple sensors can be obtained as the master sensor, and the other sensors except the master sensor can be used as slave sensors. Further, if the current master sensor fails, another sensor among the multiple sensors can be obtained as the new master sensor, and the other sensors except the new master sensor can be used as slave sensors.

[0045] The hardware device may include a multi-sensor system. The multi-sensor system can obtain one sensor among the multiple sensors as the master sensor, and there is no limitation on this obtaining method. For example, any one of the multiple sensors can be used as the master sensor, or a certain strategy can be adopted to select one sensor from the multiple sensors as the master sensor. There is no limitation on this strategy and it can be arbitrarily configured according to needs.

[0046] Optionally, in one example, the serial bus may include an RS485 (Recommended Standard 485) bus. Of course, the RS485 bus is just an example, and the serial bus can also be other types of serial buses, such as an RS232 (Recommended Standard 232) bus, a CAN (Controller Area Network) bus, an SPI (Serial Peripheral Interface) bus, an I2C (Inter Integrated Circuit) bus, etc. There is no limitation on the type of the serial bus. For the sake of convenient description, the RS485 bus is taken as an example for illustration.

[0047] Optionally, in one example, the hardware device may include but is not limited to a movable platform. Moreover, the movable platform may include but is not limited to an unmanned aerial vehicle (such as a drone, etc.), a robot, an ordinary vehicle, etc. There is no limitation on this, as long as the hardware device can include multiple sensors, the multiple sensors are connected through a serial bus, and the multiple sensors need to perform time synchronization.

[0048] Optionally, in one example, the sensors of the hardware device may include but are not limited to: an IMU sensor, an image sensor, a lidar sensor (such as LiDAR (Light Detection And Ranging), etc.), an electronic control unit (such as an ECU (Electronic Control Unit), etc.). Of course, the above are just several examples of the sensor types, and there is no limitation on this. As long as the sensors are deployed on the hardware device, they are all within the protection scope of the present invention.

[0049] Among them, the master sensor may include an IMU sensor. Of course, the master sensor may also be other types of sensors, and there is no limitation in this regard. For example, the master sensor may be an image sensor, a lidar sensor, an electronic control unit, etc. Taking the master sensor being an IMU sensor as an example. Since the IMU sensor has a high clock accuracy, a low probability of failure, and is convenient for master-slave design and redundancy design, the IMU sensor can be used as the master sensor and the time of the IMU sensor can be synchronized to the slave sensor.

[0050] The slave sensors include but are not limited to at least one of the following: IMU sensors, image sensors, lidar sensors, electronic control units. Of course, the above are only examples, and there is no limitation on the slave sensors. As long as the sensors are deployed on the hardware device, they are all within the protection scope of the present invention.

[0051] See Figure 2 As shown, it is a schematic flowchart of the time synchronization method, and the method may include:

[0052] Step 201, the master sensor obtains the current time data of the master sensor.

[0053] Step 202, the master sensor sends the time data to the slave sensor through the serial bus.

[0054] Step 203, after receiving the time data through the serial bus, the slave sensor updates the local time of the slave sensor according to the time data, that is, updates its own local time according to the time data.

[0055] Optionally, in an example, the serial bus can connect all sensors, and a sensor (such as an IMU sensor) can be selected from all sensors as the clock source, that is, this sensor is the master sensor. Specifically, the master sensor and the slave sensor are connected through a serial converter. The master sensor periodically obtains its own current time data and sends the time data to each slave sensor through the serial bus, so that each slave sensor updates its own local time according to the time data, that is, synchronizes its own time to the time of the master sensor, thereby synchronizing the time of all sensors.

[0056] In the embodiments of the present application, the serial bus transmits data in a unidirectional protocol manner. That is, during the time synchronization process between the master sensor and the slave sensor, only one-way communication is required, and two-way communication is not required to achieve time synchronization. The synchronization process is relatively simple and is suitable for devices with short links such as drones and pan-tilts. For example, the master sensor can send time data to the slave sensor, and the slave sensor does not need to return any information to the master sensor. The slave sensor can directly update the local time using the time data, rather than the slave sensor updating the local time of the slave sensor using the information of multiple interactions after several interactions between the master sensor and the slave sensor.

[0057] Optionally, in an example, the slave sensor updating the local time of the slave sensor according to the time data may include, but is not limited to: when the slave sensor receives a trigger signal from the master sensor, recording the reception time of the trigger signal, and updating the local time of the slave sensor according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

[0058] Case 1: If the trigger signal is a synchronization signal independent of the time data, and the serial bus includes a first serial sub-bus and a second serial sub-bus, the master sensor sending the time data to the slave sensor through the serial bus may include: the master sensor sending the trigger signal to the slave sensor through the first serial sub-bus, and simultaneously sending the time data to the slave sensor through the second serial sub-bus.

[0059] Further, when the slave sensor receives the trigger signal from the master sensor, recording the reception time of the trigger signal may include, but is not limited to: when the slave sensor receives the trigger signal sent by the master sensor through the first serial sub-bus, the reception time of the trigger signal may be recorded.

[0060] Case 2: If the trigger signal is the first N bit signals of the time data, and the serial bus is a single-channel serial bus, the master sensor sending the time data to the slave sensor through the serial bus may include: the master sensor sending the time data to the slave sensor through the single-channel serial bus.

[0061] Further, when the slave sensor receives the trigger signal from the master sensor, recording the reception time of the trigger signal may include, but is not limited to: when the slave sensor detects the rising edge or falling edge of the first bit signal of the time data, recording the current time as the reception time of the trigger signal.

[0062] Optionally, in the above embodiments, the slave sensor updates the local time of the slave sensor according to the time data, which may include but is not limited to: the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data.

[0063] Furthermore, the time data may include a timestamp; the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data, which may include but is not limited to: the slave sensor determines the difference between the current time of the slave sensor and the reception time of the trigger signal, and updates the local time of the slave sensor according to the timestamp and the difference; or, the slave sensor determines the difference between the timestamp and the reception time of the trigger signal, and updates the local time of the slave sensor according to the current time of the slave sensor and the difference.

[0064] Optionally, in an example, the slave sensor updates the local time of the slave sensor according to the time data, which may include: the slave sensor updates the local system time of the slave sensor according to the time data; and / or, the slave sensor updates the local hardware time of the slave sensor according to the time data.

[0065] Optionally, in an example, the slave sensor updates the local time of the slave sensor according to the time data, which may include but is not limited to: the slave sensor updates the virtual clock of the slave sensor according to the time data; the slave sensor updates the local time of the slave sensor according to the virtual clock.

[0066] Wherein, the time data includes a timestamp, and the starting virtual time of the virtual clock is the timestamp. Based on this, the slave sensor updates the local time of the slave sensor according to the virtual clock, which may include but is not limited to: after a preset duration, updating the target virtual time of the virtual clock to the sum of the timestamp and the preset duration, and updating the local time of the slave sensor to the target virtual time.

[0067] Optionally, in an example, the slave sensor updates the local time of the slave sensor according to the time data, which may include but is not limited to: the slave sensor determines whether the time data is valid time data; if so, the slave sensor updates the local time of the slave sensor according to the time data.

[0068] Optionally, in an example, the slave sensor updates the local time of the slave sensor according to the time data, which may include but is not limited to: the slave sensor determines whether there is a start marker in the time data; if so, the slave sensor updates the local time of the slave sensor according to the time data.

[0069] Optionally, in one example, the slave sensor can also determine time drift information based on multiple time data, and perform time compensation on the crystal oscillator according to the time drift information.

[0070] Optionally, in one example, when the slave sensor receives multiple time data, it can also determine the sending methods corresponding to the multiple time data, and determine the priorities corresponding to the multiple time data according to the sending methods; wherein, the sending methods include the serial bus sending method and other sending methods except the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to other sending methods. Further, the sensor can update the local time of the slave sensor through the time data with the highest priority according to the priorities corresponding to the multiple time data.

[0071] Obviously, due to the existence of the serial bus sending method and other sending methods except the serial bus, when there is a problem with the time data of the serial bus sending method (such as the time data of the serial bus sending method is not received), as a redundant method, the time data of other sending methods can also be used to update the local time of the slave sensor, that is, there is an alternative synchronization scheme to ensure that time synchronization can be achieved and the reliability of the slave sensor can be improved. When the time data of the serial bus sending method is normal, the time data of the serial bus sending method can be used to update the local time of the slave sensor to ensure accurate time.

[0072] Optionally, in one example, the master sensor and the slave sensor can also be connected through an Ethernet cable (i.e., an Ethernet interface); the slave sensor can perform information interaction with the master sensor through the Ethernet cable to achieve time synchronization. Among them, the master sensor and the slave sensor can be connected through an Ethernet structure converter. When the slave sensor receives the time data sent by the master sensor through the serial bus and the time data sent by the master sensor through the Ethernet cable at the same time, and the priority of the serial bus is greater than the priority of the Ethernet cable, the slave sensor can update the local time based on the time data sent by the master sensor through the serial bus. Or, when the slave sensor only receives the time data sent by the master sensor through the serial bus, the slave sensor can update the local time based on the time data sent by the master sensor through the serial bus. Or, when the slave sensor only receives the time data sent by the master sensor through the Ethernet cable, the slave sensor can update the local time based on the time data sent by the master sensor through the Ethernet cable.

[0073] In an application scenario, when the master sensor cannot send time data through the serial bus, it can also send time data through the Ethernet cable, so that the slave sensor can still update the local time according to the time data of the master sensor, ensuring that the local clock of the slave sensor is synchronized with the master sensor.

[0074] Optionally, in one example, the slave sensors may include, but are not limited to, a first slave sensor and at least one second slave sensor. The first slave sensor and the second slave sensor are connected by an Ethernet cable; the second slave sensor exchanges information with the first slave sensor through the Ethernet cable to achieve time synchronization. Among them, the first slave sensor may include an IMU sensor. Of course, the first slave sensor may also be other types of sensors, which are not limited in this regard. For example, image sensors, lidar sensors, electronic control units, etc. Subsequently, the IMU sensor will be used as an example. The second slave sensor includes at least one of the following: IMU sensor, image sensor, lidar sensor, electronic control unit. Of course, the above are just examples and are not limited in this regard.

[0075] Exemplarily, if the first slave sensor does not receive the time data sent by the master sensor through the serial bus within the preset time, the first slave sensor may send the time data of the first slave sensor to the second slave sensor through the Ethernet cable between the first slave sensor and the second slave sensor, so that the second slave sensor performs time synchronization according to the time data of the first slave sensor.

[0076] Exemplarily, the master sensor and the first slave sensor may respectively correspond to preset priorities. If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor at the same time, and the priority of the master sensor is greater than the priority of the first slave sensor, the second slave sensor updates the local time based on the time data of the master sensor; if the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor at the same time, and the priority of the master sensor is less than the priority of the first slave sensor, the second slave sensor updates the local time based on the time data of the first slave sensor.

[0077] The serial bus and the Ethernet cable may respectively correspond to preset priorities. If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable at the same time, and the priority of the serial bus is greater than the priority of the Ethernet cable, the second slave sensor updates the local time based on the time data sent through the serial bus; if the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable at the same time, and the priority of the serial bus is less than the priority of the Ethernet cable, the second slave sensor updates the local time based on the time data sent through the Ethernet cable.

[0078] Based on the above technical solution, in the embodiment of the present invention, the master sensor can send time data to the slave sensor through the serial bus. After receiving the time data through the serial bus, the slave sensor updates its local time according to the time data. The above method synchronizes time data through the serial bus, which can ensure the time synchronization accuracy of the sensor, that is, the synchronization accuracy can be in the millisecond level, which can meet the business requirements. The cost of the synchronization method is greatly reduced, the board making and installation wiring are very convenient, and the dependence on specific hardware is low. Moreover, since the common hardware interface (serial port) on the sensor can be used for time synchronization, the requirements of low cost, simple wiring, general interface, and accuracy guarantee are taken into account.

[0079] Since the serial port is a common hardware interface with a simple protocol, and sensors on mobile platforms all support the serial port protocol, it is convenient to implement time synchronization through the serial bus in terms of hardware modification and wiring. Since the baud rate of the serial port is fixed (for example, if 115200bps is selected, the transmission time for one byte is 0.0868ms), and the distance between sensors on mobile platforms is short, the link transmission can be ignored, thus meeting the accuracy requirements in the millisecond level. Compared with software synchronization methods such as NTP (Network Time Protocol), the synchronization method of the serial bus is not affected by system load and non-real-time system scheduling delay. Compared with the GPS (Global Positioning System) synchronization method, the synchronization method of the serial bus is very convenient for board making and installation wiring. Compared with high-precision synchronization protocols such as IEEE1588 (Institute of Electrical and Electronics Engineers), the synchronization method of the serial bus has low dependence on specific hardware, and the accuracy in the millisecond level is completely sufficient.

[0080] The above technical solution will be further described below in conjunction with several specific embodiments.

[0081] Embodiment 2:

[0082] A time synchronization method is proposed in the embodiment of the present invention, which can be applied to an unmanned aerial vehicle. The unmanned aerial vehicle can include a master sensor and a slave sensor, and the master sensor is connected to the slave sensor through a serial bus (such as an RS485 bus). In this embodiment, the serial bus includes two buses. For the convenience of distinction, the two buses are called the first serial sub-bus and the second serial sub-bus, that is, the serial bus includes the first serial sub-bus (such as a 485 bus 1) and the second serial sub-bus (such as another 485 bus 2).

[0083] See Figure 3As shown, it is a schematic flowchart of a time synchronization method, and the method may include:

[0084] Step 301, the master sensor obtains the current time data of the master sensor. The time data may include a timestamp, and the timestamp may represent the current time value of the master sensor. For example, if the current time value of the master sensor is time A, then the timestamp included in the time data may be time A.

[0085] In an example, the master sensor may perform time synchronization periodically. That is to say, in each synchronization period, the master sensor needs to obtain the current time data and perform subsequent steps. Since the time synchronization process in each synchronization period is the same, therefore, taking one time synchronization process as an example.

[0086] Step 302, the master sensor sends a trigger signal to the slave sensor through the first serial port sub-bus, and simultaneously sends the time data (such as a timestamp) to the slave sensor through the second serial port sub-bus.

[0087] In an example, the trigger signal is a synchronization signal independent of the time data. The master sensor can send a trigger signal to the slave sensor through the first serial port sub-bus. While sending the trigger signal, the master sensor can also send the time data to the slave sensor through the second serial port sub-bus.

[0088] Step 303, the slave sensor receives the trigger signal sent by the master sensor through the first serial port sub-bus and records the reception time of the trigger signal. For example, when the slave sensor receives the trigger signal sent by the master sensor at time B, it can record the reception time of the trigger signal as time B.

[0089] Step 304, the slave sensor receives the time data sent by the master sensor through the second serial port sub-bus and obtains the timestamp of the master sensor from the time data, such as time A.

[0090] Step 305, the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal and the timestamp; wherein, the trigger signal is a synchronization signal independent of the time data.

[0091] In an example, the slave sensor can update the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the timestamp. Specifically, determine the difference between the current time of the slave sensor and the reception time of the trigger signal, and update the local time of the slave sensor according to the timestamp and the difference; or determine the difference between the timestamp and the reception time of the trigger signal, and update the local time of the slave sensor according to the current time of the slave sensor and the difference.

[0092] For example, assume that the current time of the slave sensor is time C, the time stamp is time A, and the reception time of the trigger signal is time B. Then, calculate the difference 1 between time C and time B (i.e., the absolute value of the difference between the two), and update the local time of the slave sensor according to time A and difference 1. For example, update the local time of the slave sensor to the sum of time A and difference 1. Alternatively, calculate the difference 2 between time A and time B (i.e., the absolute value of the difference between the two), and update the local time of the slave sensor according to time C and difference 2. For example, update the local time of the slave sensor to the difference between time C and difference 2.

[0093] Since the master sensor sends the trigger signal and time data (including the time stamp) simultaneously, and the transmission delay of the trigger signal / time data can be ignored, the slave sensor receives the trigger signal and time data simultaneously. The trigger signal is a pulse signal. The time when the slave sensor receives the trigger signal can be approximated as the time when the master sensor sends the trigger signal, that is, the reception time of the trigger signal (time B) should be the same as the time when the master sensor sends the trigger signal (time A). If the time of the master sensor and the slave sensor is not synchronized, time B and time A are different. If the time of the master sensor and the slave sensor is synchronized, time B and time A are the same. Obviously, when time B and time A are different, time synchronization is required.

[0094] Since the content of the time data is relatively large, the slave sensor needs to receive all the content of the time data completely before it can obtain the time stamp of the master sensor (i.e., time A) from the time data. Obviously, the time when the slave sensor obtains the time stamp is no longer time B. Assume that the time when the time stamp is obtained is time C.

[0095] In view of the above findings, in this embodiment, the slave sensor can update the local time of the slave sensor according to the reception time of the trigger signal (i.e., time B), the current time of the slave sensor (i.e., time C, the slave sensor obtains the time stamp in the time data at time C and performs time synchronization at time C), and the time stamp (i.e., time A). For the specific update method, refer to the above embodiment and will not be elaborated here.

[0096] In one example, as shown in Figure 4 After the master sensor is powered on, it sends a 1PPS (Pulse Per Second) pulse as the trigger signal to the slave sensor through an RS485 bus (i.e., the first serial port sub-bus), and sends a data packet carrying the time stamp (this data packet is referred to as time data in this article) to the slave sensor through another RS485 bus (i.e., the second serial port sub-bus).

[0097] In Figure 4 T represents the trigger signal, and TS represents the data packet carrying the time stamp. In Figure 4It can be seen that while the master sensor sends a trigger signal to the slave sensor through the first serial port bus, the master sensor can send a data packet carrying a timestamp to the slave sensor through the second serial port bus.

[0098] When the slave sensor receives the trigger signal sent by the master sensor through the first serial port bus, it can record the reception time of the trigger signal. After receiving the trigger signal, the slave sensor can receive the time data sent by the master sensor through the second serial port bus, and obtain the timestamp of the master sensor from the time data (such as obtaining the timestamp by parsing the data packet). Further, the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the timestamp.

[0099] Optionally, in an example, for the trigger signal sent by the master sensor to the slave sensor, in addition to being used to trigger the slave sensor for time synchronization, the trigger signal can also be used as a data trigger signal for the slave sensor, that is, to control the slave sensor to perform data processing based on the trigger signal, and there is no limitation in this regard.

[0100] Embodiment 3:

[0101] In an embodiment of the present invention, a time synchronization method is proposed, which can be applied to an unmanned aerial vehicle. The unmanned aerial vehicle can include a master sensor and a slave sensor, and the master sensor is connected to the slave sensor through a serial port bus (such as an RS485 bus). In this embodiment, the serial port bus includes one serial port bus, that is, the serial port bus is a single-channel serial port bus (such as a single-channel 485 bus), and time synchronization is achieved through the single-channel serial port bus.

[0102] See Figure 5 As shown in the flowchart of the time synchronization method, the method may include:

[0103] Step 501, the master sensor obtains the current time data of the master sensor. The time data may include a timestamp, and the timestamp may represent the current time value of the master sensor. For example, if the current time value of the master sensor is moment A, the timestamp included in the time data may be moment A.

[0104] Step 502, the master sensor sends the time data to the slave sensor through the single-channel serial port bus.

[0105] In this embodiment, the trigger signal is the first N-bit signal of the time data, and N is a positive integer greater than or equal to 1. Therefore, the master sensor does not need to separately send a trigger signal to the slave sensor through the single-channel serial port bus, but represents the trigger signal through the first N-bit signal of the time data.

[0106] Step 503: When the slave sensor detects the rising edge or falling edge of the first bit signal of the time data (including the timestamp), record the current time as the reception time of the trigger signal.

[0107] For example, when the slave sensor detects the rising edge or falling edge of the first bit signal of the time data at time B, the first N (such as 1) bit signals of the time data can be used as the trigger signal. That is to say, it is determined that the slave sensor receives the trigger signal sent by the master sensor at time B, and the current time is recorded as the reception time of the trigger signal, that is, the reception time of the trigger signal is recorded as time B.

[0108] Step 504: The slave sensor receives the time data sent by the master sensor through a single-channel serial bus, and obtains the timestamp of the master sensor from the time data. For example, the timestamp is time A.

[0109] Step 505: The slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal and the timestamp; where the trigger signal is the first N bit signals of the time data.

[0110] In an example, the slave sensor can update the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the timestamp. Specifically, determine the difference between the current time of the slave sensor and the reception time of the trigger signal, and update the local time of the slave sensor according to the timestamp and the difference; or, determine the difference between the timestamp and the reception time of the trigger signal, and update the local time of the slave sensor according to the current time of the slave sensor and the difference.

[0111] For example, assume that the current time of the slave sensor is time C, the timestamp is time A, and the reception time of the trigger signal is time B. Then calculate the difference 1 between time C and time B (that is, the absolute value of the difference between the two), and update the local time of the slave sensor according to time A and the difference 1. For example, update the local time of the slave sensor to the sum of time A and the difference 1. Or, calculate the difference 2 between time A and time B (that is, the absolute value of the difference between the two), and update the local time of the slave sensor according to time C and the difference 2. For example, update the local time of the slave sensor to the difference between time C and the difference 2.

[0112] When the master sensor sends time data (including time stamps) through a single-channel serial bus, the transmission delay of the time data can be ignored. Assume that the slave sensor receives the first N bit signals (such as the first bit signal) of the time data at time B. Among them, the reception time of the first N bit signals can be approximately the time when the master sensor sends the time data, that is, the reception time of the first N bit signals (time B) should be the same as the time when the master sensor sends the time data (time A). If the time of the master sensor and the slave sensor is not synchronized, then time B and time A are different. If the time of the master sensor and the slave sensor is synchronized, time B and time A are the same. Obviously, when time B and time A are different, time synchronization is required.

[0113] Since the content of the time data is relatively large, the slave sensor needs to receive all the content of the time data completely before it can obtain the time stamp of the master sensor (that is, time A) from the time data. Obviously, the time when the slave sensor obtains the time stamp is no longer time B. Assume that the time when the time stamp is obtained is time C.

[0114] In view of the above discovery, in this embodiment, the slave sensor can detect the rising edge or falling edge of the first bit signal of the time data. Assume that the slave sensor detects the rising edge or falling edge of the first bit signal of the detection time data at time B, then the slave sensor records time B as the reception time of the trigger signal. Further, the slave sensor can update the local time of the slave sensor according to the reception time of the trigger signal (that is, time B), the current time of the slave sensor (that is, time C, the slave sensor obtains the time stamp in the time data at time C and performs time synchronization at time C), and the time stamp (that is, time A). The specific update method can refer to the above embodiment and will not be elaborated here.

[0115] In an example, as shown in Figure 6 After the master sensor is powered on, it can periodically send data packets carrying time stamps (this data packet is called time data in this article) to the slave sensor through the RS485 bus (that is, a single-channel serial bus). In Figure 6 TS represents the data packet carrying the time stamp.

[0116] The slave sensor can capture the first falling edge of the time data using the EXTI (External interrupt / event controller) GPIO (General Purpose Input / Output). When the first falling edge of the time data is captured, the slave sensor records the current time as the reception time of the trigger signal. After completely receiving all the content of the time data, the timestamp of the master sensor is obtained from the time data. Further, the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the timestamp.

[0117] Exemplarily, when implementing time synchronization using a single-channel serial bus, the slave sensor defaults to turning off the EXTI GPIO interrupt, turns on the EXTI GPIO interrupt after receiving the first complete time data, waits for the arrival of the next trigger signal, and loops in this way. The slave sensor performs time synchronization through the timestamp of 1PPS, triggers the data acquisition of the sensor by the internal timer of the slave sensor, and attaches the correct timestamp to the data.

[0118] Embodiment 4:

[0119] In an embodiment of the present invention, a time synchronization method is proposed, which can be applied to an unmanned aerial vehicle. The unmanned aerial vehicle may include a master sensor and a slave sensor. The master sensor is connected to the slave sensor through a serial bus, and the master sensor is also connected to the slave sensor through an Ethernet cable (i.e., an Ethernet interface).

[0120] See Figure 7 As shown, the master sensor can be connected to the slave sensor through a serial bus (such as an RS485 bus). Among them, the serial bus can be the dual-channel serial bus in the above embodiment (i.e., the serial bus composed of the first serial sub-bus and the second serial sub-bus), and the serial bus can also be the single-channel serial bus in the above embodiment (i.e., the serial bus composed of one RS485 bus).

[0121] See Figure 7 As shown, the master sensor is also connected to the slave sensor through an Ethernet cable, and the slave sensor can interact with the master sensor through the Ethernet cable to achieve time synchronization.

[0122] In this embodiment, the master sensor can obtain the current time data of the master sensor. The time data includes a timestamp, and the timestamp can represent the current time value of the master sensor, and sends the time data to the slave sensor through the serial bus. For the specific sending method, refer to Embodiment 2 and Embodiment 3.

[0123] In this embodiment, the master sensor can send time data to the slave sensors through an Ethernet cable to achieve time data synchronization. For example, taking IEEE1588 as an example, the master sensor can obtain time data in the IEEE1588 manner and send the time data to the slave sensors.

[0124] Optionally, in an example, if the slave sensor receives the time data sent by the master sensor through the serial bus and the time data sent by the master sensor through the Ethernet cable at the same time, and the priority of the serial bus is higher than that of the Ethernet cable, the slave sensor can update the local time based on the time data sent by the master sensor through the serial bus. For the specific update method, refer to Embodiment 2 and Embodiment 3. If the priority of the serial bus is lower than that of the Ethernet cable, the slave sensor can update the local time based on the time data sent by the master sensor through the Ethernet cable. For the specific update method, refer to IEEE1588. The time synchronization method of IEEE1588 is described in the subsequent embodiments.

[0125] Optionally, in another example, if the slave sensor only receives the time data sent by the master sensor through the serial bus and does not receive the time data sent by the master sensor through the Ethernet cable, the slave sensor can update the local time based on the time data sent by the master sensor through the serial bus.

[0126] Optionally, in another example, if the slave sensor only receives the time data sent by the master sensor through the Ethernet cable and does not receive the time data sent by the master sensor through the serial bus, the slave sensor can update the local time based on the time data sent by the master sensor through the Ethernet cable. For the specific update method, refer to the IEEE1588 time synchronization method in the subsequent embodiments.

[0127] Embodiment 5:

[0128] A time synchronization method is proposed in an embodiment of the present invention, which can be applied to an unmanned aerial vehicle. The unmanned aerial vehicle may include a master sensor and multiple slave sensors. The multiple slave sensors may include a first slave sensor and at least one second slave sensor (hereinafter, one second slave sensor is taken as an example). The master sensor is connected to the first slave sensor through a serial bus, the master sensor is connected to the second slave sensor through a serial bus, and the first slave sensor is connected to the second slave sensor through an Ethernet cable.

[0129] See Figure 8As shown, the master sensor can be connected to the first slave sensor via a serial bus (such as an RS485 bus), and the master sensor can be connected to the second slave sensor via a serial bus (such as an RS485 bus). Among them, the serial bus can be the dual-channel serial bus in the above embodiment (i.e., the serial bus composed of the first serial sub-bus and the second serial sub-bus), and the serial bus can also be the single-channel serial bus in the above embodiment (i.e., the serial bus composed of one RS485 bus).

[0130] The first slave sensor is connected to the second slave sensor via an Ethernet cable, and the second slave sensor exchanges information with the first slave sensor via the Ethernet cable to achieve time synchronization.

[0131] In this embodiment, the master sensor can obtain the current time data of the master sensor. The time data includes a timestamp, which can represent the current time value of the master sensor, and send the time data to the first slave sensor via the serial bus and send the time data to the second slave sensor via the serial bus. For the specific sending method, refer to Embodiment 2 and Embodiment 3, which will not be elaborated here.

[0132] In this embodiment, if the first slave sensor receives the time data sent by the master sensor via the serial bus within the preset time, it can update the local time based on the time data sent by the master sensor via the serial bus. For the specific update method, refer to Embodiment 2 and Embodiment 3. If the first slave sensor does not receive the time data sent by the master sensor via the serial bus within the preset time, it can send the time data of the first slave sensor to the second slave sensor via the Ethernet cable between the first slave sensor and the second slave sensor, so that the second slave sensor synchronizes the time according to the time data of the first slave sensor. For example, taking IEEE1588 as an example, the first slave sensor can obtain the time data in the IEEE1588 manner and send the time data to the second slave sensor to achieve the synchronization of the time data.

[0133] In an example, the master sensor and the first slave sensor respectively correspond to preset priorities. If the second slave sensor receives the time data of the master sensor (the time data sent by the master sensor via the serial bus) and the time data of the first slave sensor (the time data sent by the first slave sensor via the Ethernet cable) at the same time, and the priority of the master sensor is greater than the priority of the first slave sensor, then the second slave sensor updates the local time based on the time data of the master sensor, that is, updates the local time according to the time data sent by the master sensor via the serial bus. For the update method, refer to Embodiment 2 and Embodiment 3.

[0134] If the second slave sensor simultaneously receives the time data of the master sensor (such as the time data sent by the master sensor through the serial bus) and the time data of the first slave sensor (such as the time data sent by the first slave sensor through the Ethernet cable), and the priority of the master sensor is lower than that of the first slave sensor, then the second slave sensor updates its local time based on the time data of the first slave sensor, that is, updates its local time according to the time data sent by the first slave sensor through the Ethernet cable. For the specific update method, refer to IEEE1588. The time synchronization method of IEEE1588 is described in the subsequent embodiments.

[0135] In another example, the serial bus and the Ethernet cable are respectively corresponding to preset priorities. If the second slave sensor simultaneously receives the time data sent through the serial bus (the time data sent by the master sensor through the serial bus) and the time data sent through the Ethernet cable (the time data sent by the first slave sensor through the Ethernet cable), and the priority of the serial bus is higher than that of the Ethernet cable, then the second slave sensor updates its local time based on the time data sent by the serial bus. That is to say, the second slave sensor updates its local time based on the time data sent by the master sensor through the serial bus. For the update method, refer to Embodiment 2 and Embodiment 3.

[0136] If the second slave sensor simultaneously receives the time data sent through the serial bus (the time data sent by the master sensor through the serial bus) and the time data sent through the Ethernet cable (the time data sent by the first slave sensor through the Ethernet cable), and the priority of the serial bus is lower than that of the Ethernet cable, then the second slave sensor updates its local time based on the time data sent by the Ethernet cable, that is, updates its local time based on the time data sent by the first slave sensor through the Ethernet cable. For the specific update method, refer to IEEE1588 in the subsequent embodiments.

[0137] Optionally, if the second slave sensor only receives the time data sent by the master sensor through the serial bus and does not receive the time data sent by the first slave sensor through the Ethernet cable, then the second slave sensor can update its local time based on the time data sent by the master sensor through the serial bus. If the second slave sensor only receives the time data sent by the first slave sensor through the Ethernet cable and does not receive the time data sent by the master sensor through the serial bus, then the second slave sensor can update its local time based on the time data sent by the first slave sensor through the Ethernet cable.

[0138] Embodiment 6:

[0139] In an embodiment of the present invention, a time synchronization method is proposed, which can be applied to an unmanned aerial vehicle. The unmanned aerial vehicle may include a main sensor and multiple slave sensors. The multiple slave sensors may include a first slave sensor and at least one second slave sensor. The main sensor is connected to the first slave sensor through a serial port bus, the main sensor is connected to the second slave sensor through a serial port bus, the main sensor is connected to the first slave sensor through an Ethernet cable, the main sensor is connected to the second slave sensor through an Ethernet cable, and the first slave sensor is connected to the second slave sensor through an Ethernet cable.

[0140] See Figure 9 As shown, the main sensor can be connected to the first slave sensor through a serial port bus (such as an RS485 bus), and the main sensor can be connected to the second slave sensor through a serial port bus (such as an RS485 bus). Among them, the serial port bus can be the dual-channel serial port bus (i.e., the serial port bus composed of a first serial port sub-bus and a second serial port sub-bus) in the above embodiment, or the single-channel serial port bus (i.e., the serial port bus composed of a single RS485 bus) in the above embodiment.

[0141] The main sensor can be connected to the first slave sensor through an Ethernet cable, and the main sensor can be connected to the second slave sensor through an Ethernet cable. The first slave sensor exchanges information with the main sensor through the Ethernet cable to achieve time synchronization. The second slave sensor exchanges information with the main sensor through the Ethernet cable to achieve time synchronization.

[0142] The first slave sensor is connected to the second slave sensor through an Ethernet cable, and the second slave sensor exchanges information with the first slave sensor through the Ethernet cable to achieve time synchronization.

[0143] In this embodiment, the main sensor can obtain the current time data of the main sensor. The time data includes a timestamp, which can represent the current time value of the main sensor, and send the time data to the first slave sensor through the serial port bus and send the time data to the second slave sensor through the serial port bus. For the specific sending method, see Embodiment 2 and Embodiment 3, which will not be elaborated here.

[0144] In this embodiment, the main sensor can send the time data to the first slave sensor through the Ethernet cable and send the time data to the second slave sensor through the Ethernet cable to achieve the synchronization of the time data. For example, taking IEEE1588 as an example, the main sensor can obtain the time data in the IEEE1588 manner and send the time data to the first slave sensor and the second slave sensor.

[0145] In this embodiment, if the first slave sensor receives both the time data sent by the master sensor via the serial bus and the time data sent by the master sensor via the Ethernet cable, and the priority of the serial bus is higher than that of the Ethernet cable, the first slave sensor can update its local time based on the time data sent by the master sensor via the serial bus. For the specific update method, refer to Embodiment 2 and Embodiment 3. If the priority of the serial bus is lower than that of the Ethernet cable, the first slave sensor can update its local time based on the time data sent by the master sensor via the Ethernet cable. For the specific update method, refer to the IEEE 1588 time synchronization method. Alternatively, if the first slave sensor only receives the time data sent by the master sensor via the serial bus and does not receive the time data sent by the master sensor via the Ethernet cable, the first slave sensor can update its local time based on the time data sent by the master sensor via the serial bus. Or, if the first slave sensor only receives the time data sent by the master sensor via the Ethernet cable and does not receive the time data sent by the master sensor via the serial bus, the first slave sensor can update its local time based on the time data sent by the master sensor via the Ethernet cable. For the specific update method, refer to the IEEE 1588 time synchronization method.

[0146] In this embodiment, if the first slave sensor does not receive the time data sent by the master sensor via the serial bus and does not receive the time data sent by the master sensor via the Ethernet cable within the preset time, the time data of the first slave sensor is sent to the second slave sensor via the Ethernet cable between the first slave sensor and the second slave sensor, so that the second slave sensor can perform time synchronization according to the time data of the first slave sensor. For example, taking IEEE 1588 as an example, the first slave sensor can obtain the time data in the IEEE 1588 manner and send the time data to the second slave sensor.

[0147] In one example, for the second slave sensor, the master sensor and the first slave sensor respectively correspond to preset priorities. If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is greater than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the master sensor; if the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is less than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the first slave sensor. Also, the serial bus and the Ethernet cable respectively correspond to preset priorities. If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is greater than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the serial bus; if the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is less than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the Ethernet cable.

[0148] Based on the above strategy, the process of the second slave sensor updating its local time includes the following situations:

[0149] Situation 1: If the second slave sensor only receives the time data sent by the master sensor through the serial bus, does not receive the time data sent by the master sensor through the Ethernet cable, and does not receive the time data sent by the first slave sensor through the Ethernet cable, the second slave sensor can update its local time based on the time data sent by the master sensor through the serial bus.

[0150] Situation 2: If the second slave sensor only receives the time data sent by the master sensor through the Ethernet cable, does not receive the time data sent by the master sensor through the serial bus, and does not receive the time data sent by the first slave sensor through the Ethernet cable, the second slave sensor can update its local time based on the time data sent by the master sensor through the Ethernet cable.

[0151] Situation 3: If the second slave sensor only receives the time data sent by the first slave sensor through the Ethernet cable, does not receive the time data sent by the master sensor through the serial bus, and does not receive the time data sent by the master sensor through the Ethernet cable, the second slave sensor can update its local time based on the time data sent by the first slave sensor through the Ethernet cable.

[0152] Case 4: If the second slave sensor simultaneously receives the time data sent by the master sensor via the serial bus and the time data sent by the first slave sensor via the Ethernet cable, and does not receive the time data sent by the master sensor via the Ethernet cable. If the priority of the master sensor is higher than that of the first slave sensor, the second slave sensor updates its local time according to the time data sent by the master sensor via the serial bus; if the priority of the master sensor is lower than that of the first slave sensor, the second slave sensor updates its local time according to the time data sent by the first slave sensor via the Ethernet cable. Alternatively, if the priority of the serial bus is higher than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the master sensor via the serial bus; if the priority of the serial bus is lower than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the first slave sensor via the Ethernet cable.

[0153] Case 5: If the second slave sensor simultaneously receives the time data sent by the master sensor via the serial bus and the time data sent by the master sensor via the Ethernet cable, and does not receive the time data sent by the first slave sensor via the Ethernet cable. If the priority of the serial bus is higher than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the master sensor via the serial bus; if the priority of the serial bus is lower than that of the Ethernet cable, it updates its local time according to the time data sent by the master sensor via the Ethernet cable.

[0154] Case 6: If the second slave sensor simultaneously receives the time data sent by the master sensor via the Ethernet cable and the time data sent by the first slave sensor via the Ethernet cable, and does not receive the time data sent by the master sensor via the serial bus. If the priority of the master sensor is higher than that of the first slave sensor, it updates its local time according to the time data sent by the master sensor via the Ethernet cable; if the priority of the master sensor is lower than that of the first slave sensor, it updates its local time according to the time data sent by the first slave sensor via the Ethernet cable.

[0155] Case 7: If the second slave sensor simultaneously receives the time data sent by the master sensor via the serial bus, the time data sent by the first slave sensor via the Ethernet cable, and the time data sent by the master sensor via the Ethernet cable. If the priority of the master sensor is higher than that of the first slave sensor and the priority of the serial bus is higher than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the master sensor via the serial bus; if the priority of the master sensor is higher than that of the first slave sensor and the priority of the serial bus is lower than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the master sensor via the Ethernet cable; if the priority of the master sensor is lower than that of the first slave sensor and the priority of the serial bus is higher than or lower than that of the Ethernet cable, the second slave sensor updates its local time according to the time data sent by the first slave sensor via the Ethernet cable.

[0156] Embodiment 7: In an example, when the slave sensor receives multiple time data, it can also determine the sending methods corresponding to the multiple time data and determine the priorities corresponding to the multiple time data according to the sending methods; wherein, the sending methods include the serial bus sending method and other sending methods other than the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to other sending methods other than the serial bus. Further, the sensor updates the local time of the slave sensor with the time data having the highest priority according to the priorities corresponding to the multiple time data.

[0157] Obviously, due to the existence of the serial bus sending method and other sending methods other than the serial bus, when there is a problem with the time data of the serial bus sending method (such as not receiving the time data of the serial bus sending method), as a redundant method, the time data of other sending methods can also be used to update the local time of the slave sensor, that is, there is an alternative synchronization scheme to ensure that time synchronization can be achieved and the reliability of the slave sensor is improved. When the time data of the serial bus sending method is normal, the time data of the serial bus sending method can be used to update the local time of the slave sensor to ensure accurate time.

[0158] For example, referring to the above embodiment, when the slave sensor receives the time data sent by the master sensor via the serial bus and the time data sent by the master sensor via the Ethernet cable (i.e., other sending methods other than the serial bus), since the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to other sending methods, the slave sensor can update its local time according to the time data sent by the master sensor via the serial bus.

[0159] For another example, referring to the above embodiments, when the first slave sensor receives the time data sent by the master sensor through the serial bus and the time data sent by the master sensor through the Ethernet cable (i.e., other sending methods except the serial bus), since the priority of the time data corresponding to the serial bus sending method is higher than that of the time data corresponding to other sending methods, the first slave sensor updates the local time of the first slave sensor according to the time data sent by the master sensor through the serial bus.

[0160] For another example, referring to the above embodiments, when the second slave sensor receives the time data sent by the master sensor through the serial bus, the time data sent by the master sensor through the Ethernet cable (i.e., other sending methods except the serial bus), and the time data sent by the first slave sensor through the Ethernet cable, since the priority of the time data corresponding to the serial bus sending method is higher than that of the time data corresponding to other sending methods, the second slave sensor can update the local time of the second slave sensor according to the time data sent by the master sensor through the serial bus.

[0161] Embodiment 8: When the slave sensor updates the local time of the slave sensor according to the time data, the slave sensor can update the local system time (i.e., the time maintained by the processor) of the slave sensor according to the time data; and / or, the slave sensor can update the local hardware time of the slave sensor according to the time data.

[0162] Specifically, the slave sensor can update the local system time of the slave sensor according to the time data. Based on the local system time of the slave sensor, the slave sensor can update the local hardware time of the slave sensor according to the local system time. Or, the slave sensor can update the local hardware time of the slave sensor according to the time data. Based on the local hardware time of the slave sensor, the slave sensor can update the local system time of the slave sensor according to the local hardware time. Or, the slave sensor can update the local system time of the slave sensor according to the time data and update the local hardware time of the slave sensor according to the time data. Or, the slave sensor can only update the local system time of the slave sensor according to the time data. Or, the slave sensor can only update the local hardware time of the slave sensor according to the time data. Of course, the above are only several examples of updating the local time, and there is no limitation thereto, as long as the local time is updated according to the time data.

[0163] Embodiment 9: When the slave sensor updates the local time of the slave sensor according to the time data, the slave sensor can first update the virtual clock of the slave sensor according to the time data and update the local time of the slave sensor according to the virtual clock. For example, the time data includes a time stamp, and the starting virtual time of the virtual clock is the time stamp. After a preset duration, the target virtual time of the virtual clock is updated to the sum of the time stamp and the preset duration, and the local time of the slave sensor is updated to the target virtual time.

[0164] For example, assume that the timestamp in the time data is time A (e.g., 2019.6.18 - 18:00:00), and the local time of the slave sensor is time B (e.g., 2019.6.18 - 18:00:05). In one example, the slave sensor can directly update the local time of the slave sensor to time A (i.e., change from time B to time A). However, in the above implementation, a time rollback phenomenon occurs in the local time of the slave sensor.

[0165] To prevent transient changes in the local time of the slave sensor, which may lead to time rollback and time advance phenomena, in this embodiment, the slave sensor can maintain a virtual clock. This virtual clock has nothing to do with the operations of the slave sensor and is only used to update the local time of the slave sensor. After the slave sensor parses time A from the time data, it updates time A to the starting virtual time of the virtual clock, that is, the starting virtual time is time A. When the slave sensor updates time A to the starting virtual time, the current local time of the slave sensor is time B.

[0166] After a preset duration, the target virtual time of the virtual clock is updated to the sum of time A and the preset duration. The value of the preset duration can be greater than the difference between time B and time A. For example, if the preset duration is 6 seconds (both time A and time B are moments accurate to milliseconds, and the preset duration is a value in milliseconds, this is just for convenience of example), then the target virtual time of the virtual clock is time C (e.g., 2019.6.18 - 18:00:06).

[0167] After the preset duration, the slave sensor can also update the local time of the slave sensor to time C (e.g., 2019.6.18 - 18:00:06). That is to say, the local time of the slave sensor at the starting virtual time is time B (e.g., 2019.6.18 - 18:00:05). After 6 seconds of the preset duration, the local time of the slave sensor is updated to time C (e.g., 2019.6.18 - 18:00:06), that is, the local time only increases by 1 second instead of 6 seconds. Through the above method, the local time of the slave sensor is synchronized to the time of the master sensor.

[0168] Since the local time of the slave sensor only increases by 1 second after a preset duration of 6 seconds, the local time can be changed slowly. For example, at the start of the preset duration, the local time of the slave sensor is time B (such as 2019.6.18 - 18:00:05). At the 1st second of the preset duration, increase the local time of the slave sensor by 0.2 seconds; at the 2nd second of the preset duration, increase the local time of the slave sensor by 0.2 seconds; at the 3rd second of the preset duration, increase the local time of the slave sensor by 0.2 seconds; at the 4th second of the preset duration, increase the local time of the slave sensor by 0.2 seconds; at the 5th second of the preset duration, increase the local time of the slave sensor by 0.1 seconds; at the 6th second of the preset duration, increase the local time of the slave sensor by 0.1 seconds; thus, after 6 seconds of the preset duration, the local time increases by 1 second, that is, after 6 seconds of the preset duration, the local time of the slave sensor is time C (such as 2019.6.18 - 18:00:06).

[0169] For another example, assume that the timestamp in the time data is time B (such as 2019.6.18 - 18:00:05), the local time of the slave sensor is time A (such as 2019.6.18 - 18:00:00). After the slave sensor parses time B from the time data, it can update time B to the starting virtual time of the virtual clock, that is, the starting virtual time is time B, and the current local time of the slave sensor is time A. After the preset duration, update the target virtual time of the virtual clock to the sum of time B and the preset duration. The value of the preset duration is configured according to experience, such as 1 second, and the target virtual time of the virtual clock is time C (such as 2019.6.18 - 18:00:06).

[0170] After the preset duration, the slave sensor can also update the local time of the slave sensor to time C (such as 2019.6.18 - 18:00:06), that is to say, the local time of the slave sensor at the starting virtual time is time A (such as 2019.6.18 - 18:00:00), and after 1 second of the preset duration, update the local time of the slave sensor to time C (such as 2019.6.18 - 18:00:06), that is, the local time increases by 6 seconds instead of 1 second. Through the above method, synchronize the local time of the slave sensor to the time of the master sensor.

[0171] Since the local time of the slave sensor has increased by 6 seconds after a preset duration of 1 second, the local time can be changed slowly. For example, at the start of the preset duration, the local time of the slave sensor is time A. At the 0.2 - second mark of the preset duration, the local time of the slave sensor is increased by 2 seconds; at the 0.4 - second mark of the preset duration, the local time of the slave sensor is increased by 3 seconds; at the 0.6 - second mark of the preset duration, the local time of the slave sensor is increased by 4 seconds; at the 0.8 - second mark of the preset duration, the local time of the slave sensor is increased by 5 seconds; at the 1 - second mark of the preset duration, the local time of the slave sensor is increased by 6 seconds. Thus, after a preset duration of 1 second, the local time has increased by 6 seconds, that is, after a preset duration of 1 second, the local time of the slave sensor is time C (such as 2019.6.18 - 18:00:06).

[0172] Exemplarily, when the slave sensor receives multiple time data (for example, time data sent by the master sensor through the serial bus, time data sent by the master sensor through the Ethernet cable, etc.), independent virtual clocks can be maintained for each time data without considering the differences between multiple virtual clocks. When updating the local time of the slave sensor with a certain time data, the slave sensor can update its local time according to the virtual clock corresponding to that time data.

[0173] Embodiment 10: When the slave sensor updates its local time according to time data, it can also determine whether the time data is valid time data; if it is, the local time of the slave sensor is updated according to the time data, and if not, the slave sensor is prohibited from updating its local time according to the time data.

[0174] For example, when the master sensor sends time data, it can also calculate the first checksum of the time data according to a checksum algorithm, and the time data includes this first checksum. There is no limit to this checksum algorithm, such as checksum algorithms like code distance, parity check, Hamming check, cyclic redundancy check, etc. When the slave sensor receives the time data, it can also calculate the second checksum of the time data according to the checksum algorithm (the checksum algorithm used by the slave sensor needs to be the same as that used by the master sensor). If the second checksum is the same as the first checksum, the time data is valid time data, and the slave sensor updates its local time according to the time data; if the second checksum is different from the first checksum, the time data is not valid time data, and the slave sensor is prohibited from updating its local time according to the time data.

[0175] Of course, the above method is only an example of determining whether it is valid time data, and there is no limit to this.

[0176] Example 11: When the slave sensor updates the local time of the slave sensor according to the time data from the sensor, it can also determine whether there is a start marker in the time data; if so, update the local time of the slave sensor according to the time data; if not, prohibit updating the local time of the slave sensor according to the time data.

[0177] For example, when the master sensor sends the time data, the time data can also include a start marker. When the slave sensor receives the time data, it can also determine whether there is a start marker in the time data; if so, the slave sensor can update the local time of the slave sensor according to the time data; if not, the slave sensor can prohibit updating the local time of the slave sensor according to the time data.

[0178] Example 12: The slave sensor can also determine time drift information based on multiple time data and perform time compensation on the crystal oscillator according to the time drift information. For example, due to fluctuations in the synchronization signal, the slave sensor can also perform processes such as filtering and control. For example, assuming that the clock drift is a typical value of 50 ppm (100 / 10^6 s), then the drift is 0.01 millisecond per second, that is, 3 milliseconds in 60 seconds. Therefore, the slave sensor can determine the time drift information (such as 3 milliseconds) based on multiple time data (i.e., the time data sent by the master sensor within 60 seconds) and perform time compensation on the crystal oscillator according to the time drift information. There is no limitation on this compensation method, and traditional compensation methods can be referred to.

[0179] Example 13: The time synchronization method of IEEE 1588. The IEEE 1588 protocol is also known as PTP (Precise Time Protocol), and can achieve a time synchronization accuracy at the sub-microsecond level, including:

[0180] The master clock (such as the master sensor / first slave sensor) periodically sends sync (synchronization message) messages and records the exact transmission time t1 when the sync message leaves the master clock. The master clock encapsulates the exact transmission time t1 into the Follow_up (following message) message and sends it to the slave clock (such as the first slave sensor / second slave sensor). The slave clock records the exact arrival time t2 when the sync message arrives at the slave clock. The slave clock sends a delay_req (delay request message) message and records the exact transmission time t3. The master clock records the exact arrival time t4 when the delay_req message arrives at the master clock. The master clock sends a delay_resp (delay request response message) message carrying the exact timestamp information t4 to the slave clock. In summary, the slave clock can obtain four times, namely t1, t2, t3, and t4, and obtain the master-slave clock deviation and transmission delay based on t1, t2, t3, and t4, and update the local time according to the master-slave clock deviation and transmission delay to perform time synchronization.

[0181] Exemplarily, in the above embodiments, the IEEE 1588 time synchronization method is taken as an example of the redundancy method. In practical applications, other time synchronization methods can also be used as the redundancy method. For example, the NTP time synchronization method can be used as the redundancy method, that is, the NTP time synchronization method is used to replace the IEEE 1588 time synchronization method. The specific time synchronization process will not be elaborated here; or, the GPS time synchronization method can be used as the redundancy method, that is, the GPS time synchronization method is used to replace the IEEE 1588 time synchronization method. The specific time synchronization process will not be elaborated here; or, the ROS time synchronization method can be used as the redundancy method, etc., that is, the ROS time synchronization method is used to replace the IEEE 1588 time synchronization method. The specific time synchronization process will not be elaborated here. Of course, the above are just a few examples and are not limited thereto.

[0182] Embodiment 14:

[0183] Based on the same concept as the above method, refer to Figure 10 As shown, in an embodiment of the present invention, a multi-sensor system is further provided. The multi-sensor system includes a plurality of sensors; one of the sensors is a main sensor, hereinafter referred to as main sensor 1001, and the other sensors are slave sensors, hereinafter referred to as slave sensors 1002. The main sensor 1001 is connected to the slave sensors 1002 through a serial bus;

[0184] The main sensor 1001 is configured to obtain the current time data of the main sensor 1001 and send the time data to the slave sensors 1002 through the serial bus;

[0185] The slave sensors 1002 are configured to update the local time of the slave sensors 1002 according to the time data after receiving the time data through the serial bus.

[0186] When the slave sensors 1002 update the local time of the slave sensors 1002 according to the time data, it is specifically configured to: when receiving the trigger signal of the main sensor 1001, record the reception time of the trigger signal, and update the local time of the slave sensors 1002 according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

[0187] If the trigger signal is a synchronization signal independent of the time data, and the serial bus includes a first serial sub-bus and a second serial sub-bus, when the master sensor 1001 sends the time data to the slave sensor 1002 through the serial bus, it is specifically used for: sending the trigger signal to the slave sensor 1002 through the first serial sub-bus, and simultaneously sending the time data to the slave sensor 1002 through the second serial sub-bus.

[0188] When the slave sensor 1002 receives the trigger signal from the master sensor 1001, when recording the reception time of the trigger signal, it is specifically used for: when receiving the trigger signal sent by the master sensor 1001 through the first serial sub-bus, recording the reception time of the trigger signal.

[0189] If the trigger signal is the first N bit signals of the time data, and the serial bus is a single-channel serial bus, when the master sensor 1001 sends the time data to the slave sensor 1002 through the serial bus, it is specifically used for: sending the time data to the slave sensor 1002 through the single-channel serial bus.

[0190] When the slave sensor 1002 receives the trigger signal from the master sensor 1001, when recording the reception time of the trigger signal, it is specifically used for: when detecting the rising edge or falling edge of the first bit signal of the time data, recording the current time as the reception time of the trigger signal.

[0191] When the slave sensor 1002 updates the local time of the slave sensor 1002 according to the time data, it is specifically used for: updating the local time of the slave sensor 1002 according to the reception time of the trigger signal, the current time of the slave sensor 1002, and the time data.

[0192] The time data includes a time stamp; when the slave sensor 1002 updates the local time of the slave sensor 1002 according to the reception time of the trigger signal, the current time of the slave sensor 1002, and the time data, it is specifically used for: determining the difference between the current time of the slave sensor 1002 and the reception time of the trigger signal, and updating the local time of the slave sensor 1002 according to the time stamp and the difference; or, determining the difference between the time stamp and the reception time of the trigger signal, and updating the local time of the slave sensor 1002 according to the current time of the slave sensor 1002 and the difference.

[0193] When the slave sensor 1002 updates the local time of the slave sensor 1002 according to the time data, it is specifically used for: updating the local system time of the slave sensor 1002 according to the time data; and / or updating the local hardware time of the slave sensor 1002 according to the time data.

[0194] When the slave sensor 1002 updates the local time of the slave sensor 1002 according to the time data, it is specifically used for: updating the virtual clock of the slave sensor 1002 according to the time data; and updating the local time of the slave sensor 1002 according to the virtual clock.

[0195] The time data includes a time stamp, and the starting virtual time of the virtual clock is the time stamp; when the slave sensor 1002 updates the local time of the slave sensor 1002 according to the virtual clock, it is specifically used for: after a preset time period, updating the target virtual time of the virtual clock to the sum of the time stamp and the preset time period, and updating the local time of the slave sensor 1002 to the target virtual time.

[0196] When the slave sensor 1002 updates the local time of the slave sensor 1002 according to the time data, it is specifically used for: determining whether the time data is valid time data; if so, updating the local time of the slave sensor 1002 according to the time data.

[0197] The slave sensor 1002 is further used for: determining time drift information according to multiple time data; and performing time compensation on the crystal oscillator according to the time drift information.

[0198] When the slave sensor 1002 updates the local time of the slave sensor 1002 according to the time data, it is specifically used for: determining whether there is a start marker in the time data; if so, updating the local time of the slave sensor 1002 according to the time data.

[0199] The slave sensor 1002 is further used for: when receiving multiple time data, determining the sending methods corresponding to the multiple time data, and determining the priorities corresponding to the multiple time data according to the sending methods; the sending methods include a serial bus sending method and other sending methods other than the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to the other sending methods; updating the local time of the slave sensor 1002 with the time data having the highest priority according to the priorities corresponding to the multiple time data.

[0200] The main sensor 1001 and the slave sensor 1002 are connected by an Ethernet cable; the slave sensor 1002 is further configured to: perform information interaction with the main sensor 1001 through the Ethernet cable to achieve time synchronization.

[0201] The slave sensor 1002 is further configured to: when receiving both the time data sent by the main sensor 1001 through the serial bus and the time data sent by the main sensor 1001 through the Ethernet cable, and the priority of the serial bus is higher than that of the Ethernet cable, update the local time based on the time data sent by the main sensor 1001 through the serial bus.

[0202] The slave sensor 1002 includes a first slave sensor and at least one second slave sensor, and the first slave sensor and the second slave sensor are connected by an Ethernet cable; the second slave sensor is further configured to: perform information interaction with the first slave sensor through the Ethernet cable to achieve time synchronization.

[0203] The first slave sensor is further configured to: if the time data sent by the main sensor through the serial bus is not received within a preset time, send the time data of the first slave sensor to the second slave sensor through the Ethernet cable between the first slave sensor and the second slave sensor, so that the second slave sensor performs time synchronization according to the time data of the first slave sensor.

[0204] The main sensor 1001 and the first slave sensor respectively correspond to preset priorities, and the second slave sensor is further configured to: if receiving both the time data of the main sensor 1001 and the time data of the first slave sensor, and the priority of the main sensor 1001 is higher than that of the first slave sensor, update the local time based on the time data of the main sensor 1001;

[0205] if receiving both the time data of the main sensor 1001 and the time data of the first slave sensor, and the priority of the main sensor 1001 is lower than that of the first slave sensor, update the local time based on the time data of the first slave sensor.

[0206] The serial bus and the Ethernet cable are respectively corresponding to preset priorities. The second slave sensor is further configured to: if receiving the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is greater than that of the Ethernet cable, update the local time based on the time data sent through the serial bus; if receiving the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is less than that of the Ethernet cable, update the local time based on the time data sent through the Ethernet cable.

[0207] The serial bus includes an RS485 bus. The master sensor 1001 includes an IMU sensor. The slave sensor 1002 includes at least one of the following: an IMU sensor, an image sensor, a lidar sensor, and an electronic control unit. The first slave sensor includes an IMU sensor. Wherein, the IMU sensor is configured to measure the three-axis attitude angle and acceleration of the movable platform; the image sensor is configured to acquire the image information around the movable platform; the lidar sensor is configured to acquire the point cloud information of the movable platform; the electronic control unit is configured to generate a control signal to control the flight parameters of the movable platform.

[0208] Embodiment 15:

[0209] Based on the same concept as the above method, an embodiment of the present invention further provides a multi-sensor system, which includes a plurality of sensors; one of the sensors is a master sensor, and the other sensors are slave sensors. The master sensor is connected to the slave sensors through a serial bus; the master sensor includes a first processor and a first memory; the first memory is configured to store first computer instructions executable by the first processor; the slave sensor includes a second processor and a second memory; the second memory is configured to store second computer instructions executable by the second processor; the first processor is configured to read the first computer instructions from the first memory to implement: obtaining the current time data of the master sensor, and sending the time data to the slave sensors through the serial bus; the second processor is configured to read the second computer instructions from the second memory to implement: after receiving the time data through the serial bus, updating the local time of the slave sensor according to the time data.

[0210] Embodiment 16:

[0211] Based on the same concept as the above method, an embodiment of the present invention further provides a movable platform, including:

[0212] A fuselage;

[0213] A power system, provided on the body, for providing power to the movable platform; and the multi-sensor system described above.

[0214] Embodiment 17:

[0215] Based on the same concept as the above method, an embodiment of the present invention further provides a sensor, the sensor including a processor;

[0216] The processor is configured to receive time data sent through a serial bus;

[0217] Update the local time of the sensor according to the time data.

[0218] Embodiment 18:

[0219] An embodiment of the present invention further provides a machine-readable storage medium, on which computer instructions are stored, and when the computer instructions are executed, the above time synchronization method is implemented.

[0220] The systems, devices, modules or units illustrated in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, and the specific form of the computer can be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver device, a game console, a tablet computer, a wearable device, or a combination of any several of these devices.

[0221] For convenience of description, the above devices are described by dividing them into various units according to functions. Of course, when implementing the present invention, the functions of each unit can be implemented in one or more software and / or hardware.

[0222] Those skilled in the art should understand that the embodiments of the present invention can be provided as a method, a system, or a computer program product. Therefore, the present invention can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the embodiments of the present invention can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0223] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present invention. It should be understood that each flow and / or block in the flowchart and / or block diagram, and combinations of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, such that the instructions executed by the processor of the computer or other programmable data processing device generate means for implementing the functions specified in one or more flows and / or blocks Figure 1 one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0224] Furthermore, these computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, such that the instructions stored in the computer-readable memory produce a manufactured article including instruction means that implement the functions specified in one or more flows Figure 1 or one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0225] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operational steps are performed on the computer or other programmable device to produce a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in one or more flows Figure 1 or one or more flows and / or blocks Figure 1 or means for implementing the functions specified in one or more blocks

[0226] The above are only embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, various modifications and changes can be made to the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall be included within the scope of the claims of the present invention

Claims

1. A time synchronization method, characterized in that, it is applied to a hardware device, the hardware device includes multiple sensors, the hardware device includes an unmanned aerial vehicle and / or a vehicle; one of the sensors is the main sensor, and the other sensors are slave sensors, the main sensor and the slave sensors are connected by a serial bus and the serial bus transmits data in a unidirectional protocol manner, and the method includes: The main sensor obtains the current time data of the main sensor; The main sensor sends the time data to the slave sensors through the serial bus; wherein, the serial bus is used to connect the main sensor and the slave sensors; After receiving the time data through the serial bus, the slave sensors update the local time of the slave sensors according to the time data; Wherein, the slave sensors update the local time of the slave sensors according to the time data, including: when the slave sensors receive the trigger signal from the main sensor, record the reception time of the trigger signal, and update the local time of the slave sensors according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

2. The method according to claim 1, characterized in that, the method further includes: Obtain one of the multiple sensors as the main sensor, and use the other sensors except the main sensor as slave sensors.

3. The method according to claim 2, characterized in that, the method further includes: If the current main sensor fails, obtain another one of the multiple sensors as the new main sensor, and use the other sensors except the new main sensor as slave sensors.

4. The method according to claim 1, characterized in that, If the trigger signal is a synchronization signal independent of the time data, and the serial bus includes a first serial sub-bus and a second serial sub-bus, the main sensor sends the time data to the slave sensors through the serial bus, including: the main sensor sends the trigger signal to the slave sensors through the first serial sub-bus, and simultaneously sends the time data to the slave sensors through the second serial sub-bus.

5. The method according to claim 4, characterized in that, When the slave sensors receive the trigger signal from the main sensor, record the reception time of the trigger signal, including: When the slave sensors receive the trigger signal sent by the main sensor through the first serial sub-bus, record the reception time of the trigger signal.

6. The method according to claim 1, characterized in that, If the trigger signal is the first N bit signals of the time data, and the serial bus is a single-channel serial bus, the main sensor sends the time data to the slave sensors through the serial bus, including: The main sensor sends the time data to the slave sensors through the single-channel serial bus.

7. The method according to claim 6, wherein, when receiving the trigger signal of the master sensor from the sensor, recording the reception time of the trigger signal includes: when the slave sensor detects the rising edge or falling edge of the first bit signal of the time data, recording the current time as the reception time of the trigger signal.

8. The method according to claim 1, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, it further includes: the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data.

9. The method according to claim 8, wherein, the time data includes a time stamp; when the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data, it includes: the slave sensor determines the difference between the current time of the slave sensor and the reception time of the trigger signal, and updates the local time of the slave sensor according to the time stamp and the difference; or, the slave sensor determines the difference between the time stamp and the reception time of the trigger signal, and updates the local time of the slave sensor according to the current time of the slave sensor and the difference.

10. The method according to claim 1, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, it includes: the slave sensor updates the local system time of the slave sensor according to the time data; and / or, the slave sensor updates the local hardware time of the slave sensor according to the time data.

11. The method according to claim 1, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, it includes: the slave sensor updates the virtual clock of the slave sensor according to the time data; the slave sensor updates the local time of the slave sensor according to the virtual clock.

12. The method according to claim 11, wherein, the time data includes a time stamp, and the starting virtual time of the virtual clock is the time stamp; when the slave sensor updates the local time of the slave sensor according to the virtual clock, it includes: after a preset duration, updating the target virtual time of the virtual clock to the sum of the time stamp and the preset duration, and updating the local time of the slave sensor to the target virtual time.

13. The method according to claim 1, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, it includes: the slave sensor determines whether the time data is valid time data; if so, the slave sensor updates the local time of the slave sensor according to the time data.

14. The method according to claim 1, wherein, the method includes: the slave sensor determines time drift information according to a plurality of time data; The slave sensor performs time compensation on the crystal oscillator according to the time drift information.

15. The method according to claim 1, wherein, the slave sensor updates the local time of the slave sensor according to the time data, including: the slave sensor determines whether there is a start marker in the time data; if so, the slave sensor updates the local time of the slave sensor according to the time data.

16. The method according to claim 1, wherein, when the slave sensor receives a plurality of time data, it determines the sending methods corresponding to the plurality of time data, and determines the priorities corresponding to the plurality of time data according to the sending methods; wherein, the sending methods include a serial bus sending method and other sending methods except the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to the other sending methods; the sensor updates the local time of the slave sensor through the time data with the highest priority according to the priorities corresponding to the plurality of time data.

17. The method according to claim 1, wherein, the master sensor and the slave sensor are connected by an Ethernet cable; wherein, the slave sensor performs information interaction with the master sensor through the Ethernet cable to achieve time synchronization.

18. The method according to claim 17, wherein, the method further includes: when the slave sensor simultaneously receives the time data sent by the master sensor through the serial bus and the time data sent by the master sensor through the Ethernet cable, and the priority of the serial bus is greater than the priority of the Ethernet cable, the slave sensor updates the local time based on the time data sent by the master sensor through the serial bus.

19. The method according to claim 1, wherein, the slave sensor includes a first slave sensor and at least one second slave sensor, and the first slave sensor and the second slave sensor are connected by an Ethernet cable; wherein, the second slave sensor performs information interaction with the first slave sensor through the Ethernet cable to achieve time synchronization.

20. The method according to claim 19, wherein, the method further includes: if the first slave sensor does not receive the time data sent by the master sensor through the serial bus within a preset time, the time data of the first slave sensor is sent to the second slave sensor through the Ethernet cable between the first slave sensor and the second slave sensor, so that the second slave sensor performs time synchronization according to the time data of the first slave sensor.

21. The method according to claim 19, wherein, the master sensor and the first slave sensor respectively correspond to preset priorities, and the method further includes: If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is higher than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the master sensor; If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is lower than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the first slave sensor.

22. The method according to claim 20, wherein, the master sensor and the first slave sensor are respectively corresponding to preset priorities, and the method further includes: If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is higher than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the master sensor; If the second slave sensor receives the time data of the master sensor and the time data of the first slave sensor simultaneously, and the priority of the master sensor is lower than that of the first slave sensor, the second slave sensor updates its local time based on the time data of the first slave sensor.

23. The method according to claim 19, wherein, the serial bus and the Ethernet cable are respectively corresponding to preset priorities, and the method further includes: If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is higher than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the serial bus; If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is lower than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the Ethernet cable.

24. The method according to claim 20, wherein, the serial bus and the Ethernet cable are respectively corresponding to preset priorities, and the method further includes: If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is higher than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the serial bus; If the second slave sensor receives the time data sent through the serial bus and the time data sent through the Ethernet cable simultaneously, and the priority of the serial bus is lower than that of the Ethernet cable, the second slave sensor updates its local time based on the time data sent through the Ethernet cable.

25. The method according to any one of claims 1-24, wherein, the serial bus includes an RS485 bus.

26. The method according to any one of claims 1 - 24, characterized in that, the main sensor includes an IMU sensor.

27. The method according to any one of claims 1 - 24, characterized in that, the slave sensors include at least one of the following: an IMU sensor, an image sensor, a lidar sensor, an electronic control unit.

28. The method according to any one of claims 19 - 24, characterized in that, the first slave sensor includes an IMU sensor.

29. The method according to any one of claims 1 - 24, characterized in that, the hardware device includes a movable platform, and the movable platform includes an unmanned aerial vehicle.

30. A multi - sensor system, characterized in that, the multi - sensor system is for an unmanned aerial vehicle and / or a vehicle, and the multi - sensor system includes a plurality of sensors; one of the sensors is a main sensor, and the other sensors are slave sensors. The main sensor is connected to the slave sensors through a serial port bus, and the serial port bus transmits data in a one - way protocol manner; the main sensor is used to obtain the current time data of the main sensor and send the time data to the slave sensors through the serial port bus; the slave sensors are used to update the local time of the slave sensors according to the time data after receiving the time data through the serial port bus; wherein, when the slave sensors update the local time of the slave sensors according to the time data, it is specifically used for: when receiving a trigger signal from the main sensor, recording the reception time of the trigger signal, and updating the local time of the slave sensors according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

31. The multi - sensor system according to claim 30, characterized in that, if the trigger signal is a synchronization signal independent of the time data, and the serial port bus includes a first serial sub - bus and a second serial sub - bus, when the main sensor sends the time data to the slave sensors through the serial port bus, it is specifically used for: sending the trigger signal to the slave sensors through the first serial sub - bus, and simultaneously sending the time data to the slave sensors through the second serial sub - bus.

32. The multi - sensor system according to claim 31, characterized in that, when the slave sensors receive the trigger signal from the main sensor and record the reception time of the trigger signal, it is specifically used for: when receiving the trigger signal sent by the main sensor through the first serial sub - bus, recording the reception time of the trigger signal.

33. The multi - sensor system according to claim 30, characterized in that, if the trigger signal is the first N bit signals of the time data, and the serial port bus is a single - channel serial port bus, when the main sensor sends the time data to the slave sensors through the serial port bus, it is specifically used for: Send the time data to the slave sensor through the single-channel serial bus.

34. The multi-sensor system according to claim 33, wherein, when the slave sensor receives the trigger signal from the master sensor, the specific operation of recording the reception time of the trigger signal is: when detecting the rising edge or falling edge of the first bit signal of the time data, record the current time as the reception time of the trigger signal.

35. The multi-sensor system according to any one of claims 30-33, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, the specific operation is: update the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data.

36. The multi-sensor system according to claim 35, wherein, the time data includes a time stamp; when the slave sensor updates the local time of the slave sensor according to the reception time of the trigger signal, the current time of the slave sensor, and the time data, the specific operation is: determine the difference between the current time of the slave sensor and the reception time of the trigger signal, and update the local time of the slave sensor according to the time stamp and the difference; or, determine the difference between the time stamp and the reception time of the trigger signal, and update the local time of the slave sensor according to the current time of the slave sensor and the difference.

37. The multi-sensor system according to claim 30, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, the specific operation is: update the local system time of the slave sensor according to the time data; and / or, update the local hardware time of the slave sensor according to the time data.

38. The multi-sensor system according to claim 30, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, the specific operation is: update the virtual clock of the slave sensor according to the time data; update the local time of the slave sensor according to the virtual clock.

39. The multi-sensor system according to claim 38, wherein, the time data includes a time stamp, and the starting virtual time of the virtual clock is the time stamp; when the slave sensor updates the local time of the slave sensor according to the virtual clock, the specific operation is: after a preset duration, update the target virtual time of the virtual clock to the sum of the time stamp and the preset duration, and update the local time of the slave sensor to the target virtual time.

40. The multi-sensor system according to claim 30, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, the specific operation is: determine whether the time data is valid time data; if so, update the local time of the slave sensor according to the time data.

41. The multi-sensor system according to claim 30, wherein, the slave sensor is further configured to: determine time drift information according to multiple time data; Perform time compensation on the crystal oscillator according to the time drift information.

42. The multi-sensor system according to claim 30, wherein, when the slave sensor updates the local time of the slave sensor according to the time data, it is specifically used for: judging whether there is a start mark in the time data; if so, updating the local time of the slave sensor according to the time data.

43. The multi-sensor system according to claim 30, wherein, the slave sensor is further used for: when receiving a plurality of time data, determining the sending methods corresponding to the plurality of time data, and determining the priorities corresponding to the plurality of time data according to the sending methods; the sending methods include a serial bus sending method and other sending methods other than the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to the other sending methods; updating the local time of the slave sensor through the time data with the highest priority according to the priorities corresponding to the plurality of time data.

44. The multi-sensor system according to claim 30, wherein, the master sensor and the slave sensor are connected by an Ethernet cable; the slave sensor is further used for: performing information interaction with the master sensor through the Ethernet cable to achieve time synchronization.

45. The multi-sensor system according to claim 44, wherein, the slave sensor is further used for: when receiving the time data sent by the master sensor through the serial bus and the time data sent by the master sensor through the Ethernet cable at the same time, and the priority of the serial bus is greater than the priority of the Ethernet cable, updating the local time based on the time data sent by the master sensor through the serial bus.

46. The multi-sensor system according to claim 30, wherein, the slave sensor includes a first slave sensor and at least one second slave sensor, and the first slave sensor and the second slave sensor are connected by an Ethernet cable; the second slave sensor is further used for: performing information interaction with the first slave sensor through the Ethernet cable to achieve time synchronization.

47. The multi-sensor system according to claim 46, wherein, the first slave sensor is further used for: if the time data sent by the master sensor through the serial bus is not received within a preset time, then through the Ethernet cable between the first slave sensor and the second slave sensor, sending the time data of the first slave sensor to the second slave sensor, so that the second slave sensor performs time synchronization according to the time data of the first slave sensor.

48. The multi-sensor system according to claim 46, wherein, the master sensor and the first slave sensor respectively correspond to preset priorities, and the second slave sensor is further used for: if receiving the time data of the master sensor and the time data of the first slave sensor at the same time, and the priority of the master sensor is greater than the priority of the first slave sensor, then updating the local time based on the time data of the master sensor; If the time data of the master sensor and the time data of the first slave sensor are received simultaneously, and the priority of the master sensor is less than the priority of the first slave sensor, then update the local time based on the time data of the first slave sensor.

49. The multi-sensor system according to claim 47, wherein, the master sensor and the first slave sensor respectively correspond to preset priorities, and the second slave sensor is further configured to: if the time data of the master sensor and the time data of the first slave sensor are received simultaneously, and the priority of the master sensor is greater than the priority of the first slave sensor, then update the local time based on the time data of the master sensor; if the time data of the master sensor and the time data of the first slave sensor are received simultaneously, and the priority of the master sensor is less than the priority of the first slave sensor, then update the local time based on the time data of the first slave sensor.

50. The multi-sensor system according to claim 46, wherein, the serial bus and the Ethernet cable respectively correspond to preset priorities, and the second slave sensor is further configured to: if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is greater than the priority of the Ethernet cable, then update the local time based on the time data sent through the serial bus; if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is less than the priority of the Ethernet cable, then update the local time based on the time data sent through the Ethernet cable.

51. The multi-sensor system according to claim 47, wherein, the serial bus and the Ethernet cable respectively correspond to preset priorities, and the second slave sensor is further configured to: if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is greater than the priority of the Ethernet cable, then update the local time based on the time data sent through the serial bus; if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is less than the priority of the Ethernet cable, then update the local time based on the time data sent through the Ethernet cable.

52. The multi-sensor system according to any one of claims 30-34 or 36-51, wherein, the serial bus includes an RS485 bus.

53. The multi-sensor system according to claim 35, wherein, the serial bus includes an RS485 bus.

54. The multi-sensor system according to any one of claims 30-34 or 36-51, wherein, the master sensor includes an IMU sensor.

55. The multi-sensor system according to claim 35, wherein, the master sensor includes an IMU sensor.

56. The multi-sensor system according to any one of claims 30-34 or 36-51, characterized in that, the slave sensors include at least one of the following: an IMU sensor, an image sensor, a lidar sensor, an electronic control unit.

57. The multi-sensor system according to claim 35, characterized in that, the slave sensors include at least one of the following: an IMU sensor, an image sensor, a lidar sensor, an electronic control unit.

58. The multi-sensor system according to any one of claims 46-51, characterized in that, the first slave sensor includes an IMU sensor.

59. A multi-sensor system, characterized in that, the multi-sensor system is used for an unmanned aerial vehicle and / or a vehicle, and the multi-sensor system includes a plurality of sensors; one of the sensors is a master sensor, and the other sensors are slave sensors. The master sensor is connected to the slave sensors through a serial bus, and the serial bus transmits data in a unidirectional protocol manner; the master sensor includes a first processor and a first memory; the first memory is used for storing first computer instructions executable by the first processor; the slave sensors include a second processor and a second memory; the second memory is used for storing second computer instructions executable by the second processor; the first processor is used for reading the first computer instructions from the first memory to achieve: obtaining the current time data of the master sensor, and sending the time data to the slave sensors through the serial bus; the second processor is used for reading the second computer instructions from the second memory to achieve: after receiving the time data through the serial bus, updating the local time of the slave sensors according to the time data; wherein, updating the local time of the slave sensors according to the time data includes: when receiving a trigger signal of the master sensor, recording the reception time of the trigger signal, and updating the local time of the slave sensors according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

60. A movable platform, characterized in that, the movable platform includes an unmanned aerial vehicle and / or a vehicle, and includes: a fuselage; a power system provided on the fuselage, the power system being used for providing power for the movable platform; and the multi-sensor system according to any one of claims 30-58; wherein, the plurality of sensors include one or more of an IMU sensor, an image sensor, a lidar sensor, and an electronic control unit; the IMU sensor is used for measuring the three-axis attitude angle and acceleration of the movable platform; the image sensor is used for acquiring image information around the movable platform; the lidar sensor is used for acquiring point cloud information of the movable platform; the electronic control unit is used for generating control signals to control the flight parameters of the movable platform.

61. A time synchronization method, characterized in that, it is applied to a sensor, and the sensor is used for an unmanned aerial vehicle and / or a vehicle. The method includes: receiving time data sent through a serial port bus, and the serial port bus transmits data in a unidirectional protocol manner; updating the local time of the sensor according to the time data; wherein, the updating the local time of the sensor according to the time data includes: when receiving a trigger signal, recording the receiving time of the trigger signal; updating the local time of the sensor according to the receiving time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

62. The method according to claim 61, characterized in that, if the trigger signal is a synchronization signal independent of the time data, and the serial port bus includes a first serial port sub-bus and a second serial port sub-bus, the receiving the time data sent through the serial port bus includes: receiving the trigger signal sent through the first serial port sub-bus; receiving the time data sent simultaneously through the second serial port sub-bus; the when receiving a trigger signal, recording the receiving time of the trigger signal includes: when receiving the trigger signal sent through the first serial port sub-bus, recording the receiving time of the trigger signal.

63. The method according to claim 61, characterized in that, if the trigger signal is the first N bit signals of the time data, the serial port bus is a single-channel serial port bus; the receiving the time data sent through the serial port bus includes: receiving the time data sent through the single-channel serial port bus; the when receiving a trigger signal, recording the receiving time of the trigger signal includes: when detecting the rising edge or falling edge of the first bit signal of the time data, recording the current time as the receiving time of the trigger signal.

64. The method according to claim 62 or 63, characterized in that, the updating the local time of the sensor according to the time data includes: updating the local time of the sensor according to the receiving time of the trigger signal, the current time of the sensor, and the time data.

65. The method according to claim 64, characterized in that, the time data includes a time stamp; the updating the local time of the sensor according to the receiving time of the trigger signal, the current time of the sensor, and the time data includes: determining the difference between the current time of the sensor and the receiving time of the trigger signal, and updating the local time of the sensor according to the time stamp and the difference; or, determining the difference between the time stamp and the receiving time of the trigger signal, and updating the local time of the sensor according to the current time of the sensor and the difference.

66. The method according to claim 61, characterized in that, Updating the local time of the sensor according to the time data includes: updating the local system time of the sensor according to the time data; and / or, updating the local hardware time of the sensor according to the time data.

67. The method according to claim 61, wherein, updating the local time of the sensor according to the time data includes: updating the virtual clock of the sensor according to the time data; updating the local time of the sensor according to the virtual clock.

68. The method according to claim 67, wherein, the time data includes a time stamp, and the starting virtual time of the virtual clock is the time stamp; the updating the local time of the sensor according to the virtual clock includes: after a preset duration, updating the target virtual time of the virtual clock to the sum of the time stamp and the preset duration, and updating the local time of the sensor to the target virtual time.

69. The method according to claim 61, wherein, updating the local time of the sensor according to the time data includes: judging whether the time data is valid time data; if so, updating the local time of the sensor according to the time data.

70. The method according to claim 61, wherein, the method includes: determining time drift information according to a plurality of time data; performing time compensation on the crystal oscillator according to the time drift information.

71. The method according to claim 61, wherein, updating the local time of the sensor according to the time data includes: judging whether there is a starting mark in the time data; if so, updating the local time of the sensor according to the time data.

72. The method according to claim 61, wherein, the method further includes: when receiving a plurality of time data, determining the sending methods corresponding to the plurality of time data, and determining the priorities corresponding to the plurality of time data according to the sending methods; the sending methods include a serial bus sending method and other sending methods except the serial bus, and the priority of the time data corresponding to the serial bus sending method is higher than the priority of the time data corresponding to the other sending methods; updating the local time of the sensor with the time data having the highest priority according to the priorities corresponding to the plurality of time data.

73. The method according to claim 61, wherein, the method further includes: if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is greater than the priority of the Ethernet cable, updating the local time of the sensor based on the time data sent through the serial bus; if the time data sent through the serial bus and the time data sent through the Ethernet cable are received simultaneously, and the priority of the serial bus is less than the priority of the Ethernet cable, updating the local time of the sensor based on the time data sent through the Ethernet cable.

74. A sensor, wherein, The sensor is used for an unmanned aerial vehicle and / or a vehicle, and includes a processor; The processor is configured to receive time data sent through a serial port bus, and the serial port bus transmits data in a unidirectional protocol; Update the local time of the sensor according to the time data; Wherein, updating the local time of the sensor according to the time data includes: when a trigger signal is received, recording the reception time of the trigger signal; updating the local time of the sensor according to the reception time of the trigger signal and the time data; wherein, the trigger signal is a synchronization signal independent of the time data; or, the trigger signal is the first N bit signals of the time data, and N is greater than or equal to 1.

75. A machine-readable storage medium, characterized in that, Computer instructions are stored on the machine-readable storage medium, and when the computer instructions are executed, the method according to any one of claims 61-73 is implemented.

Citation Information

Patent Citations

  • Sensor synchronization method and sensor measuring system appertaining thereto

    CN104009833A