CN108093207B - Data storage and acquisition method and device - Google Patents

Data storage and acquisition method and device Download PDF

Info

Publication number
CN108093207B
CN108093207B CN201611046865.7A CN201611046865A CN108093207B CN 108093207 B CN108093207 B CN 108093207B CN 201611046865 A CN201611046865 A CN 201611046865A CN 108093207 B CN108093207 B CN 108093207B
Authority
CN
China
Prior art keywords
video data
type
storage
solid state
data
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
CN201611046865.7A
Other languages
Chinese (zh)
Other versions
CN108093207A (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.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology 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 Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201611046865.7A priority Critical patent/CN108093207B/en
Publication of CN108093207A publication Critical patent/CN108093207A/en
Application granted granted Critical
Publication of CN108093207B publication Critical patent/CN108093207B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/78Television signal recording using magnetic recording
    • H04N5/781Television signal recording using magnetic recording on disks or drums

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Television Signal Processing For Recording (AREA)

Abstract

The embodiment of the invention provides a data storage and acquisition method and device. The data storage method is applied to a storage server with a solid state disk, and comprises the following steps: obtaining video data; determining whether the type of the video data is an alarm type; if so, storing the video data to the solid state disk, and sending alarm data notification information to a management server corresponding to the target storage server group; acquiring response information which is replied by the management server and comprises target identification information, wherein the target identification information is identification information of a preset number of storage servers in the target storage server group except the storage server which sends the notification information; and sending the video data to a storage server with target identification information. On the premise of ensuring the security of the valuable video data, the scheme improves the access efficiency of the valuable video data and simultaneously improves the reading and writing speeds of the valuable video data.

Description

Data storage and acquisition method and device
Technical Field
The invention relates to the technical field of video monitoring, in particular to a data storage and acquisition method and device.
Background
In the technical field of video monitoring, a video cloud storage system is widely applied. For a video cloud storage system, in order to ensure the security of video data, a data storage redundancy backup scheme is very common. Specifically, the scheme refers to: after the front-end equipment collects any video data, the video data can be backed up to the solid state disks of at least two storage servers of the video cloud storage system, so that even if one storage server fails, the rest storage servers can normally operate, the video data can still be normally accessed, and the safety of the video data is better ensured.
However, the above solutions have certain problems: for video data subjected to redundant backup storage, only a small part of the video data is valuable, and the rest of useless video data occupies a large amount of storage space, so that the access efficiency of the valuable video data is seriously influenced. In addition, solid state disks have poor performance, which can limit the speed of reading and writing valuable video data.
Therefore, it is an urgent problem for those skilled in the art to improve the access efficiency of the valuable video data and to improve the reading and writing speed of the valuable video data while ensuring the security of the valuable video data.
Disclosure of Invention
Embodiments of the present invention provide a method and an apparatus for storing and acquiring data, so as to effectively improve the access efficiency of valuable video data and improve the reading and writing speed of the valuable video data on the premise of ensuring the security of the valuable video data.
The embodiment of the invention provides a data storage method, which is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state disk, and the method comprises the following steps:
obtaining video data;
determining whether the type of the video data is an alarm type;
if so, storing the video data to the solid state disk, and sending alarm data notification information to a management server corresponding to a target storage server group where the video data is located;
acquiring response information replied by the management server, wherein the response information comprises target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group except the storage server sending the alarm data notification information;
sending the video data to a storage server having the target identification information so that the storage server having the target identification information stores the received video data.
In a specific implementation manner of the embodiment of the present invention, the storage server further has a mechanical hard disk, and accordingly, after the video data is obtained, the method further includes:
and storing the video data to the mechanical hard disk.
In a specific implementation manner of the embodiment of the present invention, the method further includes:
determining whether the type of the video data is an alarm type while storing the video data to the mechanical hard disk;
if yes, adding a locking mark for the video data stored in the mechanical hard disk;
when the storage time of any video data in the mechanical hard disk is longer than a preset first time threshold and the video data does not have the locking mark, deleting the video data; and/or the presence of a gas in the gas,
and when the residual capacity of the mechanical hard disk is smaller than a preset first capacity threshold, deleting the video with the earliest storage time in the video data without the locking mark from the mechanical hard disk.
In a specific implementation manner of the embodiment of the present invention, the method further includes:
when the storage time of any video data in the solid state disk reaches a preset second time threshold, deleting the video data from the solid state disk; and/or the presence of a gas in the gas,
and when the residual capacity of the solid state disk is smaller than a preset second capacity threshold, deleting the video data with the earliest storage time from the solid state disk.
In a specific implementation manner of the embodiment of the present invention, the determining whether the type of the video data is an alarm type includes:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
The embodiment of the invention also provides a data acquisition method, which is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state disk and a mechanical hard disk, the storage server stores the acquired video data by adopting the data storage method, and the method comprises the following steps:
acquiring a video data acquisition request aiming at a target time period;
determining whether video data corresponding to the target time period is stored in the solid state disk;
if so, extracting the video data corresponding to the target time period from the solid state disk, and outputting the extracted video data;
if not, extracting the video data corresponding to the target time period from the mechanical hard disk, and outputting the extracted video data.
In a specific implementation manner of the embodiment of the present invention, before determining whether the video data corresponding to the target time period is stored in the solid state disk, the method further includes:
determining whether the data type corresponding to the target time period is an alarm type or not based on the corresponding relation between the time period and the data type stored in the data type;
if so, executing the step of determining whether the video data corresponding to the target time period is stored in the solid state disk;
if not, executing the step of extracting the video data corresponding to the target time period from the mechanical hard disk.
The embodiment of the invention also provides a data storage device, which is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state disk, and the device comprises:
the video data acquisition module is used for acquiring video data and calling the first type determination module;
the first type determining module is used for determining whether the type of the video data is an alarm type;
the first processing module is used for storing the video data to the solid state disk and sending alarm data notification information to a management server corresponding to a target storage server group where the first processing module is located under the condition that the type of the video data is an alarm type;
a response information obtaining module, configured to obtain response information replied by the management server, where the response information includes target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group, except for a storage server that sends the alarm data notification information;
and the video data sending module is used for sending the video data to the storage server with the target identification information so as to enable the storage server with the target identification information to store the received video data.
In a specific implementation manner of the embodiment of the present invention, the storage server further includes a mechanical hard disk, and the apparatus further includes:
and the storage module is used for storing the video data to the mechanical hard disk after the video data is obtained.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the calling module is used for calling the first type determining module while storing the video data to the mechanical hard disk;
the mark adding module is used for adding a locking mark for the video data stored in the mechanical hard disk under the condition that the type of the video data is an alarm type;
the first deleting module is used for deleting any video data when the storage time length of the video data in the mechanical hard disk is greater than a preset first time length threshold value and the video data does not have the locking mark; and/or the presence of a gas in the gas,
and the second deleting module is used for deleting the video with the earliest storage time in all the video data without the locking mark from the mechanical hard disk when the residual capacity of the mechanical hard disk is smaller than a preset first capacity threshold.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the third deleting module is used for deleting the video data from the solid state disk when the storage time of any video data in the solid state disk reaches a preset second time threshold; and/or the presence of a gas in the gas,
and the fourth deleting module is used for deleting the video data with the earliest storage time from the solid state disk when the residual capacity of the solid state disk is smaller than a preset second capacity threshold.
In a specific implementation manner of the embodiment of the present invention, the first type determining module is specifically configured to:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
The embodiment of the invention also provides a data acquisition device, which is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state disk and a mechanical hard disk, the storage server adopts the data storage device to store the acquired video data, and the data acquisition device comprises:
the request acquisition module is used for acquiring a video data acquisition request aiming at a target time period;
the storage determining module is used for determining whether video data corresponding to the target time period is stored in the solid state disk;
the second processing module is used for extracting the video data corresponding to the target time period from the solid state disk and outputting the extracted video data under the condition that the video data corresponding to the target time period is stored in the solid state disk;
and the third processing module is used for extracting the video data corresponding to the target time period from the mechanical hard disk and outputting the extracted video data under the condition that the video data corresponding to the target time period is not stored in the solid state hard disk.
In a specific implementation manner of the embodiment of the present invention, the apparatus further includes:
the second type determining module is used for determining whether the data type corresponding to the target time period is an alarm type based on the corresponding relation between the time period and the data type stored in the solid state disk before determining whether the video data corresponding to the target time period is stored in the solid state disk;
the triggering module is used for triggering the storage determining module under the condition that the data type corresponding to the target time period is an alarm type; and triggering the third processing module under the condition that the video type corresponding to the target time period is not the alarm type.
In the scheme, after the storage server obtains the video data, the storage server can determine whether the type of the video data is an alarm type. And under the condition that the type of the video data is an alarm type, the storage server stores the video data into a solid state disk of the storage server, and performs redundant backup storage on the video data to ensure the safety of the video data. Under the condition that the type of the video data is not the alarm type, the storage server does not perform redundant backup storage on the video data, so that the storage space in the storage server can be greatly saved, and the access efficiency of the video data is effectively ensured. It is easy to see that the scheme improves the access efficiency of the valuable video data and the reading and writing speed of the valuable video data by adopting different storage strategies for different types of video data on the premise of ensuring the security of the valuable video data.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a flowchart of a data storage method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of a networking structure of a video cloud storage system;
FIG. 3 is a block diagram of a data storage device according to an embodiment of the present invention;
fig. 4 is a flowchart of a data acquisition method according to an embodiment of the present invention;
fig. 5 is a flowchart of a data obtaining method according to an embodiment of the present invention;
fig. 6 is a block diagram of a data acquisition apparatus according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In order to solve the problems in the prior art, embodiments of the present invention provide a data storage method and apparatus and a data acquisition method and apparatus.
First, a data storage method provided by an embodiment of the present invention is described below.
It should be noted that the embodiment of the present invention may be applied to a storage server in a video cloud storage system. The storage server has a Solid State Drive (SSD). It should be noted that the reading and writing speed of the solid state disk is much better than that of the mechanical disk (i.e. the ordinary disk).
Referring to fig. 1, a flowchart of a data storage method according to an embodiment of the present invention is shown. As shown in fig. 1, the method may include the steps of:
s101, video data are obtained.
As shown in fig. 2, the video cloud storage system may include a management server in addition to the storage server. The number of the storage servers can be multiple. Specifically, the number of storage servers may be five, S1, S2, S3, S4, and S5, respectively, to facilitate redundant backup storage of video data. Similarly, the number of management servers may be plural. Specifically, the number of the management servers may be two, which are M1 and M2, where M1 is a master management server that can manage the above five storage servers, and M2 is a standby management server, and when the master management server M1 fails, the standby management server M2 may take over the work of the master management server M1 to ensure the normal operation of the entire video cloud storage system.
It should be noted that, the video data is generally collected by the front-end device. In particular, the front-end device may be a web high definition camera. When a front-end device such as a network high definition camera acquires Video data, the front-end device sends the Video data to a back-end device, and in addition, a stream Access server (CVA) can acquire the Video data acquired by the front-end device. Then, the streaming server notifies the main management server M1 of the attribute information of the video data it acquired, for example, the information that the video data is 100M. Next, the master management server M1 selects a storage server with the best performance from the five storage servers, i.e., S1, S2, S3, S4, and S5, and returns the identification information of the selected storage server to the streaming server. Specifically, the storage server selected by the master management server M1 may be the storage server with the largest remaining capacity, and the identification information of the storage server may be an IP address of the storage server. When the streaming server receives the identification information returned by the primary management server M1, the streaming server sends the 100M data to the storage server with the identification information, so that the storage server with the identification information successfully obtains the video data.
S102, determining whether the type of the video data is an alarm type; if so, S103 is executed.
It should be noted that, the specific implementation form of the storage server determining whether the type of the video data is the alarm type is various, and the following description is given by way of example.
In a specific implementation manner of the embodiment of the present invention, determining whether the type of the video data is an alarm type may include:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
It should be noted that, for the front-end device, after it collects the video data, it can determine whether the video data is valuable video data. Specifically, the front-end device may check whether the video data is data related to violation records, intrusion records, and the like. If so, the front-end equipment can add an alarm mark to the video data to represent that the type of the video data is an alarm type; if not, the front-end equipment may add a non-alarm mark to the video data, or may not add any mark to the video data.
It is easy to see that the alert flag can distinguish the type of video data very effectively. For the storage server, when the video data obtained by the storage server has the alarm mark, this indicates that the video data is data related to violation records, intrusion records, and the like, so the video data is valuable video data, and in order to better ensure the security of the valuable video data, the storage server performs the subsequent S103. In contrast, when the video data obtained by the storage server does not have the warning flag thereon, which indicates that the video data is general data, the value of the video data is very small or no value at all, and therefore the storage server does not perform S103.
S103, storing the video data to the solid state disk, and sending alarm data notification information to a management server corresponding to the target storage server group where the video data is located.
S104, acquiring response information replied by the management server, wherein the response information comprises target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group except the storage server sending the alarm data notification information.
S105, sending the video data to the storage server having the target identification information, so that the storage server having the target identification information stores the received video data.
The preset number may be regarded as a preset redundancy backup coefficient.
It is easy to understand that, in the case that the type of the video data obtained by the storage server is an alarm type, the storage server stores the video data into the solid state disk, and the video data can be quickly written into the solid state disk because the solid state disk has a fast reading and writing speed. In addition, when the storage server subsequently reads the video data from the solid state disk, the reading efficiency of the video data is also very high.
A specific example will be described below with reference to fig. 2.
As is readily apparent from fig. 2, S1, S2, S3, S4 and S5 belong to the same storage server group, and M1 can be regarded as a management server corresponding to the storage server group.
Assuming that S1 obtains video data with an alarm tag, S1 sends an alarm notification message to M1. When M1 receives the notification message, M1 selects a predetermined number of management servers from the remaining four management servers based on a predetermined selection rule. Specifically, assuming that M1 picked up two management servers, S4 and S5, respectively, then M1 would send reply information including the identification information of S4 and S5 to S1. Specifically, the IP addresses of S4 and S5 may be included in the response information. When the response message is received at S1, S1 sends the video data obtained by itself to S4 and S5 according to the identification information in the response message. It is easy to see that the video data of the alarm type obtained at S1 is redundantly stored as backup, so that even if S1 fails, S4 and S5 can still work normally, and thus the video data can still be accessed normally, and thus the security of the video data of the alarm type, i.e., valuable video data, is better ensured.
In the scheme, after the storage server obtains the video data, the storage server can determine whether the type of the video data is an alarm type. Under the condition that the type of the video data is an alarm type, the storage server stores the video data into a solid state disk of the storage server and performs redundant backup storage on the video data, so that the safety of the video data is effectively ensured, and the reading and writing speed of the video data can be effectively improved. Under the condition that the type of the video data is not the alarm type, the storage server does not perform redundant backup storage on the video data, so that the storage space in each storage server can be greatly saved, and the access efficiency of the alarm type video data is effectively ensured.
It is easy to see that, according to the scheme, different storage strategies are adopted for different types of video data, so that on the premise of ensuring the safety of valuable video data, the access efficiency of the valuable video data is improved, and meanwhile, the reading and writing speeds of the valuable video data are also improved.
In a specific implementation manner of the embodiment of the present invention, the storage server may further have a mechanical hard disk. It should be noted that the price of the solid state disk is lower than that of the mechanical hard disk, and the capacity of the solid state disk is also smaller than that of the mechanical hard disk.
Accordingly, after obtaining the video data, the method may further include:
and storing the video data to the mechanical hard disk.
It is easy to understand that, because the storage server stores each obtained video data in the mechanical hard disk, when a user needs to access some video data of a non-alarm type or a problem occurs in the solid state disk, the user can very easily obtain data required by the user from the mechanical hard disk, so that better use experience can be brought to the user.
In a specific implementation manner of the embodiment of the present invention, the method may further include:
determining whether the type of the video data is an alarm type while storing the video data to the mechanical hard disk;
if yes, adding a locking mark for the video data stored in the mechanical hard disk;
when the storage time of any video data in the mechanical hard disk is longer than a preset first time threshold and the video data does not have a locking mark, deleting the video data; and/or the presence of a gas in the gas,
and when the residual capacity of the mechanical hard disk is smaller than a preset first capacity threshold value, deleting the video with the earliest storage time in the video data without the locking mark from the mechanical hard disk.
The first time threshold and the first capacity threshold may be determined according to actual conditions, which is not limited in this embodiment.
It should be noted that, in this embodiment, the specific implementation of determining whether the type of the video data is the alarm type may refer to the description of S102, and details are not repeated here.
It is easy to understand that when the amount of video data stored in the mechanical hard disk reaches a certain amount, the remaining capacity of the mechanical hard disk, i.e. the available storage space, is small, and at this time, the speed of storing new video data into the mechanical hard disk is slow, or new video data cannot be stored into the mechanical hard disk at all.
In order to avoid the above problem, in this embodiment, the storage server determines the type of the video data while storing the video data in the mechanical hard disk. If the type of the video data is an alarm type, the storage server adds an alarm mark to the video data; if the type of the video data is not an alert type, the storage server does not add an alert flag to the video data.
Therefore, when the storage server detects that the storage time of any video data in the mechanical hard disk is longer than a preset first time threshold, the storage server checks whether the video data has a locking mark. If yes, the video data is valuable video data, so the storage server does not delete the video data from the mechanical hard disk; if not, the video data is not valuable video data, the existing time of the video data is long, and the storage server can delete the video data from the mechanical hard disk, so that the mechanical hard disk releases a certain storage space.
When the storage server detects that the remaining capacity of the mechanical hard disk is smaller than the preset first capacity threshold, this indicates that the storage space in the mechanical hard disk is very limited, at this time, the storage server may delete the video with the earliest storage time in each video data without the locking flag from the mechanical hard disk, so that the mechanical hard disk may release a certain storage space.
It is easy to see that the present embodiment can effectively ensure the storage space in the mechanical hard disk, so that the new video data can be successfully stored in the mechanical hard disk. In addition, the storage server deletes the video data without the locking mark, so that the user can successfully acquire the alarm type video data, namely the valuable video data from the mechanical hard disk.
In a specific implementation manner of the embodiment of the present invention, the method may further include:
and when the storage time of any video data in the solid state disk reaches a preset second time threshold, deleting the video data from the solid state disk.
The specific value of the second duration threshold may be determined according to an actual situation, which is not limited in this embodiment.
As will be appreciated by those skilled in the art, the capacity of a solid state drive is generally not large, and it does not store alarm type video data without limitation. When the video data stored in the solid state disk reaches a certain amount, the remaining storage space of the solid state disk is small, and at this time, the speed of storing new video data into the solid state disk is slow, or the new video data cannot be stored into the solid state disk at all.
In order to avoid the foregoing problem, in this embodiment, when the storage duration of any video data in the solid state disk reaches the preset second duration threshold, the storage server deletes the video data from the solid state disk, so that the solid state disk releases a certain storage space.
It can be seen that the present embodiment can effectively ensure the storage space in the solid state disk, so that new video data can be successfully stored in the solid state disk.
In a specific implementation manner of the embodiment of the present invention, the method may further include:
and when the residual capacity of the solid state disk is smaller than a preset second capacity threshold value, deleting the video data with the earliest storage time from the solid state disk.
The specific value of the preset second capacity threshold may be determined according to an actual situation, which is not limited in this embodiment.
As will be appreciated by those skilled in the art, the capacity of a solid state drive is generally not large, and it does not store alarm type video data without limitation. When the video data stored in the solid state disk reaches a certain amount, the remaining capacity, i.e., the remaining storage space, of the solid state disk is small, and at this time, the speed of storing new video data into the solid state disk is slow, or new video data cannot be stored into the solid state disk at all.
In order to avoid the foregoing problem, in this embodiment, when the remaining capacity of the solid state disk is smaller than the preset second capacity threshold, the storage server deletes the video data with the earliest storage time from the solid state disk, so that the solid state disk releases a certain storage space.
It can be seen that the present embodiment can effectively ensure the storage space in the solid state disk, so that new video data can be successfully stored in the solid state disk.
It is easy to see that the present embodiment improves the access efficiency of the valuable video data and improves the reading and writing speed of the valuable video data on the premise of ensuring the security of the valuable video data.
A data storage device provided by an embodiment of the present invention is described below.
It should be noted that the data storage device provided by the embodiment of the present invention may be applied to a storage server in a video cloud storage system, where the storage server has a solid state disk.
Referring to fig. 3, a block diagram of a data storage device according to an embodiment of the present invention is shown. As shown in fig. 3, the apparatus may include:
a video data obtaining module 31, configured to obtain video data and call the first type determining module 32;
a first type determining module 32, configured to determine whether the type of the video data is an alarm type;
the first processing module 33 is configured to, when the type of the video data is an alarm type, store the video data in the solid state disk, and send alarm data notification information to a management server corresponding to a target storage server group where the first processing module is located;
a video data obtaining module 34, configured to obtain response information replied by the management server, where the response information includes target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group, except for a storage server that sends the alarm data notification information;
and a video data sending module 35, configured to send the video data to the storage server with the target identification information, so that the storage server with the target identification information stores the received video data.
In the scheme, after the storage server obtains the video data, the storage server can determine whether the type of the video data is an alarm type. Under the condition that the type of the video data is an alarm type, the storage server stores the video data into a solid state disk of the storage server and performs redundant backup storage on the video data, so that the safety of the video data is effectively ensured, and the reading and writing speed of the video data can be effectively improved. Under the condition that the type of the video data is not the alarm type, the storage server does not perform redundant backup storage on the video data, so that the storage space in each storage server can be greatly saved, and the access efficiency of the alarm type video data is effectively ensured.
It is easy to see that, according to the scheme, different storage strategies are adopted for different types of video data, so that on the premise of ensuring the safety of valuable video data, the access efficiency of the valuable video data is improved, and meanwhile, the reading and writing speeds of the valuable video data are also improved.
In a specific implementation manner of the embodiment of the present invention, the storage server further includes a mechanical hard disk, and the apparatus may further include:
and the storage module is used for storing the video data to the mechanical hard disk after the video data is obtained.
In a specific implementation manner of the embodiment of the present invention, the apparatus may further include:
the calling module is used for calling the first type determining module while storing the video data to the mechanical hard disk;
the mark adding module is used for adding a locking mark to the video data stored in the mechanical hard disk under the condition that the type of the video data is an alarm type;
the first deleting module is used for deleting any video data when the storage time of the video data in the mechanical hard disk is longer than a preset first time threshold and the video data does not have a locking mark; and/or the presence of a gas in the gas,
and the second deleting module is used for deleting the video with the earliest storage time in all the video data without the locking mark from the mechanical hard disk when the residual capacity of the mechanical hard disk is smaller than the preset first capacity threshold.
In a specific implementation manner of the embodiment of the present invention, the apparatus may further include:
the third deleting module is used for deleting the video data from the solid state disk when the storage time of any video data in the solid state disk reaches a preset second time threshold; and/or the presence of a gas in the gas,
and the fourth deleting module is used for deleting the video data with the earliest storage time from the solid state disk when the residual capacity of the solid state disk is smaller than a preset second capacity threshold.
In a specific implementation manner of the embodiment of the present invention, the first type determining module is specifically configured to:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
It is easy to see that the present embodiment improves the access efficiency of the valuable video data and improves the reading and writing speed of the valuable video data on the premise of ensuring the security of the valuable video data.
A data acquisition method provided in an embodiment of the present invention is described below.
It should be noted that the data acquisition method provided by the embodiment of the present invention may be applied to a storage server in a video cloud storage system, where the storage server has a solid state disk and a mechanical hard disk, and the storage server stores the obtained video data by using the data storage method.
Referring to fig. 4, a flowchart of a data acquisition method according to an embodiment of the present invention is shown. As shown in fig. 4, the method may include the steps of:
s401, receiving a video data acquisition request aiming at a target time period;
s402, determining whether video data corresponding to a target time period are stored in the solid state disk; if yes, S403 is executed, and if no, S404 is executed.
S403, extracting video data corresponding to the target time period from the solid state disk, and outputting the extracted video data;
s404, extracting the video data corresponding to the target time period from the mechanical hard disk, and outputting the extracted video data.
Generally, when a user wants to view video Data corresponding to a certain time period, the user may send a query instruction for a Data file corresponding to a target time period to a Data forwarding server (CDT). When the data forwarding server receives the query instruction, it forwards the query instruction to the management server. For the management server, an index information table may be stored therein, the index information table has a correspondence between a time period and address information of a storage server storing video data corresponding to the time period, and after receiving a query instruction, the management server searches for IP address information corresponding to a target time period according to the correspondence. And then, the management server returns all the IP address information corresponding to the target time period to the data forwarding server, and the data forwarding server provides all the IP address information to the user. Next, the user can send a video data acquisition request for the target time period to the storage server having the IP address.
The storage server stores the obtained video data by adopting the data storage method, so that the video data of the alarm type is stored in the solid state disk, and the video data of the existing alarm type and the video data of the non-alarm type are stored in the mechanical hard disk.
When a user wants to acquire video data corresponding to a target time period, the user may send a video data acquisition request carrying the target time period to the storage server. After receiving the request, the storage server may determine whether video data corresponding to the target time period is stored in the solid state disk. If the video data exists, the storage server can directly extract the video data corresponding to the target time period from the solid state disk and output the extracted video data. Because the reading and writing speeds of the solid state disk are very high, the storage server can output the video data corresponding to the target time period more quickly so as to better meet the requirements of users. If not, the storage server can extract the video data corresponding to the target time period from the mechanical hard disk and output the extracted data, and the end user can also successfully obtain the video data required by the end user.
The storage server stores the obtained video data by adopting the data storage method, so the scheme improves the access efficiency of the valuable video data and simultaneously improves the reading and writing speed of the valuable video data on the premise of ensuring the safety of the valuable video data. In addition, under the condition that the video data corresponding to the target time period is stored in the solid state disk, the storage server extracts and outputs the video data corresponding to the target time period from the solid state disk, so that a user can quickly obtain the video data corresponding to the target time period, and the requirements of the user can be better met.
Referring to fig. 5, a flowchart of a data acquisition method according to an embodiment of the present invention is shown. As shown in fig. 5, the method may include the steps of:
s501, receiving a video data acquisition request aiming at a target time period;
s502, determining whether the data type corresponding to the target time period is an alarm type or not based on the corresponding relation between the time period and the data type stored by the data type; if yes, S503 is executed, and if no, S505 is executed.
S503, determining whether video data corresponding to the target time period is stored in the solid state disk; if yes, go to S504, otherwise go to S505.
S504, extracting video data corresponding to a target time period from the solid state disk, and outputting the extracted video data;
and S505, extracting the video data corresponding to the target time period from the mechanical hard disk, and outputting the extracted video data.
In this embodiment, the storage server may store a corresponding relationship between the time period and the data type in advance. Therefore, as long as the target time period is provided for the storage server, the storage server can very easily determine whether the type of the video data corresponding to the target time period is the alarm type according to the corresponding relation. If the type of the video data corresponding to the target time period is a non-alarm type, the video data does not exist in the solid state disk, and the storage server does not need to search the video data in the solid state disk, and can directly search the video data in the mechanical hard disk. If the type of video data corresponding to the target time period is an alert type, there are two possible cases: in one case, the video data has been deleted due to the longer storage time; in another case, the storage time of the video data is short and the video data is not deleted yet, in both cases, the storage server can preferentially search the video data in the solid state disk, and if the video data is stored in the solid state disk, the storage server can successfully search the video data and rapidly output the video data; even if the video data is not stored in the solid state disk, the storage server can finally search the video data in the mechanical hard disk and output the video data.
It is easy to see that, in this embodiment, the storage server can rapidly and successfully output the video data corresponding to the target time period, so as to better meet the actual requirements of the user.
In summary, the present embodiment improves the access efficiency of the valuable video data and improves the reading and writing speed of the valuable video data on the premise of ensuring the security of the valuable video data. In addition, in this embodiment, the user can obtain the video data corresponding to the target time period relatively quickly, so that the user's requirements can be better met.
A data acquisition apparatus provided in an embodiment of the present invention is described below.
It should be noted that the data acquisition device provided by the embodiment of the present invention may be applied to a storage server in a video cloud storage system, where the storage server has a solid state disk and a mechanical hard disk, and the storage server stores the acquired video data by using the data storage device.
Referring to fig. 6, a block diagram of a data acquisition apparatus according to an embodiment of the present invention is shown. As shown in fig. 6, the apparatus may include:
a request receiving module 61, configured to obtain a video data acquisition request for a target time period;
a storage determining module 62, configured to determine whether video data corresponding to the target time period is stored in the solid state disk;
the third processing module 63 is configured to, in a case where video data corresponding to a target time period is stored in the solid state disk, extract the video data corresponding to the target time period from the solid state disk, and output the extracted video data;
the fourth processing module 64 is configured to, when the video data corresponding to the target time period is not stored in the solid state disk, extract the video data corresponding to the target time period from the mechanical hard disk, and output the extracted video data.
The storage server stores the obtained video data by adopting the data storage method, so the scheme improves the access efficiency of the valuable video data and simultaneously improves the reading and writing speed of the valuable video data on the premise of ensuring the safety of the valuable video data. In addition, under the condition that the video data corresponding to the target time period is stored in the solid state disk, the storage server extracts and outputs the video data corresponding to the target time period from the solid state disk, so that a user can quickly obtain the video data corresponding to the target time period, and the requirements of the user can be better met.
In a specific implementation manner of the embodiment of the present invention, the apparatus may further include:
the second type determining module is used for determining whether the data type corresponding to the target time period is an alarm type based on the corresponding relation between the time period and the data type stored in the solid state disk before determining whether the video data corresponding to the target time period is stored in the solid state disk;
the triggering module is used for triggering the storage determining module under the condition that the data type corresponding to the target time period is the alarm type; and under the condition that the video type corresponding to the target time period is not the alarm type, triggering a fourth processing module.
In summary, the present embodiment improves the access efficiency of the valuable video data and improves the reading and writing speed of the valuable video data on the premise of ensuring the security of the valuable video data. In addition, in this embodiment, the user can obtain the video data corresponding to the target time period relatively quickly, so that the user's requirements can be better met.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (12)

1. A data storage method is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state disk and a mechanical hard disk, the video cloud storage system further comprises a management server, and the management server is used for managing a group of storage servers in the video cloud storage system, and the method comprises the following steps:
the method comprises the steps that video data collected by front-end equipment sent by a streaming server are obtained, the video data are stored in a mechanical hard disk, the front-end equipment sends the video data to the streaming server after collecting the video data, and the front-end equipment is used for collecting video monitoring data;
determining whether the type of the video data is an alarm type, wherein the data with the type of the alarm type refers to data related to violation records and intrusion records, and the alarm type is determined by the front-end equipment based on the video data; if so, storing the video data to the solid state disk, and sending alarm data notification information to the management server corresponding to the target storage server group where the management server is located; acquiring response information replied by the management server, wherein the response information comprises target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group except the storage server sending the alarm data notification information; sending the video data to a storage server with the target identification information so that the storage server with the target identification information stores the received video data;
determining whether the type of the video data is an alarm type while storing the video data to the mechanical hard disk;
if yes, adding a locking mark for the video data stored in the mechanical hard disk.
2. The method of claim 1, further comprising:
when the storage time of any video data in the mechanical hard disk is longer than a preset first time threshold and the video data does not have the locking mark, deleting the video data; and/or the presence of a gas in the gas,
and when the residual capacity of the mechanical hard disk is smaller than a preset first capacity threshold, deleting the video data with the earliest storage time in the video data without the locking mark from the mechanical hard disk.
3. The method according to claim 1 or 2, characterized in that the method further comprises:
when the storage time of any video data in the solid state disk reaches a preset second time threshold, deleting the video data from the solid state disk; and/or the presence of a gas in the gas,
and when the residual capacity of the solid state disk is smaller than a preset second capacity threshold, deleting the video data with the earliest storage time from the solid state disk.
4. The method of claim 1, wherein the determining whether the type of the video data is an alert type comprises:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
5. A data acquisition method applied to a storage server in a video cloud storage system, wherein the storage server has a solid-state hard disk and a mechanical hard disk, and the storage server stores obtained video data by using the data storage method according to any one of claims 1 to 4, and the method comprises:
acquiring a video data acquisition request aiming at a target time period;
determining whether video data corresponding to the target time period is stored in the solid state disk;
if so, extracting the video data corresponding to the target time period from the solid state disk, and outputting the extracted video data;
if not, extracting the video data corresponding to the target time period from the mechanical hard disk, and outputting the extracted video data.
6. The method according to claim 5, wherein before determining whether the video data corresponding to the target time period is stored in the solid state disk, the method further comprises:
determining whether the data type corresponding to the target time period is an alarm type or not based on the corresponding relation between the time period and the data type stored in the data type;
if so, executing the step of determining whether the video data corresponding to the target time period is stored in the solid state disk;
if not, executing the step of extracting the video data corresponding to the target time period from the mechanical hard disk.
7. A data storage device is applied to a storage server in a video cloud storage system, wherein the storage server is provided with a solid state hard disk and a mechanical hard disk, the video cloud storage system further comprises a management server, and the management server is used for managing a group of storage servers in the video cloud storage system, and the device comprises:
the video data acquisition module is used for acquiring video data acquired by front-end equipment sent by a streaming server and storing the video data to the mechanical hard disk, the front-end equipment sends the video data to the streaming server after acquiring the video data, and the front-end equipment is used for acquiring video monitoring data and calling the first type determination module;
the first type determining module is used for determining whether the type of the video data is an alarm type, the data with the type of the alarm type refers to data related to violation records and intrusion records, and the alarm type is determined by the front-end equipment based on the video data; under the condition that the type of the video data is an alarm type, storing the video data to the solid state disk, and sending alarm data notification information to the management server corresponding to the target storage server group where the video data is located; acquiring response information replied by the management server, wherein the response information comprises target identification information, and the target identification information is identification information of a preset number of storage servers in the target storage server group except the storage server sending the alarm data notification information; sending the video data to a storage server with the target identification information so that the storage server with the target identification information stores the received video data;
the calling module is used for calling the first type determining module while storing the video data to the mechanical hard disk;
and the mark adding module is used for adding a locking mark to the video data stored in the mechanical hard disk under the condition that the type of the video data is an alarm type.
8. The apparatus of claim 7, further comprising:
the first deleting module is used for deleting any video data when the storage time length of the video data in the mechanical hard disk is greater than a preset first time length threshold value and the video data does not have the locking mark; and/or the presence of a gas in the gas,
and the second deleting module is used for deleting the video data with the earliest storage time in all the video data without the locking mark from the mechanical hard disk when the residual capacity of the mechanical hard disk is smaller than a preset first capacity threshold.
9. The apparatus of claim 7 or 8, further comprising:
the third deleting module is used for deleting the video data from the solid state disk when the storage time of any video data in the solid state disk reaches a preset second time threshold; and/or the presence of a gas in the gas,
and the fourth deleting module is used for deleting the video data with the earliest storage time from the solid state disk when the residual capacity of the solid state disk is smaller than a preset second capacity threshold.
10. The apparatus of claim 7, wherein the first type determination module is specifically configured to:
and judging whether the video data has an alarm mark, if so, indicating that the type of the video data is an alarm type, and if not, indicating that the type of the video data is not the alarm type.
11. A data acquisition apparatus, applied to a storage server in a video cloud storage system, the storage server having a solid-state hard disk and a mechanical hard disk, the storage server storing acquired video data by using the data storage apparatus according to any one of claims 7 to 10, the data acquisition apparatus comprising:
the request acquisition module is used for acquiring a video data acquisition request aiming at a target time period;
the storage determining module is used for determining whether video data corresponding to the target time period is stored in the solid state disk;
the second processing module is used for extracting the video data corresponding to the target time period from the solid state disk and outputting the extracted video data under the condition that the video data corresponding to the target time period is stored in the solid state disk;
and the third processing module is used for extracting the video data corresponding to the target time period from the mechanical hard disk and outputting the extracted video data under the condition that the video data corresponding to the target time period is not stored in the solid state hard disk.
12. The apparatus of claim 11, further comprising:
the second type determining module is used for determining whether the data type corresponding to the target time period is an alarm type based on the corresponding relation between the time period and the data type stored in the solid state disk before determining whether the video data corresponding to the target time period is stored in the solid state disk;
the triggering module is used for triggering the storage determining module under the condition that the data type corresponding to the target time period is an alarm type; and triggering the third processing module under the condition that the video type corresponding to the target time period is not the alarm type.
CN201611046865.7A 2016-11-23 2016-11-23 Data storage and acquisition method and device Active CN108093207B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611046865.7A CN108093207B (en) 2016-11-23 2016-11-23 Data storage and acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611046865.7A CN108093207B (en) 2016-11-23 2016-11-23 Data storage and acquisition method and device

Publications (2)

Publication Number Publication Date
CN108093207A CN108093207A (en) 2018-05-29
CN108093207B true CN108093207B (en) 2021-03-16

Family

ID=62171147

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611046865.7A Active CN108093207B (en) 2016-11-23 2016-11-23 Data storage and acquisition method and device

Country Status (1)

Country Link
CN (1) CN108093207B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110658979B (en) 2018-06-29 2022-03-25 杭州海康威视系统技术有限公司 Data reconstruction method and device, electronic equipment and storage medium
CN109408509A (en) * 2018-10-15 2019-03-01 北京金山云网络技术有限公司 Date storage method, device and computer equipment
CN111176549B (en) * 2018-11-13 2021-05-18 杭州海康威视系统技术有限公司 Data storage method and device based on cloud storage and storage medium
CN110198435A (en) * 2019-05-14 2019-09-03 陈少能 Surveillance video data cloud storage system and cloud storage method
CN112383686B (en) * 2020-11-02 2023-01-13 浙江大华技术股份有限公司 Video processing method, video processing device, storage medium and electronic device
CN115134239A (en) * 2022-08-31 2022-09-30 广州市千钧网络科技有限公司 Client configuration method, system, electronic equipment and storage medium
CN115955581A (en) * 2023-03-15 2023-04-11 浪潮电子信息产业股份有限公司 Real-time video processing method, device, equipment and storage medium
CN116340055B (en) * 2023-03-28 2024-03-12 上海威固信息技术股份有限公司 Data recovery method and system for solid state disk

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728697A (en) * 2004-07-31 2006-02-01 西门子(中国)有限公司 Fault-tolerance method in application of request proxy structure of public object
JP2008108332A (en) * 2006-10-24 2008-05-08 Funai Electric Co Ltd Recording and reproducing device
CN102279779A (en) * 2011-08-29 2011-12-14 杭州海康威视数字技术股份有限公司 Method and device for realizing redundancy backup of video data on digital video recorder
CN102567538A (en) * 2011-12-31 2012-07-11 上海聚力传媒技术有限公司 Method and equipment used for providing object visiting information corresponding to vision operation of user

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060240806A1 (en) * 2001-07-18 2006-10-26 Saban Demirbasa Data security device
US8903773B2 (en) * 2010-03-31 2014-12-02 Novastor Corporation Computer file storage, backup, restore and retrieval
CN104202384A (en) * 2014-08-27 2014-12-10 四川长虹电器股份有限公司 File uploading and searching method of distributed file system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1728697A (en) * 2004-07-31 2006-02-01 西门子(中国)有限公司 Fault-tolerance method in application of request proxy structure of public object
JP2008108332A (en) * 2006-10-24 2008-05-08 Funai Electric Co Ltd Recording and reproducing device
CN102279779A (en) * 2011-08-29 2011-12-14 杭州海康威视数字技术股份有限公司 Method and device for realizing redundancy backup of video data on digital video recorder
CN102567538A (en) * 2011-12-31 2012-07-11 上海聚力传媒技术有限公司 Method and equipment used for providing object visiting information corresponding to vision operation of user

Also Published As

Publication number Publication date
CN108093207A (en) 2018-05-29

Similar Documents

Publication Publication Date Title
CN108093207B (en) Data storage and acquisition method and device
US8418003B2 (en) Log collecting apparatus, program, method, and system
CN103167026B (en) A kind of cloud store environmental data processing method, system and equipment
US9965542B2 (en) Method for data maintenance
CN107656695B (en) Data storage and deletion method and device and distributed storage system
CN108023746B (en) Video data processing method, device and system
CN107506266B (en) Data recovery method and system
WO2018233630A1 (en) Fault discovery
CN111176888B (en) Disaster recovery method, device and system for cloud storage
CN107092686B (en) File management method and device based on cloud storage platform
US10827205B2 (en) Video data storage system, operation method thereof, and retrieval server
CN103702053A (en) Video storage and search method and system as well as monitoring system
CN106959820A (en) A kind of data extraction method and system
WO2019024910A1 (en) Storage resource recovery method, apparatus and system
CN110389715B (en) Data storage method, storage server and cloud storage system
CN107908505A (en) A kind of date storage method, device, equipment and system
US11055259B2 (en) Method and system for deleting obsolete files from a file system
CN105635278A (en) Method for managing metadata of storage system and metadata server
CN113330426B (en) Method, device and system for backing up data
CN109560951A (en) A kind of configuration method, alarm real-time statistical method, server and system
US9852031B2 (en) Computer system and method of identifying a failure
CN116643704A (en) Storage management method, storage management device, electronic equipment and storage medium
CN106998436B (en) Video backup method and device
CN109669623B (en) File management method, file management device, electronic equipment and storage medium
CN109669814A (en) A kind of restoration methods of Metadata Service, device, equipment and readable storage medium storing program for executing

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