技术领域technical field
本发明涉及应用在DVR视频大数据存储的技术领域,尤其涉及一种车载DVR裸盘存储文件系统。The invention relates to the technical field applied to DVR video big data storage, in particular to a vehicle-mounted DVR bare disk storage file system.
背景技术Background technique
为了解决DVR视频大数据存储的问题,当前,大多数产家采取的做法是将磁盘预分配的策略,即将整磁盘格式化为fat32的格式,而文件系统大部分都是采用fat32磁盘预分配的策略来实行,其由此产生的问题也是比较明显的,其个有以下的足:磁盘格式化时间过长,,开机时做文件系统检测与修复的时间过长,其写入效率也是十分低,32G容量的磁盘,fat文件系统的开机时做文件系统检测与修复的时间要在2-10分钟才能完成,并且操作的过程中容易产生文件碎片。因此,为了解决这些问题,本申请人研发一种将磁盘分为两个分区,一个是第一分区的数据索引分区,另一个是第二分区的数据存储分区,两者大小比例在1:500左右,由于第二分区的数据索引分区不需要做任何文件系统的记录工作,写入速度非常快,其也不需要格式化及做系统检测工作,所有文件系统格式化,系统检测与文件系统的修复都发生在第一分区的数据索引分区这个超小型分区内,即使行为方式一样,但工作量却明显大大减少,同等容量大小的磁盘开机时做文件系统检测与修复仅在30秒以内便可完成,并且不会产生文件碎片,给日常开机与例行检查修复带来飞一般的感觉,运行速度快,使用更加顺畅,简便的一种车载DVR裸盘存储文件系统确属必要。In order to solve the problem of large data storage of DVR videos, most manufacturers currently adopt the strategy of pre-allocating disks, that is, formatting the entire disk into fat32 format, and most of the file systems are pre-allocated using fat32 disks The resulting problems are quite obvious, including the following problems: the disk formatting time is too long, the file system detection and repair time is too long when starting up, and the writing efficiency is also very low , 32G capacity disk, the file system detection and repair time of the fat file system will take 2-10 minutes to complete, and file fragments are likely to occur during the operation. Therefore, in order to solve these problems, the applicant has developed a method to divide the disk into two partitions, one is the data index partition of the first partition, and the other is the data storage partition of the second partition, and the size ratio of the two is 1:500 About, because the data index partition of the second partition does not need to do any recording work of the file system, the writing speed is very fast, and it does not need to format and do system testing. All file system formatting, system testing and file system The repairs all take place in the ultra-small partition of the data index partition of the first partition. Even though the behavior is the same, the workload is significantly reduced. It only takes less than 30 seconds to detect and repair the file system when a disk of the same size is turned on. Complete, and no file fragments will be generated, bringing a flying feeling to daily startup and routine inspection and repair, fast running speed, smoother use, and a simple car DVR bare disk storage file system is indeed necessary.
发明内容Contents of the invention
本发明要解决的技术问题是提供一种将磁盘分为两个分区,一个是第一分区的数据索引分区,另一个是第二分区的数据存储分区,两者大小比例在1:500左右,由于第二分区的数据索引分区不需要做任何文件系统的记录工作,写入速度非常快,其也不需要格式化及做系统检测工作,所有文件系统格式化,系统检测与文件系统的修复都发生在第一分区的数据索引分区这个超小型分区内,即使行为方式一样,但工作量却明显大大减少,同等容量大小的磁盘开机时做文件系统检测与修复仅在30秒以内便可完成,并且不会产生文件碎片,给日常开机与例行检查修复带来飞一般的感觉,运行速度快,使用更加顺畅,简便的车载DVR裸盘存储文件系统。本发明是通过以下技术方案来实现的:The technical problem to be solved by the present invention is to provide a method for dividing the disk into two partitions, one is the data index partition of the first partition, and the other is the data storage partition of the second partition, and the size ratio of the two is about 1:500. Because the data index partition of the second partition does not need to do any file system recording work, the writing speed is very fast, and it does not need to format and do system testing. All file system formatting, system testing and file system repairing It occurs in the ultra-small partition of the data index partition of the first partition. Even though the behavior is the same, the workload is significantly reduced. The file system detection and repair can be completed within 30 seconds when the disk with the same capacity is turned on. And there will be no file fragments, which brings a flying feeling to daily startup and routine inspection and repair. It runs fast and uses more smoothly. It is a simple car DVR bare disk storage file system. The present invention is achieved through the following technical solutions:
一种车载DVR裸盘存储文件系统,应用在DVR视频大数据存储中,包括磁盘,及与磁盘连接设置的设备端和播放器,所述磁盘包括第一分区的数据索引分区与第二分区的数据存储分区,第二分区的数据存储分区也叫裸分区,所述第一分区的数据索引分区与第二分区的数据存储分区的大小比例是1:500,第一分区的数据索引分区做文件系统的记录工作,包括文件系统所有的格式化、系统检测和文件系统的修复;第二分区的数据存储分区主要是写入数据,第一分区的数据索引分区的文件系统类型采用的是fat32,第二分区的数据存储分区的文件系统类型采用的是ext2,所述设备端也用作写入数据,所述播放器则用作读取数据。A vehicle-mounted DVR bare disk storage file system, which is used in DVR video big data storage, includes a disk, and a device end and a player connected to the disk, and the disk includes a data index partition of the first partition and a data index partition of the second partition. Data storage partition, the data storage partition of the second partition is also called a bare partition, the size ratio of the data index partition of the first partition to the data storage partition of the second partition is 1:500, and the data index partition of the first partition is used as a file The recording work of the system includes all formatting of the file system, system detection and repair of the file system; the data storage partition of the second partition is mainly for writing data, and the file system type of the data index partition of the first partition is fat32. The file system type of the data storage partition of the second partition is ext2, the device is also used for writing data, and the player is used for reading data.
所述设备端的工作步骤为:The working steps of the device end are:
A:首先初始化对应磁盘的参数,包括分区挂载在那个设备节点上,录像存储的文件夹及录像文件的信息。A: First initialize the parameters of the corresponding disk, including the device node on which the partition is mounted, the folder where the video is stored, and the information of the video file.
B:根据A步骤中初始化的磁盘信息,把磁盘挂载到相应的设备节点上面,在磁盘挂载成功以后获取磁盘的文件信息,判断磁盘是否需要复写。B: According to the disk information initialized in step A, mount the disk to the corresponding device node, obtain the file information of the disk after the disk is mounted successfully, and judge whether the disk needs to be overwritten.
C:根据B步骤中磁盘挂载成功以后判断磁盘中最晚写入录像的时间,根据这个时间来判断马上写入录像数据的位置。C: Judging the latest recording time in the disk after the disk is mounted successfully in step B, and judging the position of immediately writing the recording data according to this time.
D:根据B、C步骤在要写录像之前,先要打开录像写入接口,使在第二分区的数据存储分区写入录像数据之前先在第一分区的数据索引分区用数据库记录录像文件的索引,使此数据库的数据暂时还在内存中。D: according to B, C step before wanting to write video recording, earlier will open video recording write-in interface, make the data index subregion of first subregion record video file with database before the data storage subregion of second subregion writes video data Index, so that the data of this database is still in memory temporarily.
E:根据D步骤,在第二分区的数据存储分区裸盘中按照64K大小的块写入录像文件数据,写完以后,同步,将内存中的数据库数据刷新进入第一分区的数据索引分区的数据库中。E: According to step D, write video file data in blocks of 64K in the raw disk of the data storage partition of the second partition. After writing, synchronize and refresh the database data in the memory into the data index partition of the first partition in the database.
F:当要格式化、检测和修复磁盘的时候都在磁盘的第一分区的数据索引分区中操作,而第二分区的数据存储分区的原始数据不动。F: When the disk is to be formatted, detected and repaired, it is operated in the data index partition of the first partition of the disk, while the original data of the data storage partition of the second partition does not move.
所述播放器的工作步骤为:The working steps of the player are:
A:首先加载磁盘信息,其主要是确认磁盘需要挂载在那个磁盘分区上面,然后初始化磁盘里面的信息。A: First load the disk information, which is mainly to confirm that the disk needs to be mounted on the disk partition, and then initialize the information in the disk.
B:根据A步骤中磁盘初始化成功以后,然后先读第一分区的数据索引分区里面的所有录像文件的索引信息。B: According to the successful initialization of the disk in step A, first read the index information of all video files in the data index partition of the first partition.
C:根据B步骤中的读取录像文件信息以后按照时间排列录像列表,然后再根据对应的时间选取相应的录像列表,在第二分区的数据存储分区里面读取对应的录像数据。C: Arrange the video list according to time after reading the video file information in the B step, then select the corresponding video list according to the corresponding time, and read the corresponding video data in the data storage partition of the second partition.
作为优选,在所述设备端的B步骤中,在磁盘挂载的时候要先卸载挂载点,然后根据系统初始化的过程填写好磁盘的信息,并修复第一分区的数据索引分区中的fat32格式文件系统,然后再挂载磁盘;当磁盘挂载成功以后再初始化第一分区的数据索引分区中的数据库文件,最后才打开第二分区的数据存储分区写入数据。Preferably, in step B of the device side, when the disk is mounted, the mount point must be unmounted first, and then fill in the disk information according to the system initialization process, and repair the fat32 format in the data index partition of the first partition file system, and then mount the disk; when the disk is successfully mounted, initialize the database file in the data index partition of the first partition, and finally open the data storage partition of the second partition to write data.
作为优选,所述磁盘在挂载成功以后判断第一分区的数据索引分区里面的数据是否需要复写,当数据需要复写就复写相应的数据。Preferably, after the disk is successfully mounted, it is determined whether the data in the data index partition of the first partition needs to be rewritten, and when the data needs to be rewritten, the corresponding data is rewritten.
作为优选,在所述设备端的C步骤中,在写入数据之前需要先判断最晚写入录像的时间,当最晚写入录像的时间比当前系统时间晚时,那么需要先校验系统时间,在系统时间恢复到跟录像时间一样的时候才开始写入录像;当录像时间出现错误时,那么需要格式化第一分区的数据索引分区的录像索引文件,重新写入录像。As a preference, in step C of the device side, before writing data, it is necessary to judge the latest time to write the video, when the latest time to write the video is later than the current system time, then the system time needs to be checked first , when the system time returns to be the same as the recording time, the recording will start to be written; when the recording time is wrong, the recording index file of the data index partition of the first partition needs to be formatted, and the recording should be written again.
作为优选,在所述设备端的D步骤中,在写入录像之前需要获取磁盘的空间大小,即获取第二分区的数据存储分区能否写入数据的大小。Preferably, in the step D on the device side, before writing the video recording, it is necessary to obtain the space size of the disk, that is, to obtain the size of whether data can be written in the data storage partition of the second partition.
作为优选,在所述设备端的E步骤中,在写入录像数据的时候需要将码流数据开始按照4K大小对齐,然后按照文件系统每块64K的大小写入到第二分区的数据存储分区中,当写完以后,每个录像的索引文件要从内存数据库中刷新进入到第一分区的数据索引分区的数据库中保存记录。As a preference, in the E step of the device side, when writing video data, the code stream data needs to be aligned according to the size of 4K, and then written into the data storage partition of the second partition according to the size of each block of 64K in the file system After writing, the index file of each video will be refreshed from the memory database and entered into the database of the data index partition of the first partition to save the record.
作为优选,在所述播放器的B、C步骤中,首先需要操作第一分区的数据索引分区的内容,将数据库中全部数据读取出来放到列表中,然后按照时间的排列顺序来选择列表中的索引文件,把第二分区的数据存储分区的原始数据以64K一块的大小、按顺序读取出来。Preferably, in steps B and C of the player, it is first necessary to operate the content of the data index partition of the first partition, read all the data in the database and put them in the list, and then select the list according to the order of time The index file in the second partition reads the original data of the data storage partition of the second partition sequentially in a block size of 64K.
作为优选,所述设备端往磁盘中写入数据时,一旦写入即可成功生成存放在第一分区的数据索引分区的索引文件,然后通过播放器把磁盘中第一分区的数据索引分区的索引文件读出来,再根据读出来的索引文件来调用实际读原始数据的接口,把原始数据读取出来。As a preference, when the device side writes data into the disk, once it is written, it can successfully generate the index file of the data index partition stored in the first partition, and then use the player to record the data index file of the first partition in the disk. Read the index file, and then call the interface for actually reading the original data according to the read index file, and read the original data.
作为优选,所述第一分区的数据索引分区的索引文件是通过操作数据库来写入和读取的,该数据库的记录和排列数据的效率高,稳定性好,并且数据内容扩展性强。Preferably, the index file of the data index partition of the first partition is written and read by operating a database, and the database records and arranges data with high efficiency, good stability, and strong expansibility of data content.
本发明的一种车载DVR裸盘存储文件系统,应用在DVR视频大数据存储中,包括磁盘,及与磁盘连接设置的设备端和播放器,所述磁盘包括第一分区的数据索引分区与第二分区的数据存储分区,第二分区的数据存储分区也叫裸分区,第一分区的数据索引分区做文件系统的记录工作,包括文件系统所有的格式化、系统检测和文件系统的修复;第二分区的数据存储分区主要是写入数据,第一分区的数据索引分区的文件系统类型采用的是fat32,第二分区的数据存储分区的文件系统类型采用的是ext2,所述设备端也用作写入数据,所述播放器则用作读取数据。本发明将磁盘分为两个分区,一个是第一分区的数据索引分区,另一个是第二分区的数据存储分区,两者大小比例在1:500左右,由于第二分区的数据索引分区不需要做任何文件系统的记录工作,写入速度非常快,其也不需要格式化及做系统检测工作,所有文件系统格式化,系统检测与文件系统的修复都发生在第一分区的数据索引分区这个超小型分区内,即使行为方式一样,但工作量却明显大大减少,同等容量大小的磁盘开机时做文件系统检测与修复仅在30秒以内便可完成,并且不会产生文件碎片,给日常开机与例行检查修复带来飞一般的感觉,运行速度快,而第二分区的数据存储分区为裸盘存储,使用更加顺畅,操作简便。A vehicle-mounted DVR bare disk storage file system of the present invention is used in DVR video big data storage, including a disk, and a device end and a player connected to the disk, and the disk includes a data index partition of the first partition and a second partition. The data storage partition of the second partition, the data storage partition of the second partition is also called the bare partition, and the data index partition of the first partition is used for recording the file system, including all formatting, system detection and file system repair of the file system; The data storage partition of the second partition is mainly for writing data. The file system type of the data index partition of the first partition is fat32, and the file system type of the data storage partition of the second partition is ext2. The device side also uses For writing data, the player is used for reading data. The invention divides the disk into two partitions, one is the data index partition of the first partition, and the other is the data storage partition of the second partition, and the size ratio of the two is about 1:500. Since the data index partition of the second partition is not Need to do any file system recording work, the writing speed is very fast, and it does not need to format and do system testing. All file system formatting, system testing and file system repairs occur in the data index partition of the first partition In this ultra-small partition, even though the behavior is the same, the workload is significantly reduced. The file system detection and repair can be completed within 30 seconds when a disk with the same capacity is turned on, and no file fragments will be generated. Start-up and routine inspection and repair bring a feeling of flying, and the operation speed is fast, while the data storage partition of the second partition is stored on a bare disk, which is smoother and easier to operate.
附图说明Description of drawings
为了易于说明,本发明由下述的较佳实施例及附图作以详细描述。For ease of illustration, the present invention is described in detail by the following preferred embodiments and accompanying drawings.
图1为本发明的一种车载DVR裸盘存储文件系统中磁盘整体分区按大小比例为1:500的构成图。Fig. 1 is a composition diagram of the overall partition of the disk in a bare disk storage file system of a vehicle-mounted DVR according to the present invention with a size ratio of 1:500.
图2为本发明的一种车载DVR裸盘存储文件系统的复写磁盘结构图。Fig. 2 is a structural diagram of a rewritten disk of a vehicle-mounted DVR bare disk storage file system according to the present invention.
图3为本发明的一种车载DVR裸盘存储文件系统的设备端写入数据图。FIG. 3 is a diagram of data written at the device end of a bare disk storage file system of a vehicle-mounted DVR according to the present invention.
图4为本发明的一种车载DVR裸盘存储文件系统的播放器读取数据图。Fig. 4 is a diagram of data read by a player of a bare disk storage file system of a vehicle-mounted DVR according to the present invention.
具体实施方式detailed description
为了便于理解本发明,下面将参照相关附图对本发明进行更全面的描述。附图中给出了本发明的较佳实施方式。但是,本发明可以以许多不同的形式来实现,并不限于本文所描述的实施方式。相反地,提供这些实施方式的目的是使对本发明的公开内容理解的更加透彻全面。In order to facilitate the understanding of the present invention, the present invention will be described more fully below with reference to the associated drawings. Preferred embodiments of the invention are shown in the accompanying drawings. However, the present invention can be embodied in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present invention more thorough and comprehensive.
除非另有定义,本文所使用的所有的技术和科学术语与属于本发明的技术领域的技术人员通常理解的含义相同。本文中在本发明的说明书中所使用的术语只是为了描述具体的实施方式的目的,不是旨在于限制本发明。Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the technical field of the invention. The terminology used herein in the description of the present invention is only for the purpose of describing specific embodiments, and is not intended to limit the present invention.
本实施例中,参照图1至图4所示,本发明的一种可以快速更换皮带的张紧机构,应用在DVR视频大数据存储中,包括磁盘,及与磁盘连接设置的设备端和播放器,所述磁盘包括第一分区的数据索引分区与第二分区的数据存储分区,第二分区的数据存储分区也叫裸分区,所述第一分区的数据索引分区与第二分区的数据存储分区的大小比例是1:500,第一分区的数据索引分区做文件系统的记录工作,包括文件系统所有的格式化、系统检测和文件系统的修复;第二分区的数据存储分区主要是写入数据,第一分区的数据索引分区的文件系统类型采用的是fat32,第二分区的数据存储分区的文件系统类型采用的是ext2,所述设备端也用作写入数据,所述播放器则用作读取数据。In this embodiment, referring to Fig. 1 to Fig. 4, a kind of tensioning mechanism of the present invention that can quickly replace the belt is applied in DVR video big data storage, including a disk, and a device end and a playback device connected to the disk. The disk includes the data index partition of the first partition and the data storage partition of the second partition. The data storage partition of the second partition is also called a raw partition. The data index partition of the first partition and the data storage partition of the second partition The size ratio of the partition is 1:500. The data index partition of the first partition is used to record the file system, including all formatting, system detection and file system repair of the file system; the data storage partition of the second partition is mainly for writing For data, the file system type of the data index partition of the first partition adopts fat32, and the file system type of the data storage partition of the second partition adopts ext2, and the device end is also used for writing data, and the player then Used to read data.
所述设备端的工作步骤为:The working steps of the device end are:
A:首先初始化对应磁盘的参数,包括分区挂载在那个设备节点上,录像存储的文件夹及录像文件的信息。A: First initialize the parameters of the corresponding disk, including the device node on which the partition is mounted, the folder where the video is stored, and the information of the video file.
B:根据A步骤中初始化的磁盘信息,把磁盘挂载到相应的设备节点上面,在磁盘挂载成功以后获取磁盘的文件信息,判断磁盘是否需要复写。B: According to the disk information initialized in step A, mount the disk to the corresponding device node, obtain the file information of the disk after the disk is mounted successfully, and judge whether the disk needs to be overwritten.
C:根据B步骤中磁盘挂载成功以后判断磁盘中最晚写入录像的时间,根据这个时间来判断马上写入录像数据的位置。C: Judging the latest recording time in the disk after the disk is mounted successfully in step B, and judging the position of immediately writing the recording data according to this time.
D:根据B、C步骤在要写录像之前,先要打开录像写入接口,使在第二分区的数据存储分区写入录像数据之前先在第一分区的数据索引分区用数据库记录录像文件的索引,使此数据库的数据暂时还在内存中。D: according to B, C step before wanting to write video recording, earlier will open video recording write-in interface, make the data index subregion of first subregion record video file with database before the data storage subregion of second subregion writes video data Index, so that the data of this database is still in memory temporarily.
E:根据D步骤,在第二分区的数据存储分区裸盘中按照64K大小的块写入录像文件数据,写完以后,同步,将内存中的数据库数据刷新进入第一分区的数据索引分区的数据库中。E: According to step D, write video file data in blocks of 64K in the raw disk of the data storage partition of the second partition. After writing, synchronize and refresh the database data in the memory into the data index partition of the first partition in the database.
F:当要格式化、检测和修复磁盘的时候都在磁盘的第一分区的数据索引分区中操作,而第二分区的数据存储分区的原始数据不动。F: When the disk is to be formatted, detected and repaired, it is operated in the data index partition of the first partition of the disk, while the original data of the data storage partition of the second partition does not move.
所述播放器的工作步骤为:The working steps of the player are:
A:首先加载磁盘信息,其主要是确认磁盘需要挂载在那个磁盘分区上面,然后初始化磁盘里面的信息。A: First load the disk information, which is mainly to confirm that the disk needs to be mounted on the disk partition, and then initialize the information in the disk.
B:根据A步骤中磁盘初始化成功以后,然后先读第一分区的数据索引分区里面的所有录像文件的索引信息。B: According to the successful initialization of the disk in step A, first read the index information of all video files in the data index partition of the first partition.
C:根据B步骤中的读取录像文件信息以后按照时间排列录像列表,然后再根据对应的时间选取相应的录像列表,在第二分区的数据存储分区里面读取对应的录像数据。C: Arrange the video list according to time after reading the video file information in the B step, then select the corresponding video list according to the corresponding time, and read the corresponding video data in the data storage partition of the second partition.
在其中一实施例中,在所述设备端的B步骤中,在磁盘挂载的时候要先卸载挂载点,然后根据系统初始化的过程填写好磁盘的信息,并修复第一分区的数据索引分区中的fat32格式文件系统,然后再挂载磁盘;当磁盘挂载成功以后再初始化第一分区的数据索引分区中的数据库文件,最后才打开第二分区的数据存储分区写入数据。In one of the embodiments, in the step B of the device side, when the disk is mounted, the mount point must be uninstalled first, and then fill in the disk information according to the system initialization process, and repair the data index partition of the first partition After the disk is mounted successfully, the database file in the data index partition of the first partition is initialized, and finally the data storage partition of the second partition is opened to write data.
在其中一实施例中,所述磁盘在挂载成功以后判断第一分区的数据索引分区里面的数据是否需要复写,复写的作用是将错误时间的索引给删除,这个错误时间是根据将当前系统时间与数据库里面数据存储的时间进行对比而判断的,一旦当前系统时间小于数据库中数据存储的时间数据时,那么就要对数据库中大于当前系统时间的那段索引数据进行复写。In one embodiment, after the disk is successfully mounted, it is determined whether the data in the data index partition of the first partition needs to be overwritten. The function of overwriting is to delete the index at the wrong time. The wrong time is based on the current system The time is judged by comparing the time with the data stored in the database. Once the current system time is less than the time data stored in the database, the index data in the database that is greater than the current system time must be overwritten.
在其中一实施例中,在所述设备端的C步骤中,在写入数据之前需要先判断最晚写入录像的时间,当最晚写入录像的时间比当前系统时间晚时,那么需要先校验系统时间,在系统时间恢复到跟录像时间一样的时候才开始写入录像;当录像时间出现错误时,那么需要格式化第一分区的数据索引分区的录像索引文件,重新写入录像。In one of the embodiments, in step C on the device side, before writing data, it is necessary to judge the latest time to write the video, and when the latest time to write the video is later than the current system time, then it is necessary to first Check the system time, and start writing the video when the system time returns to be the same as the recording time; when the recording time is wrong, you need to format the video index file of the data index partition of the first partition, and rewrite the video.
在其中一实施例中,在所述设备端的D步骤中,在写入录像之前需要获取磁盘的空间大小,即获取第二分区的数据存储分区能否写入数据的大小。In one of the embodiments, in step D of the device side, before writing the video recording, it is necessary to obtain the space size of the disk, that is, to obtain the size of whether data can be written in the data storage partition of the second partition.
在其中一实施例中,在所述设备端的E步骤中,在写入录像数据的时候需要将码流数据开始按照4K大小对齐,然后按照文件系统每块64K的大小写入到第二分区的数据存储分区中,当写完以后,每个录像的索引文件要从内存数据库中刷新进入到第一分区的数据索引分区的数据库中保存记录。In one of the embodiments, in the step E of the device side, when writing video data, the code stream data needs to be aligned according to the size of 4K, and then written to the second partition according to the size of each block of 64K in the file system. In the data storage partition, after writing, the index file of each video will be refreshed from the memory database and entered into the database of the data index partition of the first partition to save the record.
在其中一实施例中,在所述播放器的B、C步骤中,首先需要操作第一分区的数据索引分区的内容,将数据库中全部数据读取出来放到列表中,然后按照时间的排列顺序来选择列表中的索引文件,把第二分区的数据存储分区的原始数据以64K一块的大小、按顺序读取出来。In one embodiment, in steps B and C of the player, it is first necessary to operate the content of the data index partition of the first partition, read all the data in the database and put them in the list, and then arrange them according to time Select the index files in the list sequentially, and read the original data of the data storage partition of the second partition in a block size of 64K in order.
在其中一实施例中,所述设备端往磁盘中写入数据时,一旦写入即可成功生成索引文件,此索引文件存在第一分区的数据索引分区,然后在播放器中,把磁盘的第一分区的数据索引分区的索引文件读出来,再根据读出来的索引文件来调用实际读原始数据的接口,把原始数据读取出来。In one of the embodiments, when the device side writes data into the disk, once written, the index file can be successfully generated. The index file exists in the data index partition of the first partition, and then in the player, the disk's The index file of the data index partition of the first partition is read out, and then the interface for actually reading the original data is called according to the read index file, and the original data is read out.
在其中一实施例中,所述第一分区的数据索引分区的索引文件是通过操作数据库来写入和读取的,该数据库的记录和排列数据的效率高,稳定性好,并且数据内容扩展性强。In one of the embodiments, the index file of the data index partition of the first partition is written and read by operating the database, and the efficiency of recording and arranging data in the database is high, the stability is good, and the data content is expanded. Strong.
本发明的一种车载DVR裸盘存储文件系统,应用在DVR视频大数据存储中,包括磁盘,及与磁盘连接设置的设备端和播放器,所述磁盘包括第一分区的数据索引分区与第二分区的数据存储分区,第二分区的数据存储分区也叫裸分区,第一分区的数据索引分区做文件系统的记录工作,包括文件系统所有的格式化、系统检测和文件系统的修复;第二分区的数据存储分区主要是写入数据,第一分区的数据索引分区的文件系统类型采用的是fat32,第二分区的数据存储分区的文件系统类型采用的是ext2,所述设备端也用作写入数据,所述播放器则用作读取数据。本发明将磁盘分为两个分区,一个是第一分区的数据索引分区,另一个是第二分区的数据存储分区,两者大小比例在1:500左右,由于第二分区的数据索引分区不需要做任何文件系统的记录工作,写入速度非常快,其也不需要格式化及做系统检测工作,所有文件系统格式化,系统检测与文件系统的修复都发生在第一分区的数据索引分区这个超小型分区内,即使行为方式一样,但工作量却明显大大减少,同等容量大小的磁盘开机时做文件系统检测与修复仅在30秒以内便可完成,并且不会产生文件碎片,给日常开机与例行检查修复带来飞一般的感觉,运行速度快,而第二分区的数据存储分区为裸盘存储,使用更加顺畅,操作简便。A vehicle-mounted DVR bare disk storage file system of the present invention is used in DVR video big data storage, including a disk, and a device end and a player connected to the disk, and the disk includes a data index partition of the first partition and a second partition. The data storage partition of the second partition, the data storage partition of the second partition is also called the bare partition, and the data index partition of the first partition is used for recording the file system, including all formatting, system detection and file system repair of the file system; The data storage partition of the second partition is mainly for writing data. The file system type of the data index partition of the first partition is fat32, and the file system type of the data storage partition of the second partition is ext2. The device side also uses For writing data, the player is used for reading data. The invention divides the disk into two partitions, one is the data index partition of the first partition, and the other is the data storage partition of the second partition, and the size ratio of the two is about 1:500. Since the data index partition of the second partition is not Need to do any file system recording work, the writing speed is very fast, and it does not need to format and do system testing. All file system formatting, system testing and file system repairs occur in the data index partition of the first partition In this ultra-small partition, even though the behavior is the same, the workload is significantly reduced. The file system detection and repair can be completed within 30 seconds when a disk with the same capacity is turned on, and no file fragments will be generated. Start-up and routine inspection and repair bring a feeling of flying, and the operation speed is fast, while the data storage partition of the second partition is stored on a bare disk, which is smoother and easier to operate.
上述实施例,只是本发明的一个实例,并不是用来限制本发明的实施与权利范围,凡与本发明权利要求所述内容相同或等同的技术方案,均应包括在本发明保护范围内。The foregoing embodiment is only an example of the present invention, and is not intended to limit the implementation and scope of rights of the present invention. All technical solutions identical or equivalent to those described in the claims of the present invention shall be included in the protection scope of the present invention.
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510763769.3ACN105353986B (en) | 2015-11-11 | 2015-11-11 | Vehicle-mounted DVR (digital video recorder) bare disk storage file system |
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510763769.3ACN105353986B (en) | 2015-11-11 | 2015-11-11 | Vehicle-mounted DVR (digital video recorder) bare disk storage file system |
| Publication Number | Publication Date |
|---|---|
| CN105353986Atrue CN105353986A (en) | 2016-02-24 |
| CN105353986B CN105353986B (en) | 2018-04-03 |
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510763769.3AActiveCN105353986B (en) | 2015-11-11 | 2015-11-11 | Vehicle-mounted DVR (digital video recorder) bare disk storage file system |
| Country | Link |
|---|---|
| CN (1) | CN105353986B (en) |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108763531A (en)* | 2018-05-31 | 2018-11-06 | 深圳市易甲文技术有限公司 | A kind of MDVR document storage systems and its operation method |
| CN109634910A (en)* | 2018-11-08 | 2019-04-16 | 珠海全志科技股份有限公司 | A method of promoting DVR file writing speed |
| CN109766325A (en)* | 2019-01-09 | 2019-05-17 | 吴思齐 | A kind of distributed file system and flow data wiring method towards flow data |
| CN109819345A (en)* | 2017-11-20 | 2019-05-28 | 网宿科技股份有限公司 | Live video processing, time shifting method, video processing device and cloud storage system |
| CN113703667A (en)* | 2021-07-14 | 2021-11-26 | 深圳市有为信息技术发展有限公司 | File system processing method and device for storing data in real time, vehicle-mounted terminal and commercial vehicle |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100061708A1 (en)* | 2008-09-05 | 2010-03-11 | Barton James M | Server-based program recording scheduling |
| CN101873457A (en)* | 2009-09-02 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | DVR (Digital Video Recorder) as well as data backup method and system thereof |
| CN203027497U (en)* | 2012-11-30 | 2013-06-26 | 大唐电信科技股份有限公司 | Wireless intelligent public transportation system |
| CN103986898A (en)* | 2014-06-03 | 2014-08-13 | 四川效率源信息安全技术有限责任公司 | Device and method for extracting remnant videos and deleted videos in DVR hard disk |
| CN104268088A (en)* | 2014-09-15 | 2015-01-07 | 郑州天迈科技股份有限公司 | Vehicle DVR (Digital Video Recorder) hard disk data storage method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20100061708A1 (en)* | 2008-09-05 | 2010-03-11 | Barton James M | Server-based program recording scheduling |
| CN101873457A (en)* | 2009-09-02 | 2010-10-27 | 杭州海康威视数字技术股份有限公司 | DVR (Digital Video Recorder) as well as data backup method and system thereof |
| CN203027497U (en)* | 2012-11-30 | 2013-06-26 | 大唐电信科技股份有限公司 | Wireless intelligent public transportation system |
| CN103986898A (en)* | 2014-06-03 | 2014-08-13 | 四川效率源信息安全技术有限责任公司 | Device and method for extracting remnant videos and deleted videos in DVR hard disk |
| CN104268088A (en)* | 2014-09-15 | 2015-01-07 | 郑州天迈科技股份有限公司 | Vehicle DVR (Digital Video Recorder) hard disk data storage method |
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109819345A (en)* | 2017-11-20 | 2019-05-28 | 网宿科技股份有限公司 | Live video processing, time shifting method, video processing device and cloud storage system |
| CN109819345B (en)* | 2017-11-20 | 2021-08-10 | 网宿科技股份有限公司 | Live video processing method, time shifting method, video processing device and cloud storage system |
| CN108763531A (en)* | 2018-05-31 | 2018-11-06 | 深圳市易甲文技术有限公司 | A kind of MDVR document storage systems and its operation method |
| CN108763531B (en)* | 2018-05-31 | 2021-08-27 | 深圳市易甲文技术有限公司 | MDVR file storage system and operation method thereof |
| CN109634910A (en)* | 2018-11-08 | 2019-04-16 | 珠海全志科技股份有限公司 | A method of promoting DVR file writing speed |
| CN109766325A (en)* | 2019-01-09 | 2019-05-17 | 吴思齐 | A kind of distributed file system and flow data wiring method towards flow data |
| CN109766325B (en)* | 2019-01-09 | 2019-09-17 | 吴思齐 | A kind of distributed file system and flow data wiring method towards flow data |
| CN113703667A (en)* | 2021-07-14 | 2021-11-26 | 深圳市有为信息技术发展有限公司 | File system processing method and device for storing data in real time, vehicle-mounted terminal and commercial vehicle |
| Publication number | Publication date |
|---|---|
| CN105353986B (en) | 2018-04-03 |
| Publication | Publication Date | Title |
|---|---|---|
| CN105353986B (en) | Vehicle-mounted DVR (digital video recorder) bare disk storage file system | |
| KR100288203B1 (en) | Real time data recording method | |
| US11061869B2 (en) | Reduction in time required to write file to tape | |
| US7017078B2 (en) | Power failure recovery mechanism for a recording and reproducing device | |
| US7336579B2 (en) | Information storage apparatus that writes data in unrecorded regions of a recording medium | |
| CN102063348B (en) | Partition table information backup method and device and storage system | |
| CN106600750B (en) | A kind of method of circulation recording, system and automobile data recorder | |
| US20030163449A1 (en) | File managing method | |
| CN104484427B (en) | A kind of video file storage device and method | |
| JPH10125006A (en) | Signal recorder and signal recording method | |
| CN109683825B (en) | Storage system online data compression method, device and equipment | |
| CN107678981A (en) | Data processing method and device | |
| CN107357696B (en) | Nonvolatile memory bad block test method and system | |
| US20060008250A1 (en) | Recovery of real-time video data after power loss | |
| US20080104316A1 (en) | Emulating Volume Having Selected Storage Capacity | |
| CN109976811B (en) | Automatic mounting method of movable storage equipment and locomotive video monitoring system | |
| CN109271100A (en) | A kind of flash storage date storage method and read method | |
| CN101325079B (en) | Method and device for recovering disc management information in recording medium | |
| CN101201778A (en) | Hard Disk Test Method under Extensible Firmware Interface | |
| US8077570B2 (en) | Error recovery method for video recording | |
| US20030142554A1 (en) | Emulating hardware having selected storage characteristics | |
| CN105786643B (en) | Data backup method and system based on heterogeneous hybrid memory | |
| CN107423207A (en) | System compatibility automated testing method and device | |
| JPH03192436A (en) | Information recording and playback method | |
| JP2822869B2 (en) | Library file management device |
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant |