Video covering method of vehicle-mounted video recorder based on virtual timestamp chain
1. A video covering method of a vehicle-mounted video recorder based on a virtual timestamp chain is characterized by comprising the following steps:
creating a virtual timestamp linked list for recording the timestamp information of the video file in a disk directory;
when the video equipment is recovered abnormally, comparing the maximum timestamp of the virtual timestamp linked list with the current system time;
if the maximum timestamp of the virtual timestamp linked list is larger than the current system time, adding a preset time value to the maximum timestamp of the virtual timestamp linked list to serve as an initial timestamp of the timestamp information of the new video file;
and when the storage of the disk video files is full, covering the old video files according to the time sequence of the time stamps of the virtual time stamp linked list.
2. The method for video overlay for a vehicle video recorder based on virtual time stamp chain as claimed in claim 1, further comprising:
creating an actual time stamp linked list for recording the time stamp information of the video file in a disk directory;
and when the video equipment is recovered abnormally, the default system time is recovered to be used as the initial timestamp of the timestamp information of the new video file.
3. The method for video overlay for a vehicle video recorder based on virtual time stamp chain as claimed in claim 2, further comprising: and when the video equipment is recovered abnormally, time correction is carried out on the virtual timestamp linked list and the actual timestamp linked list.
4. The video overlay method for a vehicle video recorder based on a virtual timestamp chain as claimed in claim 3, wherein said time-correcting the virtual timestamp chain table and the actual timestamp chain table comprises: and correcting the delay time of the virtual timestamp linked list and the actual timestamp linked list when the video equipment is abnormally recovered.
5. The method as claimed in claim 4, wherein the timestamps of the virtual timestamp chain table and the real timestamp chain table after correction are equal to the time difference between the timestamp of the abnormal timestamp interval and the delay time.
6. The method as claimed in claim 5, wherein the video recording device is abnormal, such as GPS or network environment.
Background
In the field of vehicle monitoring, vehicle-mounted video is generally required, the capacity of a disk for storing the video is limited, and after the disk is fully stored, the video needs to be overwritten, namely, a relatively old (time dimension) video file in the disk is deleted and a new video file is written to ensure the continuity of the video. The traditional management method for video storage is based on time dimension management, and the covering strategy is to cover according to the time dimension, namely, to cover the oldest video file in the disk and write a new video file. Therefore, if the RTC of the system is abnormal or the system time is intentionally tampered, the timestamp of the video file in the disk can be disturbed, so that the newly written video file is mistakenly taken as the oldest video to be covered, the continuity of the video covering is greatly damaged, the important evidence video can be mistakenly covered, and the like.
Disclosure of Invention
The invention aims to provide a video covering method of a vehicle-mounted video recorder based on a virtual time stamp chain, which prevents a newly written video file from being covered as the oldest video.
The invention discloses a video covering method of a vehicle-mounted video recorder based on a virtual timestamp chain, which comprises the following steps:
creating a virtual timestamp linked list for recording the timestamp information of the video file in a disk directory;
when the video equipment is recovered abnormally, comparing the maximum timestamp of the virtual timestamp linked list with the current system time;
if the maximum timestamp of the virtual timestamp linked list is larger than the current system time, adding a preset time value to the maximum timestamp of the virtual timestamp linked list to serve as an initial timestamp of the timestamp information of the new video file;
and when the storage of the disk video files is full, covering the old video files according to the time sequence of the time stamps of the virtual time stamp linked list.
The invention relates to a video covering method of a vehicle-mounted video recorder based on a virtual timestamp chain, which is characterized in that when a video device is recovered abnormally, a virtual timestamp chain table for recording the timestamp information of a video file is established in a disk directory, comparing the maximum time stamp of the virtual time stamp linked list with the current system time, if the maximum time stamp of the virtual time stamp linked list is larger than the current system time, adding a preset time value to the maximum time stamp of the virtual time stamp linked list as the initial time stamp of the time stamp information of the new video file, when the storage of the disk video files is full, the old video files are covered according to the time sequence of the time stamps of the virtual time stamp linked list, the problem that the timestamp of the video file in the disk is disordered due to the fact that the RTC of the system is abnormal or the system time is intentionally tampered, and therefore the newly written video file is mistakenly taken as the oldest video to be covered can be effectively solved.
Drawings
FIG. 1 is a schematic flow chart of a video covering method of a vehicle-mounted video recorder based on a virtual timestamp chain according to the present invention;
FIG. 2 is a schematic diagram of an actual timestamp linked list of the present invention;
FIG. 3 is a schematic diagram of a virtual timestamp chain table according to the present invention.
Detailed Description
As shown in fig. 1, a method for overlaying video of a vehicle-mounted video recorder based on a virtual timestamp chain includes:
creating a virtual timestamp linked list for recording the timestamp information of the video file in a disk directory;
when the video equipment is recovered abnormally, comparing the maximum timestamp of the virtual timestamp linked list with the current system time;
if the maximum timestamp of the virtual timestamp linked list is larger than the current system time, adding a preset time value to the maximum timestamp of the virtual timestamp linked list to serve as an initial timestamp of the timestamp information of the new video file;
and when the storage of the disk video files is full, covering the old video files according to the time sequence of the time stamps of the virtual time stamp linked list.
And creating an actual time stamp linked list for recording the time stamp information of the video file in a disk directory. And when the video equipment is recovered abnormally, the recovered default system time is used as the initial timestamp of the timestamp information of the new video file in the recovery process. The virtual timestamp linked list is combined with the timestamp chains of the disk video files of the actual timestamp linked list, so that each video file has both a virtual timestamp and an actual timestamp, and the video coverage continuity and the integrity of time information are ensured. Moreover, the virtual timestamp linked list and the actual timestamp linked list are also greatly convenient for the client to visually look up the video time distribution information and the abnormal information.
Further comprising: and when the video equipment is recovered abnormally, time correction is carried out on the virtual timestamp linked list and the actual timestamp linked list. The time correction of the virtual time stamp linked list and the actual time stamp linked list comprises: and correcting the delay time of the virtual timestamp linked list and the actual timestamp linked list when the video equipment is abnormally recovered. The time stamps of the corrected virtual time stamp linked list and the actual time stamp linked list are equal to the time difference of the time stamp of the abnormal time stamp interval plus the delay time. The video equipment abnormality comprises an abnormality in a GPS or network environment. Set up the calibration function of the time under GPS or the network environment through video recording equipment, because equipment start initial stage and equipment do not lead to the time correction delay that appears well in operation GPS or network environment, during this delay period, the time stamp on the time stamp chain is unusual, wait to correct after succeeding in, on the basis of virtual time stamp chain, through the method of extrapolating, the time difference of unusual time stamp and normal time stamp can be deduced out, then rectify the unusual time stamp in the linked list, the time stamp after the correction equals the time difference of time stamp plus delay time of unusual time stamp interval, thereby can revise unusual time stamp to a certain extent, ensure the furthest's of time stamp accuracy.
The specific example that a new video file is deleted by mistake due to the abnormality of the system RTC is avoided through the virtual timestamp linked list:
as shown in fig. 2, the physical time of FILE3 in the real timestamp list is the latest, but due to the system time anomaly, the system time provided by the device is the oldest, and if the disk is full and the video FILE with the oldest time needs to be deleted first, the system deletes FILE3, thereby deleting the latest video FILE.
The maximum timestamp of the virtual timestamp linked list is compared with the current system time, if the maximum timestamp of the virtual timestamp linked list is greater than the current system time, the maximum timestamp of the virtual timestamp linked list is added with a preset time value to serve as an initial timestamp of the timestamp information of the new video file, when the storage of the disk video file is full, an automatic time repair mechanism for covering the old video file is carried out according to the timestamp time sequence of the virtual timestamp linked list, as shown in FIG. 3, the maximum timestamp in the virtual timestamp linked list is 2021-03-3108-03-01, the system time is 1970-01-0100-01, the maximum timestamp in the virtual timestamp linked list is greater than the system time, at the moment, the value of the maximum timestamp of the virtual timestamp linked list is added with the preset time value for 15 seconds, the initial timestamp of FILE3 promptly, the condition configuration can be followed up to the time value of presetting, if the disc is full this moment, need delete the oldest video FILE of time earlier, then the system can delete FILE1, thereby delete the oldest video FILE, its video circulation covers the mechanism and relies on virtual timestamp linked list completely, the unusual node of actual timestamp linked list can effective recording system time, through looking over the actual timestamp linked list, can directly perceivedly see when system time unusual problem has taken place, the tracking of the problem of being convenient for.
The foregoing is a more detailed description of the invention in connection with specific preferred embodiments and it is not intended that the invention be limited to these specific details. For those skilled in the art to which the invention pertains, several simple deductions or substitutions can be made without departing from the spirit of the invention, and all shall be considered as belonging to the protection scope of the invention.
- 上一篇:石墨接头机器人自动装卡簧、装栓机
- 下一篇:一种网络数据智能化采集装置