CN116684028A - Multi-sensor time synchronization method, device, equipment and storage medium - Google Patents

Multi-sensor time synchronization method, device, equipment and storage medium Download PDF

Info

Publication number
CN116684028A
CN116684028A CN202310692591.2A CN202310692591A CN116684028A CN 116684028 A CN116684028 A CN 116684028A CN 202310692591 A CN202310692591 A CN 202310692591A CN 116684028 A CN116684028 A CN 116684028A
Authority
CN
China
Prior art keywords
time
sensor
sensor data
data transmission
host
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310692591.2A
Other languages
Chinese (zh)
Other versions
CN116684028B (en
Inventor
蓝鸿翔
颜沁睿
胡闻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Chenjing Technology Co ltd
Original Assignee
Guangzhou Chenjing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Chenjing Technology Co ltd filed Critical Guangzhou Chenjing Technology Co ltd
Priority to CN202310692591.2A priority Critical patent/CN116684028B/en
Priority claimed from CN202310692591.2A external-priority patent/CN116684028B/en
Publication of CN116684028A publication Critical patent/CN116684028A/en
Application granted granted Critical
Publication of CN116684028B publication Critical patent/CN116684028B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0682Clock or time synchronisation in a network by delay compensation, e.g. by compensation of propagation delay or variations thereof, by ranging
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/02Details
    • H04J3/06Synchronising arrangements
    • H04J3/0635Clock or time synchronisation in a network
    • H04J3/0638Clock or time synchronisation among nodes; Internode synchronisation
    • H04J3/0658Clock or time synchronisation among packet nodes
    • H04J3/0661Clock or time synchronisation among packet nodes using timestamps
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Arrangements For Transmission Of Measured Signals (AREA)

Abstract

The invention discloses a multi-sensor time synchronization method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor; compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host; determining a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process and compensated sensor data transmission time; and filtering the compensated sensor data transmission time through a filtering weighting factor to obtain the filtered sensor data transmission time. The embodiment of the invention can provide accurate sensor data transmission time and achieve the aim of high-precision time synchronization.

Description

Multi-sensor time synchronization method, device, equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method, an apparatus, a device, and a storage medium for time synchronization of multiple sensors.
Background
On a robot, an automatic driving vehicle and other movable equipment needing to sense the environment, a plurality of sensors, such as cameras, millimeter radar waves and the like, are generally required to be arranged to collect image data of the surrounding environment, data fusion sensing is performed based on the image data collected by the plurality of cameras, and a sensing result of the surrounding environment is obtained.
Most of the existing multi-sensor clock synchronization is only solved at an application layer level, however, the problem that the accuracy of time synchronization is finally affected due to the fact that the periodic noise variance is too large and the clock offset is uncertain in the sensor data transmission process and the sensor timestamp data are distorted exists in the application layer time synchronization.
Disclosure of Invention
The invention provides a multi-sensor time synchronization method, a device, equipment and a storage medium, which are used for solving the problems that in the prior art, the periodic noise variance is overlarge and the clock offset is uncertain in the sensor data transmission process, the sensor time stamp data is distorted, and finally the accuracy of time synchronization is influenced.
To achieve the above object, an embodiment of the present invention provides a multi-sensor time synchronization method, including:
acquiring sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
determining a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process and the compensated sensor data transmission time;
and filtering the compensated sensor data transmission time through the filtering weighting factors to obtain filtered sensor data transmission time.
As an improvement of the above solution, the compensating the sensor data transmission time according to the sensor data receiving time to obtain a compensated sensor data transmission time includes:
acquiring clock offset and communication delay time between the host and the sensor through data interaction between the host and the sensor;
compensating the sensor data transmission time according to the following steps to obtain the compensated sensor data transmission time:
t=t rcv -t shift -d
wherein t is rcv Representing sensor data reception time, t shift Represents the clock offset, and d represents the communication delay time.
As an improvement of the above solution, the method for acquiring the clock offset and the communication delay time between the host and the sensor through the data interaction between the host and the sensor includes:
sending a message carrying a time stamp to a sensor, so that the sensor returns the message after receiving a preset waiting time of the message;
receiving the returned message;
analyzing the message to obtain the message sending time of the host, the message receiving time of the sensor, the message sending time of the sensor and the message receiving time of the host;
and calculating clock offset and communication delay time between the host and the sensor according to the time of sending the message by the host, the time of receiving the message by the sensor, the time of sending the message by the sensor and the time of receiving the message by the host.
As an improvement of the above solution, the calculating the clock offset and the communication delay time between the host and the sensor according to the host sending message time, the sensor receiving message time, the sensor sending message time and the host receiving message time includes:
establishing a first relation between the message sending time of the host and the message receiving time of the sensor by using the clock offset and the sending delay between the host and the sensor;
establishing a second relation between the time of sending the message by the sensor and the time of receiving the message by the host by using the clock offset and the receiving delay between the host and the sensor;
constructing a first expression regarding the clock offset and a second expression regarding a communication delay time between the host and the sensor using the first relation and the second relation;
solving the first expression to obtain the clock offset;
and solving the second expression to obtain the communication delay time.
As an improvement of the above solution, the determining a filtering weighting factor according to delay noise during system scheduling, delay noise during sensor data transmission, and the compensated sensor data transmission time includes:
according to P i ' +1 =P i +q, predicting the expected jitter variance at the next time; wherein P is i ' +1 Representing the expected jitter variance at time i+1, P i The jitter variance at the moment i is represented, and Q represents the variance of delay noise in the system scheduling process;
according toCalculating a filtering weighting factor; wherein K represents a filtering weighting factor, P i ' +1 Representing the expected jitter variance at time i+1, and R represents the variance of the delay noise during sensor data transmission.
As an improvement of the above solution, the filtering the compensated sensor data transmission time by the filtering weighting factor to obtain a filtered sensor data transmission time includes:
according to T i ' +1 =T i +Δt, predicting a sensor data transmission time at a next time; wherein T is i ' +1 Sensor data transmission time, T, at time i+1 i Transmission indicating time iSensor data transmission time, Δt represents a sensor data transmission period;
according to T i+1 =T i ' +1 +ky, calculating the filtered sensor data transmission time; wherein T is i+1 Sensor data transmission time, T, at time i i ' +1 Sensor data transmission time at time i+1, K represents a filter weighting factor, y=t i+1 -T i ' +1
To achieve the above object, an embodiment of the present invention further provides a multi-sensor time synchronization device, including:
the sensor data receiving time acquisition module is used for acquiring the sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
the sensor data transmission time compensation module is used for compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
and the sensor data transmission time filtering module filters the compensated sensor data transmission time to obtain the filtered sensor data transmission time.
As an improvement of the above solution, the compensating the sensor data transmission time according to the sensor data receiving time to obtain a compensated sensor data transmission time includes:
acquiring clock offset and communication delay time between the host and the sensor through data interaction between the host and the sensor;
compensating the sensor data transmission time according to the following steps to obtain the compensated sensor data transmission time:
t=t rcv -t shift -d
wherein t is rcv Representing sensor data reception time, t shift Represents the clock offset, and d represents the communication delay time.
To achieve the above object, an embodiment of the present invention further provides an electronic device including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the multi-sensor time synchronization method as described above when executing the computer program.
To achieve the above object, embodiments of the present invention also provide a computer-readable storage medium including a stored computer program; wherein the computer program, when run, controls the device in which the computer readable storage medium resides to perform the multi-sensor time synchronization method as described above.
Compared with the prior art, the multi-sensor time synchronization method, the device, the equipment and the storage medium provided by the embodiment of the invention acquire the sensor data receiving time; compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; and filtering the compensated sensor data transmission time to obtain the filtered sensor data transmission time. Therefore, the embodiment of the invention determines the filtering weighting factor K by combining the actual sensor data receiving time, the delay noise in the system scheduling process and the delay noise in the sensor data transmission process, and further calculates the final sensor data sending time through weighted average, thereby achieving the purpose of high-precision time synchronization.
Drawings
FIG. 1 is a flow chart of a multi-sensor time synchronization method provided by an embodiment of the present invention;
FIG. 2 is a block diagram of a multi-sensor time synchronization device according to an embodiment of the present invention;
fig. 3 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
Referring to fig. 1, fig. 1 is a flowchart of a multi-sensor time synchronization method according to an embodiment of the present invention, where the multi-sensor time synchronization method includes:
s1, acquiring sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
s2, compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
s3, determining a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process and the compensated sensor data transmission time;
and S4, filtering the compensated sensor data transmission time through the filtering weighting factors to obtain the filtered sensor data transmission time.
It can be understood that the embodiment of the invention can be applied to a host computer and can receive the sensor data sent by each sensor; according to the embodiment of the invention, the compensation parameters of the communication are calculated through estimating the clock offset and the network communication delay of the target sensor and the host, then the filtering weighting factors are determined by utilizing the last time of sensor data transmission and combining the system scheduling delay noise and the sensor transmission delay noise, and finally the final sensor time stamp is calculated through weighted average so as to achieve the aim of high-precision time stamp synchronization.
It can be understood that the conventional sensor communication method has means such as serial port and SPI, and in order to meet the accuracy requirement of time synchronization, the processing performance of the processing port of the main host needs to be very high, and even customization of driving needs to be performed. And the quantization process in the transmission delay also needs to be quantized for a specific hardware model. When the transmission data volume is too large, the problems of packet loss and the like are easy to occur.
The LAN communication has the characteristics of low delay, high bandwidth, loss protection rate and the like, and in addition, the embedded platform system generally supports functions of marking time stamps and the like at a kernel level. Common network transport protocols support both TCP and UDP. The TCP transmission support retransmission mechanism is somewhat prominent when the network communication quality is poor, but for a multi-sensor platform using lan-type communication, the sensor would be more suitable to use UDP because the lan itself has a sufficiently high communication quality.
Thus, prior to implementation of an embodiment of the present invention, a communication link is designed:
to implement the kernel level timestamp, the lower level system API recvmsg/sendmsg may be used at programming time, and the functional options of SO_ TIMESTAMPING, SO _ TIMESTAMPING _RX_SOFTWARE, SO_ TIMESTAMPING _RX_HARDWARE, etc. are opened in the program initialization. Where so_ TIMESTAMPING _rx_hardwire requires network adapter support to be realizable.
The embodiment of the invention optimizes the communication link by using Ethernet communication in the multi-sensor platform, and achieves the marking of the kernel-level/hardware-level time stamp by using the UDP protocol characteristic to further eliminate delay errors introduced by message processing of an application layer.
In an alternative embodiment, the compensating the sensor data sending time according to the sensor data receiving time to obtain the compensated sensor data sending time includes:
acquiring clock offset and communication delay time between the host and the sensor through data interaction between the host and the sensor;
compensating the sensor data transmission time according to the following steps to obtain the compensated sensor data transmission time:
t=t rcv -t shift -d
wherein t is rcv Representing the receipt of sensor dataBetween t shift Represents the clock offset, and d represents the communication delay time.
It will be appreciated that the clock offset and communication delay time are estimated as one-time computing work done at the initial stage of the sensor. In the subsequent sensor frame receiving process, the accurate time triggered by the sensor frame can be compensated only by determining the receiving time and calculating the time offset and the communication delay time.
In an alternative embodiment, the obtaining the clock offset and the communication delay time between the host and the sensor through the data interaction between the host and the sensor includes:
sending a message carrying a time stamp to a sensor, so that the sensor returns the message after receiving a preset waiting time of the message;
receiving the returned message;
analyzing the message to obtain the message sending time of the host, the message receiving time of the sensor, the message sending time of the sensor and the message receiving time of the host;
and calculating clock offset and communication delay time between the host and the sensor according to the time of sending the message by the host, the time of receiving the message by the sensor, the time of sending the message by the sensor and the time of receiving the message by the host.
It will be appreciated that in a typical multi-sensor platform, both the host and the sensor have their own clocks, and there is typically a clock offset of two between them due to the difference in the accuracy of the respective clocks' crystal oscillator and the clock source. This offset is only visible to the naked eye at the second level.
Multiple handshaking communications with the host are required during the initial stages of the sensor in order to achieve time offset estimation and delay estimation. The handshake communication message needs to carry a local clock time stamp, and the deviation between the sensor clock and the host clock can be estimated through multiple interactions according to a certain packet grouping rule, and meanwhile, the average network communication delay can be calculated.
Illustratively, the host sends N-time probing messages, and after the sensor receives the probing messages sent by the host, the sensor adds a local timestamp to the messages and returns the messages to the host. Through the probe message, the host can calculate the offset between the two clocks and the transmission delay introduced by the communication link. The detailed steps are as follows:
(1) The host acquires the current UTC time stamp and sends the current UTC time stamp to the sensor;
(2) The sensor receives a message probed by the host computer and acquires a message receiving time stamp;
(3) The sensor waits for K seconds, acquires a local UTC time stamp, and sends the received current UTC time stamp, the message receiving time stamp and the local UTC time stamp back to the host;
(4) The host receives the sounding packet returned by the sensor and marks the sounding packet receiving time stamp;
the four steps are collectively called as sounding, the current UTC time stamp and the sounding packet receiving time stamp are host time stamps, and the message receiving time stamp and the local UTC time stamp are sensor time stamps. These four timestamps need to be unified into UTC timestamp format with nanosecond precision. It will be appreciated that using these time stamps, the host send message time T can be obtained 1 Time T for receiving message by sensor 2 Time T for sending message by sensor 3 And the message receiving time T of the host 4
The corresponding clock offset and communication delay time are obtained through multiple trending and calculation, and then the clock offset and the communication delay time are averaged to obtain a group of clock offset and communication delay time with higher robustness.
In an optional embodiment, the calculating the clock offset and the communication delay time between the host and the sensor according to the host sending message time, the sensor receiving message time, the sensor sending message time and the host receiving message time includes:
establishing a first relation between the message sending time of the host and the message receiving time of the sensor by using the clock offset and the sending delay between the host and the sensor;
establishing a second relation between the time of sending the message by the sensor and the time of receiving the message by the host by using the clock offset and the receiving delay between the host and the sensor;
constructing a first expression regarding the clock offset and a second expression regarding a communication delay time between the host and the sensor using the first relation and the second relation;
solving the first expression to obtain the clock offset;
and solving the second expression to obtain the communication delay time.
Illustratively, according to the clock offset t shift And a transmission delay d 1 Constructing a first relation T 1 +t shift +d 1 =T 2
According to the clock offset t shift And a reception delay d 2 Constructing a second relation T 3 -t shift +d 2 =T 4
Subtracting the two relational expressions to obtain a first expression:
adding the two relational expressions to obtain a second expression: d=d 1 +d 2 =(T 2 -T 1 )+(T 4 -T 3 )。
In general, the transmission delay d 1 And a reception delay d 2 Equality, solving the first expression to obtain the clock offset t shift The method comprises the steps of carrying out a first treatment on the surface of the At the same time, delay d will be sent 1 And a reception delay d 2 The communication delay time d is obtained by addition.
In an alternative embodiment, the determining the filtering weighting factor according to the delay noise during the scheduling of the system, the delay noise during the transmission of the sensor data, and the compensated sensor data transmission time includes:
according to P i ' +1 =P i +Q, predicting the expected jitter variance at the next time instantThe method comprises the steps of carrying out a first treatment on the surface of the Wherein P is i ' +1 Representing the expected jitter variance at time i+1, P i The jitter variance at the moment i is represented, and Q represents the variance of delay noise in the system scheduling process;
according toCalculating a filtering weighting factor; wherein K represents a filtering weighting factor, P i ' +1 Representing the expected jitter variance at time i+1, and R represents the variance of the delay noise during sensor data transmission.
In an optional embodiment, the filtering the compensated sensor data transmission time by the filtering weighting factor to obtain a filtered sensor data transmission time includes:
according to T i ' +1 =T i +Δt, predicting a sensor data transmission time at a next time; wherein T is i ' +1 Sensor data transmission time, T, at time i+1 i Sensor data transmission time at time i is represented, and Δt represents a sensor data transmission period;
according to T i+1 =T i ' +1 +ky, calculating the filtered sensor data transmission time; wherein T is i+1 Sensor data transmission time, T, at time i i ' +1 Sensor data transmission time at time i+1, K represents a filter weighting factor, y=t i+1 -T i ' +1
It will be appreciated that the communication delay estimate is an estimate made assuming that the communication link delay is fixed and the transmission uplink and downlink delays are consistent. The network delay and the uplink and downlink communication rate of the actual multi-sensor network transmission platform depend on the design of the network topology of the whole system, and often these parameters are not constant. In particular, network transmission delay is often interfered by electromagnetic environment of a link, and the problems of extremely large jitter variance and the like caused by preemption of other sensors, so that time stamps need to be filtered. The main function of the timestamp filtering is to achieve that the receiving period of the sensor frame is as close to the sending period as possible, and the period jitter (jitter) is smoothed, so that the finally acquired timestamp is more accurate and stable.
And taking the time after the time compensation as an input, and filtering the time after the time compensation. In the time compensation process, the arrival time of the sensor message needs to be predicted, the filtering weighting factor K is determined according to the relation between the delay of the transmission link and the noise, and finally the weighted average of the predicted time and the measurement time is realized through K. Assuming that the input time is T, the sensor data transmission period, that is, the theoretical transmission frame period of the sensor frame is Δt, the jitter (jitter) variance of the packet reception period of the target sensor is P, the variance of the corresponding noise is Q, and the variance of the network transmission delay is R. The filter weighting factor K can be determined by the following formula:
T i ' +1 =T i +ΔT
P i ' +1 =P i +Q
y=T i+1 -T i ' +1
T i+1 =T i ' +1 +Ky
P i+1 =(1-K)P i ' +1
the first line of the formula functions to estimate the arrival time of the message at the target sensor. The second behavior estimates the corresponding timestamp variance, since the received timestamp always has a gaussian noise with Q as the variance each time the system scheduling priority interference is received. In addition to the noise introduced by the system scheduling, the system also has a communication delay noise, which is also assumed to be gaussian with variance R. Therefore, the weighting factor K of the current filtering can be determined as the ratio of two noises.
The embodiment of the invention effectively solves the problems of clock offset, transmission delay estimation and quantization in the multi-sensor time synchronization process by means of communication optimization, clock offset estimation, delay estimation, time stamp filtering and the like, provides a low-period jitter and high-precision clock synchronization method for multi-sensor time synchronization, and provides accurate time stamp data for a subsequent fusion algorithm.
Referring to fig. 2, fig. 2 is a block diagram of a multi-sensor time synchronization device 10 according to an embodiment of the present invention, where the multi-sensor time synchronization device 10 includes:
a sensor data receiving time acquisition module 11 for acquiring a sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
a sensor data transmission time compensation module 12, configured to compensate the sensor data transmission time according to the sensor data reception time, so as to obtain a compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
a filtering weighting factor determining module 13, configured to determine a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process, and the compensated sensor data transmission time;
the time synchronization module 14 filters the compensated sensor data transmission time by the filtering weighting factor to obtain a filtered sensor data transmission time.
Preferably, the compensating the sensor data sending time according to the sensor data receiving time to obtain the compensated sensor data sending time includes:
acquiring clock offset and communication delay time between the host and the sensor through data interaction between the host and the sensor;
compensating the sensor data transmission time according to the following steps to obtain the compensated sensor data transmission time:
t=t rcv -t shift -d
wherein t is rcv Representing sensor data reception time, t shift Indicating clockThe offset, d, represents the communication delay time.
Preferably, the acquiring the clock offset and the communication delay time between the host and the sensor through the data interaction between the host and the sensor includes:
sending a message carrying a time stamp to a sensor, so that the sensor returns the message after receiving a preset waiting time of the message;
receiving the returned message;
analyzing the message to obtain the message sending time of the host, the message receiving time of the sensor, the message sending time of the sensor and the message receiving time of the host;
and calculating clock offset and communication delay time between the host and the sensor according to the time of sending the message by the host, the time of receiving the message by the sensor, the time of sending the message by the sensor and the time of receiving the message by the host.
Preferably, the calculating the clock offset and the communication delay time between the host and the sensor according to the time when the host sends the message, the time when the sensor receives the message, the time when the sensor sends the message, and the time when the host receives the message includes:
establishing a first relation between the message sending time of the host and the message receiving time of the sensor by using the clock offset and the sending delay between the host and the sensor;
establishing a second relation between the time of sending the message by the sensor and the time of receiving the message by the host by using the clock offset and the receiving delay between the host and the sensor;
constructing a first expression regarding the clock offset and a second expression regarding a communication delay time between the host and the sensor using the first relation and the second relation;
solving the first expression to obtain the clock offset;
and solving the second expression to obtain the communication delay time.
Preferably, the determining a filtering weighting factor according to the delay noise in the system scheduling process, the delay noise in the sensor data transmission process and the compensated sensor data transmission time includes:
according to P i ' +1 =P i +q, predicting the expected jitter variance at the next time; wherein P is i ' +1 Representing the expected jitter variance at time i+1, P i The jitter variance at the moment i is represented, and Q represents the variance of delay noise in the system scheduling process;
according toCalculating a filtering weighting factor; wherein K represents a filtering weighting factor, P i ' +1 Representing the expected jitter variance at time i+1, and R represents the variance of the delay noise during sensor data transmission.
Preferably, the filtering the compensated sensor data transmission time by the filtering weighting factor to obtain a filtered sensor data transmission time includes:
according to T i ' +1 =T i +Δt, predicting a sensor data transmission time at a next time; wherein T is i ' +1 Sensor data transmission time, T, at time i+1 i Sensor data transmission time at time i is represented, and Δt represents a sensor data transmission period;
according to T i+1 =T i ' +1 +ky, calculating the filtered sensor data transmission time; wherein T is i+1 Sensor data transmission time, T, at time i i ' +1 Sensor data transmission time at time i+1, K represents a filter weighting factor, y=t i+1 -T i ' +1
It should be noted that, the working process of each module in the multi-sensor time synchronization device 10 according to the embodiment of the present invention may refer to the working process of the multi-sensor time synchronization method according to the above embodiment, which is not described herein.
The embodiment of the invention also provides a computer readable storage medium, which comprises a stored computer program; wherein the computer program, when executed, controls a device in which the computer readable storage medium is located to perform the multi-sensor time synchronization method according to any one of the embodiments described above.
Referring to fig. 3, fig. 3 is a block diagram of an electronic device 20 according to an embodiment of the present invention, where the electronic device 20 includes: a processor 21, a memory 22 and a computer program stored in said memory 22 and executable on said processor 21. The processor 21, when executing the computer program, implements the steps of the multi-sensor time synchronization method embodiments described above. Alternatively, the processor 21 may implement the functions of the modules/units in the above-described device embodiments when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory 22 and executed by the processor 21 to complete the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing the specified functions, which instruction segments are used to describe the execution of the computer program in the electronic device 20.
The electronic device 20 may be a computing device such as a desktop computer, a notebook computer, a palm computer, and a cloud server. The electronic device 20 may include, but is not limited to, a processor 21, a memory 22. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of the electronic device 20 and is not meant to be limiting of the electronic device 20, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the electronic device 20 may also include input-output devices, network access devices, buses, etc.
The processor 21 may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, and the processor 21 is a control center of the electronic device 20, and connects various parts of the entire electronic device 20 using various interfaces and lines.
The memory 22 may be used to store the computer program and/or module, and the processor 21 may implement various functions of the electronic device 20 by executing or executing the computer program and/or module stored in the memory 22, and invoking data stored in the memory 22. The memory 22 may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program (such as a sound playing function, an image playing function, etc.) required for at least one function, and the like; the storage data area may store data (such as audio data, phonebook, etc.) created according to the use of the handset, etc. In addition, the memory 22 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, memory, plug-in hard disk, smart Media Card (SMC), secure Digital (SD) Card, flash Card (Flash Card), at least one disk storage device, flash memory device, or other volatile solid-state storage device.
Wherein the integrated modules/units of the electronic device 20 may be stored in a computer readable storage medium if implemented in the form of software functional units and sold or used as a stand alone product. Based on such understanding, the present invention may implement all or part of the flow of the method of the above embodiment, or may be implemented by a computer program to instruct related hardware, where the computer program may be stored in a computer readable storage medium, and the computer program may implement the steps of each of the method embodiments described above when executed by the processor 21. Wherein the computer program comprises computer program code which may be in source code form, object code form, executable file or some intermediate form etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a U disk, a removable hard disk, a magnetic disk, an optical disk, a computer Memory, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), an electrical carrier signal, a telecommunications signal, a software distribution medium, and so forth.
It should be noted that the above-described apparatus embodiments are merely illustrative, and the units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. In addition, in the drawings of the embodiment of the device provided by the invention, the connection relation between the modules represents that the modules have communication connection, and can be specifically implemented as one or more communication buses or signal lines. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
Compared with the prior art, the multi-sensor time synchronization method, the device, the equipment and the storage medium provided by the embodiment of the invention acquire the sensor data receiving time; compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; and filtering the compensated sensor data transmission time to obtain the filtered sensor data transmission time. Therefore, the embodiment of the invention determines the filtering weighting factor K by combining the actual sensor data receiving time, the delay noise in the system scheduling process and the delay noise in the sensor data transmission process, and further calculates the final sensor data sending time through weighted average, thereby achieving the purpose of high-precision time synchronization.
While the foregoing is directed to the preferred embodiments of the present invention, it will be appreciated by those skilled in the art that changes and modifications may be made without departing from the principles of the invention, such changes and modifications are also intended to be within the scope of the invention.

Claims (10)

1. A method of multi-sensor time synchronization, comprising:
acquiring sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
determining a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process and the compensated sensor data transmission time;
and filtering the compensated sensor data transmission time through the filtering weighting factors to obtain filtered sensor data transmission time.
2. The multi-sensor time synchronization method of claim 1, wherein compensating the sensor data transmission time based on the sensor data reception time to obtain a compensated sensor data transmission time comprises:
acquiring clock offset and communication delay time between the host and the sensor through data interaction between the host and the sensor;
compensating the sensor data transmission time according to the following steps to obtain the compensated sensor data transmission time:
t=t rcv -t shift -d
wherein t is rcv Representing sensor data reception time, t shift Represents the clock offset, and d represents the communication delay time.
3. The multi-sensor time synchronization method of claim 2, wherein the obtaining the clock offset and the communication delay time between the host and the sensor through the data interaction between the host and the sensor comprises:
sending a message carrying a time stamp to a sensor, so that the sensor returns the message after receiving a preset waiting time of the message;
receiving the returned message;
analyzing the message to obtain the message sending time of the host, the message receiving time of the sensor, the message sending time of the sensor and the message receiving time of the host;
and calculating clock offset and communication delay time between the host and the sensor according to the time of sending the message by the host, the time of receiving the message by the sensor, the time of sending the message by the sensor and the time of receiving the message by the host.
4. The multi-sensor time synchronization method of claim 3, wherein the calculating the clock offset and the communication delay time between the host and the sensor based on the host transmit message time, the sensor receive message time, the sensor transmit message time, and the host receive message time comprises:
establishing a first relation between the message sending time of the host and the message receiving time of the sensor by using the clock offset and the sending delay between the host and the sensor;
establishing a second relation between the time of sending the message by the sensor and the time of receiving the message by the host by using the clock offset and the receiving delay between the host and the sensor;
constructing a first expression regarding the clock offset and a second expression regarding a communication delay time between the host and the sensor using the first relation and the second relation;
solving the first expression to obtain the clock offset;
and solving the second expression to obtain the communication delay time.
5. The multi-sensor time synchronization method of claim 1, wherein the determining the filtering weighting factor based on the delay noise during system scheduling, the delay noise during sensor data transmission, and the compensated sensor data transmission time comprises:
according to P i ' +1 =P i +q, predicting the expected jitter variance at the next time; wherein P is i ' +1 Representing the expected jitter variance at time i+1, P i The jitter variance at the moment i is represented, and Q represents the variance of delay noise in the system scheduling process;
according toCalculating a filtering weighting factor; wherein K represents a filtering weighting factor, P i ' +1 Representing the expected jitter variance at time i+1, and R represents the variance of the delay noise during sensor data transmission.
6. The multi-sensor time synchronization method of claim 1, wherein filtering the compensated sensor data transmission time by the filtering weighting factor to obtain a filtered sensor data transmission time comprises:
according to T i ' +1 =T i +Δt, predicting a sensor data transmission time at a next time; wherein T is i ' +1 Sensor data transmission time, T, at time i+1 i Sensor data transmission time at time i is represented, and Δt represents a sensor data transmission period;
according to T i+1 =T i ' +1 +ky, calculating the filtered sensor data transmission time; wherein T is i+1 Sensor data transmission time, T, at time i i ' +1 Sensor data transmission time at time i+1, K represents a filter weighting factor, y=t i+1 -T i ' +1
7. A multi-sensor time synchronization device, comprising:
the sensor data receiving time acquisition module is used for acquiring the sensor data receiving time; the sensor data receiving time is the time when the host receives the sensor data sent by the sensor;
the sensor data transmission time compensation module is used for compensating the sensor data transmission time according to the sensor data receiving time to obtain compensated sensor data transmission time; the sensor data sending time is the time when the sensor sends the sensor data to the host;
the filtering weighting factor determining module is used for determining a filtering weighting factor according to delay noise in a system scheduling process, delay noise in a sensor data transmission process and the compensated sensor data sending time;
and the time synchronization module filters the compensated sensor data transmission time through the filtering weighting factors to obtain the filtered sensor data transmission time.
8. The multi-sensor time synchronization apparatus of claim 7, wherein the determining the filter weighting factor based on delay noise during system scheduling, delay noise during sensor data transmission, and the compensated sensor data transmission time comprises:
according to P i ' +1 =P i +q, predicting the expected jitter variance at the next time; wherein P is i ' +1 Representing the expected jitter variance at time i+1, P i The jitter variance at the moment i is represented, and Q represents the variance of delay noise in the system scheduling process;
according toCalculating a filtering weighting factor; wherein K represents a filtering weighting factor, P i ' +1 Representing the expected jitter variance at time i+1, and R represents the variance of the delay noise during sensor data transmission.
9. An electronic device comprising a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, the processor implementing the multi-sensor time synchronization method of any one of claims 1-6 when the computer program is executed.
10. A computer readable storage medium, wherein the computer readable storage medium comprises a stored computer program; wherein the computer program, when run, controls a device in which the computer readable storage medium is located to perform the multi-sensor time synchronization method according to any one of claims 1 to 6.
CN202310692591.2A 2023-06-12 Multi-sensor time synchronization method, device, equipment and storage medium Active CN116684028B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310692591.2A CN116684028B (en) 2023-06-12 Multi-sensor time synchronization method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310692591.2A CN116684028B (en) 2023-06-12 Multi-sensor time synchronization method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN116684028A true CN116684028A (en) 2023-09-01
CN116684028B CN116684028B (en) 2024-05-28

