WO2019079944A1 - 一种视频数据的存储方法、装置及终端设备 - Google Patents

一种视频数据的存储方法、装置及终端设备

Info

Publication number
WO2019079944A1
WO2019079944A1 PCT/CN2017/107355 CN2017107355W WO2019079944A1 WO 2019079944 A1 WO2019079944 A1 WO 2019079944A1 CN 2017107355 W CN2017107355 W CN 2017107355W WO 2019079944 A1 WO2019079944 A1 WO 2019079944A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
video data
block
data
inter
Prior art date
Application number
PCT/CN2017/107355
Other languages
English (en)
French (fr)
Inventor
徐记超
王斌
归建章
Original Assignee
深圳市锐明技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市锐明技术股份有限公司 filed Critical 深圳市锐明技术股份有限公司
Priority to CN201780001287.1A priority Critical patent/CN110100243B/zh
Priority to PCT/CN2017/107355 priority patent/WO2019079944A1/zh
Publication of WO2019079944A1 publication Critical patent/WO2019079944A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/71Indexing; Data structures therefor; Storage structures

Definitions

  • the present application relates to the field of storage technologies, and in particular, to a method, an apparatus, and a terminal device for storing video data.
  • the storage of the video data recorded by the external camera is shorter than the storage of the video data recorded by the internal camera, which requires that the video data collected by the two cameras can achieve asynchronous coverage; At the same time, the video data collected by the two cameras is required to accurately synchronize playback.
  • the current storage method cannot achieve synchronous playback if video data of multiple channels can be asynchronously overwritten; if synchronous playback is enabled, asynchronous coverage is often not realized.
  • the embodiments of the present application provide a method, a device, and a terminal device for storing video data, which can enable synchronous playback and asynchronous coverage of video data of multiple channels.
  • the present application provides a method for storing video data, including:
  • the storage structure of the block I block includes an offset direction of the previous block I block, an offset direction of the next index block, and an inter-turn index
  • the storage structure of the data block includes the previous data.
  • the offset of the block points, the offset of the next data block, the start and end of the stored video data, and the key frame index.
  • the present application further provides a storage device for video data, including:
  • a dividing module configured to divide the storage space into a plurality of storage blocks according to a preset condition, and set the plurality of storage blocks as a block or a data block respectively;
  • a storage module configured to store, according to the storage structure of the index block or the data block, video data of the acquired at least two channels according to the storage structure;
  • the storage structure of the index block includes an offset pointing of the previous index block, an offset pointing of the next index block, and an inter-turn index, where the storage structure of the data block includes an offset of the previous data block. Point, offset of the next data block, start and end of the stored video data, and key frame index.
  • the present application also provides a terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, the processor executing the computer program to implement the present application The steps of the method provided by the first aspect of the embodiment.
  • the present application also provides a computer program product, the computer program product comprising a computer program, the computer program being executed by one or more processors, implementing the method provided by the first aspect of the embodiments of the present application step.
  • the present application divides a storage space into a plurality of storage blocks according to a preset condition, and sets a plurality of storage blocks as index blocks or data blocks respectively; based on an index block or a data block storage structure, at least two acquired
  • the video data of the channel is stored according to the storage structure;
  • the storage structure of the index block includes the offset pointing of the previous index block, the offset pointing of the next index block, and the inter-turn index
  • the storage structure of the data block includes the previous one.
  • the offset of the data block points, the offset of the next data block, the start and end of the stored video data, and the key frame index.
  • the video data of the multiple channels By storing the video data of multiple channels in the storage structure, and creating an index in the index block according to the time, the starting and ending time of the video data and the key frame index are stored in the data block, so that the video data of the multiple channels is Synchronous playback and asynchronous coverage in limited storage space.
  • FIG. 1 is a schematic flowchart of an implementation of a method for storing video data according to an embodiment of the present disclosure
  • FIG. 2 is a storage structure of an index block and a data block according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart of an implementation process of a synchronous playback method of video data according to an embodiment of the present application.
  • FIG. 4 is a schematic flow chart of an implementation method of asynchronous coverage of video data according to another embodiment of the present application.
  • FIG. 5 is a schematic block diagram of a video data storage apparatus according to an embodiment of the present application.
  • FIG. 6 is a schematic block diagram of a terminal device according to an embodiment of the present application.
  • the term “if” can be used depending on the context. It is interpreted as “when" or “once” or “in response to determination” or “in response to detection.” Similarly, the phrase “if determined” or “if detected [condition or event described]” may be interpreted in context to mean “once determined” or “in response to determining” or “once detected [condition or event described] ] “OR” in response to detecting [described condition or event].
  • FIG. 1 is a schematic flowchart of an implementation of a method for storing video data according to an embodiment of the present application. As shown in the figure, the method may include the following steps:
  • Step S101 The storage space is divided into a plurality of storage blocks according to a preset condition, and the plurality of storage blocks are respectively set as index blocks or data blocks.
  • each storage block is set to a size of 8 M.
  • it can also be set to a different size, and no limitation is imposed here.
  • the storage blocks may be separately set as index blocks or data blocks according to actual needs. For example, according to actual needs, video data of each channel may need one index block. 3 data blocks, if there are currently two channels of video data, then you need to set 2 memory blocks as index blocks and 6 memory blocks as data blocks. Moreover, the data of each channel is stored, that is, the index of the video data of only one channel can be stored in each index block, and only one channel of video data can be stored in each data block. In a specific application, in order to effectively utilize the storage space, it can also be set as follows: While collecting video data and storing video data, the video data of each channel is stored separately, and for each channel of video data, each index block is used.
  • one storage block is set as the next index block of the channel, and after each storage space of one data block of the channel is used, one storage block is set as the next data of the channel. Piece. In this way, it is equivalent to the setting of the use, and it is not necessary to set all the storage blocks in advance as index blocks or data blocks, so as to prevent too many index block settings, and after the data blocks are used, there are still many index blocks remaining, resulting in storage space. Waste.
  • Step S102 The captured video data of the at least two channels are stored according to the storage structure according to the storage structure of the index block or the data block.
  • FIG. 2 shows a storage structure of an index block and a storage structure of a data block.
  • the storage structure of the index block includes an offset pointing of the previous index block, an offset pointing of the next index block, and an inter-turn index
  • the storage structure of the data block includes an offset of the previous data block.
  • the key frame index includes: an absolute time of the key frame and an offset direction of the key frame in the stored data block.
  • the data block further includes video data.
  • the inter-index in the index block is an inter-time index that is accurate to a small size, and the inter-index refers to the data stored in a small video data.
  • the starting address of the block, the data block contains the beginning and the end of the video data stored in the data block, specifically accurate to the second, and also stores the key frame index (11, 12, 13... In)
  • the storage of the video data in the data block is stored in the form of I frame data, P frame data, and the like.
  • the video data of each channel is stored separately in different data blocks, and the corresponding index data is also stored in different index blocks. That is, each channel will have a corresponding index block and data block.
  • the process of storing the video data may first create the index information, and then store the video data according to the created index information; or store the video data first, and then create the index information according to the stored video data. That is, the storing, according to the storage structure of the index block or the data block, storing the acquired video data of at least two channels according to the storage structure includes:
  • the embodiment of the present application divides a storage space into a plurality of storage blocks according to a preset condition, and sets a plurality of storage blocks as index blocks or data blocks respectively; based on an index block or a data block storage structure, The video data of at least two channels is stored according to the storage structure; the storage structure of the index block includes an offset pointing of the previous index block, an offset pointing of the next index block, and a diurnal index, and the storage structure of the data block includes Offset of the previous data block, offset of the next data block, stored video The start and end of the data and the key frame index.
  • the video data of the multiple channels By storing the video data of multiple channels in the storage structure, and creating an index in the index block according to the time, the starting and ending time of the video data and the key frame index are stored in the data block, so that the video data of the multiple channels is Synchronous playback and asynchronous coverage in limited storage space.
  • FIG. 3 is a schematic flow diagram of a method for synchronous playback of video data implemented on the basis of the embodiment shown in FIG. 1, which may include the following steps:
  • Step S301 Obtain the time information in the data playback request, and locate the data block where the video data corresponding to the time information is located by using the inter-turn index in the index block of each channel according to the information.
  • the data playback request information includes time information, and the time information may be some information that the user inputs through the visual interface.
  • the inter-day information in the data playback request is obtained, for example, the diurnal information is 14:30:56 on June 6, 2017, there are currently two channels of video data, the first channel and the second channel.
  • the starting position of the data block corresponding to the video data corresponding to the small ⁇ ⁇ may be firstly located according to the ⁇ ⁇ , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Positioning the starting position of the data block actually finds a specific data block, and according to the time information, the starting position of the data block of the first channel and the second channel is located, and the data block of one channel can be located first.
  • the starting position, and then the starting position of the data block of another channel can also be positioned in parallel with the data blocks of the two channels, that is, the positioning of the data block accurate to the point of 14 o'clock on June 6, 2017. position
  • Step S302 In the located data block, locate the key frame pointed by the inter-turn information according to the inter-frame information and the absolute time of the key frame.
  • the absolute time of the key frame is the time of collecting the key frame, and after the data block is located, the information may be accurate according to the second time and the absolute value of each key frame.
  • the key frames corresponding to the inter-turn information accurate to the second are located. Since there is also a key frame index in the data block, the storage location of the key frame can be located according to the offset of the key frame in the stored data block.
  • Step S303 After the key frame pointed to by the video information in each channel is located, the video data of each channel is played according to the key frame that is located.
  • the video data of each channel can be played in the same manner according to the located key frame. Due to video data for each channel The stored time may be different. Therefore, the video data of each channel in the storage space is not located after the key frame corresponding to the daytime information in the playback request, and then can be played synchronously. Rather, the video data corresponding to the video data corresponding to the inter-turn information in the playback request needs to complete the positioning operation in the channel in the storage space, if the video data corresponding to the inter-frame information in the playback request of a certain channel has been deleted or If you are covered, you don't need to complete the positioning operation.
  • the video data stored by the external camera in the vehicle monitoring is 7 days
  • the video data stored in the internal camera is 2 days
  • the video data of the two channels is played back 4 days before the video data
  • only The video data of the channel corresponding to the external camera needs to be located, and the video data of the channel corresponding to the internal camera has been overwritten or deleted, and cannot be located.
  • there is still a camera (third camera) and the video data stored by the third camera is 5 days. Before the video data is played back 4 days ago, only the video data of the channel corresponding to the external camera needs to be located and the third The video data of the channel corresponding to the camera can be synchronized. Because the video data of the channel corresponding to the internal camera has been overwritten or deleted.
  • the embodiment of the present application specifically describes how to implement synchronous playback on the basis of the embodiment of the method for storing video data shown in FIG. 1.
  • FIG. 4 is a schematic flow diagram of a method for asynchronous coverage of video data implemented on the basis of the embodiment shown in FIG. 1. The method may include the following steps as shown:
  • Step S401 Obtain an earliest inter-day index in each channel index block, and determine whether the current inter-day distance represented by the earliest inter-day index is greater than a preset time.
  • the earliest ⁇ of each channel index block may be obtained first.
  • Inter-index according to the earliest inter-day index of the index block in each channel, determine whether the earliest video data needs to be deleted, and the earliest inter-day index in the index block of each channel can be compared with the current inter-day index. Pre-set comparisons to confirm whether deletion is required, and the preset time of each channel can be set differently.
  • the preset time of the first channel is set to 7 days
  • the preset time of the second channel is set to 2 days
  • the earliest inter-day index in the first channel index block is obtained, and the earliest one in the first channel is determined.
  • the current index is greater than 7 days from the current index
  • obtains the earliest inter-day index in the second channel index block and determines whether the earliest inter-day index in the second channel is greater than 2 days from the current day.
  • Step S402 deleting the video data stored in the data block pointed by the earliest inter-day index, if the current inter-day distance represented by the earliest inter-day index is greater than the preset time interval. And delete the index information corresponding to the video data.
  • the preset time of the first channel is 7 days
  • the preset time of the second channel is 2 days.
  • the earliest daytime index of the first channel is the current distance
  • the time is greater than 7 days
  • the video data stored in the data block pointed to by the earliest day index needs to be deleted, and the index information corresponding to the video data is also deleted.
  • whether the earliest video data stored in the second channel and the corresponding index information need to be deleted are determined in the same manner as the first channel.
  • Step S403 If the current inter-turn distance represented by the earliest inter-day index is less than or equal to the preset time, obtain the remaining space of the storage space.
  • the remaining space of the storage space needs to be acquired, so as to facilitate Even if the stored video data does not exceed the preset time, but the storage space is not enough, the video data corresponding to the earliest daytime index is deleted.
  • Step S404 if the remaining space is less than the space threshold, deleting the video data stored in the data block pointed to by the earliest inter-day index in each channel index block, and deleting the index information corresponding to the video data.
  • the deletion does not need to be deleted. If the remaining space is less than the space threshold, the storage space cannot continue to store the video. For the data, it is necessary to delete the video data stored in the data pointed to by the earliest inter-turn cable I in each channel, and also delete the index information corresponding to the video data.
  • FIG. 5 is a schematic block diagram of a video data storage apparatus according to an embodiment of the present application, for convenience of description.
  • the storage device 5 of the video data may be built in a terminal device (for example, a mobile phone, a computer, a notebook)
  • a terminal device for example, a mobile phone, a computer, a notebook
  • the pendant is integrated into the terminal device.
  • the storage device 5 of the video data includes:
  • the dividing module 51 is configured to divide the storage space into a plurality of storage blocks according to a preset condition, and set the plurality of storage blocks as a block or a data block respectively;
  • the storage module 52 is configured to store, according to the storage structure of the index block or the data block, video data of the acquired at least two channels according to the storage structure;
  • the storage structure of the block I block includes an offset direction of the previous block I block, an offset direction of the next index block, and an inter-turn index, and the storage structure of the data block includes the previous data.
  • the offset of the block points, the offset of the next data block, the start and end of the stored video data, and the key frame index.
  • the storage module 52 includes:
  • the first data storage unit 521 is configured to acquire video data of at least two channels, and store the video data of the at least two channels in different data blocks according to a storage structure of the data block;
  • the first index creating unit 522 is configured to create a dice index based on the storage structure of the index block in the index block of the channel in which the video data is located according to the video data stored in the data block.
  • the storage module 52 further includes:
  • the second index creating unit 523 is configured to acquire video data of at least two channels, and create video data of the at least two channels based on a storage structure of the index block in different index blocks.
  • the second data storage unit 524 is configured to separately store video data of each channel based on the storage structure of the data block in the data block of the channel where the video data pointed by the inter-direct index is located according to the created inter-turn index .
  • the key frame index includes: an absolute interval of the key frame and an offset direction of the key frame in the stored data block.
  • the storage device 5 further includes:
  • the playback data block positioning module 53 is configured to acquire the time information in the data playback request, and locate the video corresponding to the time information by using the time index in the index block of each channel according to the time information.
  • a playback key frame positioning module 54 is configured to: in the located data block, according to the information and the The absolute time of the key frame is located to the key frame pointed by the daytime information;
  • the playback module 55 is configured to play the video data of each channel according to the located key frame after the key frame pointed in the video data of each channel is located.
  • the storage device 5 further includes:
  • the coverage interval determining module 56 is configured to obtain an earliest inter-day index in each channel index block, and determine whether the current inter-day distance represented by the earliest inter-day index is greater than a preset time interval;
  • the first coverage processing module 57 is configured to: if the current inter-time distance represented by the earliest inter-day index is greater than the preset time, the data block pointed by the earliest inter-day index The video data stored in the video is deleted, and the index information corresponding to the video data is deleted.
  • the storage device 5 further includes:
  • the coverage space judging module 58 is configured to acquire the remaining space of the storage space if the current inter-day distance represented by the earliest inter-head index is less than or equal to the preset time interval;
  • the second coverage processing module 59 is configured to: if the remaining space is smaller than the space threshold, delete the video data stored in the data block pointed to by the earliest inter-day index in each channel index block, and delete the video data. Corresponding index information.
  • each functional unit and module are completed, that is, the internal structure of the storage device of the video data is divided into different functional units or modules to complete all or part of the functions described above.
  • Each functional unit and module in the embodiment may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit, and the integrated unit may be implemented by hardware.
  • Formal implementation can also be implemented in the form of software functional units.
  • FIG. 6 is a schematic block diagram of a terminal device according to an embodiment of the present application.
  • the terminal device 6 of this embodiment includes: one or more processors 60, a memory 61, and a computer program 62 stored in the memory 61 and operable on the processor 60.
  • the processor 60 executes the computer program 62
  • the steps in the embodiment of the storage method of the above respective video data are implemented, for example, steps S101 to S102 shown in FIG.
  • the processor 60 executes the computer program 62 to implement the functions of the modules/units in the above-described terminal device embodiment, such as the functions of the modules 51 to 52 shown in FIG.
  • the computer program 62 can be divided into one or more modules/units, which are stored in the memory 61 and executed by the processor 60.
  • the one or more modules/units may be a series of computer program instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer program 62 in the terminal device 6.
  • the computer program 62 can be partitioned into partitioning modules, storage modules.
  • the dividing module is configured to divide the storage space into a plurality of storage blocks according to a preset condition, and set the plurality of storage blocks as a block or a data block respectively;
  • the storage module is configured to store, according to the storage structure of the index block or the data block, video data of the acquired at least two channels according to the storage structure;
  • the storage structure of the block I block includes an offset direction of the previous block I block, an offset direction of the next index block, and an inter-turn index
  • the storage structure of the data block includes the previous data.
  • the offset of the block points, the offset of the next data block, the start and end of the stored video data, and the key frame index.
  • the terminal device includes but is not limited to the processor 60 and the memory 61. It will be understood by those skilled in the art that FIG. 6 is only one example of the terminal device 6, and does not constitute a limitation on the terminal device 6, and may include more or less components than those illustrated, or combine some components, or different. Components, such as the terminal device, may also include input devices, output devices, network access devices, buses, and the like.
  • the processor 60 may be a central processing unit (CPU), or may be another general-purpose processor, a digital signal processor (DSP), or an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), ready-to-use programmable gate array
  • CPU central processing unit
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 61 may be an internal storage unit of the terminal device 6, such as a hard disk or a memory of the terminal device 6.
  • the memory 61 may also be an external storage device of the terminal device 6, for example, the terminal device Plug-in hard disk equipped with 6 and smart memory card (Smart Media Card,
  • the memory 61 may also include both an internal storage unit of the terminal device 6 and an external storage device.
  • the memory 61 is used to store the computer program and other programs and data required by the terminal device.
  • the memory 61 can also be used to temporarily store data that has been output or is about to be output.
  • the disclosed terminal device, storage device, and storage method may be implemented in other manners.
  • the storage device/terminal device embodiment described above is merely illustrative.
  • the division of the module or unit is only a logical function division, and the actual implementation may have another division manner, for example, multiple Units or components may be combined or integrated into another system, or some features may be omitted or not implemented.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be electrical, mechanical or otherwise.
  • the unit described as a separate component may or may not be physically distributed, and the component displayed as a unit may or may not be a physical unit, that is, may be located in one place, or may be distributed to multiple On the network unit. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated modules/units, if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be completed by a computer program to instruct related hardware.
  • the computer program may be stored in a computer readable storage medium. After the program is executed by the processor, the steps of the various method embodiments described above can be implemented.
  • the computer program includes computer program code, and the computer program code may be in a source code form, an object code form, an executable file, or some intermediate form.
  • the computer readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a removable hard disk, a magnetic disk, an optical disk, a computer memory, a Read-Only Memory (ROM). , Random Access Memory (RAM), electrical carrier signals, telecommunications signals, and software distribution media. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in a jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, computer readable media It does not include electrical carrier signals and telecommunication signals.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Multimedia (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

一种视频数据的存储方法,包括:将存储空间按照预设条件划分成多个存储块,并将多个存储块分别设置为索引块或数据块;基于索引块或数据块的存储结构,将获取的至少两个通道的视频数据按照存储结构分开存储;索引块的存储结构中包括上一个索引块的偏移指向、下一个索引块的偏移指向以及时间索引,数据块的存储结构中包括上一个数据块的偏移指向、下一个数据块的偏移指向、存储的视频数据的起止时间以及关键帧索引。通过将多个通道的视频数据在存储结构中分开存储,并且根据时间在索引块创建索引,在数据块中存储视频数据的起止时间以及关键帧索引,使得多个通道的视频数据在有限的存储空间中实现同步回放以及异步覆盖。

Description

一种视频数据的存储方法、 装置及终端设备 技术领域
[0001] 本申请属于存储技术领域, 尤其涉及一种视频数据的存储方法、 装置及终端设 备。
背景技术
[0002] 目前的车载视频监控, 包括至少两个摄像头, 一个对外摄像头, 用于车辆事故 吋对车辆前方的监控; 一个对内摄像头, 用于对车辆内部的司机和乘客的监控
[0003] 由于车载视频监控的特殊性, 对外摄像头录制的视频数据的存储吋间比对内摄 像头录制的视频数据的存储吋间短, 这就要求两个摄像头采集的视频数据能够 实现异步覆盖; 同吋, 还需要两个摄像头采集的视频数据能够精准的实现同步 回放。 然而, 目前的存储方法如果多个通道的视频数据能够实现异步覆盖, 往 往不能实现同步回放; 如果能够实现同步回放, 往往不能实现异步覆盖。
技术问题
[0004] 鉴于此, 本申请实施例提供一种视频数据的存储方法、 装置及终端设备, 可以 使得多个通道的视频数据实现同步回放以及异步覆盖。
问题的解决方案
技术解决方案
[0005] 本申请提供一种视频数据的存储方法, 包括:
[0006] 将存储空间按照预设条件划分成多个存储块, 并将所述多个存储块分别设置为 索引块或数据块;
[0007] 基于所述索引块或所述数据块的存储结构, 将获取的至少两个通道的视频数据 按照所述存储结构分幵存储;
[0008] 所述索弓 I块的存储结构中包括上一个索弓 I块的偏移指向、 下一个索引块的偏移 指向以及吋间索引, 所述数据块的存储结构中包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止吋间以及关键帧索引。 [0009] 本申请还提供一种视频数据的存储装置, 包括:
[0010] 划分模块, 用于将存储空间按照预设条件划分成多个存储块, 并将所述多个存 储块分别设置为索弓 I块或数据块;
[0011] 存储模块, 用于基于所述索引块或所述数据块的存储结构, 将获取的至少两个 通道的视频数据按照所述存储结构分幵存储;
[0012] 所述索引块的存储结构中包括上一个索引块的偏移指向、 下一个索引块的偏移 指向以及吋间索引, 所述数据块的存储结构中包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止吋间以及关键帧索引。
[0013] 本申请还提供一种终端设备, 包括存储器、 处理器以及存储在所述存储器中并 可在所述处理器上运行的计算机程序, 所述处理器执行所述计算机程序吋实现 本申请实施例第一方面提供的所述方法的步骤。
[0014] 本申请还提供了一种计算机程序产品, 所述计算机程序产品包括计算机程序, 所述计算机程序被一个或多个处理器执行吋实现本申请实施例第一方面提供的 所述方法的步骤。
发明的有益效果
有益效果
[0015] 本申请通过将存储空间按照预设条件划分成多个存储块, 并将多个存储块分别 设置为索引块或数据块; 基于索引块或数据块的存储结构, 将获取的至少两个 通道的视频数据按照存储结构分幵存储; 索引块的存储结构中包括上一个索引 块的偏移指向、 下一个索引块的偏移指向以及吋间索引, 数据块的存储结构中 包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的 起止吋间以及关键帧索引。 通过将多个通道的视频数据在存储结构中分幵存储 , 并且根据吋间在索引块创建索引, 在数据块中存储视频数据的起止吋间以及 关键帧索引, 使得多个通道的视频数据在有限的存储空间中实现同步回放以及 异步覆盖。
对附图的简要说明
附图说明
[0016] 为了更清楚地说明本申请实施例中的技术方案, 下面将对实施例或现有技术描 述中所需要使用的附图作简单地介绍, 显而易见地, 下面描述中的附图仅仅是 本申请的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动性 的前提下, 还可以根据这些附图获得其他的附图。
[0017] 图 1是本申请一实施例提供的一种视频数据的存储方法的实现流程示意图; [0018] 图 2是本申请一实施例提供的索引块和数据块的存储结构;
[0019] 图 3是本申请一实施例提供的一种视频数据的同步回放方法的实现流程示意图
[0020] 图 4是本申请另一实施例提供的一种视频数据的异步覆盖方法的实现流程示意 图;
[0021] 图 5是本申请一实施例提供的视频数据的存储装置的示意框图;
[0022] 图 6是本申请一实施例提供的终端设备的示意框图。
本发明的实施方式
[0023] 下面将结合本申请实施例中的附图, 对本申请实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本申请一部分实施例, 而不是全部的实 施例。 基于本申请中的实施例, 本领域普通技术人员在没有做出创造性劳动前 提下所获得的所有其他实施例, 都属于本申请保护的范围。
[0024] 应当理解, 当在本说明书和所附权利要求书中使用吋, 术语"包括"指示所描述 特征、 整体、 步骤、 操作、 元素和 /或组件的存在, 但并不排除一个或多个其它 特征、 整体、 步骤、 操作、 元素、 组件和 /或其集合的存在或添加。
[0025] 还应当理解, 在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的 目的而并不意在限制本申请。 如在本申请说明书和所附权利要求书中所使用的 那样, 除非上下文清楚地指明其它情况, 否则单数形式的"一"、 "一个 "及"该"意 在包括复数形式。
[0026] 还应当进一步理解, 在本申请说明书和所附权利要求书中使用的术语 "和 /或"是 指相关联列出的项中的一个或多个的任何组合以及所有可能组合, 并且包括这 些组合。
[0027] 如在本说明书和所附权利要求书中所使用的那样, 术语"如果"可以依据上下文 被解释为 "当…吋 "或"一旦"或"响应于确定"或"响应于检测到"。 类似地, 短语"如 果确定 "或"如果检测到 [所描述条件或事件]"可以依据上下文被解释为意指"一旦 确定"或"响应于确定"或"一旦检测到 [所描述条件或事件]"或"响应于检测到 [所描 述条件或事件]"。
[0028] 为了说明本申请所述的技术方案, 下面通过具体实施例来进行说明。
[0029] 图 1是本申请一实施例提供的视频数据的存储方法的实现流程示意图, 如图所 示该方法可以包括以下步骤:
[0030] 步骤 S101, 将存储空间按照预设条件划分成多个存储块, 并将所述多个存储块 分别设置为索引块或数据块。
[0031] 在本申请实施例中, 我们以车载监控为例, 车载监控中为了存储对内和对外摄 像头采集的视频数据, 会设置存储卡, 我们将存储卡中的存储空间分成多个存 储块, 具体划分的方式可以根据大小进行划分, 例如, 将每个存储块都设置为 8 M大小, 当然, 也可以设置为不同的大小, 在此不做限制。
[0032] 在划分成多个存储块后, 我们可以根据实际需要将存储块再分别设置为索引块 或数据块, 例如, 根据实际需要, 目前每个通道的视频数据可能需要 1个索引块 , 3个数据块, 如果当前存在两个通道的视频数据, 那么就需要将 2个存储块设 置为索引块, 将 6个存储块设置为数据块。 并且, 每个通道的数据分幵存储, 即 每个索引块中只能存放一个通道的视频数据的索引, 每个数据块中只能存放一 个通道的视频数据。 在具体应用中, 为了有效利用存储空间, 还可以这样设置 : 一边采集视频数据, 一边存储视频数据, 每个通道的视频数据分幵存储, 针 对一个通道的视频数据来说, 每将一个索引块的存储空间使用完后, 再将一个 存储块设置为该通道的下一个索引块, 每将该通道的一个数据块的存储空间使 用完后, 再将一个存储块设置为该通道的下一个数据块。 这样, 相当于随用随 设置, 无需将所有的存储块提前设置为索引块或数据块, 防止出现索引块设置 的过多, 导致数据块使用完后, 还剩余多个索引块, 造成存储空间的浪费。
[0033] 步骤 S102, 基于所述索引块或所述数据块的存储结构, 将获取的至少两个通道 的视频数据按照所述存储结构分幵存储。
[0034] 在本申请实施例中, 图 2示出了索引块的存储结构和数据块的存储结构。 如图 所示, 所述索引块的存储结构中包括上一个索引块的偏移指向、 下一个索引块 的偏移指向以及吋间索引, 所述数据块的存储结构中包括上一个数据块的偏移 指向、 下一个数据块的偏移指向、 存储的视频数据的起止吋间以及关键帧索引 。 所述关键帧索引包括: 所述关键帧的绝对吋间和所述关键帧在所存储的数据 块中的偏移指向。 当然, 所述数据块还包括视频数据, 通过图中可以看出索引 块中的吋间索引是精确到小吋的吋间索引, 该吋间索引指向某一个小吋的视频 数据具体存放的数据块的起始地址, 数据块中有该数据块存放的视频数据的幵 始吋间和结束吋间, 具体精确到秒, 还存放了关键帧索引 (11、 12、 13...... In)
, 视频数据在数据块中的存放是以 I帧数据、 P帧数据等形式存储。 每个通道的视 频数据是在不同的数据块中分幵存储的, 相应的索引数据也是在不同的索引块 中存储的。 即每个通道都会有对应的索引块和数据块。
[0035] 具体的, 视频数据存储的过程可以先创建索引信息, 再根据创建的索引信息存 储视频数据; 也可以先存储视频数据, 再根据存储的视频数据创建索引信息。 即所述基于所述索引块或所述数据块的存储结构, 将获取的至少两个通道的视 频数据按照所述存储结构分幵存储包括:
[0036] 获取至少两个通道的视频数据, 并将所述至少两个通道的视频数据基于所述数 据块的存储结构分别存储在不同的数据块中;
[0037] 根据所述数据块中存储的视频数据, 在所述视频数据所在通道的索引块中基于 所述索引块的存储结构创建吋间索引;
[0038] 或者, 获取至少两个通道的视频数据, 并将所述至少两个通道的视频数据基于 所述索引块的存储结构分别在不同的索引块中创建吋间索引;
[0039] 根据创建的吋间索引在所述吋间索引指向的视频数据所在通道的数据块中基于 所述数据块的存储结构分别存储每个通道的视频数据。
[0040] 本申请实施例通过将存储空间按照预设条件划分成多个存储块, 并将多个存储 块分别设置为索引块或数据块; 基于索引块或数据块的存储结构, 将获取的至 少两个通道的视频数据按照存储结构分幵存储; 索引块的存储结构中包括上一 个索引块的偏移指向、 下一个索引块的偏移指向以及吋间索引, 数据块的存储 结构中包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频 数据的起止吋间以及关键帧索引。 通过将多个通道的视频数据在存储结构中分 幵存储, 并且根据吋间在索引块创建索引, 在数据块中存储视频数据的起止吋 间以及关键帧索引, 使得多个通道的视频数据在有限的存储空间中实现同步回 放以及异步覆盖。
[0041] 图 3是在图 1所示的实施例的基础上实现的视频数据的同步回放的方法的流程示 意图, 如图所示该方法可以包括以下步骤:
[0042] 步骤 S301, 获取数据回放请求中的吋间信息, 并根据所述吋间信息通过每个通 道的索引块中的吋间索引定位所述吋间信息对应的视频数据所在的数据块。
[0043] 在本申请实施例中, 所述数据回放请求信息中包含吋间信息, 吋间信息可以是 用户通过可视化界面输入的某个吋间信息。 当获取到数据回放请求中的吋间信 息之后, 例如, 所述吋间信息是 2017年 6月 6日 14点 30分 56秒, 当前存在两个通 道的视频数据, 第一通道和第二通道, 可以先根据吋间信息中精细到小吋的吋 间通过每个通道的索引块中的吋间索引定位到该精确到小吋的吋间对应的视频 数据所在的数据块的起始位置, 定位到该数据块的起始位置实际上就已经找到 了具体的数据块, 根据吋间信息定位第一通道和第二通道的数据块的起始位置 吋, 可以先定位一个通道的数据块的起始位置, 再定位另一个通道的数据块的 起始位置, 也可以两个通道的数据块并行的方式定位, 即同吋定位精确到 2017 年 6月 6日 14点的数据块的起始位置。
[0044] 步骤 S302, 在定位的数据块中, 根据所述吋间信息以及所述关键帧的绝对吋间 定位到所述吋间信息指向的关键帧。
[0045] 在本申请实施例中, 关键帧的绝对吋间就是采集到该关键帧的吋间, 在定位到 数据块后, 可以根据精确到秒的吋间信息以及每个关键帧的绝对吋间定位到精 确到秒的吋间信息对应的关键帧。 由于数据块中还存在关键帧索引, 所以可以 根据关键帧在所存储的数据块中的偏移指向定位到关键帧的存储位置。
[0046] 步骤 S303, 在定位到所述吋间信息在每个通道的视频数据中指向的关键帧后, 根据定位到的关键帧同吋播放每个通道的视频数据。
[0047] 在本申请实施例中, 只有在每个通道的视频数据中都定位到关键帧后, 才能够 根据定位到的关键帧同吋播放每个通道的视频数据。 由于每个通道的视频数据 存储的吋间可能会有差异, 所以, 并非将存储空间中的每个通道的视频数据都 定位到回放请求中的吋间信息对应的关键帧后, 才能同步播放。 而是, 所述回 放请求中的吋间信息对应的视频数据在存储空间中存在的通道需要完成定位操 作, 如果某个通道在所述回放请求中的吋间信息对应的视频数据已经被刪除或 者覆盖了则无需完成定位操作。
[0048] 作为举例, 假设, 车辆监控中的对外摄像头存储的视频数据为 7天, 对内摄像 头存储的视频数据为 2天, 两个通道的视频数据在回放 4天前的视频数据吋, 只 需要定位到对外摄像头对应的通道的视频数据即可, 对内摄像头对应的通道的 视频数据已经被覆盖或者刪除了, 是无法定位到的。 进一步举例, 假设还存在 一个摄像头 (第三摄像头) , 第三摄像头存储的视频数据为 5天, 在回放 4天前 的视频数据吋, 只需要定位到对外摄像头对应的通道的视频数据以及第三摄像 头对应的通道的视频数据就可以实现同步回放。 因为对内摄像头对应的通道的 视频数据已经被覆盖或者刪除了。
[0049] 本申请实施例具体描述了在图 1所示的视频数据的存储方法的实施例的基础上 如何实现同步回放。
[0050] 图 4是在图 1所示的实施例的基础上实现的视频数据的异步覆盖的方法的流程示 意图, 如图所示该方法可以包括以下步骤:
[0051] 步骤 S401 , 获取每个通道索引块中最早的吋间索引, 并判断所述最早的吋间索 引表示的吋间距离当前的吋间是否大于预设吋间。
[0052] 在本申请实施例中, 由于各个通道的视频数据对保存吋间的要求不同, 所以需 要针对不同通道的视频数据实现异步覆盖, 具体可以先获取每个通道索引块中 的最早的吋间索引, 根据每个通道的索引块中最早的吋间索引距离当前的吋间 判断最早的视频数据是否需要刪除, 可以将每个通道的索引块中最早的吋间索 引距离当前的吋间与预设吋间进行比较确认是否需要刪除, 每个通道的预设吋 间可以设置不同。 例如, 将第一通道的预设吋间设置为 7天, 将第二通道的预设 吋间设置为 2天, 获取第一通道索引块中最早的吋间索引, 判断第一通道中最早 的吋间索引距离当前的吋间是否大于 7天, 获取第二通道索引块中最早的吋间索 引, 判断第二通道中最早的吋间索引距离当前的吋间是否大于 2天。 [0053] 步骤 S402, 若所述最早的吋间索引表示的吋间距离当前的吋间大于所述预设吋 间, 则将所述最早的吋间索引指向的数据块中存储的视频数据刪除, 并刪除该 视频数据对应的索引信息。
[0054] 在本申请实施例中, 具体以第一通道的预设吋间为 7天, 第二通道的预设吋间 为 2天为例, 若第一通道中最早的吋间索引距离当前的吋间大于 7天, 则需要将 最早的吋间索引指向的数据块中存储的视频数据刪除, 同吋还要刪除该视频数 据对应的索引信息。 同理, 第二通道存储的最早的视频数据以及对应的索引信 息是否需要刪除同第一通道的判断方式。
[0055] 步骤 S403 , 若所述最早的吋间索引表示的吋间距离当前的吋间小于或者等于所 述预设吋间, 则获取所述存储空间的剩余空间。
[0056] 在本申请实施例中, 若所述最早的吋间索引表示的吋间距离当前的吋间小于或 者等于所述预设吋间, 还需要获取所述存储空间的剩余空间, 以便于即使存储 的视频数据没有超过预设吋间, 但是存储空间不够, 还是要将最早的吋间索引 对应的视频数据刪除。
[0057] 步骤 S404, 若所述剩余空间小于空间阈值, 则将每个通道索引块中最早的吋间 索引指向的数据块中存储的视频数据刪除, 并刪除该视频数据对应的索引信息
[0058] 在本申请实施例中, 若所述剩余空间大于或者等于空间阈值, 表示存储空间还 能够继续存储视频数据, 则无需刪除, 若剩余空间小于空间阈值, 表示存储空 间已经无法继续存储视频数据, 就需要将每个通道索弓 I块中最早的吋间索弓 I指 向的数据中存储的视频数据刪除, 同吋还要刪除该视频数据对应的索引信息。
[0059] 应理解, 上述实施例中各步骤的序号的大小并不意味着执行顺序的先后, 各过 程的执行顺序应以其功能和内在逻辑确定, 而不应对本申请实施例的实施过程 构成任何限定。
[0060] 图 5是本申请一实施例提供的视频数据的存储装置的示意框图, 为了便于说明
, 仅示出与本申请实施例相关的部分。
[0061] 该视频数据的存储装置 5可以是内置于终端设备 (例如手机、 计算机、 笔记本
、 车载终端) 内的软件单元、 硬件单元或者软硬结合的单元, 也可以作为独立 的挂件集成到所述终端设备中。
[0062] 所述视频数据的存储装置 5包括:
[0063] 划分模块 51, 用于将存储空间按照预设条件划分成多个存储块, 并将所述多个 存储块分别设置为索弓 I块或数据块;
[0064] 存储模块 52, 用于基于所述索引块或所述数据块的存储结构, 将获取的至少两 个通道的视频数据按照所述存储结构分幵存储;
[0065] 所述索弓 I块的存储结构中包括上一个索弓 I块的偏移指向、 下一个索引块的偏移 指向以及吋间索引, 所述数据块的存储结构中包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止吋间以及关键帧索引。
[0066] 可选的, 所述存储模块 52包括:
[0067] 第一数据存储单元 521, 用于获取至少两个通道的视频数据, 并将所述至少两 个通道的视频数据基于所述数据块的存储结构分别存储在不同的数据块中;
[0068] 第一索引创建单元 522, 用于根据所述数据块中存储的视频数据在所述视频数 据所在通道的索引块中基于所述索引块的存储结构创建吋间索引。
[0069] 可选的, 所述存储模块 52还包括:
[0070] 第二索引创建单元 523, 用于获取至少两个通道的视频数据, 并将所述至少两 个通道的视频数据基于所述索引块的存储结构分别在不同的索引块中创建吋间 索引;
[0071] 第二数据存储单元 524, 用于根据创建的吋间索引在所述吋间索引指向的视频 数据所在通道的数据块中基于所述数据块的存储结构分别存储每个通道的视频 数据。
[0072] 可选的, 所述关键帧索引包括: 所述关键帧的绝对吋间和所述关键帧在所存储 的数据块中的偏移指向。
[0073] 可选的, 所述存储装置 5还包括:
[0074] 回放数据块定位模块 53, 用于获取数据回放请求中的吋间信息, 并根据所述吋 间信息通过每个通道的索引块中的吋间索引定位所述吋间信息对应的视频数据 所在的数据块;
[0075] 回放关键帧定位模块 54, 用于在定位的数据块中, 根据所述吋间信息以及所述 关键帧的绝对吋间定位到所述吋间信息指向的关键帧;
[0076] 回放模块 55, 用于在定位到所述吋间信息在每个通道的视频数据中指向的关键 帧后, 根据定位到的关键帧同吋播放每个通道的视频数据。
[0077] 可选的是, 所述存储装置 5还包括:
[0078] 覆盖吋间判断模块 56, 用于获取每个通道索引块中最早的吋间索引, 并判断所 述最早的吋间索引表示的吋间距离当前的吋间是否大于预设吋间;
[0079] 第一覆盖处理模块 57, 用于若所述最早的吋间索引表示的吋间距离当前的吋间 大于所述预设吋间, 则将所述最早的吋间索引指向的数据块中存储的视频数据 刪除, 并刪除该视频数据对应的索引信息。
[0080] 可选的, 所述存储装置 5还包括:
[0081] 覆盖空间判断模块 58, 用于若所述最早的吋间索引表示的吋间距离当前的吋间 小于或者等于所述预设吋间, 则获取所述存储空间的剩余空间;
[0082] 第二覆盖处理模块 59, 用于若所述剩余空间小于空间阈值, 则将每个通道索引 块中最早的吋间索引指向的数据块中存储的视频数据刪除, 并刪除该视频数据 对应的索引信息。
[0083] 所属领域的技术人员可以清楚地了解到, 为了描述的方便和简洁, 仅以上述各 功能单元、 模块的划分进行举例说明, 实际应用中, 可以根据需要而将上述功 能分配由不同的功能单元、 模块完成, 即将所述视频数据的存储装置的内部结 构划分成不同的功能单元或模块, 以完成以上描述的全部或者部分功能。 实施 例中的各功能单元、 模块可以集成在一个处理单元中, 也可以是各个单元单独 物理存在, 也可以两个或两个以上单元集成在一个单元中, 上述集成的单元既 可以采用硬件的形式实现, 也可以采用软件功能单元的形式实现。 另外, 各功 能单元、 模块的具体名称也只是为了便于相互区分, 并不用于限制本申请的保 护范围。 上述装置中单元、 模块的具体工作过程, 可以参考前述方法实施例中 的对应过程, 在此不再赘述。
[0084] 图 6是本申请一实施例提供的终端设备的示意框图。 如图 6所示, 该实施例的终 端设备 6包括: 一个或多个处理器 60、 存储器 61以及存储在所述存储器 61中并可 在所述处理器 60上运行的计算机程序 62。 所述处理器 60执行所述计算机程序 62 吋实现上述各个视频数据的存储方法实施例中的步骤, 例如图 1所示的步骤 S 101 至 S102。 或者, 所述处理器 60执行所述计算机程序 62吋实现上述终端设备实施 例中各模块 /单元的功能, 例如图 5所示模块 51至 52的功能。
[0085] 示例性的, 所述计算机程序 62可以被分割成一个或多个模块 /单元, 所述一个 或者多个模块 /单元被存储在所述存储器 61中, 并由所述处理器 60执行, 以完成 本申请。 所述一个或多个模块 /单元可以是能够完成特定功能的一系列计算机程 序指令段, 该指令段用于描述所述计算机程序 62在所述终端设备 6中的执行过程 。 例如, 所述计算机程序 62可以被分割成划分模块、 存储模块。
[0086] 所述划分模块, 用于将存储空间按照预设条件划分成多个存储块, 并将所述多 个存储块分别设置为索弓 I块或数据块;
[0087] 所述存储模块, 用于基于所述索引块或所述数据块的存储结构, 将获取的至少 两个通道的视频数据按照所述存储结构分幵存储;
[0088] 所述索弓 I块的存储结构中包括上一个索弓 I块的偏移指向、 下一个索引块的偏移 指向以及吋间索引, 所述数据块的存储结构中包括上一个数据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止吋间以及关键帧索引。
[0089] 其它模块或者单元的描述可参照图 5所示的实施例中的描述, 在此不再赘述。
[0090] 所述终端设备包括但不仅限于处理器 60、 存储器 61。 本领域技术人员可以理解 , 图 6仅仅是终端设备 6的一个示例, 并不构成对终端设备 6的限定, 可以包括比 图示更多或更少的部件, 或者组合某些部件, 或者不同的部件, 例如所述终端 设备还可以包括输入设备、 输出设备、 网络接入设备、 总线等。
[0091] 所述处理器 60可以是中央处理单元 (Central Processing Unit, CPU) , 还可以是其 他通用处理器、 数字信号处理器(Digital Signal Processor, DSP)、 专用集成电路 (Application Specific Integrated Circuit, ASIC)、 现成可编程门阵列
(Field-Programmable Gate Array , FPGA)或者其他可编程逻辑器件、 分立门或者 晶体管逻辑器件、 分立硬件组件等。 通用处理器可以是微处理器或者该处理器 也可以是任何常规的处理器等。
[0092] 所述存储器 61可以是所述终端设备 6的内部存储单元, 例如终端设备 6的硬盘或 内存。 所述存储器 61也可以是所述终端设备 6的外部存储设备, 例如所述终端设 备 6上配备的插接式硬盘, 智能存储卡 (Smart Media Card,
SMC) , 安全数字 (Secure Digital, SD) 卡, 闪存卡 (Flash Card) 等。 进一步 地, 所述存储器 61还可以既包括所述终端设备 6的内部存储单元也包括外部存储 设备。 所述存储器 61用于存储所述计算机程序以及所述终端设备所需的其他程 序和数据。 所述存储器 61还可以用于暂吋地存储已经输出或者将要输出的数据
[0093] 在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有详述或 记载的部分, 可以参见其它实施例的相关描述。
[0094] 本领域普通技术人员可以意识到, 结合本文中所公幵的实施例描述的各示例的 单元及算法步骤, 能够以电子硬件、 或者计算机软件和电子硬件的结合来实现 。 这些功能究竟以硬件还是软件方式来执行, 取决于技术方案的特定应用和设 计约束条件。 专业技术人员可以对每个特定的应用来使用不同方法来实现所描 述的功能, 但是这种实现不应认为超出本申请的范围。
[0095] 在本申请所提供的实施例中, 应该理解到, 所揭露的终端设备、 存储装置和存 储方法, 可以通过其它的方式实现。 例如, 以上所描述的存储装置 /终端设备实 施例仅仅是示意性的, 例如, 所述模块或单元的划分, 仅仅为一种逻辑功能划 分, 实际实现吋可以有另外的划分方式, 例如多个单元或组件可以结合或者可 以集成到另一个系统, 或一些特征可以忽略, 或不执行。 另一点, 所显示或讨 论的相互之间的耦合或直接耦合或通讯连接可以是通过一些接口, 装置或单元 的间接耦合或通讯连接, 可以是电性, 机械或其它的形式。
[0096] 所述作为分离部件说明的单元可以是或者也可以不是物理上分幵的, 作为单元 显示的部件可以是或者也可以不是物理单元, 即可以位于一个地方, 或者也可 以分布到多个网络单元上。 可以根据实际的需要选择其中的部分或者全部单元 来实现本实施例方案的目的。
[0097] 另外, 在本申请各个实施例中的各功能单元可以集成在一个处理单元中, 也可 以是各个单元单独物理存在, 也可以两个或两个以上单元集成在一个单元中。 上述集成的单元既可以采用硬件的形式实现, 也可以采用软件功能单元的形式 实现。 [0098] 所述集成的模块 /单元如果以软件功能单元的形式实现并作为独立的产品销售 或使用吋, 可以存储在一个计算机可读取存储介质中。 基于这样的理解, 本申 请实现上述实施例方法中的全部或部分流程, 也可以通过计算机程序来指令相 关的硬件来完成, 所述的计算机程序可存储于一计算机可读存储介质中, 该计 算机程序在被处理器执行吋, 可实现上述各个方法实施例的步骤。 其中, 所述 计算机程序包括计算机程序代码, 所述计算机程序代码可以为源代码形式、 对 象代码形式、 可执行文件或某些中间形式等。 所述计算机可读介质可以包括: 能够携带所述计算机程序代码的任何实体或装置、 记录介质、 U盘、 移动硬盘、 磁碟、 光盘、 计算机存储器、 只读存储器 (ROM, Read-Only Memory) 、 随机 存取存储器 (RAM, Random Access Memory) 、 电载波信号、 电信信号以及软 件分发介质等。 需要说明的是, 所述计算机可读介质包含的内容可以根据司法 管辖区内立法和专利实践的要求进行适当的增减, 例如在某些司法管辖区, 根 据立法和专利实践, 计算机可读介质不包括是电载波信号和电信信号。
[0099] 以上所述实施例仅用以说明本申请的技术方案, 而非对其限制; 尽管参照前述 实施例对本申请进行了详细的说明, 本领域的普通技术人员应当理解: 其依然 可以对前述各实施例所记载的技术方案进行修改, 或者对其中部分技术特征进 行等同替换; 而这些修改或者替换, 并不使相应技术方案的本质脱离本申请各 实施例技术方案的精神和范围, 均应包含在本申请的保护范围之内。

Claims

权利要求书
[权利要求 1] 一种视频数据的存储方法, 其特征在于, 包括:
将存储空间按照预设条件划分成多个存储块, 并将所述多个存储块分 别设置为索引块或数据块;
基于所述索引块或所述数据块的存储结构, 将获取的至少两个通道的 视频数据按照所述存储结构分幵存储;
所述索弓 I块的存储结构中包括上一个索弓 I块的偏移指向、 下一个索引 块的偏移指向以及吋间索引, 所述数据块的存储结构中包括上一个数 据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止 吋间以及关键帧索引。
[权利要求 2] 如权利要求 1所述的视频数据的存储方法, 其特征在于, 所述基于所 述索引块或所述数据块的存储结构, 将获取的至少两个通道的视频数 据按照所述存储结构分幵存储包括:
获取至少两个通道的视频数据, 并将所述至少两个通道的视频数据基 于所述数据块的存储结构分别存储在不同的数据块中;
根据所述数据块中存储的视频数据, 在所述视频数据所在通道的索引 块中基于所述索引块的存储结构创建吋间索引; 或者, 获取至少两个通道的视频数据, 并将所述至少两个通道的视频 数据基于所述索引块的存储结构分别在不同的索引块中创建吋间索引
根据创建的吋间索弓 I在所述吋间索弓 I指向的视频数据所在通道的数据 块中基于所述数据块的存储结构分别存储每个通道的视频数据。
[权利要求 3] 如权利要求 1所述的视频数据的存储方法, 其特征在于, 所述关键帧 索引包括:
所述关键帧的绝对吋间和所述关键帧在所存储的数据块中的偏移指向
[权利要求 4] 如权利要求 3所述的视频数据的存储方法, 其特征在于, 在基于所述 索引块或所述数据块的存储结构, 将获取的至少两个通道的视频数据 按照所述存储结构分幵存储之后, 还包括:
获取数据回放请求中的吋间信息, 并根据所述吋间信息通过每个通道 的索引块中的吋间索引定位所述吋间信息对应的视频数据所在的数据 块;
在定位的数据块中, 根据所述吋间信息以及所述关键帧的绝对吋间定 位到所述吋间信息指向的关键帧;
在定位到所述吋间信息在每个通道的视频数据中指向的关键帧后, 根 据定位到的关键帧同吋播放每个通道的视频数据。
[权利要求 5] 如权利要求 3所述的视频数据的存储方法, 其特征在于, 在基于所述 索引块或所述数据块的存储结构, 将获取的至少两个通道的视频数据 按照所述存储结构分幵存储之后, 还包括:
获取每个通道索引块中最早的吋间索引, 并判断所述最早的吋间索引 表示的吋间距离当前的吋间是否大于预设吋间; 若所述最早的吋间索引表示的吋间距离当前的吋间大于所述预设吋间 , 则将所述最早的吋间索引指向的数据块中存储的视频数据刪除, 并 刪除该视频数据对应的索引信息。
[权利要求 6] 如权利要求 5所述的视频数据存储的方法, 其特征在于, 在判断所述 最早的吋间索引表示的吋间距离当前的吋间是否大于预设吋间之后, 所述存储方法还包括:
若所述最早的吋间索引表示的吋间距离当前的吋间小于或者等于所述 预设吋间, 则获取所述存储空间的剩余空间;
若所述剩余空间小于空间阈值, 则将每个通道索引块中最早的吋间索 引指向的数据块中存储的视频数据刪除, 并刪除该视频数据对应的索 引信息。
[权利要求 7] —种视频数据的存储装置, 其特征在于, 包括:
划分模块, 用于将存储空间按照预设条件划分成多个存储块, 并将所 述多个存储块分别设置为索引块或数据块;
存储模块, 用于基于所述索引块或所述数据块的存储结构, 将获取的 至少两个通道的视频数据按照所述存储结构分幵存储; 所述索弓 I块的存储结构中包括上一个索弓 I块的偏移指向、 下一个索引 块的偏移指向以及吋间索引, 所述数据块的存储结构中包括上一个数 据块的偏移指向、 下一个数据块的偏移指向、 存储的视频数据的起止 吋间以及关键帧索引。
[权利要求 8] 如权利要求 7所述的视频数据的存储装置, 其特征在于, 所述存储模 块包括:
第一数据存储单元, 用于获取至少两个通道的视频数据, 并将所述至 少两个通道的视频数据基于所述数据块的存储结构分别存储在不同的 数据块中;
第一索引创建单元, 用于根据所述数据块中存储的视频数据在所述视 频数据所在通道的索引块中基于所述索引块的存储结构创建吋间索引
[权利要求 9] 如权利要求 7所述的视频数据的存储装置, 其特征在于, 所述存储模 块还包括:
第二索引创建单元, 用于获取至少两个通道的视频数据, 并将所述至 少两个通道的视频数据基于所述索弓 I块的存储结构分别在不同的索引 块中创建吋间索引;
第二数据存储单元, 用于根据创建的吋间索引在所述吋间索引指向的 视频数据所在通道的数据块中基于所述数据块的存储结构分别存储每 个通道的视频数据。
[权利要求 10] 如权利要求 7所述的视频数据的存储装置, 其特征在于, 所述关键帧 索引包括:
所述关键帧的绝对吋间和所述关键帧在所存储的数据块中的偏移指向
[权利要求 11] 如权利要求 10所述的视频数据的存储装置, 其特征在于, 还包括: 回放数据块定位模块, 用于获取数据回放请求中的吋间信息, 并根据 所述吋间信息通过每个通道的索引块中的吋间索引定位所述吋间信息 对应的视频数据所在的数据块;
回放关键帧定位模块, 用于在定位的数据块中, 根据所述吋间信息以 及所述关键帧的绝对吋间定位到所述吋间信息指向的关键帧; 回放模块, 用于在定位到所述吋间信息在每个通道的视频数据中指向 的关键帧后, 根据定位到的关键帧同吋播放每个通道的视频数据。
[权利要求 12] 如权利要求 10所述的视频数据的存储装置, 其特征在于, 还包括: 覆盖吋间判断模块, 用于获取每个通道索引块中最早的吋间索引, 并 判断所述最早的吋间索引表示的吋间距离当前的吋间是否大于预设吋 间;
第一覆盖处理模块, 用于若所述最早的吋间索引表示的吋间距离当前 的吋间大于所述预设吋间, 则将所述最早的吋间索引指向的数据块中 存储的视频数据刪除, 并刪除该视频数据对应的索引信息。
[权利要求 13] 如权利要求 12所述的视频数据的存储装置, 其特征在于, 还包括: 覆盖空间判断模块, 用于若所述最早的吋间索引表示的吋间距离当前 的吋间小于或者等于所述预设吋间, 则获取所述存储空间的剩余空间 第二覆盖处理模块, 用于若所述剩余空间小于空间阈值, 则将每个通 道索引块中最早的吋间索引指向的数据块中存储的视频数据刪除, 并 刪除该视频数据对应的索引信息。
[权利要求 14] 一种终端设备, 包括存储器、 处理器以及存储在所述存储器中并可在 所述处理器上运行的计算机程序, 其特征在于, 所述处理器执行所述 计算机程序吋实现如权利要求 1至 6任一项所述方法的步骤。
[权利要求 15] —种计算机可读存储介质, 所述计算机可读存储介质存储有计算机程 序, 其特征在于, 所述计算机程序被处理器执行吋实现如权利要求 1 至 6任一项所述方法的步骤。
PCT/CN2017/107355 2017-10-23 2017-10-23 一种视频数据的存储方法、装置及终端设备 WO2019079944A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201780001287.1A CN110100243B (zh) 2017-10-23 2017-10-23 一种视频数据的存储方法、装置及终端设备
PCT/CN2017/107355 WO2019079944A1 (zh) 2017-10-23 2017-10-23 一种视频数据的存储方法、装置及终端设备

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2017/107355 WO2019079944A1 (zh) 2017-10-23 2017-10-23 一种视频数据的存储方法、装置及终端设备

Publications (1)

Publication Number Publication Date
WO2019079944A1 true WO2019079944A1 (zh) 2019-05-02

Family

ID=66247163

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107355 WO2019079944A1 (zh) 2017-10-23 2017-10-23 一种视频数据的存储方法、装置及终端设备

Country Status (2)

Country Link
CN (1) CN110100243B (zh)
WO (1) WO2019079944A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732177A (zh) * 2020-12-28 2021-04-30 深圳市华宝电子科技有限公司 一种视频存储方法、装置、设备及存储介质

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111506768A (zh) * 2020-04-21 2020-08-07 深圳市华宝电子科技有限公司 一种车载视频数据存储方法、装置、服务器及存储介质
CN114205641A (zh) * 2021-11-30 2022-03-18 杭州华橙软件技术有限公司 一种视频数据处理方法及装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060171666A1 (en) * 2005-02-01 2006-08-03 Lg Electronics Inc. Apparatus and method for recording/reproducing moving picture in digital broadcast receiver
CN102760136A (zh) * 2011-04-29 2012-10-31 苏州科达科技有限公司 一种基于快速视频数据存储的文件系统的控制方法
CN103037203A (zh) * 2012-12-11 2013-04-10 浙江宇视科技有限公司 一种基于块存储的索引恢复方法和装置
CN103929609A (zh) * 2014-04-22 2014-07-16 浙江宇视科技有限公司 一种录像回放方法和装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6119123A (en) * 1997-12-02 2000-09-12 U.S. Philips Corporation Apparatus and method for optimizing keyframe and blob retrieval and storage
CN106815355A (zh) * 2017-01-22 2017-06-09 济南浪潮高新科技投资发展有限公司 一种用于NANDflash阵列的文件系统实现方法
CN107870973B (zh) * 2017-09-20 2021-11-26 广东东为信息技术有限公司 一种加快多路监控同时回放的文件存储系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060171666A1 (en) * 2005-02-01 2006-08-03 Lg Electronics Inc. Apparatus and method for recording/reproducing moving picture in digital broadcast receiver
CN102760136A (zh) * 2011-04-29 2012-10-31 苏州科达科技有限公司 一种基于快速视频数据存储的文件系统的控制方法
CN103037203A (zh) * 2012-12-11 2013-04-10 浙江宇视科技有限公司 一种基于块存储的索引恢复方法和装置
CN103929609A (zh) * 2014-04-22 2014-07-16 浙江宇视科技有限公司 一种录像回放方法和装置

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GUO QIU: "Storage Algorithm of a multi-Channel Digital Video Monitoring System", ELECTRIC ENGINEER, vol. 31, no. 5, 31 May 2005 (2005-05-31) *
XU DIANWU: "Study on AVI File Format and its Application", MODERN ELECTRONIC TECHNIQUE, no. 265, 29 February 2008 (2008-02-29) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112732177A (zh) * 2020-12-28 2021-04-30 深圳市华宝电子科技有限公司 一种视频存储方法、装置、设备及存储介质
CN112732177B (zh) * 2020-12-28 2024-03-26 深圳市华宝电子科技有限公司 一种视频存储方法、装置、设备及存储介质

Also Published As

Publication number Publication date
CN110100243A (zh) 2019-08-06
CN110100243B (zh) 2023-04-14

Similar Documents

Publication Publication Date Title
US11310413B2 (en) Device and method for photo and video capture
KR101871364B1 (ko) 카메라 스위칭 동안 계속적으로 비디오를 캡쳐하는 방법 및 그 장치
JP6626440B2 (ja) マルチメディアファイルを再生するための方法及び装置
EP3537278A1 (en) Recording and playing method for screen video, and screen recording terminal and playing terminal
WO2019079944A1 (zh) 一种视频数据的存储方法、装置及终端设备
CN110704202B (zh) 多媒体录制数据共享方法及终端设备
CN108401134A (zh) 播放视频的方法、终端和系统
WO2023051185A1 (zh) 图像处理方法、装置、电子设备及存储介质
CN110720096B (zh) 一种多传感器状态估计方法、装置及终端设备
CN105205494A (zh) 相似图片识别方法及装置
WO2019041227A1 (zh) 车载安防监控方法、系统及终端设备
WO2022017006A1 (zh) 视频处理方法、装置、终端设备及计算机可读存储介质
CN107231537B (zh) 一种画中画切换方法和装置
US11756586B2 (en) Method for splicing audio file and computer device
US9544532B2 (en) System and method for pre-recording video
WO2019015411A1 (zh) 录屏方法、装置及电子设备
CN111147778B (zh) 基于数字视频录像机的轨迹录像方法、装置及存储介质
JP2016526246A (ja) ユーザデータ更新方法、装置、プログラム、及び記録媒体
CN111143092B (zh) 故障录波数据处理方法、系统及终端设备
CN105426904A (zh) 照片处理方法、装置和设备
EP2672695A2 (en) Continuous video capture during switch between video capture devices
US11503226B2 (en) Multi-camera device
EP3839786A1 (en) Information acquisition method and device, and storage medium
CN107577810A (zh) 数据写入方法、装置及计算机可读存储介质
CN108335706B (zh) 一种多媒体文件的无缝播放方法、终端设备及存储介质

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17929739

Country of ref document: EP

Kind code of ref document: A1