A driving recorder data synchronization method for vehicle-mounted terminal equipment and related equipment
By realizing cloud synchronization of driving recorder data in the on-board terminal equipment, the problem of inconvenient video data viewing in the prior art is solved, and the convenience of users to view video recordings in real time without taking out the memory card.
Patent Information
- Application Number
- CN202310120730.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-02-02
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2043-02-02
AI Technical Summary
To view video data of existing driving recorders, you need to take out the memory card and insert it into other devices, which is inconvenient to operate.
Design a driving recorder data synchronization method for on-board terminal equipment, obtain the configuration information of the cloud server, read the mount path of the memory card, start the video directory search thread and the video directory structure information upload thread, obtain basic video information, structure and synchronize unsynchronized data to the cloud server according to synchronization interval and data entries.
It realizes that the dash recorder data can be viewed in real time without taking out the memory card, making the operation more convenient, and users can view real-time videos anytime, anywhere.
Smart Images

Figure CN116132454B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of driving recorder storage, and in particular to a driving recorder data synchronization method and system for vehicle-mounted terminal equipment, vehicle-mounted terminal equipment and a computer-readable storage medium. Background Art
[0002] With the continuous development of society, cars have gradually entered thousands of households. As road conditions become increasingly complex, driving recorders have become a necessary car product for many car owners. Today, there are many kinds of driving recorders, and the quality of various products is also uneven.
[0003] The driving recorder is also called the "black box of the car". It can truly record the driver's operation and the running status of the car during the accident. It can be used as a basis for accident analysis and as an important means of supervision to assess whether the driver is driving in violation of regulations. Due to the functions of "supervision" and "witness", the driver's sense of safety responsibility is greatly improved, thereby significantly reducing the accident rate.
[0004] However, in this era of the Internet of Things and the interconnection of all things, most in-vehicle products are equipped with 4G networking functions. The network only plays an auxiliary role in the core function of the driving recorder. In the traditional operation method, users are limited by the equipment when viewing the videos recorded by the driving recorder. To view the video, they need to take out the memory card of the driving recorder and insert it into a computer or other display device, which is inconvenient for users to operate.
[0005] Therefore, the prior art still needs to be improved and developed. Summary of the invention
[0006] The main purpose of the present invention is to provide a method, system, terminal and computer-readable storage medium for synchronizing dash cam data of a vehicle-mounted terminal device, aiming to solve the problem in the prior art that the video in the dash cam requires the user to take out the memory card of the dash cam and view it through other devices, which is inconvenient for the user to operate.
[0007] To achieve the above object, the present invention provides a method for synchronizing driving recorder data of a vehicle-mounted terminal device, and the method for synchronizing driving recorder data of a vehicle-mounted terminal device comprises the following steps:
[0008] Get the configuration information of the cloud server and save it locally;
[0009] Read the mount path of the memory card. When the memory card is detected, start the video directory retrieval thread and the video directory structure information upload thread;
[0010] Acquire basic video information based on the video directory retrieval thread, and obtain video structured information based on the basic video information;
[0011] Based on the video directory structure information upload thread, a synchronization interval and data entries are obtained according to the configuration information, and the unsynchronized driving recorder data in the video structured information is synchronized to the cloud server according to the synchronization interval and data entries.
[0012] Optionally, in the driving recorder data synchronization method of the vehicle-mounted terminal device, the configuration information includes: the video file directory tree synchronization time interval and the single number of video file directory tree synchronizations.
[0013] Optionally, the driving recorder data synchronization method of the vehicle-mounted terminal device, wherein the acquiring of basic video information based on the video directory retrieval thread and the obtaining of video structured information based on the basic video information, specifically includes:
[0014] Retrieving the storage path and video format of the video in the memory card based on the video directory retrieval thread;
[0015] According to the storage path and video format, the basic information of the video is read based on the FFmpeg open source library, the basic information of the video is integrated to obtain the video structured information, and the video structured information is stored in the local database Sqlite3.
[0016] Optionally, in the method for synchronizing dash cam data of the vehicle-mounted terminal device, the basic video information includes: start recording time, end recording time, video recording time, video frequency, bit rate, resolution and offset of each frame.
[0017] Optionally, the method for synchronizing driving recorder data of the vehicle-mounted terminal device further comprises:
[0018] When the FFmpeg open source library reads the basic information of the video, the video being recorded is not read, and whether the video recording is completed is judged according to the difference between the system time and the last modification time of the video. When the difference between the system time and the last modification time of the video is greater than the preset time, the recording is deemed to be completed;
[0019] When storing the video structured information in the local database Sqlite3, it is determined whether the local database Sqlite3 has stored the same data, and the same data that has been stored is no longer stored.
[0020] Optionally, the method for synchronizing dashcam data of the vehicle-mounted terminal device, wherein the upload thread based on the video directory structure information obtains the synchronization interval and data entries according to the configuration information, and synchronizes the dashcam data that is not synchronized in the video structured information to the cloud server according to the synchronization interval and data entries, specifically includes:
[0021] Based on the video directory structure information upload thread timing to obtain synchronization intervals and data entries according to the configuration information;
[0022] The video directory structure information upload thread reads unsynchronized data from the local database Sqlite3 at a configured interval, synchronizes the unsynchronized data to the cloud server in json format, and marks the status of the data synchronized to the cloud server as synchronized.
[0023] Optionally, the method for synchronizing driving recorder data of the vehicle-mounted terminal device further comprises:
[0024] The video directory structure information uploading thread regularly and actively synchronizes the deleted or overwritten video information in the storage card to the cloud server;
[0025] The cloud server marks the corresponding data as deleted junk data according to the deleted or overwritten video information, and cleans up the junk data in the local database Sqlite3.
[0026] In addition, to achieve the above-mentioned purpose, the present invention further provides a driving recorder data synchronization system of a vehicle-mounted terminal device, wherein the driving recorder data synchronization system of the vehicle-mounted terminal device comprises:
[0027] The information acquisition module is used to obtain the configuration information of the cloud server and save it locally;
[0028] The thread start module is used to read the mount path of the storage card. When the storage card is detected, the video directory search thread and the video directory structure information upload thread are started;
[0029] An information processing module, used for acquiring basic video information based on the video directory retrieval thread, and obtaining video structured information based on the basic video information;
[0030] A data synchronization module is used to obtain a synchronization interval and data entries according to the configuration information based on the video directory structure information upload thread, and synchronize the unsynchronized driving recorder data in the video structured information to the cloud server according to the synchronization interval and data entries.
[0031] In addition, to achieve the above-mentioned purpose, the present invention also provides a vehicle-mounted terminal device, wherein the vehicle-mounted terminal device includes: a memory, a processor, and a driving recorder data synchronization program of the vehicle-mounted terminal device stored in the memory and executable on the processor, and when the driving recorder data synchronization program of the vehicle-mounted terminal device is executed by the processor, the steps of the driving recorder data synchronization method of the vehicle-mounted terminal device as described above are implemented.
[0032] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a driving recorder data synchronization program of a vehicle-mounted terminal device, and when the driving recorder data synchronization program of the vehicle-mounted terminal device is executed by a processor, the steps of the driving recorder data synchronization method of the vehicle-mounted terminal device as described above are implemented.
[0033] In the present invention, the configuration information of the cloud server is obtained and saved locally; the mount path of the memory card is read, and when the memory card is detected, the video directory retrieval thread and the video directory structure information upload thread are started; based on the video directory retrieval thread, the basic video information is obtained, and based on the basic video information, the video structured information is obtained; based on the video directory structure information upload thread, the synchronization interval and data entries are obtained according to the configuration information, and the unsynchronized dashcam data in the video structured information is synchronized to the cloud server according to the synchronization interval and data entries. The present invention synchronizes the dashcam data of the vehicle-mounted terminal device to the cloud server at a regular interval, so that the user does not need to take out the memory card when viewing the dashcam data, and can view the real-time video recording of the dashcam anytime and anywhere, which is more convenient to operate. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 It is a flow chart of a preferred embodiment of a method for synchronizing driving recorder data of a vehicle-mounted terminal device of the present invention;
[0035] Figure 2 It is a flow chart of realizing real-time synchronization of driving recorder data in a preferred embodiment of the driving recorder data synchronization method of the vehicle-mounted terminal device of the present invention;
[0036] Figure 3 It is a schematic diagram of a mobile phone terminal directory display in a preferred embodiment of a method for synchronizing driving recorder data of a vehicle-mounted terminal device of the present invention;
[0037] Figure 4 It is a schematic diagram of a Web-side directory display in a preferred embodiment of a method for synchronizing driving recorder data of a vehicle-mounted terminal device of the present invention;
[0038] Figure 5It is a schematic diagram of the principle of a preferred embodiment of the driving recorder data synchronization system of the vehicle-mounted terminal device of the present invention;
[0039] Figure 6 Schematic diagram of the operating environment of a preferred embodiment of the vehicle-mounted terminal device of the present invention. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical solution and advantages of the present invention clearer and more specific, the present invention is further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not used to limit the present invention.
[0041] The driving recorder data synchronization method of the vehicle terminal device described in the preferred embodiment of the present invention is as follows: Figure 1 and Figure 2 As shown, the driving recorder data synchronization method of the vehicle terminal device includes the following steps:
[0042] Step S10: Obtain configuration information of the cloud server and save it locally.
[0043] Specifically, the use scenario of the present invention is a vehicle-mounted terminal device, which generally has a 4G networking function and a video storage function. The driving recorder has a camera function, which will be divided into different directions, such as the front road, the back road, or a 360-degree panoramic recorder, and stored according to the name of the video storage folder, for example: front, back, left, right and other naming methods, corresponding to: front road, back road, left side, right side, respectively. If they do not correspond, they will all be classified as the front road camera, but no matter what angle, the corresponding video will be stored on the device, and the video list can be obtained with the source video.
[0044] The program (refers to the software APP implanted in the vehicle terminal device, which will automatically run and start when the vehicle terminal device is turned on) is started. First, the configuration information OssConfig (i.e. cloud configuration information) of the cloud server is pulled. The pulled configuration information OssConfig includes: the video file directory tree synchronization time interval vfi_sync_interval, in seconds, 60 seconds by default; the single number of video file directory tree synchronization vfi_sync_batch, 20 by default, and the configuration information OssConfig is cached locally. This configuration information OssConfig can be changed according to actual needs.
[0045] Step S20, read the mount path of the memory card, and when the memory card is detected, start the video directory search thread and the video directory structure information upload thread.
[0046] Specifically, Figure 2As shown, the mounting path of the memory card (TF card) is automatically read first to determine whether there is a memory card. If there is no memory card, the process is terminated directly (because the premise of the use of the present invention is that the vehicle-mounted terminal device has networking and storage functions); if there is a memory card, the video directory retrieval thread ScanVideoThread and the video directory structure information upload thread VideoUpToServerThread are started, and both threads automatically execute subsequent logical processing at a scheduled time (the thread will start when the device is turned on and stop when it is turned off; the timing can be a timer, which is automatically executed at a frequency of once per minute).
[0047] Step S30: acquiring basic video information based on the video directory retrieval thread, and obtaining video structured information based on the basic video information.
[0048] Specifically, based on the video directory retrieval thread ScanVideoThread, the storage path and video format of the video in the storage card are retrieved; according to the storage path and video format, based on the FFmpeg open source library (FFmpeg is a set of open source computer programs that can be used to record and convert digital audio and video and convert them into streams), the basic information of the video is read, and the basic information of the video includes: start recording time beginTime, end recording time endTime, video recording duration, video frequency frame, bit rate rate, resolution resolution and offset of each frame (the offset of each frame is the key frame I frame of the video, and the specific time point can be quickly located according to the offset, and the corresponding picture can be accurately located when the play bar is dragged on the Web page or APP page); the basic information of the video is integrated to obtain the video structured information, and the video structured information is stored in the local database Sqlite3, that is, the basic information of the video read constitutes a video class VideoClass, and the corresponding object VideoInfo has the attribute of storing the video structured information.
[0049] In addition, when the FFmpeg open source library reads the basic information of the video, the video being recorded is not read, and whether the video recording is completed is judged based on the difference between the system time and the last modification time of the video. When the difference between the system time and the last modification time of the video is greater than the preset time (for example, the preset time is 2 seconds), the recording is deemed to be completed (that is, the recording is deemed to be completed when the difference between the two is more than 2 seconds).
[0050] Among them, the last modification time of the video can be obtained by reading the attribute value of the file, which is an attribute of each file. Users generally do not modify the video. If the video is modified, the last modification time of the video will also be recorded synchronously. However, the video directory retrieval thread ScanVideoThread will verify whether the last modification time of the video is effective based on the start recording time of the video + the length of the video. If the difference is large, the time value of the user's last modification will be discarded. The video being recorded will continue to store video stream information in the video file, that is, the video content will continue to be modified, so the video will always be modified. The video being modified is an incomplete video, and the basic information of the video is also incomplete, so you must wait until the video recording is finished, so that the basic information of the video is complete. In other words, it must be ensured that the last modification time of the video and the system time differ by 2 seconds.
[0051] When storing the video structured information in the local database Sqlite3 (the Android system or Linux system of the vehicle-mounted terminal device has a Sqlite3 embedded storage database), it is determined whether the local database Sqlite3 has stored the same data, and the same data that has been stored will no longer be stored.
[0052] The logical process of determining whether there is the same data is to check for duplicates by using the video's storage path. The local database Sqlite3 stores the basic information of each video, including the storage path, which is unique. Each video corresponds to a complete path. If the video information already exists in the local database Sqlite3, it will not be inserted into the local database Sqlite3 again to avoid redundant data in the database.
[0053] The video structured information that is about to be read is stored in the local database Sqlite3. When storing in the local database Sqlite3, it will first determine whether there is the same data. If the same data already exists, it means that it has been analyzed. The data that is not in the database is the incrementally generated video. The local database Sqlite3 records the video's beginTime, endTime, duration, frame, rate, resolution, and the status of whether it has been synchronized to the server, and filePath.
[0054] Step S40: Based on the video directory structure information upload thread, a synchronization interval and data entries are obtained according to the configuration information, and the unsynchronized driving recorder data in the video structured information is synchronized to the cloud server according to the synchronization interval and data entries.
[0055] Specifically, based on the video directory structure information upload thread VideoUpToServerThread, the synchronization interval vfi_sync_interval and the data entry vfi_sync_batch are obtained according to the configuration information OssConfig; the video directory structure information upload thread reads the unsynchronized data from the local database Sqlite3 according to the configuration interval, and synchronizes the unsynchronized data to the cloud server in json format using http, and marks the status of the data synchronized to the cloud server as synchronized.
[0056] In addition, the video directory structure information uploading thread VideoUpToServerThread regularly and actively synchronizes the deleted or overwritten video information in the storage card to the cloud server; for example, the video directory structure information uploading thread VideoUpToServerThread detects which videos have been overwritten and which videos have been deleted every 1 minute, and the status of the deleted and overwritten videos will be changed to deleted, so that the video directory structure information uploading thread VideoUpToServerThread can synchronize this information to the cloud server.
[0057] For example, in the VideoUpToServerThread thread, there will also be a module used to read all the data stored in the local database Sqlite3, and determine whether the video still exists according to the stored video path File file = new File ("video storage path"); boolean isExists = file.exists(); if not, mark the record status as deleted.
[0058] The cloud server marks the corresponding data as deleted junk data according to the deleted or overwritten video information, and cleans up the junk data in the local database Sqlite3.
[0059] The videos stored in the recorder will be overwritten in a loop. After the overwriting, the local videos will no longer exist. At this time, the cloud server still has the previous data records. If the deleted or overwritten videos are not synchronized to the cloud server, the cloud server data will be inconsistent with the data stored in the device. Users can only operate the videos in the storage card from the vehicle terminal device, not the videos on the cloud server. In addition, the cloud server does not store video files, but only stores the structured information of the video, that is, it records what videos the vehicle terminal device has.
[0060] Afterwards, if Figure 2As shown, the specific use of video directory structure information can be viewed through the Web front end and the visual mobile terminal (such as the user's mobile phone). The vehicle terminal device only provides video structured information and only guarantees how to efficiently synchronize video data to the cloud server. The use of Web front end and visual mobile terminal data can be selected according to actual needs.
[0061] The basic information of these videos can be used to structure the video information, and the video structured information can be transmitted to the cloud server through the 4G network and stored. Then, the real-time recording of the recorder can be viewed in real time by reading and displaying the structured information on the Web front end or the visual mobile terminal. Figure 3 and Figure 4 As shown, Figure 3 It is a visual mobile directory display. Figure 4 It is a web-side directory display.
[0062] Furthermore, if Figure 5 As shown, based on the above-mentioned driving recorder data synchronization method of the vehicle-mounted terminal device, the present invention also provides a driving recorder data synchronization system of the vehicle-mounted terminal device, wherein the driving recorder data synchronization system of the vehicle-mounted terminal device includes:
[0063] The information acquisition module 51 is used to obtain the configuration information of the cloud server and save it locally;
[0064] The thread starting module 52 is used to read the mount path of the memory card, and when the memory card is detected, start the video directory search thread and the video directory structure information upload thread;
[0065] An information processing module 53, configured to obtain basic video information based on the video directory search thread, and obtain video structured information based on the basic video information;
[0066] The data synchronization module 54 is used to obtain the synchronization interval and data entries according to the configuration information based on the video directory structure information upload thread, and synchronize the unsynchronized driving recorder data in the video structured information to the cloud server according to the synchronization interval and data entries.
[0067] Furthermore, if Figure 6 As shown, based on the above-mentioned driving recorder data synchronization method and system of the vehicle-mounted terminal device, the present invention also provides a vehicle-mounted terminal device accordingly, and the vehicle-mounted terminal device includes a processor 10, a memory 20 and a display 30. Figure 6 Only some components of the vehicle-mounted terminal device are shown, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
[0068] In some embodiments, the memory 20 may be an internal storage unit of the vehicle-mounted terminal device, such as a hard disk or memory of the vehicle-mounted terminal device. In other embodiments, the memory 20 may also be an external storage device of the vehicle-mounted terminal device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the vehicle-mounted terminal device. Further, the memory 20 may also include both an internal storage unit of the vehicle-mounted terminal device and an external storage device. The memory 20 is used to store application software and various types of data installed in the vehicle-mounted terminal device, such as the program code of the vehicle-mounted terminal device. The memory 20 may also be used to temporarily store data that has been output or is to be output. In one embodiment, the memory 20 stores a driving recorder data synchronization program 40 of the vehicle-mounted terminal device, and the driving recorder data synchronization program 40 of the vehicle-mounted terminal device can be executed by the processor 10, thereby realizing the driving recorder data synchronization method of the vehicle-mounted terminal device in the present application.
[0069] In some embodiments, the processor 10 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run the program code or process data stored in the memory 20, such as executing the driving recorder data synchronization method of the vehicle-mounted terminal device.
[0070] In some embodiments, the display 30 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 30 is used to display information on the vehicle-mounted terminal device and to display a visual user interface. The components 10-30 of the vehicle-mounted terminal device communicate with each other via a system bus.
[0071] In one embodiment, when the processor 10 executes the driving recorder data synchronization program 40 of the vehicle terminal device in the memory 20, the following steps are implemented:
[0072] Get the configuration information of the cloud server and save it locally;
[0073] Read the mount path of the memory card. When the memory card is detected, start the video directory retrieval thread and the video directory structure information upload thread;
[0074] Acquire basic video information based on the video directory retrieval thread, and obtain video structured information based on the basic video information;
[0075] Based on the video directory structure information upload thread, a synchronization interval and data entries are obtained according to the configuration information, and the unsynchronized driving recorder data in the video structured information is synchronized to the cloud server according to the synchronization interval and data entries.
[0076] The configuration information includes: a video file directory tree synchronization time interval and a single number of video file directory tree synchronizations.
[0077] The step of obtaining basic video information based on the video directory retrieval thread and obtaining video structured information based on the basic video information specifically includes:
[0078] Retrieving the storage path and video format of the video in the memory card based on the video directory retrieval thread;
[0079] According to the storage path and video format, the basic information of the video is read based on the FFmpeg open source library, the basic information of the video is integrated to obtain the video structured information, and the video structured information is stored in the local database Sqlite3.
[0080] The basic video information includes: start recording time, end recording time, video recording duration, video frequency, bit rate, resolution and offset of each frame.
[0081] The method for synchronizing driving recorder data of the vehicle-mounted terminal device further includes:
[0082] When the FFmpeg open source library reads the basic information of the video, the video being recorded is not read, and whether the video recording is completed is judged according to the difference between the system time and the last modification time of the video. When the difference between the system time and the last modification time of the video is greater than the preset time, the recording is deemed to be completed;
[0083] When storing the video structured information in the local database Sqlite3, it is determined whether the local database Sqlite3 has stored the same data, and the same data that has been stored is no longer stored.
[0084] The uploading thread based on the video directory structure information obtains the synchronization interval and the data entry according to the configuration information, and synchronizes the unsynchronized driving recorder data in the video structured information to the cloud server according to the synchronization interval and the data entry, specifically including:
[0085] Based on the video directory structure information upload thread timing to obtain synchronization intervals and data entries according to the configuration information;
[0086] The video directory structure information upload thread reads unsynchronized data from the local database Sqlite3 at a configured interval, synchronizes the unsynchronized data to the cloud server in json format, and marks the status of the data synchronized to the cloud server as synchronized.
[0087] The method for synchronizing driving recorder data of the vehicle-mounted terminal device further includes:
[0088] The video directory structure information uploading thread regularly and actively synchronizes the deleted or overwritten video information in the storage card to the cloud server;
[0089] The cloud server marks the corresponding data as deleted junk data according to the deleted or overwritten video information, and cleans up the junk data in the local database Sqlite3.
[0090] The present invention also provides a computer-readable storage medium, wherein the computer-readable storage medium stores a driving recorder data synchronization program of a vehicle-mounted terminal device, and when the driving recorder data synchronization program of the vehicle-mounted terminal device is executed by a processor, the steps of the driving recorder data synchronization method of the vehicle-mounted terminal device as described above are implemented.
[0091] In summary, the present invention provides a method for synchronizing dashcam data of an on-board terminal device and related equipment, the method comprising: obtaining configuration information of a cloud server and saving it locally; reading the mount path of a memory card, and when a memory card is detected, starting a video directory retrieval thread and a video directory structure information upload thread; obtaining basic video information based on the video directory retrieval thread, and obtaining video structured information based on the basic video information; obtaining synchronization intervals and data entries based on the video directory structure information upload thread according to the configuration information, and synchronizing dashcam data that is not synchronized in the video structured information to the cloud server according to the synchronization interval and data entries. The present invention synchronizes dashcam data of an on-board terminal device to a cloud server at a regular interval, so that users do not need to take out the memory card when viewing dashcam data, and can view real-time video recording of the dashcam anytime and anywhere, which is more convenient to operate.
[0092] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or terminal including the element.
[0093] Of course, those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware (such as a processor, a controller, etc.) through a computer program, and the program can be stored in a computer-readable storage medium that can be read by a computer, and the program can include the processes of the above-mentioned method embodiments when executed. The computer-readable storage medium can be a memory, a disk, an optical disk, etc.
[0094] It should be understood that the application of the present invention is not limited to the above examples. For ordinary technicians in this field, improvements or changes can be made based on the above description. All these improvements and changes should fall within the scope of protection of the claims attached to the present invention.
Claims
1. A method for synchronizing driving recorder data of a vehicle-mounted terminal device, characterized in that: The driving recorder data synchronization method of the vehicle terminal device includes: Get the configuration information of the cloud server and save it locally; Read the mount path of the memory card. When the memory card is detected, start the video directory retrieval thread and the video directory structure information upload thread; Acquire basic video information based on the video directory retrieval thread, and obtain video structured information based on the basic video information; Based on the video directory structure information upload thread, the synchronization interval and data entry are acquired according to the configuration information, and the unsynchronized dashcam data in the video structured information is synchronized to the cloud server according to the synchronization interval and data entry; The acquiring of basic video information based on the video directory retrieval thread and obtaining video structured information based on the basic video information specifically includes: Retrieving the storage path and video format of the video in the memory card based on the video directory retrieval thread; According to the storage path and the video format, the basic information of the video is read based on the FFmpeg open source library, the basic information of the video is integrated to obtain the video structured information, and the video structured information is stored in the local database Sqlite3; The basic video information includes: start recording time, end recording time, video recording duration, video frequency, bit rate, resolution and offset of each frame.
2. The driving recorder data synchronization method of the vehicle terminal device according to claim 1, characterized in that: The configuration information includes: a video file directory tree synchronization time interval and a single number of video file directory tree synchronizations.
3. The driving recorder data synchronization method of the vehicle terminal device according to claim 1, characterized in that: The driving recorder data synchronization method of the vehicle terminal device also includes: When the FFmpeg open source library reads the basic information of the video, the video being recorded is not read, and whether the video recording is completed is judged according to the difference between the system time and the last modification time of the video. When the difference between the system time and the last modification time of the video is greater than the preset time, the recording is deemed to be completed; When storing the video structured information in the local database Sqlite3, it is determined whether the local database Sqlite3 has stored the same data, and the same data that has been stored is no longer stored.
4. The driving recorder data synchronization method of the vehicle terminal device according to claim 1, characterized in that: The uploading thread based on the video directory structure information obtains a synchronization interval and a data entry according to the configuration information, and synchronizes the unsynchronized driving recorder data in the video structured information to the cloud server according to the synchronization interval and the data entry, specifically including: Based on the video directory structure information upload thread timing to obtain synchronization intervals and data entries according to the configuration information; The video directory structure information upload thread reads unsynchronized data from the local database Sqlite3 at a configured interval, synchronizes the unsynchronized data to the cloud server in json format, and marks the status of the data synchronized to the cloud server as synchronized.
5. The driving recorder data synchronization method of the vehicle terminal device according to claim 4, characterized in that: The driving recorder data synchronization method of the vehicle terminal device also includes: The video directory structure information uploading thread regularly and actively synchronizes the deleted or overwritten video information in the storage card to the cloud server; The cloud server marks the corresponding data as deleted junk data according to the deleted or overwritten video information, and cleans up the junk data in the local database Sqlite3.
6. A driving recorder data synchronization system for a vehicle-mounted terminal device, characterized in that: The driving recorder data synchronization system of the vehicle terminal device includes: The information acquisition module is used to obtain the configuration information of the cloud server and save it locally; The thread start module is used to read the mount path of the storage card. When the storage card is detected, the video directory search thread and the video directory structure information upload thread are started; An information processing module, used for acquiring basic video information based on the video directory retrieval thread, and obtaining video structured information based on the basic video information; A data synchronization module, configured to obtain a synchronization interval and data entries according to the configuration information based on the video directory structure information upload thread, and synchronize the unsynchronized dashcam data in the video structured information to the cloud server according to the synchronization interval and data entries; The acquiring of basic video information based on the video directory retrieval thread and obtaining video structured information based on the basic video information specifically includes: Retrieving the storage path and video format of the video in the memory card based on the video directory retrieval thread; According to the storage path and the video format, the basic information of the video is read based on the FFmpeg open source library, the basic information of the video is integrated to obtain the video structured information, and the video structured information is stored in the local database Sqlite3; The basic video information includes: start recording time, end recording time, video recording duration, video frequency, bit rate, resolution and offset of each frame.
7. A vehicle-mounted terminal device, characterized in that: The vehicle-mounted terminal device includes: a memory, a processor, and a driving recorder data synchronization program stored in the memory and executable on the processor. When the driving recorder data synchronization program is executed by the processor, the steps of the driving recorder data synchronization method as described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a driving recorder data synchronization program, and when the driving recorder data synchronization program is executed by a processor, the steps of the driving recorder data synchronization method according to any one of claims 1 to 5 are implemented.
