WO2017020737A1 - 视频流的存储方法、读取方法及装置 - Google Patents

视频流的存储方法、读取方法及装置 Download PDF

Info

Publication number
WO2017020737A1
WO2017020737A1 PCT/CN2016/091510 CN2016091510W WO2017020737A1 WO 2017020737 A1 WO2017020737 A1 WO 2017020737A1 CN 2016091510 W CN2016091510 W CN 2016091510W WO 2017020737 A1 WO2017020737 A1 WO 2017020737A1
Authority
WO
WIPO (PCT)
Prior art keywords
frame data
data
storage
storage address
frame
Prior art date
Application number
PCT/CN2016/091510
Other languages
English (en)
French (fr)
Inventor
陈伟
汪渭春
Original Assignee
杭州海康威视数字技术股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 杭州海康威视数字技术股份有限公司 filed Critical 杭州海康威视数字技术股份有限公司
Priority to US15/749,986 priority Critical patent/US10332565B2/en
Priority to EP16832225.3A priority patent/EP3334165B1/en
Publication of WO2017020737A1 publication Critical patent/WO2017020737A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/10Indexing; Addressing; Timing or synchronising; Measuring tape travel
    • G11B27/19Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier
    • G11B27/28Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier by using information signals recorded by the same method as the main recording
    • G11B27/30Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier by using information signals recorded by the same method as the main recording on the same track as the main recording
    • G11B27/3081Indexing; Addressing; Timing or synchronising; Measuring tape travel by using information detectable on the record carrier by using information signals recorded by the same method as the main recording on the same track as the main recording used signal is a video-frame or a video-field (P.I.P)
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/02Editing, e.g. varying the order of information signals recorded on, or reproduced from, record carriers
    • G11B27/031Electronic editing of digitised analogue information signals, e.g. audio or video signals
    • G11B27/034Electronic editing of digitised analogue information signals, e.g. audio or video signals on discs
    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B27/00Editing; Indexing; Addressing; Timing or synchronising; Monitoring; Measuring tape travel
    • G11B27/10Indexing; Addressing; Timing or synchronising; Measuring tape travel
    • G11B27/102Programmed access in sequence to addressed parts of tracks of operating record carriers
    • G11B27/105Programmed access in sequence to addressed parts of tracks of operating record carriers of operating discs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/83Generation or processing of protective or descriptive data associated with content; Content structuring
    • H04N21/845Structuring of content, e.g. decomposing content into time segments
    • H04N21/8455Structuring of content, e.g. decomposing content into time segments involving pointers to the content, e.g. pointers to the I-frames of the video stream
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/80Generation or processing of content or additional data by content creator independently of the distribution process; Content per se
    • H04N21/85Assembly of content; Generation of multimedia applications
    • H04N21/854Content authoring
    • H04N21/85406Content authoring involving a specific file format, e.g. MP4 format

