WO2021000216A1 - 消息同步方法和装置、无人驾驶系统以及可移动平台 - Google Patents

消息同步方法和装置、无人驾驶系统以及可移动平台 Download PDF

Info

Publication number
WO2021000216A1
WO2021000216A1 PCT/CN2019/094166 CN2019094166W WO2021000216A1 WO 2021000216 A1 WO2021000216 A1 WO 2021000216A1 CN 2019094166 W CN2019094166 W CN 2019094166W WO 2021000216 A1 WO2021000216 A1 WO 2021000216A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
messages
synchronized
storage
queue
Prior art date
Application number
PCT/CN2019/094166
Other languages
English (en)
French (fr)
Inventor
晋文科
王斌
周青松
Original Assignee
深圳市大疆创新科技有限公司
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 深圳市大疆创新科技有限公司 filed Critical 深圳市大疆创新科技有限公司
Priority to CN201980011683.1A priority Critical patent/CN111712800A/zh
Priority to PCT/CN2019/094166 priority patent/WO2021000216A1/zh
Publication of WO2021000216A1 publication Critical patent/WO2021000216A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Definitions

  • the invention relates to the field of message publishing and subscription, and in particular to a message synchronization method and device, an unmanned driving system and a movable platform.
  • the message synchronization module stores the messages collected by the same sensor in the same storage queue, and then obtains the messages collected by the corresponding sensors at the same time from each storage queue according to the externally required messages to be synchronized for fusion.
  • the message synchronization module stores messages A, B, C, and D in storage queue 0, storage queue 1, storage queue 2, and storage queue 3 respectively. If external parties need to merge message A and message D, The message synchronization module will obtain the message A stored in the storage queue 0 and the message D stored in the storage queue 3 in 200 ms.
  • the above-mentioned existing synchronization mechanism establishes a storage queue for each type of message.
  • the output frequency of different sensors will be different.
  • the result of the synchronization is only 20Hz sensor messages, while most of the 400Hz sensor messages do not need to be cached, the above storage method will lead to a waste of memory space.
  • the invention provides a message synchronization method and device, an unmanned driving system and a movable platform.
  • the present invention is implemented through the following technical solutions:
  • a message synchronization method for a message synchronization module in an automation system.
  • the automation system has a plurality of sensors, and the plurality of sensors have different types and/or different installation positions.
  • the methods include:
  • a message synchronization device is provided, the message synchronization device is applied in an automation system, the automation system has a plurality of sensors, and the plurality of sensors have different types and/or different installation positions,
  • the message synchronization device includes:
  • Storage device for storing program instructions
  • One or more processors call program instructions stored in the storage device, and when the program instructions are executed, the one or more processors are individually or collectively configured to:
  • an unmanned driving system including:
  • the multiple sensors are of different types and/or installation positions;
  • Storage device for storing program instructions
  • One or more processors call program instructions stored in the storage device, and when the program instructions are executed, the one or more processors are individually or collectively configured to:
  • a movable platform including:
  • a power system installed on the fuselage and used to provide power for the movable platform
  • a plurality of sensors are arranged in the body, and the plurality of sensors are of different types and/or installation positions;
  • Storage device for storing program instructions
  • One or more processors call program instructions stored in the storage device, and when the program instructions are executed, the one or more processors are individually or collectively configured to:
  • a computer-readable storage medium having a computer program stored thereon, and the program is used to:
  • the present invention caches each group of messages to be synchronized with the same timestamp in the same storage queue, which reduces the consumption speed of system memory space and can obtain the information at the same time faster. news.
  • Figure 1 is a schematic diagram of a message caching method in related technologies
  • FIG. 2 is a method flowchart of a message synchronization method in an embodiment of the present invention
  • Figure 3 is a schematic diagram of a message caching manner in an embodiment of the present invention.
  • 5 is a flowchart of an implementation manner of buffering each group of messages to be synchronized with the same timestamp in the same storage queue in an embodiment of the present invention
  • FIG. 6 is a flowchart of another specific method of a message synchronization method in an embodiment of the present invention.
  • Figure 7 is a structural block diagram of a message synchronization device in an embodiment of the present invention.
  • Figure 8 is a structural block diagram of an unmanned driving system in an embodiment of the present invention.
  • Fig. 9 is a structural block diagram of a movable platform in an embodiment of the present invention.
  • the embodiment of the present invention provides a message synchronization method, which is used in a message synchronization module in an automation system, wherein the automation system has multiple sensors, and the multiple sensors have different types and/or different installation positions.
  • the automation system can be, but is not limited to, a movable platform such as an unmanned driving system, a car, an unmanned aerial vehicle, a remote control vehicle, an unmanned boat or a robot, or a fixed platform.
  • the unmanned driving system may include an IMU, a camera, and a radar, and the motion information of the unmanned driving system can be measured by any one or a combination of at least two of the IMU, the camera and the radar In some cases, the messages output by at least two of the IMU, camera and radar at the same time are fused to obtain more accurate motion information.
  • the unmanned driving system can include multiple radars, which can be installed in different positions. For example, they can be installed on the left and right sides of the vehicle. The messages output by the radars on the left and right sides of the vehicle can be fused at the same time to detect the surrounding area of the vehicle. Obstacle situation.
  • multiple radars of different types can be installed at different positions on the vehicle body.
  • two laser radars are installed on the front side of the vehicle body and a millimeter wave radar is installed on the top of the vehicle body. Collect signals at the same time and merge the messages output at the same time.
  • the message synchronization method may include the following steps:
  • S201 Determine at least one group of messages to be synchronized, where the messages to be synchronized include messages output by at least two sensors with different types and/or messages output by at least two sensors with different installation positions;
  • the messages to be synchronized are a group.
  • the group of messages to be synchronized includes at least two of the messages output by the IMU, camera, and radar; optionally, the group of messages to be synchronized
  • the messages include messages output by radars on the left and right sides of the vehicle.
  • the messages to be synchronized can be two groups, such as the combination of the above two groups of messages to be synchronized; of course, the messages to be synchronized can also be more than two groups.
  • Different sensors have different degrees of delay and frame loss when collecting data. With the increase of the number of sensors, it is very difficult to synchronize the messages of all sensors at every moment, and the messages collected by different sensors are redundant , The requesting device sometimes needs messages from individual sensors to output stable results.
  • the message to be synchronized may be determined by the requesting device from the message synchronization module according to the message that it needs to synchronize, and the requesting device and the message synchronization module can communicate.
  • the requesting device can be a module in the automation system or an external device.
  • the requesting device registers the message to be synchronized on the message synchronization module, and the process of the message synchronization module determining at least one group of messages to be synchronized includes the following two steps:
  • the registration message carries at least one set of message types of messages to be synchronized. If the requesting device needs to synchronize message A, message C, and message D, the requesting device will include the message types of message A, message C, and message D in the send to message In the registration message of the synchronization module. It can be understood that the registration message may not only carry at least one group of message types to be synchronized, but also other information.
  • the device When the automation system of this embodiment is first started, the device is requested to register on the message synchronization module.
  • the requesting device registers on the message synchronization module, it informs the message synchronization module of the messages it needs to synchronize.
  • the message synchronization module will automatically update each message with the same time stamp. Groups of messages to be synchronized are cached in the same storage queue. Based on this method, message synchronization is more timely, while reducing the amount of data transmission between the requesting device and the message synchronization module.
  • the time stamp is based on the clock system of the message synchronization module.
  • the requesting device when the requesting device needs the message synchronization module to synchronize the messages to be synchronized, it sends a trigger signal to the message synchronization module, the trigger signal carries the message type of each message in the messages to be synchronized; the message synchronization module After receiving the trigger signal sent by the requesting device, obtain the message type of each message in each group of messages to be synchronized in the trigger signal, and then perform the synchronization process of the messages to be synchronized, that is, each group of messages to be synchronized with the same time stamp The messages are cached in the same storage queue.
  • S202 Buffer each group of messages to be synchronized with the same time stamp in the same storage queue.
  • the messages to be synchronized include the following groups: (1) Message A, Message B, Message C, Message D, and Message E; (2) Message A, Message B, Message C, and Message D; 3) Message A, Message C and Message D; (4) Message C and Message D.
  • the message synchronization module collects Message A, Message B, Message C, Message D, and Message E within 50 ms, and caches Message A, Message B, Message C, Message D, and Message E collected in 50 ms in In storage queue 3; the message synchronization module collects message A, message B, message C, and message D in 100ms, and caches message A, message B, message C, and message D collected in 100ms in storage queue 2; message synchronization The module collects message A, message C, and message D in 150ms, and caches message A, message C, and message D collected in 150ms in storage queue 1. The message synchronization module collects message C and message D in 200ms, and Message C and Message D collected in 200ms are buffered in storage queue 0.
  • the larger the value of the time stamp the later the collection time corresponding to the time stamp.
  • the collection time corresponding to the time stamp of 50ms is earlier than the collection time corresponding to the time stamp of 100ms, and the collection time corresponding to the time stamp of 100ms
  • the message synchronization module further includes the following steps after performing step S201 and before performing step S202:
  • the frequency of IMU output messages is usually higher than that of the camera.
  • the frequency of IMU output messages is 100Hz, the frequency of the camera output message is 20Hz.
  • S402 Determine the number of storage queues according to the message with the smallest frequency among the messages to be synchronized.
  • the realization of determining the number of storage queues may include but not limited to the following two:
  • the pre-established storage queue can be used cyclically. After processing the messages in the storage queue or when the time stamp of the message in the storage queue is earlier than the preset time stamp, the message in the storage queue can be used. Clear to ensure that the storage queue is recycled.
  • the message synchronization module obtains the message output by the camera, it establishes a new storage queue or obtains a storage queue of unstored messages from a pre-established storage queue, and then combines the currently obtained camera message and the same time (ie The time when the message of the camera is obtained) The message of the obtained IMU is stored in the aforementioned storage queue.
  • FIG. 5 is a flowchart of an implementation manner for buffering each group of messages to be synchronized with the same time stamp in the same storage queue according to an embodiment of the present invention. As shown in FIG. 5, in S202, the following steps may be included:
  • the same moment is the moment when the message synchronization module obtains the message with the smallest frequency among the messages to be synchronized.
  • S502 Buffer the message to be synchronized obtained at the same time in the currently determined storage queue.
  • each group of messages to be synchronized with the same timestamp is cached in the same storage queue, which reduces the consumption speed of system memory space, and can obtain messages at the same time faster.
  • the message synchronization method of the example is more flexible and saves memory space.
  • the synchronization mechanism provided by the existing automation system only allows the user to specify the messages that need to be synchronized during initialization, and then the message synchronization module collects all the messages with the same time stamp and then calls the callback function registered by the user. In this scheme, the callback is executed every time The functions are all the same several channels of messages. If the sensor's message is lost or delayed, it will cause the frequency of the user's callback function to decrease and processing delay. The redundant design of the sensor hardware cannot play a complementary role. The real-time nature of the information synchronization module It cannot be guaranteed.
  • the embodiment of the present invention also provides a query callback (query_callback) for the requesting device to query the current buffer If there is a storage queue for messages to be synchronized; the requesting device returns the relevant information of the storage queue that meets the demand to the message synchronization module; then, the message synchronization module processes the corresponding messages in the storage queue selected by the requesting device and calls the pre- Set the processing callback (process_callback).
  • query_callback a query callback for the requesting device to query the current buffer If there is a storage queue for messages to be synchronized; the requesting device returns the relevant information of the storage queue that meets the demand to the message synchronization module; then, the message synchronization module processes the corresponding messages in the storage queue selected by the requesting device and calls the pre- Set the processing callback (process_callback).
  • the requesting device can freely select the message in the message synchronization module for processing, and adopts the two callback method, which reduces the maintenance cost of the storage queue, and at the same time can give full play to the reliability of the sensor redundancy design.
  • Figure 6 shows The specific implementation process of the above implementation.
  • the message synchronization method may further include the following steps:
  • This step is the implementation process of the query callback provided by the message synchronization module for the requesting device.
  • the first queue information of the storage queue currently buffering the message to be synchronized is returned to the requesting device, and the requesting device is provided for querying the current certain An interface that stores whether there are certain types of messages in the queue.
  • the first queue information is related information used to characterize the storage queue of the message to be synchronized currently buffered.
  • the first queue information includes at least: the identity of the storage queue currently buffering the message to be synchronized, that is, the identity ID.
  • the storage queues currently buffering messages to be synchronized include storage queue 0, storage queue 1, storage queue 2, and storage queue 3.
  • the message synchronization module detects that the message synchronization module meets the preset trigger strategy, it will The identity IDs of storage queue 0, storage queue 1, storage queue 2, and storage queue 3 are sent to the requesting device.
  • the first queue information may also include at least one of the following: the total number of storage queues currently buffering messages to be synchronized; the number of messages buffered in the storage queues for each buffering message to be synchronized; each buffer waiting The latency of the storage queue of synchronized messages.
  • the requesting device can select the storage queue to be processed according to the first queue information, and the message processing strategy is more flexible. It can be understood that the content contained in the first queue information is not limited to the content listed in the foregoing embodiment, and may also contain other information used to characterize the storage queue that currently buffers messages to be synchronized.
  • the message synchronization module can be triggered to execute query_callback according to the message type or timer mode, that is, it is judged whether the message synchronization module meets the preset trigger strategy according to the message type or timer mode.
  • the message synchronization module determines that the message synchronization module obtains a specific type of message, it determines that the message synchronization module satisfies a preset trigger strategy, for example, when the message synchronization module obtains the message at the same time
  • the message synchronization module is triggered to execute query_callback.
  • the request device designates the message synchronization module to execute query_callback at a preset time interval. Specifically, the message synchronization module determines that the time interval from the current time to the time when the message synchronization module meets the preset trigger strategy is At the preset time interval, it is determined that the message synchronization module meets the preset trigger strategy.
  • the preset time interval can be set according to the actual needs of the requesting device, such as 10ms, 20ms, etc.
  • the message synchronization method may further include: sorting the storage queues currently buffering the messages to be synchronized according to the sequence of the time stamps of the respective buffering messages in the storage queues currently buffering the messages to be synchronized, so as to facilitate The storage queue executes process_callback in the order in which messages are stored.
  • process_callback in the order in which messages are stored.
  • the sequence of the timestamps of the respective buffered messages of the storage queues currently buffering the messages to be synchronized is: the timestamp of the buffered messages of the storage queue 3 -> the timestamp of the buffered messages of the storage queue 2 -> storage Queue 1 buffer message timestamp -> storage queue 0 buffer message timestamp, after sorting, the order of the storage queue is: storage queue 0-> storage queue 1-> storage queue 2-> storage queue 3, that is, storage queue 0 is at the top and storage queue 3 is at the bottom.
  • S602 Receive the second queue information of the to-be-processed storage queue in the storage queue that currently buffers the message to be synchronized returned by the requesting device;
  • This step is an implementation process in which the requesting device returns the relevant information of the storage queue that meets the demand to the message synchronization module.
  • the second queue information is related information used to characterize the storage queue to be processed.
  • the content of the second queue information and the first queue information may be the same or different.
  • the second queue information includes: the identity of the storage queue to be processed.
  • the second queue information may further include: a processing strategy, and the processing strategy may include: a message type and a corresponding processing mode of the message to be processed in the storage queue.
  • S603 Process the corresponding storage queue according to the second queue information and the preset processing strategy.
  • This step is the implementation process of the processing callback provided by the message synchronization module for the requesting device.
  • the corresponding storage queue may include one or more.
  • step S603 may include: processing the corresponding storage queue according to a preset processing strategy.
  • step S603 can be further selected according to the delay situation of the corresponding storage queue. If the corresponding storage queue delay is relatively serious, the time stamp of the messages in the multiple storage queues The storage queue with the earlier timestamp from the current time may be of little significance and poor timeliness, so you can choose to process the storage queue with the closest timestamp among the timestamps of the messages in multiple storage queues; if If the corresponding storage queue has no delay or the delay is small, the corresponding storage queue can be processed in sequence according to the sequence of the timestamps of the messages of the multiple storage queues.
  • the corresponding storage queue when the corresponding storage queue includes multiple storage queues, if the delay duration of the corresponding storage queue is greater than the preset duration, the time stamp of the messages in the multiple storage queues is closest to the current time In some embodiments, when the corresponding storage queue includes multiple storage queues, if the delay duration of the corresponding storage queue is less than or equal to the preset duration, the timestamps of the messages in the multiple storage queues The corresponding storage queues are processed in sequence, that is, the timestamps of the messages of the multiple storage queues are processed sequentially in the order of the farthest and the most recent.
  • the processing strategy includes: the message type of the message to be processed in the corresponding storage queue and the corresponding processing mode. It can be understood that the processing strategy may also include other content.
  • the processing method may include copying and/or deleting the message.
  • the corresponding message is copied according to the message type of the message to be processed in the corresponding storage queue; in some embodiments , Delete the corresponding message according to the message type of the message to be processed in the corresponding storage queue; in some embodiments, according to the message type of the message to be processed in the corresponding storage queue, the corresponding storage queue Part of the message in is copied and the other part is deleted.
  • the processing method can include other methods, and is not limited to message copy and deletion.
  • the trigger strategy and/or processing strategy are also registered on the message synchronization module by the requesting device.
  • the message synchronization method may further include:
  • the requesting device when it registers on the message synchronization module, it informs the message synchronization module to execute the trigger strategy of query_callback and/or the processing strategy adopted by process_callback.
  • the message synchronization module determines the message synchronization module When the trigger strategy set during registration is met, query_callback is executed, and the processing strategy set during registration is used to process messages of the corresponding message type in the to-be-processed storage queue selected by the requesting device according to the content returned by query_callback.
  • the requesting device can also choose to notify the message synchronization module to execute the query_callback trigger strategy and/or the processing strategy adopted by the process_callback at other times, and is not limited to informing the message synchronization module to execute the query_callback trigger strategy and/or the processing strategy adopted by the process_callback during registration.
  • the message synchronization method may further include: In the storage queue where the message to be synchronized is cached, the message cached in the storage queue whose time stamp is before the time stamp of the currently processed storage queue cache message is deleted.
  • the embodiment of the present invention also provides a message synchronization device, which is applied in an automation system, and the method in which the message synchronization device achieves message synchronization is similar to that of the message synchronization module of the foregoing embodiment.
  • the message synchronization device in the embodiment of the present invention includes a first storage device and a first processor.
  • the first storage device is used to store program instructions; one or more first processors call the program instructions stored in the first storage device, and when the program instructions are executed, the one or more first processors individually Or are configured to: determine at least one group of messages to be synchronized, the messages to be synchronized include messages output by at least two sensors with different types and/or messages output by at least two sensors with different installation positions; Each group of stamped messages to be synchronized is buffered in the same storage queue.
  • the first processor may implement the message synchronization method in the embodiments shown in FIG. 2 and FIG. 4 to FIG. 6 of the present invention.
  • the message synchronization apparatus in this embodiment can be described with reference to the message synchronization method in the foregoing embodiment.
  • the unmanned driving system may include a sensor, a second storage device, and a second processor.
  • the sensors include multiple sensors, which have different types and/or different installation positions.
  • the sensors may include sensors of different types but all capable of achieving the same function, such as IMU, camera, and radar; Including sensors of the same type but different installation positions, such as radars installed on the left and right sides of the fuselage of the unmanned driving system.
  • the second storage device is used to store program instructions; one or more second processors call and store the program instructions stored in the second storage device.
  • the one or more second processors individually or Are collectively configured to: determine at least one group of messages to be synchronized, the messages to be synchronized include messages output by at least two sensors of different types and/or messages output by at least two sensors with different installation positions; Each group of messages to be synchronized is cached in the same storage queue.
  • the second processor can implement the message synchronization method according to the embodiments shown in FIG. 2 and FIG. 4 to FIG. 6 of the present invention.
  • the unmanned driving system in this embodiment can be described with reference to the message synchronization method in the above embodiment.
  • the message synchronization module or the message synchronization device of the foregoing embodiment may be a module in an unmanned driving system.
  • the present invention also provides a movable platform. See FIG. 9.
  • the movable platform may include a body, a power system, a sensor, a third storage device, and a third processor.
  • the power system is installed on the fuselage to provide power for the movable platform.
  • the sensors include multiple sensors, which have different types and/or different installation positions.
  • the sensors can include sensors of different types but all can be used to achieve the same function.
  • the sensors can also include sensors of the same type but different installation positions;
  • a plurality of sensors are arranged in the fuselage; optionally, a part of the plurality of sensors is arranged in the fuselage, and another part is arranged on the fuselage.
  • the third storage device is used to store program instructions; one or more third processors call the program instructions stored in the third storage device.
  • the one or more third processors individually or collectively
  • the ground is configured to: determine at least one group of messages to be synchronized, the messages to be synchronized include messages output by at least two sensors with different types and/or messages output by at least two sensors with different installation positions; Each group of messages to be synchronized is cached in the same storage queue.
  • the third processor may implement the message synchronization method of the embodiment shown in FIG. 2 and FIG. 4 to FIG. 6 of the present invention.
  • the movable platform of this embodiment can be described with reference to the message synchronization method in the foregoing embodiment.
  • the message synchronization module or the message synchronization device of the foregoing embodiment may be a module in a movable platform.
  • the movable platform can be at least one of a car, an unmanned aerial vehicle, a remote control vehicle, an unmanned boat, or a robot.
  • the movable platform is not limited to the several types of movable platforms listed above, and can also be other types. Type of movable platform.
  • the aforementioned storage device may include volatile memory, such as random-access memory (RAM); the storage device may also include non-volatile memory, such as flash memory ( flash memory, hard disk drive (HDD) or solid-state drive (SSD); the storage device 110 may also include a combination of the foregoing types of memory.
  • volatile memory such as random-access memory (RAM)
  • non-volatile memory such as flash memory ( flash memory, hard disk drive (HDD) or solid-state drive (SSD)
  • SSD solid-state drive
  • the storage device 110 may also include a combination of the foregoing types of memory.
  • the processor may be a central processing unit (CPU).
  • the processor can also be other general-purpose processors, digital signal processors (Digital Signal Processor, DSP), application-specific integrated circuit (ASIC), field-programmable gate array (FPGA) ) Or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc.
  • DSP Digital Signal Processor
  • ASIC application-specific integrated circuit
  • FPGA field-programmable gate array
  • the general-purpose processor may be a microprocessor or the processor 7 may also be any conventional processor or the like.
  • an embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the message synchronization method of the above-mentioned embodiment are implemented. Specifically, when the program is executed by the processor, the following steps are implemented: determine at least one group of messages to be synchronized, the messages to be synchronized include messages output by at least two sensors of different types and/or output of at least two sensors with different installation positions Message; cache each group of messages to be synchronized with the same timestamp in the same storage queue.
  • the computer-readable storage medium may be the internal storage unit of the pan/tilt head described in any of the foregoing embodiments, such as a hard disk or a memory.
  • the computer-readable storage medium may also be an external storage device of the pan-tilt, such as a plug-in hard disk, a smart media card (SMC), an SD card, a flash card (Flash Card), etc. equipped on the device .
  • the computer-readable storage medium may also include both an internal storage unit of the pan-tilt and an external storage device.
  • the computer-readable storage medium is used to store the computer program and other programs and data required by the pan/tilt, and can also be used to temporarily store data that has been output or will be output.
  • the program can be stored in a computer readable storage medium. During execution, it may include the procedures of the above-mentioned method embodiments.
  • the storage medium may be a magnetic disk, an optical disc, a read-only memory (Read-Only Memory, ROM), or a random access memory (Random Access Memory, RAM), etc.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Hardware Redundancy (AREA)

Abstract

一种消息同步方法和装置、无人驾驶系统以及可移动平台,其中,消息同步方法包括:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息(S201);将相同时间戳的每组所述待同步的消息缓存在同一存储队列中(S202)。通过将相同时间戳的每组待同步的消息缓存在同一存储队列中,降低了系统内存空间的消耗速度,同时能够更快地获取同一时刻的消息。

Description

消息同步方法和装置、无人驾驶系统以及可移动平台 技术领域
本发明涉及消息发布订阅领域,尤其涉及一种消息同步方法和装置、无人驾驶系统以及可移动平台。
背景技术
在自动化系统中,传感器种类多种多样,数量、位置差别较大,在一些时候,需要对不同类型的传感器、或者不同位置的传感器的消息进行融合,通常需要对不同传感器在同一时刻采集的消息进行融合。
相关技术中,消息同步模块将同一传感器采集的消息存储在同一存储队列中,再根据外部所需的待同步的消息,从各存储队列中获取对应传感器在同一时刻采集的消息进行融合。如图1所示,消息同步模块将消息A、B、C、D分别存储在存储队列0、存储队列1、存储队列2、存储队列3中,若外部需要对消息A和消息D进行融合,消息同步模块会获取200ms时,存储队列0存储的消息A和存储队列3存储的消息D。
上述现有的同步机制,针对每个类型的消息建立存储队列,而通常不同的传感器的输出频率会存在差异,比如,需要对输出频率分别为20Hz与400Hz的传感器消息做同步,同步的结果只有20Hz的传感器消息,而400Hz的传感器消息大部分是不需要缓存的,上述存储方式会导致内存空间的浪费。
发明内容
本发明提供一种消息同步方法和装置、无人驾驶系统以及可移动平台。
具体地,本发明是通过如下技术方案实现的:
根据本发明的第一方面,提供一种消息同步方法,用于自动化系统中的消息同步模块,所述自动化系统具有多个传感器,多个所述传感器的类型不同和/或安装位置不同,所述方法包括:
确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
根据本发明的第二方面,提供一种消息同步装置,所述消息同步装置应用在自动化系统中,所述自动化系统具有多个传感器,多个所述传感器的类型不同和/或安装位置不同,所述消息同步装置包括:
存储装置,用于存储程序指令;
一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于:
确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
根据本发明的第三方面,提供一种无人驾驶系统,包括:
多个传感器,多个所述传感器的类型不同和/或安装位置不同;
存储装置,用于存储程序指令;
一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于:
确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
根据本发明的第四方面,提供一种可移动平台,包括:
机身;
动力系统,安装在所述机身,用于为所述可移动平台提供动力;
多个传感器,设于所述机身内,多个所述传感器的类型不同和/或安装位置不同;
存储装置,用于存储程序指令;以及
一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于:
确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
根据本发明的第五方面,提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时用于:
确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
由以上本发明实施例提供的技术方案可见,本发明将相同时间戳的每组待同步的消息缓存在同一存储队列中,降低了系统内存空间的消耗速度,同时能够更快地获取 同一时刻的消息。
附图说明
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是相关技术中的消息缓存方式的示意图;
图2是本发明一实施例中的消息同步方法的方法流程图;
图3是本发明一实施例中的消息缓存方式的示意图;
图4是本发明一实施例中的消息同步方法的一种具体方法流程图;
图5是本发明一实施例中的一种将相同时间戳的每组待同步的消息缓存在同一存储队列中的实现方式流程图;
图6是本发明一实施例中的消息同步方法的另一种具体方法流程图;
图7是本发明一实施例中的消息同步装置的结构框图;
图8是本发明一实施例中的无人驾驶系统的结构框图;
图9是本发明一实施例中的可移动平台的结构框图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
在不冲突的情况下,下述的实施例及实施方式中的特征可以相互组合。
本发明实施例提供一种消息同步方法,该方法用于自动化系统中的消息同步模块,其中,自动化系统具有多个传感器,多个所述传感器的类型不同和/或安装位置不同。该自动化系统可以为但不限于无人驾驶系统、汽车、无人飞行器、遥控车、无人船或机器人等可移动平台,也可以为为固定平台。以自动化系统为无人驾驶系统为例,无人驾驶系统可以包括IMU、摄像头和雷达,可以通过IMU、摄像头和雷达中的任一个或至少两个的组合来测量该无人驾驶系统的运动信息,在一些情况下,对IMU、摄像头和雷达中至少两个在同一时刻输出的消息进行融合,以获得更加精确的运动信息。无人驾驶系统可以包括多个雷达,多个雷达安装位置不同,如可以安装在车身左侧和右侧,可以对车身左侧和右侧的雷达在同一时刻输出的消息进行融合,检测车身周围 障碍物情况。在一个具体的场景下,还可以是不同种类的多个雷达安装在车身的不同位置,例如在车身前侧安装两个激光雷达,在车身顶部安装一个毫米波雷达,此时上述三个雷达可以同时采集信号,并将同一时刻输出的消息进行融合。
如图2所示,所述消息同步方法包括可以包括如下步骤:
S201:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
如在无人驾驶系统中,待同步的消息为一组,可选地,该组待同步的消息包括IMU、摄像头和雷达输出的消息中的至少两个;可选地,该组待同步的消息包括车身左侧和右侧的雷达输出的消息。可以理解,在无人驾驶系统中,待同步的消息可以为两组,如上述两组待同步的消息的组合;当然,待同步的消息还可以为两组以上。
不同的传感器在采集数据时存在不同程度的延迟和丢帧,随着传感器数量的增加,导致每一个时刻同步上所有传感器的消息是非常困难的,又因为不同的传感器所采集的消息存在冗余,请求设备有时需要个别传感器的消息就能输出稳定的结果。
待同步的消息可以为请求设备根据自身需要同步的消息向消息同步模块请求确定,请求设备与消息同步模块能够进行通信。其中,请求设备可以为自动化系统中的一个模块,也可以为外部设备。
在某些实施例中,请求设备在消息同步模块上注册待同步的消息,消息同步模块确定至少一组待同步的消息的过程包括如下两个步骤:
(1)接收请求待同步的消息的请求设备的发送的注册消息;
注册消息携带有至少一组待同步的消息的消息类型,如请求设备需要同步消息A、消息C以及消息D,则请求设备会将消息A、消息C以及消息D的消息类型携带在发送至消息同步模块的注册消息中。可以理解,注册消息不仅可以携带至少一组待同步的消息的消息类型,还可以携带其他信息。
(2)对注册消息进行解析,获得至少一组待同步的消息中每一消息的消息类型。
本实施例的自动化系统初次启动时,请求设备在消息同步模块上进行注册。本实施例中,请求设备在消息同步模块上进行注册时,告知消息同步模块其所需要同步的消息,后续自动化系统工作过程中,无需请求设备触发,消息同步模块会自动将相同时间戳的每组待同步的消息缓存在同一存储队列中,基于该方式,消息同步更加及时,同时减少了请求设备与消息同步模块之间的数据传输量。可选的,时间戳以消息同步模块的时钟系统为时间基准。
在某些实施例中,请求设备在需要消息同步模块进行待同步的消息的同步时,发送触发信号至消息同步模块,该触发信号携带有待同步的消息中每一消息的消息类型;消息同步模块在接收到请求设备发送的触发信号后,获取触发信号中的每组待同步的 消息中每一消息的消息类型,再进行待同步的消息的同步过程,即将相同时间戳的每组待同步的消息缓存在同一存储队列中。
S202:将相同时间戳的每组待同步的消息缓存在同一存储队列中。
在一具体实施例中,待同步的消息包括以下几组:(1)消息A、消息B、消息C、消息D和消息E;(2)消息A、消息B、消息C和消息D;(3)消息A、消息C和消息D;(4)消息C和消息D。
如图3所示,消息同步模块在50ms采集到消息A、消息B、消息C、消息D和消息E,并将50ms采集到的消息A、消息B、消息C、消息D和消息E缓存在存储队列3中;消息同步模块在100ms采集到消息A、消息B、消息C和消息D,并将100ms采集到的消息A、消息B、消息C和消息D缓存在存储队列2中;消息同步模块在150ms采集到消息A、消息C和消息D,并将150ms采集到的消息A、消息C和消息D缓存在存储队列1中;消息同步模块在200ms采集到消息C和消息D,并将200ms采集到的消息C和消息D缓存在存储队列0中。
本实施例中,时间戳的数值越大,该时间戳对应的采集时刻越晚,如时间戳为50ms对应的采集时刻早于时间戳为100ms对应的采集时刻,时间戳为100ms对应的采集时刻早于时间戳为150ms对应的采集时刻,以此类推。
进一步的,参见图4,消息同步模块在执行步骤S201之后,执行步骤S202之前,还包括如下步骤:
S401:获取待同步的消息对应的传感器中,每一传感器输出消息的频率;
不同类型的传感器由于性能不同,输出消息的频率也会不同,例如,在无人驾驶系统中,IMU输出消息的频率通常高于摄像头输出的消息的频率,可选的,IMU输出消息的频率为100Hz,摄像头输出消息的频率为20Hz。
S402:根据待同步的消息中频率最小的消息,确定存储队列个数。
根据待同步的消息中频率最小的消息,确定存储队列个数的实现方式可包括但不限于如下两种:
(1)当获得待同步的消息中频率最小的消息时,建立新的存储队列。
(2)当获得待同步的消息中频率最小的消息时,从预先建立的存储队列中获得未存储消息的存储队列。
本实施例中,预先建立的存储队列能够循环使用,在对存储队列中的消息进行处理后或当存储队列中的消息的时间戳早于预设时间戳时,可将该存储队列中的消息进行清除,从而确保该存储队列循环使用。
在无人驾驶系统中,需要将IMU输出消息和摄像头输出的消息进行同步。每次同 步时,消息同步模块在获得摄像头输出的消息时,建立新的存储队列或从预先建立的存储队列中获得未存储消息的存储队列,再将当前获得的摄像头的消息以及同一时刻(即获得摄像头的消息的时刻)获得的IMU的消息存储在上述存储队列中。
图5为本发明实施例提供的一种将相同时间戳的每组待同步的消息缓存在同一存储队列中的实现方式流程图,如图5所示,在S202时,可以包括如下步骤:
S501:当获得待同步的消息中频率最小的消息时,获取同一时刻待同步的消息中的其他消息;
该步骤中,同一时刻即为消息同步模块获得待同步的消息中频率最小的消息的时刻。
S502:将同一时刻获得的待同步的消息缓存在当前确定的存储队列中。
至此,消息同步模块完成了待同步的消息的同步过程。本发明实施例的消息同步方法,将相同时间戳的每组待同步的消息缓存在同一存储队列中,降低了系统内存空间的消耗速度,同时能够更快地获取同一时刻的消息,本发明实施例的消息同步方法更加灵活且节省内存空间。
现有自动化系统提供的同步机制,仅允许用户在初始化时指定需要同步的消息,然后息同步模块收集齐相同时间戳的消息后调用用户注册的回调函数,在这种方案下,每次执行回调函数都是相同的几路消息,如果传感器的消息丢失或者延迟、会造成用户回调函数的频率下降和处理延迟,传感器硬件的冗余设计不能很好的发挥互补的作用,息同步模块的实时性不能得到保证。
针对链路中数量众多的传感器消息,本发明实施例在将相同时间戳的每组待同步的消息缓存在同一存储队列中之后,还为请求设备提供查询回调(query_callback),用于查询当前缓存有待同步的消息的存储队列的情况;再由请求设备将满足需求的存储队列的相关信息返回给消息同步模块;然后,消息同步模块将请求设备选择的存储队列中的相应消息进行处理,调用预设的处理回调(process_callback)。基于上述实现方式,请求设备可以自由选择消息同步模块中的消息进行处理,并且,采用两次回调的方式,降低了存储队列维护成本,同时能够充分发挥传感器冗余设计的可靠性,图6为上述实现方式的具体实现过程。
如图6所示,在将相同时间戳的每组待同步的消息缓存在同一存储队列中之后,所述消息同步方法还可以包括如下步骤:
S601:若检测到消息同步模块满足预设的触发策略,则发送当前缓存有待同步的消息的存储队列的第一队列信息至请求待同步的消息的请求设备;
该步骤即为消息同步模块为请求设备提供的查询回调的实现过程,通过该步骤,将当前缓存有待同步的消息的存储队列的第一队列信息返回给请求设备,为请求设备 提供了查询当前某一个存储队列中是否有某种类型消息的接口。其中,第一队列信息即为用于表征当前缓存有待同步的消息的存储队列的相关信息。
在某些实施例中,第一队列信息至少包括:当前缓存有待同步的消息的存储队列的身份标识,即身份ID。如图3所示,当前缓存有待同步的消息的存储队列包括存储队列0、存储队列1、存储队列2和存储队列3,消息同步模块在检测到消息同步模块满足预设的触发策略时,将存储队列0、存储队列1、存储队列2和存储队列3的身份ID发送至请求设备。
进一步可选的,第一队列信息还可以包括如下至少一个:当前缓存有待同步的消息的存储队列的总数;每个缓存有待同步的消息的存储队列中缓存的消息的个数;每个缓存有待同步的消息的存储队列的延迟情况。请求设备可以根据第一队列信息,选择待处理的存储队列,消息处理策略更加灵活。可以理解,第一队列信息所包含的内容不限于上述实施例列举的内容,还可以包含其他用于表征当前缓存有待同步的消息的存储队列的信息。
可以按照消息类型或者定时器方式触发消息同步模块执行query_callback,也即,按照消息类型或者定时器方式来判断消息同步模块是否满足预设的触发策略。可选的,在某些实施例中,消息同步模块在确定该消息同步模块获取到特定类型的消息时,确定该消息同步模块满足预设的触发策略,比如,当消息同步模块在同一时刻获取到消息C和消息D,则触发消息同步模块执行query_callback。
在某些实施例中,请求设备指定消息同步模块按照预设时间间隔执行query_callback,具体的,消息同步模块在确定当前至上一次检测到该消息同步模块满足预设的触发策略的时刻的时间间隔为预设时间间隔时,确定该消息同步模块满足预设的触发策略。预设时间间隔可根据请求设备的实际需求设定,如10ms、20ms等等。
另外,在某些实施例中,在将相同时间戳的每组待同步的消息缓存在同一存储队列中之后,发送当前缓存有待同步的消息的存储队列的第一队列信息至请求待同步的消息的请求设备之前,所述消息同步方法还可以包括:按照当前缓存有待同步的消息的存储队列各自缓存消息的时间戳的先后顺序,对当前缓存有待同步的消息的存储队列进行排序,从而方便根据存储队列存储消息的时间先后顺序执行process_callback。在图3所示实施例中,当前缓存有待同步的消息的存储队列各自缓存消息的时间戳的先后顺序为:存储队列3缓存消息的时间戳->存储队列2缓存消息的时间戳->存储队列1缓存消息的时间戳->存储队列0缓存消息的时间戳,在排序后,存储队列的顺序为:存储队列0->存储队列1->存储队列2->存储队列3,即存储队列0位于最上方,存储队列3位于最下方。
S602:接收请求设备返回的当前缓存有待同步的消息的存储队列中待处理的存储队列的第二队列信息;
该步骤即为请求设备将满足需求的存储队列的相关信息返回给消息同步模块的实现过程。其中,第二队列信息即为用于表征待处理的存储队列的相关信息。第二队列信息与第一队列信息的内容可以相同,也可以不相同。
可选的,第二队列信息包括:待处理的存储队列的身份标识。进一步的,在某些实施例中,第二队列信息还可以包括:处理策略,该处理策略可以包括:存储队列中待处理的消息的消息类型和对应的处理方式。
S603:根据第二队列信息以及预设的处理策略,对对应的存储队列进行处理。
该步骤即为消息同步模块为请求设备提供的处理回调的实现过程。
在步骤S603中,对应的存储队列可以包括一个或多个。
当对应的存储队列为一个时,步骤S603的实现过程可以包括:根据预设的处理策略,对该对应的存储队列进行处理。
当对应的存储队列包括多个时,可以根据对应的存储队列的延时情况进一步选择步骤S603的实现方式,若对应的存储队列延时较为严重,则对多个存储队列的消息的时间戳中距离当前较早的时间戳的存储队列进行处理的意义可能不大且及时性较差,故可以选择对多个存储队列的消息的时间戳中距离当前最近的时间戳的存储队列进行处理;若对应的存储队列不存在延时或者延时较小,则可按照多个存储队列的消息的时间戳的先后顺序依次对对应的存储队列进行处理。具体的,在某些实施例中,当对应的存储队列包括多个时,若对应的存储队列的延迟时长大于预设时长,则对多个存储队列的消息的时间戳中距离当前最近的时间戳的存储队列进行处理;在某些实施例中,当对应的存储队列包括多个时,若对应的存储队列的延迟时长小于或等于预设时长,则按照多个存储队列的消息的时间戳的先后顺序依次对对应的存储队列进行处理,即由多个存储队列的消息的时间戳由远及近的顺序依次对对应的存储队列进行处理。
本实施例中,处理策略包括:对应的存储队列中待处理的消息的消息类型和对应的处理方式。可以理解,处理策略还可以包括其他内容。其中,处理方式可以包括对消息进行复制和/或删除,例如,在某些实施例中,根据对应的存储队列中待处理的消息的消息类型,对对应的消息进行复制;在某些实施例中,根据对应的存储队列中待处理的消息的消息类型,对对应的消息进行删除;在某些实施例中,根据对应的存储队列中待处理的消息的消息类型,对该对应的存储队列中的部分消息进行复制、另一部分消息进行删除。当然,处理方式可以包括其他方式,不限于消息复制和删除。
可选的,触发策略和/或处理策略也由请求设备在消息同步模块上注册,具体的,在检测到消息同步模块满足预设的触发策略之前,所述消息同步方法还可以包括:
(1)接收请求设备的发送的注册消息;
(2)对注册消息进行解析,获得触发策略和/或处理策略。
本实施例中,请求设备在消息同步模块上进行注册时,告知消息同步模块执行query_callback的触发策略和/或process_callback采用的处理策略,后续自动化系统工作过程中,消息同步模块在确定该消息同步模块满足注册时设定的触发策略时,即执行query_callback,并采用注册时设定的处理策略对请求设备根据query_callback返回的内容选择的待处理的存储队列中的对应消息类型的消息进行处理。
当然,请求设备还可以选择其他时刻告知消息同步模块执行query_callback的触发策略和/或process_callback采用的处理策略,不限于在注册时告知消息同步模块执行query_callback的触发策略和/或process_callback采用的处理策略。
在某些实施例中,为确保预先建立的存储队列循环可用,在根据第二队列信息以及预设的处理策略,对对应的存储队列进行处理之后,所述消息同步方法还可以包括:对当前缓存有待同步的消息的存储队列中,缓存消息的时间戳在当前处理的存储队列缓存消息的时间戳之前的存储队列所缓存的消息进行删除处理。
对于上述实施例的方法,本发明实施例还提供一种消息同步装置,该消息同步装置应用在自动化系统中,该消息同步装置实现消息同步的方式与上述实施例的消息同步模块实现消息同步的方式相类似。如图7所示,本发明实施例的消息同步装置包括第一存储装置和第一处理器。
其中,第一存储装置,用于存储程序指令;一个或多个第一处理器,调用第一存储装置中存储的程序指令,当程序指令被执行时,一个或多个第一处理器单独地或共同地被配置用于:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;将相同时间戳的每组待同步的消息缓存在同一存储队列中。
第一处理器可以实现如本发明图2、图4-图6所示实施例的消息同步方法,可参见上述实施例的消息同步方法对本实施例的消息同步装置进行说明。
本发明实施例还提供一种无人驾驶系统,参见图8,所述无人驾驶系统可以包括传感器、第二存储装置和第二处理器。其中,传感器包括多个,多个传感器的类型不同和/或安装位置不同,例如,传感器可以包括多种类型不同但均可以用于实现同一功能的传感器,如IMU、摄像头和雷达;传感器还可以包括类型相同但安装位置不同的传感器,如安装在无人驾驶系统的机身左侧和右侧的雷达。
第二存储装置,用于存储程序指令;一个或多个第二处理器,调用存第二储装置中存储的程序指令,当程序指令被执行时,一个或多个第二处理器单独地或共同地被配置用于:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;将相同时间戳的每组待同步的消息缓存在同一存储队列中。
第二处理器可以实现如本发明图2、图4-图6所示实施例的消息同步方法,可参 见上述实施例的消息同步方法对本实施例的无人驾驶系统进行说明。
上述实施例的消息同步模块或消息同步装置可以为无人驾驶系统中的一个模块。
本发明还提供一种可移动平台,参见图9,该可移动平台可以包括机身、动力系统、传感器、第三存储装置和第三处理器。其中,动力系统安装在机身,用于为可移动平台提供动力。传感器包括多个,多个传感器的类型不同和/或安装位置不同,传感器可以包括多种类型不同但均可以用于实现同一功能的传感器,传感器还可以包括类型相同但安装位置不同的传感器;可选的,多个传感器设于机身内;可选的,多个传感器中的一部分设于机身内,另一部分设于机身上。
第三存储装置,用于存储程序指令;一个或多个第三处理器,调用第三存储装置中存储的程序指令,当程序指令被执行时,一个或多个第三处理器单独地或共同地被配置用于:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;将相同时间戳的每组待同步的消息缓存在同一存储队列中。
第三处理器可以实现如本发明图2、图4-图6所示实施例的消息同步方法,可参见上述实施例的消息同步方法对本实施例的可移动平台进行说明。
上述实施例的消息同步模块或消息同步装置可以为可移动平台中的一个模块。
所述可移动平台可以为汽车、无人飞行器、遥控车、无人船或机器人中的至少一种,当然,可移动平台并不限于上述列举的几种类型的可移动平台,也可为其他类型的可移动平台。
上述存储装置可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储装置也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),硬盘(hard disk drive,HDD)或固态硬盘(solid-state drive,SSD);存储装置110还可以包括上述种类的存储器的组合。
应当理解,本发明实施例中,处理器可以是中央处理器(central processing unit,CPU)。该处理器还可以是其它通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(application-specific integrated circuit,ASIC)、现场可编程逻辑门阵列(field-programmable gate array,FPGA)或者其它可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器7也可以是任何常规的处理器等。
此外,本发明实施例还提供一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现上述实施例的消息同步方法的步骤。具体的,该程序被处理器执行时实现如下步骤:确定至少一组待同步的消息,待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;将相 同时间戳的每组待同步的消息缓存在同一存储队列中。
所述计算机可读存储介质可以是前述任一实施例所述的云台的内部存储单元,例如硬盘或内存。所述计算机可读存储介质也可以是云台的外部存储设备,例如所述设备上配备的插接式硬盘、智能存储卡(Smart Media Card,SMC)、SD卡、闪存卡(Flash Card)等。进一步的,所述计算机可读存储介质还可以既包括云台的内部存储单元也包括外部存储设备。所述计算机可读存储介质用于存储所述计算机程序以及所述云台所需的其他程序和数据,还可以用于暂时地存储已经输出或者将要输出的数据。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于一计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本发明部分实施例而已,当然不能以此来限定本发明之权利范围,因此依本发明权利要求所作的等同变化,仍属本发明所涵盖的范围。

Claims (38)

  1. 一种消息同步方法,用于自动化系统中的消息同步模块,所述自动化系统具有多个传感器,多个所述传感器的类型不同和/或安装位置不同,其特征在于,所述方法包括:
    确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
    将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
  2. 根据权利要求1所述的方法,其特征在于,所述确定至少一组待同步的消息,包括:
    接收请求所述待同步的消息的请求设备的发送的注册消息;
    对所述注册消息进行解析,获得至少一组所述待同步的消息中每一消息的消息类型。
  3. 根据权利要求1所述的方法,其特征在于,所述确定至少一组待同步的消息之后,将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之前,还包括:
    获取所述待同步的消息对应的传感器中,每一传感器输出消息的频率;
    根据所述待同步的消息中所述频率最小的消息,确定存储队列个数。
  4. 根据权利要求3所述的方法,其特征在于,所述根据所述待同步的消息中所述频率最小的消息,确定存储队列个数,包括:
    当获得所述待同步的消息中所述频率最小的消息时,建立新的存储队列或从预先建立的存储队列中获得未存储消息的存储队列。
  5. 根据权利要求3所述的方法,其特征在于,所述将相同时间戳的每组所述待同步的消息缓存在同一存储队列中,包括:
    当获得所述待同步的消息中所述频率最小的消息时,获取同一时刻所述待同步的消息中的其他消息;
    将同一时刻获得的所述待同步的消息缓存在当前确定的存储队列中。
  6. 根据权利要求1所述的方法,其特征在于,所述将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之后,还包括:
    若检测到所述消息同步模块满足预设的触发策略,则发送当前缓存有所述待同步的消息的存储队列的第一队列信息至请求所述待同步的消息的请求设备;
    接收所述请求设备返回的所述当前缓存有待同步的消息的存储队列中待处理的存储队列的第二队列信息;
    根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理。
  7. 根据权利要求6所述的方法,其特征在于,所述检测到所述消息同步模块满足预设的触发策略之前,还包括:
    接收所述请求设备的发送的注册消息;
    对所述注册消息进行解析,获得所述触发策略和/或所述处理策略。
  8. 根据权利要求6所述的方法,其特征在于,所述检测到所述消息同步模块满足预设的触发策略,包括:
    确定所述消息同步模块获取到特定类型的消息;或者
    当前至上一次检测到所述消息同步模块满足预设的触发策略的时刻的时间间隔为预设时间间隔。
  9. 根据权利要求6所述的方法,其特征在于,所述根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理,包括:
    当所述对应的存储队列包括多个时,若所述对应的存储队列的延迟时长大于预设时长,则对多个所述存储队列的消息的时间戳中距离当前最近的时间戳的存储队列进行处理。
  10. 根据权利要求6所述的方法,其特征在于,所述根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理,包括:
    当所述对应的存储队列包括多个时,若所述对应的存储队列的延迟时长小于或等于预设时长,则按照多个所述存储队列的消息的时间戳的先后顺序依次对所述对应的存储队列进行处理。
  11. 根据权利要求6或9或10所述的方法,其特征在于,所述处理策略包括:
    所述对应的存储队列中待处理的消息的消息类型和对应的处理方式。
  12. 根据权利要求11所述的方法,其特征在于,所述处理方式包括:
    根据所述对应的存储队列中待处理的消息的消息类型,对对应的消息进行复制;或者
    根据所述对应的存储队列中待处理的消息的消息类型,对对应的消息进行删除。
  13. 根据权利要求6所述的方法,其特征在于,所述第一队列信息至少包括:
    所述当前缓存有待同步的消息的存储队列的身份标识。
  14. 根据权利要求13所述的方法,其特征在于,所述第一队列信息还包括如下至少一个:
    所述当前缓存有待同步的消息的存储队列的总数;
    每个缓存有待同步的消息的存储队列中缓存的消息的个数;
    每个缓存有待同步的消息的存储队列的延迟情况。
  15. 根据权利要求6所述的方法,其特征在于,所述第二队列信息包括:
    所述待处理的存储队列的身份标识。
  16. 根据权利要求6所述的方法,其特征在于,所述根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理之后,还包括:
    对所述当前缓存有所述待同步的消息的存储队列中,缓存消息的时间戳在所述当前处理的存储队列缓存消息的时间戳之前的存储队列所缓存的消息进行删除处理。
  17. 根据权利要求6所述的方法,其特征在于,所述将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之后,发送当前缓存有所述待同步的消息的存储队 列的第一队列信息至请求所述待同步的消息的请求设备之前,还包括:
    按照所述当前缓存有待同步的消息的存储队列各自缓存消息的时间戳的先后顺序,对所述当前缓存有待同步的消息的存储队列进行排序。
  18. 一种消息同步装置,其特征在于,所述消息同步装置应用在自动化系统中,所述自动化系统具有多个传感器,多个所述传感器的类型不同和/或安装位置不同,所述消息同步装置包括:
    存储装置,用于存储程序指令;
    一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于:
    确定至少一组待同步的消息,所述待同步的消息包括类型不同的至少两个传感器输出的消息和/或安装位置不同的至少两个传感器输出的消息;
    将相同时间戳的每组所述待同步的消息缓存在同一存储队列中。
  19. 根据权利要求18所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于,包括:
    接收请求所述待同步的消息的请求设备的发送的注册消息;
    对所述注册消息进行解析,获得至少一组所述待同步的消息中每一消息的消息类型。
  20. 根据权利要求18所述的装置,其特征在于,所述一个或多个处理器单独地或共同地被配置用于确定至少一组待同步的消息之后,将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之前,还被配置用于:
    获取所述待同步的消息对应的传感器中,每一传感器输出消息的频率;
    根据所述待同步的消息中所述频率最小的消息,确定存储队列个数。
  21. 根据权利要求20所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于:
    当获得所述待同步的消息中所述频率最小的消息时,建立新的存储队列或从预先建立的存储队列中获得未存储消息的存储队列。
  22. 根据权利要求20所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于:
    当获得所述待同步的消息中所述频率最小的消息时,获取同一时刻所述待同步的消息中的其他消息;
    将同一时刻获得的所述待同步的消息缓存在当前确定的存储队列中。
  23. 根据权利要求18所述的装置,其特征在于,所述一个或多个处理器单独地或共同地被配置用于将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之后,还被配置用于:
    若检测到所述消息同步模块满足预设的触发策略,则发送当前缓存有所述待同步的消息的存储队列的第一队列信息至请求所述待同步的消息的请求设备;
    接收所述请求设备返回的所述当前缓存有待同步的消息的存储队列中待处理的存储队列的第二队列信息;
    根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理。
  24. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地被配置用于检测到所述消息同步模块满足预设的触发策略之前,还被配置用于:
    接收所述请求设备的发送的注册消息;
    对所述注册消息进行解析,获得所述触发策略和/或所述处理策略。
  25. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于:
    确定所述消息同步模块获取到特定类型的消息;或者
    当前至上一次检测到所述消息同步模块满足预设的触发策略的时刻的时间间隔为预设时间间隔。
  26. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于:
    当所述对应的存储队列包括多个时,若所述对应的存储队列的延迟时长大于预设时长,则对多个所述存储队列的消息的时间戳中距离当前最近的时间戳的存储队列进行处理。
  27. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地进一步被配置用于:
    当所述对应的存储队列包括多个时,若所述对应的存储队列的延迟时长小于或等于预设时长,则按照多个所述存储队列的消息的时间戳的先后顺序依次对所述对应的存储队列进行处理。
  28. 根据权利要求23或26或27所述的装置,其特征在于,所述处理策略包括:
    所述对应的存储队列中待处理的消息的消息类型和对应的处理方式。
  29. 根据权利要求28所述的装置,其特征在于,所述处理方式包括:
    根据所述对应的存储队列中待处理的消息的消息类型,对对应的消息进行复制;或者
    根据所述对应的存储队列中待处理的消息的消息类型,对对应的消息进行删除。
  30. 根据权利要求23所述的装置,其特征在于,所述第一队列信息至少包括:
    所述当前缓存有待同步的消息的存储队列的身份标识。
  31. 根据权利要求30所述的装置,其特征在于,所述第一队列信息还包括如下至少一个:
    所述当前缓存有待同步的消息的存储队列的总数;
    每个缓存有待同步的消息的存储队列中缓存的消息的个数;
    每个缓存有待同步的消息的存储队列的延迟情况。
  32. 根据权利要求23所述的装置,其特征在于,所述第二队列信息包括:
    所述待处理的存储队列的身份标识。
  33. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地被配置用于根据所述第二队列信息以及预设的处理策略,对对应的存储队列进行处理之后,还被配置用于:
    对所述当前缓存有所述待同步的消息的存储队列中,缓存消息的时间戳在所述当前处理的存储队列缓存消息的时间戳之前的存储队列所缓存的消息进行删除处理。
  34. 根据权利要求23所述的装置,其特征在于,所述一个或多个处理器单独地或共同地被配置用于将相同时间戳的每组所述待同步的消息缓存在同一存储队列中之后,发送当前缓存有所述待同步的消息的存储队列的第一队列信息至请求所述待同步的消息的请求设备之前,还被配置用于:
    按照所述当前缓存有待同步的消息的存储队列各自缓存消息的时间戳的先后顺序,对所述当前缓存有待同步的消息的存储队列进行排序。
  35. 一种无人驾驶系统,其特征在于,包括:
    多个传感器,多个所述传感器的类型不同和/或安装位置不同;
    存储装置,用于存储程序指令;
    一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于实施权利要求1-17之一所述的方法。
  36. 一种可移动平台,其特征在于,包括:
    机身;
    动力系统,安装在所述机身,用于为所述可移动平台提供动力;
    多个传感器,设于所述机身内,多个所述传感器的类型不同和/或安装位置不同;
    存储装置,用于存储程序指令;以及
    一个或多个处理器,调用所述存储装置中存储的程序指令,当所述程序指令被执行时,所述一个或多个处理器单独地或共同地被配置用于实施权利要求1-17之一所述的方法。
  37. 根据权利要求36所述的可移动平台,其特征在于,所述可移动平台为汽车、无人飞行器、遥控车、无人船或机器人中的至少一种。
  38. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,该程序被处理器执行时用于实施权利要求1-17之一所述的方法。