Family

ID=

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724404A (en) * 2024-02-07 2024-03-19 北京航天巨恒系统集成技术有限公司 Position data compensation method and device, electronic equipment and motion control system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112398559A (en) * 2019-08-12 2021-02-23 顺丰科技有限公司 Clock synchronization method, device, system and storage medium
CN113472468A (en) * 2020-03-31 2021-10-01 华为技术有限公司 Synchronization method, device, equipment and storage medium
CN114710252A (en) * 2022-03-17 2022-07-05 陕西国防工业职业技术学院 Filtering method and system for precise clock synchronization
CN114785363A (en) * 2022-02-22 2022-07-22 Oppo广东移动通信有限公司 Noise compensation method, device, electronic equipment and computer readable storage medium
CN116245961A (en) * 2023-03-02 2023-06-09 之江实验室 Fusion sensing method and system based on multi-class sensor information

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112398559A (en) * 2019-08-12 2021-02-23 顺丰科技有限公司 Clock synchronization method, device, system and storage medium
CN113472468A (en) * 2020-03-31 2021-10-01 华为技术有限公司 Synchronization method, device, equipment and storage medium
US20230016860A1 (en) * 2020-03-31 2023-01-19 Huawei Technologies Co., Ltd. Synchronization Method, Apparatus, and Device, and Storage Medium
CN114785363A (en) * 2022-02-22 2022-07-22 Oppo广东移动通信有限公司 Noise compensation method, device, electronic equipment and computer readable storage medium
CN114710252A (en) * 2022-03-17 2022-07-05 陕西国防工业职业技术学院 Filtering method and system for precise clock synchronization
CN116245961A (en) * 2023-03-02 2023-06-09 之江实验室 Fusion sensing method and system based on multi-class sensor information

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117724404A (en) * 2024-02-07 2024-03-19 北京航天巨恒系统集成技术有限公司 Position data compensation method and device, electronic equipment and motion control system
CN117724404B (en) * 2024-02-07 2024-04-16 北京航天巨恒系统集成技术有限公司 Position data compensation method and device, electronic equipment and motion control system

Similar Documents

Publication Publication Date Title
US9736804B2 (en) Methods, systems, and computer readable media for synchronizing timing among network interface cards (NICS) in a network equipment test device
CN104243129B (en) Receiver, the method and computer readable storage medium for calculating the time difference
JP4931108B2 (en) High-precision time synchronization processing device and program thereof, and network congestion level warning device and program thereof
US8370675B2 (en) Precise clock synchronization
EP2434673B1 (en) Network synchronization method and apparatus for performing time synchronization between nodes
CN102197611B (en) Method and device for packet network synchronization
CN109392074B (en) Clock calibration method and device
KR20150143801A (en) Timestamp generating method, device and system
KR20210019531A (en) PHY level hardware time stamping and time synchronization in cost-optimized environments
EP3827623A1 (en) Synchronizing tsn master clocks in wireless networks
CN110100408B (en) Method for interacting time synchronization message and network device
KR20170058167A (en) Method and apparatus for synchronizing time
EP2129016B1 (en) Method and equipment for delay measurements in a communication system
CN108075851B (en) Device and method for synchronised clock
WO2019076210A1 (en) Time domain correlation estimation method, apparatus, and device
EP4044466A1 (en) Synchronization method and device
CN112395231B (en) Method and device for calculating data delay time among multiple processors
CN116684028B (en) Multi-sensor time synchronization method, device, equipment and storage medium
EP3231110A1 (en) Method and devices for time transfer using end to end transparent clocks
CN116684028A (en) Multi-sensor time synchronization method, device, equipment and storage medium
CN109120469B (en) Line transmission delay calculation method and device
TW202027448A (en) Nanosecond accuracy of timestamping by leveraging alignment marker and method for producing the same
CN107027167A (en) frequency correction device and method
CN115333660A (en) Precision timestamp correction
US20150106647A1 (en) Method and a Device for Maintaining a Synchronized Local Timer Using a Periodic Signal

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant