A data synchronization method, device, data processing equipment and storage medium

By obtaining the time parameters of the device and establishing a mapping relationship, the problem of inaccurate data synchronization caused by different device clock sources is solved, and the accuracy of data synchronization and the quality of data analysis are improved.

CN114063703BActive Publication Date: 2024-08-23SHENZHEN ORBBEC CO LTD
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202111188273.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-12
Publication Date
2024-08-23
Estimated Expiration
2041-10-12

AI Technical Summary

Technical Problem

Different clock sources of different devices lead to inaccurate data synchronization, affecting the accuracy of data fusion and analysis.

Method used

By obtaining the data to be synchronized and its time parameters sent by multiple devices to be synchronized, a time parameter mapping relationship is established, and the data is synchronized based on this relationship to ensure that the data is aligned in time.

Benefits of technology

It improves the accuracy of data synchronization and enhances the quality of subsequent data fusion and analysis results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114063703B
    Figure CN114063703B
Patent Text Reader

Abstract

The present application is applicable to the field of data processing, and provides a data synchronization method, device, data processing equipment and storage medium. The above-mentioned data synchronization method specifically includes: obtaining the data to be synchronized sent by multiple devices to be synchronized, and obtaining the time parameter of each of the data to be synchronized; obtaining the time parameter mapping relationship between each of the data to be synchronized; based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized, data synchronization is performed on the data to be synchronized sent by the multiple devices to be synchronized. The embodiments of the present application can avoid the problem of inaccurate data synchronization caused by different clock sources of different devices.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing, and in particular to a data synchronization method, apparatus, data processing equipment and storage medium. Background Art

[0002] Data synchronization refers to the time alignment of data collected by different devices to facilitate data processing equipment to analyze data collected by different devices at the same time.

[0003] At present, data synchronization between multiple devices generally uses a device to send a synchronization signal to other devices, so that each device collects data at the same time. However, in actual applications, different devices often use their own clock sources, resulting in each device asynchronously collecting data, and the data cannot be accurately synchronized, resulting in reduced accuracy of data processing equipment during subsequent data fusion or data analysis. Summary of the invention

[0004] The embodiments of the present application provide a data synchronization method, apparatus, data processing device and storage medium, which can avoid the problem of inaccurate data synchronization caused by different clock sources of different devices.

[0005] A first aspect of an embodiment of the present application provides a data synchronization method, including:

[0006] Acquire the data to be synchronized respectively sent by a plurality of devices to be synchronized, and acquire the time parameter of each of the data to be synchronized;

[0007] Acquire a time parameter mapping relationship between each of the data to be synchronized;

[0008] Based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized, data synchronization is performed on the data to be synchronized respectively sent by the multiple devices to be synchronized.

[0009] A second aspect of an embodiment of the present application provides a data synchronization device, including:

[0010] A first acquisition unit, configured to acquire data to be synchronized respectively sent by a plurality of devices to be synchronized, and to acquire a time parameter of each of the data to be synchronized;

[0011] A second acquisition unit, used to acquire a time parameter mapping relationship between each of the data to be synchronized;

[0012] A data synchronization unit is used to synchronize the data to be synchronized respectively sent by the multiple devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized.

[0013] A third aspect of an embodiment of the present application provides a data processing device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0014] A fourth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0015] A fifth aspect of an embodiment of the present application provides a computer program product, which, when executed on a data processing device, enables the data processing device to implement the steps of the method.

[0016] In an implementation manner of the present application, by obtaining the data to be synchronized sent by multiple devices to be synchronized, the time parameters of each data to be synchronized, and the time parameter mapping relationship between each data to be synchronized, data synchronization is performed on the data to be synchronized sent by multiple devices to be synchronized based on the time parameter mapping relationship and the time parameters of each data to be synchronized. The time parameter mapping relationship can be used to align the data to be synchronized, avoiding the problem of inaccurate data synchronization caused by the different clock sources of different devices, so that the results of subsequent data fusion or data analysis are more accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0018] Figure 1 It is a schematic diagram of an implementation flow of a data synchronization method provided in an embodiment of the present application;

[0019] Figure 2 is a schematic diagram of interaction between a device to be synchronized and a data processing device provided in an embodiment of the present application;

[0020] Figure 3 This is a schematic diagram of a specific implementation process of obtaining the time parameters of each data to be synchronized provided in an embodiment of the present application;

[0021] Figure 4 is a structural diagram of a data synchronization device provided in an embodiment of the present application;

[0022] Figure 5 It is a structural diagram of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solutions and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work are protected by the present application.

[0024] Data synchronization refers to the time alignment of data collected by different devices to facilitate data processing equipment to analyze data collected by different devices at the same time.

[0025] At present, data synchronization between multiple devices generally uses a device to send a synchronization signal to other devices, so that each device collects data at the same time. However, in actual applications, different devices often use their own clock sources, resulting in each device asynchronously collecting data, and the data cannot be accurately synchronized, resulting in reduced accuracy of data processing equipment during subsequent data fusion or data analysis.

[0026] In order to illustrate the technical solution of the present application, a specific embodiment is provided below for illustration.

[0027] Figure 1 A schematic diagram of the implementation flow of a data synchronization method provided by an embodiment of the present application is shown, and the method can be applied to a data processing device, which can be a device for data fusion or data analysis, or any device for collecting data. The above method can be applied to situations where the accuracy of data synchronization needs to be improved.

[0028] Specifically, the above data synchronization method may include the following steps S101 to S103.

[0029] Step S101, obtaining data to be synchronized respectively sent by a plurality of devices to be synchronized, and obtaining a time parameter of each data to be synchronized.

[0030] The device to be synchronized may refer to a device for data collection. The data to be synchronized is the data collected by each device to be synchronized. In some embodiments of the present application, the data to be synchronized may refer to sensor data, that is, data collected by sensors of the device to be synchronized.

[0031] It should be noted that the present application does not limit the number of devices to be synchronized and the type of data collected by each device to be synchronized.

[0032] In actual applications, staff can set a specific number of devices to be synchronized according to needs, and configure different sensors for each device to be synchronized, so that each device to be synchronized collects corresponding sensor data and transmits it to the data processing device. Each device to be synchronized includes a single or multiple sensors. For example, the number of devices to be synchronized can be two, and the first device to be synchronized can include an infrared (IR) camera, an RGB camera, and a depth camera, and the collected data to be synchronized include IR images, RGB images, and depth images. The second device to be synchronized can include an RGB camera and a lidar, and the collected data to be synchronized include RGB images and point cloud data. The synchronization process includes the need to synchronize each frame of sensor data collected by multiple sensors in a single device, and the need to synchronize each frame of sensor data output by multiple devices to the data processing device. Furthermore, the data processing device can fuse or analyze multiple sensor data of the same frame.

[0033] In some embodiments of the present application, the data processing device can actively send a data collection command to each device to be synchronized, triggering each device to be synchronized to collect data, so that each device to be synchronized feeds back the collected data to be synchronized to the data processing device according to the data collection command. In other embodiments of the present application, the data processing device can also passively receive the data to be synchronized uploaded periodically by the device to be synchronized.

[0034] In order to synchronize the data to be synchronized respectively sent by a plurality of devices to be synchronized, in an embodiment of the present application, the data processing device also needs to obtain a time parameter of each data to be synchronized.

[0035] The time parameter of the data to be synchronized can represent the timestamp when the device to be synchronized collects the data to be synchronized. In some embodiments of the present application, the device to be synchronized can obtain the time parameter of the data to be synchronized when collecting the data to be synchronized, and combine each data to be synchronized and the corresponding time parameter into a data frame and send it to the data processing device.

[0036] Step S102: Acquire the time parameter mapping relationship between each data to be synchronized.

[0037] The time parameter mapping relationship is used to characterize the difference between the time parameter of a certain data to be synchronized and the time parameter of another data to be synchronized, that is, to characterize the time difference between the times when different data to be synchronized are collected.

[0038] In an implementation manner of the present application, the data processing device can determine the time parameter mapping relationship between each data to be synchronized based on the time parameter of each data to be synchronized; or it can obtain the time parameter mapping relationship between multiple devices by pre-detecting multiple devices to be synchronized, and obtain the time parameter mapping relationship between each data to be synchronized based on the time parameter mapping relationship between multiple devices.

[0039] Step S103: based on the time parameter mapping relationship and the time parameter of each data to be synchronized, data synchronization is performed on the data to be synchronized respectively sent by the multiple devices to be synchronized.

[0040] In an implementation manner of the present application, based on the time parameter mapping relationship and the time parameter of each data to be synchronized, the data processing device can use the time parameter of a certain data to be synchronized as a reference to calculate the relative relationship between the time parameters of other data to be synchronized and the time parameter of the data to be synchronized, and then determine the data to be synchronized collected at the same time, thereby realizing data synchronization of the data to be synchronized sent by multiple devices to be synchronized.

[0041] In an implementation manner of the present application, by obtaining the data to be synchronized sent by multiple devices to be synchronized, the time parameters of each data to be synchronized, and the time parameter mapping relationship between each data to be synchronized, data synchronization is performed on the data to be synchronized sent by multiple devices to be synchronized based on the time parameter mapping relationship and the time parameters of each data to be synchronized. The time parameter mapping relationship can be used to align the data to be synchronized, avoiding the problem of inaccurate data synchronization caused by the different clock sources of different devices, so that the results of subsequent data fusion or data analysis are more accurate.

[0042] In some embodiments of the present application, the above-mentioned multiple devices to be synchronized may include a master device and a slave device. The data processing device can select any one of the multiple devices to be synchronized as the master device according to actual conditions, and other devices to be synchronized other than the master device are called slave devices.

[0043] By interacting with the master device, the data processing device can control the collection of sensor data in the master device, and at the same time the master device controls the sensors of other slave devices to collect sensor data.

[0044] Specifically, the above-mentioned obtaining the to-be-synchronized data respectively sent by the multiple to-be-synchronized devices may specifically include: sending a data collection command to the multiple to-be-synchronized devices, and receiving the sensor data respectively sent by the multiple to-be-synchronized devices.

[0045] Among them, the data acquisition command is used to instruct the master device to obtain and send the master device's sensor data to the data processing device, instruct the slave device to obtain and send the master and slave device's sensor data to the data processing device, and instruct the master device to send trigger signals to the master device's sensors and the slave device's sensors.

[0046] The trigger signal is used to instruct the sensor of the master device to collect sensor data of the master device, and to instruct the sensor of the slave device to collect sensor data of the slave device. In some embodiments of the present application, the master device can send the trigger signal to each sensor of the master device and the slave device at a preset sending frequency.

[0047] Specifically, Figure 2 A schematic diagram of the interaction between a device to be synchronized and a data processing device provided by the present application is shown. Each device to be synchronized includes a system-on-chip (SOC) processor for processing data, and at least one sensor for collecting data; the data processing device may include an application processor (MAP); the data processing device is used to send commands to each device to be synchronized and receive data transmitted by each device to be synchronized and perform data processing, and the SOC processor in each device to be synchronized is used to receive commands to trigger the sensor to collect data and receive corresponding sensor data. Each device to be synchronized can be connected to the data processing device through a universal serial bus (USB) interface, a mobile industry processor interface (MIPI) or other interfaces.

[0048] Combination Figure 2 As shown in the interactive schematic diagram, in some embodiments of the present application, the data processing device can send a data acquisition command to multiple devices to be synchronized. After receiving the data acquisition command, the master device generates a Trigger signal, and then sends the Trigger signal to each sensor of the master device and the slave device at a preset sending frequency. After receiving the Trigger signal, each sensor immediately collects sensor data and sends the sensor data to the corresponding device to be synchronized. Therefore, the frequency of the sensor data can be consistent with the sending frequency of the Trigger signal.

[0049] Furthermore, in some embodiments of the present application, if the target device among the multiple devices to be synchronized includes multiple sensors, the multiple sensors of the target device will all collect sensor data upon receiving the trigger signal. The target device refers to a device among the multiple devices to be synchronized that includes multiple sensors.

[0050] Accordingly, the data processing device can receive sensor data collected by multiple sensors sent by the target device. Based on this, the data processing device can receive sensor data collected by different sensors from the same device to be synchronized. At the same time, since the time points at which the various sensors of the same device to be synchronized receive the trigger signal are basically the same, the time points at which the various sensors of the same device to be synchronized generate sensor data are also almost synchronized.

[0051] Furthermore, if Figure 2 As shown, a common counter may be included in addition to the data processing device and the device to be synchronized, and the counter may be used to update the real-time count value of the counter according to the sending frequency of the trigger signal.

[0052] Specifically, the master device can send a Trigger signal to the counter at the same sending frequency, and the Trigger signal can be used as the trigger source of the counter. After each Trigger signal is received by the counter, the real-time count value increases by 1. Therefore, the update frequency of the counter can be consistent with the sending frequency of the Trigger signal.

[0053] At this time, if Figure 3 As shown, the above-mentioned step of obtaining the time parameter of each data to be synchronized may include the following steps S301 to S302.

[0054] Step S301 : obtaining a real-time count value of a counter of a sensor of each device to be synchronized among a plurality of devices to be synchronized when the sensor collects sensor data.

[0055] Specifically, each device to be synchronized may generate an interrupt signal when collecting its own sensor data, and the interrupt signal is used to instruct the device to be synchronized that has collected the sensor data to obtain a real-time count value of a counter.

[0056] At this time, each device to be synchronized can use the real-time count value as a timestamp, combine it with the collected sensor data, generate a data frame containing a timestamp, and send the data frame containing the timestamp to the data processing device.

[0057] It should be noted that, if a device to be synchronized includes multiple sensors, the device to be synchronized can obtain real-time count values ​​corresponding to sensor data collected by different sensors.

[0058] Step S302: taking the real-time count value of the counter when the sensor data is collected as the time parameter of the sensor data.

[0059] In some embodiments of the present application, a data processing device may obtain real-time count values ​​corresponding to sensor data respectively sent by multiple devices to be synchronized, and use the real-time count value of the counter when the sensor data is collected as the time parameter of the sensor data. Since the real-time count value can represent the collection time of the sensor data, that is, it can represent the number of times the sensor data is collected when the Trigger signal is sent, the real-time count value is used as a timestamp, and the data processing device can perform data synchronization based on the timestamp.

[0060] Specifically, in some embodiments of the present application, the time parameter mapping relationship may refer to the count value size of the real-time count value corresponding to each sensor data. Accordingly, the data processing device may synchronize the data to be synchronized respectively sent by multiple devices to be synchronized based on the count value size of each real-time count value and the real-time count value corresponding to each sensor data.

[0061] More specifically, the data processing device can combine the sensor data corresponding to the real-time count values ​​with the same count value size into a data set collected at the same time, that is, combine different sensor data with the same timestamp into a synchronized data structure. Therefore, in practical applications, when a sensor loses a frame, that is, the sensor does not transmit sensor data to the SOC processor in the current frame, if the traditional method of timestamping each sensor is used to determine the synchronized data, since the time when each sensor data arrives at the SOC processor is different, the data processing device may use the sensor data of the next frame as the sensor data of the current frame for synchronization with other data to be synchronized, resulting in synchronization misalignment. In this solution, even if there is a frame loss, since the data processing device uses the count value size as the judgment basis, even if there is a frame loss, it will only cause a lack of data in a certain data set and will not cause the overall synchronized data to be misaligned.

[0062] In the implementation of the present application, data synchronization is performed through the real-time count value of the counter, and there is no need to perform data synchronization based on the clock sources of different devices, which can avoid the problem of inaccurate data synchronization caused by different clock sources of different devices. At the same time, since the real-time count value is updated according to the sending frequency of the trigger signal, the data processing device can align each sensor data to the time axis formed by the trigger signal sending time, so that the data processing device only needs to compare the count value of the real-time count value to complete data synchronization, without the need for complex judgment and calculation, while ensuring the accuracy of data synchronization, the efficiency of data synchronization is improved.

[0063] In some other implementations of the present application, the time parameter may also be the system time of the device to be synchronized that collects the data to be synchronized. Correspondingly, the time parameter mapping relationship may also be the system time difference between multiple devices to be synchronized.

[0064] Specifically, before performing data synchronization, the data processing device may read the current system timestamp of each device to be synchronized respectively, and calculate the system time difference between multiple devices to be synchronized based on the current system timestamp of each device to be synchronized.