PCT/CN2019/094166 2019-07-01 2019-07-01 消息同步方法和装置、无人驾驶系统以及可移动平台 WO2021000216A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980011683.1A CN111712800A (zh) 2019-07-01 2019-07-01 消息同步方法和装置、无人驾驶系统以及可移动平台
PCT/CN2019/094166 WO2021000216A1 (zh) 2019-07-01 2019-07-01 消息同步方法和装置、无人驾驶系统以及可移动平台

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/094166 WO2021000216A1 (zh) 2019-07-01 2019-07-01 消息同步方法和装置、无人驾驶系统以及可移动平台

Publications (1)

Publication Number Publication Date
WO2021000216A1 true WO2021000216A1 (zh) 2021-01-07

Family

ID=72536767

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/094166 WO2021000216A1 (zh) 2019-07-01 2019-07-01 消息同步方法和装置、无人驾驶系统以及可移动平台

Country Status (2)

Country Link
CN (1) CN111712800A (zh)
WO (1) WO2021000216A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113626221B (zh) * 2021-08-10 2024-03-15 迈普通信技术股份有限公司 一种消息入队方法及装置
CN113965289B (zh) * 2021-10-29 2024-03-12 际络科技(上海)有限公司 基于多传感器数据的时间同步方法及装置
CN114064316B (zh) * 2021-11-16 2024-01-30 北京元客方舟科技有限公司 一种多路采集数据的同步方法及系统

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102857333A (zh) * 2011-06-28 2013-01-02 富士通株式会社 对来自传感器网络的数据包进行同步的装置和方法
US8428088B2 (en) * 2009-01-16 2013-04-23 Microsoft Corporation Synchronization of multiple data sources to a common time base
US9555883B1 (en) * 2015-06-25 2017-01-31 Amazon Technologies, Inc. Unmanned aerial vehicle sensor synchronization
CN106681846A (zh) * 2016-12-29 2017-05-17 北京奇虎科技有限公司 日志数据的统计方法、装置及系统
CN106707873A (zh) * 2017-01-16 2017-05-24 上海兆芯集成电路有限公司 传感集线器及应用处理器间的数据同步方法及其装置
WO2018103013A1 (en) * 2016-12-07 2018-06-14 SZ DJI Technology Co., Ltd. System and method for supporting synchronization in a movable platform

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109564560A (zh) * 2016-06-01 2019-04-02 北京易掌云峰科技有限公司 基于队列的消息同步

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8428088B2 (en) * 2009-01-16 2013-04-23 Microsoft Corporation Synchronization of multiple data sources to a common time base
CN102857333A (zh) * 2011-06-28 2013-01-02 富士通株式会社 对来自传感器网络的数据包进行同步的装置和方法
US9555883B1 (en) * 2015-06-25 2017-01-31 Amazon Technologies, Inc. Unmanned aerial vehicle sensor synchronization
WO2018103013A1 (en) * 2016-12-07 2018-06-14 SZ DJI Technology Co., Ltd. System and method for supporting synchronization in a movable platform
CN106681846A (zh) * 2016-12-29 2017-05-17 北京奇虎科技有限公司 日志数据的统计方法、装置及系统
CN106707873A (zh) * 2017-01-16 2017-05-24 上海兆芯集成电路有限公司 传感集线器及应用处理器间的数据同步方法及其装置

Also Published As

Publication number Publication date
CN111712800A (zh) 2020-09-25

Similar Documents

Publication Publication Date Title
WO2021000216A1 (zh) 消息同步方法和装置、无人驾驶系统以及可移动平台
CN109204324B (zh) 用于操作自动驾驶车辆的集中调度系统
JP6731201B2 (ja) 時間ベースのノード選出方法及び装置
US20180007429A1 (en) Intelligent processing method and system for video data
EP3627960A1 (en) Method, network side device, and terminal device for switching communication mode
EP3386152B1 (en) Method, device and system for realizing heartbeat mechanism
WO2020258901A1 (zh) 传感器数据处理方法、装置、电子设备及系统
CN110401843B (zh) 直播平台中的榜单数据更新方法、装置、设备和介质
WO2014166265A1 (en) Method, terminal, cache server and system for updating webpage data
EP3445019B1 (en) Vehicle-based communication method and system
WO2019057193A1 (zh) 数据删除方法及分布式存储系统
CN109388481B (zh) 一种事务信息的传输方法、系统、装置、计算设备和介质
US10681639B2 (en) Systems and methods for receiving sensor data from a mobile device
US20140310372A1 (en) Method, terminal, cache server and system for updating webpage data
WO2020143181A1 (zh) 数据存储方法、装置、计算机设备及存储介质
US10529080B2 (en) Automatic thoroughfare recognition and traffic counting
CN108063832B (zh) 一种云存储系统及其存储方法
CN110248156B (zh) 视频分析方法、平台设备、智能相机和智能监控系统
CN105528366A (zh) 一种数据同步控制方法和装置
WO2016095329A1 (zh) 一种日志记录系统及日志记录操作方法
CN111787256A (zh) 警前录像的管理方法、装置、介质及电子设备
US20230073566A1 (en) Intelligent telematics data synchronization
WO2019140644A1 (zh) 一种数据处理方法、装置、系统、可移动设备及存储介质
CN115169452A (zh) 基于时空同步队列特性雷视融合目标信息系统及方式方法
CN110674757B (zh) 布控方法、系统及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19936535

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19936535

Country of ref document: EP

Kind code of ref document: A1