CN107145450B - Video monitoring data storage method and device - Google Patents

Video monitoring data storage method and device Download PDF

Info

Publication number
CN107145450B
CN107145450B CN201710183508.3A CN201710183508A CN107145450B CN 107145450 B CN107145450 B CN 107145450B CN 201710183508 A CN201710183508 A CN 201710183508A CN 107145450 B CN107145450 B CN 107145450B
Authority
CN
China
Prior art keywords
video monitoring
monitoring data
flash memory
memory block
path
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
CN201710183508.3A
Other languages
Chinese (zh)
Other versions
CN107145450A (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.)
Shenzhen Longsys Electronics Co Ltd
Original Assignee
Shenzhen Longsys Electronics 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 Shenzhen Longsys Electronics Co Ltd filed Critical Shenzhen Longsys Electronics Co Ltd
Priority to CN201710183508.3A priority Critical patent/CN107145450B/en
Publication of CN107145450A publication Critical patent/CN107145450A/en
Priority to PCT/CN2017/115710 priority patent/WO2018171266A1/en
Application granted granted Critical
Publication of CN107145450B publication Critical patent/CN107145450B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0253Garbage collection, i.e. reclamation of unreferenced memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0646Horizontal data movement in storage systems, i.e. moving data in between storage devices or systems
    • G06F3/0652Erasing, e.g. deleting, data cleaning, moving of data to a wastebasket
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Closed-Circuit Television Systems (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The invention relates to a video monitoring data storage method and a video monitoring data storage device, which are used for receiving a path of video monitoring data, storing the video monitoring data into a specified flash memory block and recording the storage times of the path of video monitoring data. When the storage frequency of the video monitoring data reaches a first threshold value, a corresponding flash memory block is allocated to the video monitoring data, and then the video monitoring data is received again, and the video monitoring data is directly stored in the allocated flash memory block. Because the corresponding flash memory block only stores one path of video monitoring data, if all the paths of video monitoring data stored in the corresponding flash memory block become invalid data, the flash memory block can be erased integrally, video monitoring data files of other paths cannot be influenced, the situation that the valid files of other paths are moved back to an internal memory is avoided, the recovery efficiency of a storage space is improved, and the loss of the flash memory block is reduced.

Description

Video monitoring data storage method and device
Technical Field
The invention relates to the technical field of video monitoring, in particular to a method and a device for storing video monitoring data.
Background
Our daily life is basically not away from the video monitoring system. The video monitoring system can be divided into one or more paths of monitoring according to the number of monitoring paths, namely monitoring one or more scenes. The multiple paths of monitoring correspond to the multiple video files, and the video files monitored in different paths are stored in the memory through the same interface.
In a video surveillance system, a flash memory (flash) is often used as a memory. Flash memory is made up of a plurality of flash blocks, each containing a plurality of pages. In the conventional method, each path of video file is sequentially written into the same flash memory block according to the writing sequence of data, namely more than one path of video file stored in the same flash memory block. Because the storage space of the flash memory is limited, the storage space allocated to each path of video file is limited, and the video data code streams of the paths are different, and the monitoring video of a path with large code stream consumes the storage space faster, which leads to that the storable space of the path of video file is used up before the storable space of other paths of video files. At this time, the invalid data of the video in the flash memory block needs to be deleted to obtain free space for storing the latest file of the video.
However, flash erasing is performed in units of blocks, and deleting a monitored expired video file requires erasing all blocks where the expired video file is located. However, when more than one path of video files stored in the flash memory block is a dirty page (a page whose stored data is expired) occupied by a monitored video file in one path of the flash memory block, pages occupied by other paths of monitored video files in the flash memory block may still be valid pages (pages whose stored data is not expired). Before erasing the block where the expired video file is located, moving valid page data except dirty pages on the blocks to a memory of the monitoring device, then performing an overall erasing operation on the flash memory blocks, and finally moving the valid page data moved to the memory back to the corresponding page position of the block where the valid page data is located. The traditional method has extremely low recovery efficiency of storage space, effective pages need to be copied before erasing flash memory blocks, and the erasing frequency of the flash memory is limited, so the flash memory blocks have larger loss.
In the conventional method, a video monitoring system has 4 paths of monitoring, which are respectively a path a, a path B, a path C and a path D. The 4-way monitoring respectively corresponds to the 4 video files. Every certain time, 4 paths of video files are stored in the flash memory in sequence. In a first time period, the 4-way video files may be named as a1, B1, C1, D1, respectively, in a second time period, the 4-way video files may be named as a2, B2, C2, D2, respectively, and so on. Due to the adoption of a time division multiplexing mode, the storage of each time period is sequentially stored into the pages of the flash memory block according to the sequence from the A way to the D way. And the total storage space of the flash memory is limited, and the storage space allocated to the 4 paths of video files is also limited. Assuming that the code stream of the path A is maximum, the path A consumes the storage space faster than other 3 paths of video files. When the storage space allocated to the path a is used up, the outdated path a video needs to be deleted to obtain the space for storing the path a video in the latest time period, and if the invalid data a5, A6, a7 and A8 needs to be deleted, it is necessary to move the pages occupied by the path B, the path C and the path D in the blocks to the memory before erasing the blocks in which the paths a5, A6, a7 and A8 are located, then erase the flash memory blocks in which the paths a5, A6, a7 and A8 are located, and finally move the valid page data of the paths B, C and D in the memory back to the corresponding page positions of the flash memory blocks in which the paths B, C and D are located before. Therefore, the efficiency of recovering the storage space is extremely low, and the loss of the flash memory block caused by repeated erasing and writing is also large.
Disclosure of Invention
In view of the foregoing, it is desirable to provide a video surveillance data storage method and apparatus capable of improving the storage space recovery efficiency and reducing the flash block loss.
A video surveillance data storage method, the method comprising:
receiving a path of video monitoring data, storing the video monitoring data into a designated flash memory block, and recording the storage times of the path of video monitoring data;
when the storage frequency of the video monitoring data reaches a first threshold value, distributing corresponding flash memory blocks for the video monitoring data;
and then, directly storing the path of video monitoring data into the allocated flash memory block after receiving the path of video monitoring data again.
A video surveillance data storage apparatus, the apparatus comprising:
the recording module is used for receiving one path of video monitoring data, storing the video monitoring data into a specified flash memory block, and recording the storage times of the path of video monitoring data;
a flash memory block allocation module, configured to allocate a corresponding flash memory block for the channel of video monitoring data when the number of times of storing the channel of video monitoring data reaches a first threshold,
and the storage module is used for directly storing the video monitoring data to the allocated flash memory blocks after the corresponding flash memory blocks are allocated to the video monitoring data.
The video monitoring data storage method and the device receive a path of video monitoring data, store the video monitoring data into the designated flash memory block, and record the storage times of the path of video monitoring data. When the storage frequency of the video monitoring data reaches a first threshold value, a corresponding flash memory block is allocated to the video monitoring data, and then the video monitoring data is received again, and the video monitoring data is directly stored in the allocated flash memory block. And allocating corresponding flash memory blocks to certain path of video monitoring data with the storage frequency exceeding a first threshold value in the specified flash memory blocks, wherein the corresponding flash memory blocks are only used for storing the certain path of video monitoring data. Because the corresponding flash memory block only stores one path of video monitoring data, if all the paths of video monitoring data stored in the corresponding flash memory block become invalid data, the flash memory block can be erased integrally, and video monitoring data files of other paths cannot be influenced. The whole flash memory block can be recovered by erasing each time, so that the recovery efficiency of the storage space is improved, and only one path of data is stored in one flash memory block, so that when the data of the path in the flash memory block is invalid, the whole flash memory block can be erased integrally, the valid files of other paths are prevented from being moved to the memory and then moved back, and the loss of the flash memory block is reduced.
Drawings
FIG. 1 is a diagram of an exemplary environment in which a method for storing surveillance video data may be implemented;
FIG. 2 is a flow diagram of a method for storing surveillance video data in accordance with one embodiment;
FIG. 3 is a flow diagram of a method for storing surveillance video data in accordance with one embodiment;
FIG. 4 is a flow diagram of a method for storing surveillance video data in accordance with one embodiment;
FIG. 5 is a flow diagram of a method for storing surveillance video data in accordance with one embodiment;
FIG. 6 is a flow diagram of a method for storing surveillance video data in accordance with one embodiment;
FIG. 7 is a schematic diagram of a video surveillance data storage method for the previous 3 receptions in one embodiment;
FIG. 8 is a schematic diagram of a method for storing video surveillance data received more than 3 times later in one embodiment;
FIG. 9 is a schematic diagram of a monitor video data storage device according to an embodiment;
FIG. 10 is a schematic diagram of a monitor video data storage device according to an embodiment;
FIG. 11 is a schematic diagram of a monitor video data storage device according to an embodiment;
FIG. 12 is a schematic diagram of a monitor video data storage device according to an embodiment;
fig. 13 is a schematic structural diagram of a monitoring video data storage device according to an embodiment.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present invention comprehensible, embodiments accompanied with figures are described in detail below. In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present invention. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, but rather should be construed as broadly as the present invention is capable of modification in various respects, all without departing from the spirit and scope of the present invention.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. The terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The video monitoring data storage method provided by the embodiment of the invention can be applied to the environment shown in FIG. 1. Referring to fig. 1, an image pickup apparatus 102 is connected to a storage apparatus 104, a Central Processing Unit (CPU) is included in the image pickup apparatus 102, and it is possible to realize that the image pickup apparatus 102 directly transmits video monitoring data to the storage apparatus 104, and the storage apparatus 104 receives and stores the video monitoring data.
In one embodiment, as shown in fig. 2, there is provided a video surveillance data storage method, including:
step 210, receiving a path of video monitoring data, storing the video monitoring data into a designated flash memory block, and recording the storage times of the path of video monitoring data.
A video monitoring system is composed of five parts of camera shooting, transmission, control, display and record registration. In this embodiment, the video monitoring system may be divided into one or more monitoring paths according to the number of monitoring paths, that is, monitoring one or more scenes. In a video surveillance system, a flash memory (flash) is often used as a storage device.
The camera shooting device transmits the video monitoring data to the storage device and finally stores the video monitoring data in the storage device. The FTL (Flash Translation Layer) is a Translation Layer between a Flash memory chip and a file system, and enables an operating system and the file system to access a Flash memory device like a hard disk for access. The FTL functions to write data to a flash memory timely and effectively, and can manage all written data effectively, and when data needs to be read from a storage device, the FTL must accurately calculate a flash memory address of the data to be read so as to obtain the data accurately.
The FTL receives multiple paths of video monitoring data transmitted by the image pickup apparatus, and transmits not only the data but also the write address and data length of the data (not necessarily).
The flash memory is divided into a common flash memory block and a special flash memory block in advance, and the designated flash memory block is the common flash memory block. The common flash memory block can receive each path of video monitoring data, and the special flash memory block is used for distributing corresponding video monitoring data.
The FTL receives a path of video monitoring data, stores the received path of video monitoring data into a designated flash memory block, namely a common flash memory block, and records the storage times of the path of video monitoring data in the common flash memory block.
Step 220, when the storage frequency of the path of video monitoring data reaches a first threshold value, allocating a corresponding flash memory block for the path of video monitoring data.
And when the storage frequency of the video monitoring data in the common flash memory block reaches a first threshold value, the FTL allocates a special flash memory block for the video monitoring data. The first threshold value may be set according to actual conditions. One dedicated flash block may be allocated at a time, or one dedicated flash block group may be allocated at a time, and the dedicated flash block group includes a plurality of dedicated flash blocks.
In step 230, after the corresponding flash memory block is allocated to the channel of video monitoring data, the channel of video monitoring data is received again, and then the channel of video monitoring data is directly stored in the allocated flash memory block.
After the FTL allocates the dedicated flash memory block for the path of video monitoring data, the FTL directly stores the path of video monitoring data into the dedicated flash memory block upon receiving the path of video monitoring data again.
In this embodiment, the FTL allocates a dedicated flash memory block to a certain path of video monitoring data whose storage frequency in the common flash memory block exceeds the first threshold, where the dedicated flash memory block is only used to store the certain path of video monitoring data. Because the special flash memory block only stores one path of video monitoring data, if all the video monitoring data stored in the special flash memory block become invalid data, the flash memory block can be erased integrally, and the video monitoring data files of other paths cannot be influenced. According to the method for managing the flash memory blocks in the FTL mode, one flash memory block can be erased integrally every time so as to recycle one complete flash memory block, therefore, the recycling efficiency of the storage space is improved, effective files of other paths in the flash memory block do not need to be moved back to the memory, repeated erasing is avoided, and the loss of the flash memory block is greatly reduced.
In one embodiment, as shown in fig. 3, a video surveillance data storage method further includes:
in step 240, when the storage space of the allocated flash memory block is full, the allocated flash memory block which is full and is all invalid data is erased in one block for next reallocation.
And when the storage space of the allocated special flash memory block is full, erasing the full special flash memory block which is full and is all invalid data in a whole block. For example, if the storage life of the video monitoring data is set to be one month, the video monitoring data with the storage time exceeding one month becomes invalid data, and the dedicated flash memory blocks which are full and the storage time of the video monitoring data is all more than one month are erased integrally to become free blocks for storing the latest video file.
And step 250, receiving the path of video monitoring data, storing the path of video monitoring data into a specified flash memory block, and recording the storage times of the path of video monitoring data.
And receiving the video monitoring data, storing the video monitoring data into the common flash memory block again by the FTL, and recording the storage times of the video monitoring data in the common flash memory block from the FTL.
And step 260, when the storage frequency of the path of video monitoring data reaches the first threshold value, reallocating the corresponding flash memory block for the path of video monitoring data again.
And when the frequency of storing the video monitoring data in the common flash memory block reaches the first threshold value again, the FTL reallocates the empty special flash memory block for the video monitoring data.
Step 270, after receiving the path of video monitoring data again, directly storing the path of video monitoring data into the reallocated flash memory blocks.
After the empty special flash memory block is redistributed to the path of video monitoring data, when the same path of video monitoring data is received again, the video monitoring data is directly stored into the redistributed special flash memory block.
In this embodiment, when the dedicated flash memory block or the dedicated flash memory block group allocated by the FTL for a path of video monitoring data for the first time is used up, the dedicated flash memory blocks which are full and all are invalid data are erased in one block, so that the dedicated flash memory blocks become free blocks for storing the latest video file. And when the video monitoring data is received again, storing the video monitoring data in the common flash memory block again, and recording the storage times of the video monitoring data in the common flash memory block. When the number of times of storage in the normal flash memory block exceeds the first threshold value again, a new dedicated flash memory block is newly allocated to the channel of video monitoring data, and the channel of video monitoring data received later is stored in the newly allocated dedicated flash memory block.
Because the special flash memory block is distributed to one path of video monitoring data, when the distributed special flash memory block is full, the special flash memory block which is full and is all invalid data can be erased in one block, so that the special flash memory block becomes an empty special flash memory block for storing new video monitoring data. Therefore, the recovery efficiency of the storage space is improved, and the loss of the flash memory blocks is small. In a conventional method, when a page occupied by storage of a certain path of monitored video files in a flash memory block becomes a dirty page (a page whose stored data is expired), a page occupied by other paths of monitored video files in the flash memory block may still be a valid page (a page whose stored data is unexpired). Before erasing the block where the expired video file is located, moving valid page data except dirty pages on the blocks to a memory of the monitoring device, then performing an overall erasing operation on the flash memory blocks, and finally moving the valid page data moved to the memory back to the corresponding page position of the block where the valid page data is located. The traditional method has extremely low recovery efficiency of storage space, and the effective page needs to be copied before the flash memory block is erased, so that the flash memory block has high loss.
In one embodiment, as shown in fig. 4, there is provided a video surveillance data storage method, including:
step 410, receiving multiple paths of video monitoring data.
When a plurality of scenes need to be monitored simultaneously, the method can be realized by utilizing a multi-channel video monitoring system. The multi-channel video monitoring system comprises a plurality of camera devices. The camera shooting device transmits the video monitoring data to the storage device and finally stores the video monitoring data in the storage device.
The FTL (Flash Translation Layer) is a Translation Layer between a Flash memory chip and a file system, and enables an operating system and the file system to access a Flash memory device like a hard disk for access. The FTL functions to write data to the flash memory timely and effectively, and can manage all written data effectively, and when data needs to be read from the storage device, the FTL must accurately calculate the flash memory address of the data to be read so as to obtain the data accurately.
The FTL receives multiple paths of video monitoring data transmitted by the image pickup apparatus, and transmits not only the data but also the write address and data length of the data (not necessarily).
Step 420, storing the video monitoring data into the designated flash memory block, and recording the storage times of each path of video monitoring data.
The FTL divides the flash memory into a normal flash memory block and a dedicated flash memory block in advance, and the designated flash memory block is the normal flash memory block. The common flash memory block can receive each path of video monitoring data, and the special flash memory block is used for distributing corresponding video monitoring data. The received multiple paths of video monitoring data are stored in a common flash memory block, and the times of storing each path of video monitoring data in the common flash memory block are recorded. Each path of video file is written into the same common flash memory block in sequence according to the writing sequence of the data, namely more than one path of video file stored in the same common flash memory block.
Step 430, when the storage frequency of one of the paths of video monitoring data reaches a first threshold, allocating a corresponding flash memory block for the path of video monitoring data.
When the storage frequency of a certain path of video monitoring data in the common flash memory block reaches a first threshold value, the FTL allocates a special flash memory block for the path of video monitoring data. The first threshold value may be set according to actual conditions. One dedicated flash block may be allocated at a time, or one dedicated flash block group may be allocated at a time, and the dedicated flash block group includes a plurality of dedicated flash blocks.
Step 440, after allocating the corresponding flash memory block to the channel of video monitoring data, when the received video monitoring data is determined to be the channel of video monitoring data, acquiring the video monitoring data.
After allocating a special flash memory block for the path of video monitoring data, the FTL determines the video monitoring data received each time, determines whether the video monitoring data is the path of video monitoring data, and if the determination result is yes, acquires the video monitoring data received this time. The specific judging steps are as follows: comparing the address of the video monitoring data received each time with the address of the video monitoring data stored last time to generate a comparison result, and if the comparison result is that the addresses are continuous, indicating that the video monitoring data received this time is the video monitoring data of the path, so that the video monitoring data received this time is obtained, and the video monitoring data received this time is stored in the corresponding special flash memory block.
Based on the same judgment method, when the data received again is judged to be the video monitoring data, the video monitoring data is directly stored into the special flash memory block.
And step 450, directly storing the video monitoring data into the corresponding flash memory block allocated to the path of video monitoring data.
And directly storing the video monitoring data acquired this time into a special flash memory block corresponding to the video monitoring data belonging to a certain path.
In this embodiment, in the multi-channel video monitoring system, the FTL receives the multi-channel video monitoring data, stores the received multi-channel video monitoring data in the normal flash memory block, and records the number of times that each channel of video monitoring data is stored in the normal flash memory block. When the storage frequency of a certain path of video monitoring data in the common flash memory block reaches a first threshold value, the FTL allocates a special flash memory block for the path of video monitoring data. And when the received video monitoring data is judged to be the video monitoring data, acquiring the video monitoring data, and directly storing the video monitoring data into the corresponding flash memory blocks distributed for the video monitoring data. The method for managing the flash memory block by the FTL mode allocates the corresponding special flash memory block for each path of video monitoring data which is stored in the common flash memory block for a time exceeding a first threshold value, thereby separately storing each path of data in different special flash memory blocks. When the code stream of a certain path of monitoring video is large, the special flash memory block or the special flash memory block group allocated to the path of video monitoring data is exhausted first, and when all files stored in a certain special flash memory block are invalid data, the whole flash memory block can be directly erased, and an empty flash memory block can be vacated for reallocation. Therefore, the recovery efficiency of the storage space is high, repeated erasing and writing are avoided, and the service life of the flash memory block is prolonged.
In a conventional method, when a page occupied by storage of a certain path of monitored video files in a flash memory block becomes a dirty page (a page whose stored data is expired), a page occupied by other paths of monitored video files in the flash memory block may still be a valid page (a page whose stored data is unexpired). Before erasing the block where the expired video file is located, moving valid page data except dirty pages on the blocks to a memory of the monitoring device, then performing an overall erasing operation on the flash memory blocks, and finally moving the valid page data moved to the memory back to the corresponding page position of the block where the valid page data is located. The traditional method has extremely low recovery efficiency of storage space, effective pages need to be copied before erasing flash memory blocks, the erasing frequency of the flash memory is limited, and the flash memory blocks are worn more by repeated erasing.
In one embodiment, as shown in fig. 5, a video surveillance data storage method further includes:
step 460, receiving multiple paths of video monitoring data, and recording the times of not receiving the path of video monitoring data continuously.
After the FTL has allocated the dedicated flash memory block to the received multiple paths of video monitoring data and each path of video monitoring data is stored in the corresponding dedicated flash memory block, it needs to record the receiving condition of each path of video monitoring data. Specifically, the number of times that a certain path of video monitoring data is not received continuously is counted, for example, when a total of A, B, C, D4 paths of video monitoring data is A, B, C, D, the received time is AACDDAADDCCD, and thus there are 12 times that B paths of video monitoring data are not received continuously.
Step 470, if the number of times of continuously not receiving the way of video monitoring data reaches the second threshold, releasing the right of the way of video monitoring data to the allocated flash memory block.
And the FTL counts the times of continuously not receiving a certain path of video monitoring data, and if the times of continuously not receiving a certain path of video monitoring data reach a second threshold value, the FTL releases the right of the path of video monitoring data to the allocated special flash memory block, namely the special flash memory block is no longer exclusive to the path of video monitoring data and can be allocated to other paths of video monitoring data for storage and use.
In this embodiment, the FTL records the receiving condition of each path of video monitoring data to which the dedicated flash memory block has been allocated, and if the number of times that a path of video monitoring data is not received continuously reaches a second threshold, releases the ownership of the dedicated flash memory block allocated by the path of video monitoring data, so that the dedicated flash memory block can be allocated to other paths of video monitoring data for storage and use. Instead of allocating a dedicated flash block to a certain path of video surveillance data, the dedicated flash block is occupied by the path of video surveillance data all the time. Therefore, a certain special flash memory block is not occupied, but no data is written, and the whole special flash memory block is wasted, so that each special flash memory block is fully used, and the storage efficiency is improved.
In one embodiment, as shown in fig. 6, a video surveillance data storage method further includes:
step 610, when the address of the video monitoring data received this time is not continuous with the address of each path of video monitoring data received last time, storing the video monitoring data received this time into a specified flash memory block, and recording the storage times of the path of video monitoring data.
The file system allocates a segment of address for each path of video monitoring data, for example, a total of 4 paths of video monitoring data, the file system allocates an address for the first time to the a path of 0x10000-1 fffffff, allocates an address for the B path of 0x20000-2FFFFF, allocates an address for the C path of 0x30000-3 fffffff, and allocates an address for the D path of 0x40000-4FFFFF, and when the address allocated for the a path of 0x10000-1 fffffff is used up and the other paths are not used up, the file system reallocates an address for the a path of, for example, the address of 0x50000-5 FFFFF. When the address of the received video monitoring data of the A path jumps from 0x1FFFFF to 0x50000, the video monitoring data received this time is stored in the common flash memory block, and the storage times of the video monitoring data of the A path are recorded. And releasing the occupation right of the video monitoring data of the last section of address to the special flash memory block so that the special flash memory block can be used by other ways.
Step 620, when the storage frequency of the path of video monitoring data reaches a first threshold value, allocating a corresponding flash memory block for the path of video monitoring data.
And when the storage frequency of the video monitoring data in the common flash memory block reaches a first threshold value, allocating a special flash memory block for the video monitoring data. The first threshold value may be set according to actual conditions. One dedicated flash block may be allocated at a time, or one dedicated flash block group may be allocated at a time, and the dedicated flash block group includes a plurality of dedicated flash blocks.
Step 630, comparing the address of the video monitoring data received each time with the address of the video monitoring data stored last time, and generating a comparison result.
And step 640, acquiring the video monitoring data with continuous addresses as a comparison result, wherein the video monitoring data is the video monitoring data of the path.
And step 650, directly storing the path of video monitoring data into the allocated flash memory block.
After distributing a special flash memory block for the path of video monitoring data, comparing the address of the video monitoring data received each time with the address of the path of video monitoring data stored last time to generate a comparison result, if the comparison result is that the addresses are continuous, indicating that the video monitoring data received this time is the path of video monitoring data, so that the video monitoring data received this time is obtained, and the video monitoring data received this time is stored in the corresponding special flash memory block.
In this embodiment, when the address of the video monitoring data of a certain path is not continuous, the right occupied by the video monitoring data of the previous path to the dedicated flash memory block is released, the received video monitoring data of the path is stored into the common flash memory block again, the storage times are counted, and a new dedicated flash memory block is reallocated when the first threshold is exceeded. Therefore, the problem that when the addresses of the received video monitoring data are not continuous, the video monitoring data with discontinuous addresses cannot be identified and stored in the corresponding special flash memory blocks is solved.
In one embodiment, a surveillance video data storage method is provided, which is illustrated as being applied in an environment such as that shown in FIG. 1.
Assuming that A, B, C, D4 paths of video monitoring data are shared, the file system allocates addresses to the paths of video monitoring data respectively, the address allocated to the path A is 0x10000-1 FFFFFFF, the address allocated to the path B is 0x20000-2FFFFF, the address allocated to the path C is 0x30000-3FFFFF, and the address allocated to the path D is 0x40000-4 FFFFF. The data length of the path A video monitoring data is 200, the data length of the path B video monitoring data is 100, the data length of the path C video monitoring data is 200, and the data length of the path D video monitoring data is 100. Suppose that 4 paths of video monitoring data are received in sequence, and the first writing of the 4 paths of video monitoring data is as follows:
Figure DEST_PATH_GDA0001328318810000111
Figure DEST_PATH_GDA0001328318810000121
the second write case is shown in the following table:
group of Ending address Number of writes Write count
A 0x10 0400 2 5
B 0x20 0200 2 6
C 0x30 0400 2 7
D 0x40 0200 2 8
The third write case is shown in the following table:
group of Ending address Number of writes Write count
A 0x10 0600 3 9
B 0x20 0300 3 10
C 0x30 0600 3 11
D 0x40 0300 3 12
The writing times are defined as the times of storing the data of the path, and the writing count is the total times of receiving 4 paths of data by the storage device.
Referring to fig. 7, the video surveillance data of each channel received in the previous 3 times are sequentially stored in a common flash memory block, and if the first threshold is 3, after the video surveillance data of each channel is written in the 3 rd time, the FTL allocates a dedicated flash memory block for the video surveillance data of the channel.
Referring to fig. 8, the FTL allocates a dedicated flash memory block 1 to the video monitoring data in the a channel, a dedicated flash memory block 2 to the video monitoring data in the B channel, a dedicated flash memory block 3 to the video monitoring data in the C channel, and a dedicated flash memory block 4 to the video monitoring data in the D channel. After the FTL allocates a dedicated flash memory block to the path of video monitoring data, the address of the video monitoring data received each time is compared with the address of each path of video monitoring data stored last time, a comparison result is generated, and the comparison result is continuous with the address stored last time of the path of video monitoring data, so that it is indicated that the video monitoring data received this time is the path of video monitoring data, and therefore the video monitoring data received this time is obtained, and the video monitoring data received this time is stored in the dedicated flash memory block corresponding to the path. A4 indicates that the 4 th received video surveillance data for a way, and so on. Since the number of times data is stored in the normal flash block has exceeded the first threshold 3, a4, a5, a6, a7 are stored in the allocated dedicated flash block 1, B4, B5, B6, B7 are stored in the allocated dedicated flash block 2, C4, C5, C6, C7 are stored in the allocated dedicated flash block 3, and D4, D5, D6, D7 are stored in the allocated dedicated flash block 4.
The code stream of the path A is large, so that the storage block is consumed quickly, when the storage space allocated to the path A special flash memory block 1 by the FTL is used up and the path A video monitoring data stored in the special flash memory block 1 become invalid data, the special flash memory block 1 is directly erased integrally to obtain an empty special flash memory block for reallocation.
According to the method for managing the flash memory blocks in the FTL mode, one flash memory block can be erased integrally every time so as to recycle one complete flash memory block, therefore, the recycling efficiency of the storage space is improved, effective files of other paths in the flash memory block do not need to be moved back to the memory, repeated erasing is avoided, and the loss of the flash memory block is greatly reduced.
In one embodiment, as shown in fig. 9, there is also provided a surveillance video data storage apparatus, including: a recording module 910, a flash block allocation module 920, and a storage module 930.
The recording module 910 is configured to receive a path of video monitoring data, store the video monitoring data in an assigned flash memory block, and record the storage frequency of the path of video monitoring data.
And a flash memory block allocation module 920, configured to allocate a corresponding flash memory block for the way of video monitoring data when the number of times that the way of video monitoring data is stored reaches a first threshold.
The storage module 930 is configured to, after allocating the corresponding flash memory block for the channel of video monitoring data, directly store the channel of video monitoring data into the allocated flash memory block when receiving the channel of video monitoring data again.
In one embodiment, as shown in fig. 10, the apparatus further comprises: an erase module 940, a record module 910, a flash block allocation module 920, and a storage module 930.
The erasing module 940 is configured to erase the allocated flash memory blocks that are full and all invalid data in one block for next reallocation after the storage space of the allocated flash memory blocks is full.
The recording module 910 receives the path of video monitoring data, stores the path of video monitoring data into a designated flash memory block, and records the storage times of the path of video monitoring data.
And a flash block allocation module 920, configured to reallocate a corresponding flash block for the way of video monitoring data again when the number of times that the way of video monitoring data is stored reaches the first threshold.
The storage module 930 is configured to, after erasing all allocated flash memory blocks that are full and invalid, receive the way of video surveillance data again and directly store the way of video surveillance data into the reallocated flash memory blocks.
In one embodiment, as shown in fig. 11, there is also provided a surveillance video data storage apparatus including: the device comprises a multi-channel video monitoring data receiving module 1110, a recording module 1120, a flash block allocation module 1130, a judgment module 1140 and a storage module 1150.
The multi-channel video monitoring data receiving module 1110 is configured to receive multi-channel video monitoring data.
The recording module 1120 is configured to store the video monitoring data in the designated flash memory block, and record the number of times of storing each path of video monitoring data.
The flash block allocation module 1130 is configured to, when the number of times of storing one of the paths of video monitoring data reaches a first threshold, allocate a corresponding flash block to the path of video monitoring data.
The determining module 1140 is configured to, after allocating a corresponding flash block to the channel of video monitoring data, obtain the video monitoring data when the received video monitoring data is determined to be the channel of video monitoring data.
And a storage module 1150, configured to directly store the video surveillance data into the corresponding flash memory block allocated to the channel of video surveillance data.
In one embodiment, as shown in fig. 12, the apparatus further comprises: the module 1160 is released.
The recording module 1120 is further configured to receive multiple paths of video monitoring data, and record the number of times that the path of video monitoring data is not received continuously.
The releasing module 1160 is configured to release the right of ownership of the allocated flash memory block by the way of video monitoring data if the number of times that the way of video monitoring data is not received continuously reaches the second threshold.
In one embodiment, as shown in fig. 13, the apparatus further comprises: an address matching module 1170 and an obtaining module 1180.
The recording module 1120 is further configured to, when the address of the video monitoring data received this time is not consecutive to the address of each path of video monitoring data received last time before, store the video monitoring data received this time into an assigned flash memory block, and record the number of times that the path of video monitoring data is stored;
a flash memory block allocation module 1130, configured to allocate, when the number of times that the channel of video monitoring data is stored reaches a first threshold, a corresponding flash memory block for the channel of video monitoring data;
the address comparison module 1170 is configured to compare the address of the video monitoring data received each time with the address of the path of video monitoring data stored last time after the corresponding flash memory block is allocated, and generate a comparison result;
an obtaining module 1180, configured to obtain video monitoring data with a continuous address as a comparison result, where the video monitoring data is the path of video monitoring data;
a storage module 1150, configured to store the way of video surveillance data directly into the allocated flash memory block.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A video surveillance data storage method, the method comprising:
receiving multiple paths of video monitoring data, wherein the code streams of the multiple paths of video monitoring data are different;
storing the video monitoring data into a common flash memory block, and recording the storage times of each path of video monitoring data, wherein the common flash memory block can receive each path of video monitoring data;
when the storage frequency of one path of video monitoring data reaches a first threshold value, a special flash memory block is allocated to the path of video monitoring data, and the special flash memory block only stores one path of video monitoring data;
then, when the received video monitoring data is judged to be the video monitoring data of the path, the video monitoring data is obtained;
directly storing the video monitoring data into the special flash memory block allocated to the video monitoring data;
when the storage space of the allocated flash memory block is full, the allocated flash memory block which is full and is invalid data is erased in a whole block for next reallocation.
2. The method of claim 1, further comprising:
receiving multiple paths of video monitoring data, and recording the times of not receiving the paths of video monitoring data continuously;
and if the frequency of continuously not receiving the video monitoring data reaches a second threshold value, releasing the right of the video monitoring data to the allocated flash memory blocks.
3. The method of claim 1, further comprising:
when the address of the video monitoring data received this time is not continuous with the address of each path of video monitoring data received last time, storing the video monitoring data received this time into the common flash memory block, and recording the storage times of the path of video monitoring data;
when the storage frequency of the video monitoring data reaches a first threshold value, allocating a special flash memory block for the video monitoring data;
then, comparing the address of the video monitoring data received each time with the address of the video monitoring data stored last time, and generating a comparison result;
acquiring the video monitoring data with continuous addresses as a comparison result, wherein the video monitoring data is the video monitoring data of the path;
and directly storing the path of video monitoring data into the allocated flash memory block.
4. The method of claim 1, further comprising:
when the storage frequency of one path of video monitoring data reaches a first threshold value, a special flash memory block group is allocated to the path of video monitoring data, and the special flash memory block group only stores one path of video monitoring data.
5. A video surveillance data storage apparatus, the apparatus comprising:
the multi-channel video monitoring data receiving module is used for receiving multi-channel video monitoring data, and the code streams of the multi-channel video monitoring data are different;
the recording module is used for storing the video monitoring data into a common flash memory block and recording the storage times of each path of video monitoring data, and the common flash memory block can receive each path of video monitoring data;
the flash memory block distribution module is used for distributing a special flash memory block for one path of video monitoring data when the storage frequency of the video monitoring data reaches a first threshold value, and the special flash memory block only stores one path of video monitoring data;
the judging module is used for acquiring the video monitoring data when the received video monitoring data is judged to be the video monitoring data after the special flash memory block is distributed to the video monitoring data;
the storage module is used for directly storing the video monitoring data into the special flash memory block allocated to the video monitoring data;
and the reallocation module is used for erasing the allocated flash memory blocks which are full and are all invalid data in a whole block for next reallocation after the storage space of the allocated flash memory blocks is full.
6. The apparatus of claim 5, further comprising:
the recording module is used for receiving multiple paths of video monitoring data and recording the times of continuously not receiving the paths of video monitoring data;
and the releasing module is used for releasing the right of the video monitoring data to the allocated flash memory blocks if the frequency of continuously not receiving the video monitoring data reaches a second threshold value.
7. The apparatus of claim 5, further comprising:
the recording module is used for storing the video monitoring data received this time into the common flash memory block and recording the storage times of the video monitoring data when the address of the video monitoring data received this time is not continuous with the address of each path of video monitoring data received last time before;
the flash memory block distribution module is used for distributing a special flash memory block for the video monitoring data when the storage frequency of the video monitoring data reaches a first threshold value;
the address comparison module is used for comparing the address of the video monitoring data received each time with the address of the video monitoring data stored last time to generate a comparison result;
the acquisition module is used for acquiring the video monitoring data with continuous addresses as a comparison result, and the video monitoring data is the video monitoring data of the path;
and the storage module is used for directly storing the video monitoring data to the allocated flash memory blocks.
8. The apparatus of claim 5, wherein the flash block allocation module is further configured to: when the storage frequency of one path of video monitoring data reaches a first threshold value, a special flash memory block group is allocated to the path of video monitoring data, and the special flash memory block group only stores one path of video monitoring data.
9. A storage device comprising a memory and a processor, the memory having stored therein a computer program, wherein the computer program, when executed by the processor, causes the processor to perform the steps of the video surveillance data storage method according to any of claims 1 to 4.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the video surveillance data storage method according to any one of claims 1 to 4.
CN201710183508.3A 2017-03-24 2017-03-24 Video monitoring data storage method and device Active CN107145450B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201710183508.3A CN107145450B (en) 2017-03-24 2017-03-24 Video monitoring data storage method and device
PCT/CN2017/115710 WO2018171266A1 (en) 2017-03-24 2017-12-12 Video monitoring data storage method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710183508.3A CN107145450B (en) 2017-03-24 2017-03-24 Video monitoring data storage method and device

Publications (2)

Publication Number Publication Date
CN107145450A CN107145450A (en) 2017-09-08
CN107145450B true CN107145450B (en) 2020-12-08

Family

ID=59784092

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710183508.3A Active CN107145450B (en) 2017-03-24 2017-03-24 Video monitoring data storage method and device

Country Status (2)

Country Link
CN (1) CN107145450B (en)
WO (1) WO2018171266A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145450B (en) * 2017-03-24 2020-12-08 深圳市江波龙电子股份有限公司 Video monitoring data storage method and device
CN108959118B (en) * 2018-06-27 2021-11-19 郑州云海信息技术有限公司 Data writing method and device
CN109271457A (en) * 2018-11-19 2019-01-25 郑州云海信息技术有限公司 A kind of method of data synchronization and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533670A (en) * 2009-04-23 2009-09-16 北京握奇数据系统有限公司 Method and memory device realizing loss balance of memory device
CN103870205A (en) * 2012-12-11 2014-06-18 联想(北京)有限公司 Method and device for storage control and information processing method and device
CN105306865A (en) * 2015-10-29 2016-02-03 南京秦杜明视信息技术有限公司 Video monitoring data system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8588199B2 (en) * 2006-10-11 2013-11-19 At&T Mobility Ii, Llc Mobile digital video recorders
JP5241618B2 (en) * 2009-06-05 2013-07-17 日本放送協会 Recording / reproducing control apparatus and recording / reproducing apparatus using hard disk drive
CN107145450B (en) * 2017-03-24 2020-12-08 深圳市江波龙电子股份有限公司 Video monitoring data storage method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101533670A (en) * 2009-04-23 2009-09-16 北京握奇数据系统有限公司 Method and memory device realizing loss balance of memory device
CN103870205A (en) * 2012-12-11 2014-06-18 联想(北京)有限公司 Method and device for storage control and information processing method and device
CN105306865A (en) * 2015-10-29 2016-02-03 南京秦杜明视信息技术有限公司 Video monitoring data system

Also Published As

Publication number Publication date
CN107145450A (en) 2017-09-08
WO2018171266A1 (en) 2018-09-27

Similar Documents

Publication Publication Date Title
KR101767710B1 (en) Card-based management of discardable files
US10223010B2 (en) Dynamic storage device provisioning
WO2017088185A1 (en) Method for storage device storing data and storage device
KR101825770B1 (en) Systems and methods for managing an upload of files in a shared cache storage system
CN107145450B (en) Video monitoring data storage method and device
KR102290540B1 (en) Namespace/Stream Management
US7660837B2 (en) Method for automatically managing disk fragmentation
JP2013509658A (en) Allocation of storage memory based on future usage estimates
JP2012512462A (en) Discardable file
US8572307B2 (en) Memory controller, memory card, and nonvolatile memory system
WO2013155673A1 (en) Management method and apparatus for on-chip shared cache
JP2005135116A (en) Storage device and access control method thereof
US20120191938A1 (en) Information processing apparatus and write control method
US10949340B2 (en) Block mapping systems and methods for storage device
US8301862B2 (en) Formatting device
KR101950759B1 (en) Garbage collection method for performing memory controller of storage device and memory controler
CN105183375A (en) Control method and apparatus for service quality of hot spot data
US20220365677A1 (en) Storage management device, storage management method, and program
CN107766262B (en) Method and device for adjusting number of concurrent write commands
Kwon et al. Hot-LSNs distributing wear-leveling algorithm for flash memory
US11604593B2 (en) Control apparatus that improves recording of data in a recording medium by allocating directory clusters to recording units in a more effective manner, and control method and non-transitory computer readable storage medium storing instructions thereof
US12019886B2 (en) Storage management apparatus, storage management method, and program
CN110018988B (en) Snapshot deleting method, processing method, device and system
CN115048035A (en) Cache management method, device and related equipment
JP2018120571A (en) Storage control apparatus and storage control program

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 518057 A, B, C, D, E, F1, 8 Building, Financial Services Technology Innovation Base, No. 8 Kefa Road, Nanshan District, Shenzhen City, Guangdong Province

Applicant after: Shenzhen jiangbolong electronic Limited by Share Ltd

Address before: 518057 A, B, C, D, E, F1, 8 Building, Financial Services Technology Innovation Base, No. 8 Kefa Road, Nanshan District, Shenzhen City, Guangdong Province

Applicant before: Shenzhen jiangbolong Electronic Co., Ltd.

GR01 Patent grant
GR01 Patent grant