[0065] Next, the data processing device may synchronize the data to be synchronized respectively sent by the multiple devices to be synchronized based on the system time difference and the system time corresponding to each data to be synchronized.

[0066] Among them, the method for obtaining the data to be synchronized can refer to the above description, and this application will not elaborate on it.

[0067] In some embodiments of the present application, a data processing device may use the system time corresponding to a certain sensor data as a reference, utilize the system time difference to align the system time corresponding to other sensor data to the reference, and then determine the sensor data collected at the same time through the aligned system time, thereby realizing data synchronization of the data to be synchronized sent by multiple devices to be synchronized.

[0068] It should be noted that, for the sake of simplicity of description, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present application is not limited to the described order of actions, because according to the present application, certain steps can be performed in other orders.

[0069] like Figure 4 FIG. 4 is a schematic diagram of the structure of a data synchronization device 400 provided in an embodiment of the present application. The data synchronization device 400 is configured on a data processing device.

[0070] Specifically, the data synchronization device 400 may include:

[0071] The first acquisition unit 401 is used to acquire the data to be synchronized respectively sent by multiple devices to be synchronized, and acquire the time parameter of each of the data to be synchronized;

[0072] A second acquisition unit 402 is used to acquire a time parameter mapping relationship between each of the data to be synchronized;

[0073] The data synchronization unit 403 is configured to synchronize the data to be synchronized respectively sent by the plurality of devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized.

[0074] In some embodiments of the present application, the above-mentioned multiple devices to be synchronized may include a master device and a slave device, and the above-mentioned data to be synchronized is sensor data; accordingly, the above-mentioned first acquisition unit 401 can be specifically used to: send a data acquisition command to the multiple devices to be synchronized, the data acquisition command is used to instruct the master device to acquire and send the sensor data of the master device to the data processing device, to instruct the slave device to acquire and send the sensor data of the slave device to the data processing device, and to instruct the processor of the master device to send a trigger signal to the sensor of the master device and the sensor of the slave device, the trigger signal is used to instruct the sensor of the master device to acquire the sensor data of the master device, and to instruct the sensor of the slave device to acquire the sensor data of the slave device; receive the sensor data sent by the multiple devices to be synchronized respectively.

[0075] In some embodiments of the present application, the above-mentioned first acquisition unit 401 can be specifically used to: obtain the real-time count value of the counter when the sensor of each device to be synchronized among the multiple devices to be synchronized collects the sensor data, and the counter is used to update the real-time count value of the counter according to the sending frequency of the trigger signal; use the real-time count value of the counter when the sensor data is collected as the time parameter of the sensor data.

[0076] In some embodiments of the present application, the above-mentioned time parameter mapping relationship can be the count value size of the real-time count value corresponding to each of the sensor data; accordingly, the above-mentioned data synchronization unit 403 can be specifically used to: based on the count value size and the real-time count value corresponding to each of the sensor data, synchronize the data to be synchronized sent by the multiple devices to be synchronized respectively.

[0077] In some embodiments of the present application, the above-mentioned multiple devices to be synchronized can generate an interrupt signal when collecting their respective sensor data, and the above-mentioned interrupt signal can be used to instruct the device to be synchronized that has collected the sensor data to obtain the real-time count value of the counter; accordingly, the above-mentioned first acquisition unit 401 can be specifically used to: obtain the real-time count values ​​corresponding to the sensor data respectively sent by the multiple devices to be synchronized.

[0078] In some embodiments of the present application, the target device among the above-mentioned multiple devices to be synchronized may include multiple sensors, and each of the multiple sensors collects sensor data upon receiving a trigger signal; accordingly, the above-mentioned first acquisition unit 401 can be specifically used to: receive the sensor data collected by the multiple sensors respectively sent by the target device.

[0079] In some embodiments of the present application, the above-mentioned time parameter is the system time of the device to be synchronized that collects the data to be synchronized; the above-mentioned time parameter mapping relationship is the system time difference between multiple devices to be synchronized; the above-mentioned data synchronization unit 403 can be specifically used to: based on the system time difference and the system time corresponding to each of the data to be synchronized, synchronize the data to be synchronized sent by the multiple devices to be synchronized respectively.

