CN106998436B - Video backup method and device - Google Patents

Video backup method and device Download PDF

Info

Publication number
CN106998436B
CN106998436B CN201710184742.8A CN201710184742A CN106998436B CN 106998436 B CN106998436 B CN 106998436B CN 201710184742 A CN201710184742 A CN 201710184742A CN 106998436 B CN106998436 B CN 106998436B
Authority
CN
China
Prior art keywords
record
time
video
backup
records
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201710184742.8A
Other languages
Chinese (zh)
Other versions
CN106998436A (en
Inventor
成浩
尤晓明
张鹏国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201710184742.8A priority Critical patent/CN106998436B/en
Publication of CN106998436A publication Critical patent/CN106998436A/en
Application granted granted Critical
Publication of CN106998436B publication Critical patent/CN106998436B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

The application provides a video backup method and a device, wherein the method is applied to BM and comprises the following steps: receiving a backup task, and acquiring a movement amount record of the backup task in a specified time period; combining two adjacent records with the interval time smaller than the first numerical value in the moving amount records into one record to obtain the moving amount record after polymerization; and reading the video of each record corresponding to the start-stop time period in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file. According to the method and the device, the time segments of the movement amount records are aggregated into continuous and large time segments, and the video of each record corresponding to the start-stop time period in the aggregated movement amount records is written into the same backup file, so that the occurrence of a large number of fragmented files of several seconds or dozens of seconds can be avoided, the utilization rate of backup space resources is improved, the files do not need to be frequently opened when the video is retrieved, and the efficiency of retrieving the video is improved.

Description

Video backup method and device
Technical Field
The present application relates to the field of storage technologies, and in particular, to a video backup method and apparatus.
Background
In the application of video monitoring industries such as public security, garden and the like, the following backup requirements exist for the original video: backup is required to be performed for some important time periods selected by the user (for example, the time period related to the camera in the public security major case). The part of the video is transmitted from the original storage space and stored into the storage space special for backup, thereby effectively preventing the situations of video coverage, recording loss and the like caused by limited original storage resources.
In the related technology, a camera extracts moving amount data of each frame of a collected video by adopting a moving target analysis algorithm, reports the moving amount data to a database once every preset time period, if all the moving amount data are static pictures in the preset time period, the moving amount data are not reported, and if at least one frame has a moving target in the preset time period, the moving amount data are reported, namely the moving amount data and time information thereof are written into the database. When a BM (Backup Management server) executes a video Backup, first, according to a start-stop time period of a video to be backed up, moving amount data of the start-stop time period is acquired from a database, and then, according to the acquired moving amount data, time for the video to be backed up is filtered to Backup the video with the moving amount.
However, for a video with a large amount of static pictures, even if there is a moving target, the video stays for only several seconds, so the corresponding moving amount data has strong discreteness in time, if backup is simply performed according to the moving amount data, a large number of small fragmented files with several seconds or several tens of seconds of videos are backed up, fragmentation of backup space resources is caused, and when a user accesses the backup video, the files need to be frequently opened, which affects the efficiency of the user accessing the video.
Disclosure of Invention
In view of this, the present application provides a video backup method and apparatus, so as to solve the problems that the existing backup method may cause fragmentation of backup resource space and affect the efficiency of retrieving videos by users.
According to a first aspect of the embodiments of the present application, a video backup method is provided, where the method is applied to a BM, and the method includes:
receiving a backup task, and acquiring a movement amount record of the backup task in a specified time period, wherein each record in the movement amount record corresponds to a start time and an end time;
combining two adjacent records with the interval time smaller than a first value in the moving amount records into one record to obtain the moving amount record after polymerization, wherein the interval time is the difference between the end time of the previous record and the start time of the next record;
and reading the video of each record corresponding to the start-stop time period in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file.
According to a second aspect of the embodiments of the present application, there is provided a video recording backup method, where the method is applied to a VM, and the method includes:
acquiring the starting time and the query time length of a video to be backed up, setting the query starting time as the starting time of the video to be backed up, and setting the query ending time as the sum of the query starting time and the query time length;
acquiring movement records from the query starting time to the query ending time, and acquiring the sum of time lengths of start-stop time periods corresponding to each record in the movement records;
judging whether the sum of the time lengths is larger than a sixth numerical value or not;
if so, taking the starting time of the video to be backed up as the starting time of a backup task and the ending time of the last record in the movement amount record as the ending time of the backup task, and sending the backup task to the BM;
otherwise, resetting the query starting time as the last query ending time, wherein the query ending time is the sum of the query starting time and the query time length, and executing the process of obtaining the moving amount record between the query starting time and the query ending time.
According to a third aspect of the embodiments of the present application, there is provided a video recording backup apparatus, where the apparatus is applied to a BM, and the apparatus includes:
the acquisition module is used for receiving a backup task and acquiring movement records of the backup task in a specified time period, wherein each record in the movement records corresponds to a start time and an end time;
the aggregation module is used for merging two adjacent records with the interval time smaller than a first numerical value in the moving amount records into one record to obtain the moving amount record after aggregation, wherein the interval time is the difference between the end time of the previous record and the start time of the next record;
and the backup module is used for reading the video of the start-stop time period corresponding to each record in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file.
According to a fourth aspect of the embodiments of the present application, there is provided a video recording backup apparatus, where the apparatus is applied to a VM, the apparatus including:
the device comprises a setting module, a searching module and a judging module, wherein the setting module is used for acquiring the starting time and the searching time length of a video to be backed up, setting the searching starting time as the starting time of the video to be backed up, and setting the searching ending time as the sum of the searching starting time and the searching time length;
the acquisition module is used for acquiring the movement records from the query starting time to the query ending time and acquiring the sum of the time lengths of the starting time period and the ending time period corresponding to each record in the movement records;
the judging module is used for judging whether the sum of the time lengths is larger than a sixth numerical value or not;
the sending module is used for taking the starting time of the video to be backed up as the starting time of a backup task and taking the ending time of the last record in the movement amount record as the ending time of the backup task when the judgment result is yes, and sending the backup task to the BM;
and the resetting module is used for resetting the query starting time as the last query ending time when the judgment result is negative, setting the query ending time as the sum of the query starting time and the query time length, and executing the process of obtaining the moving amount record between the query starting time and the query ending time.
By applying the embodiment of the application, after receiving the backup task and acquiring the record of the movement amount of the backup task in the specified time period, the time segments of the acquired movement records are firstly aggregated into continuous and large time segments, combining two adjacent records with the interval time smaller than the first value in the moving amount records into one record to obtain the moving amount records after polymerization, then further reading the video of the start-stop time period corresponding to each record in the aggregated moving amount records, and writes the read video segments into the same backup file in the backup IPSAN device to complete video backup, thereby avoiding the occurrence of a large number of small fragmented files recorded for several seconds or dozens of seconds, improving the utilization rate of backup space resources, and the user does not need to frequently open the file when searching and reading the backup video, so that the efficiency of searching and reading the video by the user is improved.
Drawings
Fig. 1 is a video backup scene diagram according to an exemplary embodiment of the present application;
fig. 2 is a flowchart illustrating an embodiment of a video backup method according to an exemplary embodiment of the present application;
fig. 3 is a flowchart illustrating another video backup method according to an exemplary embodiment of the present application;
FIG. 4 is a diagram illustrating a hardware configuration of a backup management server according to an exemplary embodiment of the present application;
fig. 5 is a hardware block diagram of a video management server according to an exemplary embodiment of the present application;
fig. 6 is a block diagram of an embodiment of a video recording backup apparatus according to an exemplary embodiment of the present application;
fig. 7 is a block diagram of another embodiment of a video recording backup apparatus according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a view of a video backup scenario according to an exemplary embodiment of the present application, where fig. 1 includes a database server, a video management server VM, a backup management server BM, a backup IPSAN device, a VOD server, and an IPSAN device where an original video is located. The database server is used for storing the moving amount data sent by the camera and corresponding time information (starting time and ending time); the VM is used for managing all devices in the video monitoring system in a centralized manner, scheduling various video monitoring services and managing and distributing monitoring user rights; the BM is used for acquiring moving amount records (each record comprises moving amount data and time information) in a specified time period according to a backup task sent by the VM, sending a request instruction to a VOD server based on the acquired moving amount records to read a video, and sending the read video to backup IPSAN equipment for storage and backup, so that the video of the monitoring system is backed up; the backup IPSAN equipment is used for storing the backup video sent by the BM; a VOD (Video on demand) server is used for reading the Video from the IPSAN equipment where the original Video mounted to the local is located according to a request instruction sent by the BM, wherein the BM and the VOD communicate based on RTSP (Real Time Streaming Protocol), and the BM and the IPSAN equipment where the original Video is located communicate based on iSCSI (Internet Small computer Interface) Protocol; the IPSAN equipment where the original video is located is used for storing all the videos collected by the camera.
Fig. 2 is a flowchart of an embodiment of a video backup method according to an exemplary embodiment of the present application, where the video backup method may be applied to a BM, and is described in detail with reference to the scene diagram shown in fig. 1, as shown in fig. 2, the video backup method includes the following steps:
step 201: receiving a backup task, and acquiring a movement amount record of a specified time period of the backup task, wherein each record in the movement amount record corresponds to a start time and an end time.
In an embodiment, the backup task received by the BM may carry the start time and the end time of the video to be backed up, and the camera identifier, and the specified time period is a time period between the start time and the end time. Therefore, the moving amount record of the camera corresponding to the camera identification in the specified time period can be obtained from the database server. Furthermore, each record stored in the database server includes movement amount data and corresponding time information (start time and end time), and each record indicates that there is movement of the moving object in the video of the period of time, the movement amount data may be movement data of each macro block in the picture, and the movement data of each macro block may take the maximum value of the corresponding macro block of each frame in the period of time, for example, the picture is divided into 22 × 18 macro blocks, each macro block is represented by one byte, so the movement amount data is composed of 396 bytes, wherein each byte takes a value of 1 to 8, and a larger value indicates that the moving object moves more intensely.
Step 202: and combining two adjacent records with the interval time smaller than the first value in the moving amount records into one record to obtain the moving amount record after polymerization, wherein the interval time is the difference between the end time of the previous record and the start time of the next record.
In an embodiment, the BM may select the first two records from the moving amount records, use the first record as the current record, use the second record as the next record, and then determine whether the time interval between the current record and the next record is smaller than the first value, if so, set the end time of the current record as the end time of the next record; if not, writing the current record into the aggregated movement record, and taking the next record as the current record; and continuously selecting the next record from the moving amount records as the next record, and executing the process of judging whether the time interval between the current record and the next record is smaller than the first numerical value.
In order to integrate the time slices of the records of the respective shift amounts into a continuous, large time slice as much as possible, the records of the adjacent shift amounts whose interval time is less than a first value may be aggregated into one record, and the first value may be set according to actual requirements, for example, the first value may be 60 seconds. In addition, the BM may apply for a space for the aggregated shift amount record in advance and initialize to all zeros for subsequent writing of the shift amount record.
It should be noted that, while aggregating the adjacent records, the BM may also expand the record whose time length is less than a certain value, so as to expand the record to a longer time length, and include the videos before and after the event corresponding to the record. Therefore, before taking the next record as the current record in the movement amount record after aggregating the current records, the BM may first determine whether the start-stop time period corresponding to the current record is less than a second value; if the time interval between the current record and the next record is smaller than the first value, the process of setting the end time of the current record as the end time of the next record is executed, if the time interval between the current record and the next record is larger than the first value, the process of setting the end time of the current record as the end time of the current record is judged, if the time interval between the current record and the last record in the aggregated motion amount records is smaller than the first value, the end time of the last record in the aggregated motion amount records is set as the end time of the current record, the next record is used as the current record, the process of continuously selecting the next record from the motion amount records as the next record is executed, otherwise, the current record is written into the aggregated motion amount records, and taking the next record as the current record process; and if the current record is larger than the second numerical value, writing the current record into the aggregated movement amount record, and taking the next record as the current record.
The first value may be greater than or equal to the second value to ensure that the expanded record does not overlap with the previous or next record. The manner of respectively extending the start time and the end time of the current recording may be: and selecting (a second numerical value-the time length of the current record)/2 as an extended time length, namely extending the start time of the current record forwards by the extended time length and extending the end time of the current record backwards by the extended time length, so that the front and rear videos of the event corresponding to the current record are included.
Step 203: and reading the video of each record corresponding to the start-stop time period in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file.
In an embodiment, the BM may send a request instruction to the VOD server based on the aggregated movement records to read the video records corresponding to the start-stop time period of each record, the VOD server reads the video records segment by segment from the IPSAN device where the original video record mounted locally is located according to the received request instruction, and sequentially sends the read video segments to the BM, and then the BM writes the received video segments into the backup file on the backup IPSAN device.
It should be noted that, after writing each read video segment into the backup file, the BM may obtain the URL address of the backup file, determine the start time of the first record in the aggregated movement amount records as the start time of the video segment in the backup file, determine the end time of the last record as the end time of the video segment in the backup file, generate a video recording time information bitmap according to the start time and the end time of each video segment, and send the backup file information carrying the start time, the end time, the URL address, and the video recording time information bitmap to the VM.
The VM may store information (start time, end time, URL address, and video recording time information bitmap) related to the backup file sent by the BM in a backup file list of the database, so that a user can retrieve and view the information. The URL address of the backup file refers to a storage position of the backup video in the backup IPSAN device, the video in the backup file can be retrieved through the URL address, the time information bitmap is used for indicating the time of each video segment in the backup file, a user can know which video in which time has a moving target and which video in which time is a static picture by checking the time information bitmap, and then the video with the moving target can be directly retrieved, so that the efficiency of the user for retrieving the video is improved.
For the process of generating the video recording time information bitmap according to the start time and the end time of each video recording, the BM may first acquire a first video recording segment and a first blank segment, of which the difference between the start time and the end time is smaller than a third value, and encode the acquired first video recording segment and the acquired first blank segment by using a fourth value of bits; and then acquiring a second video segment and a second blank segment, wherein the difference value between the starting time and the ending time is greater than a third numerical value, and encoding the acquired second video segment and the acquired second blank segment by adopting a fifth numerical value bit.
Considering that there is a video recording for a long time (for example, a scene with more days or people) or no video recording for a long time (a scene with less people) in the video monitoring process, the BM may use a time unit hybrid coding method to perform coding, that is, a short time unit coding (minute coding) is used for a time period with or without video recording for a short time (a first video segment and a first blank segment whose difference between a start time and an end time is smaller than a third value), that is, a fourth value of bits is used to perform coding; and (3) adopting long-time unit coding (hour coding) for a long-time period with or without video recording (a second video segment and a second blank segment with the difference value between the starting time and the ending time larger than a third numerical value), namely adopting a fifth numerical value of bits for coding, wherein the number of bits required by minute coding is smaller than that required by hour coding, so that the fourth numerical value is smaller than the fifth numerical value.
In an exemplary scenario, the third value is 4 minutes, the fourth value used in the minute coding is 2 bits, as shown in table 1, it is an exemplary minute coding, and the fifth value used in the hour coding is 8 bits, as shown in table 2, it is an exemplary hour coding, so if the time length of the video segment or the blank segment is less than 4 minutes, it is coded with 2 bits, and if the time length of the video segment or the blank segment is greater than 4 minutes, it is coded with 8 bits.
Bit position Means of Value taking
1 st position (high position) Coding method 0: minute code 1: hour coding
2 nd bit (Low bit) Whether or not there is a video 0: video-not-recorded 1: with video recording
TABLE 1
Figure BDA0001254521800000091
TABLE 2
Suppose that there is a video recording at time 22:01 to 22: 02 at night, there is no video recording at time 22: 03 to 24: 50, there is a video recording at time 24: 51 to 24: 52, and the length of time shown is 2 hours and 52 minutes, if a time unit hybrid coding scheme is adopted, 4 minute coding units are required, 3 hour coding units (2 hour coding represents 1 hour, 1 hour coding represents 48 minutes), and the total bits required are 4 x 2+3 x 8 to 32 bits, as shown in table 3, which is the result of time unit hybrid coding.
Figure BDA0001254521800000092
TABLE 3
Compared with the prior art (for the representation of the time of a plurality of video segments, 1 bit is adopted to represent whether video is recorded for 1 minute, for example, 0 represents no video and 1 represents video), the time unit hybrid coding method has the advantages that the space resource occupied by the time unit hybrid coding is smaller and the storage efficiency is high when the video is recorded for a long time, and for the video of 52 minutes within 2 hours, the coding method only needs 32 bits to represent, while the prior art needs 480 bits to represent. And when judging whether video exists or not through the time information bitmap, the VM needs to calculate and judge bit by bit, so that the calculation and judgment efficiency of the coding mode is higher for the video representing the same time segment.
As can be seen from the above embodiments, after the BM receives the backup task and acquires the record of the movement amount of the specified time period of the backup task, the time segments of the acquired movement records are firstly aggregated into continuous and large time segments, combining two adjacent records with the interval time smaller than the first value in the moving amount records into one record to obtain the moving amount records after polymerization, then further reading the video of the start-stop time period corresponding to each record in the aggregated moving amount records, and writes the read video segments into the same backup file in the backup IPSAN device to complete video backup, thereby avoiding the occurrence of a large number of small fragmented files recorded for several seconds or dozens of seconds, improving the utilization rate of backup space resources, and the user does not need to frequently open the file when searching and reading the backup video, so that the efficiency of searching and reading the video by the user is improved.
Fig. 3 is a flowchart of another video recording backup method according to an exemplary embodiment of the present application, where the video recording backup method may be applied to a VM, and is described in detail with reference to the scene diagram shown in fig. 1, and as shown in fig. 3, the video recording backup method includes the following steps:
step 301: the method comprises the steps of obtaining the starting time and the query time length of a video to be backed up, setting the query starting time as the starting time of the video to be backed up, and setting the query ending time as the sum of the query starting time and the query time length.
In an embodiment, the manner in which the VM determines the specified time period of the backup task may be a dynamic selection manner, that is, each time the record of the movement amount with a fixed time length is queried, the dynamic adjustment is performed. Therefore, the VM may first obtain the start time and the query time length of the video to be backed up, and in addition, may also obtain the end time of the video to be backed up, where the query time length may be a preset time length, for example, 6 hours, or may also be a smaller value of the difference between the preset time length and the start time and the end time of the video to be backed up.
It should be noted that, before the VM sets the query start time as the start time of the video to be backed up, the VM may determine whether a difference between the start time and the end time of the video to be backed up is smaller than a certain threshold (for example, 1 hour), if so, directly use the start time of the video to be backed up as the start time of the backup task, use the end time of the video to be backed up as the end time of the backup task, and send the backup task to the BM, otherwise, execute the process of setting the query start time as the start time of the video to be backed up.
Step 302: and acquiring movement records from the query starting time to the query ending time, and acquiring the sum of the time lengths of the starting time period and the ending time period corresponding to each record in the movement records.
In an embodiment, the VM may obtain records of movement amounts between the query start time and the query end time from the database server, if the obtaining is successful, obtain a sum of time lengths of start and stop time periods (time lengths between the end time and the start time) corresponding to each record in the records of movement amounts, if the obtaining is failed, it indicates that an abnormal condition occurs, which results in a failure in obtaining the VM, and may directly use the start time of the video to be backed up as the start time of the backup task, and use a sum of the start time of the video to be backed up and a certain threshold (e.g., 1 hour) as the end time of the backup task.
In an exemplary scenario, the query start time is 22:00, the query end time is 4:00, and the query time length is 6 hours, where a moving target, i.e., a corresponding moving amount record, exists in 22:01 to 22:05 videos, and a moving target, i.e., a corresponding moving amount record, exists in 2:01 to 2:05 videos, and assuming that the time length of the start-stop time period corresponding to each moving amount record is 1 second, the VM may obtain 600 moving amount records from the database server, and the sum of the time lengths of the start-stop time periods corresponding to each record is 10 minutes.
Step 303: and judging whether the sum of the time lengths is larger than a sixth numerical value, if not, executing the step 304, otherwise, executing the step 305.
Wherein the sixth value is used to indicate the minimum length of recording time for each actual backup, e.g. 15 minutes.
Step 304: and taking the starting time of the video to be backed up as the starting time of the backup task and the ending time of the last record in the movement amount record as the ending time of the backup task, and sending the backup task to the BM.
If the sum of the time lengths is greater than the sixth value, it indicates that the query time length has reached the minimum time length of the video record of the actual backup, and the end time including the record of the movement amount may be used as the end time of the backup task.
Step 305: resetting the query start time as the last query end time, wherein the query end time is the sum of the query start time and the query time length, and executing the process of step 302.
If the sum of the time lengths is less than the sixth value, it indicates that the query time length has not reached the minimum time length of the video for actual backup, and it needs to continue querying backwards, and the query start time and the query end time may be reset, and the process of step 302 is continuously executed.
It should be noted that, after the VM resets the query start time to the last query end time, and the query end time is the sum of the query start time and the query time length, it may be determined whether the query end time is greater than the end time of the video to be backed up; if not, the process of step 302 is executed again, and if yes, the ending time of the video to be backed up is taken as the ending time of the backup task, the starting time of the video to be backed up is taken as the starting time of the backup task, and the backup task is sent to the BM.
As can be seen from the above embodiments, before sending a backup task, a VM may first obtain a start time and a query time length of a video to be backed up, set the query start time as the start time of the video to be backed up, and set the query end time as the sum of the query start time and the query time length, then obtain a record of movement amount between the query start time and the query end time, and obtain the sum of time lengths of start-stop time periods corresponding to each record in the record of movement amount, and determine whether the sum of time lengths is greater than a sixth value, if yes, take the start time of the video to be backed up as the start time of the backup task and the end time of the last record in the record of movement amount as the end time of the backup task, and send the backup task to a backup management server BM; otherwise, resetting the query starting time as the last query ending time, setting the query ending time as the sum of the query starting time and the query time length, and executing the process of obtaining the moving amount record between the query starting time and the query ending time. Based on the implementation manner, when the VM issues the backup task, instead of selecting a start-stop time period with a fixed time length, the VM dynamically selects the length of the start-stop time period of the backup task, so that the video recording time length of the actual backup reaches a certain threshold (the sixth value), and thus, at the source of issuing the backup task to the BM, the backup task issued to the BM can ensure that the video recording time length of the actual backup reaches the certain threshold.
Corresponding to the embodiment of the video backup method, the application also provides an embodiment of a video backup device.
The embodiment of the video backup device can be applied to a backup management server. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. In terms of hardware, as shown in fig. 4, a hardware structure diagram of a backup management server according to an exemplary embodiment of the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 4, a device in which the apparatus in the embodiment is located may also include other hardware according to an actual function of the device, which is not described again.
The embodiment of the video backup device can also be applied to a video management server. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. In terms of hardware, as shown in fig. 5, a hardware structure diagram of a video management server according to an exemplary embodiment of the present application is shown, except for the processor, the memory, the network interface, and the nonvolatile memory shown in fig. 5, a device in which the apparatus is located in the embodiment may also include other hardware according to an actual function of the device, which is not described again.
Fig. 6 is a block diagram of an embodiment of a video recording backup apparatus according to an exemplary embodiment of the present application, where the video recording backup apparatus may be applied to a BM, and as shown in fig. 6, the video recording backup apparatus includes: an acquisition module 61, an aggregation module 62, and a backup module 63.
The obtaining module 61 is configured to receive a backup task, and obtain a movement amount record of a specified time period of the backup task, where each record in the movement amount record corresponds to a start time and an end time;
the aggregation module 62 is configured to combine two adjacent records in the movement amount record, of which the interval time is smaller than the first value, into one record to obtain a movement amount record after aggregation, where the interval time is a difference between an end time of a previous record and a start time of a next record;
and the backup module 63 is configured to read a video record of each record corresponding to the start-stop time period in the aggregated movement amount record, create a backup file in the backup IPSAN device, and write each read video segment into the backup file.
In an optional implementation manner, the aggregation module 62 is specifically configured to select the first two records from the moving amount records, and use the first record as the current record and the second record as the next record; judging whether the time interval between the current record and the next record is smaller than a first numerical value or not; if so, setting the end time of the current record as the end time of the next record; if not, writing the current record into the aggregated movement amount record, and taking the next record as the current record; and continuing to select the next record from the movement records as the next record, and executing the process of judging whether the time interval between the current record and the next record is smaller than a first numerical value.
In an alternative implementation, the apparatus further comprises (not shown in fig. 6):
an extension module, configured to determine whether a start-stop time period corresponding to the current record is smaller than a second value before the aggregation module 62 writes the current record into the aggregated movement amount record and takes the next record as the current record; if the time interval between the current record and the next record is smaller than the first value, then judging whether the time interval between the current record and the next record is smaller than the first value, if so, executing a process of setting the end time of the current record as the end time of the next record, if so, then judging whether the time interval between the current record and the last record in the aggregated movement amount records is smaller than the first value, if so, setting the end time of the last record in the aggregated movement amount records as the end time of the current record, taking the next record as the current record, and executing a process of continuously selecting the next record from the movement amount records as the next record, otherwise, executing the process of writing the current record into the aggregated movement amount record and taking the next record as the current record; if the current record is larger than the second value, the current record is written into the aggregated movement amount record, and the next record is used as the current record;
wherein the first value is greater than or equal to the second value.
In an alternative implementation, the apparatus further comprises (not shown in fig. 6):
a backup file information saving module, configured to obtain a URL address of the backup file after the backup module 63 writes the read video segments into the backup file, determine a start time of a first record in the aggregated movement amount records as a start time of a video in the backup file, and determine an end time of a last record as an end time of a video in the backup file; generating a video time information bitmap according to the starting time and the ending time of each video; and sending the backup file information carrying the start time, the end time, the URL address and the video recording time information bitmap to the VM.
In an optional implementation manner, the backup file information saving module is specifically configured to obtain a first video segment and a first blank segment, where a difference between a start time and an end time of each video segment is smaller than a third value, in a process of generating a video recording time information bitmap according to the start time and the end time of each video segment; coding the acquired first video segment and the acquired first blank segment by adopting a fourth numerical value bit; acquiring a second video segment and a second blank segment, wherein the difference between the starting time and the ending time is greater than a third numerical value; coding the obtained second video segment and the second blank segment by adopting a fifth numerical value bit;
wherein the fourth value is less than the fifth value.
Fig. 7 is a block diagram of another embodiment of a video recording backup apparatus according to an exemplary embodiment of the present application, where the video recording backup apparatus may be applied to a VM, and as shown in fig. 7, the video recording backup apparatus includes: a setting module 71, an obtaining module 72, a judging module 73, a sending module 74, and a resetting module 75.
The setting module 71 is configured to obtain a start time and a query time length of a video to be backed up, set the query start time as the start time of the video to be backed up, and set the query end time as the sum of the query start time and the query time length;
an obtaining module 72, configured to obtain a movement amount record between the query start time and the query end time, and obtain a sum of time lengths of start-stop time periods corresponding to each record in the movement amount record;
a judging module 73, configured to judge whether the sum of the time lengths is greater than a sixth value;
a sending module 74, configured to, when the determination result is yes, use the start time of the video to be backed up as the start time of the backup task and use the end time of the last record in the movement amount record as the end time of the backup task, and send the backup task to the backup management server BM;
and a resetting module 75, configured to, when the determination result is negative, reset the query start time as the last query end time, where the query end time is the sum of the query start time and the query time length, and execute a process of obtaining a record of a movement amount between the query start time and the query end time.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (12)

1. A video backup method is applied to a backup management server (BM), and comprises the following steps:
receiving a backup task, and acquiring movement records of a specified camera in the backup task in a specified time period, wherein each record in the movement records corresponds to a start time and an end time, and each record indicates that a moving target moves in a video in the time period;
combining two adjacent records with a time interval smaller than a first value in the moving amount records into one record to obtain a moving amount record after polymerization, wherein the time interval is the difference between the ending time of the previous record and the starting time of the next record, and the combining two adjacent records into one record comprises: setting the end time of the previous record as the end time of the next record;
and reading the video of each record corresponding to the start-stop time period in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file.
2. The method of claim 1, wherein merging two adjacent records of the shift amount record having a time interval smaller than the first value into one record to obtain an aggregated shift amount record comprises:
selecting the first two records from the moving amount records, and taking the first record as the current record and the second record as the next record;
judging whether the time interval between the current record and the next record is smaller than a first numerical value or not;
if so, setting the end time of the current record as the end time of the next record;
if not, writing the current record into the aggregated movement amount record, and taking the next record as the current record;
and continuing to select the next record from the movement records as the next record, and executing the process of judging whether the time interval between the current record and the next record is smaller than a first numerical value.
3. The method of claim 2, wherein before writing the current record into the aggregated shift amount record and taking the next record as the current record, the method further comprises:
judging whether the starting and stopping time period corresponding to the current record is smaller than a second numerical value or not;
if the time interval between the current record and the next record is smaller than the first value, then judging whether the time interval between the current record and the next record is smaller than the first value, if so, executing a process of setting the end time of the current record as the end time of the next record, if so, then judging whether the time interval between the current record and the last record in the aggregated movement amount records is smaller than the first value, if so, setting the end time of the last record in the aggregated movement amount records as the end time of the current record, taking the next record as the current record, and executing a process of continuously selecting the next record from the movement amount records as the next record, otherwise, executing the process of writing the current record into the aggregated movement amount record and taking the next record as the current record;
if the current record is larger than the second value, the current record is written into the aggregated movement amount record, and the next record is used as the current record;
wherein the first value is greater than or equal to the second value.
4. The method of claim 1, wherein after writing the read video segments to the backup file, the method further comprises:
acquiring a URL address of the backup file, determining the start time of a first record in the aggregated movement records as the start time of a video in the backup file, and determining the end time of a last record as the end time of the video in the backup file;
generating a video time information bitmap according to the starting time and the ending time of each video;
and sending the backup file information carrying the start time, the end time, the URL address and the video recording time information bitmap to a video management server (VM).
5. The method of claim 4, wherein generating a video recording time information bitmap according to the start time and the end time of each video recording comprises:
acquiring a first video segment and a first blank segment, wherein the difference value between the starting time and the ending time is smaller than a third numerical value;
coding the acquired first video segment and the acquired first blank segment by adopting a fourth numerical value bit;
acquiring a second video segment and a second blank segment, wherein the difference between the starting time and the ending time is greater than a third numerical value;
coding the obtained second video segment and the second blank segment by adopting a fifth numerical value bit;
wherein the fourth value is less than the fifth value.
6. A video backup method is applied to a video management server (VM), and comprises the following steps:
acquiring the starting time and the query time length of a video to be backed up, setting the query starting time as the starting time of the video to be backed up, and setting the query ending time as the sum of the query starting time and the query time length;
acquiring movement records between the query starting time and the query ending time, and acquiring the sum of time lengths of start and stop time periods corresponding to each record in the movement records, wherein each record indicates that a moving target moves in the video of the time period;
judging whether the sum of the time lengths is larger than a sixth numerical value or not;
if so, taking the starting time of the video to be backed up as the starting time of a backup task and the ending time of the last record in the movement amount record as the ending time of the backup task, and sending the backup task to a backup management server BM;
otherwise, resetting the query starting time as the last query ending time, wherein the query ending time is the sum of the query starting time and the query time length, and executing the process of obtaining the moving amount record between the query starting time and the query ending time.
7. A video backup device is applied to a backup management server (BM), and comprises:
the system comprises an acquisition module, a processing module and a processing module, wherein the acquisition module is used for receiving a backup task and acquiring movement records of a specified camera in the backup task in a specified time period, and each record in the movement records corresponds to a start time and an end time;
the aggregation module is configured to combine two adjacent records in the movement amount record, of which the interval time is smaller than a first value, into one record to obtain a movement amount record after aggregation, where the interval time is a difference between an end time of a previous record and a start time of a subsequent record, and the combining of the two adjacent records into one record includes: setting the end time of the previous record as the end time of the next record;
and the backup module is used for reading the video of the start-stop time period corresponding to each record in the aggregated movement amount records, creating a backup file in backup IPSAN equipment, and writing the read video of each segment into the backup file.
8. The apparatus according to claim 7, wherein the aggregation module is specifically configured to select the first two records from the moving amount records, and use the first record as a current record and the second record as a next record; judging whether the time interval between the current record and the next record is smaller than a first numerical value or not; if so, setting the end time of the current record as the end time of the next record; if not, writing the current record into the aggregated movement amount record, and taking the next record as the current record; and continuing to select the next record from the movement records as the next record, and executing the process of judging whether the time interval between the current record and the next record is smaller than a first numerical value.
9. The apparatus of claim 8, further comprising:
the expansion module is used for judging whether the corresponding start-stop time period of the current record is smaller than a second numerical value or not before the current record is written into the aggregated movement amount record by the aggregation module and the next record is taken as the current record; if the time interval between the current record and the next record is smaller than the first value, then judging whether the time interval between the current record and the next record is smaller than the first value, if so, executing a process of setting the end time of the current record as the end time of the next record, if so, then judging whether the time interval between the current record and the last record in the aggregated movement amount records is smaller than the first value, if so, setting the end time of the last record in the aggregated movement amount records as the end time of the current record, taking the next record as the current record, and executing a process of continuously selecting the next record from the movement amount records as the next record, otherwise, executing the process of writing the current record into the aggregated movement amount record and taking the next record as the current record; if the current record is larger than the second value, the current record is written into the aggregated movement amount record, and the next record is used as the current record;
wherein the first value is greater than or equal to the second value.
10. The apparatus of claim 7, further comprising:
a backup file information saving module, configured to obtain a URL address of the backup file after the backup module writes the read video segments into the backup file, determine a start time of a first record in the aggregated movement amount records as a start time of a video in the backup file, and determine an end time of a last record as an end time of a video in the backup file; generating a video time information bitmap according to the starting time and the ending time of each video; and sending the backup file information carrying the start time, the end time, the URL address and the video recording time information bitmap to a video management server (VM).
11. The apparatus of claim 10,
the backup file information saving module: the method is specifically used for acquiring a first video segment and a first blank segment, of which the difference value between the start time and the end time is smaller than a third numerical value, in the process of generating a video time information bitmap according to the start time and the end time of each segment of video; coding the acquired first video segment and the acquired first blank segment by adopting a fourth numerical value bit; acquiring a second video segment and a second blank segment, wherein the difference between the starting time and the ending time is greater than a third numerical value; coding the obtained second video segment and the second blank segment by adopting a fifth numerical value bit;
wherein the fourth value is less than the fifth value.
12. A video backup device, which is applied to a video management server (VM), the device comprising:
the device comprises a setting module, a searching module and a judging module, wherein the setting module is used for acquiring the starting time and the searching time length of a video to be backed up, setting the searching starting time as the starting time of the video to be backed up, and setting the searching ending time as the sum of the searching starting time and the searching time length;
the acquisition module is used for acquiring the movement records from the query starting time to the query ending time and acquiring the sum of the time lengths of the starting time period and the ending time period corresponding to each record in the movement records;
the judging module is used for judging whether the sum of the time lengths is larger than a sixth numerical value or not;
the sending module is used for taking the starting time of the video to be backed up as the starting time of a backup task and taking the ending time of the last record in the movement amount record as the ending time of the backup task when the judgment result is yes, and sending the backup task to a backup management server (BM);
and the resetting module is used for resetting the query starting time as the last query ending time when the judgment result is negative, setting the query ending time as the sum of the query starting time and the query time length, and executing the process of obtaining the moving amount record between the query starting time and the query ending time.
CN201710184742.8A 2017-03-24 2017-03-24 Video backup method and device Active CN106998436B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710184742.8A CN106998436B (en) 2017-03-24 2017-03-24 Video backup method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710184742.8A CN106998436B (en) 2017-03-24 2017-03-24 Video backup method and device

Publications (2)

Publication Number Publication Date
CN106998436A CN106998436A (en) 2017-08-01
CN106998436B true CN106998436B (en) 2020-09-01

Family

ID=59431467

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710184742.8A Active CN106998436B (en) 2017-03-24 2017-03-24 Video backup method and device

Country Status (1)

Country Link
CN (1) CN106998436B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109558270B (en) * 2017-09-25 2021-02-05 北京国双科技有限公司 Data backup method and device and data restoration method and device
CN109951662B (en) * 2017-12-20 2022-06-14 浙江宇视科技有限公司 Video backup method and system

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007028320A (en) * 2005-07-19 2007-02-01 Mitsubishi Electric Engineering Co Ltd Video recording and monitoring system
CN101356808A (en) * 2006-09-13 2009-01-28 索尼株式会社 Data processing device, data processing method, and computer program
CN102447589A (en) * 2010-09-30 2012-05-09 杭州华三通信技术有限公司 Method and device for aggregating records
CN102915346A (en) * 2012-09-26 2013-02-06 中国科学院软件研究所 Data index building and query method for Internet of Things intellisense
CN104639860A (en) * 2014-12-31 2015-05-20 安科智慧城市技术(中国)有限公司 Storage method and device of supervision video
CN104702872A (en) * 2014-02-12 2015-06-10 杭州海康威视数字技术股份有限公司 Method and device for duplicating video files
CN105763613A (en) * 2016-03-17 2016-07-13 浙江宇视科技有限公司 Monitoring object and monitoring video associated backup method and device
CN106021026A (en) * 2016-05-23 2016-10-12 浙江宇视科技有限公司 Backup method and device
CN106033324A (en) * 2015-03-09 2016-10-19 杭州海康威视数字技术股份有限公司 Data storage method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201004339A (en) * 2008-07-09 2010-01-16 Univ Nat Taiwan Method and system for processing synthetic graphic images on digital video file

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007028320A (en) * 2005-07-19 2007-02-01 Mitsubishi Electric Engineering Co Ltd Video recording and monitoring system
CN101356808A (en) * 2006-09-13 2009-01-28 索尼株式会社 Data processing device, data processing method, and computer program
CN102447589A (en) * 2010-09-30 2012-05-09 杭州华三通信技术有限公司 Method and device for aggregating records
CN102915346A (en) * 2012-09-26 2013-02-06 中国科学院软件研究所 Data index building and query method for Internet of Things intellisense
CN104702872A (en) * 2014-02-12 2015-06-10 杭州海康威视数字技术股份有限公司 Method and device for duplicating video files
CN104639860A (en) * 2014-12-31 2015-05-20 安科智慧城市技术(中国)有限公司 Storage method and device of supervision video
CN106033324A (en) * 2015-03-09 2016-10-19 杭州海康威视数字技术股份有限公司 Data storage method and device
CN105763613A (en) * 2016-03-17 2016-07-13 浙江宇视科技有限公司 Monitoring object and monitoring video associated backup method and device
CN106021026A (en) * 2016-05-23 2016-10-12 浙江宇视科技有限公司 Backup method and device

Also Published As

Publication number Publication date
CN106998436A (en) 2017-08-01

Similar Documents

Publication Publication Date Title
EP3138241A2 (en) Systems, devices and methods for generating locality-indicative data representations of data streams, and compressions thereof
CN105824846B (en) Data migration method and device
CN111309720A (en) Time sequence data storage method, time sequence data reading method, time sequence data storage device, time sequence data reading device, electronic equipment and storage medium
CN106033324B (en) Data storage method and device
CN102291256B (en) A kind of querying method of monitor data and equipment
CN106599292B (en) Method and system for storing real-time video data and image data
CN112019788B (en) Data storage method, device, system and storage medium
US20190087437A1 (en) Scheduling database compaction in ip drives
CN112311902B (en) File sending method and device based on micro-service
US20160313937A1 (en) Data Access Method and Apparatus
WO2021068891A1 (en) Method, system, electronic device, and storage medium for storing and collecting temperature data
CN110389715B (en) Data storage method, storage server and cloud storage system
CN104301671A (en) Traffic monitoring video storing method in HDFS based on event intensity
CN106998436B (en) Video backup method and device
CN104079600A (en) File storage method, file storage device, file access client and metadata server system
US11012696B2 (en) Reducing an amount of storage used to store surveillance videos
CN109597566B (en) Data reading and storing method and device
US20160037119A1 (en) Video recording apparatus, and video recording method when temporary network failure occurs
CN107665224B (en) Method, system and device for scanning HDFS cold data
CN105574008A (en) Task scheduling method and equipment applied to distributed file system
JP2018511131A (en) Hierarchical cost-based caching for online media
CN114153395B (en) Object storage data life cycle management method, device and equipment
US20150088826A1 (en) Enhanced Performance for Data Duplication
CN111625502B (en) Data reading method and device, storage medium and electronic device
CN113190384A (en) Data recovery control method, device, equipment and medium based on erasure codes

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant