Multi-device data acquisition synchronization method and device, device and storage medium
By extracting the same physical quantity from the CAN bus and external data acquisition equipment signals in vehicle dynamics tests, performing resampling and time-domain correlation analysis, identifying and eliminating time delays, high-precision synchronization of data from multiple devices was achieved. This solved the reliability problem of GPS timestamp synchronization schemes in complex environments and ensured the accuracy and consistency of test data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- CHINA FAW CO LTD
- Filing Date
- 2025-12-11
- Publication Date
- 2026-04-24
AI Technical Summary
Existing GPS-based timestamp synchronization schemes are constrained by environmental conditions in vehicle dynamics tests, resulting in insufficient synchronization reliability. In particular, satellite signals are easily blocked or interfered with in underground test sites, tunnels, and electromagnetic shielding environments, leading to data alignment failures and affecting the continuity of tests and the validity of data.
The same physical quantity signal is extracted by the CAN bus acquisition device and the external data acquisition device, and the signal is resampled to make the two signals have the same time sequence. The time delay is determined by time domain correlation analysis, and time shift is performed to achieve data synchronization.
It achieves high-precision synchronization of data from multiple devices in the time dimension, ensuring the temporal consistency of experimental data and the reliability of analysis results, avoiding overall data deviation caused by partial synchronization, and improving the usability of experimental data and the credibility of analysis results.
Smart Images

Figure CN121919151A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more specifically, to a method, apparatus, device, and storage medium for multi-device data acquisition and synchronization. Background Technology
[0002] Vehicle dynamics testing is a crucial method for evaluating core indicators such as vehicle handling stability, braking performance, and ride comfort. During testing, multi-dimensional data collection from various devices is necessary to support comprehensive analysis. The CAN bus (Controller Area Network), as the vehicle's built-in communication network, is responsible for outputting basic state parameters such as vehicle speed, engine speed, and brake master cylinder pressure, with a sampling rate typically between 10Hz and 100Hz. External data acquisition devices (such as high-precision sensor modules and dynamic signal analyzers) are used to capture detailed signals such as acceleration, strain, and high-frequency pressure, with sampling rates generally not lower than 100Hz. These two types of data reflect the vehicle's dynamic process from different dimensions, and the consistency of their temporal dimension directly determines the accuracy of the test data interpretation. Any time discrepancies may lead to misjudgments in the dynamic characteristic analysis; therefore, multi-device data synchronization is a core technical requirement for vehicle dynamics testing.
[0003] Currently, the most commonly used multi-device data synchronization scheme in vehicle dynamics testing is the GPS (Global Positioning System)-based timestamp synchronization scheme. This scheme equips both the CAN bus acquisition device and the external data acquisition device with a high-precision GPS timing module. During testing, each device uses satellite timing signals to assign absolute timestamps to data points, and data alignment is subsequently completed based on these timestamps.
[0004] The aforementioned GPS-based timestamp synchronization scheme has significant drawbacks. It is severely constrained by environmental conditions and lacks sufficient synchronization reliability. This scheme relies on stable satellite signal reception. In underground test sites, tunnels, densely populated high-rise areas, or electromagnetically shielded environments, satellite signals are easily blocked or interfered with, causing the GPS timing module to be unable to obtain effective timing information and thus unable to accurately timestamp the data. This ultimately leads to data alignment failure, severely affecting the continuity of the experiment and the validity of the data. Summary of the Invention
[0005] In view of this, the purpose of this application is to provide a method, apparatus, device and storage medium for multi-device data acquisition and synchronization, which can achieve high-precision synchronization of data from multiple devices in the time dimension.
[0006] In a first aspect, embodiments of this application provide a method for synchronizing data acquisition across multiple devices, the method comprising: CAN bus data is acquired through a CAN bus acquisition device, and a first signal is extracted from the CAN bus data. Data is acquired from an external data acquisition device, and a second signal is extracted from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity; The first signal and the second signal are resampled to make the two signals have the same time sequence. Time-domain correlation analysis was performed on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal. Based on the time delay, the CAN bus data or the external data acquisition device data is time-shifted to achieve synchronization between the two.
[0007] Optionally, the method further includes: The residual sequence is calculated based on the first signal in the time-shifted CAN bus data and the second signal in the data from the external data acquisition device. Calculate the normalized root mean square error based on the residual sequence; The synchronization effect is evaluated based on the normalized root mean square error.
[0008] Optionally, the step of resampling the first signal and the second signal to make the two signals have the same time series includes: The signal with the lower sampling rate is linearly interpolated on the time axis of the signal with the higher sampling rate so that the two signals have the same time series length and the same number of data points.
[0009] Optionally, the step of performing time-domain correlation analysis on the two resampled signals to determine the time delay of the resampled first signal relative to the resampled second signal includes: Calculate the cross-correlation function between the resampled first signal and the resampled second signal; Iterate through the number of delay points of the cross-correlation function to find the number of delay points that makes the cross-correlation function reach its absolute maximum value; The time delay is calculated based on the number of delay points and the sampling interval of the external data acquisition device.
[0010] Optionally, the step of time-shifting the CAN bus data or the external data acquisition device data according to the time delay to achieve synchronization includes: Shift the timestamps of the CAN bus data by the time delay amount; or... The timestamps of the data from the external data acquisition device are shifted by the opposite number of the time delay.
[0011] Optionally, the first signal and the second signal are collected during the period when the vehicle performs a dynamic excitation operation, which is used to cause the physical quantity to change periodically.
[0012] Optionally, the dynamic excitation operation includes a continuous acceleration and deceleration cycle, and the first signal and the second signal are vehicle speed signals; or, The dynamic excitation operation includes continuously pressing and releasing the brake pedal in a cycle, and the first signal and the second signal are brake master cylinder pressure signals.
[0013] Secondly, embodiments of this application provide a multi-device data acquisition and synchronization device, the device comprising: The first signal extraction module is used to acquire CAN bus data through a CAN bus acquisition device and extract a first signal from the CAN bus data. The second signal extraction module is used to acquire data from an external data acquisition device and extract a second signal from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity; The resampling processing module is used to perform signal resampling processing on the first signal and the second signal so that the two signals have the same time sequence. The correlation analysis module is used to perform time-domain correlation analysis on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal. The time shift module is used to shift the CAN bus data or the external data acquisition device data according to the time delay, so as to achieve synchronization between the two.
[0014] Optionally, the device further includes a synchronization effect evaluation module, used for: The residual sequence is calculated based on the first signal in the time-shifted CAN bus data and the second signal in the data from the external data acquisition device. Calculate the normalized root mean square error based on the residual sequence; The synchronization effect is evaluated based on the normalized root mean square error.
[0015] Optionally, the step of resampling the first signal and the second signal to make the two signals have the same time series includes: The signal with the lower sampling rate is linearly interpolated on the time axis of the signal with the higher sampling rate so that the two signals have the same time series length and the same number of data points.
[0016] Optionally, the step of performing time-domain correlation analysis on the two resampled signals to determine the time delay of the resampled first signal relative to the resampled second signal includes: Calculate the cross-correlation function between the resampled first signal and the resampled second signal; Iterate through the number of delay points of the cross-correlation function to find the number of delay points that makes the cross-correlation function reach its absolute maximum value; The time delay is calculated based on the number of delay points and the sampling interval of the external data acquisition device.
[0017] Optionally, the step of time-shifting the CAN bus data or the external data acquisition device data according to the time delay to achieve synchronization includes: Shift the timestamps of the CAN bus data by the time delay amount; or... The timestamps of the data from the external data acquisition device are shifted by the opposite number of the time delay.
[0018] Optionally, the first signal and the second signal are collected during the period when the vehicle performs a dynamic excitation operation, which is used to cause the physical quantity to change periodically.
[0019] Optionally, the dynamic excitation operation includes a continuous acceleration and deceleration cycle, and the first signal and the second signal are vehicle speed signals; or, The dynamic excitation operation includes continuously pressing and releasing the brake pedal in a cycle, and the first signal and the second signal are brake master cylinder pressure signals.
[0020] Thirdly, embodiments of this application provide a computer device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of the multi-device data acquisition synchronization method described in any of the optional embodiments of the first aspect are performed.
[0021] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the multi-device data acquisition synchronization method described in any of the optional embodiments of the first aspect.
[0022] The technical solution provided in this application includes, but is not limited to, the following beneficial effects: The design employs a CAN bus acquisition device to extract the first signal and an external data acquisition device to extract the second signal, clearly identifying that both signals originate from the same physical quantity. This provides a core foundation for subsequent synchronous analysis. The shared source of the signals implies a high correlation between their changing trends, accurately reflecting the dynamic characteristics of the same physical quantity. This avoids the weak correlation caused by different signal sources, ensuring reliable signal evidence for subsequent synchronous analysis and guaranteeing the rationality of the synchronization results from the outset.
[0023] Resampling the first and second signals ensures they have the same time series, effectively resolving the issue of inconsistent sampling rates between the CAN bus acquisition device and the external data acquisition device. Different sampling rates prevent direct comparison and analysis of signals in the time dimension. Resampled data possesses a unified time base and the same number of data points, eliminating analytical obstacles caused by sampling rate differences. This allows subsequent time-domain correlation analysis to be conducted within a consistent time frame, avoiding synchronization errors caused by time series mismatches.
[0024] By determining the time delay through time-domain correlation analysis, the true time difference between two signals after resampling can be accurately captured. This method derives the delay based on the changes in the signal itself, which better reflects the inherent time relationship of the signal compared to simple trigger synchronization methods. The calculation accuracy of the delay is higher, effectively avoiding delay estimation errors caused by subjective judgment or simple triggering, ensuring that the time delay can truly reflect the time difference between the two data streams, and providing an accurate basis for subsequent synchronization operations.
[0025] By shifting the CAN bus data or data from external data acquisition devices according to the time delay, global synchronization of all data from both types of devices can be directly achieved. This operation is not only applied to the synchronization signal, but covers all data collected throughout the entire test process, ensuring the consistency of all test data in the time dimension. It avoids overall data deviation caused by partial synchronization, providing a unified time reference and accurate data foundation for subsequent vehicle dynamics analysis, and ensuring the reliability of the analysis results.
[0026] The various steps in this application are closely linked and work synergistically to ensure the effectiveness of multi-device data synchronization from four key dimensions: signal foundation, time reference, delay accuracy, and global synchronization. A reliable foundation is laid through the extraction of signals from the same source; resampling eliminates sampling rate differences; temporal correlation analysis ensures accurate delay; and time shifting achieves global alignment. Ultimately, high-precision synchronization of multi-device data in the time dimension is achieved, providing core technical support for accurate analysis of vehicle dynamics tests and significantly improving the usability of test data and the reliability of analysis results.
[0027] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0028] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart of a multi-device data acquisition synchronization method provided in Embodiment 1 of this application is shown; Figure 2 This illustration shows a schematic diagram of resampling the original signal according to Embodiment 1 of this application; Figure 3 A flowchart of a synchronization effect evaluation method provided in Embodiment 1 of this application is shown; Figure 4 A flowchart of a method for determining a time delay amount provided in Embodiment 1 of this application is shown; Figure 5 A schematic diagram of a cross-correlation function and peak detection provided in Embodiment 1 of this application is shown; Figure 6 The diagram shows the original signal diagram of a dynamic excitation stage provided in Embodiment 2 of this application; Figure 7 This paper shows a schematic diagram of the structure of a multi-device data acquisition and synchronization device provided in Embodiment 2 of this application; Figure 8 A schematic diagram of the structure of a computer device provided in Embodiment 3 of this application is shown. Detailed Implementation
[0030] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0031] Example 1 To facilitate understanding of this application, the following is combined with... Figure 1 The flowchart illustrating a multi-device data acquisition and synchronization method provided in Embodiment 1 of this application will be described in detail for Embodiment 1 of this application.
[0032] See Figure 1 As shown, Figure 1 A flowchart of a multi-device data acquisition synchronization method provided in Embodiment 1 of this application is shown, wherein the method includes steps S101 to S105: Specifically, Figure 1 It presents a complete process framework from multi-device signal acquisition to data synchronization, covering key steps such as signal extraction, resampling, correlation analysis, and time correction.
[0033] This process is adaptable to common scenarios in vehicle dynamics testing involving a combination of CAN bus (Controller Area Network) and external data acquisition equipment, ensuring consistency of data from different sources over time and providing a foundation for subsequent high-precision dynamics analysis.
[0034] S101: Acquire CAN bus data through a CAN bus acquisition device, and extract the first signal from the CAN bus data.
[0035] Specifically, the CAN bus data comes from the vehicle's built-in CAN network and includes core status parameters during vehicle operation, such as vehicle speed, engine speed, brake master cylinder pressure, and steering wheel angle. Its sampling rate is usually in the range of 10Hz (Hertz, a unit of frequency) to 100Hz.
[0036] The first signal is a specific signal selected from these CAN bus data. The selection criterion is that the signal must correspond to the same physical quantity as the second signal extracted from the external data acquisition device. For example, if the second signal is a vehicle speed related signal, the first signal must be the vehicle speed signal in the CAN bus to ensure that the two signals have an inherent relationship.
[0037] S102: Obtain data from an external data acquisition device, and extract a second signal from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity.
[0038] Specifically, external data acquisition devices are usually dedicated devices based on analog or digital acquisition cards (such as high-precision GPS (Global Positioning System) speed measuring devices, pressure sensor acquisition modules, etc.), with a sampling rate of generally not less than 100Hz. They can acquire high-frequency dynamic signals such as acceleration, strain, and pressure, and can also acquire physical quantity data that are from the same source as CAN bus signals.
[0039] The second signal is a physical quantity signal extracted from the device data that is from the same source as the first signal. For example, if the first signal is the brake master cylinder pressure signal of the CAN bus, the second signal can be the brake master cylinder pressure signal directly measured by an external pressure acquisition card. This commonality ensures that the two signals are highly correlated in terms of their changing trends, which is the core premise for subsequent synchronous analysis.
[0040] S103: Perform signal resampling processing on the first signal and the second signal to make the two signals have the same time sequence.
[0041] Specifically, since the sampling frequency of external data acquisition equipment (denoted as Fs) is usually greater than or equal to the sampling frequency of CAN bus acquisition equipment (denoted as Fc), resampling processing needs to be based on the time axis of the signal from the external data acquisition equipment with the higher sampling rate.
[0042] For signals with lower sampling rates (usually the first signal extracted from the CAN bus), a linear interpolation algorithm is used to supplement the data, ultimately generating a new signal sequence with the same timestamp and number of data points (denoted as N) that is completely consistent with the signal timestamp of the external data acquisition device. This completely eliminates the time dimension mismatch problem between the two signals caused by the difference in sampling rates, creating conditions for subsequent time-domain correlation analysis.
[0043] S104: Perform time-domain correlation analysis on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal.
[0044] Specifically, the core of time-domain correlation analysis is to calculate the cross-correlation function of two resampled signals to measure the similarity between the two signals under different time delays.
[0045] Let the first signal after resampling (from the CAN bus) be... n is the sampling point index (values are 1, 2, ..., N); the resampled second signal (external data source) is n is also the index of the sampling point (its value is the same as the index of the sampling point). Consistent).
[0046] At this point, the formula for calculating the cross-correlation function R(m) is: ; R(m) is the cross-correlation function value; m is the number of delay points; This represents the value of the first signal after resampling at the nth sampling point; This represents the value of the second signal after resampling at the (n+m)th sampling point.
[0047] By iterating through all possible values of m, we find the number of delay points (denoted as ) that make R(m) reach its absolute maximum. Then, combining the sampling interval of the external data acquisition equipment (denoted as Δt), the time delay (denoted as τ) is calculated using the following formula: ; Where τ is the time delay; The number of delay points required to maximize the cross-correlation function; The sampling interval (usually in seconds) for external data acquisition equipment.
[0048] The τ value reflects the time deviation of the first signal relative to the second signal after resampling.
[0049] S105: Based on the time delay, perform time shifting on the CAN bus data or the external data acquisition device data to achieve synchronization between the two.
[0050] Specifically, the time shift operation needs to be applied to all data collected throughout the entire experimental process (rather than just the first and second signals) to ensure that the time reference of all data is consistent.
[0051] If the calculated time delay is τ, two translation methods can be selected: First, the timestamps of all CAN bus data are increased or decreased by τ (the specific direction is determined by the sign of τ; for example, when τ is negative, the CAN timestamp needs to be subtracted by |τ|, where |τ| is the absolute value of τ). Second, shift the timestamps of all external data acquisition devices by -τ (i.e., in the opposite direction to the first method). Both methods can eliminate the time deviation between the two data streams, ultimately achieving global synchronization between CAN bus data and external data acquisition equipment data.
[0052] In an optional implementation, the signal resampling process for the first signal and the second signal to make the two signals have the same time series includes: linearly interpolating the signal with the lower sampling rate on the time axis of the signal with the higher sampling rate so that the two signals have the same length of time series and the same number of data points.
[0053] Specifically, signals with lower sampling rates are typically the first signals extracted from the CAN bus (sampling rate 10Hz-100Hz), while signals with higher sampling rates are the second signals extracted from external data acquisition devices (sampling rate ≥100Hz).
[0054] The principle of linear interpolation is based on the assumption that the signal changes in a stationary linear manner between two adjacent original sampling points. It calculates and generates new data points within this interval that correspond to the timestamp of the high sampling rate signal.
[0055] For example, when the CAN signal sampling rate is 10Hz (1 point per 0.1 seconds) and the external data acquisition signal sampling rate is 100Hz (1 point per 0.01 seconds), 9 interpolation points need to be added between each original data point of the CAN signal to make the time series length (i.e. the time range covered) of the two signals completely consistent, and the number of data points is equal to the total number of sampling points N of the external data acquisition device.
[0056] See Figure 2 As shown, Figure 2 The diagram illustrates a resampling of the original signal according to Embodiment 1 of this application. The diagram shows the result of resampling the original signal, including the data acquisition device signal and the resampled CAN signal. The horizontal axis of the diagram is "time (s)" (range 0 to 40 seconds) and the vertical axis is "vehicle speed (km / h)" (range 20 to 70 km / h), which shows that the resampled CAN signal and the data acquisition device signal have the same time sequence.
[0057] Different sampling rates can make it impossible to directly compare and analyze signals in the time dimension. Resampled data has a unified time base and the same number of data points, which eliminates the analytical obstacles caused by sampling rate differences. This allows subsequent time-domain correlation analysis to be carried out within a consistent time frame, avoiding synchronization errors caused by time series mismatch.
[0058] In an optional implementation, see Figure 3 As shown, Figure 3 A flowchart of a synchronization effect evaluation method provided in Embodiment 1 of this application is shown, wherein the method further includes steps S301-S303: S301: Calculate the residual sequence based on the first signal in the time-shifted CAN bus data and the second signal in the data from the external data acquisition device.
[0059] Specifically, first, the residual sequence is calculated, denoted as... The calculation formula is: ; in, This represents the value of the residual sequence at the nth sampling point; This represents the value of the first signal (from the CAN bus) at the nth sampling point after time shift; This represents the value of the second signal (external data acquisition source) at the nth sampling point; n is the sampling point index (values are 1, 2, ..., N).
[0060] S302: Calculate the normalized root mean square error based on the residual sequence.
[0061] Specifically, the normalized root mean square error (denoted as ) is then calculated based on the residual sequence. The calculation formula is: ; in, The normalized root mean square error is N; N is the number of data points. This represents the maximum value of the first signal after time shift; This is the minimum value of the first signal after time shift.
[0062] S303: Evaluate the synchronization effect based on the normalized root mean square error.
[0063] Specifically, the final evaluation criteria are as follows: if NRMSE ≤ 5%, the synchronization effect is deemed qualified and meets the accuracy requirements of subsequent dynamic analysis; if NRMSE > 5%, the signal acquisition quality (such as whether the sensor is abnormal), resampling parameter settings, or cross-correlation function calculation process need to be checked, and the synchronization process should be re-executed after troubleshooting.
[0064] In an optional implementation, the signal resampling process on the first signal and the second signal to make the two signals have the same time series includes: The signal with the lower sampling rate is linearly interpolated on the time axis of the signal with the higher sampling rate so that the two signals have the same time series length and the same number of data points.
[0065] Specifically, signals with lower sampling rates are typically the first signals extracted from the CAN bus (sampling rate 10Hz-100Hz), while signals with higher sampling rates are the second signals extracted from external data acquisition devices (sampling rate ≥100Hz).
[0066] The principle of linear interpolation is based on the assumption that the signal changes in a stable linear manner between two adjacent original sampling points. New data points corresponding to the timestamp of the high sampling rate signal are generated by calculation within this interval. For example, when the sampling rate of the CAN signal is 10Hz (1 point every 0.1 seconds) and the sampling rate of the external data acquisition signal is 100Hz (1 point every 0.01 seconds), 9 interpolation points need to be added between each original data point of the CAN signal. Finally, the time series length (i.e. the time range covered) of the two signals is completely consistent, and the number of data points is equal to the total number of sampling points N of the external data acquisition device.
[0067] In an optional implementation, see Figure 4 As shown, Figure 4 The flowchart illustrates a method for determining time delay provided in Embodiment 1 of this application, wherein the step of performing time-domain correlation analysis on the two resampled signals to determine the time delay of the resampled first signal relative to the resampled second signal includes steps S401-S403: Specifically, Figure 4 It intuitively demonstrates the step-by-step execution logic of time-domain correlation analysis, clearly presenting the process from calculating the cross-correlation function to determining the time delay. It can also help display the cross-correlation function curve and the location of the delay point corresponding to the maximum peak, making it easier to understand the derivation basis of the time delay.
[0068] This process is applicable to the synchronous analysis of various physical quantity signals from the same source, and is not limited by specific signal types (such as vehicle speed and pressure), thus possessing universality.
[0069] S401: Calculate the cross-correlation function between the resampled first signal and the resampled second signal.
[0070] Specifically, the calculation process can be implemented using numerical computing tools or libraries (such as the numpy.correlate function in Python, where numpy is a numerical computing library for Python, and correlate is a function in that library used to calculate cross-correlation). A complete resampled first signal sequence is required as input. Second signal sequence And set the range of values for the delay points m (usually need to cover ± several hundred sampling points to ensure that the m value corresponding to the actual delay is included).
[0071] The calculation result of the cross-correlation function R(m) will form a curve with m as the horizontal axis and R(m) as the vertical axis. The value of m corresponding to the peak of the curve represents the number of delay points when the similarity between the two signals is the highest.
[0072] S402: Iterate through the number of delay points of the cross-correlation function and find the number of delay points that makes the cross-correlation function reach its absolute maximum value.
[0073] Specifically, the traversal operation requires comparing all calculated R(m) values and selecting the absolute maximum value (i.e., taking the largest R(m) regardless of its sign). The m value corresponding to this maximum value is the number of delay points. .
[0074] For example, in a vehicle test, the calculated cross-correlation function reaches its absolute maximum value when m = -35. =-35, this value indicates that the first signal after resampling is 35 sampling points ahead of the second signal.
[0075] S403: The time delay is calculated based on the number of delay points and the sampling interval of the external data acquisition device.
[0076] Specifically, the sampling interval Δt of the external data acquisition device is determined by its sampling frequency Fs, and the calculation formula is Δt = 1 / Fs (Fs is the sampling frequency of the external data acquisition device, in Hz). For example, when the sampling rate of the external data acquisition device is 100Hz, Δt = 1 / 100 = 0.01s (seconds).
[0077] Combined with the results obtained in step S402 According to the formula Calculate the time delay, for example When Δt = 0.01s, τ = -35 × 0.01 = -0.35s. The negative sign indicates that the first signal after resampling leads the second signal by 0.35s, while the positive sign indicates that it lags behind.
[0078] See Figure 5 As shown, Figure 5 The diagram illustrates a cross-correlation function and peak detection provided in Embodiment 1 of this application. The diagram shows the cross-correlation function curves of two signals (the vertical axis correlation coefficient is on the order of ×10). 4 The figure shows that the maximum correlation coefficient is 8,883,764.7, with a peak position of -0.350 seconds. The time delay corresponding to this peak is -0.350 seconds. The horizontal axis represents "time delay (s)" (ranging from -40 to 40 seconds), and the vertical axis represents "correlation coefficient", clearly showing the changes in the cross-correlation function and key peak information.
[0079] This method derives the delay based on the changes in the signal itself. Compared with simple triggering synchronization, it can better reflect the inherent time relationship of the signal and has higher accuracy in calculating the delay. It effectively avoids delay estimation errors caused by subjective judgment or simple triggering, ensuring that the time delay can truly reflect the time difference between the two data streams, and providing an accurate basis for subsequent synchronization operations.
[0080] In an optional implementation, time shifting is performed on the CAN bus data or the external data acquisition device data to achieve synchronization, including shifting the timestamp of the CAN bus data by the time delay amount.
[0081] Specifically, a common approach is to "shift the timestamps of the CAN bus data by the time delay." For example, when τ = -0.35s, the timestamps of all CAN bus data (including all parameters such as vehicle speed, engine speed, and brake pressure) need to be uniformly reduced by 0.35s to align the time base of the CAN data with the external data acquisition data.
[0082] Alternatively, the timestamps of the data from the external data acquisition device can be shifted by the opposite number of the time delay.
[0083] Specifically, "shifting the timestamp of the external data acquisition device by the opposite of the time delay" is an equivalent method. If τ = -0.35s, then the timestamp of the external data acquisition device needs to be increased by 0.35s (i.e. shifted by -τ). The two methods achieve the same synchronization effect. In practical applications, the appropriate method can be selected according to the data storage format or the requirements of the subsequent analysis software.
[0084] In an optional implementation, the first signal and the second signal are acquired during a period when the vehicle performs a dynamic excitation operation, which is used to cause the physical quantity to change periodically.
[0085] Specifically, dynamic excitation operations need to be performed before the formal vehicle dynamics tests (such as handling stability tests and braking performance tests) begin. The purpose is to produce obvious and regular periodic changes in the physical quantities used for synchronization (such as vehicle speed and brake master cylinder pressure).
[0086] This operation avoids the cross-correlation function failing to accurately capture the number of delay points when the signal is in a stable state (such as when the vehicle is traveling at a constant speed). It also requires the driver to follow a preset procedure to ensure that the amplitude and frequency of changes in physical quantities are sufficient to cover the signal characteristics in subsequent formal tests, thus providing a reliable signal source for synchronous analysis.
[0087] In an optional implementation, the dynamic excitation operation includes a continuous acceleration and deceleration cycle, wherein the first signal and the second signal are vehicle speed signals.
[0088] Specifically, the operation procedure for the "continuous acceleration and deceleration cycle" is as follows: After the vehicle starts on a flat test road, it accelerates to 60 km / h with an acceleration of about 0.2g (g is Gravitational acceleration, about 9.8 m / s², meters per second squared), and then decelerates to 30 km / h with a deceleration of 0.2g. This acceleration-deceleration process is repeated 5 times.
[0089] The first signal collected during this process is the vehicle speed signal output from the CAN bus (sampling rate 10Hz-100Hz), and the second signal is the vehicle speed signal collected by an external high-precision GPS device (sampling rate ≥100Hz).
[0090] See Figure 6 As shown, Figure 6 The diagram illustrates the original signal during the dynamic excitation stage provided in Embodiment 2 of this application. The diagram shows two original vehicle speed signals during the dynamic excitation stage: one is a data acquisition device signal with a sampling rate of 100Hz, and the other is a CAN original signal with a sampling rate of 10Hz. The horizontal axis in the diagram represents "time (s)" (ranging from 0 to 40 seconds), and the vertical axis represents "vehicle speed (km / h)" (ranging from 20 to 70 km / h), visually presenting the changing trend of the two original signals from the same source during the dynamic excitation stage.
[0091] Alternatively, the dynamic excitation operation includes a continuous cycle of pressing and releasing the brake pedal, where the first signal and the second signal are brake master cylinder pressure signals.
[0092] Specifically, the "continuous pressing and releasing of the brake pedal" operation procedure is as follows: the driver periodically presses and releases the brake pedal, causing the brake master cylinder pressure to fluctuate regularly between 0 and the system's maximum working pressure.
[0093] The first signal acquired during this process is the brake master cylinder pressure signal output from the CAN bus, and the second signal is the brake master cylinder pressure signal obtained by the external pressure acquisition card through the pressure sensor. Both operations can ensure that the first and second signals produce strongly correlated dynamic changes, meeting the signal quality requirements for synchronous analysis.
[0094] Example 2 See Figure 7 As shown, Figure 7 The diagram shows a multi-device data acquisition and synchronization device according to Embodiment 2 of this application, wherein the device includes: The first signal extraction module 701 is used to acquire CAN bus data through a CAN bus acquisition device and extract a first signal from the CAN bus data. The second signal extraction module 702 is used to acquire data from an external data acquisition device and extract a second signal from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity; The resampling processing module 703 is used to perform signal resampling processing on the first signal and the second signal so that the two signals have the same time sequence. The correlation analysis module 704 is used to perform time-domain correlation analysis on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal. The time shift module 705 is used to shift the CAN bus data or the external data acquisition device data according to the time delay amount, so as to achieve synchronization between the two.
[0095] In an optional implementation, the apparatus further includes a synchronization effect evaluation module for: The residual sequence is calculated based on the first signal in the time-shifted CAN bus data and the second signal in the data from the external data acquisition device. Calculate the normalized root mean square error based on the residual sequence; The synchronization effect is evaluated based on the normalized root mean square error.
[0096] In an optional implementation, the signal resampling process on the first signal and the second signal to make the two signals have the same time series includes: The signal with the lower sampling rate is linearly interpolated on the time axis of the signal with the higher sampling rate so that the two signals have the same time series length and the same number of data points.
[0097] In an optional implementation, the step of performing time-domain correlation analysis on the two resampled signals to determine the time delay of the resampled first signal relative to the resampled second signal includes: Calculate the cross-correlation function between the resampled first signal and the resampled second signal; Iterate through the number of delay points of the cross-correlation function to find the number of delay points that makes the cross-correlation function reach its absolute maximum value; The time delay is calculated based on the number of delay points and the sampling interval of the external data acquisition device.
[0098] In an optional implementation, the step of time-shifting the CAN bus data or the external data acquisition device data according to the time delay to achieve synchronization includes: Shift the timestamps of the CAN bus data by the time delay amount; or... The timestamps of the data from the external data acquisition device are shifted by the opposite number of the time delay.
[0099] In an optional implementation, the first signal and the second signal are acquired during a period when the vehicle performs a dynamic excitation operation, which is used to cause the physical quantity to change periodically.
[0100] In an optional implementation, the dynamic excitation operation includes a continuous acceleration and deceleration cycle, wherein the first signal and the second signal are vehicle speed signals; or, The dynamic excitation operation includes continuously pressing and releasing the brake pedal in a cycle, and the first signal and the second signal are brake master cylinder pressure signals.
[0101] Example 3 Based on the same application concept, see [link / reference] Figure 8 As shown, Figure 8 This illustration shows a structural schematic diagram of a computer device provided in Embodiment 3 of this application, wherein, as shown... Figure 8 As shown, the computer device 800 provided in Embodiment 3 of this application includes: The computer device 800 includes a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions that can be executed by the processor 801. When the computer device 800 is running, the processor 801 communicates with the memory 802 through the bus 803. When the machine-readable instructions are executed by the processor 801, the steps of the multi-device data acquisition synchronization method shown in Embodiment 1 are performed.
[0102] Example 4 Based on the same concept, this application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the steps of the multi-device data acquisition synchronization method described in any of the above embodiments.
[0103] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and apparatus described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0104] The computer program product for multi-device data acquisition and synchronization provided in this application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments. For specific implementation details, please refer to the method embodiments, which will not be repeated here.
[0105] The multi-device data acquisition and synchronization device provided in this application embodiment can be specific hardware on the device or software or firmware installed on the device. The implementation principle and technical effects of the device provided in this application embodiment are the same as those in the foregoing method embodiments. For the sake of brevity, any parts not mentioned in the device embodiment can be referred to the corresponding content in the foregoing method embodiments. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can all be referred to the corresponding processes in the above method embodiments, and will not be repeated here.
[0106] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0107] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0109] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0110] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0111] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A method for synchronizing data acquisition across multiple devices, characterized in that, The method includes: CAN bus data is acquired through a CAN bus acquisition device, and a first signal is extracted from the CAN bus data. Data is acquired from an external data acquisition device, and a second signal is extracted from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity; The first signal and the second signal are resampled to make the two signals have the same time sequence. Time-domain correlation analysis was performed on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal. Based on the time delay, the CAN bus data or the external data acquisition device data is time-shifted to achieve synchronization between the two.
2. The method according to claim 1, characterized in that, The method further includes: Based on the first signal in the time-shifted CAN bus data and the second signal in the external data acquisition device data, calculate the residual sequence; Calculate the normalized root mean square error based on the residual sequence; The synchronization effect is evaluated based on the normalized root mean square error.
3. The method according to claim 1, characterized in that, The step of resampling the first signal and the second signal to make the two signals have the same time series includes: The signal with the lower sampling rate is linearly interpolated on the time axis of the signal with the higher sampling rate so that the two signals have the same time series length and the same number of data points.
4. The method according to claim 1, characterized in that, The step of performing time-domain correlation analysis on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal includes: Calculate the cross-correlation function between the resampled first signal and the resampled second signal; Iterate through the number of delay points of the cross-correlation function to find the number of delay points that makes the cross-correlation function reach its absolute maximum value; The time delay is calculated based on the number of delay points and the sampling interval of the external data acquisition device.
5. The method according to claim 1, characterized in that, The step of time-shifting the CAN bus data or the external data acquisition device data according to the time delay to achieve synchronization includes: Shift the timestamps of the CAN bus data by the time delay amount; or... The timestamps of the data from the external data acquisition device are shifted by the opposite number of the time delay.
6. The method according to claim 1, characterized in that, The first signal and the second signal were collected during the period when the vehicle performed a dynamic excitation operation, which was used to cause the physical quantity to change periodically.
7. The method according to claim 6, characterized in that, The dynamic excitation operation includes a continuous acceleration and deceleration cycle, and the first signal and the second signal are vehicle speed signals; or, The dynamic excitation operation includes continuously pressing and releasing the brake pedal in a cycle, and the first signal and the second signal are brake master cylinder pressure signals.
8. A multi-device data acquisition and synchronization device, characterized in that, The device includes: The first signal extraction module is used to acquire CAN bus data through a CAN bus acquisition device and extract a first signal from the CAN bus data. The second signal extraction module is used to acquire data from an external data acquisition device and extract a second signal from the data from the external data acquisition device, wherein the first signal and the second signal originate from the same physical quantity; The resampling processing module is used to perform signal resampling processing on the first signal and the second signal so that the two signals have the same time sequence. The correlation analysis module is used to perform time-domain correlation analysis on the two resampled signals to determine the time delay of the first resampled signal relative to the second resampled signal. The time shift module is used to shift the CAN bus data or the external data acquisition device data according to the time delay, so as to achieve synchronization between the two.
9. A computer device, characterized in that, include: The computer device includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the computer device is running, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, they perform the steps of the multi-device data acquisition synchronization method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the steps of the multi-device data acquisition synchronization method as described in any one of claims 1 to 7.