CN109120885B - Video data acquisition method and device - Google Patents

Video data acquisition method and device Download PDF

Info

Publication number
CN109120885B
CN109120885B CN201710495206.XA CN201710495206A CN109120885B CN 109120885 B CN109120885 B CN 109120885B CN 201710495206 A CN201710495206 A CN 201710495206A CN 109120885 B CN109120885 B CN 109120885B
Authority
CN
China
Prior art keywords
node
storage
video data
target
index data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201710495206.XA
Other languages
Chinese (zh)
Other versions
CN109120885A (en
Inventor
丁光凯
汪渭春
林起芊
王伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou Hikvision Digital Technology Co Ltd
Original Assignee
Hangzhou Hikvision Digital Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou Hikvision Digital Technology Co Ltd filed Critical Hangzhou Hikvision Digital Technology Co Ltd
Priority to CN201710495206.XA priority Critical patent/CN109120885B/en
Publication of CN109120885A publication Critical patent/CN109120885A/en
Application granted granted Critical
Publication of CN109120885B publication Critical patent/CN109120885B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N7/00Television systems
    • H04N7/18Closed-circuit television [CCTV] systems, i.e. systems in which the video signal is not broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • 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
    • H04N21/23103Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion using load balancing strategies, e.g. by placing or distributing content on different disks, different memories or different servers
    • 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
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/91Television signal processing therefor
    • H04N5/93Regeneration of the television signal or of selected parts thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention discloses a video data acquisition method, a device and a system, which are applied to a cloud storage system, wherein the method comprises the following steps: receiving a first acquisition request sent by a terminal, wherein the first acquisition request comprises a target time period; searching index data of the video data corresponding to the target time period from at least two index data blocks stored in a distributed manner, wherein the index data stores an index of at least one video frame in the video data; sending the index data to the terminal; receiving a second acquisition request sent by the terminal, wherein the second acquisition request comprises the index data; inquiring video data corresponding to the index data from at least two video data blocks stored in a distributed mode; and sending the video data to the terminal.

Description

Video data acquisition method and device
Technical Field
The embodiment of the invention relates to the field of cloud storage, in particular to a video data acquisition method and device.
Background
The monitoring system comprises a camera and a storage system, and the management node stores video data shot by the camera in the storage system.
In the process of storing the video data, the video data are divided into a plurality of video data blocks according to different time periods, an index file is generated for each video data block, and the index files corresponding to the video data blocks are stored in the same storage node. When the terminal acquires video data in a target time period from the cloud storage system for video playback, the index file of each video data block in the storage node needs to be traversed to find the video data belonging to the target time period and play back the video data.
However, as the number of cameras and the monitoring time length increase, the data volume of the video data in the cloud storage system becomes larger and larger, so that the data volume of the index file corresponding to the video data also becomes larger and larger. When the data volume of the index file reaches a certain order of magnitude, the efficiency of traversing and searching all the index files is low because all the index files need to be traversed during each playback.
Disclosure of Invention
In order to solve the problem of low efficiency of traversing and searching all index files during playback, the embodiment of the invention provides a video data acquisition method and a video data acquisition device. The technical scheme is as follows:
according to a first aspect of the present invention, there is provided a video data acquisition method applied in a cloud storage system, the method including:
receiving a first acquisition request sent by a terminal, wherein the first acquisition request comprises a target time period;
searching index data of the video data corresponding to the target time period from at least two index data blocks in distributed storage;
sending the index data to the terminal;
receiving a second acquisition request sent by the terminal, wherein the second acquisition request comprises the index data;
acquiring video data corresponding to the index data from at least two video data blocks stored in a distributed manner;
and sending the video data to the terminal.
In an optional embodiment, the cloud storage system further comprises:
at least two storage nodes and at least one forwarding node, wherein the at least two storage nodes are used for storing the index data blocks in a distributed manner;
the querying out the index data of the video data corresponding to the target time period from at least two index data blocks in distributed storage includes:
and the target forwarding node acquires the index data corresponding to the target time period from the at least two storage nodes, wherein the target forwarding node is one of the at least one forwarding node.
In an optional embodiment, the cloud storage system further comprises: a management node;
the at least two storage nodes are further used for storing first metadata of the index data block, wherein the first metadata comprises time period information of the index data block, and a storage node and a storage position where the index data block is located;
the obtaining, by the target forwarding node, the index data corresponding to the target time period from the at least two storage nodes includes:
the target forwarding node sends a first metadata acquisition request to the management node, wherein the first metadata acquisition request comprises the target time period;
the target forwarding node receives the first metadata which belongs to the target time period and is sent by the management node, wherein the first metadata which belongs to the target time period is obtained by the management node through inquiring the at least two storage nodes;
and the target forwarding node determines a first target storage node according to the first metadata, and inquires index data corresponding to the target time period from the first target storage node.
In an optional embodiment, the cloud storage system further comprises: at least two storage nodes and at least one forwarding node, wherein the at least two storage nodes are used for distributively storing the video data blocks;
the querying out the video data corresponding to the index data from at least two video data blocks in distributed storage includes:
and the target forwarding node acquires the video data corresponding to the index data from the at least two storage nodes, wherein the target forwarding node is one of the at least one forwarding node.
In an alternative embodiment, the index data comprises a frame storage location of at least one video frame in the video data belonging to the target time period;
the at least two storage nodes are further used for storing second metadata of the video data block, wherein the second metadata comprises time period information of the video data block, and a storage node and a storage position where the video data block is located;
the target forwarding node acquires video data corresponding to the index data from the at least two storage nodes, and the method comprises the following steps:
the target forwarding node sends a second metadata acquisition request to the management node, wherein the second metadata acquisition request comprises the target time period;
the target forwarding node receives the second metadata which belongs to the target time period and is sent by the management node, and the management node inquires the at least two storage nodes to obtain the second metadata which belongs to the target time period;
and the target forwarding node determines a second target storage node according to the second metadata, and acquires the video data from the second target storage node according to the frame storage position.
In an optional embodiment, the cloud storage system further comprises: a management node;
before the receiving the first obtaining request sent by the terminal, the method further includes:
the management node receives a node acquisition request sent by a terminal, wherein the node acquisition request is used for requesting the management node to distribute the target forwarding node;
the management node allocates the target forwarding node from the at least one forwarding node and sends the service address of the target forwarding node to the terminal;
the first obtaining request sent by the receiving terminal comprises:
and the target forwarding node receives the first acquisition request sent by the terminal through the service address.
In an optional embodiment, the cloud storage system further comprises: an access node;
before the querying out the index data of the video data corresponding to the target time period from the at least two index data blocks in the distributed storage, the method further includes:
the access node acquires the video data;
the access node performs frame analysis on the video data to obtain the index data;
the access node divides the index data into at least two index data blocks, and stores the index data blocks into at least two storage nodes in a distributed storage mode;
the access node divides the video data into at least two video data blocks and stores the video data blocks into at least two storage nodes in a distributed storage mode.
In an optional embodiment, the dividing, by the access node, the index data into at least one index data block, and storing the index data block in a distributed storage manner in at least two storage nodes includes:
the access node sends a first allocation request to a management node, wherein the first allocation request is used for requesting the management node to allocate a storage node during the ith storage, and i is more than or equal to 1;
the access node receives identification information of a storage node during the ith storage, wherein the storage node during the ith storage is the storage node during the ith storage selected from the at least two storage nodes by the management node;
the access node writes an ith index data block with the length not greater than a preset data value in the index data into a storage node during the ith storage;
and i is set to be i +1, and the step that the management node receives the first allocation request sent by the access node is executed again.
In an optional embodiment, the dividing, by the access node, the video data into at least one video data block, and storing the video data block in a distributed storage manner in at least two storage nodes includes:
the access node sends a second distribution request to a management node, wherein the second distribution request is used for requesting the management node to distribute a storage node during the k-th storage, and k is more than or equal to 1;
the access node receives identification information of a storage node during the k-th storage, wherein the storage node during the k-th storage is the storage node during the k-th storage selected by the management node from the at least two storage nodes;
the access node writes a kth video data block with the length not greater than a preset data value in the video data into a storage node during the kth storage;
and k is k +1, and the step that the management node receives the second allocation request sent by the access node is executed again.
In a second aspect of the present invention, there is provided a video data acquisition method, the method comprising:
sending a first acquisition request to a cloud storage system, wherein the first acquisition request comprises a target time period;
receiving index data sent by the cloud storage system, wherein the index data stores an index of at least one video frame in the video data corresponding to the target time period, and the index data is inquired by the cloud storage system from at least two index data blocks in distributed storage;
sending a second acquisition request to the cloud storage system, wherein the second acquisition request comprises the index data;
receiving video data sent by the cloud storage system; the video data is obtained by the cloud storage system through querying from at least two video data blocks in distributed storage and corresponds to the index data;
and packaging the video data into a video stream, and playing back the video stream.
In an optional embodiment, the cloud storage system further comprises: the system comprises a management node, at least two storage nodes and at least one forwarding node;
before the sending of the first acquisition request to the cloud storage system, the method further includes:
sending a node acquisition request to the management node, the node acquisition request being used to request the management node to allocate the target forwarding node, the target forwarding node being one of the at least one forwarding node;
receiving a service address of the target forwarding node sent by the management node, where the target forwarding node is allocated to the terminal after the management node selects from the at least one forwarding node;
the sending of the first acquisition request to the cloud storage system includes:
and sending the first acquisition request to the service address of the target forwarding node.
In an alternative embodiment, the method is performed by a terminal installed with a cloud application and a cloud storage tool;
the sending of the first acquisition request to the cloud storage system includes:
calling the cloud storage tool to query the index data through the cloud application;
sending, by the cloud storage appliance, the first acquisition request to the cloud storage system, the first acquisition request including a target time period.
In a third aspect of the present invention, there is provided a cloud storage system, the system comprising: at least one forwarding node and at least two storage nodes;
a target forwarding node, configured to receive a first acquisition request sent by a terminal, where the first acquisition request includes a target time period, and the target forwarding node is one of the at least one forwarding node;
the target forwarding node is further configured to query index data of the video data corresponding to the target time period from at least two index data blocks stored in the at least two storage nodes in a distributed manner;
the target forwarding node is further configured to send the index data to the terminal;
the target forwarding node is further configured to receive a second acquisition request sent by the terminal, where the second acquisition request includes the index data;
the target forwarding node is further configured to obtain video data corresponding to the index data from at least two video data blocks stored in the at least two storage nodes in a distributed manner;
and the target forwarding node is also used for sending the video data to the terminal.
In an optional embodiment, the system further comprises: a management node;
the at least two storage nodes are further used for storing first metadata of the index data block in a distributed manner, wherein the first metadata comprises time period information of the index data block, and a storage node and a storage position where the index data block is located;
the target forwarding node is further configured to send a first metadata acquisition request to the management node, where the first metadata acquisition request includes the target time period;
the target forwarding node is further configured to receive the first metadata belonging to the target time period, which is sent by the management node;
the target forwarding node is further configured to query, according to the first metadata belonging to the target time period, index data corresponding to the target time period from the at least two storage nodes.
In an optional embodiment, the target forwarding node is further configured to send a second metadata obtaining request to the management node, where the second metadata obtaining request includes the target time period;
the target forwarding node is further configured to receive the second metadata belonging to the target time period, which is sent by the management node;
the target forwarding node is further configured to determine a target storage node according to the second metadata, where the target storage node is a storage node where the video data is located;
and the target forwarding node is further configured to obtain the video data according to the frame storage position.
In an optional embodiment, the system further comprises: a management node;
the management node is configured to receive a node acquisition request sent by a terminal, where the node acquisition request is used to request the management node to allocate the target forwarding node;
the management node is further configured to allocate the target forwarding node from the at least one forwarding node; sending the service address of the target forwarding node to the terminal;
the target forwarding node is further configured to receive the first acquisition request sent by the terminal through the service address.
In an optional embodiment, the system further comprises: an access node;
the access node is used for acquiring the video data;
the access node is further configured to perform frame analysis on the video data to obtain the index data;
the access node is further configured to divide the index data into at least two index data blocks;
the access node is further configured to store the index data block into at least two storage nodes in a distributed storage manner;
the access node is further configured to divide the video data into at least two video data blocks;
the access node is further configured to store the video data block in at least two storage nodes in a distributed storage manner.
In an optional embodiment, the access node is further configured to send a first allocation request to a management node, where the first allocation request is used to request the management node to allocate a storage node at the ith time of storage, where i ≧ 1;
the access node is further configured to receive identification information of the storage node during the ith storage, where the storage node during the ith storage is the storage node during the ith storage selected by the management node from the at least two storage nodes;
the access node is further configured to write an ith index data block, of which the length is not greater than a predetermined data value, in the index data into the storage node at the time of the ith storage;
the access node is further configured to make i ═ i +1, and resend the first allocation request to the management node.
In an optional embodiment, the access node is further configured to send a second allocation request to a management node, where the second allocation request is used to request the management node to allocate a storage node at the k-th storage time, where k ≧ 1;
the access node is further configured to receive identification information of the storage node during the kth storage, where the storage node during the kth storage is the storage node during the kth storage selected by the management node from the at least two storage nodes;
the access node is further used for writing a kth video data block with the length not greater than a preset data value in the video data into the storage node during the kth storage;
the access node is further configured to make k equal to k +1, and resend the second allocation request to the management node.
In a fourth aspect of the invention, there is also provided
A video data acquisition terminal, the terminal comprising:
the cloud storage system comprises a sending module, a receiving module and a processing module, wherein the sending module is used for sending a first acquisition request to the cloud storage system, and the first acquisition request comprises a target time period;
a receiving module, configured to receive index data sent by the cloud storage system, where the index data stores an index of at least one video frame in video data corresponding to the target time period, and the index data is queried by the cloud storage system from at least two index data blocks in distributed storage;
the sending module is configured to send a second obtaining request to the cloud storage system, where the second obtaining request includes the index data;
the receiving module is used for receiving the video data sent by the cloud storage system; the video data is obtained by the cloud storage system through querying from at least two video data blocks in distributed storage and corresponds to the index data;
the packaging module is used for packaging the video data into a video stream;
and the playback module is used for playing back the video stream.
In an optional embodiment, the cloud storage system further comprises: the system comprises a management node, at least two storage nodes and at least one forwarding node;
the terminal, including:
the sending module is configured to send a node obtaining request to the management node, where the node obtaining request is used to request the management node to allocate the target forwarding node, and the target forwarding node is one of the at least one forwarding node;
the receiving module is configured to receive a service address of the target forwarding node sent by the management node, where the target forwarding node is allocated to the terminal after the management node selects from the at least one forwarding node;
the sending module comprises:
a sending submodule, configured to send the first obtaining request to the service address of the target forwarding node.
In an optional embodiment, the terminal is provided with a cloud application and a cloud storage tool;
the terminal further comprises:
the calling module is used for calling the cloud storage tool to inquire the index data through the cloud application;
the sending module is further configured to send the first obtaining request to the cloud storage system through the cloud storage tool, where the first obtaining request includes a target time period.
The technical scheme provided by the embodiment of the invention has the following beneficial effects:
the index data and the video data are stored separately, and the index data are stored in the plurality of storage devices in a distributed storage mode in a scattered mode to obtain at least two index data blocks, so that the index data corresponding to the target time period can be obtained from the at least two index data blocks in a concurrent extraction mode in the video playback process, the video data corresponding to the target time period is extracted according to the index data, and the extraction efficiency of the index data in the video playback process is improved.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1A to fig. 1B are schematic structural diagrams of a video data acquisition system according to an exemplary embodiment of the present invention;
fig. 2 is a schematic structural diagram of a cloud storage system according to an exemplary embodiment of the present invention;
fig. 3 is a flowchart of a video data acquisition method according to an exemplary embodiment of the present invention;
fig. 4 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention;
fig. 5 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention;
fig. 6A to 6B are schematic structural diagrams of a storage node according to another exemplary embodiment of the present invention;
fig. 7 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention;
fig. 8 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention;
fig. 9 is a block diagram of a terminal provided in an exemplary embodiment of the present invention;
fig. 10 is a block diagram of the structure of a cloud storage system provided by an exemplary embodiment of the present invention;
fig. 11 is a block diagram of a structure of a terminal according to another exemplary embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, embodiments of the present invention will be described in detail with reference to the accompanying drawings.
Fig. 1A is a schematic structural diagram of a video data acquisition system according to an exemplary embodiment of the present invention. The system comprises: at least one camera 120, a cloud storage system 140, and at least one terminal 160.
The camera 120 is a device for capturing video data, such as: any one of cameras such as a road monitoring camera, a community security camera, a construction site camera, an industrial camera and the like. Optionally, each camera 120 has a respective encoder ID (Identification). Each encoder ID is used to uniquely identify a camera.
The camera 120 and the cloud storage system 140 are connected through the communication network 130. Alternatively, the communication network 130 may be at least one of a local area network, a wide area network, and a metropolitan area network.
The cloud storage system 140 includes: an access node 141, at least two storage nodes 142, a management node 143, and at least one forwarding node 144.
The access node 142 is used for the camera 120 to store the shot video data into the storage node 142. When the number of the storage nodes 142 is multiple, the access node 141 divides the video data into multiple video data blocks, and each video data block is sent to a corresponding target storage node, where the target storage node is one of at least two storage nodes; the access node 141 is further configured to divide the index data into a plurality of index data blocks, where each index data block is sent to a corresponding target storage node, where the target storage node is one of the at least two storage nodes.
The at least two storage nodes 142 are used for storing the video data and the index data related to the video data, and the at least two storage nodes 142 are used for storing the video data and the index data related to the video data in a distributed manner. For video data, distributed storage refers to that the video data is divided into a plurality of video data blocks and is dispersedly stored in at least two storage nodes; for the index data, the distributed storage refers to that the index data is divided into a plurality of index data blocks and is dispersedly stored in at least two storage nodes 142.
As shown in fig. 1B, the data stored in one storage node 142 illustratively includes: at least one index data block 145, metadata 146 of the at least one index data block, at least one video data block 147, and metadata 148 of the at least one video data block.
The index data block 145 is a data block obtained by storing index data in a distributed storage manner on at least two storage nodes, and the index data block includes timestamp information of at least one video frame, an offset of the video frame, and an offset length of the video frame. Such as: the index data block comprises a time stamp of 2015/8/308: 00 of video frame 1, an offset of 20 of video frame 1 and an offset length of 20 of video frame 1; the timestamp of video frame 2 is 2015/8/308: 01, the offset of video frame 2 is 40, and the offset length of video frame 2 is 20; the timestamp of video frame 3 is 2015/8/308: 02, the offset of video frame 3 is 60, and the offset length of video frame 3 is 20. Optionally, when the number of cameras is greater than 1, the index data block further includes an encoder ID of the camera, which is not limited in the present invention.
The metadata 146 of the index data block includes: a time period for indexing the data block, and a storage location for indexing the data block. Such as: the time period for indexing data block 1 is 2015/8/308: 00-9:00, the storage location of the index data block 1 is storage node 1. Optionally, when the number of cameras is greater than 1, the metadata of the index data block further includes an encoder ID of the camera, which is not limited in this embodiment of the present invention.
The video data block 147 is a data block obtained by storing video data on at least two storage nodes in a distributed storage manner, where the video data block includes data of a video shot by one camera within a certain period of time, such as: the video data of video data block 1 is 2015/8/308: 00-9:00 video data captured by camera 1001. Optionally, when the number of cameras is greater than 1, the video data block further includes an encoder ID of the camera, which is not limited in this embodiment of the present invention.
The metadata 148 of the video data includes: time period information of the video data block and a storage location of the video data block. Such as: the time period of the video data block 1 is 2015/8/308: 00-9:00, and the storage position of the video data block 1 is the physical address L of the storage node 1. Optionally, when the number of cameras is greater than 1, the metadata of the video data block further includes an encoder ID of the camera, which is not limited in this embodiment of the present invention.
The management node 146 is configured to assign a target storage node to the access node from the plurality of storage nodes during a storage phase of the video data; and is further configured to assign a target forwarding node to the terminal from the plurality of forwarding nodes during a playback phase of the video data.
At least one forwarding node 142 is configured to forward data or information between the storage node 144 and the terminal 160, where the forwarded data or information includes: at least one of index data, a first metadata acquisition request, first metadata, a second metadata acquisition request, and second metadata.
Optionally, the access node 142, the at least two storage nodes 144, the management node 146, and the at least one forwarding node 148 are components of a cloud storage system, and the nodes are connected through a local area network, where the local area network includes at least one of a wireless local area network or a wired local area network.
The cloud storage system 140 and the terminal 160 are connected via the communication network 130. Alternatively, the communication network 130 may be at least one of a local area network, a wide area network, and a metropolitan area network.
The terminal 160 is a device for playing back video data captured by a camera, and the terminal may be at least one of a mobile phone, a tablet computer, a laptop computer, and a desktop computer, and optionally, the terminal 160 is a terminal supporting a dynamic bitrate adaptive technology (HTTP Live Streaming, HLS) protocol. The invention is not limited in this regard.
It should be noted that each node is a logical entity, and may be implemented by software, hardware, or a combination of both, and different nodes may be implemented on the same hardware device. Fig. 2 is a schematic structural diagram of a cloud storage system according to an exemplary embodiment of the present invention. The cloud storage system includes: management device 210, storage device 220, and storage device 230.
Among them, the management device 210 includes a management node 211 therein, and the management node 211 is the management node 146 in the structure of the video data acquisition system shown in fig. 1.
The storage device 220 includes a forwarding node 221, a storage node 222, and an access node 223, and the storage device 230 includes a forwarding node 231, a storage node 232, and an access node 233. In the embodiment of the present invention, an example that each storage device includes one forwarding node, one storage node, and one access node is described. Optionally, one storage device may only include the storage node and the access node, or may only include the storage node and the forwarding node, which is not limited in the present invention.
In the structural schematic diagram of the cloud storage system, two storage devices are taken as an example for description, in an actual operation, there may be fewer or more storage devices in the cloud storage system, which is not limited in the present invention.
Fig. 3 is a flowchart of a video data acquisition method according to an exemplary embodiment of the present invention. The method is exemplified by being applied to the video data acquisition system shown in fig. 1, and as shown in fig. 3, the video data acquisition method includes:
in step 301, the terminal sends a first acquisition request to the cloud storage system.
The first acquisition request includes a target time period, optionally, the first acquisition request further includes a communication address of the terminal, and the cloud storage system can send data or information to the terminal through the communication address. The target time period is a user-selected time period of the video stream designated for playback.
Optionally, if there are multiple cameras, the first acquisition request further includes an encoder ID of the camera.
In step 302, the cloud storage system receives a first acquisition request sent by a terminal.
In step 303, the cloud storage system queries index data of the video data corresponding to the target time period from at least two index data blocks in the distributed storage.
Distributed storage refers to the scattered storage of index data in at least two storage nodes.
The index data includes an offset of at least one video frame in the video data and an offset length of the video frame. The offset is used to determine the start position of a video frame in the entire video data, and the offset length is the frame data length of the video frame, such as 2134 bits.
The index data block is at least two data blocks obtained by dispersedly storing the index data in at least two storage devices in a distributed storage mode. Alternatively, when the number of image pickup apparatuses is greater than 1, the encoder IDs of the image pickup apparatuses are also included in the index data.
The cloud storage system matches the target time period with the time period information of each index data block, and extracts the index data of the video data corresponding to the target time period from at least two index data blocks concurrently.
In step 304, the cloud storage system sends the index data to the terminal.
And the cloud storage system sends the index data to the terminal according to the terminal communication address.
In step 305, the terminal receives index data sent by the cloud storage system.
In step 306, the terminal sends a second acquisition request to the cloud storage system.
The second acquisition request includes all or a part of the index data received by the terminal. The index data comprises the offset of at least one video frame and the offset length of the video frame, the storage position of the video frame in the video data can be obtained through the offset and the offset length of the video frame, and the video data corresponding to the index data is obtained according to the storage position. Optionally, the cloud storage system may query the video data corresponding to the index data through the index data.
In step 307, the cloud storage system receives a second acquisition request sent by the terminal.
In step 308, the cloud storage system obtains video data corresponding to the index data from at least two video data blocks in distributed storage. And optionally, when the cloud storage system acquires corresponding video data according to the index data, acquiring I frame data of the video data corresponding to the time period information and acquiring P frame data corresponding to the I frame according to the time period information. The I frame is a first frame of a certain segment of video data in the video data, the P frame is a video frame obtained by encoding the segment of video data based on the I frame data and a variation difference with respect to the I frame data, and the P frame may be a plurality of video frames.
In step 309, the cloud storage system transmits the video data to the terminal.
In step 310, the terminal receives video data sent by the cloud storage system.
In step 311, the terminal encapsulates the received video data into a video stream.
Optionally, in this embodiment, the terminal may encapsulate the video data into an HLS video stream.
In step 312, the terminal plays back the video stream.
In summary, in the video data acquisition method provided by the embodiment of the present invention, the video data and the index data corresponding to the video data are dispersedly stored in the plurality of storage devices in a distributed storage manner, so as to obtain at least two video data blocks and at least two index data blocks, and in the video playback process, the index data corresponding to the video data is acquired from the at least two index data blocks, so that the extraction efficiency of the index data is improved.
In an exemplary implementation scenario, at least one forwarding node and at least two storage nodes exist in the cloud storage system to complete the steps on the cloud storage system side in the embodiment of fig. 3. Fig. 4 is a flowchart of a video data acquisition method according to an exemplary embodiment of the present invention, where the method includes:
in step 401, the terminal sends a first acquisition request to a target forwarding node.
Wherein the target forwarding node is one of the at least one forwarding node. The first acquisition request includes a target time period, optionally, the first acquisition request also includes a communication address of the terminal, and the target forwarding node may feed back the index data and the video data to the terminal through the communication address. The target time period is a user-selected time period of the video stream designated for playback.
If there are multiple cameras, optionally, the first acquisition request further includes an encoder ID of the camera.
In step 402, the target forwarding node receives a first acquisition request sent by a terminal.
In step 403, the target forwarding node acquires index data corresponding to the target time period from at least two storage nodes.
Illustratively, the manner in which the target forwarding node acquires the index data corresponding to the target time period from the at least two storage nodes may include: the target forwarding node sends an index data acquisition request to all storage nodes in the cloud storage system, wherein the index data acquisition request comprises the target time period; and each storage node matches the target time period with the index data stored by the storage node, and if the index data corresponding to the target time period exists, the index data is sent to the target forwarding node.
In step 404, the target forwarding node sends the index data to the terminal.
And the target forwarding node receives the index data fed back by each storage node, and when more than two storage nodes feed back the index data corresponding to the target time period, the target forwarding node summarizes at least two index data to obtain all index data corresponding to the target time period.
Optionally, the index data includes: the offset and offset length of a plurality of video frames in the video data belonging to the target time period can determine the storage position of each video frame in the video data according to the offset and offset length of each video frame, and the frame data of each video frame can be read according to the storage position.
In step 405, the terminal receives the index data sent by the target forwarding node.
Optionally, the index data is index data corresponding to the target time period.
In step 406, the terminal sends a second acquisition request to the target forwarding node.
The second obtaining request comprises the index data, and the target forwarding node can obtain the video data from at least two storage nodes through the offset and the offset length of at least one video frame in the index data.
In step 407, the target forwarding node receives a second acquisition request sent by the terminal.
In step 408, the target forwarding node obtains video data corresponding to the index data from at least two storage nodes.
Illustratively, the manner in which the target forwarding node obtains the video data corresponding to the index data from the at least two storage nodes may be: the target forwarding node sends video data block acquisition requests to all storage nodes in the cloud storage system, acquires storage positions of video frames corresponding to the index data in the video data according to offset and offset length of the video frames included in the index data, and acquires the video data corresponding to the index data according to the acquired video data blocks and the storage positions.
In step 409, the target forwarding node sends the video data to the terminal.
In step 410, the terminal receives the video data transmitted by the target forwarding node.
In step 411, the terminal encapsulates the video data into a video stream.
Optionally, in this embodiment, the terminal may encapsulate the video data into an HLS video stream.
In step 412, the terminal plays back the video stream.
In an exemplary implementation scenario, at least one forwarding node, at least two storage nodes, and a management node are present in the cloud storage to complete the steps on the cloud storage system side in the embodiment of fig. 3. The specific implementation mode is as follows:
fig. 5 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention.
In step 501, the cloud application calls the cloud storage SDK to query the index data.
In step 502, the cloud storage SDK sends a node acquisition request to the management node, where the node acquisition request is used to request the management node to allocate a target forwarding node.
Optionally, an address of a management node of the cloud storage system is stored in the cloud storage SDK, and the cloud storage SDK sends a node acquisition request to the management node through the address. Optionally, the node sent by the cloud storage SDK obtains a communication address that further includes the cloud storage SDK. The management node can allocate a target forwarding node to the cloud storage SDK through the communication address.
In step 503, the management node receives a node acquisition request sent by the cloud storage SDK.
In step 504, the management node allocates a destination forwarding node from the at least one forwarding node.
Optionally, a plurality of forwarding nodes exist in the cloud storage system, and the management node may select a forwarding node with the smallest load amount as a target forwarding node by comparing load amounts of the forwarding nodes.
Optionally, the method for the management node to select one of the forwarding nodes as the target forwarding node includes: at least one of a random drawing mode, a polling mode, or a load balancing mode.
The random extraction mode can be that the management node randomly extracts one forwarding node from all the forwarding nodes and selects the forwarding node as a target forwarding node;
the polling mode can be that the ith forwarding node is selected according to a preset sequence and determined as a target forwarding node;
the load balancing method may be that the management node acquires load information of all forwarding nodes and selects a forwarding node with the smallest load as a target forwarding node. Schematically, the load balancing method is as follows: the cloud storage system comprises 5 forwarding nodes, the management node obtains the load of the 5 forwarding nodes, and the 2 nd forwarding node with the minimum load is selected as a target forwarding node.
In step 505, the management node sends the service address of the target forwarding node to the cloud storage SDK.
Optionally, the management node stores service addresses of all forwarding nodes in the cloud storage system, and after the management node selects a forwarding node with the smallest load as a target forwarding node, the management node sends the service address of the target forwarding node to the cloud storage SDK in the terminal.
In step 506, the cloud storage SDK receives the service address of the target forwarding node sent by the management node.
In step 507, the cloud storage SDK sends a first obtaining request to a service address of the target forwarding node, where the first obtaining request includes the target time period, and optionally, the first metadata further includes a communication address of the cloud storage SDK. Optionally, when the number of cameras is greater than 1, the first acquisition request further includes an encoder ID of the camera corresponding to the target time period.
In step 508, the target forwarding node receives a first obtaining request sent by the cloud storage SDK through the service address.
In step 509, the target forwarding node sends a first metadata acquisition request to the management node.
The first metadata acquisition request comprises a target time period, and the target forwarding node acquires the first metadata from the management node by sending the first metadata acquisition request. Optionally, the first metadata obtaining request further includes a service address of the target forwarding node, and the management node may send the first metadata to the target forwarding node through the service address.
In step 510, the management node receives a first metadata obtaining request sent by a target forwarding node.
In step 511, the management node sends the first metadata belonging to the target time period to the target forwarding node.
The first metadata comprises time period information of the index data block, and a storage node and a storage position where the index data block is located. Alternatively, when the number of image pickup apparatuses is greater than 1, the encoder ID of the image pickup apparatus is also included in the first metadata. The first metadata is obtained by inquiring at least two storage nodes by the management node.
In step 512, the target forwarding node receives the first metadata belonging to the target time period sent by the management node.
In step 513, the target forwarding node determines a first target storage node according to the first metadata, and queries index data corresponding to the target time period from the first target storage node.
And determining a first target storage node according to the first metadata, wherein the first target storage node is a storage node which stores index data corresponding to the target time period, and inquiring the index data corresponding to the target time period from the first target storage node.
In step 514, the target forwarding node receives the index data sent by the storage node.
Optionally, the storage node sends the index data to the target forwarding node through the service address of the target forwarding node.
In step 515, the target forwarding node sends the index data to the cloud storage SDK.
Optionally, the target forwarding node sends the index data to the cloud storage SDK through the communication address of the cloud storage SDK.
In step 516, the cloud storage SDK receives the index data sent by the target forwarding node.
In step 517, the cloud storage SDK sends a second acquisition request to the service address of the target forwarding node.
The second acquisition request includes index data including a frame storage location of at least one video frame in the video data belonging to the target time period. Optionally, the second obtaining request further includes a communication address of the cloud storage SDK. Optionally, when the number of cameras is greater than 1, the second acquisition request further includes an encoder ID of the camera corresponding to the target time period.
In step 518, the target forwarding node receives a second obtaining request sent by the cloud storage SDK through the service address.
In step 519, the target forwarding node sends a second metadata acquisition request to the management node.
The second metadata includes time period information of the video data block and a storage node and a storage location where the video data block is located. Alternatively, when the number of image capturing apparatuses is greater than 1, the encoder ID of the image capturing apparatus is also included in the second metadata. The second metadata is obtained by the management node inquiring at least two storage nodes.
In step 520, the management node receives the second metadata obtaining request sent by the target forwarding node.
In step 521, the management node sends the second metadata belonging to the target time period to the target forwarding node.
The second metadata comprises time period information of the video data block, and a storage node and a storage position where the video data block is located. Alternatively, when the number of image capturing apparatuses is greater than 1, the encoder ID of the image capturing apparatus is also included in the second metadata. The second metadata is obtained by inquiring at least two storage nodes by the management node.
In step 522, the target forwarding node receives the second metadata belonging to the target time period sent by the management node.
Optionally, the management node sends the second metadata belonging to the target time period to the target address through the service address of the target node.
In step 523, the target forwarding node determines a second target storage node according to the second metadata.
And the target forwarding node determines the target node according to the time period information of the video data in the second metadata and the storage node where the video data block is located.
In step 524, the target forwarding node obtains video data from the second target storage node according to the frame storage location.
The frame storage position refers to the offset and offset length of a video frame, the target forwarding node sends a frame data acquisition request to the second target storage node according to the frame storage position, the frame data acquisition request carries the frame storage position, and the second target storage node reads video data according to the frame storage position and feeds the video data back to the target forwarding node.
In step 525, the target forwarding node sends the video data to the cloud storage SDK.
In step 526, the cloud storage SDK receives the video data sent by the target forwarding node.
In step 527, the cloud storage SDK sends the video data to the cloud application.
In step 528, the cloud application encapsulates the video data into a video stream.
Optionally, in this embodiment, the target forwarding node may encapsulate the video data into an HLS video stream through the protocol stack.
In step 529, the cloud application plays back the video stream.
Illustratively, as shown in fig. 6A, a storage node 1 stores therein a video data block 1, an attached data block 1, video data metadata 1, and attached data metadata 1. Alternatively, when the number of image capturing apparatuses is greater than 1, the video data block 1, the ancillary data block 1, the video data metadata 1, and the ancillary data metadata 1 are all labeled with the encoder ID of the image capturing apparatus. As shown in fig. 6A, video data of a certain time period is stored in a video data block 1, and the auxiliary data block 1 includes a time of a certain video frame in the video data, an offset of the video frame, and an offset length, such as: 2017/5/308:10, 20, 20, metadata 1 of video data includes time period information of video data block 1, and storage node location information of video data block 1, which is available from the metadata of the video data, the video data stored in video data block 1 is video data of 2017/5/308:10-8: 20 time period.
Illustratively, as shown in fig. 6B, the storage node 2 stores therein a video data block 2, an attached data block 2, video data metadata 2, and attached data metadata 2. Alternatively, when the number of image capturing apparatuses is greater than 2, the video data block 2, the ancillary data block 2, the video data metadata 2, and the ancillary data metadata 2 are all labeled with the encoder ID of the image capturing apparatus. As shown in fig. 6B, video data of a certain time period is stored in the video data block 2, and the auxiliary data block 2 includes a timestamp of a certain video frame in the video data, an offset of the video frame, and an offset length, such as: 2017/5/309: 31, 20, 20, metadata 2 of the video data includes time period information of the video data block 2, and storage node location information of the video data block 2, which is available from the metadata of the video data, the video data stored in the video data block 2 is 2017/5/308: 20-8:30 time period video data.
When a user wants to play back a video stream between 2017/5/308:10-8:30 and selects a time period of 2017/5/308:10-8:30, the cloud storage system first obtains index data by querying metadata of index data blocks corresponding to the time period of 2017/5/308:10-8:30, as can be seen from fig. 6A and 6B, the index data blocks corresponding to the time period of 2017/5/308:10-8:30 are index data block 1 and index data block 2, the index data block 1 is stored in the storage node 1, and the index data block 2 is stored in the storage node 2. Then, the cloud storage system queries metadata of video data corresponding to the time period according to the time period information of the index data block 1 and the index data block 2, the metadata of the video data corresponding to the time period are metadata 1 of the video data block and metadata 2 of the video data block, and according to the metadata 1 of the video data block and the metadata 2 of the video data block, the video data 1 is stored in the storage node 1, and the video data 2 is stored in the storage node 2. The cloud storage system acquires the video data block 1 and the video data block 2, and sends the video data in the video data block 1 and the video data block 2 to the terminal.
In summary, according to the video data acquisition method provided by the embodiment of the present invention, the video data and the index data corresponding to the video data are dispersedly stored in the plurality of storage devices in a distributed storage manner, so as to obtain at least two video data blocks and at least two index data blocks, and in the video playback process, the index data corresponding to the video data is concurrently acquired from the at least two index data blocks by acquiring the first metadata, so that the extraction efficiency of the index data is improved.
In an exemplary implementation scenario, at least two storage nodes and one access node exist in the cloud storage system, and the step of storing the video data sent by the image pickup device is completed. The specific implementation is shown in fig. 7:
fig. 7 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention.
In step 701, the camera transmits video data to the access node.
Optionally, an address of an access node of the cloud storage system is stored in the camera, and the camera sends the video data to the access node through the address. Optionally, when the number of cameras is greater than 1, encoder IDs of the cameras are also included in the video data for identifying different cameras.
In step 702, the access node acquires video data.
In step 703, the access node performs frame analysis on the video data to obtain index data.
Optionally, the frame analysis refers to that the access node analyzes each frame of the video data, divides the video data into a plurality of video segments, a first frame of each video segment is an I frame, and obtains a P frame based on a change amount of the I frame, where the P frame may be a plurality of frames, such as: the second frame is a P1 frame, the third frame is a P2 frame, and so on.
The index data includes a frame storage location of at least one video frame in the video data, and the frame storage location refers to an offset and an offset length of the video frame.
In step 704, the access node divides the index data into at least two index data blocks.
Optionally, the manner in which the access node divides the index data into at least two index data blocks includes: at least one of random division and fixed value division, which is not limited by the present invention.
The random division mode comprises the steps that index data are divided into a plurality of index data blocks, wherein the data volume of each index data block is smaller than a preset data value, and the data volumes of different index data blocks can be different;
the fixed value division mode comprises the step of dividing the index data into a plurality of index data blocks according to a certain fixed data value, wherein the data quantity of each index data block is equal to the fixed data value except the last index data block.
In step 705, the access node divides the video data into at least two blocks of video data.
Optionally, the manner in which the access node divides the video data into at least two video data blocks includes: at least one of random division and fixed value division, which is not limited by the present invention.
The random division mode comprises the steps that video data are divided into a plurality of video data blocks, wherein the data volume of each video data block is smaller than a preset data value, and the data volumes of different video data blocks can be different;
the fixed value division includes dividing the video data into a plurality of video data blocks according to a fixed data value, wherein the data amount of each video data block may not be equal to the fixed data value except for the last video data block.
In step 706, the access node stores the index data block in a distributed storage manner to at least two storage nodes.
Distributed storage refers to the scattered storage of at least two index data blocks in at least two different storage nodes. Optionally, the distributed storage manner may be that the index data block is sequentially written into the ith storage node and the (i + 1) th storage node; the distributed storage manner may also be that the management node randomly allocates at least two storage nodes to each access node for storing the index data block, which is not limited in the present invention.
In step 707, the access node stores the video data blocks in a distributed storage manner to at least two storage nodes.
Distributed storage refers to the decentralized storage of at least two blocks of video data in at least two different storage nodes. Optionally, the distributed storage manner may be that video data blocks are sequentially written into the ith storage node and the (i + 1) th storage node; the distributed storage manner may also be that the management node randomly allocates at least two storage nodes to each access node for storing the video data block, which is not limited in the present invention.
Optionally, the steps 701 to 707 described above are storage steps of video data and index data, and the steps 701 to 707 are executed before the step 301 or the step 303 of the method embodiment shown in fig. 3 in actual operation; the execution sequence of the step 706 and the step 707 is to execute the step 706 first and then execute the step 707, and in actual operation, the execution sequence of the step 706 and the step 707 may also be to execute the step 707 first and then execute the step 706, which is not limited in this disclosure.
In summary, according to the video data acquisition method provided by the embodiment of the present invention, the index data is partitioned and the video data is partitioned, the partitioned index data and the partitioned video data are distributed and stored in the at least two storage nodes, and in the video playback process, the index data is concurrently acquired from the at least two storage nodes, so that the extraction efficiency of the index data is improved.
In an exemplary implementation scenario, at least two storage nodes, a management node and an access node exist in the cloud storage system to complete the steps of storing the video data sent by the camera shown in fig. 7. The specific implementation is shown in fig. 8:
fig. 8 is a flowchart of a video data acquisition method according to another exemplary embodiment of the present invention.
In step 801, the camera sends video data to the access node.
Optionally, an address of an access node of the cloud storage system is stored in the camera, and the camera sends the video data to the access node through the address. Optionally, when the number of cameras is greater than 1, encoder IDs of the cameras are also included in the video data for identifying different cameras.
In step 802, the access node acquires video data.
In step 803, the access node performs frame analysis on the video data to obtain index data.
Optionally, the frame analysis refers to that the access node analyzes each frame of the video data, divides the video data into a plurality of video segments, a first frame of each video segment is an I frame, and obtains a P frame based on a change amount of the I frame, where the P frame may be a plurality of frames, such as: the second frame is a P1 frame, the third frame is a P2 frame, and so on.
The index data includes a frame storage location of at least one video frame in the video data, and the frame storage location refers to an offset and an offset length of the video frame.
In step 804, the access node sends a first allocation request to the management node.
The first allocation request is for requesting the management node to allocate a storage node at the ith time of storage. Optionally, the access node has an address of the management node stored therein, and the access node may send the first allocation request to the management node through the address. Optionally, the first allocation request sent by the access node to the management node further includes a receiving address of the access node, and the management node may return a message to the access node through the receiving address.
In step 805, the management node receives a first allocation request.
In step 806, the management node selects a storage node at the i-th storage from at least two storage nodes.
Optionally, the method for the management node to select the storage node in the ith storage includes: according to the storage node in the i-1 th storage, a storage node subsequent to the storage node in the i-1 st storage is selected as the storage node in the i-th storage, and one storage node is randomly selected as the storage node in the i-th storage.
In step 807, the management node sends the identification information of the storage node at the time of the i-th storage to the access node.
Optionally, the management node stores a receiving address of the access node, and the management node may send the identification information of the storage node at the time of the ith storage to the access node through the receiving address. The identification information is used to identify a storage node for storing the index data block at the i-th storage.
In step 808, the access node receives the identification information of the storage node at the time of the i-th storage.
In step 809, the access node writes the ith index data block with length not greater than the predetermined data value in the index data into the storage node at the time of the ith storage.
Optionally, the access node stores addresses of all storage nodes, the access node may obtain the address of the storage node corresponding to the flag information through the identification information, and the access node may write the ith index data block into the storage node by changing the address.
The preset data value is a preset data value, the index data is divided into index data blocks according to the preset data value, and the data length of each index data block is not greater than the preset data value.
In step 810, let i equal i + 1.
In step 811 the access node resends the first allocation request to the management node.
In step 812, the access node sends a second allocation request to the management node.
The second allocation request is for requesting the management node to allocate a storage node at the k-th storage. Optionally, the access node has an address of the management node stored therein, and the access node may send the second allocation request to the management node via the address. Optionally, the second allocation request sent by the access node to the management node further includes a receiving address of the access node, and the management node may return a message to the access node through the receiving address.
In step 813, the management node receives a second allocation request.
In step 814, the management node selects a storage node at the k-th storage from the at least two storage nodes.
Optionally, the method for the management node to select the storage node at the k-th storage includes: according to the storage node at the time of the k-1 storage, a storage node subsequent to the storage node at the time of the k-1 storage is selected as the storage node at the time of the k-1 storage, and one storage node is randomly selected as the storage node at the time of the k-1 storage.
In step 815, the management node sends the identification information of the storage node at the k-th storage time to the access node.
Optionally, the management node stores a receiving address of the access node, and the management node may send the identification information of the storage node at the time of the kth storage to the access node through the receiving address. The identification information is used to identify a storage node used to store the block of video data at the time of the i-th storage.
In step 816 the access node receives the identification information of the storage node at the time of the kth storage.
In step 817, the access node writes the kth block of video data having a length not greater than a predetermined data value in the video data to the storage node at the time of the kth storage.
Optionally, the access node stores addresses of all storage nodes, the access node may obtain the address of the storage node corresponding to the flag information through the identification information, and the access node may write the kth video data block into the storage node by changing the address.
The predetermined data value is a preset data value, the video data is divided into video data blocks according to the predetermined data value, and the data length of each video data block is not greater than the predetermined data value.
In step 818, let k be k + 1.
In step 819, the access node resends the second allocation request to the management node.
In the present embodiment, the storage process of the index data is performed first, and the storage process of the video data is performed first in steps 804 to 811, and the storage process of the index data is performed first in steps 812 to 819.
In summary, according to the video data acquisition method provided by the embodiment of the present invention, the index data is partitioned and the video data is partitioned, the partitioned index data and the partitioned video data are distributed and stored in the at least two storage nodes, and in the video playback process, the index data is concurrently acquired from the at least two storage nodes, so that the extraction efficiency of the index data is improved.
Fig. 9 is a block diagram of a terminal provided in an exemplary embodiment of the present invention. The terminal includes: processor 920, memory 940, communication interface 960, and display 980.
The processor 920 may be at least one of a single core processor, a multi-core processor, an embedded chip, and an image processor having computing capabilities.
The memory 940 stores executable instructions for the processor. Illustratively, the memory 940 stores an address of a management node in the cloud storage system, and the terminal may send request information to the management node through the address.
The communication interface 960 is an interface for communication between terminal cloud storage systems. Optionally, the terminal and the cloud storage system are connected through a wide area network.
Fig. 10 is a block diagram of a structure of a cloud storage system according to an exemplary embodiment of the present invention.
The system comprises: at least one forwarding node 1010 and at least two storage nodes 1011;
a target forwarding node 1010, configured to receive a first acquisition request sent by a terminal, where the first acquisition request includes a target time period, and the target forwarding node is one of the at least one forwarding node;
the target forwarding node 1010 is further configured to query index data of the video data corresponding to the target time period from at least two index data blocks stored in the at least two storage nodes in a distributed manner;
the target forwarding node 1010 is further configured to send the index data to the terminal;
the target forwarding node 1010 is further configured to receive a second obtaining request sent by the terminal, where the second obtaining request includes the index data;
the target forwarding node 1010 is further configured to obtain video data corresponding to the index data from at least two video data blocks stored in the at least two storage nodes in a distributed manner;
the target forwarding node 1010 is further configured to send the video data to the terminal.
In an optional embodiment, the system further comprises: a management node 1012;
the at least two storage nodes 1011 are further configured to store first metadata of the index data block in a distributed manner, where the first metadata includes time period information of the index data block, and a storage node and a storage location where the index data block is located;
the target forwarding node 1010 is further configured to send a first metadata obtaining request to the management node 1012, where the first metadata obtaining request includes the target time period;
the target forwarding node 1010 is further configured to receive the first metadata belonging to the target time period sent by the management node 1012;
the target forwarding node is further configured to query, according to the first metadata belonging to the target time period, index data corresponding to the target time period from the at least two storage nodes.
In an optional embodiment, the target forwarding node is further configured to send a second metadata obtaining request to the management node, where the second metadata obtaining request includes the target time period;
the target forwarding node is further configured to receive the second metadata belonging to the target time period, which is sent by the management node;
the target forwarding node is further configured to determine a target storage node according to the second metadata, where the target storage node is a storage node where the video data is located;
and the target forwarding node is further configured to obtain the video data according to the frame storage position.
In an optional embodiment, the system further comprises: a management node;
the management node is configured to receive a node acquisition request sent by a terminal, where the node acquisition request is used to request the management node to allocate the target forwarding node;
the management node is further configured to allocate the target forwarding node from the at least one forwarding node; sending the service address of the target forwarding node to the terminal;
the target forwarding node is further configured to receive the first acquisition request sent by the terminal through the service address.
In an optional embodiment, the system further comprises: an access node 1013;
an access node 1013 configured to obtain the video data;
the access node is further configured to perform frame analysis on the video data to obtain the index data;
the access node is further configured to divide the index data into at least two index data blocks;
the access node is further configured to store the index data block into at least two storage nodes in a distributed storage manner;
the access node is further configured to divide the video data into at least two video data blocks;
the access node is further configured to store the video data block in at least two storage nodes in a distributed storage manner.
In an optional embodiment, the access node is further configured to send a first allocation request to a management node, where the first allocation request is used to request the management node to allocate a storage node at the ith time of storage, where i ≧ 1;
the access node is further configured to receive identification information of the storage node during the ith storage, where the storage node during the ith storage is the storage node during the ith storage selected by the management node from the at least two storage nodes;
the access node is further configured to write an ith index data block, of which the length is not greater than a predetermined data value, in the index data into the storage node at the time of the ith storage;
the access node is further configured to make i ═ i +1, and resend the first allocation request to the management node.
In an optional embodiment, the access node is further configured to send a second allocation request to a management node, where the second allocation request is used to request the management node to allocate a storage node at the k-th storage time, where k ≧ 1;
the access node is further configured to receive identification information of the storage node during the kth storage, where the storage node during the kth storage is the storage node during the kth storage selected by the management node from the at least two storage nodes;
the access node is further used for writing a kth video data block with the length not greater than a preset data value in the video data into the storage node during the kth storage;
the access node is further configured to make k equal to k +1, and resend the second allocation request to the management node.
Fig. 11 is a block diagram of a structure of a terminal according to another exemplary embodiment of the present invention. The terminal includes:
a sending module 1101, configured to send a first obtaining request to a cloud storage system, where the first obtaining request includes a target time period;
a receiving module 1102, configured to receive index data sent by the cloud storage system, where the index data stores an index of at least one video frame in video data corresponding to the target time period, and the index data is queried by the cloud storage system from at least two index data blocks in distributed storage;
the sending module 1101 is configured to send a second obtaining request to the cloud storage system, where the second obtaining request includes the index data;
the receiving module 1102 is configured to receive video data sent by the cloud storage system; the video data is obtained by the cloud storage system through querying from at least two video data blocks in distributed storage and corresponds to the index data;
an encapsulating module 1103, configured to encapsulate the video data into a video stream;
a playback module 1104 for playing back the video stream.
In an optional embodiment, the cloud storage system further comprises: the system comprises a management node, at least two storage nodes and at least one forwarding node;
the apparatus, comprising:
the sending module is configured to send a node obtaining request to the management node, where the node obtaining request is used to request the management node to allocate the target forwarding node, and the target forwarding node is one of the at least one forwarding node;
the receiving module is configured to receive a service address of the target forwarding node sent by the management node, where the target forwarding node is allocated to the terminal after the management node selects from the at least one forwarding node;
the sending module comprises:
a sending submodule, configured to send the first obtaining request to the service address of the target forwarding node.
In an optional embodiment, the terminal is provided with a cloud application and a cloud storage tool;
the device, still include:
the calling module is used for calling the cloud storage tool to inquire the index data through the cloud application;
the sending module is further configured to send the first obtaining request to the cloud storage system through the cloud storage tool, where the first obtaining request includes a target time period.
It should be noted that: in the video data acquisition apparatus provided in the above embodiment, only the division of the above functional modules is taken as an example for the video data acquisition, and in practical applications, the above functions may be distributed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to complete all or part of the above described functions. In addition, the embodiments of the video data acquisition method and apparatus provided in the above embodiments belong to the same concept, and specific implementation processes thereof are described in the method embodiments in detail and are not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (16)

1. A video data acquisition method is used in a cloud storage system, wherein the cloud storage system comprises at least two storage nodes, at least one forwarding node and a management node, and the at least two storage nodes are used for storing index data blocks and video data blocks in a distributed manner, and the method comprises the following steps:
the management node receives a node acquisition request sent by a terminal, wherein the node acquisition request is used for requesting the management node to allocate a target forwarding node, and the target forwarding node is one of the at least one forwarding node;
the management node selects a forwarding node with the minimum load from the at least one forwarding node as the target forwarding node, and sends the service address of the target forwarding node to the terminal;
the target forwarding node receives a first acquisition request sent by the terminal through the service address, wherein the first acquisition request comprises a target time period;
the target forwarding node acquires index data of the video data corresponding to the target time period from the at least two storage nodes;
the target forwarding node sends the index data to the terminal;
the target forwarding node receives a second acquisition request sent by the terminal through the service address, wherein the second acquisition request comprises the index data;
the target forwarding node acquires video data corresponding to the index data from the at least two storage nodes;
and the target forwarding node sends the video data to the terminal.
2. The method of claim 1, wherein the at least two storage nodes are further configured to store first metadata of the index data block, and the first metadata includes time period information of the index data block and a storage node and a storage location where the index data block is located;
the target forwarding node acquires index data of the video data corresponding to the target time period from the at least two storage nodes, and the index data includes:
the target forwarding node sends a first metadata acquisition request to the management node, wherein the first metadata acquisition request comprises the target time period;
the target forwarding node receives first metadata which is sent by the management node and belongs to the target time period, wherein the first metadata which belongs to the target time period is obtained by the management node through inquiring the at least two storage nodes;
and the target forwarding node determines a first target storage node according to the first metadata, and inquires index data corresponding to the target time period from the first target storage node.
3. The method of claim 1, wherein the index data comprises a frame storage location of at least one video frame in the video data belonging to the target time period;
the at least two storage nodes are further used for storing second metadata of the video data block, wherein the second metadata comprises time period information of the video data block, and a storage node and a storage position where the video data block is located;
the target forwarding node acquires video data corresponding to the index data from the at least two storage nodes, and the method includes:
the target forwarding node sends a second metadata acquisition request to the management node, wherein the second metadata acquisition request comprises the target time period;
the target forwarding node receives second metadata which is sent by the management node and belongs to the target time period, and the management node inquires the at least two storage nodes to obtain the second metadata which belongs to the target time period;
and the target forwarding node determines a second target storage node according to the second metadata, and acquires the video data from the second target storage node according to the frame storage position.
4. The method of claim 1, wherein the cloud storage system further comprises: an access node;
before the target forwarding node acquires the index data of the video data corresponding to the target time period from the at least two storage nodes, the method further includes:
the access node acquires the video data;
the access node performs frame analysis on the video data to obtain the index data;
the access node divides the index data into at least two index data blocks, and stores the index data blocks into at least two storage nodes in a distributed storage mode;
the access node divides the video data into at least two video data blocks and stores the video data blocks into at least two storage nodes in a distributed storage mode.
5. The method of claim 4, wherein the access node divides the index data into at least two index data blocks, and stores the index data blocks in a distributed storage manner in at least two storage nodes, comprising:
the access node sends a first allocation request to a management node, wherein the first allocation request is used for requesting the management node to allocate a storage node during the ith storage, and i is more than or equal to 1;
the access node receives identification information of a storage node during the ith storage, wherein the storage node during the ith storage is the storage node during the ith storage selected from the at least two storage nodes by the management node;
the access node writes an ith index data block with the length not greater than a preset data value in the index data into a storage node during the ith storage;
and i is set to be i +1, and the step that the management node receives the first allocation request sent by the access node is executed again.
6. The method of claim 4, wherein the access node divides the video data into at least two video data blocks, and stores the video data blocks in a distributed storage manner in at least two storage nodes, comprising:
the access node sends a second distribution request to a management node, wherein the second distribution request is used for requesting the management node to distribute a storage node during the k-th storage, and k is more than or equal to 1;
the access node receives identification information of a storage node during the k-th storage, wherein the storage node during the k-th storage is the storage node during the k-th storage selected by the management node from the at least two storage nodes;
the access node writes a kth video data block with the length not greater than a preset data value in the video data into a storage node during the kth storage;
and k is k +1, and the step that the management node receives the second allocation request sent by the access node is executed again.
7. A video data acquisition method, for use in a terminal, the method comprising:
sending a node acquisition request to a management node included in a cloud storage system, wherein the node acquisition request is used for requesting the management node to allocate a target forwarding node, the cloud storage system further includes at least two storage nodes and at least one forwarding node, and the target forwarding node is one of the at least one forwarding node;
receiving a service address of the target forwarding node sent by the management node, where the target forwarding node is allocated to the terminal after the management node selects a forwarding node with the minimum load from the at least one forwarding node;
sending a first acquisition request to the service address of the target forwarding node, wherein the first acquisition request comprises a target time period;
receiving index data sent by the target forwarding node, wherein the index data stores an index of at least one video frame in the video data corresponding to the target time period, and the index data is acquired by the target forwarding node from the at least two storage nodes;
sending a second acquisition request to the service address of the target forwarding node, wherein the second acquisition request comprises the index data;
receiving video data sent by the target forwarding node, wherein the video data is obtained by the target forwarding node from the at least two storage nodes and corresponds to the index data;
and packaging the video data into a video stream, and playing back the video stream.
8. The method of claim 7, wherein the method is performed by a terminal installed with a cloud application and a cloud storage tool;
the sending a first acquisition request to the service address of the target forwarding node includes:
calling the cloud storage tool to query the index data through the cloud application;
sending, by the cloud storage appliance, the first acquisition request to the cloud storage system, the first acquisition request including a target time period.
9. The cloud storage system is characterized by comprising at least one forwarding node, at least two storage nodes and a management node, wherein the at least two storage nodes are used for storing index data blocks and video data blocks in a distributed mode;
the management node is configured to receive a node acquisition request sent by a terminal, where the node acquisition request is used to request the management node to allocate a target forwarding node, where the target forwarding node is one of the at least one forwarding node;
the management node is further configured to select a forwarding node with a minimum load amount from the at least one forwarding node as the target forwarding node, and send a service address of the target forwarding node to the terminal;
the target forwarding node is configured to receive a first acquisition request sent by the terminal through the service address, where the first acquisition request includes a target time period;
the target forwarding node is further configured to obtain index data of the video data corresponding to the target time period from the at least two storage nodes;
the target forwarding node is further configured to send the index data to the terminal;
the target forwarding node is further configured to receive a second acquisition request sent by the terminal through the service address, where the second acquisition request includes the index data;
the target forwarding node is further configured to obtain video data corresponding to the index data from the at least two storage nodes;
and the target forwarding node is also used for sending the video data to the terminal.
10. The system of claim 9, wherein the at least two storage nodes are further configured to store first metadata of the index data block in a distributed manner, and the first metadata includes time period information of the index data block and a storage node and a storage location where the index data block is located;
the target forwarding node is further configured to send a first metadata acquisition request to the management node, where the first metadata acquisition request includes the target time period;
the target forwarding node is further configured to receive first metadata which is sent by the management node and belongs to the target time period;
the target forwarding node is further configured to query, according to the first metadata belonging to the target time period, index data corresponding to the target time period from the at least two storage nodes.
11. The system of claim 9, wherein the index data comprises a frame storage location of at least one video frame in the video data belonging to the target time period;
the target forwarding node is further configured to send a second metadata acquisition request to the management node, where the second metadata acquisition request includes the target time period;
the target forwarding node is further configured to receive second metadata which is sent by the management node and belongs to the target time period;
the target forwarding node is further configured to determine a target storage node according to the second metadata, where the target storage node is a storage node where the video data is located;
and the target forwarding node is further configured to obtain the video data according to the frame storage position.
12. The system of any of claims 9 to 11, further comprising: an access node;
the access node is used for acquiring the video data;
the access node is further configured to perform frame analysis on the video data to obtain the index data;
the access node is further configured to divide the index data into at least two index data blocks;
the access node is further configured to store the index data block into at least two storage nodes in a distributed storage manner;
the access node is further configured to divide the video data into at least two video data blocks;
the access node is further configured to store the video data block in at least two storage nodes in a distributed storage manner.
13. The system of claim 12, wherein the access node is further configured to send a first allocation request to a management node, the first allocation request requesting the management node to allocate a storage node at the ith time of storage, wherein i ≧ 1;
the access node is further configured to receive identification information of the storage node during the ith storage, where the storage node during the ith storage is the storage node during the ith storage selected by the management node from the at least two storage nodes;
the access node is further configured to write an ith index data block, of which the length is not greater than a predetermined data value, in the index data into the storage node at the time of the ith storage;
the access node is further configured to make i ═ i +1, and re-perform sending of the first allocation request to the management node.
14. The system of claim 13, wherein the access node is further configured to send a second allocation request to a management node, the second allocation request requesting the management node to allocate a storage node at a kth storage time, where k ≧ 1;
the access node is further configured to receive identification information of the storage node during the kth storage, where the storage node during the kth storage is the storage node during the kth storage selected by the management node from the at least two storage nodes;
the access node is further used for writing a kth video data block with the length not greater than a preset data value in the video data into the storage node during the kth storage;
the access node is further configured to make k ═ k +1, and to re-perform the step of sending the second allocation request to the management node.
15. A video data acquisition apparatus, wherein the apparatus is a terminal, the apparatus comprising:
the cloud storage system further comprises at least two storage nodes and at least one forwarding node, and the target forwarding node is one of the at least one forwarding node;
a receiving module, configured to receive a service address of the target forwarding node sent by the management node, where the target forwarding node is allocated to the terminal after the management node selects a forwarding node with a minimum load from the at least one forwarding node;
the sending module is further configured to send a first obtaining request to the service address of the target forwarding node, where the first obtaining request includes a target time period;
the receiving module is further configured to receive index data sent by the target forwarding node, where the index data stores an index of at least one video frame in the video data corresponding to the target time period, and the index data is obtained by the target forwarding node from the at least two storage nodes;
the sending module is further configured to send a second obtaining request to the service address of the target forwarding node, where the second obtaining request includes the index data;
the receiving module is further configured to receive video data sent by the target forwarding node, where the video data is obtained by the target forwarding node from the at least two storage nodes and corresponds to the index data;
the packaging module is used for packaging the video data into a video stream;
and the playback module is used for playing back the video stream.
16. The apparatus according to claim 15, wherein the terminal is installed with a cloud application and a cloud storage tool;
the device, still include:
the calling module is used for calling the cloud storage tool to inquire the index data through the cloud application;
the sending module is further configured to send the first obtaining request to the cloud storage system through the cloud storage tool, where the first obtaining request includes a target time period.
CN201710495206.XA 2017-06-26 2017-06-26 Video data acquisition method and device Active CN109120885B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710495206.XA CN109120885B (en) 2017-06-26 2017-06-26 Video data acquisition method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710495206.XA CN109120885B (en) 2017-06-26 2017-06-26 Video data acquisition method and device

Publications (2)

Publication Number Publication Date
CN109120885A CN109120885A (en) 2019-01-01
CN109120885B true CN109120885B (en) 2021-01-05

Family

ID=64821781

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710495206.XA Active CN109120885B (en) 2017-06-26 2017-06-26 Video data acquisition method and device

Country Status (1)

Country Link
CN (1) CN109120885B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11683453B2 (en) * 2020-08-12 2023-06-20 Nvidia Corporation Overlaying metadata on video streams on demand for intelligent video analysis
CN112449018A (en) * 2020-11-25 2021-03-05 杭州视洞科技有限公司 Multi-computer-room data synchronization and deployment method based on end side
CN113656683A (en) * 2021-07-12 2021-11-16 北京旷视科技有限公司 Subscription data pushing method, device and system, electronic equipment and storage medium
CN113596582A (en) * 2021-08-04 2021-11-02 杭州海康威视系统技术有限公司 Video preview method and device and electronic equipment
CN114245169B (en) * 2021-12-21 2024-01-23 北京达佳互联信息技术有限公司 Video processing method, apparatus, electronic device, medium, and program product
CN115955321B (en) * 2023-03-15 2023-06-20 浙江宇视科技有限公司 Data management method, device, system and computer readable storage medium

Family Cites Families (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100561386C (en) * 2007-11-14 2009-11-18 中控科技集团有限公司 A kind of data save method and device
US9330172B2 (en) * 2008-09-29 2016-05-03 Echostar Technologies Llc Audio/video archiving system and method
CN101727465B (en) * 2008-11-03 2011-12-21 中国移动通信集团公司 Methods for establishing and inquiring index of distributed column storage database, device and system thereof
CN102375853A (en) * 2010-08-24 2012-03-14 中国移动通信集团公司 Distributed database system, method for building index therein and query method
CN102169507B (en) * 2011-05-26 2013-03-20 厦门雅迅网络股份有限公司 Implementation method of distributed real-time search engine
CN102325244B (en) * 2011-08-26 2014-02-19 杭州海康威视数字技术股份有限公司 Method for rapidly positioning videos by time, video storage control device and positioning device
CN102436513B (en) * 2012-01-18 2014-11-05 中国电子科技集团公司第十五研究所 Distributed search method and system
US8924476B1 (en) * 2012-03-30 2014-12-30 Google Inc. Recovery and fault-tolerance of a real time in-memory index
JP6237633B2 (en) * 2012-09-28 2017-11-29 日本電気株式会社 Distributed storage device, storage node, data providing method and program
CN104750708B (en) * 2013-12-27 2018-09-28 华为技术有限公司 A kind of index establishing method of space-time data, querying method, device and equipment
CN104063187B (en) * 2014-07-08 2015-06-17 珠海安联锐视科技股份有限公司 Hard disk file system suitable for security application and operation method thereof
CN105100716B (en) * 2015-07-23 2018-09-18 浙江立元通信技术股份有限公司 A kind of secure storage unit and its system for Network Video Surveillance
CN105120321A (en) * 2015-08-21 2015-12-02 北京佳讯飞鸿电气股份有限公司 Video searching method, video storage method and related devices
CN105117502A (en) * 2015-10-13 2015-12-02 四川中科腾信科技有限公司 Search method based on big data
CN106598973B (en) * 2015-10-14 2019-07-09 杭州海康威视数字技术股份有限公司 A kind of method and system of the intelligent retrieval based on cloud storage management
CN105956183B (en) * 2016-05-30 2019-04-30 广东电网有限责任公司电力调度控制中心 The multilevel optimization's storage method and system of mass small documents in a kind of distributed data base

Also Published As

Publication number Publication date
CN109120885A (en) 2019-01-01

Similar Documents

Publication Publication Date Title
CN109120885B (en) Video data acquisition method and device
US10637916B2 (en) Method and device for storage resource allocation for video cloud storage
US8069224B2 (en) Method, equipment and system for resource acquisition
CN110795244B (en) Task allocation method, device, equipment and medium
CN107562757B (en) Query and access method, device and system based on distributed file system
US10728050B2 (en) Method of terminal-based conference load-balancing, and device and system utilizing same
CN109901798B (en) Data storage method and device
CN109600410B (en) Data storage system and method
US20150088995A1 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
WO2018054369A1 (en) Method and apparatus for selecting streaming data transmission node
CN105512279A (en) Metadata access method, related equipment and system
US20160183229A1 (en) Ip phone network system, server apparatus, ip exchange and resource capacity expansion method
CN106940712B (en) Sequence generation method and device
CN113641505B (en) Resource allocation control method and device for server cluster
CN105681212A (en) Video playing state monitoring method and device
CN112269670B (en) Data warehouse-in method, device, system and storage medium
CN112398968A (en) ID generation system and method, generation terminal, server terminal and storage medium
CN110545336B (en) IP address replacement method, device, computer equipment and storage medium
CN107122136B (en) Capacity obtaining method and device
CN113395487A (en) Video data storage management method and device, computer equipment and storage medium
CN108124021B (en) Method, device and system for obtaining Internet Protocol (IP) address and accessing website
CN110581784A (en) node health check method, device and equipment
CN110049350B (en) Video transcoding processing method and device, computer equipment and storage medium
CN113301173A (en) Domain name updating system and method, message forwarding method and server
CN110891033B (en) Network resource processing method, device, gateway, controller and storage medium

Legal Events

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