[0080] It should be noted that, for the convenience and simplicity of description, the specific working process of the above data synchronization device 400 can refer to Figures 1 to 3 The corresponding process of the method will not be repeated here.

[0081] like Figure 5 FIG. 5 is a schematic diagram of a data processing device provided in an embodiment of the present application. The data processing device 5 may include: a processor 50, a memory 51, and a computer program 52 stored in the memory 51 and executable on the processor 50, such as a data synchronization program. When the processor 50 executes the computer program 52, the steps in the above-mentioned data synchronization method embodiments are implemented, such as Figure 1 Alternatively, when the processor 50 executes the computer program 52, the functions of each module / unit in the above-mentioned device embodiments are realized, for example Figure 4 The first acquisition unit 401, the second acquisition unit 402 and the data synchronization unit 403 are shown.

[0082] The computer program may be divided into one or more modules / units, which are stored in the memory 51 and executed by the processor 50 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which are used to describe the execution process of the computer program in the data processing device.

[0083] For example, the computer program can be divided into: a first acquisition unit, a second acquisition unit and a data synchronization unit. The specific functions of each unit are as follows: the first acquisition unit is used to acquire the data to be synchronized respectively sent by multiple devices to be synchronized, and acquire the time parameter of each of the data to be synchronized; the second acquisition unit is used to acquire the time parameter mapping relationship between each of the data to be synchronized; the data synchronization unit is used to synchronize the data to be synchronized respectively sent by the multiple devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized.

[0084] The data processing device may include, but is not limited to, a processor 50 and a memory 51. Those skilled in the art will appreciate that Figure 5It is only an example of a data processing device and does not constitute a limitation of the data processing device. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the data processing device may also include input and output devices, network access devices, buses, etc.

[0085] The processor 50 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0086] The memory 51 may be an internal storage unit of the data processing device, such as a hard disk or memory of the data processing device. The memory 51 may also be an external storage device of the data processing device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the data processing device. Further, the memory 51 may also include both an internal storage unit and an external storage device of the data processing device. The memory 51 is used to store the computer program and other programs and data required by the data processing device. The memory 51 may also be used to temporarily store data that has been output or is to be output.

[0087] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0088] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0089] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0090] In the embodiments provided in the present application, it should be understood that the disclosed devices / data processing equipment and methods can be implemented in other ways. For example, the device / data processing equipment embodiments described above are merely schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

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

[0092] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0093] If the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.

[0094] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.

Claims

1. A data synchronization method, characterized in that: The data synchronization method is applied to a data processing device, and the multiple devices to be synchronized include a master device and a slave device. The data synchronization method includes: Acquire data to be synchronized respectively sent by a plurality of devices to be synchronized, and acquire a time parameter of each of the data to be synchronized, wherein each of the data to be synchronized is collected by the corresponding device to be synchronized, and the time parameter represents a timestamp when the corresponding data to be synchronized is collected; the data to be synchronized is sensor data; Acquire a time parameter mapping relationship between each of the data to be synchronized, where the time parameter mapping relationship is used to characterize the difference between the time parameters of different data to be synchronized; Based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized, data synchronization is performed on the data to be synchronized respectively sent by the multiple devices to be synchronized; The acquiring of the data to be synchronized respectively sent by the multiple devices to be synchronized comprises: the data processing device sending a data acquisition command to the multiple devices to be synchronized, the data acquisition command being used to instruct the master device to acquire and send the sensor data of the master device to the data processing device, and to instruct the slave device to acquire and send the sensor data of the slave device to the data processing device, and to instruct the processor of the master device to send a trigger signal to the sensor of the master device and the sensor of the slave device, the trigger signal being used to instruct the sensor of the master device to acquire the sensor data of the master device, and to instruct the sensor of the slave device to acquire the sensor data of the slave device; the data processing device receiving the sensor data respectively sent by the multiple devices to be synchronized; The obtaining of the time parameter of each of the data to be synchronized includes: obtaining the real-time count value of a counter when the sensor of each of the multiple devices to be synchronized collects the sensor data, the counter being used to update the real-time count value of the counter according to the sending frequency of the trigger signal; and using the real-time count value of the counter when the sensor data is collected as the time parameter of the sensor data.

