Method, system and computer readable medium for data playback
By converting the original data into a target message and outputting it based on the time sequence of recording, the problem of inefficient data playback in the prior art is solved, and efficient playback of data in various formats and comprehensive reproduction of business scenarios is achieved.
Patent Information
- Application Number
- CN202311087112.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-28
- Publication Date
- 2025-02-28
AI Technical Summary
The prior art is inefficient in data playback and cannot fully reproduce business scenarios from different data sources.
Data playback is achieved by determining the original format of the original data, converting it into a target message, and outputting it to the corresponding interface based on the recording time sequence.
It supports raw data playback in various formats, improves data playback efficiency and can fully reproduce business scenarios.
Smart Images

Figure CN119537450A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing, and in particular, to a method, system, and computer-readable medium for data playback. Background Art
[0002] In many business scenarios, a large amount of various data can be collected from different data sources. In order to reproduce and analyze business scenarios, data playback technology is usually used. At present, different data playback tools are usually used to play back data from different data sources. This leads to low data playback efficiency and inability to fully reproduce business scenarios. Summary of the invention
[0003] In view of the need for improvement in the prior art, embodiments of the present disclosure provide a method, system, and computer-readable medium for data playback.
[0004] On the one hand, an embodiment of the present disclosure provides a method for data playback, comprising: determining a set of original data to be currently played back, wherein the set of original data each has a corresponding original format; based on the original formats of the set of original data, converting the set of original data into a set of target messages, wherein each target message has a target format required by an interface for receiving the target message; based on the respective recording time sequences of the set of original data, outputting the set of target messages to corresponding interfaces for data playback.
[0005] On the other hand, the present disclosure provides a system for data playback, comprising: a determination unit, configured to determine a set of original data currently to be played back, wherein the set of original data each has a corresponding original format; a conversion unit, configured to convert the set of original data into a set of target messages based on the respective original formats of the set of original data, wherein each target message has a target format required by an interface for receiving the target message; and an output unit, configured to output the set of target messages to corresponding interfaces for data playback respectively based on the respective recording time sequence of the set of original data.
[0006] On the other hand, the present disclosure provides a system for data playback, comprising: at least one processor; a memory communicating with the at least one processor, the memory storing executable code, which, when executed by the at least one processor, enables the at least one processor to perform the above method.
[0007] On the other hand, the present disclosure provides a computer-readable storage medium storing executable codes, which, when executed, cause a computer to perform the above method. BRIEF DESCRIPTION OF THE DRAWINGS
[0008] The above and other objects, features and advantages of embodiments of the present disclosure will become more apparent through a more detailed description of embodiments of the present disclosure in conjunction with the accompanying drawings, wherein like reference numerals generally represent like elements throughout the various drawings.
[0009] Figure 1 is a schematic flow chart of a method for data playback according to some embodiments.
[0010] Figure 2 is a schematic diagram of an example of an architecture for data playback.
[0011] Figure 3A is a schematic flow chart of time control of a playback period according to some embodiments.
[0012] Figure 3B is a schematic flow chart of output time control of a target message in a playback cycle according to some embodiments.
[0013] Figure 3C is a schematic flowchart of output time control of a target message in a playback cycle according to some other embodiments.
[0014] Figure 4 is a schematic block diagram of a system for data playback according to some embodiments.
[0015] Figure 5 is a schematic block diagram of a system for data playback according to some embodiments. DETAILED DESCRIPTION
[0016] The subject matter described herein will now be discussed with reference to various embodiments. It should be understood that the discussion of these embodiments is only to enable those skilled in the art to better understand and implement the subject matter described herein, and is not intended to limit the scope of protection, applicability or examples set forth in the claims. The functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the claims. Various embodiments may omit, replace or add various processes or components as needed.
[0017] Data playback technology generally refers to outputting and running the original data in the order of the recorded time to reproduce the scene, state, etc. at the time of data recording. For example, in the field of autonomous driving, various sensors installed in the vehicle (such as cameras, radars, etc.) can sense the vehicle's operating conditions (such as the vehicle's operating status, surrounding environment, etc.), thereby generating a variety of raw data. In order to reproduce or simulate the vehicle's operating conditions, the original data can be replayed. Since the data collected by different types of sensors usually have different formats, different data playback tools are usually used to replay data in corresponding formats. However, this approach often leads to low data playback efficiency and may not be able to fully reproduce or simulate the vehicle's operating conditions.
[0018] In view of this, the embodiments of the present disclosure provide a technical solution for data playback. The embodiments of the present disclosure can be applied to various business scenarios that require data playback, such as autonomous driving scenarios. The following will be described in conjunction with specific embodiments.
[0019] Figure 1 is a schematic flow chart of a method for data playback according to some embodiments.
[0020] like Figure 1 As shown, in step 102, a group of original data to be currently played back may be determined. The group of original data may each have a corresponding original format.
[0021] In step 104, the set of original data may be converted into a set of target messages based on the original formats of the set of original data. Each target message may have a target format required by an interface receiving the target message.
[0022] In step 106, based on the respective recording time sequence of a group of original data, a group of target messages may be output to corresponding interfaces for data playback.
[0023] In an embodiment of the present disclosure, a group of raw data to be played back may have a corresponding original format. Therefore, in order to play back the raw data, the group of raw data can be converted into a format so that each of the group of target messages obtained after the conversion has a target format required by the corresponding interface. Then, based on the respective recording time sequence of the group of raw data, a group of target messages can be output to the corresponding interface respectively. It can be seen that an embodiment of the present disclosure can support the playback of raw data in various formats without the need to use a separate playback tool for raw data in different formats. In addition, since a group of raw data each having a corresponding format can be played back in combination, the scene or situation when the raw data was recorded can be fully reproduced.
[0024] In some embodiments, a set of original data may be generated by a variety of different data sources and have a variety of different original formats.
[0025] For example, in an autonomous driving scenario, raw data can be collected by various sensors, such as cameras, controller area network (CAN) collectors, ultrasonic sensor systems (USS), lidars, inertial measurement units (IMUs), etc. The raw data collected by various sensors can usually have different raw formats. For example, the raw data collected by the camera can have an mkv format, the raw data collected by the CAN collector can have a blf format, the raw data collected by the USS can have a rosbag or pcap format, the raw data collected by the IMU can have a txt format, the raw data collected by the lidar can have a pcap format, and so on.
[0026] During the data playback process, the interface for receiving data may support different data formats. For example, the raw data collected by the CAN collector has a blf format, and the interface for receiving the data collected by the CAN collector may support the ROS message format. Therefore, in step 104, the raw data can be converted into a target message with a corresponding target format. For example, the file containing the raw data can be decoded and then format converted. Each raw data can be converted into a target message. In this way, data playback can be performed efficiently for raw data of various formats.
[0027] When data playback is to be performed, a set of raw data to be played back can be first determined. This can be determined in various appropriate ways. For example, in step 102, the data recording period for data playback can be first determined. The data recording period can refer to the time period when the raw data is recorded. It can be understood that the period start time and the period end time of the data recording period can be based on the time when the raw data is recorded (for example, the timestamp carried by the raw data). Which data recording period is specifically selected as the period for data playback can be manually configured or specified, for example, depending on factors such as actual business needs.
[0028] The data recording period can be divided into multiple time intervals according to a certain step size. The step size can be pre-set, for example, this can be set based on actual business needs and other factors. For example, assuming that the data recording period is from 20 milliseconds to 60 milliseconds and the step size is 10ms, then the data recording period will include 4 time intervals. Each time interval has a corresponding time sequence. In order to facilitate the management of data playback, each time interval can correspond to a playback cycle. That is, during each playback cycle, the original data recorded in the time interval corresponding to the playback cycle can be played back. It can be seen that the time interval can be based on the time when the original data is recorded, and the playback cycle can be based on the system time of the system performing data playback.
[0029] Next, in step 102, the target time interval for data playback to be performed can be determined. The target time interval can be one of multiple time intervals. In some implementations, the target time interval for data playback to be performed can be determined in combination with the number of time intervals that have been performed. For example, assuming that when data playback is initially started, the target time interval can be the first time interval in chronological order among multiple time intervals. Assuming that data playback has been completed for the previous two time intervals, the target time interval can be the third time interval. Similarly, as mentioned above, the target time interval will correspond to a playback cycle, and for ease of description in this article, the playback cycle corresponding to the target time interval is referred to as the target playback cycle. After determining the target time interval, the original data recorded in the target time interval can be obtained as a set of original data to be played back in the target playback cycle.
[0030] After determining a set of raw data and converting it into a set of target messages, the target messages can be output for data playback. During the data playback process, the output time and order of the target messages are important for accurately reproducing the business scenario. In the embodiments of the present disclosure, the output time and order of the target messages can be controlled from two aspects. On the one hand, the expected output time of the target message within the target playback cycle can be determined so that each target message is output based on the expected output time, thereby ensuring that the output order of each target message conforms to the recording time order of the corresponding original time. It is understandable that the raw data can usually carry the timestamp of its recording, so the recording time order of the raw data can be determined based on the timestamp it carries. On the other hand, the playback cycle can be aligned with the corresponding time interval as much as possible, so that it can be ensured that the output interval of the target message conforms to the time interval of the raw data as much as possible. Some embodiments of these two aspects will be introduced below.
[0031] The following is a description of how to determine the expected output time of a target message within a target playback cycle in conjunction with some embodiments. In some embodiments, the expected output time of a group of target messages within a target playback cycle can be determined based on the recording time of each of a group of original data and the system time associated with the target playback cycle. The expected output time of a group of target messages can be based on the system time. For ease of understanding, a simple example is given. Assume that original data 1 is recorded at 1 millisecond in the target time interval, and original data 2 is recorded at 5 milliseconds in the target time interval. In addition, assume that data playback of the target time interval is started at 12 o'clock in the system time, that is, the target playback cycle corresponding to the target time interval is started. Then, the expected output time of the target message corresponding to original data 1 can be 12:01 millisecond, and the expected output time of the target message corresponding to original data 2 can be 12:05 milliseconds.
[0032] In this way, based on the expected output time of a group of target messages, a group of target messages are output to corresponding interfaces respectively, thereby ensuring data playback in the correct time sequence, thereby more accurately reproducing or simulating the scene or state when the original data was recorded.
[0033] More specifically, the expected output time of a group of target messages may be determined in various appropriate ways. For example, in some implementations, the interval start time of the target time interval may be determined based on the period start time of the data recording period, a preset step size, and the number of time intervals that have passed before the target time interval.
[0034] As mentioned above, the period start time of the data recording period can be based on the time when the original data is recorded. Therefore, the interval start time of the target time interval is also based on the time when the original data is recorded, and does not involve the system time.
[0035] In addition, the system time at the end of the playback cycle corresponding to the last time interval before the target time interval can be determined. Then, based on the recording time of each item of original data, the interval start time of the target time interval, and the system time at the end of the playback cycle corresponding to the last time interval, the expected output time of the target message corresponding to the original data can be determined.
[0036] In some implementations, it may be desirable to adjust the data playback rate, so a speed factor may be incorporated when calculating the expected output time of the target message. Specifically, the expected output time of the target message corresponding to the original data may be determined based on the recording time of each original data item, the interval start time of the target time interval, the system time at the end of the playback period corresponding to the previous time interval, and the speed factor. The speed factor may adjust the speed of data playback.
[0037] For example, the expected output time of the target message can be calculated by the following equation.
[0038] The interval start time of the target time interval = the period start time of the data recording period +
[0039] The number of time intervals that have passed × the preset step size
[0040]
[0041] The above equation is only an example, and in different scenarios, the expected output time of the target message can be determined based on other similar equations. For example, if the speed of data playback does not need to be adjusted, the speed factor can be 1, and the speed factor in this equation can be omitted.
[0042] In some implementations, after the expected output time of the target message is determined, how to output the target message may be determined by combining two conditions.
[0043] The first condition may include that the difference between the expected output time of the target message and the current system time is greater than a preset threshold. The preset threshold may be determined according to factors such as actual application requirements. Generally, if the difference between the expected output time of the target message and the current system time is greater than the preset threshold, it means that the current system time has not yet reached the expected output time of the target message.
[0044] The second condition may include that the recording time of the original data corresponding to the target message is not within the last preset duration of the target time interval. If the recording time of the original data is within the last preset duration of the target time interval, this indicates that the original data was recorded near the end of the target time interval. Therefore, this condition is mainly to avoid or alleviate the delay that may occur during data playback. The last preset duration can be defined in various appropriate ways, which can be determined according to factors such as actual application requirements. For example, the last preset duration can be defined by a numerical value representing the duration, or it can be defined by a ratio relative to the target time interval. For example, the last preset duration can be the last X milliseconds of the target time interval (X can be a positive integer, such as X can be equal to 3, 5, etc.). For another example, the last preset duration can be the last Y% duration of the target time interval (Y can be a positive integer, such as Y can be equal to 2, 3, 5, etc.).
[0045] If the first condition and the second condition are met, that is, the expected output time of the target message differs from the current system time by more than a preset threshold (this indicates that the current system time has not yet reached the expected output time of the target message), and the recording time of the original data corresponding to the target message is not within the last preset duration of the target time interval (this indicates that the original data was not recorded near the end of the target time interval), then you can wait until the current system time reaches the expected output time of the target message and output the target message to the corresponding interface.
[0046] If the first condition is not met, that is, the expected output time of the target message is less than or equal to the preset threshold value from the current system time, for example, the current system time is close to or reaches the expected output time of the target message, then the target message can be directly output to the corresponding interface without waiting, so as to align the output time of the target message with the recording time of the original data as much as possible. Alternatively, if the second condition is not met, that is, the recording time of the original data corresponding to the target message is within the last preset duration of the target time interval, for example, the original data is recorded close to the end of the target time interval, then the target message can be directly output to the corresponding interface without waiting. This is because the original data is recorded close to the end of the target time interval. If you still wait when outputting the corresponding target message, then since the subsequent operation also requires a certain execution time, this may cause an alignment error between the target playback cycle and the target time interval. In order to reduce this error as much as possible, the target message corresponding to the original data recorded close to the end of the target time interval can be directly output to the corresponding interface.
[0047] The following will describe how to control the alignment of the playback period and the corresponding time interval in conjunction with some embodiments.
[0048] In certain embodiments, after a group of target messages have all been output to the corresponding interface, it can be determined whether the expected duration of the target playback cycle has ended. The expected duration of the target playback cycle can be determined based on the preset step length for the time interval. For example, the expected duration of the target time interval can be equal to the preset step length. For another example, in order to adjust in conjunction with the playback rate, the expected duration of the target time interval can be equal to the preset step length divided by the multiplication factor. In addition, it is understandable that the actual duration of the playback cycle may be equal to the expected duration, or it may be longer than the expected duration due to factors such as the delay of various operations.
[0049] If the expected duration of the target playback cycle has not ended, you can wait until the expected duration of the target playback cycle ends, and then end the data playback for the target time interval. If the expected duration of the target playback cycle has ended, you do not wait and directly end the data playback for the target time interval.
[0050] If the target time interval is not the last time interval among the multiple time intervals, that is, there is a next time interval after the target time interval, then the data playback for the next time interval can be started after the data playback for the target time interval is ended. If the target time interval is the last time interval among the multiple time intervals, the entire data playback process is directly ended.
[0051] It can be seen that through the above method, the playback period and the time interval can be aligned as much as possible, thereby ensuring the time accuracy of data playback.
[0052] In some embodiments, each target message may carry the recording time of the original data corresponding to the target message. In some embodiments, each target message may carry the expected output time of the target message.
[0053] For ease of understanding, the technical solution of the present disclosure will be further described below in conjunction with specific examples. It should be understood that the following examples do not impose any limitation on the scope of the technical solution of the present disclosure.
[0054] Figure 2 is a schematic diagram of an example of an architecture for data playback.
[0055] exist Figure 2 In the example of , the data playback system 210 may include a controller 212 , a data player 214 , and a coordinator 216 .
[0056] The controller 212 may receive input information, such as a raw file 202 containing raw data and playback configuration information 204. The raw file 202 may include files from various data sources. For example, in an autonomous driving scenario, the raw file 202 may include at least one of the following: a raw file from a camera (e.g., in mkv format), a raw file from a CAN collector (e.g., in blf format), a raw file from an ultrasonic radar (e.g., in rosbag or pcap format), a raw file from an IMU (e.g., in txt format), a raw file from a lidar (e.g., in pcap format), and the like.
[0057] The playback configuration information 204 may include the preset step length, etc. The playback configuration information 204 may also include the preset threshold, the last preset duration, etc. The playback configuration information 204 may also include other configuration information related to data playback, which is not limited herein.
[0058] The controller 212 can control the start or end of the playback cycle, for example, by controlling the global clock of the data playback. The controller 212 can determine the data recording period, and starting from the period start time of the data recording period, divide the data recording period into multiple time intervals according to a preset step length. The controller 212 can determine which time interval the data playback is currently to be performed for. For ease of description, the time interval can be referred to as a target time interval. The controller 212 can determine a target playback cycle corresponding to the target time interval. In this case, the controller 212 can send a start command for starting data playback to the data player 214. For example, the start command can include the interval start time of the target time interval and the preset step length.
[0059] Upon receiving a start command from the controller 212, the data player 214 may obtain a set of raw data to be played back. For example, the data player 214 may read a set of raw files recorded during a target time interval and decode the set of raw files to obtain a set of raw data. The data player 214 may convert each item of raw data into a target message so that the target message has a target format required by an interface that receives the target message.
[0060] It can be seen that the data player 214 can support the conversion of raw data in various formats. Therefore, the data player 214 essentially integrates tools that support the playback of raw data in various formats. For example, in the autonomous driving scenario, the data player 214 essentially integrates a camera data player, a CAN data player, an ultrasonic radar data player, an IMU data player, a lidar data player, and the like.
[0061] The data player 214 may send a group of target messages to the coordinator 216. The coordinator 216 may determine the expected output time of each target message in the target playback cycle based on the recording time of each of the group of original data and the system time (the time of the system 210). The coordinator 216 may determine the expected output time of each target message in the manner described above.
[0062] The coordinator 216 may output each target message to a corresponding interface of the gateway 220 based on the expected output time of each target message.
[0063] The gateway 220 may include an interface for receiving target messages in various formats. For example, in an autonomous driving scenario, the gateway 220 may include a camera interface, a CAN interface, a USS interface, an IMU interface, a lidar interface, etc. Various interfaces support different message formats. Different interfaces can receive target messages in corresponding formats from the coordinator 216, thereby realizing data playback.
[0064] It can be seen that in the embodiments of the present disclosure, the data playback system can support the conversion of original data in different formats into target messages in corresponding formats, and output the target messages based on the corresponding time sequence, thereby efficiently realizing the joint playback of data in various formats, thereby more accurately and reliably reproducing or simulating the scene or state when the original data was recorded.
[0065] Figure 3A is a schematic flow chart of time control of a playback period according to some embodiments.
[0066] like Figure 3A As shown, in step 310, the time interval for the current data playback can be determined. For example, the interval start time of the time interval can be determined, which is represented as start_ts here. In addition, the preset step length is represented as step_width. Accordingly, the time interval can be represented as [start_ts, start_ts+step_width].
[0067] In some cases, the interval start time of the time interval may be obtained by: start_ts=replayer_begin_time+step_width×step_count, where replayer_begin_time may represent the period start time of the data recording period, and step_count may represent the number of time intervals that have passed before the time interval.
[0068] In step 310, the system time at the end of the playback cycle corresponding to the last time interval before the time interval can also be determined, which is represented as last_record_time here. If the time interval is the first time interval, the system time at the end of the playback cycle corresponding to the last time interval can be 0.
[0069] In step 320, it may be determined whether the period end time of the data recording period has been reached. For example, it may be determined whether start_ts is greater than or equal to the period end time.
[0070] If start_ts is greater than or equal to the end time of the period, it means that the data playback has ended and you can proceed to 380 to end the entire data playback process.
[0071] If start_ts is less than the period end time, the process may proceed to step 330. In step 330, a group of original data recorded in the time interval [start_ts, start_ts+step_width] may be read and converted into a group of target messages.
[0072] In step 340, a group of target messages may be output to corresponding interfaces based on the recording time sequence of a group of original data.
[0073] In addition, in step 340, after all of the target messages have been output to the corresponding interface, the actual duration that has passed since the system time at the end of the playback period corresponding to the last time interval is determined. For ease of explanation, the actual duration is represented as elapse, and the current system time is represented as system_now_time. Then, the actual duration can be determined by the following equation:
[0074] elapse=system_now_time-last_record_time.
[0075] In step 350, it can be determined whether the expected duration of the playback period corresponding to the time interval has ended based on the actual duration and the preset step length. For example, it can be determined whether step_width / real_time_factor-elapse is greater than 0, where step_width / real_time_factor-elapse is represented as padding, that is, in step 350, it can be determined whether the following condition is met: padding=step_width / real_time_factor-elapse>0. real_time_factor can represent a speed factor, which is used to adjust the speed of data playback. For example, the speed factor real_time_factor can be 1, 2, etc. In the case where there is no need to adjust the data playback, the speed factor real_time_factor can be 1, then the expected duration of the playback period can be equal to the preset step length.
[0076] If padding is greater than 0, this indicates that the expected duration of the playback period has not yet ended. Then, in order to align the playback period with the corresponding time interval, waiting can be performed in step 360. The duration of the waiting can be padding.
[0077] In step 370, since the expected duration of the playback cycle has ended, the interval start time of the next time interval and the system time when the current playback cycle ends can be determined. For example, the interval start time of the next time interval can be start_ts+step_width. Of course, the interval start time of the next time interval can also be obtained by the equation given above for calculating the interval start time of the time interval.
[0078] If padding is less than or equal to 0, it means that the expected duration of the playback period has ended, and the process can proceed directly to step 370. It is understandable that in some cases, there may be some delay in data playback, which may cause the actual duration of the playback period to be greater than the expected duration. In this case, padding will be less than 0.
[0079] After step 370, the process may return to step 320 to start data playback for the next time interval again.
[0080] From the above description, it can be seen that Figure 3A In the process, the playback cycle can be aligned with the corresponding time interval as much as possible, thereby ensuring the time accuracy of each playback cycle.
[0081] In addition to the time alignment of the playback cycle, it is also possible to ensure that the output time of each target message in the playback cycle is aligned with the recording time of the corresponding original data as much as possible. This is described below with reference to a specific example.
[0082] Figure 3B is a schematic flow chart of output time control of a target message in a playback cycle according to some embodiments.
[0083] Figure 3B The process can occur in Figure 3A During step 340 .
[0084] like Figure 3B As shown, in step 341, for a certain target message, its expected output time in the playback cycle can be determined.
[0085] First, the interval start time of the time interval corresponding to the playback period can be determined. Figure 3A , assuming that the interval start time is represented as start_ts, the preset step length is represented as step_width, the number of time intervals that have passed before the time interval is represented as step_count, and the period start time of the data recording period is represented as replayer_begin_time.
[0086] Then, the interval start time can be calculated as follows:
[0087] start_ts=replayer_begin_time+step_width×step_count
[0088] Then, the expected output time of the target message may be determined based on the interval start time, the recording time of the original data corresponding to the target message, and the system time at the end of the last playback cycle.
[0089] Assume that the expected output time of the target message is represented as data_ts, the recording time of the original data corresponding to the target message is represented as data_time_stamp, and the system time at the end of the previous playback cycle is represented as last_record_time.
[0090] Then, the expected output time of the target message can be calculated as follows:
[0091]
[0092] where real_time_factor can represent the speed factor.
[0093] In step 342, it can be determined whether two conditions are met. The first condition can include that the difference between the expected output time of the target message and the current system time is greater than a preset threshold. The second condition can include that the recording time of the original data corresponding to the target message is not within the last preset duration of the time interval.
[0094] For example, assume that the current system time is represented as system_now_time and the preset threshold is represented as T-thre. Then, the first condition can be expressed as data_ts - system_now_time > T-thre. The preset threshold can be determined according to factors such as actual business requirements. For example, the preset threshold can be 10 milliseconds.
[0095] In addition, assume that the last preset duration is defined by a certain ratio, and assume that this ratio is represented as p. Then, the second condition can be expressed as data_time_stamp < p × step_width + start_ts. For example, in some implementation manners, p can be 0.97.
[0096] If the first condition and the second condition are met, then it can proceed to step 343. In step 343, it can wait until the current system time reaches the expected output time of the target message and output the target message.
[0097] If the first condition or the second condition is not met, then in step 344, it can directly output the target message without waiting.
[0098] The process can be executed for each target message Figure 3B so as to ensure that each target message is output based on the expected output time, thereby ensuring the correctness of the output time of each target message.
[0099] Figure 3C It is a schematic flowchart of the output time control of the target message in the playback cycle according to some other embodiments.
[0100] Figure 3C The process and Figure 3B The processes are basically similar, so the steps denoted by the same reference numerals will not be described in detail.
[0101] Typically, the target message may carry a timestamp. In some implementations, the timestamp carried by the target message may represent the recording time of the corresponding original data.
[0102] In some implementations, it may be necessary to explicitly indicate the expected output time of the target message. Figure 3B compared to, Figure 3C The process of adding step 345. In step 345, a timestamp indicating an expected output time of the target message may be included in the target message.
[0103] It can be seen that through the embodiments of the present disclosure, data playback for various original data formats and various target message formats can be supported, and the time correctness of data playback can be efficiently guaranteed, so that the scene or state when the original data was recorded can be reliably reproduced or simulated.
[0104] Figure 4 is a schematic block diagram of a system for data playback according to some embodiments.
[0105] like Figure 4 As shown, the system 400 may include a determining unit 402 , a converting unit 404 , and a coordinating unit 406 .
[0106] The determination unit 402 may determine a group of original data to be currently played back, wherein each of the group of original data has a corresponding original format. The conversion unit 404 may convert the group of original data into a group of target messages based on the original formats of each of the group of original data, wherein each target message has a target format required by an interface for receiving the target message. The coordination unit 406 may output the group of target messages to corresponding interfaces for data playback based on the respective recording time sequence of the group of original data.
[0107] Each unit of the system 400 can execute the specific process described above with respect to the method embodiment. Therefore, for the sake of brevity of description, the specific operations and functions of each unit of the system 400 are not described in detail here.
[0108] Figure 5 is a schematic block diagram of a system for data playback according to some embodiments.
[0109] like Figure 5As shown, the system 500 may include a processor 502, a memory 504, an input interface 506, and an output interface 508, and these modules may be coupled together via a bus 510. However, it should be understood that Figure 5 This is only an example and does not limit the scope of the present disclosure. For example, in different application scenarios, the system 500 may include more or fewer modules, which is not limited herein.
[0110] The memory 504 may be used to store various information, executable instructions or codes, etc. related to the functions or operations of the system 500. For example, the memory 504 may include, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), registers, hard disks, etc.
[0111] The processor 502 may be used to execute or implement various functions or operations of the system 500, such as the various operations described herein. For example, the processor 502 may execute executable instructions or codes stored in the memory 504, thereby implementing the various processes described above with respect to the method embodiments. The processor 502 may include various applicable processors, such as a general-purpose processor (such as a central processing unit (CPU)), a special-purpose processor (such as a digital signal processor, a special-purpose integrated circuit, etc.).
[0112] The input interface 506 can receive various forms of information or data, such as the above-mentioned original data, a preset step size, a preset threshold value, a final preset duration, etc.
[0113] The output interface 508 can output information or data in various forms, such as the target message mentioned above.
[0114] In some implementations, Figure 4 Each unit in the embodiment may be implemented by one or more of the processor 502 , the memory 504 , the input interface 506 , and the output interface 508 .
[0115] In some implementations, Figure 2 The controller 212 , the data player 214 , and the coordinator 216 may be implemented by one or more of the processor 502 , the memory 504 , the input interface 506 , and the output interface 508 .
[0116] The embodiments of the present disclosure further provide a computer-readable storage medium. The computer-readable storage medium may store executable codes, which, when executed by a computer, enable the computer to implement the specific process described above with respect to the method embodiment.
[0117] For example, computer-readable storage media may include, but are not limited to, random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), static random access memory (SRAM), hard disk, flash memory, and the like.
[0118] Specific embodiments of the present disclosure are described above. Other embodiments are within the scope of the appended 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 accompanying 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.
[0119] Not all steps and units in the above processes and system structure diagrams are necessary, and some steps or units may be omitted according to actual needs. The device structure described in the above embodiments may be a physical structure or a logical structure, that is, some units may be implemented by the same physical entity, some units may be implemented by multiple physical entities, or may be implemented by some components in multiple independent devices.
[0120] The optional implementation modes of the embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings. However, the embodiments of the present disclosure are not limited to the specific details in the above implementation modes. Within the technical concept of the embodiments of the present disclosure, various modifications can be made to the technical solutions of the embodiments of the present disclosure, and these modifications all belong to the protection scope of the embodiments of the present disclosure.
Claims
1. A method for data playback, comprising: Determine a group of original data to be currently played back, wherein each of the group of original data has a corresponding original format; Based on the original formats of the original data, converting the original data into a set of target messages, wherein each target message has a target format required by an interface receiving the target message; Based on the respective recording time sequence of the group of original data, the group of target messages are respectively output to corresponding interfaces for data playback.
2. The method according to claim 1, wherein: The set of original data is generated by a variety of different data sources and has a variety of different original formats.
3. The method according to claim 1, wherein: Determine a set of raw data to be played back, including: Determine a target time interval for current data playback, wherein the target time interval is one of a plurality of time intervals obtained by dividing a data recording period for original data recording, each time interval has a preset step length, and each time interval corresponds to a playback cycle; The original data recorded in the target time interval is acquired as a group of original data for data playback in a target playback period, wherein the target playback period is a playback period corresponding to the target time interval.
4. The method according to claim 3, wherein: Outputting the group of target messages to corresponding interfaces respectively according to the respective recording time sequence of the group of original data, including: Determining the expected output time of the group of target messages within the target playback period based on the respective recording times of the group of original data and the system time associated with the target playback period, wherein the system time is the time of the system executing the method; Based on the expected output time of the group of target messages, the group of target messages are respectively output to corresponding interfaces.
5. The method according to claim 4, wherein: Determining the expected output time of the set of target messages, including: Determining an interval start time of the target time interval based on the period start time of the data recording period, the preset step size, and the number of time intervals that have passed before the target time interval; determining a system time at the end of a playback period corresponding to a previous time interval before the target time interval; Based on the recording time of each item of original data, the interval start time of the target time interval and the system time at the end of the playback period corresponding to the previous time interval, the expected output time of the target message corresponding to the original data is determined.
6. The method according to claim 4, wherein: Based on the expected output time of the group of target messages, the group of target messages are output to corresponding interfaces respectively, including: For any target message in the group of target messages: If the first condition and the second condition are met, wait until the current system time reaches the expected output time of the target message, and output the target message to the corresponding interface, wherein the first condition includes that the difference between the expected output time of the target message and the current system time is greater than a preset threshold, and the second condition includes that the recording time of the original data corresponding to the target message is not within the last preset duration of the target time interval; If the first condition or the second condition is not met, the target message is output to the corresponding interface.
7. The method according to claim 4, wherein: Each target message includes the recording time of the original data corresponding to the target message; or Each target message includes an expected output time of the target message.
8. The method according to claim 3, further comprising: After all of the group of target messages have been output to the corresponding interface, determining whether an expected duration of the target playback period has ended, wherein the expected duration is determined based on the preset step size; If the expected duration of the target playback period has not ended, waiting until the expected duration of the target playback period ends, and ending the data playback for the target time interval; If the expected duration of the target playback period has ended, the data playback for the target time interval is ended.
9. The method according to claim 8, wherein: Determining whether the expected duration of the target playback period has ended includes: determining an actual length of time that has elapsed since a system time at the end of a playback period corresponding to a previous time interval preceding the target time interval; Based on the actual duration and the preset step length, it is determined whether the expected length of the target playback period has ended.
10. A system for data playback, comprising: A determination unit, configured to determine a group of original data to be currently played back, wherein each of the group of original data has a corresponding original format; a conversion unit configured to convert the set of original data into a set of target messages based on respective original formats of the set of original data, wherein each target message has a target format required by an interface receiving the target message; The coordination unit is configured to output the group of target messages to corresponding interfaces for data playback based on the respective recording time sequence of the group of original data.
11. A system for data playback, comprising: at least one processor; A memory in communication with the at least one processor, storing executable code, which, when executed by the at least one processor, causes the at least one processor to perform the method according to any one of claims 1 to 9. 12 . A computer-readable storage medium storing executable codes, which, when executed, cause a computer to perform the method according to claim 1 .