CN118410203A - Video data storage and video playback methods, devices and equipment - Google Patents
Video data storage and video playback methods, devices and equipment Download PDFInfo
- Publication number
- CN118410203A CN118410203A CN202410841297.8A CN202410841297A CN118410203A CN 118410203 A CN118410203 A CN 118410203A CN 202410841297 A CN202410841297 A CN 202410841297A CN 118410203 A CN118410203 A CN 118410203A
- Authority
- CN
- China
- Prior art keywords
- data
- video sequence
- encryption key
- identifier
- video
- 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.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 92
- 238000013500 data storage Methods 0.000 title description 6
- 238000012545 processing Methods 0.000 claims abstract description 20
- 238000004458 analytical method Methods 0.000 claims abstract description 10
- 238000004590 computer program Methods 0.000 claims description 10
- 238000005192 partition Methods 0.000 claims description 7
- 238000012795 verification Methods 0.000 claims description 4
- 239000000758 substrate Substances 0.000 claims 1
- 238000013507 mapping Methods 0.000 description 21
- 239000007787 solid Substances 0.000 description 16
- 238000010586 diagram Methods 0.000 description 15
- 238000000547 structure data Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012369 In process control Methods 0.000 description 1
- 210000004544 dc2 Anatomy 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000004190 ion pair chromatography Methods 0.000 description 1
Landscapes
- Television Signal Processing For Recording (AREA)
Abstract
The application provides a method, a device and equipment for storing and playing back video data, wherein the method comprises the following steps: obtaining a video sequence, the video sequence comprising a plurality of video frames; performing frame analysis on the video sequence to obtain structured data; acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters; and storing the index data. By the technical scheme, IO operations of a large number of databases can be reduced, and processing performance is improved.
Description
Technical Field
The present application relates to the field of data storage, and in particular, to a method and apparatus for storing video data, and a device for playing back video data.
Background
The storage device may acquire video data from a head-end device such as IPC (Internet Protocol Camera, web camera), analog camera, and the like, and store the video data. In addition to storing video data, it is also necessary to store parameters corresponding to the video data in a database. In this way, during the playback of video data, parameters corresponding to the video data can be read from the database, and the video data can be played back based on the parameters.
However, since the types of parameters corresponding to the video data are large, it is necessary to store a plurality of types of parameters in the database, and it is necessary to read a plurality of types of parameters from the database. Obviously, the storage and reading processes of these parameters need to be conducted for a plurality of IO operations of the database, and the processing performance is poor.
Disclosure of Invention
The application provides a storage method of video data, which comprises the following steps:
Obtaining a video sequence, the video sequence comprising a plurality of video frames;
Performing frame analysis on the video sequence to obtain structured data;
Acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters;
and storing the index data.
The application provides a video playback method, which comprises the following steps:
obtaining a video playback request from a client;
obtaining index data, and analyzing the index data to obtain structured data and protection parameters;
and acquiring a video sequence corresponding to the video playback request based on the structured data, performing protection operation on the video sequence by adopting the protection parameters, and returning the video sequence after the protection operation to the client.
The present application provides a storage device for video data, the device comprising:
An acquisition module for acquiring a video sequence, the video sequence comprising a plurality of video frames;
The processing module is used for carrying out frame analysis on the video sequence to obtain structured data; acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters;
And the storage module is used for storing the index data.
The present application provides a video playback apparatus, the apparatus comprising:
the acquisition module is used for acquiring a video playback request from the client;
the processing module is used for acquiring index data and analyzing the index data to obtain structured data and protection parameters; acquiring a video sequence corresponding to the video playback request based on the structured data, and performing protection operation on the video sequence by adopting the protection parameters;
and the sending module is used for returning the video sequence after the protection operation to the client.
The present application provides an electronic device including: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine-executable instructions to implement the above-described exemplary video data storage method of the present application; or the processor is configured to execute machine-executable instructions to implement the video playback method of the above-described examples of the present application.
The present application provides a machine-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the above-described exemplary video data storage method of the present application; or to implement the video playback method of the above-described example of the present application.
The present application provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described exemplary video data storage method of the present application; or the computer program, when executed by a processor, implements the video playback method of the above-described example of the application.
As can be seen from the above technical solutions, in the embodiments of the present application, the spliced index data is obtained by splicing the structured data and the protection parameters, and the index data is stored, instead of storing the structured data and the protection parameters in the database, so that the IO operations of a large number of databases can be reduced, and the processing performance is improved.
Drawings
FIG. 1A is a flow chart of a method of storing video data in an embodiment of the application;
FIG. 1B is a flow chart of a video playback method in one embodiment of the application;
FIG. 2 is a flow chart of a method of storing video data in an embodiment of the application;
FIG. 3 is a schematic diagram of a method of storing video data in one embodiment of the application;
FIG. 4 is a schematic diagram of a method of reading video data in an embodiment of the application;
FIG. 5 is a schematic diagram of a method of storing video data in one embodiment of the application;
FIG. 6 is a schematic diagram of a method of reading video data in one embodiment of the application;
fig. 7A is a schematic structural diagram of a storage device for video data in one embodiment of the present application;
fig. 7B is a schematic structural view of a video playback apparatus in one embodiment of the present application;
Fig. 8 is a hardware configuration diagram of an electronic device in an embodiment of the application.
Detailed Description
The embodiment of the application provides a method for storing video data, which can be applied to electronic equipment, such as storage equipment, and the like, and is shown in fig. 1A, and is a flow diagram of the method, and the method can comprise the following steps:
Step 101, a video sequence is acquired, the video sequence comprising a plurality of video frames.
Step 102, performing frame analysis on the video sequence to obtain structured data, wherein the structured data may include, but is not limited to: the start time of the video sequence, the end time of the video sequence, the offset address of the video sequence, and the offset address represents the corresponding storage location of the video sequence in the data disk.
And 103, acquiring protection parameters corresponding to the video sequence, and splicing the structural data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence. The index data is used for analyzing the index data in the video playback process to obtain structured data and protection parameters, a video sequence is obtained based on the structured data, and protection operation is carried out on the obtained video sequence by adopting the protection parameters.
Step 104, storing index data. For example, index data is stored in a data disk.
The protection parameter is a parameter related to a video sequence, and is used for protecting the video sequence, and the protection parameter is a parameter to be stored, and the protection parameter is not limited as long as the parameter related to the video sequence is to be stored. For example, the protection parameters may include, but are not limited to, encryption key information (e.g., encryption key or unique identification of encryption key) and/or an integrity signature value. Of course, the encryption key information and the integrity signature value are just two examples, and the protection parameters may also include other parameters.
Illustratively, the protection parameters may include encryption key information, and the encryption key information may include an encryption key or a unique identification of the encryption key used to encrypt the video sequence to obtain an encrypted video sequence. The method further comprises the steps of: the encrypted video sequence is stored.
For example, after obtaining a video sequence, an encryption key is obtained, the video sequence is encrypted by using the encryption key to obtain an encrypted video sequence, and the encrypted video sequence is stored in a data disk.
After the encryption key is obtained, the encryption key itself may be determined as encryption key information, or a unique identification of the encryption key may be determined as encryption key information. Further, when the encryption key information is used as a unique identification of the encryption key, then: if the mapping relationship between the unique identifier of the encryption key and the encryption key is not stored currently, the mapping relationship between the unique identifier of the encryption key and the encryption key can be stored in the data disk. If the mapping relation between the unique identification of the encryption key and the encryption key is stored currently, the mapping relation between the unique identification of the encryption key and the encryption key is not stored in the data disk.
If the protection parameter includes encryption key information, when the structured data and the encryption key information are spliced, the first identifier is in front of the structured data, and the second identifier is in front of the encryption key information.
For example, after the index data is spliced, the index data includes the first identifier, the structured data, the second identifier, and the encryption key information in this order. Based on this, after parsing from the index data to the first and second identifications, the content located between the first and second identifications is determined as structured data, and the content located after the second identification is determined as encryption key information.
Or after the index data is spliced, the index data sequentially comprises the second identifier, the encryption key information, the first identifier and the structured data. Based on this, after parsing from the index data to the second identifier and the first identifier, the content located between the second identifier and the first identifier is determined as encryption key information, and the content located after the first identifier is determined as structured data.
Illustratively, the protection parameter may include an integrity signature value; the obtaining protection parameters corresponding to the video sequence may include, but is not limited to: after obtaining the encrypted video sequence (the video sequence is encrypted by adopting an encryption key to obtain the encrypted video sequence), calculating an integrity signature value corresponding to the encrypted video sequence.
If the protection parameter includes an integrity signature value, when the structured data, the encryption key information and the integrity signature value are spliced, the front of the structured data may be the first identifier, the front of the encryption key information may be the second identifier, and the front of the integrity signature value may be the third identifier.
Regarding the positional relationship of the structured data, the encryption key information, and the integrity signature value, the positional relationship of the structured data, the encryption key information, and the integrity signature value may be arbitrarily configured without limitation in the embodiment. For example, the structured data may be located before the encryption key information, and the encryption key information may also be located before the structured data. The structured data may precede the integrity signature value, which may also precede the structured data. The encryption key information may be preceded by an integrity signature value, which may also be preceded by the encryption key information.
For example, after the index data is spliced, the index data includes the first identifier, the structured data, the second identifier, the encryption key information, the third identifier, and the integrity signature value in this order. Based on this, after parsing from the index data to the first, second, and third identifications, the content located between the first and second identifications is determined as structured data, the content located between the second and third identifications is determined as encryption key information, and the content located after the third identification is determined as an integrity signature value.
Or after the index data is spliced, the index data sequentially comprises a second identifier, encryption key information, a first identifier, structured data, a third identifier and an integrity signature value. Based on this, after parsing from the index data to the second identifier, the first identifier, and the third identifier, the content located between the second identifier and the first identifier is determined as encryption key information, the content located between the first identifier and the third identifier is determined as structured data, and the content located after the third identifier is determined as an integrity signature value.
Of course, the above is just two examples, and the positional relationship is not limited.
In a preferred embodiment, after the structured data, the encryption key information, and the integrity signature value are spliced to obtain the index data, the index data includes, in order, the first identifier, the structured data, the third identifier, the integrity signature value, the second identifier, and the encryption key information. Based on this, after parsing from the index data to the first identifier, the third identifier, and the second identifier, the content located between the first identifier and the third identifier is determined as structured data, the content located between the third identifier and the second identifier is determined as an integrity signature value, and the content located after the second identifier is determined as encryption key information.
Illustratively, storing index data (e.g., storing index data on a data disk) may include, but is not limited to: acquiring data security corresponding to the video sequence; the data security may be a high security storage requirement, a medium security storage requirement or a low security storage requirement; n index data are generated based on the index data, N may be a positive integer greater than 1. Based on the above, if the data security is a high security storage requirement, the N index data may be stored in the data disks of the N storage nodes respectively; or if the data security is the medium security storage requirement, respectively storing N parts of index data into N data disks of a storage node; or if the data security is a low security storage requirement, the N index data may be stored to N data partitions of a data disk of a storage node respectively.
Illustratively, when index data is stored in a data disk, the data disk includes, but is not limited to, a mechanical hard disk (HARD DISK DRIVE, HDD). When the encrypted video sequence is stored in a data disk, the data disk includes, but is not limited to, a mechanical hard disk or a Solid state disk (Solid STATE DISK, SSD). When the unique identification of the encryption key and the encryption key are stored in the data disk, the data disk includes, but is not limited to, a mechanical hard disk.
As can be seen from the above technical solutions, in the embodiments of the present application, the video sequence is protected by using the protection parameters, and the protected video sequence is stored in the data disk, so that even if an attacker obtains the stored video sequence from the storage device, the attacker cannot decrypt the video sequence, thereby avoiding disclosure of private information or sensitive information, and improving data security. The structure data and the protection parameters are spliced to obtain spliced index data, and the index data is stored in a data disk instead of respectively storing the structure data and the protection parameters in the database, so that IO operations of a large number of databases can be reduced, and the processing performance is improved. By storing the index data to the data disk, the space of the index disk of the database (the space of the index disk of the database occupies the space of the solid state disk) is not required to be additionally occupied, obviously, the space of the mechanical hard disk is occupied by the data disk, and the cost of the mechanical hard disk is greatly reduced relative to the cost of the solid state disk.
The embodiment of the application provides a video playback method, which can be applied to electronic equipment, such as storage equipment, and the like, and is shown in fig. 1B, and is a flow diagram of the video playback method, and the method can include:
step 111, obtaining a video playback request from the client.
Step 112, obtain the index data (e.g. obtain the index data from the data disk), and parse the index data to obtain the structured data and the protection parameters.
And 113, acquiring a video sequence corresponding to the video playback request based on the structured data, performing protection operation on the video sequence by adopting the protection parameters, and returning the video sequence after the protection operation to the client.
Illustratively, the obtaining the video sequence (e.g., the encrypted video sequence) corresponding to the video playback request based on the structured data may include, but is not limited to: determining a first time interval based on a start time and an end time in the structured data, and determining a second time interval based on a playback start time and a playback end time in the video playback request; if the first time interval and the second time interval have overlapping time, acquiring an encrypted video sequence corresponding to the offset address from the data disk based on the offset address in the structured data.
Illustratively, the protection parameter may include encryption key information, and the encryption key information includes an encryption key or a unique identification of the encryption key. Based on this, the protection operation for the video sequence using the protection parameters may include, but is not limited to: and if the video sequence is the encrypted video sequence, decrypting the encrypted video sequence by adopting an encryption key corresponding to the encryption key information to obtain a decrypted video sequence.
The encryption key corresponding to the encryption key information may also be obtained before decrypting the encrypted video sequence using the encryption key corresponding to the encryption key information. For example, if the encryption key information is a unique identifier of the encryption key, the encryption key corresponding to the unique identifier is obtained from the data disk; if the encryption key information is the encryption key itself, the encryption key information is used as the encryption key.
If the protection parameter includes encryption key information, when the index data is analyzed to obtain the structured data and the encryption key information, when the index data is analyzed to the first identifier, the content behind the first identifier can be determined to be the structured data; upon parsing from the index data to the second identification, contents following the second identification may be determined as encryption key information. For example, if the index data includes the first identifier, the structured data, the second identifier, and the encryption key information in this order, the content located between the first identifier and the second identifier is determined as the structured data, and the content located behind the second identifier is determined as the encryption key information.
Illustratively, the protection parameters may include an integrity signature value based on which the video sequence is protected with the protection parameters, which may include, but are not limited to: carrying out integrity check on the encrypted video sequence by adopting an integrity signature value; if the integrity check is successful, executing the operation of decrypting the encrypted video sequence by adopting an encryption key corresponding to the encryption key information to obtain a decrypted video sequence; if the integrity check fails, the encrypted video sequence may be discarded without decrypting the encrypted video sequence.
If the protection parameter includes an integrity signature value, when the index data is parsed to obtain the structured data, the encryption key information and the integrity signature value, when the first identifier is parsed from the index data, the content behind the first identifier can be determined to be the structured data; when parsing from the index data to the second identifier, determining the content following the second identifier as encryption key information; upon parsing from the index data to the third identifier, content following the third identifier may be determined to be an integrity signature value.
For example, if the index data sequentially includes a first identifier, structured data, a third identifier, an integrity signature value, a second identifier, and encryption key information, then the content located between the first identifier and the third identifier is determined to be structured data, the content located between the third identifier and the second identifier is determined to be the integrity signature value, and the content located after the second identifier is determined to be encryption key information.
As can be seen from the above technical solutions, in the embodiments of the present application, the video sequence is protected by using the protection parameters, and the protected video sequence is stored in the data disk, so that even if an attacker obtains the stored video sequence from the storage device, the attacker cannot decrypt the video sequence, thereby avoiding disclosure of private information or sensitive information, and improving data security. The structure data and the protection parameters are spliced to obtain spliced index data, and the index data is stored in a data disk instead of respectively storing the structure data and the protection parameters in the database, so that IO operations of a large number of databases can be reduced, and the processing performance is improved. By storing the index data to the data disk, the space of the index disk of the database (the space of the index disk of the database occupies the space of the solid state disk) is not required to be additionally occupied, obviously, the space of the mechanical hard disk is occupied by the data disk, and the cost of the mechanical hard disk is greatly reduced relative to the cost of the solid state disk.
The embodiment of the application provides a method for storing video data, which can be applied to electronic equipment, such as storage equipment, and the like, and is shown in fig. 2, and is a flow diagram of the method, and the method can comprise the following steps:
step 201, a video sequence is acquired, the video sequence comprising a plurality of video frames.
Step 202, performing frame analysis on the video sequence to obtain structured data. Wherein the structured data may include, but is not limited to: the start time of the video sequence, the end time of the video sequence, the offset address of the video sequence, and the offset address represents the corresponding storage location of the video sequence in the data disk.
And 203, acquiring an encryption key, encrypting the video sequence by adopting the encryption key to obtain an encrypted video sequence, and storing the encrypted video sequence to a second data disk.
And 204, calculating an integrity signature value corresponding to the encrypted video sequence.
Step 205, obtaining encryption key information. For example, the encryption key may be determined as encryption key information, or a unique identification of the encryption key may be determined as encryption key information.
And 206, splicing the encryption key information, the structured data and the integrity signature value to obtain spliced index data, and storing the index data to a first data disk.
For example, when the encryption key information is the unique identifier of the encryption key, if the mapping relationship between the unique identifier of the encryption key and the encryption key is not stored, the mapping relationship between the unique identifier of the encryption key and the encryption key is stored in the third data disk. If the mapping relation between the unique identification of the encryption key and the encryption key is stored, the mapping relation between the unique identification of the encryption key and the encryption key is not stored in the third data disk.
For example, after the encryption key information, the structured data, and the integrity signature value are spliced to obtain spliced index data, the index data may include, in order, a first identifier, the structured data, a third identifier, the integrity signature value, a second identifier, and the encryption key information. Wherein after parsing from the index data to the first identifier, the third identifier, and the second identifier, the content located between the first identifier and the third identifier may be determined as structured data, the content located between the third identifier and the second identifier may be determined as an integrity signature value, and the content located after the second identifier may be determined as encryption key information.
Of course, the above is only an example of the positional relationship among the encryption key information, the structured data, and the integrity signature value, the encryption key information may be located in front of the structured data, the encryption key information may be located in front of the integrity signature value, the integrity signature value may also be located in front of the structured data, and the positional relationship is not limited as long as the first identifier is located in front of the structured data, the third identifier is located in front of the integrity signature value, and the second identifier is located in front of the encryption key information.
Based on the above-mentioned storage method of video data, the embodiment of the application also provides a video playback method, which may include: and obtaining a video playback request from the client, obtaining index data from the first data disk (such as obtaining a plurality of index data from the first data disk), and analyzing the index data to obtain structured data, an integrity signature value and encryption key information.
For each index data, if the starting time and the ending time in the structured data of the index data are not matched with the time information in the video playback request, continuing to traverse the next index data until all index data are traversed, or finding the index data matched with the time information in the video playback request. If the starting time and the ending time in the structured data of the index data are matched with the time information in the video playback request, acquiring an encrypted video sequence corresponding to the offset address from the second data disk based on the offset address in the structured data, and continuing to traverse the next index data until all the index data are traversed, or finding all the index data matched with the time information in the video playback request.
For example, a first time interval may be determined based on a start time and an end time in the structured data, and a second time interval may be determined based on a playback start time and a playback end time in the video playback request. If the first time interval and the second time interval have overlapping time, the structured data are matched with the video playback request, otherwise, if the first time interval and the second time interval do not have overlapping time, the structured data are not matched with the video playback request.
After the encrypted video sequence corresponding to the offset address is obtained from the second data disk, the integrity signature value in the index data may be used to perform integrity check on the encrypted video sequence. If the integrity check fails, the encrypted video sequence may be discarded. If the integrity check is successful, an encryption key corresponding to the encryption key information in the index data can be obtained, and the encrypted video sequence is decrypted by adopting the encryption key, so that an unencrypted video sequence is obtained. If the encryption key information is a unique identification of the encryption key, the encryption key corresponding to the unique identification can be obtained from the third data disk; if the encryption key information is the encryption key itself, the encryption key information may be used as the encryption key.
As can be seen from the above technical solutions, in the embodiments of the present application, the encryption key information, the structured data, and the integrity signature value are spliced to obtain the spliced index data, and the index data is stored in the first data disk, instead of storing the encryption key information, the structured data, and the integrity signature value in the database, which can reduce the IO operations of a large number of databases and improve the processing performance. By storing the index data to the first data disk, the first data disk occupies the space of the mechanical hard disk without additionally occupying the space of an index disk (the space of the solid state disk) of the database, and the cost of the mechanical hard disk is reduced relative to the cost of the solid state disk.
The technical scheme of the embodiment of the application is described below with reference to specific application scenarios.
In a possible embodiment, referring to fig. 3, a schematic diagram of a method for storing video data, the method may be applied to a storage device, and the method may include the steps of:
Step 1, the storage device acquires a video stream from a front-end device (such as IPC). For example, after the front-end device accesses the storage device, the video access module of the storage device may obtain the video stream from the front-end device.
Step 2, the storage device generates a video sequence based on the video stream, the video sequence comprising a plurality of video frames.
The video sequence may be a GOP (Group Of pictures) sequence, for example, but not limited to, other video frame sets. A GOP sequence represents a set of video frames over a short period of time, say, assuming a frame rate of 25 and an i-frame interval of 50, one GOP sequence represents a set of 2 seconds of video frames, and a GOP sequence may include 50 video frames.
After obtaining a video stream (i.e., streaming video data), the storage device may reorganize the video stream to obtain a GOP sequence, where the GOP sequence includes a set of video frames between two adjacent I frames, i.e., the first frame of the GOP sequence is an I frame, and the GOP sequence includes all P frames following the I frame.
Step 3, the storage device performs frame analysis on the video sequence to obtain structured data, and the structured data is used for locating (retrieving) the video sequence during video playback, and the process is described in the following embodiments.
The structured data may include, for example, a start time of the video sequence, an end time of the video sequence, an offset address of the video sequence. Of course, the structured data may include an I-frame size, GOP sequence number, etc. in addition to the above information, and is not limited thereto.
And 4, the storage device calls an encryption card (such as a hardware encryption card), acquires an encryption key through the encryption card, and encrypts the video sequence by adopting the encryption key to obtain an encrypted video sequence.
Illustratively, the video sequence is video plaintext data, the encryption card may encrypt the video sequence using an encryption key to obtain an encrypted video sequence, and the encrypted video sequence is video ciphertext data. When the video sequence is encrypted by adopting the encryption key, the video sequence can be encrypted by adopting a symmetric encryption algorithm (such as SM4 algorithm and the like), and can be encrypted by adopting other algorithms, so that the method is not limited.
Illustratively, the encryption card may update the encryption key periodically when it obtains the encryption key, e.g., encryption key a1 may be used for video sequences at 0-2, encryption key a2 may be used for video sequences at 2-4, encryption key a3 may be used for video sequences at 4-6, and so on.
And 5, the storage equipment calculates an integrity signature value corresponding to the encrypted video sequence.
For example, an integrity protection algorithm may be used to calculate an integrity signature value corresponding to the encrypted video sequence, where the integrity protection algorithm is a hash algorithm (such as SM3 algorithm, etc.), a hash operation may be performed on the encrypted video sequence, and a hash operation result is used as the integrity signature value corresponding to the encrypted video sequence.
For example, the storage device invokes an encryption card (e.g., a hardware encryption card), and performs a hash operation on the encrypted video sequence by using the encryption card to obtain an integrity signature value corresponding to the encrypted video sequence.
And 6, the storage device stores the structured data into a database.
And 7, the storage device stores the encryption key in a database.
Illustratively, the encryption key is stored in the database each time the encryption key is updated, and the encryption key need not be stored in the database when the encryption key is not updated. For example, when the encryption key is updated to the encryption key a1, the encryption key a1 is stored in the database, and when the encryption key a1 corresponds to 0-2, it means that all video sequences at 0-2 correspond to the encryption key a1. When the encryption key is updated to the encryption key a2, the encryption key a2 is stored in the database, and so on.
And 8, the storage device stores the integrity signature value into a database.
And 9, the storage device stores the encrypted video sequence into a data disk.
For example, when storing the encrypted video sequence to the data disk, a corresponding storage location (i.e., an offset address of the video sequence) of the encrypted video sequence in the data disk may be determined first, and the structured data may also include the offset address of the video sequence. Based on this, the encrypted video sequence can be stored to a position in the data disk corresponding to the offset address of the video sequence.
The offset address may include a start address and a data length, or the offset address may include a start address and an end address, without limitation as long as the storage location of the video sequence can be represented.
In one possible implementation, referring to fig. 4, a schematic diagram of a method for reading video data (i.e., playing back video), where the method may be applied to a storage device, the method may include:
Step 1, a storage device obtains a video playback request from a client, wherein the video playback request can comprise an IPC identifier, a playback start time and a playback end time, and the video playback request indicates that video data acquired by an IPC corresponding to the IPC identifier needs to be retrieved and video data located between the playback start time and the playback end time needs to be retrieved.
For example, a video playback module of a storage device may obtain a video playback request from a client.
And 2, the storage equipment inquires structured data corresponding to the video playback request from the database.
For example, for each structured data in the database, which structured data comprises a start time of the video sequence and an end time of the video sequence, a time interval 1 corresponding to the structured data (i.e. from the start time to the end time) may be determined, and a time interval 2 corresponding to the video playback request (i.e. from the playback start time to the playback end time) may be determined. If there is an overlapping time between time interval 1 and time interval 2, the structured data is structured data corresponding to a video playback request. If there is no overlapping time between time interval 1 and time interval 2, the structured data is not structured data corresponding to the video playback request.
For example, if the video playback request includes IPC identifier 1, all structured data corresponding to IPC identifier 1 is queried from the database. For each structured data corresponding to IPC identifier 1, if there is an overlapping time between the time interval corresponding to the structured data and time interval 2, the structured data is the structured data corresponding to the video playback request. If the time interval corresponding to the structured data does not overlap with the time interval 2, the structured data is not the structured data corresponding to the video playback request.
For example, the structured data may further include an IPC identifier, which indicates that the structured data corresponds to video data collected by an IPC corresponding to the IPC identifier, and based on this, since the structured data includes the IPC identifier, all the structured data corresponding to the IPC identifier 1 may be queried from the database.
And step 3, the storage device acquires an offset address (such as a start address and a data length) in the structured data.
For example, since the structured data includes the offset address, the offset address can be obtained from the structured data corresponding to the video playback request after the structured data is obtained.
And 4, the storage device acquires the encrypted video sequence corresponding to the offset address from the data disk.
And 5, the storage equipment reads the integrity signature value of the encrypted video sequence from the database.
For example, when the storage device stores the integrity signature value in the database, the unique identification of the video sequence (i.e., the unique identification of the data, such as the GOP sequence number, etc.) may be stored with the integrity signature value in the database. When the storage device stores structured data in a database, the structured data may also include a unique identification of the video sequence. Thus, after obtaining the structured data corresponding to the video playback request, based on the unique identifier in the structured data, the integrity signature value corresponding to the unique identifier may be read from the database.
And 6, the storage equipment adopts the integrity signature value to carry out integrity check on the encrypted video sequence.
For example, the storage device calculates an integrity signature value a corresponding to the encrypted video sequence, for example, an integrity protection algorithm is used to calculate the integrity signature value a corresponding to the encrypted video sequence, and taking the integrity protection algorithm as a hash algorithm (such as SM3 algorithm) as an example, hash operation can be performed on the encrypted video sequence, and the hash operation result is used as the integrity signature value a. For example, the storage device invokes an encryption card (e.g., a hardware encryption card), and performs a hash operation on the encrypted video sequence using the encryption card to obtain the integrity signature value a.
Assuming that the integrity signature value B is read from the database, if the integrity signature value a is the same as the integrity signature value B, the integrity check is successful, which means that the encrypted video sequence is not tampered, and the encrypted video sequence is complete, and step 7 is executed at this time. If the integrity signature value a is different from the integrity signature value B, the integrity check fails, which means that the encrypted video sequence is tampered, and step 7 is not executed at this time.
And 7, the storage device reads the encryption key of the encrypted video sequence from the database.
For example, when the storage device stores the encryption key in the database, the time interval (e.g., 0-2 hours, 2-4 hours, etc.) may be stored to the database along with the encryption key. Based on this, after obtaining the structured data corresponding to the video playback request, a time interval corresponding to the structured data (that is, the starting time and the ending time belong to the time interval) may be determined based on the starting time to the ending time in the structured data, so that the storage device may read the encryption key corresponding to the time interval from the database.
And 8, the storage equipment adopts the encryption key to decrypt the encrypted video sequence (namely video ciphertext data) to obtain an unencrypted video sequence (namely video plaintext data).
For example, the storage device invokes an encryption card (e.g., a hardware encryption card) that can use the encryption key to decrypt the encrypted video sequence to obtain an unencrypted video sequence. When the encrypted video sequence is decrypted by adopting the encryption key, the encrypted video sequence can be decrypted by adopting a symmetric encryption algorithm (such as SM4 algorithm and the like), and the encrypted video sequence can also be decrypted by adopting other algorithms.
After the unencrypted video sequence is obtained, the storage device may also return the video sequence to the client, which plays the video sequence, without limitation to the processing of the client.
In the process, the video sequence is stored in an encrypted mode, so that the situation that privacy information or sensitive information cannot be revealed after video data are lost can be ensured, and the data safety is improved. By carrying out integrity protection on the video sequence, whether the video sequence is tampered or not can be detected, and the data security is further improved.
In the above procedure, for the storage procedure of video data, it is necessary to store structured data in a database, an encryption key in a database, and an integrity signature value in a database. For the process of reading video data, structured data needs to be read from the database, an encryption key is read from the database, and an integrity signature value is read from the database, which causes the following problems:
1: the database has more read-write IO and affects the performance. When video data is written, an encryption key, an integrity signature value and structured data are required to be stored in a database, when video data is played back, the information is required to be read from the database, and more database IOs can cause software performance bottlenecks. For example, as the frequency of access to databases by storage devices increases, the overall performance of the software is affected to some extent.
Taking a 4Mbps code stream, a frame rate of 25, an I frame interval of 50, and 1 hour of writing as an example, the database writing frequency is as follows: structured data was written 1 hour 60 minutes 60 seconds/2 sec per GOP = 1800 times, and integrity signature values were written 4mbps 1 hour 60 minutes 60 seconds/2 MB = 900 times.
2: A large amount of database index disk space is needed, and because the index disk space of the database is realized based on the solid state disk and the cost of the solid state disk is high, the cost of the large amount of index disk space of the database is high.
Each structured data includes: start time, end time, offset address, I frame size, GOP number, etc., which occupy about 56 bytes. Taking a 4Mbps code stream, a frame rate of 25, an I-frame interval of 50, and writing for 1 hour as an example, the number of video sequences (GOP sequences) is 1 hour by 60 minutes by 60 seconds/2 sec per GOP =1800, the occupied space is 1800 by 56 bytes=100 KB, and the occupied space of one IPC is 100KB by 24 hours in 1 day, that is, the occupied space is about 2.5MB. Each integrity signature value is 96 bytes, taking a 4Mbps code stream, a frame rate of 25, an I-frame interval of 50 and writing for 1 hour as an example, the number of the integrity signature values is 4Mbps x1 hour x 60 minutes x 60 seconds/2 mb=900, the occupied space is 900 x 96 bytes=86 KB, the occupied space of one IPC at 1 day is 100KB x 24 hours, and the occupied space is about 2MB.
According to the example that the storage device is accessed with 500 IPCs, the storage period of the video data is 30 days, and the storage device additionally needs 500 additional database spaces (2mb+2.5mb) for 30 days, which is about 67GB.
3: The video data cannot be recovered after the database is damaged. If the database is corrupted, this results in the loss of the encryption key, integrity signature value, structured data. Obviously, after the encryption key is lost, the video data cannot be decrypted and cannot be viewed. After loss of the integrity signature value, the data integrity protection function will be disabled. After the structured data is lost, it will result in the inability of the video data to locate playback.
In a possible implementation manner, referring to fig. 5, a schematic diagram of a storage method of video data is shown, where the method may be applied to a storage device, and the storage device may be a cloud storage device or other storage devices, and the method may not limit the type of the storage device, and may include:
Step 1, the storage device acquires a video stream from a front-end device (such as IPC). For example, after the front-end device accesses the storage device, the video access module of the storage device may obtain the video stream from the front-end device.
Step 2, the storage device generates a video sequence based on the video stream, the video sequence comprising a plurality of video frames.
The video sequence may be, for example, a GOP sequence, which represents a set of video frames over a short period of time, or other set of video frames. After obtaining the video stream, the storage device may reorganize the video stream to obtain a GOP sequence including a set of video frames between two adjacent I frames.
And 3, carrying out frame analysis on the video sequence by the storage device to obtain structured data, wherein the structured data can comprise the starting time of the video sequence, the ending time of the video sequence and the offset address of the video sequence.
And 4, the storage device acquires an encryption key, and encrypts the video sequence by adopting the encryption key to obtain an encrypted video sequence. For example, the storage device invokes an encryption card (e.g., a hardware encryption card), obtains an encryption key from the encryption card, and encrypts the video sequence using the encryption key to obtain an encrypted video sequence.
Illustratively, the encryption card may update the encryption key periodically when it obtains the encryption key, e.g., encryption key a1 may be used for video sequences at 0-2, encryption key a2 may be used for video sequences at 2-4, encryption key a3 may be used for video sequences at 4-6, and so on.
And 5, the storage equipment calculates an integrity signature value corresponding to the encrypted video sequence. For example, the storage device invokes an encryption card (e.g., a hardware encryption card), and performs hash operation on the encrypted video sequence through the encryption card to obtain an integrity signature value (i.e., a hash operation result) corresponding to the encrypted video sequence.
And 6, splicing the encryption key information, the structured data and the integrity signature value by the storage equipment to obtain spliced index data (index), wherein the index data is a spliced data structure.
For example, the encryption key may be used as encryption key information, in which case, even if all video sequences within a certain time interval (e.g., 0-2) use the same encryption key, the encryption key used by each video sequence may be spliced into the index data.
For example, the unique identification of the encryption key may be used as encryption key information, in which case, when all video sequences within a certain time interval (e.g., 0-2) use the same encryption key, then, for each video sequence, only the unique identification of the encryption key may be spliced into the index data.
In addition, in order to find the encryption key corresponding to the unique identifier, the mapping relationship between the unique identifier of the encryption key and the encryption key may also be stored in a third data disk, and the third data disk may be a mechanical hard disk.
For example, for the first video sequence of the time interval, the mapping relationship between the unique identification of the encryption key and the encryption key is not yet stored, and therefore, the mapping relationship between the unique identification of the encryption key and the encryption key is stored to the third data disk. For the non-first video sequence of the time interval, the mapping relationship between the unique identification of the encryption key and the encryption key is already stored, and the mapping relationship does not need to be stored.
Illustratively, when the encryption key information, the structured data, and the integrity signature value are concatenated, a first identifier may be set for the structured data (indicating that the first identifier is followed by the structured data), a second identifier may be set for the integrity signature value (indicating that the second identifier is followed by the integrity signature value), and a third identifier may be set for the encryption key information (indicating that the third identifier is followed by the encryption key information).
Regarding the order of the encryption key information, the structured data, and the integrity signature value in the index data, no limitation is made in the present embodiment. For example, the encryption key information may be located in front of the structured data, or the encryption key information may be located in back of the structured data. The encryption key information may be located before the integrity signature value, or the encryption key information may be located after the integrity signature value. The structured data may be located before the integrity signature value or the structured data may be located after the integrity signature value.
For example, considering that structured data needs to be used first, then the integrity signature value and then the encryption key information during video playback, the structured data may be located in front of the signature of the integrity signature value and the integrity signature value may be located in front of the encryption key information. Based on this, the index data may include, in order, a first identifier, structured data, a second identifier, an integrity signature value, a third identifier, and encryption key information. In the video playback process, after parsing from the index data to the first identifier, the second identifier, and the third identifier, the content located between the first identifier and the second identifier may be determined as structured data, the content located between the second identifier and the third identifier may be determined as an integrity signature value, and the content located after the third identifier may be determined as encryption key information.
And 7, the storage device stores the multiple copies of the index data to the first data disk. When storing the index data to the first data disk, the index data may be persistently stored in the first data disk.
The storage device stores index data to a data disk instead of storing the index data to a database, and the index data may be stored by a mechanical hard disk, because the data disk may be a mechanical hard disk instead of a solid state hard disk. In addition, multiple copies of index data can be copied, and multiple copies of index data are stored in multiple data disks, so that index data loss caused by failure of a certain data disk is avoided.
For example, the data security corresponding to the video sequence may be acquired, where the data security may be a high security storage requirement, a medium security storage requirement, or a low security storage requirement. For example, the user may configure the data security corresponding to the video sequence according to the actual requirement, for example, the user configures the high security storage requirement corresponding to all video sequences in the time interval 1, configures the medium security storage requirement corresponding to all video sequences in the time interval 2, and so on. Of course, other ways of obtaining data security may be employed.
N index data may be generated based on the index data, and N may be a positive integer greater than 1. For example, the index data may be copied to obtain N index data in total.
If the data security is a high security storage requirement, the N index data may be stored to the data disks of the N storage nodes, respectively. For example, the storage system may be configured with a plurality of storage nodes in a distributed manner, N storage nodes may be selected from the plurality of storage nodes, and N index data are stored in data disks of the N storage nodes, that is, the data disk of each storage node stores one index data.
If the data security is the medium security storage requirement, the N index data may be stored in N data disks of one storage node respectively. For example, the storage system may be distributed to deploy a plurality of storage nodes, one storage node may be selected from the plurality of storage nodes, and the storage node may include a plurality of data disks, N data disks may be selected from the plurality of data disks, and N index data may be stored in the N data disks of the storage node, respectively, that is, each data disk stores one index data.
If the data security is a low security storage requirement, the N index data may be stored to N data partitions of a data disk of a storage node, respectively. For example, the storage system may be distributed to deploy a plurality of storage nodes, one storage node may be selected from the plurality of storage nodes, one data disk may be selected from the plurality of data disks of the storage node, and N index data may be stored in N data partitions of the data disk, respectively, that is, each data partition stores one index data.
For example, when the mapping relationship between the unique identifier of the encryption key and the encryption key is stored in the third data disk, multiple copies of the mapping relationship may also be stored in the third data disk (the third data disk may be a mechanical hard disk), so as to avoid that the mapping relationship is lost due to a fault of a certain data disk. For example, N shares of the mapping relationship may be generated based on the mapping relationship. If the data security is a high security storage requirement, the N mapping relations can be respectively stored to the data disks of the N storage nodes. Or if the data security is the medium security storage requirement, the N mapping relations can be respectively stored into N data disks of one storage node. Or if the data security is a low security storage requirement, the N mapping relationships may be stored to N data partitions of a data disk of a storage node respectively.
And 8, the storage device stores the encrypted video sequence in a second data disk.
For example, when storing the encrypted video sequence to the data disk, a corresponding storage location (i.e., an offset address of the video sequence) of the encrypted video sequence in the data disk may be determined first, and the structured data may also include the offset address of the video sequence. Based on this, the encrypted video sequence can be stored to a position in the data disk corresponding to the offset address of the video sequence.
The offset address may include a start address and a data length, or the offset address may include a start address and an end address, without limitation as long as the storage location of the video sequence can be represented.
The second data disk may include, but is not limited to, a mechanical hard disk or a solid state disk, and may store the encrypted video sequence through the mechanical hard disk or the solid state disk.
In one possible implementation, referring to fig. 6, a schematic diagram of a method for reading video data (i.e., playing back video), where the method may be applied to a storage device, the method may include:
Step 1, a storage device obtains a video playback request from a client, wherein the video playback request can comprise an IPC identifier, a playback start time and a playback end time, and the video playback request indicates that video data acquired by an IPC corresponding to the IPC identifier needs to be retrieved and video data located between the playback start time and the playback end time needs to be retrieved.
For example, a video playback module of a storage device may obtain a video playback request from a client.
And 2, the storage device reads the index data from the first data disk.
By way of example, since the first data disk includes a plurality of index data, each index data may be traversed in turn from the first data disk. It should be noted that since the index data is stored in multiple copies, it is also possible to traverse the index data from other data disks when one data disk fails.
And 3, analyzing the index data by the storage device to obtain structured data according to each index data.
For example, if the index data includes the first identifier, the structured data, the second identifier, the integrity signature value, the third identifier, and the encryption key information in this order, after parsing the index data into the first identifier and the second identifier, the content located between the first identifier and the second identifier is determined as the structured data.
And step 4, if the structured data is matched with the video playback request, the storage device acquires an offset address in the structured data, wherein the offset address can comprise a starting address and a data length.
Illustratively, for each index data, if the structured data in the index data matches the video playback request, then subsequent steps are performed based on the index data. If the structured data in the index data does not match the video playback request, then no subsequent steps are performed based on the index data.
For example, a first time interval may be determined based on a start time and an end time in the structured data, and a second time interval may be determined based on a playback start time and a playback end time in the video playback request. If the first time interval and the second time interval have overlapping time, the structured data is matched with the video playback request, otherwise, if the first time interval and the second time interval have no overlapping time, the structured data is not matched with the video playback request.
For example, if the video playback request further includes an IPC identifier and the structured data also includes an IPC identifier, then if the IPC identifier in the structured data is different from the IPC identifier in the video playback request, the structured data does not match the video playback request. If the IPC identifier in the structured data is the same as the IPC identifier in the video playback request, comparing whether the first time interval and the second time interval have overlapping time.
And step 5, based on the offset address in the structured data, the storage device acquires the encrypted video sequence corresponding to the offset address from the second data disk. For example, from the start address of the second data disk, the video data corresponding to the data length is read, and the read video data is an encrypted video sequence.
And 6, the storage equipment analyzes the index data to obtain an integrity signature value of the encrypted video sequence.
For example, if the index data includes the first identifier, the structured data, the second identifier, the integrity signature value, the third identifier, and the encryption key information in this order, after parsing from the index data to the second identifier and the third identifier, the content located between the second identifier and the third identifier is determined as the integrity signature value.
And 7, the storage equipment adopts the integrity signature value to carry out integrity check on the encrypted video sequence.
For example, the storage device calculates an integrity signature value a corresponding to the encrypted video sequence, for example, the storage device calls an encryption card (such as a hardware encryption card), and hashes the encrypted video sequence by using a hash algorithm (such as an SM3 algorithm) through the encryption card to obtain the integrity signature value a (i.e., a hash operation result).
Assuming that the index data is analyzed to obtain an integrity signature value B, if the integrity signature value A is the same as the integrity signature value B, the integrity check is successful, which means that the encrypted video sequence is not tampered, the encrypted video sequence is complete, and step 8 is executed at this time. If the integrity signature value a is different from the integrity signature value B, the integrity check fails, which means that the encrypted video sequence is tampered, and step 8 is not executed at this time.
And 8, the storage equipment analyzes the index data to obtain encryption key information of the encrypted video sequence.
For example, if the index data includes the first identifier, the structured data, the second identifier, the integrity signature value, the third identifier, and the encryption key information in this order, after parsing from the index data to the third identifier, the content located after the third identifier may be determined as the encryption key information.
After the encryption key information is obtained, an encryption key corresponding to the encryption key information may also be obtained. For example, if the encryption key information is a unique identifier of the encryption key, the encryption key corresponding to the unique identifier of the encryption key may be obtained from the third data disk. Or if the encryption key information is the encryption key itself, the encryption key information may be directly used as the encryption key.
And 9, the storage equipment adopts the encryption key to decrypt the encrypted video sequence (video ciphertext data) to obtain an unencrypted video sequence (video plaintext data). For example, the storage device invokes an encryption card (e.g., a hardware encryption card) that decrypts the encrypted video sequence using an encryption key to obtain an unencrypted video sequence, e.g., decrypts the encrypted video sequence using a symmetric encryption algorithm.
After the unencrypted video sequence is obtained, the storage device may also return the video sequence to the client, which plays the video sequence, without limitation to the processing of the client.
In the above process, for the storage process of video data, it is necessary to splice the structured data, the encryption key information, and the integrity signature value to obtain index data, and store the index data to a data disk instead of storing the index data to a database. For the video data reading process, the index data needs to be read from the data disk, and the index data is analyzed to obtain the structured data, the encryption key information and the integrity signature value, instead of reading the index data from the database. The above operation has the following technical effects:
1: and the IO operation of the database is reduced, and the performance is improved. For example, when video data is written, the writing operation of the database of the structured data, the encryption key and the integrity signature value is replaced by the writing operation of the data disk, so that the IO operation of the database is greatly reduced, and the performance is improved. During video data playback, the database reading operation of the structured data, the encryption key and the integrity signature value is replaced by the reading operation of the data disk, so that the IO operation of the database is greatly reduced, and the performance is improved.
2: And the space of an index disk of an extra database is not occupied, and the construction cost is saved. For example, because the structured data, the encryption key and the integrity signature value are all stored in the index data, and the index data is stored in the data disk, the space of the index disk of the database is not occupied. Because the index disk space of the database is realized based on the solid state disk, the data disk is realized by the mechanical hard disk, and the cost of the mechanical hard disk is lower than that of the solid state disk, the construction cost is saved by storing the structured data, the encryption key and the integrity signature value into the data disk.
3: And the video data security is improved. For example, by storing the structured data, encryption keys, and integrity signature values in multiple copies to the data disk, security of the video data is increased, and even if index data of one data disk is corrupted, the index data can be read from the other copies without affecting video playback.
Based on the same application concept as the above method, an embodiment of the present application provides a storage device for video data, as shown in fig. 7A, which is a schematic structural diagram of the device, where the device may include:
An acquisition module 71 for acquiring a video sequence, the video sequence comprising a plurality of video frames; a processing module 72, configured to perform frame analysis on the video sequence to obtain structured data; acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters; a storage module 73, configured to store the index data.
Illustratively, the storage module 73 is specifically configured to, when storing the index data: the index data is stored in a data disk.
Illustratively, the protection parameters include encryption key information; the encryption key information comprises an encryption key or a unique identifier of the encryption key; the encryption key is used for encrypting the video sequence to obtain an encrypted video sequence; the memory module 73 is further configured to: storing the encrypted video sequence;
When the processing module 72 splices the structured data and the encryption key information, the first identifier is in front of the structured data, and the second identifier is in front of the encryption key information.
Illustratively, the protection parameter includes an integrity signature value; the processing module 72 is specifically configured to, when obtaining the protection parameter corresponding to the video sequence: calculating an integrity signature value corresponding to the encrypted video sequence; wherein, when the processing module 72 splices the structured data, the encryption key information, and the integrity signature value, the structured data is preceded by a first identifier, the encryption key information is preceded by a second identifier, and the integrity signature value is preceded by a third identifier.
After the processing module 72 splices the structured data, the encryption key information, and the integrity signature value to obtain spliced index data, the index data sequentially includes the first identifier, the structured data, the third identifier, the integrity signature value, the second identifier, and the encryption key information; wherein after parsing from the index data into the first, third, and second identifications, content located between the first and third identifications is determined to be the structured data, content located between the third and second identifications is determined to be the integrity signature value, and content located after the second identification is determined to be the encryption key information.
Illustratively, the storage module 73 is specifically configured to, when storing the index data: acquiring data security corresponding to the video sequence; the data security is a high security storage requirement, a medium security storage requirement or a low security storage requirement; generating N parts of index data based on the index data, wherein N is a positive integer greater than 1; if the data security is a high security storage requirement, respectively storing the N index data into data disks of N storage nodes; or if the data security is the medium security storage requirement, respectively storing the N index data into N data disks of a storage node; or if the data security is a low security storage requirement, respectively storing the N index data into N data partitions of one data disk of one storage node.
Based on the same application concept as the above method, an embodiment of the present application provides a video playback device, as shown in fig. 7B, which is a schematic structural diagram of the device, where the device may include:
An acquisition module 74 for acquiring a video playback request from a client;
a processing module 75, configured to obtain index data, and parse the index data to obtain structured data and protection parameters; acquiring a video sequence corresponding to the video playback request based on the structured data, and performing protection operation on the video sequence by adopting the protection parameters;
and the sending module 76 is used for returning the video sequence after the protection operation to the client.
Illustratively, the protection parameters include encryption key information; the encryption key information comprises an encryption key or a unique identifier of the encryption key; the processing module 75 is specifically configured to, when performing a protection operation on the video sequence using the protection parameter: if the video sequence is an encrypted video sequence, decrypting the encrypted video sequence by adopting an encryption key corresponding to the encryption key information to obtain a decrypted video sequence; when the index data is analyzed to obtain the structured data and the encryption key information, determining the content behind the first identifier as the structured data when the first identifier is analyzed from the index data; and determining the content behind the second identifier as the encryption key information when the second identifier is parsed from the index data.
Illustratively, the protection parameter includes an integrity signature value; the processing module 75 is specifically configured to, when performing a protection operation on the video sequence using the protection parameter: carrying out integrity check on the encrypted video sequence by adopting the integrity signature value; if the verification is successful, the operation of decrypting the encrypted video sequence by adopting the encryption key corresponding to the encryption key information to obtain a decrypted video sequence is executed; discarding the encrypted video sequence if the verification fails; when the index data is analyzed to obtain the structured data, the encryption key information and the integrity signature value, determining the content behind a first identifier as the structured data when the first identifier is analyzed from the index data; determining content following a second identifier as the encryption key information when parsing from the index data to the second identifier; and determining the content behind the third identifier as the integrity signature value when the third identifier is parsed from the index data.
Based on the same application concept as the above method, an electronic device is provided in an embodiment of the present application, as shown in fig. 8, where the electronic device includes: a processor 81 and a machine-readable storage medium 82, the machine-readable storage medium 82 storing machine-executable instructions executable by the processor 81; the processor 81 is configured to execute machine executable instructions to implement the method for storing video data disclosed in the above example of the present application or implement the method for playing back video disclosed in the above example of the present application.
Based on the same application concept as the above method, the embodiment of the present application further provides a machine-readable storage medium, where a plurality of computer instructions are stored, where the computer instructions can implement the method for storing video data disclosed in the above example of the present application or implement the method for playing back video disclosed in the above example of the present application when the computer instructions are executed by a processor.
Wherein the machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information, such as executable instructions, data, or the like. For example, a machine-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state disk, any type of storage disk (e.g., optical disk, dvd, etc.), or a similar storage medium, or a combination thereof.
Based on the same application concept as the above method, a computer program product is provided in an embodiment of the present application, which includes a computer program, where the computer program when executed by a processor implements the method for storing video data disclosed in the above example of the present application, or implements the method for playing back video disclosed in the above example of the present application.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the application may take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (14)
1. A method of storing video data, the method comprising:
Obtaining a video sequence, the video sequence comprising a plurality of video frames;
Performing frame analysis on the video sequence to obtain structured data;
Acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters;
and storing the index data.
2. The method of claim 1, wherein the step of determining the position of the substrate comprises,
The storing the index data includes: the index data is stored in a data disk.
3. The method of claim 1, wherein the protection parameter comprises encryption key information; the encryption key information comprises an encryption key or a unique identifier of the encryption key; the encryption key is used for encrypting the video sequence to obtain an encrypted video sequence;
the method further comprises the steps of: storing the encrypted video sequence;
When the structured data and the encryption key information are spliced, the first identifier is in front of the structured data, and the second identifier is in front of the encryption key information.
4. A method according to claim 3, wherein the protection parameter comprises an integrity signature value; the obtaining the protection parameters corresponding to the video sequence includes:
calculating an integrity signature value corresponding to the encrypted video sequence;
When the structured data, the encryption key information and the integrity signature value are spliced, the first identifier is in front of the structured data, the second identifier is in front of the encryption key information, and the third identifier is in front of the integrity signature value.
5. The method of claim 4, wherein after concatenating the structured data, the encryption key information, and the integrity signature value to obtain concatenated index data, the index data comprises, in order, the first identifier, the structured data, the third identifier, the integrity signature value, the second identifier, and the encryption key information;
wherein after parsing from the index data into the first, third, and second identifications, determining content located between the first and third identifications as the structured data, determining content located between the third and second identifications as the integrity signature value, and determining content located after the second identification as the encryption key information.
6. A method according to claim 1 or 2, characterized in that,
The storing the index data includes:
acquiring data security corresponding to the video sequence; the data security is a high security storage requirement, a medium security storage requirement or a low security storage requirement;
Generating N parts of index data based on the index data, wherein N is a positive integer greater than 1;
If the data security is a high security storage requirement, respectively storing the N index data into data disks of N storage nodes; or alternatively
If the data security is the medium security storage requirement, respectively storing the N index data into N data disks of a storage node; or alternatively
And if the data security is a low security storage requirement, respectively storing the N index data into N data partitions of one data disk of one storage node.
7. A method of video playback, the method comprising:
obtaining a video playback request from a client;
obtaining index data, and analyzing the index data to obtain structured data and protection parameters;
and acquiring a video sequence corresponding to the video playback request based on the structured data, performing protection operation on the video sequence by adopting the protection parameters, and returning the video sequence after the protection operation to the client.
8. The method of claim 7, wherein the protection parameters include encryption key information; the encryption key information comprises an encryption key or a unique identifier of the encryption key;
the protecting operation of the video sequence by adopting the protecting parameters comprises the following steps:
If the video sequence is an encrypted video sequence, decrypting the encrypted video sequence by adopting an encryption key corresponding to the encryption key information to obtain a decrypted video sequence;
When the index data is analyzed to obtain the structured data and the encryption key information, determining the content behind the first identifier as the structured data when the first identifier is analyzed from the index data; and determining the content behind the second identifier as the encryption key information when the second identifier is parsed from the index data.
9. The method of claim 8, wherein the protection parameter comprises an integrity signature value; the protecting operation of the video sequence by adopting the protecting parameters comprises the following steps:
Carrying out integrity check on the encrypted video sequence by adopting the integrity signature value;
If the verification is successful, the operation of decrypting the encrypted video sequence by adopting the encryption key corresponding to the encryption key information to obtain a decrypted video sequence is executed;
Discarding the encrypted video sequence if the verification fails;
When the index data is analyzed to obtain the structured data, the encryption key information and the integrity signature value, determining the content behind a first identifier as the structured data when the first identifier is analyzed from the index data; determining content following a second identifier as the encryption key information when parsing from the index data to the second identifier; and determining the content behind the third identifier as the integrity signature value when the third identifier is parsed from the index data.
10. A storage device for video data, the device comprising:
An acquisition module for acquiring a video sequence, the video sequence comprising a plurality of video frames;
The processing module is used for carrying out frame analysis on the video sequence to obtain structured data; acquiring protection parameters corresponding to the video sequence, and splicing the structured data and the protection parameters to obtain spliced index data, wherein the protection parameters are used for protecting the video sequence; the index data is used for analyzing the index data in the video playback process to obtain the structured data and the protection parameters, acquiring a video sequence based on the structured data, and performing protection operation on the acquired video sequence by adopting the protection parameters;
And the storage module is used for storing the index data.
11. A video playback device, the device comprising:
the acquisition module is used for acquiring a video playback request from the client;
the processing module is used for acquiring index data and analyzing the index data to obtain structured data and protection parameters; acquiring a video sequence corresponding to the video playback request based on the structured data, and performing protection operation on the video sequence by adopting the protection parameters;
and the sending module is used for returning the video sequence after the protection operation to the client.
12. An electronic device, comprising: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor; the processor is configured to execute machine-executable instructions to implement the method of any of claims 1-6 or the processor is configured to execute machine-executable instructions to implement the method of any of claims 7-9.
13. A machine-readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the method of any of claims 1-6 or the method of any of claims 7-9.
14. A computer program product comprising a computer program which, when executed by a processor, implements the method of any of claims 1-6 or which, when executed by a processor, implements the method of any of claims 7-9.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410841297.8A CN118410203B (en) | 2024-06-26 | 2024-06-26 | Video data storage and video playback methods, devices and equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410841297.8A CN118410203B (en) | 2024-06-26 | 2024-06-26 | Video data storage and video playback methods, devices and equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN118410203A true CN118410203A (en) | 2024-07-30 |
CN118410203B CN118410203B (en) | 2024-09-03 |
Family
ID=91990866
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410841297.8A Active CN118410203B (en) | 2024-06-26 | 2024-06-26 | Video data storage and video playback methods, devices and equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118410203B (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106600494A (en) * | 2016-12-14 | 2017-04-26 | 国网上海市电力公司 | On-site learning and management system of protection automation devices |
WO2019153433A1 (en) * | 2018-02-09 | 2019-08-15 | 网宿科技股份有限公司 | Secret key providing method, video playback method, server and client |
CN111083573A (en) * | 2018-10-22 | 2020-04-28 | 杭州海康威视系统技术有限公司 | Video file processing method and device and storage node |
CN113259723A (en) * | 2021-06-28 | 2021-08-13 | 杭州海康威视数字技术股份有限公司 | Decentralized video key management method, device and system |
CN114928756A (en) * | 2022-05-27 | 2022-08-19 | 浙江大华技术股份有限公司 | Video data protection, encryption and verification method, system and equipment |
WO2022242607A1 (en) * | 2021-05-19 | 2022-11-24 | 杭州海康威视数字技术股份有限公司 | Method, apparatus, and system for encrypting video data slice, and electronic device |
CN115767138A (en) * | 2023-01-06 | 2023-03-07 | 杭州海康威视数字技术股份有限公司 | Video data processing method and device, electronic equipment and storage medium |
-
2024
- 2024-06-26 CN CN202410841297.8A patent/CN118410203B/en active Active
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106600494A (en) * | 2016-12-14 | 2017-04-26 | 国网上海市电力公司 | On-site learning and management system of protection automation devices |
WO2019153433A1 (en) * | 2018-02-09 | 2019-08-15 | 网宿科技股份有限公司 | Secret key providing method, video playback method, server and client |
CN111083573A (en) * | 2018-10-22 | 2020-04-28 | 杭州海康威视系统技术有限公司 | Video file processing method and device and storage node |
WO2022242607A1 (en) * | 2021-05-19 | 2022-11-24 | 杭州海康威视数字技术股份有限公司 | Method, apparatus, and system for encrypting video data slice, and electronic device |
CN113259723A (en) * | 2021-06-28 | 2021-08-13 | 杭州海康威视数字技术股份有限公司 | Decentralized video key management method, device and system |
CN114928756A (en) * | 2022-05-27 | 2022-08-19 | 浙江大华技术股份有限公司 | Video data protection, encryption and verification method, system and equipment |
CN115767138A (en) * | 2023-01-06 | 2023-03-07 | 杭州海康威视数字技术股份有限公司 | Video data processing method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
蔡伟鸿;饶亮;王玉良;陈银冬;: "一种基于关键帧的视频保护方案的设计与实现", 汕头大学学报(自然科学版), no. 02, 15 May 2014 (2014-05-15) * |
Also Published As
Publication number | Publication date |
---|---|
CN118410203B (en) | 2024-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11238165B2 (en) | File encryption method, file decryption method, electronic device, and storage medium | |
US8429365B2 (en) | Memory device and method for embedding host-identification information into content | |
KR101597930B1 (en) | A video file encryption and decryption method, device, and mobile terminal | |
KR101405720B1 (en) | Accelerated cryptography with an encryption attribute | |
JP4679851B2 (en) | Access control for digital content | |
US7660423B2 (en) | Method and apparatus for maintaining ephemeral keys in limited space | |
CN106973310A (en) | The player method of Streaming Media, EPG server and CDN server in a kind of IPTV system | |
US11736457B2 (en) | Systems and methods for managing data based on secret sharing | |
CN114301602B (en) | Video protection method and device based on block chain | |
US20080232596A1 (en) | Data processing apparatus and program | |
CN110620950B (en) | Method, device and equipment for storing audio and video files | |
CN112733189A (en) | System and method for realizing file storage server side encryption | |
US8185751B2 (en) | Achieving strong cryptographic correlation between higher level semantic units and lower level components in a secure data storage system | |
CN118410203B (en) | Video data storage and video playback methods, devices and equipment | |
CN113297611B (en) | Data processing, encryption storage and reading method, device and storage medium | |
JP4886831B2 (en) | Content recording apparatus, reproducing apparatus, editing apparatus and method thereof | |
CN111711671B (en) | Cloud storage method for updating efficient ciphertext file based on blind storage | |
CN111865924A (en) | Method and system for monitoring user side | |
US20050038999A1 (en) | Access control for digital content | |
CN111813965B (en) | Encryption method and decryption method for multimedia file, storage medium and electronic device | |
Williams et al. | Access privacy and correctness on untrusted storage | |
CN111083573A (en) | Video file processing method and device and storage node | |
CN114528561A (en) | Flash key storage management method | |
JP5395866B2 (en) | Recording / reproducing system, recording apparatus, and reproducing apparatus | |
KR101277261B1 (en) | Method and apparatus for storing digital content in storage device |
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 |