Data playback synchronization method, device, electronic device and storage medium
By using the clock of the radar host computer to synchronize the playback time of radar and camera data during the data playback process, the problem of synchronization of radar data and camera data is solved, the accuracy and reliability of analysis are improved, and R&D personnel can better judge the radar. performance.
Patent Information
- Application Number
- CN202211520397.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-11-28
AI Technical Summary
During the data playback process, the synchronization problem between radar data and camera data makes it difficult for R&D personnel to accurately analyze radar performance indicators, making it difficult to judge missed detections and false detections.
By introducing the clock of the radar host computer as a reference clock, the playback time of radar data and camera data is synchronized, and the local playback time of each frame of data is calculated and adjusted to achieve synchronous playback of radar data and camera data.
It effectively solves the problem of out-of-synchronization between radar data and camera video during data playback, improves the authenticity and reliability of analysis, and helps developers more accurately judge radar performance indicators.
Smart Images

Figure CN115883748B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data playback synchronization method, device, electronic device and storage medium. Background Art
[0002] As the eyes of intelligent driving, automotive radar is increasingly used. In order to better study radar, analyze radar performance indicators, and determine whether missed detection and false detection occur, such as Figure 1 As shown, radar manufacturers usually install multiple radars and cameras on the vehicle, collect radar data and camera data through a large number of road tests, and then R&D personnel discover radar problems by replaying the collected data.
[0003] During data playback, the display of radar data and camera data on the radar host computer should theoretically be completely consistent with the display on the radar host computer during real-time data acquisition. However, in reality, the display of radar and camera data is inconsistent, which causes great problems for R&D personnel to analyze radar data. The fundamental reason is that the radar data and camera data are not synchronized during playback. Summary of the invention
[0004] In order to solve the problems of the prior art, the embodiments of the present application provide a data playback synchronization method, device, electronic device and storage medium. The technical solution is as follows:
[0005] In one aspect, a data playback synchronization method is provided, the method comprising:
[0006] Get multiple frames of radar data and multiple frames of camera data to be played back synchronously;
[0007] Play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local playback time of the first frame; the local playback time of the first frame is the time indicated by the reference clock during the playback;
[0008] Determine a radar reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of radar data, and determine a camera reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of camera data;
[0009] Determine the local playback time of each remaining frame of radar data based on the radar reference time difference and the local time; and determine the local playback time of each remaining frame of camera data based on the camera reference time difference and the local time; the local time is the time indicated by the reference clock;
[0010] Based on the local play time of each remaining frame of radar data and the local play time of each remaining frame of camera data, the corresponding frame of radar data and the corresponding frame of camera data are played respectively.
[0011] On the other hand, a data playback synchronization device is provided, the device comprising:
[0012] A data acquisition module is used to acquire multiple frames of radar data and multiple frames of camera data to be synchronously played back;
[0013] A first data playback module is used to play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local playback time of the first frame; the local playback time of the first frame is the time indicated by the reference clock during the playback;
[0014] a reference determination module, configured to determine a radar reference time difference based on a local playback time of the first frame and a collection time of the first frame of radar data, and to determine a camera reference time difference based on a local playback time of the first frame and a collection time of the first frame of camera data;
[0015] a play time determination module, configured to determine the local play time of each remaining frame of radar data based on the radar reference time difference and the local time; and to determine the local play time of each remaining frame of camera data based on the camera reference time difference and the local time; the local time being the time indicated by the reference clock;
[0016] The second data playback module is used to play the corresponding frame radar data and the corresponding frame camera data respectively based on the local playback time of each remaining frame radar data and the local playback time of each remaining frame camera data.
[0017] In an exemplary embodiment, the playback time determination module includes:
[0018] A radar frame determination module, used to determine the current frame radar data to be played among the remaining frames of radar data;
[0019] A first sum value determination module, used to determine the sum value of the radar reference time difference and the local time;
[0020] The first determination module is used to determine the local time as the local playback time of the current frame radar data when the sum value is greater than or equal to the acquisition time of the current frame radar data.
[0021] In an exemplary embodiment, the device further includes a first time determination module for determining a local playback time of the current frame radar data, the first time determination module including:
[0022] A first waiting module, configured to wait for a first preset time length when the sum value is less than the acquisition time of the current frame radar data;
[0023] A second sum value determination module, used for determining the sum value of the radar reference time difference and the local time when the waiting time reaches the first preset time;
[0024] A second waiting module is used for executing the step of waiting for a first preset time if the sum value is less than the acquisition time of the current frame radar data, and stopping the waiting until the sum value is greater than or equal to the acquisition time of the current frame radar data;
[0025] The second determining module is used to determine the local time when the waiting is stopped as the local playing time of the current frame radar data.
[0026] In an exemplary embodiment, the playback time determination module includes:
[0027] A camera frame determination module, used to determine the current frame of camera data to be played among the remaining frames of camera data;
[0028] A difference determination module, used to determine the sum of the acquisition time of the current frame camera data and the camera reference time difference, and determine the difference between the local time and the sum;
[0029] A third waiting module, configured to wait for a second preset time period when the difference is a negative value;
[0030] The third determination module is used to determine the local time as the local playback time of the current frame camera data when the waiting time reaches the second preset time.
[0031] In an exemplary embodiment, the device further includes a second time determination module for determining the local playback time of the current frame of camera data, the second time determination module including:
[0032] A first threshold value acquisition module, used for acquiring a first preset synchronization threshold value when the difference is a positive value;
[0033] The fourth determination module is used to determine the local time as the local playback time of the current frame camera data when the difference is less than or equal to the first preset synchronization threshold.
[0034] In an exemplary embodiment, the device further includes a third time determination module for determining the local playback time of the current frame camera data, and the third time determination module includes:
[0035] A second threshold acquisition module, configured to acquire a second preset synchronization threshold when the difference is greater than the first preset synchronization threshold;
[0036] The fifth determination module is used to, when the difference is less than or equal to the second preset synchronization threshold, subtract the second preset duration from the local time to obtain the local playback time of the current frame camera data.
[0037] In an exemplary embodiment, the device further includes a data discarding module for discarding the current frame camera data, the data discarding module including:
[0038] A data discarding module is used to discard the current frame camera data when the difference is greater than the second preset synchronization threshold.
[0039] On the other hand, an electronic device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement the data playback synchronization method of any of the above aspects.
[0040] On the other hand, a computer-readable storage medium is provided, in which at least one instruction or at least one program is stored, and the at least one instruction or the at least one program is loaded and executed by a processor to implement a synchronization method for data playback as described in any of the above aspects.
[0041] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of an electronic device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the electronic device performs the synchronization method of data playback in any of the above aspects.
[0042] The embodiment of the present application introduces the clock of the radar host computer as a reference clock, and synchronizes the radar data and the camera data with the clock of the radar host computer respectively, which can effectively solve the problem of asynchrony between the radar data and the camera video during data playback, and assist R&D personnel to more accurately determine whether the radar has missed detections and false detections, which greatly facilitates R&D personnel to analyze radar data and improves the authenticity and reliability of playback. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments 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 creative work.
[0044] Figure 1 This is a common deployment diagram of radar and camera installed on a road test vehicle provided in an embodiment of the present application;
[0045] Figure 2 It is a flowchart of a synchronization method for data playback provided in an embodiment of the present application;
[0046] Figure 3 It is a flowchart of a synchronization method for radar data playback provided in an embodiment of the present application;
[0047] Figure 4 It is a flowchart of a synchronization method for camera data playback provided in an embodiment of the present application;
[0048] Figure 5 It is a structural block diagram of a data playback synchronization device provided in an embodiment of the present application;
[0049] Figure 6 It is a hardware structure block diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0052] It is understandable that in the specific implementation of this application, related data such as user information is involved. When the above embodiments of this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0053] See also Figure 2 , which shows a flow chart of a synchronization method for data playback provided in an embodiment of the present application. It should be noted that this specification provides method operation steps as described in the embodiment or flow chart, but may include more or fewer operation steps based on conventional or non-creative labor. The order of steps listed in the embodiment is only one way of executing the steps among many orders, and does not represent the only order of execution. When the system or product is executed in practice, it can be executed in sequence or in parallel (for example, in a parallel processor or multi-threaded processing environment) according to the method shown in the embodiment or the accompanying drawings. Specifically, Figure 2 As shown, the method may include:
[0054] S201, obtaining multiple frames of radar data and multiple frames of camera data to be synchronously played back.
[0055] Among them, radar data is data collected by the radar installed on the road test vehicle, such as Figure 1 As shown in the figure, the common radar deployment on the road test car is 4 corner radars (left front, right front, left rear and right rear), 1 forward radar, 1 rear radar, 1 left radar and 1 right radar. For radar data, while recording the raw data, it is also necessary to record the time when each frame of raw data is collected.
[0056] The camera data is the video captured by the camera installed on the road test vehicle, including the time when each frame of video was captured, such as Figure 1 As shown in the figure, the common camera deployment on the road test car is 1 forward camera, 1 rearward camera, 1 left camera and 1 right camera; and the camera data and radar data record the data of the same time period. When playing back the camera data and radar data, multiple channels of data are synchronized, which makes it easier for R&D personnel to find out whether the radar has missed detection and false detection by playing back the camera data.
[0057] S203, play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local play time of the first frame.
[0058] The local playback time of the first frame is the time indicated by the reference clock during the playback.
[0059] Among them, the reference clock is the clock of the radar host computer. The radar data and camera data are played back by the radar host computer. At the same time, the clock of the radar host computer is used as the reference clock. During the playback, the local playback time of multiple frames of radar data and the local playback time of multiple frames of camera data are synchronized with the reference clock respectively, thereby completing the synchronization of the local playback time of multiple frames of radar data and the local playback time of multiple frames of camera data.
[0060] Specifically, the first frame of radar data and the first frame of camera data are played at the same time, then the time indicated by the reference clock when the first frame of radar data is played is the same as the time indicated by the reference clock when the first frame of camera data is played, that is, the synchronous playback of the first frame of radar data and the first frame of camera data is completed, which is the prerequisite for the subsequent synchronous playback of each remaining frame of radar data and each remaining frame of camera data.
[0061] Specifically, the playback time of the first frame is recorded, that is, the time indicated by the reference clock when the first frame of radar data and the first frame of camera data are played, so as to calibrate each remaining frame of radar data frame by frame based on the playback time of the first frame, and calibrate each remaining frame of camera data frame by frame based on the playback time of the first frame.
[0062] S205: Determine a radar reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of radar data, and determine a camera reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of camera data.
[0063] The acquisition time of the first frame of radar data is the time when the radar acquires the first frame of data.
[0064] The radar reference time difference is the difference between the time indicated by the reference clock when the first frame of radar data is played and the time when the first frame of radar data is collected. When calibrating each remaining frame of radar data, it is necessary to ensure that the difference between the time indicated by the reference clock when the current frame of radar data is played and the time when the current frame of radar data is collected is within a certain range from the radar reference time difference. The higher the user's requirements for data synchronization, the smaller the range needs to be set, so as to complete the synchronization of the radar data and the reference clock time.
[0065] The acquisition time of the first frame of camera data is the time when the camera acquires the first frame of data.
[0066] The camera reference time is the difference between the time indicated by the reference clock when the first frame of camera data is played and the time when the first frame of camera data is collected. When calibrating each remaining frame of camera data, it is necessary to ensure that the difference between the time indicated by the reference clock when the current frame of camera data is played and the time when the current frame of camera data is collected is within a certain range from the camera reference time difference. The higher the user's requirements for data synchronization, the smaller the range needs to be set, so as to complete the synchronization of the camera data and the reference clock time.
[0067] S207, determining the local playback time of each remaining frame of radar data based on the radar reference time difference and the local time; and determining the local playback time of each remaining frame of camera data based on the camera reference time difference and the local time.
[0068] The local time is the time indicated by the reference clock.
[0069] The local playback time of radar data is the time indicated by the reference clock when the radar data is played. In a specific implementation, when the radar reference time difference, the local time and the acquisition time of the current frame radar data meet a certain comparison relationship, the local time is determined as the local playback time of the current frame radar data. If not, wait for a certain period of time until the local time at the end of the waiting period can make the above time values meet the above comparison relationship, that is, the difference between the local time and the acquisition time of the current frame radar data and the radar reference time difference is kept within a certain range, which is the range represented by the above duration. The smaller the duration is set, the higher the degree of data synchronization is.
[0070] The local playback time of the camera data is the time indicated by the reference clock when the camera data is played. In the specific implementation, when the camera reference time difference, the local time and the acquisition time of the current frame camera data meet a certain comparison relationship, the local time is determined as the local playback time of the current frame camera data. If not, the current frame camera data is played back in a delayed or advanced manner, or the current frame camera data is dropped, depending on the result of the above comparison. That is, the difference between the local playback time of the current frame camera data and the acquisition time of the current frame camera data and the camera reference time difference is kept within a certain range. The smaller the range is set, the higher the degree of data synchronization is.
[0071] In an exemplary embodiment, see Figure 3 , which is a schematic flow chart of a synchronization method for radar data playback provided in an embodiment of the present application, the above step S207 may include:
[0072] S301, determining the current frame radar data to be played in the remaining frames radar data.
[0073] The remaining frame radar data is radar data that has not been played in this round of playback of multiple frames of radar data.
[0074] The current frame radar data is the first frame radar data in the remaining frame radar data.
[0075] S303, determining the sum of the radar reference time difference and the local time.
[0076] The radar reference time difference is the difference between the time indicated by the reference clock when the first frame of radar data is played and the time when the first frame of radar data is collected.
[0077] The local time is the time currently indicated by the reference clock.
[0078] S305: Determine whether the sum is greater than or equal to the acquisition time of the current frame of radar data.
[0079] Specifically, the sum value is compared with the acquisition time of the current frame radar data, that is, the sum value of the radar reference time difference and the local time is compared with the acquisition time of the current frame radar data, that is, the difference between the local time and the acquisition time of the current frame radar data, and the difference between the local time when the first frame radar data is played and the acquisition time of the first frame radar data. The two differences are compared and calibrated, and finally the difference between the two differences is kept within a certain range, and the local time at this time is determined as the local playback time of the current frame radar data, thus completing the synchronization of the radar data with the reference clock. In the specific implementation, the calibration process is completed by waiting for the local time to increase.
[0080] Specifically, if the result of the judgment is yes, step S307 can be executed; otherwise, if the result of the judgment is no, step S309 can be executed.
[0081] S307: Determine the local time as the local playback time of the current frame of radar data.
[0082] The local playback time is the local time that meets the comparison condition, or the local time that meets the comparison condition after calibration, and the comparison condition is specifically that the sum of the radar reference time difference and the local time is greater than or equal to the acquisition time of the current frame radar data. In a specific implementation, the local time that meets the comparison condition is determined as the local playback time of the current frame radar data, and the radar host computer plays the current frame radar data according to the local playback time of the current frame radar data, so as to complete the synchronous playback of the radar data.
[0083] S309: Wait until the waiting time reaches the first preset time.
[0084] Among them, waiting refers to the waiting of the radar host computer, which achieves the effect of increasing local time.
[0085] Among them, the first preset duration is the preset single waiting duration of the radar host computer. Specifically, when the sum of the radar reference time difference and the local time is less than the acquisition time of the current frame radar data, the radar host computer waits for the first preset duration, recalculates the sum of step S303 based on the local time at the end of the waiting, and re-performs the judgment of step S305 based on the recalculated sum. When the judgment result is yes, the local time is determined as the local playback time of the current frame radar data. When the judgment result is no, re-execute the waiting of step S309 until the judgment result is yes, the waiting ends, thereby determining the local playback time of the current frame radar data. In specific implementation, while requiring high synchronization accuracy, considering the influence of computer performance, the value of the first preset duration is usually 2 milliseconds.
[0086] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application sets comparison conditions for the radar reference time difference, the local time and the acquisition time of the current frame radar data, and determines the local time when the conditions are met as the local playback time of the current frame radar data, so that the difference between the local playback time and the acquisition time of the current frame radar data and the radar reference time difference is maintained within a certain range, and based on this, the local playback time of each remaining frame of radar data is determined, thereby completing the synchronization of the local playback time of each remaining frame of radar data with the reference clock time.
[0087] In an exemplary embodiment, see Figure 4 , which is a flow chart of a synchronization method for camera data playback provided in an embodiment of the present application, the above step S207 may include:
[0088] S401, determining the current frame of camera data to be played among the remaining frames of camera data.
[0089] The remaining frame camera data refers to the camera data of the multiple frames of camera data that have not been played in this round of playback.
[0090] The current frame of camera data is the first frame of camera data among the remaining frames of camera data.
[0091] S403, determining the sum of the acquisition time of the current frame camera data and the camera reference time difference, and determining the difference between the local time and the sum.
[0092] The acquisition time of the current frame camera data is the time when the camera acquires the current frame data;
[0093] The camera reference time difference is the difference between the time indicated by the reference clock when playing the first frame of camera data and the time when the first frame of camera data is collected.
[0094] The local time is the time currently indicated by the reference clock.
[0095] S405: Determine whether the difference is a negative value.
[0096] Specifically, the comparison of the positive and negative differences is the comparison of the difference between the local time and the acquisition time of the current frame camera data with the camera reference time difference, that is, the comparison of the difference between the local time and the acquisition time of the current frame camera data with the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data. Depending on the size and gap of these two differences, it is determined whether the current frame camera data is played directly, delayed, played in advance, or directly discarded.
[0097] Specifically, when the difference is a negative value, the difference between the local time and the acquisition time of the current frame camera data is smaller than the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data, that is, smaller than the camera reference time difference. If the local time is determined as the local playback time of the current frame camera data, then the playback speed of the current frame camera data is faster than the reference clock time, so delayed playback is required. When the difference is a positive value, the difference between the local time and the acquisition time of the current frame camera data is greater than or equal to the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data, that is, greater than or equal to the camera reference time difference. The local playback time of the current frame camera data needs to be determined based on the difference between these two differences.
[0098] Specifically, if the result of the judgment is yes, step S407 can be executed; otherwise, if the result of the judgment is no, step S4011 can be executed.
[0099] S407: Wait until the waiting time reaches a second preset time.
[0100] Among them, waiting refers to the waiting of the radar host computer, which achieves the effect of increasing local time.
[0101] The second preset duration is the preset waiting duration of the radar host computer. In a specific implementation, when the difference is a negative value, the radar host computer waits for the second preset duration, and determines the local time at the end of the waiting as the local playback time of the current frame camera data, thereby achieving the effect of delaying the playback of the current frame camera data. In a specific implementation, while requiring high synchronization accuracy, considering the impact of computer performance, the value of the first preset duration is usually 2 milliseconds.
[0102] S409: Determine the local time as the local play time of the current frame of camera data.
[0103] The local playback time is the local time that meets the comparison condition, or the adjusted local time, and the comparison condition is specifically that the difference is a positive value less than or equal to the first preset synchronization threshold. In a specific implementation, after determining the local playback time of the current frame camera data, the radar host computer plays the current frame camera data according to the local playback time of the current frame camera data, thereby completing the synchronous playback of the current frame camera data.
[0104] S4011, obtaining a first preset synchronization threshold.
[0105] The first preset synchronization threshold is an acceptable playback delay value selected by the user within a preset range. In a specific implementation, the range is 10 milliseconds to 100 milliseconds, wherein 10 milliseconds is the maximum accuracy that can be achieved in this embodiment due to the limitation of the hardware device, and 100 milliseconds is the maximum delay that the naked eye cannot distinguish that the data playback is out of sync. The user can select a value within this range as the first preset synchronization threshold according to the synchronization requirements. The higher the value of the first preset synchronization threshold, the higher the synchronization degree of the data playback. Of course, the smaller the value, the higher the requirement for the hardware device.
[0106] S4013: Determine whether the difference is less than or equal to the first preset synchronization threshold.
[0107] Specifically, the comparison between the difference and the first preset synchronization threshold is the judgment of the size of the gap between the local time and the acquisition time of the current frame camera data and the camera reference time difference, that is, the judgment of the size of the gap between the local time and the acquisition time of the current frame camera data and the local playback time of the first frame camera data and the acquisition time of the first frame camera data. According to the size of the gap between the two differences, it is determined whether the current frame camera data is played directly, played in advance, or directly discarded.
[0108] Specifically, when the difference is less than or equal to the first preset synchronization threshold, the difference between the local time and the acquisition time of the current frame camera data and the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data is within an acceptable playback delay range, that is, the difference reaches the synchronization accuracy set by the user, and therefore can be played directly; when the difference is greater than the first preset synchronization threshold, the above gap exceeds the acceptable playback delay range and fails to reach the synchronization accuracy set by the user, and therefore it is necessary to further determine, based on the size of the gap, whether the current frame camera data should be played in advance or directly discarded.
[0109] Specifically, if the result of the judgment is yes, step S409 can be executed; otherwise, if the result of the judgment is no, step S4015 can be executed.
[0110] S4015: Obtain a second preset synchronization threshold.
[0111] The second preset synchronization threshold is the maximum delay value. When the delay of data playback exceeds this value, the current frame of camera data can be discarded. In specific implementation, the value of the second preset synchronization threshold is usually 500 milliseconds. Since the video refresh rate of cameras on the market is mostly 60 Hz, that is, 60 frames per second, one frame is 16.7 milliseconds, and 500 milliseconds is about 30 frames. If the playback delay exceeds 500 milliseconds, it is about 30 frames slower. These 30 frames are discarded to make the camera data catch up with the reference clock as soon as possible.
[0112] S4017: Determine whether the difference is less than or equal to the second preset synchronization threshold.
[0113] Specifically, the comparison between the difference and the second preset synchronization threshold is the judgment of the size of the gap between the local time and the acquisition time of the current frame camera data and the camera reference time difference, that is, the judgment of the size of the gap between the local time and the acquisition time of the current frame camera data and the local playback time of the first frame camera data and the acquisition time of the first frame camera data. According to the size of the gap between the two differences, it is determined whether the current frame camera data is played in advance or directly discarded.
[0114] Specifically, when the difference is less than or equal to the second preset synchronization threshold, the difference between the local time and the acquisition time of the current frame camera data and the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data are still within an adjustable range, that is, the delay of the camera data playback can still be adjusted in time, so the current frame camera data can be played in advance; when the difference is greater than the second preset synchronization threshold, the above gap exceeds the adjustable range, and there is no time to adjust the camera data frame by frame, so the current frame camera data is directly discarded.
[0115] Specifically, if the result of the judgment is yes, step S4019 can be executed; otherwise, if the result of the judgment is no, step S4021 can be executed.
[0116] S4019: Subtract the second preset duration from the local time to obtain the local playback time of the current frame of camera data.
[0117] Among them, the local time is subtracted from the second preset time length, that is, the current frame camera data is played in advance of the second preset time length. In a specific implementation, when the difference is less than or equal to the second preset synchronization threshold, the current frame camera data is played in advance of the second preset time length, and after the local playback time of the current frame camera data is determined, the current frame camera data is played according to the local playback time of the current frame camera data by the radar host computer, so that the synchronous playback of the current frame camera data can be completed.
[0118] S4021, discard the current frame camera data.
[0119] Specifically, when the difference is greater than the second preset synchronization threshold, the difference between the local time and the acquisition time of the current frame camera data and the difference between the local playback time of the first frame camera data and the acquisition time of the first frame camera data has exceeded the range that can be adjusted in time, so the current frame camera data is directly discarded. In a specific implementation, the value of the second preset synchronization threshold is usually 500 milliseconds. Since the refresh rate of camera videos on the market is mostly 60 Hz, the playback delay exceeds 500 milliseconds, which is about 30 frames slower. 30 frames of camera data need to be discarded to make the camera data catch up with the reference clock as soon as possible.
[0120] It can be seen from the above technical solutions of the embodiment of the present application that the embodiment of the present application sets comparison conditions for the camera reference time difference, local time and acquisition time of the current frame camera data, and determines the local playback time of the current frame camera data frame by frame according to different situations, so that the difference between the local playback time and acquisition time of the current frame camera data and the camera reference time difference is maintained within a certain range, and based on this, the local playback time of each remaining frame of camera data is determined, thereby completing the synchronization of the local playback time of each remaining frame of radar data with the reference clock time.
[0121] S209: Based on the local play time of each remaining frame of radar data and the local play time of each remaining frame of camera data, respectively play the corresponding frame of radar data and the corresponding frame of camera data.
[0122] Specifically, the current frame radar data is played by the radar host computer according to the local playback time of the current frame radar data, and the current frame camera data is played by the radar host computer according to the local playback time of the current frame camera data. When the acquired multi-frame radar data and multi-frame camera data are played, the synchronous playback of the multi-frame radar data and the multi-frame camera data is completed.
[0123] In specific implementation, the data playback synchronization method described in this embodiment can be applied not only to the synchronized playback of camera data and radar data, but also to the synchronized playback of multi-channel radar data and the synchronized playback of multi-channel camera data; this embodiment synchronizes the playback of camera data and radar data, which makes it easier for R&D personnel to discover whether the radar has missed detections and false detections by playing back camera data.
[0124] It can be seen from the above technical solutions of the embodiments of the present application that the embodiments of the present application introduce the clock of the radar host computer as a reference clock, and synchronize the radar data and the camera data with the clock of the radar host computer respectively, which can effectively solve the problem of asynchrony between radar data and camera video during data playback, and assist R&D personnel to more accurately judge whether the radar has missed detections and false detections, which greatly facilitates R&D personnel to analyze radar data and improves the authenticity and reliability of playback.
[0125] Corresponding to the data playback synchronization method provided in the above-mentioned embodiments, the embodiment of the present application also provides a data playback synchronization device. Since the data playback synchronization device provided in the embodiment of the present application corresponds to the data playback synchronization method provided in the above-mentioned embodiments, the implementation method of the aforementioned data playback synchronization method is also applicable to the data playback synchronization device provided in this embodiment, and will not be described in detail in this embodiment.
[0126] See also Figure 5 , which is a schematic diagram of the structure of a data playback synchronization device provided in an embodiment of the present application, the device has the function of implementing the data playback synchronization method in the above method embodiment, and the function can be implemented by hardware or by hardware executing corresponding software. Figure 5 As shown, the device may include:
[0127] A data acquisition module 510 is used to acquire multiple frames of radar data and multiple frames of camera data to be synchronously played back;
[0128] The first data playback module 520 is used to play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local playback time of the first frame; the local playback time of the first frame is the time indicated by the reference clock during the playback;
[0129] A reference determination module 530, configured to determine a radar reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of radar data, and to determine a camera reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of camera data;
[0130] The play time determination module 540 is used to determine the local play time of each remaining frame of radar data based on the radar reference time difference and the local time; and to determine the local play time of each remaining frame of camera data based on the camera reference time difference and the local time; the local time is the time indicated by the reference clock;
[0131] The second data playback module 550 is used to play the corresponding frame radar data and the corresponding frame camera data respectively based on the local playback time of each remaining frame radar data and the local playback time of each remaining frame camera data.
[0132] In an exemplary embodiment, the playback time determination module includes:
[0133] A radar frame determination module, used to determine the current frame radar data to be played among the remaining frames of radar data;
[0134] A first sum value determination module, used to determine the sum value of the radar reference time difference and the local time;
[0135] The first determination module is used to determine the local time as the local playback time of the current frame radar data when the sum value is greater than or equal to the acquisition time of the current frame radar data.
[0136] In an exemplary embodiment, the device further includes a first time determination module for determining a local playback time of the current frame radar data, the first time determination module including:
[0137] A first waiting module, configured to wait for a first preset time length when the sum value is less than the acquisition time of the current frame radar data;
[0138] A second sum value determination module, used for determining the sum value of the radar reference time difference and the local time when the waiting time reaches the first preset time;
[0139] A second waiting module is used for executing the step of waiting for a first preset time if the sum value is less than the acquisition time of the current frame radar data, and stopping the waiting until the sum value is greater than or equal to the acquisition time of the current frame radar data;
[0140] The second determining module is used to determine the local time when the waiting is stopped as the local playing time of the current frame radar data.
[0141] In an exemplary embodiment, the playback time determination module includes:
[0142] A camera frame determination module, used to determine the current frame of camera data to be played among the remaining frames of camera data;
[0143] A difference determination module, used to determine the sum of the acquisition time of the current frame camera data and the camera reference time difference, and determine the difference between the local time and the sum;
[0144] A third waiting module, configured to wait for a second preset time period when the difference is a negative value;
[0145] The third determination module is used to determine the local time as the local playback time of the current frame camera data when the waiting time reaches the second preset time.
[0146] In an exemplary embodiment, the device further includes a second time determination module for determining the local playback time of the current frame of camera data, the second time determination module including:
[0147] A first threshold value acquisition module, used for acquiring a first preset synchronization threshold value when the difference is a positive value;
[0148] The fourth determination module is used to determine the local time as the local playback time of the current frame camera data when the difference is less than or equal to the first preset synchronization threshold.
[0149] In an exemplary embodiment, the device further includes a third time determination module for determining the local playback time of the current frame camera data, and the third time determination module includes:
[0150] A second threshold acquisition module, configured to acquire a second preset synchronization threshold when the difference is greater than the first preset synchronization threshold;
[0151] The fifth determination module is used to, when the difference is less than or equal to the second preset synchronization threshold, subtract the second preset duration from the local time to obtain the local playback time of the current frame camera data.
[0152] In an exemplary embodiment, the device further includes a data discarding module for discarding the current frame camera data, the data discarding module including:
[0153] A data discarding module is used to discard the current frame camera data when the difference is greater than the second preset synchronization threshold.
[0154] It should be noted that the device provided in the above embodiment, when implementing its functions, is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device is divided into different functional modules to complete all or part of the functions described above. In addition, the device and method embodiments provided in the above embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.
[0155] An embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by the processor to implement any one of the data playback synchronization methods provided in the above method embodiments.
[0156] The memory can be used to store software programs and modules. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, application programs required for functions, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory and can also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory can also include a memory controller to provide the processor with access to the memory.
[0157] The method embodiments provided in the embodiments of the present application may be executed in a computer terminal, a server or a similar computing device, that is, the above-mentioned electronic device may include a computer terminal, a server or a similar computing device. Figure 6 is a hardware structure block diagram of a computer device for running a data playback synchronization method provided by an embodiment of the present invention, such as Figure 6 As shown, the internal structure of the computer device may include but is not limited to: a processor, a network interface and a memory. The processor, the network interface and the memory in the computer device may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0158] Among them, the processor (or CPU (Central Processing Unit)) is the computing core and control core of the computer device. The network interface may optionally include a standard wired interface, a wireless interface (such as WI-FI, a mobile communication interface, etc.). Memory is a memory device in a computer device for storing programs and data. It is understandable that the memory here can be a high-speed RAM storage device or a non-volatile memory device, such as at least one disk storage device; optionally, it can also be at least one storage device located away from the aforementioned processor. The memory provides a storage space, which stores the operating system of the electronic device, which may include but is not limited to: Windows system (an operating system), Linux (an operating system), Android (Android, a mobile operating system) system, IOS (a mobile operating system) system, etc., and the present invention is not limited to this; and, in the storage space, one or more instructions suitable for being loaded and executed by the processor are also stored, and these instructions can be one or more computer programs (including program codes). In the embodiment of this specification, the processor loads and executes one or more instructions stored in the memory to implement the synchronization method of data playback provided in the above method embodiment. An embodiment of the present application also provides a computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one program related to a method for implementing a synchronization of data playback. The at least one instruction or the at least one program is loaded and executed by the processor to implement any one of the methods for implementing a synchronization of data playback provided in the above method embodiments.
[0159] Optionally, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store program codes.
[0160] It should be noted that the above-mentioned sequence of the embodiments of the present application is for description only and does not represent the advantages and disadvantages of the embodiments. The above-mentioned specific embodiments of this specification are described. Other embodiments are within the scope of the attached claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0161] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0162] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0163] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A data playback synchronization method, characterized in that: The method comprises: Get multiple frames of radar data and multiple frames of camera data to be played back synchronously; Play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local playback time of the first frame; the local playback time of the first frame is the time indicated by the reference clock during the playback; Determine a radar reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of radar data, and determine a camera reference time difference based on the local playback time of the first frame and the acquisition time of the first frame of camera data; Determine the local playback time of each remaining frame of radar data based on the radar reference time difference and the local time; and determine the local playback time of each remaining frame of camera data based on the camera reference time difference and the local time; the local time is the time indicated by the reference clock; Based on the local play time of each remaining frame of radar data and the local play time of each remaining frame of camera data, respectively, the corresponding frame of radar data and the corresponding frame of camera data are played; Among them, the local playback time of each remaining frame of camera data is determined based on the camera reference time difference and the local time, including: determining the current frame of camera data to be played in the remaining frames of camera data; determining the sum of the acquisition time of the current frame of camera data and the camera reference time difference, and determining the difference between the local time and the sum; when the difference is a positive value, obtaining a first preset synchronization threshold; when the difference is less than or equal to the first preset synchronization threshold, determining the local time as the local playback time of the current frame of camera data.
2. The data playback synchronization method according to claim 1, characterized in that: The determining, based on the radar reference time difference and the local time, the local playback time of each remaining frame of radar data comprises: Determine the current frame radar data to be played among the remaining frames radar data; Determining the sum of the radar reference time difference and the local time; When the sum is greater than or equal to the acquisition time of the current frame radar data, the local time is determined as the local playback time of the current frame radar data.
3. The data playback synchronization method according to claim 2, characterized in that: The method further comprises: When the sum is less than the acquisition time of the current frame radar data, waiting for a first preset time length; When the waiting time reaches the first preset time, determining the sum of the radar reference time difference and the local time; If the sum is less than the acquisition time of the current frame radar data, executing the step of waiting for the first preset time length until the sum is greater than or equal to the acquisition time of the current frame radar data, and stopping the waiting; The local time when the waiting is stopped is determined as the local playback time of the current frame radar data.
4. The data playback synchronization method according to claim 1, characterized in that: The method further comprises: When the difference is a negative value, waiting for a second preset time length; When the waiting time reaches the second preset time, the local time is determined as the local playback time of the current frame of camera data.
5. The data playback synchronization method according to claim 4, characterized in that: The method further comprises: When the difference is greater than the first preset synchronization threshold, obtaining a second preset synchronization threshold; When the difference is less than or equal to the second preset synchronization threshold, the second preset duration is subtracted from the local time to obtain the local playback time of the current frame of camera data.
6. The data playback synchronization method according to claim 5, characterized in that: The method further comprises: When the difference is greater than the second preset synchronization threshold, the current frame camera data is discarded.
7. A data playback synchronization device, characterized in that: The device comprises: A data acquisition module is used to acquire multiple frames of radar data and multiple frames of camera data to be synchronously played back; A first data playback module is used to play the first frame of radar data in the multiple frames of radar data and the first frame of camera data in the multiple frames of camera data, and record the local playback time of the first frame; the local playback time of the first frame is the time indicated by the reference clock during the playback; a reference determination module, configured to determine a radar reference time difference based on a local playback time of the first frame and a collection time of the first frame of radar data, and to determine a camera reference time difference based on a local playback time of the first frame and a collection time of the first frame of camera data; a play time determination module, configured to determine the local play time of each remaining frame of radar data based on the radar reference time difference and the local time; and to determine the local play time of each remaining frame of camera data based on the camera reference time difference and the local time; the local time being the time indicated by the reference clock; A second data playback module is used to play the corresponding frame radar data and the corresponding frame camera data respectively based on the local playback time of each remaining frame radar data and the local playback time of each remaining frame camera data; Among them, the local playback time of each remaining frame of camera data is determined based on the camera reference time difference and the local time, including: determining the current frame of camera data to be played in the remaining frames of camera data; determining the sum of the acquisition time of the current frame of camera data and the camera reference time difference, and determining the difference between the local time and the sum; when the difference is a positive value, obtaining a first preset synchronization threshold; when the difference is less than or equal to the first preset synchronization threshold, determining the local time as the local playback time of the current frame of camera data.
8. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores at least one instruction or at least one program, and the at least one instruction or at least one program is loaded and executed by the processor to implement the data playback synchronization method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one instruction or at least one program, and the at least one instruction or the at least one program is loaded and executed by a processor to implement the data playback synchronization method according to any one of claims 1 to 6.