2. The data synchronization method according to claim 1, characterized in that: The time parameter mapping relationship is the count value size of the real-time count value corresponding to each of the sensor data; The step of synchronizing the data to be synchronized respectively sent by the plurality of devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized includes: Based on the count value and the real-time count value corresponding to each of the sensor data, data synchronization is performed on the data to be synchronized respectively sent by the multiple devices to be synchronized.

3. The data synchronization method according to claim 1, characterized in that: The multiple devices to be synchronized generate interrupt signals when collecting respective sensor data, and the interrupt signals are used to instruct the devices to be synchronized that have collected the sensor data to obtain the real-time count value of the counter; The obtaining of the real-time count value of the counter when the sensor of each of the multiple devices to be synchronized collects the sensor data comprises: Acquire real-time count values ​​corresponding to the sensor data respectively sent by the plurality of devices to be synchronized.

4. The data synchronization method according to any one of claims 1 to 3, characterized in that: The target device among the multiple devices to be synchronized includes multiple sensors, and each of the multiple sensors collects sensor data upon receiving the trigger signal; In the step of receiving the sensor data respectively sent by the plurality of devices to be synchronized, receiving the sensor data sent by the target device includes: Receive sensor data respectively collected by the multiple sensors sent by the target device.

5. The data synchronization method according to claim 1, characterized in that: The time parameter is the system time of the device to be synchronized that collects the data to be synchronized; the time parameter mapping relationship is the system time difference between the multiple devices to be synchronized; The step of synchronizing the data to be synchronized respectively sent by the plurality of devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized includes: Based on the system time difference and the system time corresponding to each of the data to be synchronized, data synchronization is performed on the data to be synchronized respectively sent by the multiple devices to be synchronized.

6. A data synchronization device, characterized in that: The data synchronization device is configured on a data processing device, and the multiple devices to be synchronized include a master device and a slave device. The data synchronization device includes: A first acquisition unit is used to acquire data to be synchronized respectively sent by a plurality of devices to be synchronized, and to acquire a time parameter of each of the data to be synchronized, wherein each of the data to be synchronized is collected by the corresponding device to be synchronized, and the time parameter represents a timestamp when the corresponding data to be synchronized is collected; the data to be synchronized is sensor data; A second acquisition unit is used to acquire a time parameter mapping relationship between each of the data to be synchronized, where the time parameter mapping relationship is used to characterize the difference between the time parameters of different data to be synchronized; A data synchronization unit, configured to synchronize the data to be synchronized respectively sent by the plurality of devices to be synchronized based on the time parameter mapping relationship and the time parameter of each of the data to be synchronized; The acquiring of the data to be synchronized respectively sent by the multiple devices to be synchronized comprises: the data processing device sending a data acquisition command to the multiple devices to be synchronized, the data acquisition command being used to instruct the master device to acquire and send the sensor data of the master device to the data processing device, and to instruct the slave device to acquire and send the sensor data of the slave device to the data processing device, and to instruct the processor of the master device to send a trigger signal to the sensor of the master device and the sensor of the slave device, the trigger signal being used to instruct the sensor of the master device to acquire the sensor data of the master device, and to instruct the sensor of the slave device to acquire the sensor data of the slave device; the data processing device receiving the sensor data respectively sent by the multiple devices to be synchronized; The obtaining of the time parameter of each of the data to be synchronized includes: obtaining the real-time count value of a counter when the sensor of each of the multiple devices to be synchronized collects the sensor data, the counter being used to update the real-time count value of the counter according to the sending frequency of the trigger signal; and using the real-time count value of the counter when the sensor data is collected as the time parameter of the sensor data.

7. A data processing device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Vehicle-mounted terminal system and synchronous data acquisition method and device

    CN109905194A

  • Synchronous data acquisition method and system for master-slave wireless sensors

    CN110493744A

  • Sensor data processing method and device, computer equipment and storage medium

    CN111368172A

  • Multi-sensor data synchronization method and device thereof

    CN111983948A

  • Data acquisition and time synchronization method and device, electronic equipment and storage medium

    CN112865902A