Definitions

  • the present application relates to the field of data processing, and in particular, to a method, a reading method and a device for storing a video stream.
  • video formats come in a variety of formats, and in many types of formats, the storage efficiency of real-time video (video streaming) is particularly important.
  • the video stream when the video stream is stored in the related art, it is often stored in a frame-by-frame manner in the order in which the video stream is sent. This results in a slower storage of the video stream with a larger amount of data, especially in the case of a large number of video streams. It can also cause the system to run slowly or even embarrassingly.
  • the embodiment of the present application provides a method, a method, and a device for storing a video stream, so as to at least solve the video stream storage efficiency caused by the related art in storing the video stream in sequence according to the sequence of the video stream. Lower technical issues.
  • a method for storing a video stream is provided, which is applied to a video stream storage device, including: separating the obtained video stream into I frame data and a non-corresponding to the I frame data.
  • I frame data wherein the non-I frame data includes data other than the I frame data in the video stream; acquiring a storage address allocated by the data storage server for the non-I frame data, and the non- The I frame data is stored in a storage space of the data storage server pointed to by the storage address; the storage address is added to the I frame data; and the I frame data including the storage address is stored To the data storage server.
  • the method before storing the I frame data including the storage address to the data storage server, the method further includes: calculating a check of the I frame data including the storage address a value, wherein the check value is used to recover the I frame data including the storage address if the I frame data containing the storage address is lost; wherein the The storing of the I frame data of the storage address to the data storage server includes: storing the I frame data including the storage address and the check value to the data storage server.
  • the calculating includes a check value of the I frame data of the storage address, including: a disk structure according to two stored parity codes, a RAID-6 algorithm pair, including the storage address
  • the I frame data is calculated to obtain the check value of the I frame data including the storage address.
  • the acquiring, by the data storage server, a storage address allocated by the data storage server for the non-I frame data, and storing the non-I frame data in a storage space of the data storage server pointed by the storage address includes: sending a storage address request to a metadata storage server, wherein the metadata storage server requests the data storage server to allocate the storage address for the non-I frame data; and receiving the metadata storage server in response to The storage address returned by the storage address request; according to the storage address, writing the non-I frame data to a storage space pointed by the storage address in the data storage server; The data amount of the non-I frame data of the data storage server is reported to the metadata storage server.
  • the method further includes: calculating the non-I frame data according to the independent disk structure RAID-5 algorithm of the distributed parity, and obtaining the exclusive OR check data of the non-I frame data, the XOR check Data for recovering the non-I frame data in case the non-I frame data is lost; wherein the acquiring a storage address allocated by the data storage server for the non-I frame data, and the non-I Storing frame data in a storage space of the data storage server pointed to by the storage address, comprising: acquiring the storage allocated by the data storage server for the non-I frame data and the XOR check data Addressing: storing the non-I frame data and the XOR check data into a storage space of the data storage server pointed to by the storage address.
  • a method for reading a video stream comprising: acquiring a storage address of the I frame data of the video stream; Storage address, reading the I frame data from the data storage server; from the I frame data Parsing a storage address of the non-I frame data of the video stream; reading the non-I frame data from the data storage server according to the storage address of the non-I frame data, wherein the non-I frame The data includes data other than the I frame data in the video stream; the I frame data and the non-I frame data are aggregated into the video stream.
  • the storage address of the non-I frame data of the video stream is parsed from the I frame data.
  • the method further includes: reading, from the data storage server, a check value of the I frame data, where the check value is a disk structure RAID-6 algorithm based on two stored parity codes in advance Calculating the I frame data; verifying the I frame data, wherein, when the I frame data is lost, the I frame data is restored according to the check value.
  • the method further includes: reading, from the data storage server, XOR check data of the non-I frame data, wherein the XOR check data is pre-determined according to distributed parity
  • the independent disk structure RAID-5 algorithm calculates the non-I frame data; and performs verification on the non-I frame data, wherein, in the case that the non-I frame data is lost, according to the The XOR check data recovers the non-I frame data.
  • a storage device for a video stream including: a data separation unit, configured to separate the acquired video stream into I frame data and a non-corresponding to the I frame data.
  • I frame data wherein the non-I frame data includes data other than the I frame data in the video stream; and a data sending unit configured to acquire storage allocated by the data storage server for the non-I frame data An address, and the non-I frame data is stored in a storage space of the data storage server pointed to by the storage address; a data adding unit, configured to add the storage address to the I frame data;
  • the data sending unit is further configured to store the I frame data including the storage address to the data storage server.
  • the storage device of the video stream further includes: a first calculating unit, configured to calculate a check value of the I frame data that includes the storage address, where the check value is used to include In the case that the I frame data of the storage address is lost, the I frame data including the storage address is restored; wherein the data sending unit is configured to perform the following steps to include the storage address.
  • the I frame data is stored to the data storage server: the I frame data including the storage address and the check value are stored to the data storage server.
  • the first calculating unit is configured to perform the following steps: calculating a check value of the I frame data that includes the storage address: a disk structure RAID-6 algorithm pair according to two stored parity codes
  • the I frame data including the storage address is calculated to obtain the check value of the I frame data including the storage address.
  • the data sending unit is configured to: acquire a storage address allocated by the data storage server for the non-I frame data, and store the non-I frame data to a location pointed by the storage address
  • the data storage server sends a storage address request to the metadata storage server, wherein the metadata storage server requests the data storage server to allocate the storage address for the non-I frame data; Determining, by the metadata storage server, the storage address returned by the storage address request; writing the non-I frame data to a storage space pointed by the storage address in the data storage server according to the storage address Transmitting the amount of data of the non-I frame data that has been written to the data storage server to the metadata storage server.
  • the storage device of the video stream further includes: a second calculating unit, configured to calculate the non-I frame data according to the independent disk structure RAID-5 algorithm of the distributed parity, to obtain the non-I frame data XOR check data, the XOR check data is used to recover the non-I frame data in case the non-I frame data is lost; wherein the data sending unit is configured to perform the following steps to obtain a storage address allocated by the data storage server for the non-I frame data, and storing the non-I frame data in a storage space of the data storage server pointed by the storage address: acquiring by the data storage server Storing the storage address for the non-I frame data and the XOR check data; storing the non-I frame data and the XOR check data to the data storage pointed to by the storage address The storage space of the server.
  • a second calculating unit configured to calculate the non-I frame data according to the independent disk structure RAID-5 algorithm of the distributed parity, to obtain the non-I frame data XOR check data, the XOR check data is
  • a video stream reading apparatus including: an acquiring unit, configured to acquire a storage address of I frame data of a video stream; and a first reading unit, configured to Decoding the I frame data from the data storage server; the parsing unit is configured to parse the storage address of the non-I frame data of the video stream from the I frame data; a reading unit, configured to read the non-I frame data from the data storage server according to a storage address of the non-I frame data, where the non-I frame data includes the video stream except the Outside the I frame data And an aggregation unit, configured to aggregate the I frame data and the non-I frame data into the video stream.
  • the first reading unit is further configured to read, from the data storage server, a check value of the I frame data, where the check value is based on two stored parity codes in advance.
  • the disk structure RAID-6 algorithm calculates the I frame data;
  • the video stream reading device further includes: a first check unit, configured to perform verification on the I frame data, wherein When it is verified that the I frame data is lost, the I frame data is restored according to the check value.
  • the second reading unit is further configured to read the exclusive OR check data of the non-I frame data from the data storage server, where the XOR check data is pre-distributed according to a distribution
  • the independent disk structure of the parity parity RAID-5 algorithm calculates the non-I frame data
  • the reading device of the video stream further includes: a second check unit, configured to use the non-I frame data Performing a check, wherein, in the case of verifying that the non-I frame data is lost, the non-I frame data is restored according to the XOR check data.
  • the present application further provides an electronic device including: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside the space enclosed by the housing, and the processor and the memory are disposed at a circuit board; a power circuit for powering various circuits or devices of the electronic device; a memory for storing executable program code; and a processor for executing the method of storing the video stream by executing executable program code stored in the memory .
  • the present application also provides a storage medium for storing executable program code, the executable program code being executed to perform a storage method of the video stream.
  • the present application further provides another electronic device, including: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed inside a space enclosed by the housing, the processor and the memory setting On a circuit board; a power supply circuit for powering various circuits or devices of the electronic device; a memory for storing executable program code; and a processor for executing reading of the video stream by running executable program code stored in the memory Take the method.
  • the present application also provides another storage medium for storing executable program code, the executable program code being executed to perform the reading method of the video stream.
  • the obtained video stream is separated into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes data other than the I frame data in the video stream; Obtaining a storage address allocated by the data storage server for non-I frame data, and storing non-I frame data into a storage space of the data storage server pointed to by the storage address; adding the storage address to the I frame data; storing the storage The manner in which the I frame data of the address is stored in the data storage server is obtained by separating the video stream into I frame data and non-I frame data, and after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquired The storage address of the non-I frame data is added to the I frame data.
  • the I frame data and the non-I frame data can be stored in parallel, so as to achieve the purpose of quickly storing the video stream, thereby realizing the technical effect of high video stream storage efficiency, and further solving the problem that the related technology is based on the video stream when storing the video stream.
  • the order in which the incoming sequence is sequentially stored on a frame-by-frame basis is a technical problem that the video stream storage efficiency is low.
  • FIG. 1 is a schematic flowchart of a method for storing an optional video stream according to an embodiment of the present application
  • FIG. 2 is a schematic structural diagram of a frame format of an optional video stream according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of an optional system architecture according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart diagram of an optional method for reading a video stream according to an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an optional video stream storage device according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of another optional video stream storage device according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of still another optional video stream storage device according to an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an optional video stream reading apparatus according to an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of another optional video stream reading apparatus according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of still another optional video stream reading apparatus according to an embodiment of the present application.
  • FIG. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • a method embodiment of a method for storing a video stream is provided. It should be noted that the steps shown in the flowchart of the drawing may be performed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 1 is a method for storing a video stream according to an embodiment of the present application.
  • the method is a method on a storage device side of a video stream. As shown in FIG. 1 , the method includes the following steps:
  • Step S102 separating the acquired video stream into I frame data and non-I frame data corresponding to the I frame data, wherein the non-I frame data includes data other than the I frame data in the video stream.
  • the video stream may be data transmitted by the surveillance camera in real time.
  • the video stream in the embodiment of the present application includes I frame data and non-I frame data, wherein an I frame is also called an internal picture, and an I frame is usually a GOP (Group of Picture, The first frame of the picture group), as a reference point for random access, can be regarded as an image.
  • the I frame is also called the key frame, which is an important frame for interframe compression coding. When decoding, the complete image can be reconstructed with only I frame.
  • non-I frame Including P frames and B frames, P frames and B frames can also be referred to as reference frames, which are predicted from the previous I frames, and must be reconstructed based on I frames when decoding.
  • the storage device of the video stream can determine the frame type by checking the frame header.
  • the video stream storage method in the embodiment of the present application can separate the video stream into I frame data and non-I frame data.
  • multiple The data aggregation (also referred to as sequential storage) of the I frame is a stripe, that is, DI1 to DI6 in FIG. 2, wherein DI1 to DI6 correspond one-to-one with the data of the I frame, that is, DI1 corresponds to the data of the first I frame.
  • DI2 corresponds to the data of the second I frame, etc.
  • the data of multiple non-I frames may also be aggregated into strips, that is, D1 to D6, where D1
  • D1 The data of D6 and the non-I frame are in one-to-one correspondence, that is, D1 corresponds to the data of the first non-I frame, D2 corresponds to the data of the second non-I frame, and the like.
  • the data size of the first I frame in FIG. 2 is 15K
  • the size of the data of the second I frame is 9K
  • the size of the data of the third I frame is 27K
  • the size of the data of the fourth I frame is 30K
  • the size of the data of the fifth I frame is 21K
  • the size of the data of the sixth I frame is 11K
  • the process of aggregating the data of the first I frame to the data of the sixth I frame into a stripe First, first determine the data of the first I frame to the data of the sixth I frame, the I frame with the largest amount of data is the sixth I frame, the data size of the sixth I frame is 30K, and then, to 30K (or More than 30K) is the reference, for each I frame of data reserved size 30K space (ie DI1 to DI6, there is no data in DI1 to DI6), and finally, the data of the first I frame is placed in In DI1, and so on, the data of each I frame is placed in the corresponding space in order.
  • Step S104 Acquire a storage address allocated by the data storage server for non-I frame data, and store the non-I frame data in a storage space of the data storage server pointed to by the storage address.
  • step S104 of the present application since the I frame data and the non-I frame data have time correlation (that is, one I frame data and one set of non-I frame data constitute one GOP (Group of Pictures), the recombination is required when reading, Therefore, in order to subsequently read the video stream, the non-I frame data corresponding to the I frame data can be found and the request to the metadata storage server is not required, and the signaling overhead is reduced.
  • the video stream storage method in the embodiment of the present application separates the video stream. After the I frame data and the non-I frame data, the storage address allocated by the data storage server for the non-I frame data is first acquired, and then the I frame data is added. Add this storage address.
  • the subsequent steps S106 and S108 may be performed, and the parallel processing stores the non-I frame data in the storage space of the data storage server pointed to by the storage address. Speed up the storage of data.
  • the non-I frame data may be simultaneously processed in parallel to the storage space of the data storage server pointed to by the storage address. And the step of adding the storage address to the I frame data and storing the I frame data containing the storage address in the data storage server.
  • non-I frame data and I frame data may also be stored in sequential order.
  • step S104 the storage address allocated by the data storage server for the non-I frame data is obtained, and the non-I frame data is stored in the storage space of the data storage server pointed to by the storage address, which may include :
  • Step S10 sending a storage address request to the metadata storage server, wherein the metadata storage server requests the data storage server to allocate a storage address for the non-I frame data.
  • step S10 of the present application in the system architecture for cloud storage, the storage device of the video stream needs to go through the metadata storage server when applying for the storage space, and the metadata storage server requests the data server to allocate the storage address for the non-I frame data. .
  • the storage device of the video stream first sends a command stream containing the storage address request to the metadata storage server, wherein the storage address request should include the size of the non-I frame data to be stored, and the metadata storage server further includes A command stream having a storage address request is sent to the data storage server, the data storage server allocates a storage address for the non-I frame data, and sends a command stream containing the storage address to the metadata storage server, and the metadata storage server includes The command stream of the storage address is forwarded to the storage device of the video stream.
  • the storage device of the video stream may write the data stream containing the non-I frame data to the data storage server according to the storage address, and the subsequent I frame data.
  • the storage process is similar, and will not be described here.
  • Step S12 Receive a storage address returned by the metadata storage server in response to the storage address request.
  • step S12 of the present application after the data storage server allocates a storage address for the non-I frame data, the storage device of the video stream receives the return of the metadata storage server in response to the storage address request.
  • the storage address of non-I frame data is the storage address of non-I frame data.
  • Step S14 Write non-I frame data to the storage space pointed to by the storage address in the data storage server according to the storage address.
  • step S14 of the present application after the storage device of the video stream acquires the storage address, the non-I frame data can be directly written into the data storage server.
  • step S16 the data amount of the non-I frame data that has been written to the data storage server is reported to the metadata storage server.
  • step S16 of the present application after the non-I frame data is written into the data storage server, the storage device of the video stream needs to report the data amount of the non-I frame data that has been written to the data storage server to the metadata storage server, so as to The data storage server records the size of the non-I frame data that is finally written.
  • the metadata storage server can compare, store the size of the non-I frame data to be stored included in the address request, and the size of the finally written non-I frame data recorded by the metadata storage server to determine all the requests are stored. Whether all non-I frames are written to the data storage server.
  • the storage device of the video stream may write non-I frame data (I frame data) to the data storage server, or may acquire non-I frame data (I frame data) from the data storage server. .
  • step S106 the storage address is added to the I frame data.
  • the storage address may be added to the I frame data corresponding to the non-I frame data, that is, the added I frame.
  • the data includes real data and storage addresses of non-I frame data.
  • Step S108 storing the I frame data including the storage address to the data storage server.
  • the storage device of the video stream stores the I frame data including the storage address to the data storage server.
  • the method for storing the I frame data including the storage address to the data storage server is similar to the method for storing the non-I frame data, that is, sending the storage address request to the metadata storage server, wherein the metadata storage server stores the data to the data storage server.
  • the server requests to allocate a storage address for the I frame data including the storage address, and the storage address request should include the size of the I frame data containing the storage address to be stored; and the storage address returned by the receiving metadata storage server in response to the storage address request According to the storage address, the I frame data containing the storage address is written into the storage space pointed by the storage address in the data storage server; the written data is stored The data amount of the I frame data of the storage server including the storage address is reported to the metadata storage server.
  • the video stream can be separated into I frame data and non-I frame data.
  • the storage address of the acquired non-I frame data is added to In the I frame data, since the correspondence between the I frame data and the non-I frame data is established, there is no need to store the I frame data and then the non-I frame data according to the related art, and the I frame data and the non-I can be stored in parallel.
  • the frame data achieves the purpose of quickly storing the video stream, thereby realizing the technical effect of high video stream storage efficiency, and further solving the problem that the related technology stores the video stream in the order of the video stream and sequentially stores the frame by frame.
  • the video stream is stored with less efficient technical issues.
  • the method for storing the video stream in this embodiment may further include:
  • Step S20 calculating a check value of the I frame data including the storage address, wherein the check value is used to recover the I frame data including the storage address in the case where the I frame data including the storage address is lost.
  • the video stream storage device may implement the verification by calculating the check value of the I frame data including the storage address. Protection of I-frame data containing storage addresses. The check value is used to recover the I frame data including the storage address when the I frame data including the storage address is lost.
  • calculating a check value of the I frame data that includes the storage address including: calculating, according to the disk structure RAID-6 algorithm of the two stored parity codes, the I frame data including the storage address, to obtain the inclusion The check value of the I frame data with the storage address.
  • the storing the I frame data including the storage address to the data storage server includes: storing the I frame data including the storage address and the check value to the data storage server.
  • the storage device of the video stream can calculate a plurality of check values, and the number of check values should be less than or equal to the number of I frame data.
  • the number of recoverable data of the check value is less than or equal to The number of check values, that is, if two check values are calculated, it can support recovering up to two lost I frame data.
  • a plurality of check values may also be calculated, which are all within the protection scope of the embodiments of the present application.
  • the storage device of the video stream in this embodiment may also protect the I frame data by using an erasure code reconstruction or a copy.
  • the video stream of the embodiment is stored before the storage address allocated by the data storage server for the non-I frame data is acquired, and the non-I frame data is stored in the storage space of the data storage server pointed to by the storage address.
  • the method may further include:
  • Step S30 calculating non-I frame data according to the independent disk structure RAID-5 algorithm of distributed parity, and obtaining XOR check data of non-I frame data, and XOR check data is used for data loss in non-I frame. In case of non-I frame data is restored.
  • the video stream storage device may also be based on the independent disk structure RAID-5 algorithm of distributed parity check. I frame data is protected.
  • the storage address allocated by the data storage server for the non-I frame data is obtained, and the non-I frame data is stored in the storage space of the data storage server pointed to by the storage address, including: acquiring the non-I frame data by the data storage server. And storing the storage address of the XOR check data; storing the non-I frame data and the XOR check data in the storage space of the data storage server pointed to by the storage address.
  • the video stream storage device can calculate a plurality of XOR check data, and the number of XOR check data should be less than or equal to non-I.
  • the number of frame data as shown in P1 in Figure 2, when any non-I frame data in D1 to D6 is lost, the lost non-I frame data can be recovered by XOR check data. It should be noted that the XOR school The number of data recoverable by the test data is less than or equal to the number of XOR check data, that is, if an XOR check data is calculated, at most one data of the lost non-I frame can be recovered.
  • a plurality of XOR check data may also be calculated, which should be within the protection scope of the embodiments of the present application.
  • the obtained video stream is separated into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes data other than the I frame data in the video stream; a storage address allocated by the data storage server for non-I frame data, and storing the non-I frame data in the storage space of the data storage server pointed to by the storage address; adding the storage address to the I frame data; the storage address will be included
  • the method of storing the I frame data to the data storage server by separating the video stream into I frame data and non-I frame data, after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquired non- The storage address of the I frame data is added to the I frame data, due to the construction
  • the correspondence between the I frame data and the non-I frame data is established, so that it is not necessary to store the I frame data and then the non-I frame data according to the related art, and the I frame data and the non-I frame data can be stored in parallel, which is fast.
  • a method embodiment of a method for reading a video stream is provided. It should be noted that the steps shown in the flowchart of the drawing may be executed in a computer system such as a set of computer executable instructions. And, although the logical order is shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
  • FIG. 4 is a method for reading a video stream according to an embodiment of the present application.
  • the method is a method for reading a device on a video stream. As shown in FIG. 4, the method includes the following steps:
  • Step S402 acquiring a storage address of the I frame data of the video stream.
  • the present embodiment describes a method for reading a corresponding video stream.
  • the reading device of the video stream may first request the storage address of the I frame data to be read from the metadata storage server.
  • Step S404 reading I frame data from the data storage server according to the storage address of the I frame data.
  • the video stream reading device reads the I frame data from the data storage server according to the stored storage address of the I frame data.
  • the I frame data includes a storage address of the non-I frame data corresponding thereto.
  • Step S406 parsing the storage address of the non-I frame data of the video stream from the I frame data.
  • the video stream reading device parses the storage address of the non-I frame data of the video stream from the read I frame data.
  • the enhancement number according to the security, after the I frame data is read from the data storage server according to the storage address of the I frame data, before the storage address of the non-I frame data of the video stream is parsed from the I frame data, the method further includes: The data storage server reads the check value of the I frame data, and the check value is obtained by calculating the I frame data according to the disk structure RAID-6 algorithm of the two stored parity codes in advance; In the case where the I frame data is lost, the I frame data is restored according to the check value.
  • Step S408 reading non-I frame data from the data storage server according to the storage address of the non-I frame data, wherein the non-I frame data includes data other than the I frame data in the video stream.
  • the video stream reading device reads non-I frame data from the data storage server according to the parsed storage address of the non-I frame data, wherein the non-I frame data includes the I frame in the video stream. Data other than data.
  • Step S410 the I frame data and the non-I frame data are aggregated into a video stream.
  • the video stream reading device aggregates the I frame data and the non-I frame data into a video stream, where aggregation can be understood as being placed in order.
  • the method further includes: reading the XOR check data of the non-I frame data from the data storage server, wherein the XOR check data is pre-based on the distributed parity check
  • the independent disk structure RAID-5 algorithm calculates the non-I frame data; checks the non-I frame data, wherein, in the case of verifying that the non-I frame data is lost, the non-I is recovered according to the exclusive OR check data. Frame data.
  • the solution provided by the foregoing embodiment of the present application is to separate the video stream into I frame data and non-I frame data, and add the storage address to the I frame data after acquiring the storage address of the non-I frame data.
  • the I frame data can be found to find the non-I frame data, and the purpose of reducing the signaling overhead and the read rate is achieved.
  • the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, by hardware, but in many cases, the former is A better implementation.
  • the technical solution of the present application which is essential or contributes to the related art, may be embodied in the form of a software product stored in a storage medium (such as ROM/RAM, disk, CD-ROM).
  • the instructions include a number of instructions for causing a terminal device (which may be a cell phone, computer, server, or network device, etc.) to perform the methods of various embodiments of the present application.
  • an apparatus embodiment for implementing the foregoing method embodiments is also provided.
  • the apparatus provided by the foregoing embodiment of the present application may be run on a computer terminal.
  • FIG. 5 is a schematic structural diagram of a storage device of a video stream according to an embodiment of the present application.
  • the storage device of the video stream may include a data separating unit 502, a data sending unit 504, and a data adding unit 506.
  • the data separating unit 502 is configured to separate the acquired video stream into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes the video stream Data other than the I frame data; the data sending unit 504 is configured to acquire a storage address allocated by the data storage server for the non-I frame data, and store the non-I frame data to the storage address In the storage space of the data storage server, the data adding unit 506 is configured to add the storage address to the I frame data, and the data sending unit 502 is further configured to include the storage address.
  • the I frame data is stored to the data storage server.
  • the solution provided in the foregoing Embodiment 3 of the present application by separating the video stream into I frame data and non-I frame data, after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquisition will be obtained.
  • the storage address of the non-I frame data is added to the I frame data. Since the correspondence between the I frame data and the non-I frame data is established, it is not necessary to save the I frame data and then save the non-I frame data according to the related art.
  • the method can store the I frame data and the non-I frame data in parallel, and achieve the purpose of quickly storing the video stream, thereby realizing the technical effect of high video stream storage efficiency, and further solving the video according to the related technology when storing the video stream.
  • the order in which the stream is sent is sequentially stored on a frame-by-frame basis.
  • the foregoing data separating unit 502, the data sending unit 504, and the data adding unit 506 correspond to the steps S102 to S108 in the first embodiment, and the examples and application scenarios implemented by the three modules and the corresponding steps. The same, but not limited to, the content disclosed in the above embodiment 1.
  • the foregoing module may be implemented in a computer terminal as part of the device, and may be implemented by software or by hardware.
  • the storage device of the video stream further includes: a first calculating unit 602.
  • a first calculating unit 602 configured to calculate a check value of the I frame data that includes the storage address, where the check value is used to lose data of the I frame that includes the storage address In the case, the I frame data including the storage address is restored; wherein the data sending unit 504 is configured to perform the following steps: storing the I frame data including the storage address to the data storage Server: storing the I frame data including the storage address and the check value to the data storage server.
  • the first calculating unit 602 is configured to perform the following steps: calculating a check value of the I frame data that includes the storage address: a disk structure RAID-6 algorithm according to two stored parity codes Calculating the I frame data including the storage address to obtain the check value of the I frame data including the storage address.
  • the data sending unit 504 is configured to perform the following steps: acquiring a storage address allocated by the data storage server for the non-I frame data, and storing the non-I frame data to the storage address In the storage space of the data storage server: sending a storage address request to the metadata storage server, wherein the metadata storage server requests the data storage server to allocate the storage address for the non-I frame data; receiving The metadata storage server is responsive to the storage address request to return the storage address; according to the storage address, writing the non-I frame data to the storage pointed to by the storage address in the data storage server a space; the amount of data of the non-I frame data that has been written to the data storage server is reported to the metadata storage server.
  • the storage device of the video stream further includes: a second calculating unit 702.
  • the second calculating unit 702 is configured to calculate the non-I frame data according to the independent disk structure RAID-5 algorithm of the distributed parity, to obtain the exclusive OR check data of the non-I frame data, where the XOR Verifying data for recovering the non-I frame data in case the non-I frame data is lost; wherein
  • the data sending unit 504 is configured to perform the following steps: acquiring a storage address allocated by the data storage server for the non-I frame data, and storing the non-I frame data to the data storage pointed by the storage address In the storage space of the server: acquiring the storage address allocated by the data storage server for the non-I frame data and the XOR check data; and the non-I frame data and the XOR check data Stored in a storage space of the data storage server pointed to by the storage address.
  • the obtained video stream is separated into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes data other than the I frame data in the video stream; a storage address allocated by the data storage server for non-I frame data, and storing the non-I frame data in the storage space of the data storage server pointed to by the storage address; adding the storage address to the I frame data; the storage address will be included
  • the method of storing the I frame data to the data storage server by separating the video stream into I frame data and non-I frame data, after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquired non- The storage address of the I frame data is added to the I frame data.
  • I frame data and non-I frame data Since the correspondence between the I frame data and the non-I frame data is established, there is no need to save the I frame data and then save the non I frame data according to the related art.
  • Parallel storage of I frame data and non-I frame data achieves the purpose of quickly storing video streams, thereby realizing the technical effect of high video stream storage efficiency, thereby solving the related technology
  • the reservoir is in the order of the video stream to a video stream sent frame by frame sequentially lower video stream stored in storage efficiency due to technical problems.
  • an apparatus embodiment for implementing the foregoing method embodiments is also provided.
  • the apparatus provided by the foregoing embodiment of the present application may be run on a computer terminal.
  • FIG. 8 is a schematic structural diagram of a video stream reading apparatus according to an embodiment of the present application.
  • the reading device of the video stream may include an obtaining unit 802, a first reading unit 804, a parsing unit 806, a second reading unit 808, and an aggregating unit 810.
  • the obtaining unit 802 is configured to acquire a storage address of the I frame data of the video stream
  • the first reading unit 804 is configured to read the I frame data from the data storage server according to the storage address of the I frame data.
  • a parsing unit 806, configured to parse a storage address of the non-I frame data of the video stream from the I frame data
  • a second reading unit 808, configured to: according to the storage address of the non-I frame data, Reading the non-I frame data in the data storage server, wherein the non-I frame data includes The data stream includes data other than the I frame data
  • the aggregation unit 810 is configured to aggregate the I frame data and the non-I frame data into the video stream.
  • the solution provided in the foregoing Embodiment 3 of the present application is to separate the video stream into I frame data and non-I frame data, and add the storage address to the I frame after acquiring the storage address of the non-I frame data.
  • the I frame data can be found to find the non-I frame data, and the purpose of reducing the signaling overhead and the read rate is achieved.
  • the foregoing obtaining unit 802, the first reading unit 804, the parsing unit 806, the second reading unit 808, and the aggregating unit 810 correspond to steps S402 to S410 in the second embodiment, and five modules are associated with The examples and application scenarios implemented by the corresponding steps are the same, but are not limited to the content disclosed in the second embodiment. It should be noted that the foregoing module may be implemented in a computer terminal as part of the device, and may be implemented by software or by hardware.
  • the first reading unit 804 is further configured to read, from the data storage server, a check value of the I frame data, where the check value is based on two stored parity checks in advance.
  • the disk structure RAID-6 algorithm calculates the I frame data.
  • the apparatus further includes: a first check unit 902, configured to perform verification on the I frame data, where, in the case of verifying that the I frame data is lost, according to the The check value restores the I frame data.
  • a first check unit 902 configured to perform verification on the I frame data, where, in the case of verifying that the I frame data is lost, according to the The check value restores the I frame data.
  • the second reading unit 808 is further configured to read the exclusive OR check data of the non-I frame data from the data storage server, where the XOR check data is based in advance
  • the independent disk structure of the distributed parity RAID-5 algorithm calculates the non-I frame data.
  • the apparatus further includes: a second check unit 1002, configured to perform verification on the non-I frame data, where, in the case of verifying that the non-I frame data is lost, The XOR check data recovers the non-I frame data.
  • a second check unit 1002 configured to perform verification on the non-I frame data, where, in the case of verifying that the non-I frame data is lost, The XOR check data recovers the non-I frame data.
  • the embodiment of the present application further provides an electronic device, as shown in FIG. 11, comprising: a housing 111, a processor 112, a memory 113, a circuit board 114, and a power circuit 115, wherein the circuit board 114 is disposed in the housing 111.
  • the processor 112 and the memory 113 are disposed on the circuit board 114; the power circuit 115 is used to supply power to various circuits or devices of the electronic device; and the memory 113 is used to store executable programs.
  • the processor 112 executes the following steps by running executable program code stored in the memory:
  • the I frame data containing the storage address is stored to the data storage server.
  • the obtained video stream is separated into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes data other than the I frame data in the video stream; a storage address allocated by the data storage server for non-I frame data, and storing the non-I frame data in the storage space of the data storage server pointed to by the storage address; adding the storage address to the I frame data; the storage address will be included
  • the method of storing the I frame data to the data storage server by separating the video stream into I frame data and non-I frame data, after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquired non- The storage address of the I frame data is added to the I frame data.
  • I frame data and non-I frame data Since the correspondence between the I frame data and the non-I frame data is established, there is no need to save the I frame data and then save the non I frame data according to the related art.
  • Parallel storage of I frame data and non-I frame data achieves the purpose of quickly storing video streams, thereby realizing the technical effect of high video stream storage efficiency, thereby solving the related technology
  • the reservoir is in the order of the video stream to a video stream sent frame by frame sequentially lower video stream stored in storage efficiency due to technical problems.
  • the electronic device exists in a variety of forms including, but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content.
  • This type of equipment package Includes: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the embodiment of the present application provides a storage medium for storing executable program code, the executable program code being executed to perform a storage method of the video stream, where the method for storing the video stream may include:
  • the I frame data containing the storage address is stored to the data storage server.
  • the obtained video stream is separated into I frame data and non-I frame data corresponding to the I frame data, where the non-I frame data includes data other than the I frame data in the video stream; a storage address allocated by the data storage server for non-I frame data, and storing the non-I frame data in the storage space of the data storage server pointed to by the storage address; adding the storage address to the I frame data; the storage address will be included
  • the method of storing the I frame data to the data storage server by separating the video stream into I frame data and non-I frame data, after the separation, in order to establish the correspondence between the I frame data and the non-I frame data, the acquired non- The storage address of the I frame data is added to the I frame data.
  • I frame data and non-I frame data Since the correspondence between the I frame data and the non-I frame data is established, there is no need to save the I frame data and then save the non I frame data according to the related art.
  • Parallel storage of I frame data and non-I frame data achieves the purpose of quickly storing video streams, thereby realizing the technical effect of high video stream storage efficiency, thereby solving the related technology
  • the reservoir is in the order of the video stream to a video stream sent frame by frame sequentially lower video stream stored in storage efficiency due to technical problems.
  • the embodiment of the present application further provides another electronic device, wherein the structure is the same as that shown in FIG. 11, and includes: a housing, a processor, a memory, a circuit board, and a power supply circuit, wherein the circuit board is disposed in the housing Inside the space, the processor and the memory are disposed on the circuit board; the power circuit is used to supply power to the various circuits or devices of the electronic device; the memory is used to store the executable program code; and the processor runs the executable program code stored in the memory. To perform the following steps:
  • the I frame data and the non-I frame data are aggregated into the video stream.
  • the solution provided by the foregoing embodiment of the present application is to separate the video stream into I frame data and non-I frame data, and add the storage address to the I frame data after acquiring the storage address of the non-I frame data, and then It is only necessary to find the I frame data to find the non-I frame data, which achieves the purpose of not requiring multiple requests for the metadata storage server, thereby achieving the technical effect of reducing signaling overhead and increasing the reading rate.
  • the electronic device exists in a variety of forms including, but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but is required to provide high The service depends on the processing capability, stability, reliability, security, scalability, manageability and so on.
  • the embodiment of the present application provides another storage medium for storing executable program code, where the executable program code is executed to perform a reading method of the video stream, where the video stream reading method may be include:
  • the I frame data and the non-I frame data are aggregated into the video stream.
  • the solution provided by the foregoing embodiment of the present application is to separate the video stream into I frame data and non-I frame data, and add the storage address to the I frame data after acquiring the storage address of the non-I frame data, and then It is only necessary to find the I frame data to find the non-I frame data, which achieves the purpose of not requiring multiple requests for the metadata storage server, thereby achieving the technical effect of reducing signaling overhead and increasing the reading rate.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
  • the disclosed technical contents may be implemented in other manners.
  • the device embodiments described above are only schematic.
  • the division of the unit may be a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or may be Integrate into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, unit or module, and may be electrical or otherwise.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present application may be embodied in the form of a software product in the form of a software product, or a part of the technical solution, which is stored in a storage medium.
  • a number of instructions are included to cause a computer device (which may be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and the like. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Television Signal Processing For Recording (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

本申请公开了一种视频流的存储方法、读取方法及装置。其中,该方法包括:将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;将所述存储地址添加至所述I帧数据中;将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。本申请解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。

Description

视频流的存储方法、读取方法及装置
本申请要求于2015年8月4日提交中国专利局、申请号为201510471364.2发明名称为“视频流的存储方法、读取方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理领域,具体而言,涉及一种视频流的存储方法、读取方法及装置。
背景技术
随着生活水平的提高,越来越多的视频涌入人们的生活。随着海量视频的产生,关于如何提高视频的存储效率成为一大难题。众所周知,视频的格式种类多种多样,在众多种类的格式中,对于实时视频(视频流)的存储效率的提高尤为重要。
然而,相关技术的在存储视频流时,往往是按照视频流发来的顺序依次逐帧进行存储,这导致对数据量较大的视频流存储较为缓慢,特别是在面临大量视频流均需存储时,还可能导致系统运行缓慢甚至瘫痪。
发明内容
本申请实施例提供了一种视频流的存储方法、读取方法及装置,以至少解决由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
根据本申请实施例的一个方面,提供了一种视频流的存储方法,应用于视频流的存储装置,包括:将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;将所述存储地址添加至所述I帧数据中;将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
可选地,在将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器之前,所述方法还包括:计算包含有所述存储地址的所述I帧数据的校验 值,其中,所述校验值用于在包含有所述存储地址的所述I帧数据丢失的情况下,恢复包含有所述存储地址的所述I帧数据;其中,所述将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器,包括:将包含有所述存储地址的所述I帧数据以及所述校验值存储至所述数据存储服务器。
可选地,所述计算包含有所述存储地址的所述I帧数据的校验值,包括:依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有所述存储地址的所述I帧数据进行计算,得到包含有所述存储地址的所述I帧数据的所述校验值。
可选地,所述获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中,包括:发送存储地址请求至元数据存储服务器,其中,由所述元数据存储服务器向所述数据存储服务器请求为所述非I帧数据分配所述存储地址;接收所述元数据存储服务器响应于所述存储地址请求所返回的所述存储地址;依据所述存储地址,将所述非I帧数据写入所述数据存储服务器中所述存储地址所指向的存储空间;将已写入所述数据存储服务器的所述非I帧数据的数据量上报至所述元数据存储服务器。
可选地,在获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中之前,所述方法还包括:依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算,得到所述非I帧数据的异或校验数据,所述异或校验数据用于在所述非I帧数据丢失的情况下,恢复所述非I帧数据;其中,所述获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中,包括:获取由所述数据存储服务器为所述非I帧数据以及所述异或校验数据分配的所述存储地址;将所述非I帧数据以及所述异或校验数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中。
根据本申请实施例的另一方面,还提供了一种视频流的读取方法,应用于视频流的读取装置,包括:获取视频流的I帧数据的存储地址;依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;从所述I帧数据 中解析出所述视频流的非I帧数据的存储地址;依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;将所述I帧数据及所述非I帧数据聚合为所述视频流。
可选地,在依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据之后,从所述I帧数据中解析出所述视频流的非I帧数据的存储地址之前,所述方法还包括:从所述数据存储服务器中读取所述I帧数据的校验值,所述校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对所述I帧数据进行计算得到的;对所述I帧数据进行校验,其中,在校验出所述I帧数据丢失的情况下,依据所述校验值恢复所述I帧数据。
可选地,在依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据之后,将所述I帧数据及所述非I帧数据聚合为所述视频流之前,所述方法还包括:从所述数据存储服务器中读取所述非I帧数据的异或校验数据,其中,所述异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算得到的;对所述非I帧数据进行校验,其中,在校验出所述非I帧数据丢失的情况下,依据所述异或校验数据恢复所述非I帧数据。
根据本申请实施例的另一方面,还提供了一种视频流的存储装置,包括:数据分离单元,用于将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;数据下发单元,用于获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;数据添加单元,用于将所述存储地址添加至所述I帧数据中;所述数据下发单元,还用于将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
可选地,视频流的存储装置还包括:第一计算单元,用于计算包含有所述存储地址的所述I帧数据的校验值,其中,所述校验值用于在包含有所述存储地址的所述I帧数据丢失的情况下,恢复包含有所述存储地址的所述I帧数据;其中,所述数据下发单元用于执行以下步骤将包含有所述存储地址的所 述I帧数据存储至所述数据存储服务器:将包含有所述存储地址的所述I帧数据以及所述校验值存储至所述数据存储服务器。
可选地,所述第一计算单元用于执行以下步骤计算包含有所述存储地址的所述I帧数据的校验值:依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有所述存储地址的所述I帧数据进行计算,得到包含有所述存储地址的所述I帧数据的所述校验值。
可选地,所述数据下发单元用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:发送存储地址请求至元数据存储服务器,其中,由所述元数据存储服务器向所述数据存储服务器请求为所述非I帧数据分配所述存储地址;接收所述元数据存储服务器响应于所述存储地址请求所返回的所述存储地址;依据所述存储地址,将所述非I帧数据写入所述数据存储服务器中所述存储地址所指向的存储空间;将已写入所述数据存储服务器的所述非I帧数据的数据量上报至所述元数据存储服务器。
可选地,视频流的存储装置还包括:第二计算单元,用于依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算,得到所述非I帧数据的异或校验数据,所述异或校验数据用于在所述非I帧数据丢失的情况下,恢复所述非I帧数据;其中,所述数据下发单元用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:获取由所述数据存储服务器为所述非I帧数据以及所述异或校验数据分配的所述存储地址;将所述非I帧数据以及所述异或校验数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中。
根据本申请实施例的另一方面,还提供了一种视频流的读取装置,包括:获取单元,用于获取视频流的I帧数据的存储地址;第一读取单元,用于依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;解析单元,用于从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;第二读取单元,用于依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外 的数据;聚合单元,用于将所述I帧数据及所述非I帧数据聚合为所述视频流。
可选地,所述第一读取单元,还用于从所述数据存储服务器中读取所述I帧数据的校验值,所述校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对所述I帧数据进行计算得到的;所述视频流的读取装置还包括:第一校验单元,用于对所述I帧数据进行校验,其中,在校验出所述I帧数据丢失的情况下,依据所述校验值恢复所述I帧数据。
可选地,所述第二读取单元,还用于从所述数据存储服务器中读取所述非I帧数据的异或校验数据,其中,所述异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算得到的;所述视频流的读取装置还包括:第二校验单元,用于对所述非I帧数据进行校验,其中,在校验出所述非I帧数据丢失的情况下,依据所述异或校验数据恢复所述非I帧数据。
另一方面,本申请还提供了一种电子设备,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过运行存储器中存储的可执行程序代码,以执行所述视频流的存储方法。
另一方面,本申请还提供了一种存储介质,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行所述的视频流的存储方法。
另一方面,本申请还提供了另一种电子设备,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过运行存储器中存储的可执行程序代码,以执行所述视频流的读取方法。
另一方面,本申请还提供了另一种存储介质,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行所述的视频流的读取方法。
在本申请实施例中,采用将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据; 获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中;将存储地址添加至I帧数据中;将包含有存储地址的I帧数据存储至数据存储服务器的方式,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
附图说明
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1是根据本申请实施例的一种可选的视频流的存储方法的流程示意图;
图2是根据本申请实施例的一种可选的视频流的帧格式的结构示意图;
图3是根据本申请实施例的一种可选的系统架构示意图;
图4是根据本申请实施例的一种可选的视频流的读取方法的流程示意图;
图5是根据本申请实施例的一种可选的视频流的存储装置的结构示意图;
图6是根据本申请实施例的另一种可选的视频流的存储装置的结构示意图;
图7是根据本申请实施例的又一种可选的视频流的存储装置的结构示意图;
图8是根据本申请实施例的一种可选的视频流的读取装置的结构示意图;
图9是根据本申请实施例的另一种可选的视频流的读取装置的结构示意图;
图10是根据本申请实施例的又一种可选的视频流的读取装置的结构示意图;
图11是根据本申请实施例的一种电子设备的结构示意图。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分的实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
需要说明的是,本申请的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
实施例1
根据本申请实施例,提供了一种视频流的存储方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
图1是根据本申请实施例的视频流的存储方法,该方法为视频流的存储装置侧的方法,如图1所示,该方法包括如下步骤:
步骤S102,将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据。
本申请上述步骤S102中,视频流可以是由监控摄像头实时拍摄传输来的数据。如图2所示,本申请实施例中视频流中包含I帧数据和非I帧数据,其中,I帧(I frame)又称为内部画面,I帧通常是每个GOP(Group of Picture,画面组)的第一个帧,作为随机访问的参考点,可以当成图像。I帧也称关键帧,它是帧间压缩编码的重要帧,解码时仅用I帧就可重构完整图像。非I帧 包括P帧和B帧,P帧和B帧也可称为参考帧,由前面的I帧预测而来,解码时必须基于I帧才可重构图像。其中,视频流的存储装置可以通过检查帧首部确定帧类型。
仍如图2所示,本申请实施例的视频流的存储方法,可以将视频流分离为I帧数据以及非I帧数据,在视频流中包含多个I帧的数据时,可以将多个I帧的数据聚合(也称按顺序存放)为条带,即如图2中的DI1至DI6,其中,DI1至DI6与I帧的数据一一对应,即DI1对应第一个I帧的数据,DI2对应第二个I帧的数据等等,在视频流中包含多个非I帧的数据时,也可以将多个非I帧的数据聚合为条带,即D1至D6,其中,D1至D6与非I帧的数据一一对应,即D1对应第一个非I帧的数据,D2对应第二个非I帧的数据等等。
例如,图2中第一个I帧的数据大小为15K,第二个I帧的数据的大小为9K,第三个I帧的数据的大小是27K,第四个I帧的数据的大小为30K,第五个I帧的数据的大小为21K,第六个I帧的数据的大小为11K,那么在将第一个I帧的数据到第六个I帧的数据聚合为条带的过程中,首先确定第一个I帧的数据到第六个I帧的数据中数据量最大的I帧是第六个I帧,第六个I帧的数据大小为30K,然后,以30K(或大于30K)为基准,为每个I帧的数据预留大小为30K的空间(即DI1至DI6,此时的DI1至DI6中并没有数据),最后,将第一个I帧的数据放置在DI1中,以此类推,将各个I帧的数据按照顺序放置在对应的空间中。同样地,将多个非I帧的数据聚合为条带的方法与将多个I帧的数据聚合为条带的方法类似。
步骤S104,获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中。
本申请上述步骤S104中,由于I帧数据和非I帧数据具有时间相关性(即一个I帧数据与一组非I帧数据构成一个GOP(GroupofPictures,图像组),读取时需要重新组合,因此为了后续读取视频流时,能够找到I帧数据对应的非I帧数据并且无需向元数据存储服务器请求,减少信令开销,本申请实施例的视频流的存储方法,在将视频流分离为I帧数据以及非I帧数据之后,首先获取由数据存储服务器为非I帧数据分配的存储地址,进而将在I帧数据中添 加该存储地址。
需要说明的是,只要获取到非I帧数据的存储地址后,就可以执行后续步骤S106及步骤S108,同时并行处理将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中,加快数据的存储速度。
也就是说,在获取到非I帧数据的存储地址后,为了加快对数据的存储速度,可以同时并行处理将该非I帧数据存储至该存储地址所指向的该数据存储服务器的存储空间中的步骤,和将该存储地址添加至该I帧数据中并将包含有该存储地址的该I帧数据存储至该数据存储服务器中的步骤。当然,也可以按照先后顺序对非I帧数据和I帧数据进行存储。
一种可选的实施方式,上述步骤S104,获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中,可以包括:
步骤S10,发送存储地址请求至元数据存储服务器,其中,由元数据存储服务器向数据存储服务器请求为非I帧数据分配存储地址。
本申请上述步骤S10中,在针对云存储的系统架构中,视频流的存储装置在申请存储空间时需要经过元数据存储服务器,由元数据存储服务器向数据服务器请求为非I帧数据分配存储地址。
如图3所示,为本实施方式的系统架构图。其中,视频流的存储装置首先将包含有存储地址请求的命令流发送至元数据存储服务器,其中,存储地址请求中应包含需存储的非I帧数据的大小,进而元数据存储服务器再将包含有存储地址请求的命令流发送至数据存储服务器,数据存储服务器为非I帧数据分配存储地址,并将包含有该存储地址的命令流发送给元数据存储服务器,进而元数据存储服务器将包含有该存储地址的命令流转发给视频流的存储装置,视频流的存储装置在获取到存储地址之后,可以依据存储地址将包含非I帧数据的数据流写入数据存储服务器,后续的I帧数据的存储流程与之类似,此处不再赘述。
步骤S12,接收元数据存储服务器响应于存储地址请求所返回的存储地址。
本申请上述步骤S12中,在数据存储服务器为非I帧数据分配存储地址后,视频流的存储装置会接收到元数据存储服务器响应于存储地址请求所返回的 非I帧数据的存储地址。
步骤S14,依据存储地址,将非I帧数据写入数据存储服务器中存储地址所指向的存储空间。
本申请上述步骤S14中,视频流的存储装置在获取到存储地址之后,可以将非I帧数据直接写入数据存储服务器中。
步骤S16,将已写入数据存储服务器的非I帧数据的数据量上报至元数据存储服务器。
本申请上述步骤S16中,在将非I帧数据写入数据存储服务器之后,视频流的存储装置需要将已写入数据存储服务器的非I帧数据的数据量上报至元数据存储服务器,以便元数据存储服务器记录最终写入的非I帧数据的大小。
这样元数据存储服务器可以对比,存储地址请求中包含的需存储的非I帧数据的大小,和元数据存储服务器所记录的最终写入的非I帧数据的大小,以确定请求被存储的所有非I帧是否全部被写入数据存储服务器。
并且,如图3所示,该视频流的存储装置可以将非I帧数据(I帧数据)写入该数据存储服务器,也可以从该数据存储服务器中获取非I帧数据(I帧数据)。
步骤S106,将存储地址添加至I帧数据中。
本申请上述步骤S106中,视频流的存储装置在获取到非I帧数据的存储地址之后,可以将该存储地址添加至与该非I帧数据对应的I帧数据中,即添加后的I帧数据包括真实数据以及非I帧数据的存储地址。
步骤S108,将包含有存储地址的I帧数据存储至数据存储服务器。
本申请上述步骤S108中,基于上述步骤S106,视频流的存储装置将包含有存储地址的I帧数据存储至数据存储服务器。其中,将包含有存储地址的I帧数据存储至数据存储服务器的方法与上述存储非I帧数据的方法类似,即发送存储地址请求至元数据存储服务器,其中,由元数据存储服务器向数据存储服务器请求为包含有存储地址的I帧数据分配存储地址,存储地址请求中应包含需存储的包含有存储地址的I帧数据的大小;接收元数据存储服务器响应于存储地址请求所返回的存储地址;依据存储地址,将包含有存储地址的I帧数据写入数据存储服务器中存储地址所指向的存储空间;将已写入数据存 储服务器的包含有存储地址的I帧数据的数据量上报至元数据存储服务器。
通过上述步骤,可以将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
可选地,在将包含有存储地址的I帧数据存储至数据存储服务器之前,本实施例的视频流的存储方法,还可以包括:
步骤S20,计算包含有存储地址的I帧数据的校验值,其中,校验值用于在包含有存储地址的I帧数据丢失的情况下,恢复包含有存储地址的I帧数据。
本申请上述步骤S20中,为了基于不同的数据类型,提供不同的数据保护模式,增强数据的安全性,视频流的存储装置可以通过计算包含有存储地址的I帧数据的校验值,实现对包含有存储地址的I帧数据的保护。其中,校验值用于在包含有存储地址的I帧数据丢失的情况下,恢复包含有存储地址的I帧数据。
可选地,计算包含有存储地址的I帧数据的校验值,包括:依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有存储地址的I帧数据进行计算,得到包含有存储地址的I帧数据的校验值。
其中,将包含有存储地址的I帧数据存储至数据存储服务器,包括:将包含有存储地址的I帧数据以及校验值存储至数据存储服务器。
仍如图2所示,在I帧数据的数量为多个的情况下,视频流的存储装置可以计算出多个校验值,校验值的个数应小于等于I帧数据的个数,如图2中的PI1和PI2,当DI1至DI6中哪个I帧数据丢失时,可以通过校验值恢复出丢失的I帧数据,需要指出的是,校验值可恢复的数据个数小于等于校验值的个数,即若计算出两个校验值,则最多可支持恢复两个丢失的I帧数据。为了增加I帧数据的安全性,也可计算多个校验值,均应在本申请实施例的保护范围之内。
需要补充的是,为了提高I帧数据的安全性,本实施例的视频流的存储装置还可以采用纠删码重构或副本的方式对I帧数据进行保护。
可选地,在获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中之前,本实施例的视频流的存储方法,还可以包括:
步骤S30,依据分布式奇偶校验的独立磁盘结构RAID-5算法对非I帧数据进行计算,得到非I帧数据的异或校验数据,异或校验数据用于在非I帧数据丢失的情况下,恢复非I帧数据。
本申请上述步骤S30中,为了基于不同的数据类型,提供不同的数据保护模式,增强数据的安全性,视频流的存储装置还可以依据分布式奇偶校验的独立磁盘结构RAID-5算法为非I帧数据进行保护。
其中,获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中,包括:获取由数据存储服务器为非I帧数据以及异或校验数据分配的存储地址;将非I帧数据以及异或校验数据存储至存储地址所指向的数据存储服务器的存储空间中。
仍如图2所示,在非I帧数据的数量为多个的情况下,视频流的存储装置可以计算出多个异或校验数据,异或校验数据的个数应小于等于非I帧数据的个数,如图2中的P1,当D1至D6中哪个非I帧数据丢失时,可以通过异或校验数据恢复出丢失的非I帧数据,需要指出的是,异或校验数据可恢复的数据个数小于等于异或校验数据的个数,即若计算出一个异或校验数据,则最多可支持恢复一个丢失的非I帧数据。为了增加非I帧数据的安全性,也可计算多个异或校验数据,均应在本申请实施例的保护范围之内。
在本申请实施例中,采用将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据;获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中;将存储地址添加至I帧数据中;将包含有存储地址的I帧数据存储至数据存储服务器的方式,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建 立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
实施例2
根据本申请实施例,提供了一种视频流的读取方法的方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
图4是根据本申请实施例的视频流的读取方法,该方法为视频流的读取装置侧的方法,如图4所示,该方法包括如下步骤:
步骤S402,获取视频流的I帧数据的存储地址。
本申请上述步骤S402中,依据上述的视频流的存储方法,本实施例对其对应的视频流的读取方法进行描述。在读取视频流的过程中,只需找到I帧数据,即可以通过I帧数据中包含的非I帧数据的存储地址找到非I帧数据,无需多次向元数据存储服务器请求,可以减少信令开销,提高读取速率。在读取视频流的过程中,视频流的读取装置首先可以向元数据存储服务器请求需读取的I帧数据的存储地址。
步骤S404,依据I帧数据的存储地址,从数据存储服务器中读取I帧数据。
本申请上述步骤S404中,视频流的读取装置根据获取到的I帧数据的存储地址,从数据存储服务器中读取I帧数据。其中,I帧数据包含有与其对应的非I帧数据的存储地址。
步骤S406,从I帧数据中解析出视频流的非I帧数据的存储地址。
本申请上述步骤S406中,视频流的读取装置从读取到的I帧数据中解析出视频流的非I帧数据的存储地址。
可选地,为了基于不同的数据类型,提供不同的数据保护模式,增强数 据的安全性,在依据I帧数据的存储地址,从数据存储服务器中读取I帧数据之后,从I帧数据中解析出视频流的非I帧数据的存储地址之前,方法还包括:从数据存储服务器中读取I帧数据的校验值,校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对I帧数据进行计算得到的;对I帧数据进行校验,其中,在校验出I帧数据丢失的情况下,依据校验值恢复I帧数据。
步骤S408,依据非I帧数据的存储地址,从数据存储服务器中读取非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据。
本申请上述步骤S408中,视频流的读取装置依据解析出的非I帧数据的存储地址,从数据存储服务器中读取非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据。
步骤S410,将I帧数据及非I帧数据聚合为视频流。
本申请上述步骤S410中,视频流的读取装置将I帧数据及非I帧数据聚合为视频流,此处聚合可以理解为按顺序摆放。
可选地,为了基于不同的数据类型,提供不同的数据保护模式,增强数据的安全性,在依据非I帧数据的存储地址,从数据存储服务器中读取非I帧数据之后,将I帧数据及非I帧数据聚合为视频流之前,方法还包括:从数据存储服务器中读取非I帧数据的异或校验数据,其中,异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对非I帧数据进行计算得到的;对非I帧数据进行校验,其中,在校验出非I帧数据丢失的情况下,依据异或校验数据恢复非I帧数据。
由上可知,本申请上述实施例所提供的方案,通过将视频流分离为I帧数据和非I帧数据,并在获取到非I帧数据的存储地址后将该存储地址添加至I帧数据中,进而可以只需找到I帧数据即可找到非I帧数据,达到了无需多次请求元数据存储服务器目的,从而实现了减少信令开销,提高读取速率的技术效果。
需要说明的是,对于前述的各方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本申请并不受所描述的动作顺序的限制,因为依据本申请,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属 于优选实施例,所涉及的动作和模块并不一定是本申请所必须的。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例的方法。
实施例3
根据本申请实施例,还提供了一种用于实施上述方法实施例的装置实施例,本申请上述实施例所提供的装置可以在计算机终端上运行。
图5是根据本申请实施例的视频流的存储装置的结构示意图。
如图5所示,该视频流的存储装置可以包括数据分离单元502、数据下发单元504以及数据添加单元506。
其中,数据分离单元502,用于将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;数据下发单元504,用于获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;数据添加单元506,用于将所述存储地址添加至所述I帧数据中;所述数据下发单元502,还用于将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
由上可知,本申请上述实施例三所提供的方案,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视 频流存储效率较低的技术问题。
此处需要说明的是,上述数据分离单元502、数据下发单元504以及数据添加单元506对应于实施例一中的步骤S102至步骤S108,三个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例一所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在计算机终端中,可以通过软件实现,也可以通过硬件实现。
可选地,如图6所示,视频流的存储装置还包括:第一计算单元602。
第一计算单元602,用于计算包含有所述存储地址的所述I帧数据的校验值,其中,所述校验值用于在包含有所述存储地址的所述I帧数据丢失的情况下,恢复包含有所述存储地址的所述I帧数据;其中,所述数据下发单元504用于执行以下步骤将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器:将包含有所述存储地址的所述I帧数据以及所述校验值存储至所述数据存储服务器。
可选地,所述第一计算单元602用于执行以下步骤计算包含有所述存储地址的所述I帧数据的校验值:依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有所述存储地址的所述I帧数据进行计算,得到包含有所述存储地址的所述I帧数据的所述校验值。
可选地,所述数据下发单元504用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:发送存储地址请求至元数据存储服务器,其中,由所述元数据存储服务器向所述数据存储服务器请求为所述非I帧数据分配所述存储地址;接收所述元数据存储服务器响应于所述存储地址请求所返回的所述存储地址;依据所述存储地址,将所述非I帧数据写入所述数据存储服务器中所述存储地址所指向的存储空间;将已写入所述数据存储服务器的所述非I帧数据的数据量上报至所述元数据存储服务器。
可选地,如图7所示,视频流的存储装置还包括:第二计算单元702。
第二计算单元702,用于依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算,得到所述非I帧数据的异或校验数据,所述异或校验数据用于在所述非I帧数据丢失的情况下,恢复所述非I帧数据;其中, 所述数据下发单元504用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:获取由所述数据存储服务器为所述非I帧数据以及所述异或校验数据分配的所述存储地址;将所述非I帧数据以及所述异或校验数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中。
在本申请实施例中,采用将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据;获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中;将存储地址添加至I帧数据中;将包含有存储地址的I帧数据存储至数据存储服务器的方式,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
实施例4
根据本申请实施例,还提供了一种用于实施上述方法实施例的装置实施例,本申请上述实施例所提供的装置可以在计算机终端上运行。
图8是根据本申请实施例的视频流的读取装置的结构示意图。
如图8所示,该视频流的读取装置可以包括获取单元802、第一读取单元804、解析单元806、第二读取单元808以及聚合单元810。
其中,获取单元802,用于获取视频流的I帧数据的存储地址;第一读取单元804,用于依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;解析单元806,用于从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;第二读取单元808,用于依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所 述视频流中除所述I帧数据以外的数据;聚合单元810,用于将所述I帧数据及所述非I帧数据聚合为所述视频流。
由上可知,本申请上述实施例三所提供的方案,通过将视频流分离为I帧数据和非I帧数据,并在获取到非I帧数据的存储地址后将该存储地址添加至I帧数据中,进而可以只需找到I帧数据即可找到非I帧数据,达到了无需多次请求元数据存储服务器目的,从而实现了减少信令开销,提高读取速率的技术效果。
此处需要说明的是,上述获取单元802、第一读取单元804、解析单元806、第二读取单元808以及聚合单元810对应于实施例二中的步骤S402至步骤S410,五个模块与对应的步骤所实现的示例和应用场景相同,但不限于上述实施例二所公开的内容。需要说明的是,上述模块作为装置的一部分可以运行在计算机终端中,可以通过软件实现,也可以通过硬件实现。
可选地,所述第一读取单元804,还用于从所述数据存储服务器中读取所述I帧数据的校验值,所述校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对所述I帧数据进行计算得到的。
如图9所示,所述装置还包括:第一校验单元902,用于对所述I帧数据进行校验,其中,在校验出所述I帧数据丢失的情况下,依据所述校验值恢复所述I帧数据。
可选地,所述第二读取单元808,还用于从所述数据存储服务器中读取所述非I帧数据的异或校验数据,其中,所述异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算得到的。
如图10所示,所述装置还包括:第二校验单元1002,用于对所述非I帧数据进行校验,其中,在校验出所述非I帧数据丢失的情况下,依据所述异或校验数据恢复所述非I帧数据。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
本申请实施例还提供了一种电子设备,如图11所示,包括:壳体111、处理器112、存储器113、电路板114和电源电路115,其中,电路板114安置在壳体111围成的空间内部,处理器112和存储器113设置在电路板114上;电源电路115,用于为电子设备的各个电路或器件供电;存储器113用于存储可执行程 序代码;处理器112通过运行存储器中存储的可执行程序代码,以执行以下步骤:
将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;
将所述存储地址添加至所述I帧数据中;
将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
在本申请实施例中,采用将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据;获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中;将存储地址添加至I帧数据中;将包含有存储地址的I帧数据存储至数据存储服务器的方式,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
该电子设备以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包 括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。
(5)其他具有数据交互功能的电子装置。
本申请实施例提供了一种存储介质,该存储介质用于存储可执行程序代码,该可执行程序代码被运行以执行该视频流的存储方法,其中,视频流的存储方法,可以包括:
将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;
将所述存储地址添加至所述I帧数据中;
将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
在本申请实施例中,采用将获取到的视频流分离为I帧数据以及与I帧数据对应的非I帧数据,其中,非I帧数据包含视频流中除I帧数据以外的数据;获取由数据存储服务器为非I帧数据分配的存储地址,并将非I帧数据存储至存储地址所指向的数据存储服务器的存储空间中;将存储地址添加至I帧数据中;将包含有存储地址的I帧数据存储至数据存储服务器的方式,通过将视频流分离为I帧数据和非I帧数据,在分离之后,为了建立I帧数据和非I帧数据的对应关系,将获取到的非I帧数据的存储地址添加至I帧数据中,由于建立了I帧数据和非I帧数据的对应关系,因此无需按照相关技术只能先存I帧数据再存非I帧数据的方法,可以并行存储I帧数据和非I帧数据,达到了快速存储视频流的目的,从而实现了视频流存储效率较高的技术效果,进而解决了由于相关技术在存储视频流时是按照视频流发来的顺序依次逐帧进行存储造成的视频流存储效率较低的技术问题。
本申请实施例还提供了另一种电子设备,其中,结构如图11所示结构相同,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过运行存储器中存储的可执行程序代码,以执行以下步骤:
获取视频流的I帧数据的存储地址;
依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;
从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;
依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
将所述I帧数据及所述非I帧数据聚合为所述视频流。
本申请上述实施例所提供的方案,通过将视频流分离为I帧数据和非I帧数据,并在获取到非I帧数据的存储地址后将该存储地址添加至I帧数据中,进而可以只需找到I帧数据即可找到非I帧数据,达到了无需多次请求元数据存储服务器目的,从而实现了减少信令开销,提高读取速率的技术效果。
该电子设备以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可 靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。
(5)其他具有数据交互功能的电子装置。
本申请实施例提供了另一种存储介质,该存储介质用于存储可执行程序代码,该可执行程序代码被运行以执行该视频流的读取方法,其中,视频流的读取方法,可以包括:
获取视频流的I帧数据的存储地址;
依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;
从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;
依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
将所述I帧数据及所述非I帧数据聚合为所述视频流。
本申请上述实施例所提供的方案,通过将视频流分离为I帧数据和非I帧数据,并在获取到非I帧数据的存储地址后将该存储地址添加至I帧数据中,进而可以只需找到I帧数据即可找到非I帧数据,达到了无需多次请求元数据存储服务器目的,从而实现了减少信令开销,提高读取速率的技术效果。
对于装置、电子设备、应用程序及存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
在本申请的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或模块的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本申请的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本申请的保护范围。

Claims (20)

  1. 一种视频流的存储方法,其特征在于,应用于视频流的存储装置,所述方法包括:
    将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
    获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;
    将所述存储地址添加至所述I帧数据中;
    将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
  2. 根据权利要求1所述的方法,其特征在于,在将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器之前,所述方法还包括:
    计算包含有所述存储地址的所述I帧数据的校验值,其中,所述校验值用于在包含有所述存储地址的所述I帧数据丢失的情况下,恢复包含有所述存储地址的所述I帧数据;
    其中,所述将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器,包括:
    将包含有所述存储地址的所述I帧数据以及所述校验值存储至所述数据存储服务器。
  3. 根据权利要求2所述的方法,其特征在于,所述计算包含有所述存储地址的所述I帧数据的校验值,包括:
    依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有所述存储地址的所述I帧数据进行计算,得到包含有所述存储地址的所述I帧数据的所述校验值。
  4. 根据权利要求1所述的方法,其特征在于,所述获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中,包括:
    发送存储地址请求至元数据存储服务器,其中,由所述元数据存储服务器向所述数据存储服务器请求为所述非I帧数据分配所述存储地址;
    接收所述元数据存储服务器响应于所述存储地址请求所返回的所述存储 地址;
    依据所述存储地址,将所述非I帧数据写入所述数据存储服务器中所述存储地址所指向的存储空间;
    将已写入所述数据存储服务器的所述非I帧数据的数据量上报至所述元数据存储服务器。
  5. 根据权利要求1至4中任一项所述的方法,其特征在于,在获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中之前,所述方法还包括:
    依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算,得到所述非I帧数据的异或校验数据,所述异或校验数据用于在所述非I帧数据丢失的情况下,恢复所述非I帧数据;
    其中,所述获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中,包括:
    获取由所述数据存储服务器为所述非I帧数据以及所述异或校验数据分配的所述存储地址;
    将所述非I帧数据以及所述异或校验数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中。
  6. 一种视频流的读取方法,其特征在于,应用于视频流的读取装置,所述方法包括:
    获取视频流的I帧数据的存储地址;
    依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;
    从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;
    依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
    将所述I帧数据及所述非I帧数据聚合为所述视频流。
  7. 根据权利要求6所述的方法,其特征在于,在依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据之后,从所述I帧数据中解析 出所述视频流的非I帧数据的存储地址之前,所述方法还包括:
    从所述数据存储服务器中读取所述I帧数据的校验值,所述校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对所述I帧数据进行计算得到的;
    对所述I帧数据进行校验,其中,在校验出所述I帧数据丢失的情况下,依据所述校验值恢复所述I帧数据。
  8. 根据权利要求6或7所述的方法,其特征在于,在依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据之后,将所述I帧数据及所述非I帧数据聚合为所述视频流之前,所述方法还包括:
    从所述数据存储服务器中读取所述非I帧数据的异或校验数据,其中,所述异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算得到的;
    对所述非I帧数据进行校验,其中,在校验出所述非I帧数据丢失的情况下,依据所述异或校验数据恢复所述非I帧数据。
  9. 一种视频流的存储装置,其特征在于,包括:
    数据分离单元,用于将获取到的视频流分离为I帧数据以及与所述I帧数据对应的非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
    数据下发单元,用于获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中;
    数据添加单元,用于将所述存储地址添加至所述I帧数据中;
    所述数据下发单元,还用于将包含有所述存储地址的所述I帧数据存储至所述数据存储服务器。
  10. 根据权利要求9所述的装置,其特征在于,还包括:
    第一计算单元,用于计算包含有所述存储地址的所述I帧数据的校验值,其中,所述校验值用于在包含有所述存储地址的所述I帧数据丢失的情况下,恢复包含有所述存储地址的所述I帧数据;
    其中,所述数据下发单元用于执行以下步骤将包含有所述存储地址的所 述I帧数据存储至所述数据存储服务器:
    将包含有所述存储地址的所述I帧数据以及所述校验值存储至所述数据存储服务器。
  11. 根据权利要求10所述的装置,其特征在于,所述第一计算单元用于执行以下步骤计算包含有所述存储地址的所述I帧数据的校验值:
    依据两种存储的奇偶校验码的磁盘结构RAID-6算法对包含有所述存储地址的所述I帧数据进行计算,得到包含有所述存储地址的所述I帧数据的所述校验值。
  12. 根据权利要求9所述的装置,其特征在于,所述数据下发单元用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:
    发送存储地址请求至元数据存储服务器,其中,由所述元数据存储服务器向所述数据存储服务器请求为所述非I帧数据分配所述存储地址;
    接收所述元数据存储服务器响应于所述存储地址请求所返回的所述存储地址;
    依据所述存储地址,将所述非I帧数据写入所述数据存储服务器中所述存储地址所指向的存储空间;
    将已写入所述数据存储服务器的所述非I帧数据的数据量上报至所述元数据存储服务器。
  13. 根据权利要求9至12中任一项所述的装置,其特征在于,还包括:
    第二计算单元,用于依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算,得到所述非I帧数据的异或校验数据,所述异或校验数据用于在所述非I帧数据丢失的情况下,恢复所述非I帧数据;
    其中,所述数据下发单元用于执行以下步骤获取由数据存储服务器为所述非I帧数据分配的存储地址,并将所述非I帧数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中:
    获取由所述数据存储服务器为所述非I帧数据以及所述异或校验数据分配的所述存储地址;
    将所述非I帧数据以及所述异或校验数据存储至所述存储地址所指向的所述数据存储服务器的存储空间中。
  14. 一种视频流的读取装置,其特征在于,包括:
    获取单元,用于获取视频流的I帧数据的存储地址;
    第一读取单元,用于依据所述I帧数据的存储地址,从数据存储服务器中读取所述I帧数据;
    解析单元,用于从所述I帧数据中解析出所述视频流的非I帧数据的存储地址;
    第二读取单元,用于依据所述非I帧数据的存储地址,从所述数据存储服务器中读取所述非I帧数据,其中,所述非I帧数据包含所述视频流中除所述I帧数据以外的数据;
    聚合单元,用于将所述I帧数据及所述非I帧数据聚合为所述视频流。
  15. 根据权利要求14所述的装置,其特征在于,所述第一读取单元,还用于从所述数据存储服务器中读取所述I帧数据的校验值,所述校验值为预先依据两种存储的奇偶校验码的磁盘结构RAID-6算法对所述I帧数据进行计算得到的;
    所述装置还包括:
    第一校验单元,用于对所述I帧数据进行校验,其中,在校验出所述I帧数据丢失的情况下,依据所述校验值恢复所述I帧数据。
  16. 根据权利要求14或15所述的装置,其特征在于,所述第二读取单元,还用于从所述数据存储服务器中读取所述非I帧数据的异或校验数据,其中,所述异或校验数据为预先依据分布式奇偶校验的独立磁盘结构RAID-5算法对所述非I帧数据进行计算得到的;
    所述装置还包括:
    第二校验单元,用于对所述非I帧数据进行校验,其中,在校验出所述非I帧数据丢失的情况下,依据所述异或校验数据恢复所述非I帧数据。
  17. 一种电子设备,其特征在于,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器 用于存储可执行程序代码;处理器通过运行存储器中存储的可执行程序代码,以执行权利要求1-5任一项所述的视频流的存储方法。
  18. 一种存储介质,其特征在于,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行权利要求1-5任一项所述的视频流的存储方法。
  19. 一种电子设备,其特征在于,包括:壳体、处理器、存储器、电路板和电源电路,其中,电路板安置在壳体围成的空间内部,处理器和存储器设置在电路板上;电源电路,用于为电子设备的各个电路或器件供电;存储器用于存储可执行程序代码;处理器通过运行存储器中存储的可执行程序代码,以执行权利要求6-8任一项所述的视频流的读取方法。
  20. 一种存储介质,其特征在于,所述存储介质用于存储可执行程序代码,所述可执行程序代码被运行以执行权利要求6-8任一项所述的视频流的读取方法。
PCT/CN2016/091510 2015-08-04 2016-07-25 视频流的存储方法、读取方法及装置 WO2017020737A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US15/749,986 US10332565B2 (en) 2015-08-04 2016-07-25 Video stream storage method, reading method and device
EP16832225.3A EP3334165B1 (en) 2015-08-04 2016-07-25 Video stream storing and video stream reading method and apparatus therefor

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510471364.2 2015-08-04
CN201510471364.2A CN106713940B (zh) 2015-08-04 2015-08-04 视频流的存储方法、读取方法及装置

Publications (1)

Publication Number Publication Date
WO2017020737A1 true WO2017020737A1 (zh) 2017-02-09

Family

ID=57942435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/091510 WO2017020737A1 (zh) 2015-08-04 2016-07-25 视频流的存储方法、读取方法及装置

Country Status (4)

Country Link
US (1) US10332565B2 (zh)
EP (1) EP3334165B1 (zh)
CN (1) CN106713940B (zh)
WO (1) WO2017020737A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3809708A4 (en) * 2018-06-13 2021-07-14 Hangzhou Hikvision System Technology Co., Ltd. METHOD AND DEVICE FOR STORING VIDEO DATA IN A CLOUD STORAGE SYSTEM

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110874185B (zh) * 2018-09-04 2021-12-17 杭州海康威视系统技术有限公司 一种数据存储方法及存储装置
CN109982020A (zh) * 2019-02-26 2019-07-05 南京邮电大学 一种视频存储及检索方法
CN114067964A (zh) * 2021-11-22 2022-02-18 武汉联影医疗科技有限公司 医疗影像数据的处理方法、装置、计算机设备和存储介质
CN115955576B (zh) * 2023-03-10 2023-06-09 深圳市泛联信息科技有限公司 视频数据访问方法、装置、存储节点及存储介质

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1232348A (zh) * 1998-02-13 1999-10-20 松下电器产业株式会社 图象解码装置及记录媒体
CN1574943A (zh) * 2003-06-11 2005-02-02 三星电子株式会社 用于控制数字视频比特流逆向播放的装置和方法
CN1649412A (zh) * 2005-02-03 2005-08-03 北京北大青鸟集成电路有限公司 视频图像的拆分及重现的方法
CN2775973Y (zh) * 2004-12-31 2006-04-26 北京中星微电子有限公司 一种针对Mpeg-4宏块的帧缓冲结构
US20060248216A1 (en) * 2005-04-27 2006-11-02 Samsung Electronics Co., Ltd. System and method for providing multimedia streaming service
CN102870416A (zh) * 2011-02-25 2013-01-09 松下电器产业株式会社 运动图像编码装置以及运动图像解码装置
CN103780877A (zh) * 2013-12-26 2014-05-07 深圳市华仁达技术有限公司 基于h264编码的海量视频数据的存储及检索方法

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4332770B2 (ja) * 2000-08-02 2009-09-16 ソニー株式会社 画像処理装置および画像処理方法、並びに記録媒体
US7218635B2 (en) * 2001-08-31 2007-05-15 Stmicroelectronics, Inc. Apparatus and method for indexing MPEG video data to perform special mode playback in a digital video recorder and indexed signal associated therewith
JP2003209807A (ja) * 2002-01-10 2003-07-25 Canon Inc 動画再生方法及び装置
US8150232B2 (en) * 2004-09-03 2012-04-03 Panasonic Corporation Recording medium, recording device, program, and recording method
US8195037B2 (en) * 2004-11-12 2012-06-05 Pelco, Inc. Apparatus and method of storing video data
US8542705B2 (en) * 2007-01-23 2013-09-24 Mobitv, Inc. Key frame detection and synchronization
US7929698B2 (en) * 2007-06-15 2011-04-19 Sony Corporation Selective encryption to enable trick play with enhanced security
JP5189640B2 (ja) * 2007-08-09 2013-04-24 ジーブイビービー ホールディングス エス.エイ.アール.エル. ビデオデータの再生システム
KR100928324B1 (ko) * 2007-10-02 2009-11-25 주식회사 아이브이넷 압축된 동영상을 복원하기 위한 프레임 버퍼 메모리 운영방법 및 이에 적합한 디코딩 장치
US9538142B2 (en) * 2009-02-04 2017-01-03 Google Inc. Server-side support for seamless rewind and playback of video streaming
CN101674444B (zh) * 2009-10-15 2011-01-05 杭州华三通信技术有限公司 视频数据的存储方法、系统和编码器
CN102169709A (zh) * 2010-12-08 2011-08-31 深圳市融创天下科技发展有限公司 一种帧数据存储和定位的方法、系统、终端设备
CN102075792B (zh) * 2010-12-23 2013-01-02 华为技术有限公司 视频文件播放方法及系统、用户端设备、服务器设备
US8855466B2 (en) * 2012-05-01 2014-10-07 Eldon Technology Limited Separate video file for I-frame and non-I-frame data to improve disk performance in trick play
CN104699416B (zh) * 2013-12-10 2017-12-01 杭州海康威视系统技术有限公司 一种数据存储系统以及一种数据存储方法
CN103826078A (zh) * 2014-03-11 2014-05-28 深圳瑞信视讯技术有限公司 视频数据线性存储方法、装置及终端
WO2015195104A1 (en) * 2014-06-17 2015-12-23 Hewlett-Packard Development Company, L.P. Distributed storage data recovery

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1232348A (zh) * 1998-02-13 1999-10-20 松下电器产业株式会社 图象解码装置及记录媒体
CN1574943A (zh) * 2003-06-11 2005-02-02 三星电子株式会社 用于控制数字视频比特流逆向播放的装置和方法
CN2775973Y (zh) * 2004-12-31 2006-04-26 北京中星微电子有限公司 一种针对Mpeg-4宏块的帧缓冲结构
CN1649412A (zh) * 2005-02-03 2005-08-03 北京北大青鸟集成电路有限公司 视频图像的拆分及重现的方法
US20060248216A1 (en) * 2005-04-27 2006-11-02 Samsung Electronics Co., Ltd. System and method for providing multimedia streaming service
CN102870416A (zh) * 2011-02-25 2013-01-09 松下电器产业株式会社 运动图像编码装置以及运动图像解码装置
CN103780877A (zh) * 2013-12-26 2014-05-07 深圳市华仁达技术有限公司 基于h264编码的海量视频数据的存储及检索方法

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3809708A4 (en) * 2018-06-13 2021-07-14 Hangzhou Hikvision System Technology Co., Ltd. METHOD AND DEVICE FOR STORING VIDEO DATA IN A CLOUD STORAGE SYSTEM
US11316925B2 (en) 2018-06-13 2022-04-26 Hangzhou Hikvision System Technology Co., Ltd. Video data storage method and device in cloud storage system

Also Published As

Publication number Publication date
US10332565B2 (en) 2019-06-25
CN106713940A (zh) 2017-05-24
EP3334165A4 (en) 2019-03-20
EP3334165B1 (en) 2020-01-15
CN106713940B (zh) 2019-12-20
US20180226104A1 (en) 2018-08-09
EP3334165A1 (en) 2018-06-13

Similar Documents

Publication Publication Date Title
WO2017020737A1 (zh) 视频流的存储方法、读取方法及装置
US10516903B2 (en) Method and apparatus for transmitting video data
CN105808151B (zh) 固态硬盘存储设备和固态硬盘存储设备的数据存取方法
WO2017177622A1 (zh) 一种全景视频的播放方法、装置和电子设备
US9451180B2 (en) Video stitching system and method
US10476928B2 (en) Network video playback method and apparatus
US20200244440A1 (en) Blockchain-based data evidence storage method and apparatus
CN104837052A (zh) 播放多媒体数据的方法及装置
WO2015139624A1 (zh) 一种视频数据编码、解码的方法和装置
EP3800894A1 (en) Method and apparatus for detecting video playing quality
CN102325025B (zh) 提供源真实性的数据处理方法及系统
CN104639325A (zh) 一种基于统一认证的云游戏系统及方法
KR20180102605A (ko) 이미지 드로잉 방법, 관련된 디바이스 및 시스템
KR20140070896A (ko) 비디오 스트리밍 방법 및 그 전자 장치
US8606087B2 (en) Screen recording system and method
US20200286120A1 (en) Advertising monitoring method, system, apparatus, and electronic equipment
CN106534137B (zh) 媒体流传输方法及装置
US20150264375A1 (en) Encapsulation of video scanning format information for media transport and storage
US20210014580A1 (en) Method and apparatus for signaling grouping types in an image container file
CN115150368B (zh) 媒体文件的关联处理方法、装置、介质及电子设备
CN115243053B (zh) 点云编解码方法及相关设备
US20170171393A1 (en) Method and Device for Call
US20240129537A1 (en) Method and apparatus for signaling cmaf switching sets in isobmff
CN109246434B (zh) 视频编码、解码方法及电子设备
CN116962663A (zh) 视频卡顿检测方法、装置、设备及计算机可读存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16832225

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 15749986

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2016832225

Country of ref document: EP