Data playback method and device, terminal and computer storage medium
By obtaining accurate timestamps and generating playback tasks through a dual-thread mechanism, the problem of inaccurate data playback time is solved, high-precision data playback effects are achieved, and performance overhead and resource usage are reduced.
Patent Information
- Application Number
- CN202510785529.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-26
AI Technical Summary
Existing technologies cannot guarantee the accuracy of data playback time during data playback. Due to the bottleneck of 3D scene rendering performance on the web side and the error in timestamp acquisition, there is a time error in the playback between each frame of data.
A dual-thread mechanism is adopted. The first thread executes the playback task of the data frame to be played back, and the second thread executes the playback time waiting task. The time measurement function with an accuracy within the preset accuracy threshold is used to obtain the timestamp, generate the playback task and the time waiting task, and ensure the accuracy of the data frame timestamp acquisition and the playback order.
The dual-thread mechanism reduces the performance overhead of the data playback thread, ensuring the accuracy of the playback interval between each data frame to be played back, with an error of less than 5ms. The error for 1 hour of data playback is less than 3 seconds. The main thread is only responsible for rendering, and the Web Worker is responsible for data processing, which reduces the burden on the main thread and reduces resource usage.
Smart Images

Figure CN120704822A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data playback technology, and in particular to a data playback method, device, terminal and computer storage medium. Background Art
[0002] With the continuous development of autonomous driving technology, the remote end can only obtain vehicle information, perception, planning data, etc. more intuitively and directly through data playback.
[0003] In the existing technology, due to the bottleneck of the web's rendering performance for 3D scenes, there is a playback interval between each frame of data during data playback. The existing technology has errors in obtaining the timestamp of the data frame, and the playback between each frame of data requires time waiting. The execution of the time waiting task will affect the execution of the data playback task, resulting in errors in the playback time of each data frame, resulting in inaccurate data playback.
[0004] It can be seen that the existing technology cannot guarantee the accuracy of data playback time when playing back data. Summary of the Invention
[0005] In view of this, it is necessary to provide a data playback method, device, terminal and computer storage medium to solve the problem that the existing technology cannot guarantee the accuracy of data playback time when performing data playback.
[0006] In order to solve the above problems, in a first aspect, the present invention provides a data playback method, comprising: Obtaining a timestamp of a data frame to be replayed, and generating a replay task of the data frame to be replayed and a replay time waiting task of an adjacent data frame to be replayed based on the timestamp; After the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frames to be played back; After the playback time waiting task is completed, the first thread is used to execute the playback task of the subsequent data frame to be played back in the adjacent data frames to be played back.
[0007] In a possible implementation, generating the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back based on the timestamp includes: Generate a serial task queue based on the timestamp order of each data frame to be replayed, wherein the serial task queue includes the replay task of each data frame to be replayed; The playback time difference of adjacent data frames to be played back is calculated based on the timestamps of the adjacent data frames to be played back, and the playback time waiting task of each adjacent data frame to be played back is generated based on the timestamp sequence of each data frame to be played back and the playback time difference.
[0008] In a possible implementation, the execution process of the playback task of the data frame to be played back includes: Obtaining object information in the data frame to be replayed and position information of each object in the data frame, and constructing a three-dimensional model of each object; The three-dimensional model of the object is rendered based on the position information in a preset three-dimensional Cartesian coordinate system.
[0009] In a possible implementation, when the data frame to be replayed is a vehicle driving scene playback data frame, the execution process of the playback task of the data frame to be replayed includes: The driving trajectory is rendered in the preset three-dimensional Cartesian coordinate system based on the preset trajectory coordinate data.
[0010] In a possible implementation, the data frame to be replayed further includes vehicle condition information, and the execution process of the replay task of the data frame to be replayed includes: The vehicle condition information is displayed on the rendering result display interface.
[0011] In a possible implementation, the first thread is configured to sequentially execute playback tasks of the data frames to be played back based on the order of tasks in the serial task queue, and after the first thread completes the playback task of the preceding data frame to be played back among adjacent data frames to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frames to be played back, including: Obtaining the current time when the first thread completes the playback task of the preceding data frame to be played back among adjacent data frames to be played back; Calculating the playback time of the subsequent data frame to be played back based on the playback time difference between the current time and the adjacent data frame to be played back; The second thread is used to execute the playback time waiting task of the adjacent data frame to be played back, so that the subsequent data frame to be played back starts to be played back at the playback time.
[0012] In one possible implementation, when the playback time of the subsequent data frame to be played back is earlier than the current playback time, the waiting time of the playback task of the subsequent data frame to be played back is adjusted based on the interval between the current time and the playback time, so that the playback time of the subsequent data frame to be played back is equal to or later than the playback end time of the previous data frame to be played back.
[0013] In a second aspect, the present invention further provides a data playback device, comprising: A task generation module is configured to obtain a timestamp of a data frame to be replayed using a time measurement function whose accuracy is within a preset accuracy threshold, and generate a replay task for the data frame to be replayed and a replay time waiting task for adjacent data frames to be replayed based on the timestamp; A first task execution module is configured to, after the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, use the second thread to execute the playback time waiting task of the adjacent data frames to be played back; The second task execution module is configured to use the first thread to execute the playback task of the subsequent data frame to be played back among the adjacent data frames to be played back after the playback time waiting task is completed.
[0014] In a third aspect, the present invention further provides a data playback terminal, comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps of the data playback method described in any one of the above embodiments.
[0015] In a fourth aspect, the present invention further provides a computer-readable storage medium for storing computer-readable programs or instructions, which, when executed by a processor, can implement the steps in the data playback method described in any of the above embodiments.
[0016] The beneficial effects of the present invention are as follows: the data playback method provided by the present invention ensures the accuracy of the timestamp acquisition of each frame of data to be played back by obtaining the timestamp of the data frame to be played back, generates the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back based on the timestamp, and ensures the accuracy of the playback order of each data frame to be played back. After the first thread completes the playback task of the preceding frame of the adjacent data frame to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frame to be played back; after the playback time waiting task is completed, the first thread is used to execute the playback task of the following frame of the adjacent data frame to be played back. By using two threads to respectively execute the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back, the performance overhead of the data playback thread is reduced, and by using a separate thread to execute the playback time waiting task, the accuracy of the playback interval between each data frame to be played back is ensured. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] Figure 1 A flowchart of a data playback method provided by an embodiment of the present invention; Figure 2 A flowchart of a task generation method provided by an embodiment of the present invention; Figure 3 A flowchart of a data rendering and display method provided by an embodiment of the present invention; Figure 4 A flowchart of a method for executing a playback time waiting task provided by an embodiment of the present invention; Figure 5 A schematic structural diagram of a data playback device provided by an embodiment of the present invention; Figure 6 A schematic structural diagram of a data playback terminal provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0019] The preferred embodiments of the present invention will be described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, and are not used to limit the scope of the present invention.
[0020] The terms "first," "second," and so on, used in the embodiments of the present invention are for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Therefore, technical features designated as "first" or "second" may explicitly or implicitly include at least one such feature.
[0021] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0022] A specific embodiment of the present invention, as Figure 1 As shown, a data playback method is disclosed, comprising: S101 , obtaining a timestamp of a data frame to be replayed, and generating a replay task of the data frame to be replayed and a replay time waiting task of an adjacent data frame to be replayed based on the timestamp.
[0023] In an embodiment of the present invention, to ensure the accuracy of the timestamp acquisition of the data frame to be replayed, it is necessary to use a time measurement function with an accuracy within a preset accuracy threshold to obtain the timestamp. The time measurement function with an accuracy within the preset accuracy threshold is specifically Performance.now(), which provides higher timestamp acquisition accuracy, typically reaching milliseconds or even microseconds. In the field of autonomous driving, the data frame to be replayed is data collected by the vehicle over a period of time, including but not limited to the vehicle's driving environment, the vehicle's driving path, the vehicle's operating condition data, etc. The timestamp of the data frame to be replayed refers to the moment when the data to be replayed for that frame was collected. This timestamp is used to sort the playback order of each frame of the data to be replayed. Based on this timestamp, the playback task of the data frame to be replayed and the playback time waiting task of the adjacent data frame to be replayed can be generated. The playback task of the data frame to be replayed refers to the task of rendering and displaying the data frame to be replayed on the web side. The playback time waiting task of the adjacent data frame to be replayed refers to the waiting task before replaying the next frame of data to be replayed after the previous frame of data to be replayed is completed. The playback time waiting task needs to accurately wait for the playback time interval between two frames of data to be replayed.
[0024] S102 , after the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frames to be played back.
[0025] In an embodiment of the present invention, in order to ensure the accuracy of the data playback time, it is necessary to adopt dual threads to respectively implement the playback task of the data frame to be played back and the playback time waiting task. The embodiment of the present invention is developed using webworker+javascript as the main technology stack, and vue2 is used as the interface development framework, wherein the first thread that executes the playback task can be the V8 main thread of javascript, and the second thread that executes the playback time waiting task can be the webworker thread. The V8 main thread only needs to render and display the data frame to be played back, and the webworker thread only needs to execute the playback time waiting task. Specifically, since the playback tasks of each frame of data to be replayed are executed serially, after executing the playback task of the previous frame of data to be replayed, it is necessary to ensure that the playback task of the next frame of data to be replayed starts at the exact moment, so it is necessary to set the playback time waiting task, and the waiting duration of the playback time waiting task is determined according to the current moment and the start playback moment of the playback task of the next frame of data to be replayed. The execution order of the playback task and the playback time waiting task is as follows: for adjacent data frames to be replayed, after the first thread completes the playback task of the previous frame of data to be replayed in the adjacent data frames to be replayed, the second thread starts to execute the playback time waiting task between the two adjacent data frames to be replayed. Specifically, the data time intervals are divided into a series and sent from the V8 main thread to the webworker. The webworker generates a serial task queue. Whenever a task is completed, the webworker notifies the V8 main engine to render the data. In this way, the V8 main thread only needs to re-render the data after receiving the notification, without having to manage the task queue, reducing performance overhead, and thus ensuring the accuracy of the time interval as a whole.
[0026] S103: After the playback time waiting task is completed, the first thread is used to execute the playback task of the subsequent data frame to be played back among the adjacent data frames to be played back.
[0027] In an embodiment of the present invention, after the second thread completes the playback time waiting task between adjacent data frames to be replayed, the first thread begins to execute the playback task of the subsequent frame to be replayed in the adjacent data frames to be replayed. Specifically, after the first thread completes the playback task of the preceding frame to be replayed in the adjacent data frames to be replayed, it sends an instruction to start executing the playback time waiting task to the second thread. After receiving the instruction to start executing the playback time waiting task, the second thread begins to execute the playback time waiting task between the adjacent data frames to be replayed, and when the playback time waiting task is completed, it sends a playback task execution instruction for the subsequent frame to be replayed of the adjacent data frames to be replayed to the first thread. When the first thread receives the playback task execution instruction for the subsequent frame to be replayed, it begins to execute the playback task for the subsequent frame to be replayed in the adjacent data frames to be replayed.
[0028] The data playback method provided by the present invention uses a time measurement function with an accuracy within a preset accuracy threshold to obtain the timestamp of the data frame to be played back, thereby ensuring the accuracy of the timestamp acquisition of each frame of the data to be played back. Based on the timestamp, the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back are generated to ensure the accuracy of the playback order of each data frame to be played back. After the first thread completes the playback task of the preceding frame of the adjacent data frame to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frame to be played back; after the playback time waiting task is completed, the first thread is used to execute the playback task of the following frame of the adjacent data frame to be played back. By using two threads to respectively execute the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back, the performance overhead of the data playback thread is reduced. By using a separate thread to execute the playback time waiting task, the accuracy of the playback interval between each data frame to be played back is guaranteed.
[0029] In some possible embodiments of the present invention, Figure 2 As shown, the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back are generated based on the timestamp, including: S201, generating a serial task queue based on the timestamp sequence of each data frame to be replayed, wherein the serial task queue includes a replay task for each data frame to be replayed; S202 , calculating playback time differences between adjacent data frames to be played back based on their timestamps, and generating playback time waiting tasks for adjacent data frames to be played back based on the timestamp sequence and playback time differences of the data frames to be played back.
[0030] In an embodiment of the present invention, in order to ensure that the playback tasks of each data frame to be replayed are executed in the order in which each data frame to be replayed is acquired, after obtaining the timestamps of each frame of data to be replayed, a serial task queue is generated according to the order of the timestamps. The task queue stores the playback tasks of each data frame to be replayed, and the first thread executes the playback tasks in sequence based on the order of the task queue. Because there will be a playback time interval between adjacent data frames to be replayed when the playback tasks of the data frames to be replayed are executed, the playback time difference between adjacent data frames to be replayed can be calculated based on the timestamps of adjacent data frames to be replayed, and then the playback time waiting tasks of adjacent data frames to be replayed are generated based on the current time and the playback time difference. Specifically, the current timestamp currentTime = Performance.now() is obtained, and the timestamp expectedTime = lastFrameTime + frameInterval when the next frame should be replayed is calculated, where lastFrameTime is the playback start timestamp of the previous frame and frameInterval is the time interval of the current frame. The time difference deltaTime = expectedTime - currentTime is calculated. If deltaTime>0, use await sleep(deltaTime) to wait, where the sleep() function is an asynchronous waiting function, which can be implemented using Promise.resolve().then(() =>{ / *your code * / }), which ensures that the playback time of the next frame is as close to the expected playback time as possible.
[0031] The embodiment of the present invention can determine the playback order of the data frames to be played back and the playback time difference between adjacent data frames to be played back through the timestamps of the data frames to be played back, and generate a playback time waiting task to ensure the accuracy of data playback.
[0032] In some possible embodiments of the present invention, Figure 3 As shown in FIG, the execution process of the playback task of the data frame to be played back includes: S301, obtaining object information in a data frame to be played back and position information of each object in the data frame, and constructing a three-dimensional model of each object; S302: Rendering a three-dimensional model of the object based on the position information in a preset three-dimensional Cartesian coordinate system.
[0033] In an embodiment of the present invention, the provided data playback method can be applied to various fields that require data playback, such as the playback of surveillance videos, the playback of driving data of autonomous vehicles, etc. In the field of autonomous driving, when the driving data of autonomous vehicles is played back, the vehicle-side TBOX uploads the vehicle Ethernet data (vehicle positioning information, speed, fuel consumption, perception data, etc.) to the cloud through the http protocol, and the web side passively receives the cloud vehicle real-time data (vehicle positioning information, speed, instantaneous fuel consumption, brake opening and closing degree, perception data, etc.) through the webscokcet protocol, and actively requests the cloud vehicle historical data (autonomous driving status, vehicle cumulative fuel consumption, lane line information, etc.) through the http protocol; the web-side 3D interface is constructed with deckgl+vue2, and three-dimensional models such as vehicles, obstacles, and lane lines are introduced, and the model positioning, direction, size and other information are rendered to the interface according to the data; javascript queues the acquired cloud data according to the timestamp, and Webworker.js receives the task queue; Webworker The queue is processed serially, specifically as follows: constructing a Cartesian 3D coordinate system based on DeckGL; rendering the acquired obstacle coordinates, size, and other information in 3D space; rendering the lane line coordinate data in 3D space; rendering the vehicle coordinates, size, and other information in 3D space; rendering the planned trajectory coordinate data in 3D space; and displaying the vehicle's condition information and other data on the web. Specifically, the data playback method provided by the present invention is applied to the web, directly performing 3D data modeling and rendering display through the web engine. This process requires restoring the 3D model to the browser based on the actual acquisition time of each frame of the data to be played back. This allows for a realistic and intuitive observation of the data changes occurring within each real time interval within that interval, achieving the unification of space and time.
[0034] The embodiment of the present invention improves the accuracy of data playback by rendering the data frame to be played back in a 3D scene.
[0035] In some possible embodiments of the present invention, Figure 4 As shown, the first thread is used to sequentially execute the playback task of the data frame to be played back based on the task order in the serial task queue. After the first thread completes the playback task of the previous frame to be played back in the adjacent data frame to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frame to be played back, including: S401, obtaining the current time when the first thread completes the playback task of the preceding data frame to be played back among adjacent data frames to be played back; S402, calculating the playback time of the next frame of the data frame to be played back based on the playback time difference between the current time and the adjacent data frame to be played back; S403: Using the second thread to execute the playback time waiting task of the adjacent data frame to be played back, so that the subsequent data frame to be played back starts to be played back at the playback time.
[0036] In an embodiment of the present invention, as described in the above embodiment, due to the limitations of JavaScript's single-thread mechanism and the browser's redrawing mechanism, the playback task queue may exceed the real time interval during execution. Therefore, the present invention adopts a dual-thread mechanism, with the first thread executing the data playback task and the second thread executing the playback time waiting task. The two threads do not affect each other, ensuring the accuracy of the data playback time. The first thread is used to execute the playback task of the data frame to be played back in sequence based on the task order in the serial task queue. Since there is a playback interval between adjacent data frames to be played back, for two adjacent data frames to be played back, when the first thread completes the playback task of the previous frame to be played back, the current moment of the completion of the playback task is obtained, and then the playback time of the next frame to be played back is calculated based on the playback time difference of the adjacent data frames to be played back and the current moment, and the second thread is used to execute the playback time waiting task. The waiting time of the playback time waiting task is the interval between the current moment and the playback time of the next frame to be played back. When the second thread is waiting for the task execution to be completed at the playback time, it sends a playback task execution instruction for the subsequent frame of the adjacent data frame to be played back to the first thread. When the first thread receives the playback task execution instruction for the subsequent frame of the data frame to be played back, it starts to execute the playback task of the subsequent frame of the adjacent data frame to be played back.
[0037] Furthermore, when the playback time of the subsequent data frame to be played back is earlier than the current playback time, the waiting time of the playback task of the subsequent data frame to be played back is adjusted based on the interval between the current time and the playback time, so that the playback time of the subsequent data frame to be played back is equal to or later than the playback end time of the previous data frame to be played back.
[0038] For example, when calculating the playback time interval of adjacent data frames to be played back, due to timestamp acquisition errors or other data errors, the calculated playback time of the subsequent frame to be played back is earlier than the playback completion time of the previous frame to be played back. At this time, the playback time waiting task should no longer be executed, and the playback of the subsequent frame to be played back should be started directly. In the subsequent data playback, the error should be adjusted. For example, if the playback time of the previous frame is 10ms later than the expected time, the waiting time of the subsequent frames should be reduced by 10ms.
[0039] The embodiment of the present invention uses an error compensation method to record accumulated errors and compensate for them during playback of subsequent frames, thereby further ensuring the accuracy of the data playback moment.
[0040] The data playback method provided by the present invention has a smaller error and is closer to the actual time interval. The average error is less than 5ms, and the error of 1-hour data playback is less than 3 seconds. The main thread is only responsible for rendering, and the Web Worker is responsible for data processing, which reduces the burden on the main thread and occupies less resources. It can fully utilize multi-core CPU resources to process larger-scale data, has strong scalability, keeps the main thread smooth, and has a fast page response.
[0041] In order to better implement the data playback method in the embodiment of the present invention, based on the data playback method, correspondingly, Figure 5 As shown, the embodiment of the present invention further provides a data playback device, the data playback device 500 includes: A task generation module 501 is configured to obtain a timestamp of a data frame to be played back using a time measurement function with an accuracy within a preset accuracy threshold, and generate a playback task for the data frame to be played back and a playback time waiting task for adjacent data frames to be played back based on the timestamp; The first task execution module 502 is configured to use a second thread to execute a playback time waiting task for the adjacent data frame to be played back after the first thread completes the playback task for the preceding data frame to be played back among the adjacent data frames to be played back; The second task execution module 503 is configured to use the first thread to execute the playback task of the subsequent data frame to be played back among the adjacent data frames to be played back after the playback time waiting task is completed.
[0042] The data playback device 500 provided in the above embodiment can implement the technical solution described in the above data playback method embodiment. The specific implementation principles of the above modules or units can be found in the corresponding content of the above data playback method embodiment, which will not be repeated here.
[0043] like Figure 6 As shown, the present invention also provides a data playback terminal 600. The data playback terminal 600 includes a processor 601, a memory 602 and a display 603. Figure 6 Only some of the components of the data playback terminal 600 are shown, but it should be understood that it is not required to implement all of the shown components, and more or fewer components may be implemented instead.
[0044] In some embodiments, the processor 601 may be a central processing unit (CPU), a microprocessor, or other data processing chip, configured to execute program codes stored in the memory 602 or process data, such as the data playback method of the present invention.
[0045] In some embodiments, processor 601 may be a single server or a server group. The server group may be centralized or distributed. In some embodiments, processor 601 may be local or remote. In some embodiments, processor 601 may be implemented on a cloud platform. In some embodiments, the cloud platform may include a private cloud, a public cloud, a hybrid cloud, a community cloud, a distributed cloud, an internal cloud, multiple clouds, or any combination thereof.
[0046] In some embodiments, the memory 602 may be an internal storage unit of the data playback terminal 600, such as a hard disk or memory of the data playback terminal 600. In other embodiments, the memory 602 may also be an external storage device of the data playback terminal 600, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the data playback terminal 600.
[0047] Furthermore, the memory 602 may include both an internal storage unit of the data playback terminal 600 and an external storage device. The memory 602 is used to store application software installed in the data playback terminal 600 and various data.
[0048] In some embodiments, the display 603 can be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display 603 is used to display information about the data playback terminal 600 and to display a visual user interface. Components 601-603 of the data playback terminal 600 communicate with each other via a system bus.
[0049] In some embodiments, when the processor 601 executes the data playback program in the memory 602, the following steps may be implemented: A time measurement function with an accuracy within a preset accuracy threshold is used to obtain a timestamp of the data frame to be replayed, and a replay task of the data frame to be replayed and a replay time waiting task of adjacent data frames to be replayed are generated based on the timestamp; After the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, the second thread is used to perform the playback time waiting task of the adjacent data frames to be played back; After the playback time waiting task is completed, the first thread is used to execute the playback task of the subsequent data frame to be played back in the adjacent data frames to be played back.
[0050] It should be understood that, when the processor 601 executes the data playback program in the memory 602 , in addition to the above functions, it can also implement other functions. For details, please refer to the description of the corresponding method embodiment above.
[0051] The data playback terminal provided by the present invention can be a mobile terminal, such as a mobile phone, tablet computer, smartwatch, or other device with a display device; it can also be an in-vehicle terminal, such as an in-vehicle display or computer; or it can be a remote device, such as a display in a control center or a desktop computer, without limitation to this invention. It should be noted that the data playback method provided by the present invention can directly enable playback of three-dimensional data in a browser when the above-mentioned data playback terminal is replaying data.
[0052] Accordingly, an embodiment of the present application also provides a computer-readable storage medium, which is used to store computer-readable programs or instructions. When the program or instructions are executed by a processor, the steps or functions in the data playback method provided in the above-mentioned method embodiments can be implemented.
[0053] Those skilled in the art will appreciate that all or part of the process steps of the above-described embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, such as a magnetic disk, an optical disk, a read-only memory, or a random access memory.
[0054] The above description is only a preferred specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any technician familiar with this technical field within the technical scope disclosed by the present invention should be covered by the scope of protection of the present invention.
Claims
1. A data playback method, characterized in that: include: Obtaining a timestamp of a data frame to be replayed, and generating a replay task of the data frame to be replayed and a replay time waiting task of an adjacent data frame to be replayed based on the timestamp; After the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frames to be played back; After the playback time waiting task is completed, the first thread is used to execute the playback task of the subsequent data frame to be played back among the adjacent data frames to be played back.
2. The data playback method according to claim 1, characterized in that: The step of generating the playback task of the data frame to be played back and the playback time waiting task of the adjacent data frame to be played back based on the timestamp includes: Generate a serial task queue based on the timestamp order of each data frame to be replayed, wherein the serial task queue includes the replay task of each data frame to be replayed; The playback time difference of adjacent data frames to be played back is calculated based on the timestamps of the adjacent data frames to be played back, and the playback time waiting task of each adjacent data frame to be played back is generated based on the timestamp sequence of each data frame to be played back and the playback time difference.
3. The data playback method according to claim 1, wherein: The execution process of the playback task of the data frame to be played back includes: Obtaining object information in the data frame to be replayed and position information of each object in the data frame, and constructing a three-dimensional model of each object; The three-dimensional model of the object is rendered based on the position information in a preset three-dimensional Cartesian coordinate system.
4. The data playback method according to claim 3, characterized in that: When the data frame to be replayed is a vehicle driving scene playback data frame, the execution process of the playback task of the data frame to be replayed includes: The driving trajectory is rendered in the preset three-dimensional Cartesian coordinate system based on the preset trajectory coordinate data.
5. The data playback method according to claim 4, characterized in that: The data frame to be replayed also includes vehicle condition information of the vehicle. The execution process of the replay task of the data frame to be replayed includes: The vehicle condition information is displayed on the rendering result display interface.
6. The data playback method according to claim 2, characterized in that: The first thread is used to sequentially execute the playback task of the data frame to be played back based on the task order in the serial task queue, and after the first thread completes the playback task of the previous frame to be played back in the adjacent data frame to be played back, the second thread is used to execute the playback time waiting task of the adjacent data frame to be played back, including: Obtaining the current time when the first thread completes the playback task of the preceding data frame to be played back among adjacent data frames to be played back; Calculating the playback time of the subsequent data frame to be played back based on the playback time difference between the current time and the adjacent data frame to be played back; The second thread is used to execute the playback time waiting task of the adjacent data frame to be played back, so that the subsequent data frame to be played back starts to be played back at the playback time.
7. The data playback method according to claim 6, characterized in that: When the playback time of the subsequent data frame to be played back is earlier than the current playback time, the waiting time of the playback task of the subsequent data frame to be played back is adjusted based on the interval between the current time and the playback time, so that the playback time of the subsequent data frame to be played back is equal to or later than the playback end time of the previous data frame to be played back.
8. A data playback device, characterized in that: include: A task generation module is used to obtain the timestamp of the data frame to be played back, and generate a playback task of the data frame to be played back and a playback time waiting task of an adjacent data frame to be played back based on the timestamp; A first task execution module is configured to, after the first thread completes the playback task of the preceding frame of the adjacent data frames to be played back, use the second thread to execute the playback time waiting task of the adjacent data frames to be played back; The second task execution module is configured to use the first thread to execute the playback task of the subsequent data frame to be played back among the adjacent data frames to be played back after the playback time waiting task is completed.
9. A data playback terminal, characterized in that: comprising a memory and a processor, wherein, The memory is used to store programs; The processor is coupled to the memory and is configured to execute the program stored in the memory to implement the steps of the data playback method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that Used to store computer-readable programs or instructions, which, when executed by a processor, can implement the steps of the data playback method described in any one of claims 1 to 7.