Driving record data processing method, system, equipment and medium
By introducing a temporary file system into the on-board terminal, processing driving record data and generating target video files, the problems of slow transmission speed of external storage devices, easy data damage and poor compatibility are solved, and efficient and stable driving record data processing and storage are achieved.
Patent Information
- Application Number
- CN202510203255.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-27
AI Technical Summary
In the prior art, external storage devices have problems such as slow transmission speed, easy data damage and poor compatibility during driving record data processing.
By introducing a temporary file system, the acquisition thread collects driving record data and writes it to the temporary file system. The video processing thread processes the data and generates the target video file, and finally saves the video file to an external storage device.
It realizes efficient processing of driving record data, avoids video data loss and file system compatibility issues, meets the needs of high-resolution driving record, and improves the storage peripheral compatibility of the smart cockpit system.
Smart Images

Figure CN120045138A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of automobiles, and particularly to a method, system, device and medium for processing driving record data. Background Art
[0002] The driving recorders in intelligent cockpits generally rely on external storage devices to save video files. However, since in-vehicle devices are usually equipped with USB 2.0 interfaces or low-speed USB flash drives, their writing speeds may not be sufficient to process continuous video streams, resulting in problems such as video data loss or delayed storage. In addition, different types of file systems may have differences in compatibility with in-vehicle systems, increasing the complexity of configuration and use. Further, when frequently performing operations such as video segment cropping, splicing, and file index updating on external storage devices, complex file systems may experience data corruption or operation failures. Therefore, there are areas for improvement. Summary of the Invention
[0003] In view of the above-mentioned disadvantages of the prior art, the purpose of the present invention is to provide a method, system, device and medium for processing driving record data, which are used to solve the technical problems of slow transmission speed, easy data corruption and poor compatibility existing in the process of processing driving record data by external storage devices in the prior art.
[0004] To achieve the above object and other related objects, the present invention provides a method for processing driving record data, including:
[0005] Collecting the driving record data of the current recording period through a collection thread, and writing the driving record data into the temporary file system of the vehicle-mounted terminal;
[0006] Judging the remaining storage space of the temporary file system through the collection thread:
[0007] When the remaining storage space is greater than or equal to the storage space of a single recording period, writing the driving record data of the next recording period into the temporary file system;
[0008] When the remaining storage space is less than the storage space of a single recording period, suspending the collection of the driving record data of the next recording period;
[0009] Processing and processing the driving record data through a video processing thread to generate a corresponding target video file, saving the target video file to an external storage device, and releasing the storage space corresponding to the target video file in the temporary file system.
[0010] In an embodiment of the present invention, before the step of collecting driving record data of the current recording period through the collection thread and writing the driving record data into the temporary file system of the vehicle-mounted terminal, it includes:
[0011] When the vehicle-mounted terminal is started, configure the storage space of the temporary file system.
[0012] In an embodiment of the present invention, the step of the collection thread judging the remaining storage space of the temporary file system includes:
[0013] Obtain the storage space of the driving record data of the current recording period and at least one recording period before it through the collection thread, calculate the storage space average value corresponding to the driving record data of multiple recording periods, and record the storage space average value as the storage space of a single recording period;
[0014] Obtain the remaining storage space of the temporary file system through the collection thread, and judge whether the remaining storage space is greater than the storage space of a single recording period.
[0015] In an embodiment of the present invention, the step of suspending the collection of driving record data of the next recording period when the remaining storage space is less than the storage space of a single recording period further includes:
[0016] Monitor the remaining storage space of the temporary file system through the collection thread, and when the remaining storage space is greater than or equal to the storage space of a single recording period, restart writing the driving record data of the next recording period into the temporary file system.
[0017] In an embodiment of the present invention, the step of processing the driving record data through the video processing thread to generate a corresponding target video file includes:
[0018] Perform splicing processing on the driving record data through the video processing thread based on a preset splicing rule to generate an initial video file;
[0019] Obtain the emergency time point corresponding to the current recording period through the video processing thread, and perform cropping processing on the initial video file based on the emergency time point to generate an emergency video file;
[0020] Save the initial video file and the emergency video file as the target video file.
[0021] In an embodiment of the present invention, the step of performing cropping processing on the initial video file based on the emergency time point to generate an emergency video file includes:
[0022] Through the video processing thread, in the initial video file, crop the video files with a preset duration before and after the emergency time point, and save them as emergency video files.
[0023] In an embodiment of the present invention, after saving the target video file to an external storage device, the following further includes:
[0024] Through the video processing thread, obtain the occupied space in the external storage device, and when the occupied space reaches a preset storage threshold, delete some data in the external storage device.
[0025] The present invention also provides a processing system for driving record data, which is characterized by including:
[0026] An acquisition module, configured to acquire driving record data of the current recording period through an acquisition thread, and write the driving record data into the temporary file system of the vehicle-mounted terminal;
[0027] A monitoring module, configured to judge the remaining storage space of the temporary file system through an acquisition thread:
[0028] When the remaining storage space is greater than or equal to the storage space of a single recording period, continue to write the driving record data of the next recording period into the temporary file system; when the remaining storage space is less than the storage space of a single recording period, pause acquiring the driving record data of the next recording period;
[0029] A video processing module, configured to process the driving record data through a video processing thread to generate a corresponding target video file, save the target video file to an external storage device, and release the storage space corresponding to the target video file in the temporary file system.
[0030] The present invention also provides an electronic device, which includes:
[0031] One or more processors;
[0032] A storage device, configured to store one or more programs, and when the one or more programs are executed by the one or more processors, enable the electronic device to implement the processing method of driving record data as described in any one of the above.
[0033] The present invention also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor of a computer, enable the computer to execute the processing method of driving record data as described in any one of the above.
[0034] As described above, a method, system, device, and medium for processing driving record data according to the present invention have the following beneficial effects: Through the multi-threaded processing mechanism of the acquisition thread and the video processing thread, the present invention solves the problem of recording loss during video processing. The present invention realizes that only one video file is written to the external storage device during a single recording cycle of driving records, and at the same time ensures that the time of the new video being written to the disk is misaligned with the time of erasing the old video, so as to avoid parallel operation of low-speed peripherals. In the present invention, complex operations of video files are all completed in the temporary file system. Therefore, the requirements for the file system of the storage peripheral in the driving record scenario are reduced, and the file system operation method of the storage peripheral only needs to support file copying, improving the compatibility of the intelligent cockpit system with the storage peripheral and meeting the high-resolution driving record requirements of different in-vehicle hardware and different storage external devices. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 It is a schematic flow chart of a method for processing driving record data provided by an embodiment of the present invention;
[0036] Figure 2 It is a schematic block diagram of a system for processing driving record data provided by an embodiment of the present invention;
[0037] Figure 3 It is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0038] The following specific examples illustrate the embodiments of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0039] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The type, quantity, and ratio of each component in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0040] In the following description, a large number of details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0041] First of all, it should be noted that the main task of a dash cam is to record video images during driving in real time, which serves as an important basis for post-event analysis, accident liability determination, and safety monitoring. With the continuous improvement of the pixel of in-vehicle cameras, the resolution of dash cam videos has gradually developed from 1080P to 2K, 4K, and even higher, and the external storage difficulty of dash cam videos has also increased significantly. The external storage device of the dash cam has evolved from an SDCARD peripheral to a USB device. However, the USB devices of in-vehicle devices on the market are uneven, and the device interface standards can include half-duplex USB 2.0, full-duplex USB 2.0, to full-duplex USB 3.2, etc. Among them, the write speed of a half-duplex USB 2.0 device or other low-speed USB flash drives may not be sufficient to handle the reading and writing of continuous video streams. If reading and writing are parallel, it will cause technical problems such as the dash cam images not being able to be saved to the disk.
[0042] In addition, the file systems used by different external storage devices (such as FAT32, exFAT, NTFS, etc.) may have compatibility issues with the in-vehicle system. For example, the in-vehicle system can be compatible with FAT32 and exFAT file systems, but not with the NTFS file system. In addition, performing some complex file system operations (such as frequently cropping or splicing video files or updating file indexes) in the external storage device may cause data corruption or operation failure. If the above situations occur in emergency scenarios such as traffic accidents, due to the write speed limitation of the dash cam application, high-quality video images cannot be saved to the storage peripheral in real time, which will inevitably cause problems with the functional stability of the dash cam, thereby reducing the user experience.
[0043] The present invention provides a method, system, device, and medium for processing dash cam data, which relates to the field of automotive technology and can be specifically applied to solve the technical problems of slow transmission speed, easy data corruption, and poor compatibility existing in the prior art during the processing of dash cam data. By introducing a temporary file system to save the original video files processed by the dash cam application, the present invention can better meet the high-quality requirements of the current intelligent cockpit for dash cams, providing an important guarantee for vehicle safety and user experience. The following will be described in detail through specific embodiments.
[0044] Please refer to Figure 1 , a method for processing dash cam data of the present invention may include the following steps:
[0045] Step S100: Collect dash cam data of the current recording period through a collection thread and write the dash cam data into the temporary file system of the in-vehicle terminal;
[0046] Step S200: Determine the remaining storage space of the temporary file system through the collection thread:
[0047] Step S300: When the remaining storage space is greater than or equal to the storage space of a single recording cycle, continue to write the driving record data of the next recording cycle into the temporary file system;
[0048] Step S400: When the remaining storage space is less than the storage space of a single recording cycle, suspend the acquisition of the driving record data of the next recording cycle;
[0049] Step S500: Process the driving record data through a video processing thread to generate a corresponding target video file, save the target video file to an external storage device, and release the storage space corresponding to the target video file in the temporary file system.
[0050] In an embodiment of the present invention, steps S100 to S500 can be executed by different threads of a driving record application. In this embodiment, the driving record application may include a capture thread, a video processing thread, and other threads. Among them, the capture thread is responsible for capturing the driving video through a camera and writing it into the temporary file system to form an initial video file. In this embodiment, in order to ensure the continuity of video recording, even in the case of resource constraints, the capture thread will be given a higher priority. It will periodically obtain image frames from the camera and save them as video segments. In addition, the capture thread also needs to handle some special situations, such as video locking in case of emergency. When it is detected that the vehicle has a collision or other abnormal events, the controller in the driving recorder will trigger the emergency recording mode. At this time, the capture thread will immediately mark the current video segment as non-overwriteable and may save it separately to a special folder for future reference.
[0051] The task of the video processing thread is to perform a series of backend processing operations on the initial video file captured by the capture thread. These processes may include but are not limited to video compression, format conversion, cropping, splicing, adding time stamps, and geographical location information, etc. It can be understood that since video processing is often a computationally intensive task, the video processing thread usually runs in the background to avoid interfering with the real-time recording process. Once the video processing is completed, the finally generated video file will be copied to an external storage device, such as an SD card or a USB flash drive. It should be noted that the video processing thread also needs to consider how to effectively manage the storage resources. Especially in the case of limited storage space, the most recent and important video materials should be given priority to be retained.
[0052] In addition to the above two core threads, the driving record application may also include other auxiliary threads for performing specific functions or services. For example: a network communication thread responsible for exchanging data with other devices or cloud servers, such as uploading videos and receiving update instructions; a user interface thread for managing the rendering and interaction logic of the graphical interface, providing functions such as allowing users to view real-time previews or playback historical records; a status monitoring thread for continuously monitoring the health status of the system, including indicators such as battery power, temperature, and memory occupancy rate, and taking preventive measures when necessary; a task scheduling thread for coordinating the collaboration between various threads to ensure that they execute their respective tasks in an orderly manner according to a predetermined schedule.
[0053] In an embodiment of the present invention, when step S100 is executed, the driving record data of the current recording period is collected by the collection thread and written into the temporary file system of the vehicle-mounted terminal. Specifically, the collection thread starts to collect the driving record data of the current recording period through vehicle sensors (such as cameras) and writes the driving record data into a pre-set temporary file system.
[0054] It should be noted that the Temporary File System (TMPFS) is a special file system that uses the computer's memory (RAM) as a storage medium to provide fast read and write operations. Since TMPFS has extremely high read and write speeds, it is very suitable for storing data that is frequently accessed but has a short lifespan. For example, intermediate files generated during compilation, cached page content of a web server, and result sets of database queries can all be considered to be stored on TMPFS. Doing so can not only significantly improve application performance but also reduce the pressure on the physical disk, helping to extend the lifespan of the hardware.
[0055] In an embodiment of the present invention, before performing step S100, that is, after the in-vehicle terminal is started, it is necessary to configure the maximum occupied space of the temporary file system. Specifically, when the in-vehicle terminal is powered on, first, the instrument system is started. The instrument system quickly completes self-check and is ready to receive information from other ECUs (Electronic Control Unit) to update the display content in a timely manner. Then, the central control system is normally powered on. The central control system usually includes function modules such as multimedia entertainment and navigation, and there is a close data interaction between it and the instrument panel. Immediately afterwards, the mounting program of the central control system configures the maximum occupied space of the temporary file system, that is, the upper limit of the temporary file system space. In this embodiment, the maximum occupied space of the temporary file system can be configured as 512MB, for example. By setting a fixed size limit for the temporary file system, the stability and response speed of the in-vehicle terminal can be ensured, thereby preventing the temporary files from occupying too much space and affecting the operation of other important functions. For example, in a Linux environment, the mounting options can be specified by modifying the / etc / fstab file, including but not limited to space quotas, etc. This not only helps manage storage resources but also avoids service interruption problems caused by insufficient disk space. Finally, the driving record application turns on the camera and is ready to start recording driving videos. In this embodiment, in order to ensure the security and continuity of video data, the driving recorder may use the cyclic overwrite method to save the video data in the recent period. In addition, the driving recorder also needs to cooperate with other in-vehicle systems, such as receiving emergency information from the in-vehicle terminal to determine whether it is necessary to specially mark the occurrence time of certain events and generate corresponding emergency video files.
[0056] In an embodiment of the present invention, when performing step S200, that is, the remaining storage space of the temporary file system is judged through the acquisition thread. Specifically, it may include the following steps:
[0057] Step S210: Obtain the storage space of the driving record data in the current recording period and at least one recording period before it through the acquisition thread, calculate the storage space mean value corresponding to the driving record data in multiple recording periods, and record the storage space mean value as the storage space of a single recording period;
[0058] Step S220: Obtain the remaining storage space of the temporary file system through the acquisition thread, and judge whether the remaining storage space is greater than the storage space of a single recording period.
[0059] In an embodiment of the present invention, when steps S210 to S220 are executed, specifically, after the data collection of the current recording cycle is completed, the acquisition thread needs to check how much remaining storage space there is in the temporary file system. First, since the amount of space required for each recording cycle can be estimated (such as based on factors such as resolution and frame rate), future storage requirements can be planned without affecting the existing data. In this embodiment, the storage space of a single recording cycle is calculated based on the driving record data in the current recording cycle and multiple recording cycles immediately preceding it. Then, the usage of the temporary file system is obtained by calling the API provided by the operating system. Next, it is determined whether the remaining storage space is greater than the storage space of a single recording cycle.
[0060] In an embodiment of the present invention, when step S300 is executed, that is, when the remaining storage space is greater than or equal to the storage space of a single recording cycle, the driving record data of the next recording cycle is continuously written into the temporary file system. Specifically, when the remaining storage space in the temporary file system is greater than or equal to the storage space of a single recording cycle, it indicates that the data collection of the next recording cycle can be safely continued, that is, the new driving record will continue to be saved in the temporary file system. This process is repeated until the predefined maximum occupied space is reached or other termination conditions are encountered.
[0061] In an embodiment of the present invention, when step S400 is executed, that is, when the remaining storage space is less than the storage space of a single recording cycle, the acquisition of the driving record data of the next recording cycle is paused. Specifically, when the remaining storage space in the temporary file system is not enough to store the storage space of a single recording cycle, measures should be taken to protect the existing data from being damaged, that is, the further data collection activities are paused to prevent new data from overwriting important historical records.
[0062] Furthermore, the remaining storage space of the temporary file system can also be monitored by the acquisition thread. When the remaining storage space is greater than or equal to the storage space of a single recording cycle, the acquisition thread can restart writing the driving record data of the next recording cycle into the temporary file system.
[0063] In one embodiment of the present invention, when step S500 is executed, the driving record data is processed by a video processing thread to generate a corresponding target video file, the target video file is saved to an external storage device, and the storage space corresponding to the target video file in the temporary file system is released. Specifically, first, the video processing thread checks the processing status of the driving record data in the previous recording cycle, that is, whether the driving record data in the previous recording cycle has been successfully processed and transferred to a long-term storage location. In this embodiment, the processing of the driving record data includes, but is not limited to, operations such as video compression, format conversion, cropping, splicing, adding time stamps, and geographical location information. Only when it is confirmed that the video in the previous cycle has been correctly processed will the driving record data in the current cycle be allowed to be processed similarly. This not only helps to maintain data consistency but also avoids resource contention problems caused by multiple unfinished tasks at the same time point.
[0064] In this embodiment, when the processing status of the driving record data in the previous recording cycle is unfinished, the video processing thread continues to process the data in the previous recording cycle. After the processing status of the driving record data in the previous recording cycle is completed, the video processing thread will process the driving record data in the current recording cycle to generate a corresponding target video file. Once the final editing and optimization of the video are completed, the video processing thread will save the target video file to an external storage device, which can be, for example, an SD card, a USB flash drive, or other forms of non-volatile memory. At the same time, this part of the space originally occupied in the temporary file system will be released for future new data use. This ensures an efficient video recording and management mechanism even under limited storage conditions.
[0065] In one embodiment of the present invention, the processing of the initial video file in the current recording cycle to generate a corresponding target video file may specifically include the following steps:
[0066] Step S510: Splice the driving record data based on a preset splicing rule through a video processing thread to generate an initial video file;
[0067] Step S520: Obtain the emergency time point corresponding to the current recording cycle recorded by the vehicle-mounted terminal through the video processing thread, and crop the initial video file based on the emergency time point to generate an emergency video file;
[0068] Step S530: Save the initial video file and the emergency video file as a target video file.
[0069] In an embodiment of the present invention, when step S610 is executed, that is, the driving record data is spliced based on a preset splicing rule through a video processing thread to generate an initial video file. Specifically, the driving record data within a recording period is usually saved as multiple small-segment video files, and the video processing thread can splice them in chronological order to form a coherent initial video file.
[0070] Furthermore, in addition to splicing the initial video file in chronological order, the video processing thread also supports merging video streams captured from different angles or different sources within the same time period according to a preset splicing rule. This splicing can be a simple sequential connection of multiple continuously captured video segments, or a more complex layout design, such as horizontally or vertically arranging the video outputs of multiple cameras. Specifically, if a user installs multiple driving recorders covering different perspectives, the videos captured by these devices can be automatically recognized by software and combined together according to a certain logic after the fact to generate a complete spliced video file.
[0071] In an embodiment of the present invention, when step S620 is executed, that is, the video processing thread obtains the emergency time point corresponding to the current recording period recorded by the in-vehicle terminal, and based on the emergency time point, performs cropping processing on the initial video file to generate an emergency video file. Specifically, when the in-vehicle terminal detects that the vehicle has collided, braked suddenly, or made a sharp turn or other emergency situations, the built-in controller will record the occurrence time of these emergency situations and record it as the emergency time point. In this embodiment, when the video processing thread further processes the initial video file, it first obtains the emergency time point corresponding to the current recording period. Then, according to the emergency time point, the initial video file is cropped to generate an emergency video file. The emergency video file only retains the video segments of a preset duration directly related to the emergency situation, which means that all video content from a period of time before the emergency event occurs until a period of time after the event ends will be extracted to form an independent emergency video file. For example, if the content before and after the accident is set to 10 seconds each, the system will accurately intercept these 20 seconds of video segments as the emergency video file.
[0072] In one embodiment of the present invention, when step S630 is executed, the initial video file and multiple emergency video files are saved as the target video file. Specifically, after completing the above two steps, the driving recorder application saves the video file after cropping and / or splicing as the target video file. It can be understood that all short segment videos caused by emergencies and any longer version videos formed by splicing will be packaged into an easy-to-manage and retrieve form. For emergency video files, they will be specially marked for quick positioning; for the initial video file, additional metadata may be attached to indicate the timestamp and other relevant information of the original material.
[0073] In one embodiment of the present invention, after saving the target video file to an external storage device, the video processing thread further obtains the occupied space in the external storage device, and deletes part of the data in the external storage device when the occupied space reaches a preset storage threshold. Specifically, in the driving recorder application, the video processing thread is not only responsible for saving the target video file to the external storage device, but also for monitoring the occupied space of the external storage device. When it is detected that the occupied space reaches the preset storage threshold, the video processing thread will automatically take measures to delete part of the data to ensure that there is enough available space to continue recording new videos.
[0074] In this embodiment, after each time the video processing thread writes data to the external storage device, it obtains the current used storage space information. Specifically, it can be completed by calling the API provided by the Android system to obtain the total space, available space, and used space of the external storage device. Thereby, it is judged whether the occupied space of the external storage device is approaching the set storage threshold to ensure that there is enough remaining space to meet the next data write.
[0075] In an embodiment of the present invention, after it is confirmed that the occupied space on the external storage device exceeds a preset storage threshold, the video processing thread will start a data cleaning mechanism. In this embodiment, the data cleaning will be selectively performed according to certain rules. For example, sorting by the creation date of the files, gradually deleting from the earliest video files until a preset size of storage space is released, such as 10GB of storage space. It can also be filtered according to the importance markings. When some video files are marked as "important" or "urgent" by the user, then these files will not be included in the cleaning scope. Only those ordinary videos without special markings will become potential deletion targets. Further, even when performing the cleaning operation, the video processing thread still needs to specially protect the video segments related to accidents or other major events to ensure that they will not be accidentally deleted due to insufficient space. Such videos often have high legal value and social significance, so additional attention should be given. Through the above method, the video processing thread can ensure the security and integrity of key video materials while maintaining the healthy state of the external storage device.
[0076] As can be seen from the above, the present invention solves the problem of recording loss during video processing through the multi-threaded processing mechanism of the acquisition thread and the video processing thread. The present invention realizes that in a single recording cycle of the driving recorder, only one video file is written to the external storage device, and at the same time, it ensures that the time of the new video being written to the disk is misaligned with the time of the old video being erased to avoid parallel operation of low-speed peripherals. In the present invention, all complex operations of the video file are completed in the temporary file system. Therefore, the requirements for the file system of the storage peripheral in the driving recorder scenario are reduced. The file system operation method of the storage peripheral only needs to support file copying, which improves the compatibility of the intelligent cockpit system with the storage peripheral and can meet the high-resolution driving record requirements of different in-vehicle hardware and different storage external devices. It can be seen that this solution can better meet the high-quality requirements of the current intelligent cockpit for driving records and provides an important guarantee for vehicle safety and user experience.
[0077] Please refer to Figure 2 , the present invention also provides a processing system for driving record data, which corresponds one-to-one with the processing method in the above embodiment. The processing system may include an acquisition module 11, a monitoring module 12, and a video processing module 13. The detailed description of each functional module is as follows:
[0078] The acquisition module 11 can be used to acquire the driving record data of the current recording cycle through the acquisition thread and write the driving record data into the temporary file system of the vehicle terminal. Further, the acquisition module 11 can specifically be used to collect the driving record data of the current recording cycle through the vehicle sensor (such as a camera) at the start of the acquisition thread and write the driving record data into a preset temporary file system.
[0079] The monitoring module 12 can be used to judge the remaining storage space of the temporary file system through the acquisition thread: when the remaining storage space is greater than or equal to the storage space of a single recording period, write the driving record data of the next recording period into the temporary file system; when the remaining storage space is less than the storage space of a single recording period, pause the acquisition of the driving record data of the next recording period. Further, the monitoring module 12 can specifically be used to obtain the storage space of the driving record data of the current recording period and at least one recording period before it through the acquisition thread, calculate the storage space mean value corresponding to the driving record data of multiple recording periods, and record the storage space mean value as the storage space of a single recording period; obtain the remaining storage space of the temporary file system through the acquisition thread, and judge whether the remaining storage space is greater than the storage space of a single recording period.
[0080] The video processing module 13 can be used to process the driving record data through the video processing thread, generate a corresponding target video file, save the target video file to an external storage device, and release the storage space corresponding to the target video file in the temporary file system. Further, the video processing module 13 can also specifically be used to splice-process the driving record data based on a preset splicing rule through the video processing thread to generate an initial video file; obtain the emergency time point corresponding to the current recording period recorded by the vehicle-mounted terminal through the video processing thread, and crop-process the initial video file based on the emergency time point to generate an emergency video file; save the initial video file and the emergency video file as the target video file.
[0081] For the specific limitations of the processing system, reference can be made to the limitations on the processing method in the foregoing text, which will not be elaborated here. Each module in the above processing system can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor in the computer device in the form of hardware or be independent of it, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0082] An embodiment of the present invention also provides an electronic device, including: one or more processors; a storage device for storing one or more programs, which, when executed by the one or more processors, cause the electronic device to implement the processing method of the driving record data provided in the above respective embodiments.
[0083] Please refer to Figure 3 , the electronic device 2 may include a memory 22, a processor 23, and a bus, and may also include a computer program stored in the memory 22 and operable on the processor 23, such as a processing program for driving record data.
[0084] Among them, the memory 22 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (such as SD or DX memory, etc.), magnetic memory, magnetic disk, optical disc, etc. In some embodiments, the memory 22 can be an internal storage unit of the electronic device 2, such as the mobile hard disk of the electronic device 2. In other embodiments, the memory 22 can also be an external storage device of the electronic device 2, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, etc. equipped on the electronic device 2. Further, the memory 22 can also include both the internal storage unit and the external storage device of the electronic device 2. The memory 22 can be used not only to store application software installed in the electronic device 2 and various types of data, such as the code for processing driving record data, etc., but also to temporarily store data that has been output or will be output.
[0085] In some embodiments, the processor 23 can be composed of integrated circuits. For example, it can be composed of a single packaged integrated circuit, or can be composed of multiple integrated circuits with the same or different functions, including the combination of one or more Central Processing Units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips, etc. The processor 23 is the control core (Control Unit) of the electronic device 2, connecting various components of the entire electronic device 2 through various interfaces and lines, and by running or executing programs or modules (such as the program for processing driving record data, etc.) stored in the memory 22, and calling the data stored in the memory 22, to execute various functions of the electronic device 2 and process data.
[0086] The processor 23 executes the operating system of the electronic device 2 and various installed application programs. The processor 23 executes the application program to implement the steps in the above-mentioned method for processing driving record data.
[0087] Exemplarily, the computer program can be divided into one or more modules, and the one or more modules are stored in the memory 22 and executed by the processor 23 to complete this application. The one or more modules can be a series of computer program instruction segments capable of completing specific functions, and these instruction segments are used to describe the execution process of the computer program in the electronic device 2. For example, the computer program can be divided into an acquisition module 11, a monitoring module 12, and a video processing module 13.
[0088] The integrated unit implemented in the form of software functional modules described above can be stored in a computer-readable storage medium, which can be non-volatile or volatile. The above software functional modules are stored in a storage medium and include several instructions for causing a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute some functions of the method for processing driving record data described in various embodiments of the present application.
[0089] In summary, a method, a system, a device, and a medium for processing driving record data disclosed in the present invention relate to the technical field of automobiles and can be specifically applied to solve the technical problems of slow transmission speed, easy data damage, and poor compatibility existing in the process of processing driving record data by external storage devices in the prior art. By introducing a temporary file system to save the original video files processed by the driving record application, the present invention can better meet the high-quality requirements of the current intelligent cockpit for driving records, providing an important guarantee for vehicle safety and user experience. Therefore, the present invention effectively overcomes various disadvantages in the prior art and has high industrial utilization value.
[0090] The above embodiments are only illustrative of the principles and effects of the present invention and are not used to limit the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical ideas disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A method for processing driving record data, characterized in that: Applied to vehicle terminals, including: Collecting the driving record data of the current recording period through the collection thread, and writing the driving record data into the temporary file system of the vehicle terminal; Determine the remaining storage space of the temporary file system through the collection thread: When the remaining storage space is greater than or equal to the storage space of a single recording cycle, continue to write the driving record data of the next recording cycle into the temporary file system; When the remaining storage space is less than the storage space of a single recording cycle, suspending the collection of driving record data for the next recording cycle; The driving record data is processed by a video processing thread to generate a corresponding target video file, the target video file is saved in an external storage device, and the storage space corresponding to the target video file in the temporary file system is released.
2. The method for storing driving record data according to claim 1, characterized in that: Before the step of collecting the driving record data of the current recording period through the collection thread and writing the driving record data into the temporary file system of the vehicle terminal, the method includes: When the vehicle-mounted terminal is started, the storage space of the temporary file system is configured.
3. The method for storing driving record data according to claim 1, characterized in that: The step of determining the remaining storage space of the temporary file system through the acquisition thread includes: Acquire the storage space of the driving record data of the current recording period and at least one previous recording period through the acquisition thread to calculate the average value of the storage space corresponding to the driving record data of multiple recording periods, and record the average value of the storage space as the storage space of a single recording period; The remaining storage space of the temporary file system is obtained through the acquisition thread, and it is determined whether the remaining storage space is greater than the storage space of a single recording cycle.
4. The method for storing driving record data according to claim 1, characterized in that: When the remaining storage space is smaller than the storage space of a single recording cycle, the step of suspending the collection of driving record data of the next recording cycle also includes: The remaining storage space of the temporary file system is monitored by the acquisition thread, and when the remaining storage space is greater than or equal to the storage space of a single recording cycle, the driving record data of the next recording cycle is restarted to be written into the temporary file system.
5. The method for storing driving record data according to claim 1, characterized in that: The step of processing the driving record data through the video processing thread to generate a corresponding target video file includes: The driving record data is spliced based on a preset splicing rule by a video processing thread to generate an initial video file; Acquire the emergency time point corresponding to the current recording cycle through the video processing thread, and based on the emergency time point, perform cropping processing on the initial video file to generate an emergency video file; The initial video file and the emergency video file are saved as target video files.
6. The method for storing driving record data according to claim 4, characterized in that: The step of performing cropping processing on the initial video file based on the emergency time point to generate an emergency video file comprises: The video processing thread cuts out video files of preset lengths before and after the emergency time point from the initial video file and saves them as emergency video files.
7. The method for storing driving record data according to claim 1, characterized in that: After the target video file is saved in the external storage device, the method further includes: The occupied space in the external storage device is obtained through the video processing thread, and when the occupied space reaches a preset storage threshold, part of the data in the external storage device is deleted.
8. A system for processing driving record data, characterized in that: include: A collection module, used for collecting driving record data of the current recording period through a collection thread, and writing the driving record data into a temporary file system of the vehicle terminal; The monitoring module is used to determine the remaining storage space of the temporary file system through the acquisition thread: When the remaining storage space is greater than or equal to the storage space of a single recording cycle, the driving record data of the next recording cycle continues to be written into the temporary file system; when the remaining storage space is less than the storage space of a single recording cycle, the collection of the driving record data of the next recording cycle is suspended; The video processing module is used to process the driving record data through a video processing thread, generate a corresponding target video file, save the target video file to an external storage device, and release the storage space corresponding to the target video file in the temporary file system.
9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, enables the electronic device to implement the method for processing driving record data as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor of a computer, the computer is caused to execute the method for processing driving record data as described in any one of claims 1 to 7.
Citation Information
Cited By
Data processing method and apparatus, computing device, computer-readable storage medium, and program product
CN122634655A