CN112118461B - Audio and video file storage and distribution method and device - Google Patents

Audio and video file storage and distribution method and device Download PDF

Info

Publication number
CN112118461B
CN112118461B CN202011000009.4A CN202011000009A CN112118461B CN 112118461 B CN112118461 B CN 112118461B CN 202011000009 A CN202011000009 A CN 202011000009A CN 112118461 B CN112118461 B CN 112118461B
Authority
CN
China
Prior art keywords
audio
video
target
file
slice
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
CN202011000009.4A
Other languages
Chinese (zh)
Other versions
CN112118461A (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.)
Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Original Assignee
Hunan Happly Sunshine Interactive Entertainment Media 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 Hunan Happly Sunshine Interactive Entertainment Media Co Ltd filed Critical Hunan Happly Sunshine Interactive Entertainment Media Co Ltd
Priority to CN202011000009.4A priority Critical patent/CN112118461B/en
Publication of CN112118461A publication Critical patent/CN112118461A/en
Application granted granted Critical
Publication of CN112118461B publication Critical patent/CN112118461B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/8456Structuring of content, e.g. decomposing content into time segments by decomposing the content in the time domain, e.g. in time segments
    • 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/21Server components or server architectures
    • H04N21/218Source of audio or video content, e.g. local disk arrays
    • H04N21/2187Live feed
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/439Processing of audio elementary streams
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/44004Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving video buffer management, e.g. video decoder buffer or video display buffer
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/47End-user applications
    • H04N21/482End-user interface for program selection
    • H04N21/4825End-user interface for program selection using a list of items to be played back in a given order, e.g. playlists

Abstract

The invention discloses a method and a device for storing and distributing audio and video files, wherein the method comprises the following steps: when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file; based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored; and distributing each audio and video clip based on a target distribution method corresponding to the file type. According to the method, when the target audio file is stored, the target audio and video file is firstly divided into the audio and video segments and then stored, and the audio and video segments are cached and distributed during distribution, so that the occupation of bandwidth during caching is reduced, and the waste of bandwidth resources is avoided.

Description

Audio and video file storage and distribution method and device
Technical Field
The invention relates to the technical field of audio and video processing, in particular to an audio and video file storage and distribution method and device.
Background
At present, an internet video platform mainly bears most of traffic access through a commercial CDN, and for any one on-demand resource, whether a single audio/video file or a live stream, in the field of video playing, when a user clicks a corresponding audio/video file to play, the current audio/video file is cached as a whole.
However, a user may switch to other audio and video files only by watching a current audio and video file for a short time, which causes the current video file to occupy a large bandwidth when being cached integrally, resulting in waste of bandwidth resources.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for storing and distributing an audio/video file, which are used to solve the problem that when playing an audio/video file, the current audio/video file is cached as a whole. However, a user may switch to other audio and video files only by watching a current audio and video file for a short time, which causes a problem that the current video file occupies a large bandwidth when being cached integrally, resulting in waste of bandwidth resources. The specific scheme is as follows:
an audio-video file storage and distribution method comprises the following steps:
when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file;
based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored;
and distributing each audio and video clip based on a target distribution method corresponding to the file type.
Optionally, in the method, when a processing request for a target audio/video file is received, the obtaining of the file type of the target audio/video file includes:
acquiring metadata corresponding to the target audio and video file, wherein the metadata comprises: resource ID and file type;
and acquiring the file type included in the metadata.
Optionally, in the method, when the file type is an individual audio/video, the target audio/video file is divided into audio/video segments based on a target segmentation method corresponding to the file type, and the audio/video segments are stored, including:
determining a preset constant in the target fragmentation method;
dividing the target audio/video file into audio/video clips based on the preset constant;
assigning a slice ID to each audio-video segment, wherein the slice ID = resource ID + range (start-end), wherein start represents a start offset, end represents an end offset, and range (start-end) represents a preset constant;
and storing each audio and video clip and the corresponding clip ID thereof to an edge computing node.
Optionally, in the foregoing method, the distributing each audio/video clip based on a target distribution method corresponding to the file type includes:
when the target audio/video file is an independent audio/video file, acquiring the resource ID and the preset constant;
constructing the slice ID based on the resource ID and the preset constant;
requesting the slice ID from the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
Optionally, in the method, when the file type is a playlist, the target audio/video file is divided into each audio/video segment based on a target segmentation method corresponding to the file type, and each audio/video segment is stored, where the method includes:
acquiring each audio and video clip of the target audio and video file and a slice serial number of each slice audio and video clip;
constructing a slice ID based on the resource ID and a slice serial number corresponding to the resource ID for each audio and video segment, wherein the slice ID = the resource ID + the corresponding slice serial number;
and storing each audio and video clip and the corresponding clip ID thereof to an edge computing node.
Optionally, in the foregoing method, the distributing each audio/video clip based on a target distribution method corresponding to the file type includes:
when the target audio/video file is a play list, acquiring the resource ID and the corresponding slice serial number;
constructing the slice ID based on the resource ID and the corresponding slice sequence number;
requesting the slice ID from the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
Optionally, in the method, when the file type is a live stream, the target audio/video file is divided into audio/video segments based on a target segmentation method corresponding to the file type, and the audio/video segments are stored, including:
determining a preset slicing time length in the target slicing method;
dividing the target audio and video file into audio and video fragments based on the preset slicing duration, and distributing a segmentation index number for each spliced video fragment, wherein the segmentation index number is used for identifying the audio and video fragments;
allocating a slice ID to each audio/video clip based on the video ID and the corresponding segment index number, wherein the slice ID = the resource ID + the corresponding segment index number;
and storing each audio and video clip and the corresponding clip ID thereof to an edge computing node.
Optionally, the foregoing method distributes, based on a target distribution method corresponding to the file type, each of the audio and video clips, and includes:
when the target audio/video file is a live stream, acquiring the resource ID and the corresponding segment index number;
constructing the slice ID based on the resource ID and the corresponding segment index number;
requesting the slice ID to the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
The above method, optionally, further includes:
and updating metadata corresponding to the target audio and video file.
An audio-video file storage and distribution apparatus comprising:
the acquisition module is used for acquiring the file type of a target audio/video file when a processing request of the target audio/video file is received;
the segmentation and storage module is used for segmenting the target audio/video file into audio/video segments based on a target segmentation method corresponding to the file type and storing the audio/video segments;
and the distribution module is used for distributing each audio and video clip based on a target distribution method corresponding to the file type.
Compared with the prior art, the invention has the following advantages:
the invention discloses a method and a device for storing and distributing audio and video files, wherein the method comprises the following steps: when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file; based on a target segmentation method corresponding to the file type, segmenting the target audio/video file into audio/video segments, and storing the audio/video segments; and distributing each audio and video clip based on a target distribution method corresponding to the file type. According to the method, when the target audio file is stored, the target audio and video file is firstly divided into the audio and video segments and then stored, and the audio and video segments are cached and distributed during distribution, so that the occupation of bandwidth during caching is reduced, and the waste of bandwidth resources is avoided.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an audio/video file storage and distribution method disclosed in an embodiment of the present application;
fig. 2 is a schematic diagram of an audio/video file slicing method disclosed in an embodiment of the present application;
fig. 3 is another schematic diagram of an audio/video file slicing method disclosed in an embodiment of the present application;
fig. 4 is another schematic diagram of an audio/video file slicing method disclosed in an embodiment of the present application;
fig. 5 is a schematic execution diagram of an audio/video file storage and distribution method disclosed in an embodiment of the present application;
fig. 6 is a block diagram of a structure of an audio/video file storage and distribution apparatus disclosed in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The invention discloses a method and a device for storing and distributing audio and video files, which are applied to the storage and distribution process of the audio and video files, take video on demand as an example, and for any on-demand resource, whether the on-demand resource is a single audio and video file, a live stream, an HLS (HTTP live streaming) playlist or a DASH playlist, a set of unified resource storage mechanisms covering various formats is required to realize the distribution and the transmission between edge nodes and a playing end and between the playing ends. In the prior art, the storage and distribution of the audio and video files are performed on the basis of the whole, the whole cache needs to occupy larger bandwidth, and the waste of bandwidth resources is caused, in order to solve the above problems, the invention provides a method for storing and distributing the audio and video files, the execution flow of the method is shown in fig. 1, and the method comprises the following steps:
s101, when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file;
in this embodiment of the present invention, the file type of the target audio/video file may be one of an individual audio/video file, a playlist of HLS and DASH, or a live stream. For each target audio/video file, there exists a metadata corresponding to the target audio/video file, where the metadata is stored in a metadata server, and the metadata includes: the file type management method comprises a resource ID and a file type, wherein the resource ID is a GUID format character string generated by a globally unique path of audio and video resource access, and therefore the file type can be acquired at a specified position in the metadata.
S102, based on a target segmentation method corresponding to the file type, segmenting the target audio/video file into audio/video segments, and storing the audio/video segments;
in the embodiment of the invention, for each target audio/video file, the access consists of a resource ID + a slice ID, wherein the resource ID is represented by StreamSchamWamID; such as StreamSwarmID = sha1 (hex (md 5 (play _ stream _ url))). The slice ID is generated according to the corresponding target sharding method, here denoted by SegmentID. The target fragmentation method is related to the file type, and corresponds to one target fragmentation method for each file type, and when the file type is an individual audio/video, the target audio/video is an MP4, ts file is taken as an example for explanation, and the determination process of the slice ID is shown in fig. 2: in the embodiment of the present invention, the preset constant is taken as 1M, where slice ID = streamforward ID + range (start-end), where start represents a start offset of a current slice interval, end represents an end offset of the current slice interval, and when the target audio/video file is MP4, resource ID streamforward ID is determined according to a play URL: and Http: mp4 generation, algorithm as follows: sha1 (hex (play _ stream _ url))), section range (0-1M), range (1-2M), range (2-3M) \8230; range (nM-). When the target audio/video file is asked ts, the resource ID StreamWamID is obtained according to the playing URL: and Http: ts generation, algorithm as follows: sha1 (hex (play _ stream _ url))), section range (0-1M), range (1-2M), range (2-3M) \8230; range (nM-). Further, when the slicing is finished, storing each slice obtained by splitting the target audio/video file, storing the resource ID, the file size of the target audio/video file, and the preset slice size and type (file) to a metadata server corresponding to the target audio/video file, and updating corresponding metadata.
When the file type is a playlist, taking the playlist as HLS and DASH as an example for explanation, the slice determining process is shown in fig. 2, because HLS/DASH is based on a slice transfer protocol, where the slice transfer protocol refers to a protocol similar to HLS/DASH, and the working principle is to divide the whole video or stream into small HTTP-based slice files for downloading. Slice ID = streamsmarmid + slice sequence number, such as the first slice sequence number being 1, the second slice sequence number being 2, and so on for the K-th slice sequence number being K. If the target audio/video file is HLS, the resource ID StreamSchammID is determined according to the playing URL: https:// host/xxx/playlist/m3u8, the algorithm is as follows: the serial numbers of sha1 (hex (md 5 (play _ stream _ url)) and the slices are segment-1, segment-2, segment-3 \8230andsegment-n. If the target audio/video file is HLS, the resource ID StreamSchamMiD is determined according to the playing URL: https:// host/xxx/bbb _30fps. Mpd generation, the algorithm is as follows: the serial numbers of the slices are video-segment-, audio-segment-1, video-segment-2, audio-segment-2 \8230, video-segment-n and audio-segment-n. Further, when the slicing is finished, all the slices obtained by slicing the target audio/video file are stored, the resource ID and the type (segment) are stored in a metadata server corresponding to the target audio/video file, and the corresponding metadata are updated.
When the file type is a live stream, the live stream format of the main stream is hls, http-flv, and http-ts, where hls refers to the file type playlist, and details are not described here. The description is given by taking the file types as http-flv and http-ts as examples, the slicing process is shown in fig. 4, the http-flv/http-ts inserts the segment information into the video stream or the audio stream at the push stream end or the push stream node according to the time length slicing rule, when the edge node pulls the live stream, the segment information in the video stream or the audio stream is analyzed, and the live stream is divided into a segment of files according to the segment information. Slice ID = streamswermid + segment index number, segment index number is calculated from the beginning of the stream pushing, the first segment index number is 1, the first segment index number is 2, and so on, the kth segment index number is K; the segmentation is divided according to a set time length, for example, a1 second slicing time length, and is divided every 1 second. If the target audio/video file is http-flv, the resource ID StreamSchamPromID is determined according to the playing URL: https:// host/xxx/ab. Flv generation, algorithm as follows: sha1 (hex (md 5 (play _ stream _ url)) and segment indexes of segment1, segment2 \8230andsegment n. If the target audio/video file is http-ts, the resource ID StreamSchamWamID is: https:// host/xxx/ab.ts generation, algorithm as follows: sha1 (hex (md 5 (play _ stream _ url)) and segment indexes of segment1, segment2 \8230andsegment n. Further, when the slicing is finished, all the slices obtained by slicing the target audio/video file are stored, the resource ID and the type (live) are stored in a metadata server corresponding to the target audio/video file, and the corresponding metadata are updated.
S103, distributing the audio and video clips based on a target distribution method corresponding to the file type.
In the embodiment of the invention, the slicing method and the distribution method have a corresponding relationship, and the slicing method and the distribution method have a corresponding relationship with each file type. For example: if the slicing method a is used for slicing, a distribution method corresponding to the slicing method a needs to be used for distribution. Preferably, the metadata needs to be acquired from the corresponding cloud data server before distribution.
When the File type is the single audio/video, acquiring metadata such as a resource ID, a File size, a preset constant, a type and the like from corresponding metadata, detecting whether the File type is a File type, and if not, exiting to finish; if yes, according to the resource ID and a preset constant, obtaining the slice ID = resource ID + range (start-end), wherein start represents the starting offset, and end represents the ending offset. And (5) according to the opening and closing principle, closing left and opening right, namely (start-end), indicating that the content from the start offset to the end offset is contained, but the end offset is not contained, requesting the edge calculation node for the slice ID, returning the file content of the slice ID to the edge calculation node, and ending the distribution.
When the file type is a playlist, acquiring metadata such as a resource ID (identity) and a type from corresponding metadata, detecting whether the file type is a Segment type, and if not, exiting is finished; if so, according to the resource ID and the sequence number, obtaining slice ID = resource ID + sequence number, where the sequence number is incremented from 1, the first slice file has a sequence number of 1, the second slice file has a sequence number of 2, and so on. And requesting the slice ID from the edge computing node, returning the content of the slice ID by the edge computing node, and ending the distribution.
If the file type is the Live stream, acquiring metadata such as a resource ID (identity) and a resource type from corresponding metadata, detecting whether the file type is a Live type, and if not, ending quitting; if yes, obtaining slice ID = resource ID + segment index number according to the resource ID and the sequence number; requesting http-flv/http-ts live streaming by the starting index number in a broadcast starting stage, and analyzing the segmented index number to obtain the segmented index number; next segment index = current index number incremented by 1. And requesting the slice ID from the edge computing node, returning the content of the slice ID file by the edge computing node, and finishing the distribution.
The invention discloses an audio and video file storage and distribution method, which comprises the following steps: when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file; based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored; and distributing each audio and video clip based on a target distribution method corresponding to the file type. According to the method, when the target audio file is stored, the target audio and video file is firstly divided into the audio and video segments and then stored, and the audio and video segments are cached and distributed during distribution, so that the occupation of bandwidth during caching is reduced, and the waste of bandwidth resources is avoided.
In the embodiment of the invention, a unified resource storage and distribution method with cross-file formats is provided, and http and p2p resource request requirements are considered. The processing flow diagram of the method is shown in fig. 5, a source station, a Content Delivery Network (CDN) Delivery and edge computing node, and each playing end unifies resource storage and Delivery formats, so that storage space is saved, and storage utilization rate is provided; the idle bandwidth and storage of the edge computing node are utilized, resources are distributed based on http or P2P, and the bandwidth cost is effectively saved; and the edge computing node and the playing end resource are intercommunicated, so that the resource distribution efficiency is improved.
In the embodiment of the invention, the edge computing nodes comprise various cooperative nodes, an ore machine, an operator MEC (namely multi-access edge computing), various flow sharing routers, a set top box and the like.
The playing end comprises daily equipment such as a pc, a web, an android, ios, a flat plate and an ott box.
The method is exemplified based on the method, and the implementation steps are as follows:
1) And pulling down the hot sheet or recommended resource which is newly on line to the edge computing node in advance.
2) And uniformly storing the slices by the edge computing nodes according to the resource types.
3) And if the video or the file is a single video or file, performing slice storage according to a preset size, and simultaneously storing metadata such as a resource ID, a slice size and a type into a metadata server. Wherein the metadata server is responsible for metadata storage and access of the requested resource.
4) If the playback list is an HLS/DASH playback list, storing the fragment file according to HLS/DASH specifications; while saving the resource ID to the metadata server.
5) And if the stream is a live stream, resolving the segment index number of the live stream. And if the segment index number is analyzed, storing the corresponding slice file according to the segment index number, and simultaneously storing the resource ID into the metadata server.
6) The playing end firstly obtains the metadata information of the requested resource to obtain the information of the resource ID, the type, the fragment size and the like.
7) If the requested resource is a single video, file, compute slice ID = resource ID + range (start-end), where start-end represents the start and end offsets, such as slice size SegmentSize of 1024 (1 k), first slice range (0-1024), second slice range (1024-2048), and so on in order depending on the slice size. A range (start-end) = (i) × SegmentSize- (i + 1) × SegmentSize) is obtained, where i represents the ith slice, counted from 0.
8) If the requested resource is a HLS/DASH list, it can be accessed either by http request for HLS/DASH playlist or by slice ID, slice ID = resource ID + sequence number. The first slice, sequence number 1; the second slice, sequence number 2, and so on.
9) And if the requested resource is a live stream, accessing with reference to the step 8 if the requested resource is an HLS/DASH live list file, and requesting according to the step 10 if the requested resource is an http-flv/http-ts live stream.
10 In the start-up stage, http-flv/http-ts live broadcast stream is requested first, and segment index numbers in the stream are analyzed. If the player successfully acquires the segment index number and the size of the player cache meets a preset size (such as 5 seconds of cache), the player can request the edge computing node for the segment ID = resource ID + (the segment index number +1 acquired last) or else continue to read http-flv/http-ts live streaming data.
11 Considering the real-time problem of live broadcast delay, the time length of the segment is generally set to be 1-2 seconds, and after the broadcast starting stage, the player can continuously request the live broadcast segment content to the edge computing node or the CDN or the broadcast end through the segment ID for live broadcast viewing.
Based on the foregoing method for storing and distributing an audio/video file, an embodiment of the present invention further provides an apparatus for storing and distributing an audio/video file, where a structural block diagram of the distribution apparatus is shown in fig. 6, and the apparatus includes:
an acquisition module 201, a segmentation and storage module 202 and a distribution module 203.
Wherein the content of the first and second substances,
the acquiring module 201 is configured to acquire a file type of a target audio/video file when a processing request for the target audio/video file is received;
the segmentation and storage module 202 is configured to segment the target audio/video file into audio/video segments based on a target segmentation method corresponding to the file type, and store the audio/video segments;
the distribution module 203 is configured to distribute each audio/video clip based on a target distribution method corresponding to the file type.
The invention discloses an audio and video file storage and distribution device, which comprises: when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file; based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored; and distributing each audio and video clip based on a target distribution method corresponding to the file type. According to the device, when the target audio file is stored, the target audio file is firstly divided into the audio and video segments and then stored, and the audio and video segments are cached and distributed during distribution, so that the occupation of bandwidth during caching is reduced, and the waste of bandwidth resources is avoided.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, respectively. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The method and the device for storing and distributing the audio and video files provided by the invention are described in detail, specific examples are applied to explain the principle and the implementation mode of the invention, and the description of the embodiments is only used for helping to understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (7)

1. An audio-video file storage and distribution method is characterized by comprising the following steps:
when a processing request for a target audio/video file is received, acquiring the file type of the target audio/video file;
based on a target fragmentation method corresponding to the file type, the edge computing node divides the target audio/video file into audio/video fragments and stores the audio/video fragments;
based on a target distribution method corresponding to the file type, distributing each audio and video clip by the edge computing node;
when the file type is an independent audio/video, based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored, wherein the method comprises the following steps:
determining a preset constant in the target fragmentation method;
dividing the target audio/video file into audio/video clips based on the preset constant;
assigning a slice ID to each audio-video segment, wherein the slice ID = resource ID + range (start-end), wherein start represents a start offset, end represents an end offset, and range (start-end) represents a preset constant;
storing each audio and video clip and the corresponding clip ID thereof to an edge computing node;
when the file type is a playlist, based on a target segmentation method corresponding to the file type, segmenting the target audio/video file into audio/video segments, and storing the audio/video segments, wherein the method comprises the following steps:
acquiring each audio and video clip of the target audio and video file and a slice serial number of each slice audio and video clip;
for each audio and video clip, constructing a slice ID based on the resource ID and a slice serial number corresponding to the resource ID, wherein the slice ID = the resource ID + corresponding slice serial number;
storing each audio and video clip and the corresponding clip ID thereof to an edge computing node;
when the file type is a live stream, based on a target fragmentation method corresponding to the file type, segmenting the target audio/video file into audio/video fragments, and storing the audio/video fragments, wherein the method comprises the following steps:
determining a preset slicing time length in the target slicing method;
dividing the target audio and video file into audio and video fragments based on the preset slicing duration, and allocating a segmentation index number to each audio and video fragment, wherein the segmentation index number is used for identifying the audio and video fragments;
allocating a slice ID to each audio and video segment based on the resource ID and the corresponding segment index number, wherein the slice ID = the resource ID + the corresponding segment index number;
and storing each audio and video clip and the corresponding clip ID thereof to an edge computing node.
2. The method according to claim 1, wherein when a processing request for a target audio/video file is received, acquiring a file type of the target audio/video file comprises:
acquiring metadata corresponding to the target audio and video file, wherein the metadata comprises: resource ID and file type;
and acquiring the file type included in the metadata.
3. The method according to claim 1, wherein distributing the respective audio/video clips based on a target distribution method corresponding to the file type comprises:
when the target audio/video file is an independent audio/video file, acquiring the resource ID and the preset constant;
constructing the slice ID based on the resource ID and the preset constant;
requesting the slice ID to the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
4. The method according to claim 1, wherein distributing the respective audio-video clips based on a target distribution method corresponding to the file type includes:
when the target audio/video file is a play list, acquiring the resource ID and the corresponding slice serial number;
constructing the slice ID based on the resource ID and the corresponding slice sequence number;
requesting the slice ID to the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
5. The method according to claim 1, wherein distributing the respective audio/video clips based on a target distribution method corresponding to the file type comprises:
when the target audio/video file is a live stream, acquiring the resource ID and the corresponding segment index number;
constructing the slice ID based on the resource ID and the corresponding segment index number;
requesting the slice ID from the edge computing node, and receiving the audio and video clips which are distributed by the edge computing node and correspond to the slice ID.
6. The method of claim 1, further comprising:
and updating metadata corresponding to the target audio and video file.
7. An audio-video file storage and distribution apparatus, comprising:
the acquisition module is used for acquiring the file type of a target audio/video file when a processing request of the target audio/video file is received;
the segmentation and storage module is used for segmenting the target audio/video file into audio/video segments and storing the audio/video segments based on a target segmentation method corresponding to the file type;
the distribution module is used for distributing each audio and video clip by the edge computing node based on a target distribution method corresponding to the file type;
when the file type is an independent audio/video, based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored, wherein the method comprises the following steps:
determining a preset constant in the target fragmentation method;
dividing the target audio/video file into audio/video fragments based on the preset constant;
assigning a slice ID to each audio-video segment, wherein the slice ID = resource ID + range (start-end), wherein start represents a start offset, end represents an end offset, and range (start-end) represents a preset constant;
storing each audio and video clip and the corresponding clip ID thereof to an edge computing node;
when the file type is a playlist, based on a target segmentation method corresponding to the file type, segmenting the target audio/video file into audio/video segments, and storing the audio/video segments, wherein the method comprises the following steps:
acquiring each audio and video clip of the target audio and video file and a slice serial number of each slice audio and video clip;
for each audio and video clip, constructing a slice ID based on the resource ID and a slice serial number corresponding to the resource ID, wherein the slice ID = the resource ID + the corresponding slice serial number;
storing each audio and video clip and the corresponding clip ID to an edge computing node;
when the file type is a live stream, based on a target fragmentation method corresponding to the file type, the target audio/video file is divided into audio/video fragments, and the audio/video fragments are stored, wherein the method comprises the following steps:
determining a preset slicing time length in the target slicing method;
dividing the target audio and video file into audio and video fragments based on the preset slicing duration, and allocating a segmentation index number to each audio and video fragment, wherein the segmentation index number is used for identifying the audio and video fragments;
allocating a slice ID to each audio and video clip based on the resource ID and the corresponding segment index number, wherein the slice ID = the resource ID + the corresponding segment index number;
and storing each audio and video clip and the corresponding clip ID thereof to an edge computing node.
CN202011000009.4A 2020-09-22 2020-09-22 Audio and video file storage and distribution method and device Active CN112118461B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011000009.4A CN112118461B (en) 2020-09-22 2020-09-22 Audio and video file storage and distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011000009.4A CN112118461B (en) 2020-09-22 2020-09-22 Audio and video file storage and distribution method and device

Publications (2)

Publication Number Publication Date
CN112118461A CN112118461A (en) 2020-12-22
CN112118461B true CN112118461B (en) 2022-10-18

Family

ID=73800378

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011000009.4A Active CN112118461B (en) 2020-09-22 2020-09-22 Audio and video file storage and distribution method and device

Country Status (1)

Country Link
CN (1) CN112118461B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114125572B (en) * 2021-11-22 2022-06-03 江苏经贸职业技术学院 Video data distribution and storage system based on P2P

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155296A (en) * 2006-09-29 2008-04-02 中国科学技术大学 Method for transmitting data
CN102510395A (en) * 2011-10-21 2012-06-20 合一网络技术(北京)有限公司 Flash video scheduling method based on peer to server peer (P2SP)
CN102546786A (en) * 2011-12-29 2012-07-04 中兴通讯股份有限公司 Method and system for variable-length access of multi-media files in content distribution network
CN103634616A (en) * 2012-08-27 2014-03-12 中兴通讯股份有限公司 Cloud storage-based streaming media video-on-demand method and apparatus
CN105392068A (en) * 2015-11-04 2016-03-09 合一网络技术(北京)有限公司 Distributed multi-transmission channel network live video parallel distribution method and system
CN106792271A (en) * 2016-12-30 2017-05-31 中广热点云科技有限公司 The system and method for document presentation association in adaptive stream media
CN107018446A (en) * 2017-04-07 2017-08-04 无锡职业技术学院 A kind of network video-on-demand and live plug-flow method
CN107222484A (en) * 2017-06-12 2017-09-29 北京经纬中天信息技术有限公司 Support the stream media server system of multi-protocols input and output
CN107801051A (en) * 2017-10-27 2018-03-13 广东省南方数字电视无线传播有限公司 Virtual sliced sheet information transferring method and device, video server
CN107809684A (en) * 2017-10-27 2018-03-16 广东省南方数字电视无线传播有限公司 Video segment generation method and device, caching server
CN109525622A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 The generation method of fragment resource ID, resource sharing method, device and electronic equipment
CN110933464A (en) * 2019-11-13 2020-03-27 北京思维造物信息科技股份有限公司 Method and system for adding digital watermark to multimedia file
CN111541903A (en) * 2020-01-14 2020-08-14 深圳市华曦达科技股份有限公司 Live broadcast acceleration method, source station end, edge node, client and live broadcast system
CN111629075A (en) * 2020-08-03 2020-09-04 腾讯科技(深圳)有限公司 Data downloading method and related device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9240217B2 (en) * 2013-06-20 2016-01-19 Tivo Inc. Storing same channel overlapping recordings

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101155296A (en) * 2006-09-29 2008-04-02 中国科学技术大学 Method for transmitting data
CN102510395A (en) * 2011-10-21 2012-06-20 合一网络技术(北京)有限公司 Flash video scheduling method based on peer to server peer (P2SP)
CN102546786A (en) * 2011-12-29 2012-07-04 中兴通讯股份有限公司 Method and system for variable-length access of multi-media files in content distribution network
CN103634616A (en) * 2012-08-27 2014-03-12 中兴通讯股份有限公司 Cloud storage-based streaming media video-on-demand method and apparatus
CN105392068A (en) * 2015-11-04 2016-03-09 合一网络技术(北京)有限公司 Distributed multi-transmission channel network live video parallel distribution method and system
CN106792271A (en) * 2016-12-30 2017-05-31 中广热点云科技有限公司 The system and method for document presentation association in adaptive stream media
CN107018446A (en) * 2017-04-07 2017-08-04 无锡职业技术学院 A kind of network video-on-demand and live plug-flow method
CN107222484A (en) * 2017-06-12 2017-09-29 北京经纬中天信息技术有限公司 Support the stream media server system of multi-protocols input and output
CN109525622A (en) * 2017-09-19 2019-03-26 阿里巴巴集团控股有限公司 The generation method of fragment resource ID, resource sharing method, device and electronic equipment
CN107801051A (en) * 2017-10-27 2018-03-13 广东省南方数字电视无线传播有限公司 Virtual sliced sheet information transferring method and device, video server
CN107809684A (en) * 2017-10-27 2018-03-16 广东省南方数字电视无线传播有限公司 Video segment generation method and device, caching server
CN110933464A (en) * 2019-11-13 2020-03-27 北京思维造物信息科技股份有限公司 Method and system for adding digital watermark to multimedia file
CN111541903A (en) * 2020-01-14 2020-08-14 深圳市华曦达科技股份有限公司 Live broadcast acceleration method, source station end, edge node, client and live broadcast system
CN111629075A (en) * 2020-08-03 2020-09-04 腾讯科技(深圳)有限公司 Data downloading method and related device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于P2P的视频点播系统关键技术研究;肖俊;《中国优秀硕士学位论文全文数据库》;20190215;第2章,2.2节 *

Also Published As

Publication number Publication date
CN112118461A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
US8489760B2 (en) Media file storage format and adaptive delivery system
TWI575950B (en) Streaming server and method for providing a content stream through a network to a client
CN108566370B (en) Method and device for returning data to source
BR112014000597B1 (en) METHOD AND SYSTEM FOR DOWNLOADING A MULTIMEDIA FILE
WO2009062385A1 (en) A storage system and method of stream media file
EP2956865A1 (en) Personal over-the-top network video recorder
CN103813185B (en) A kind of method that segment programs are quickly distributed, server and client
WO2016062081A1 (en) System, device and method for implementing hls channel playback service, and storage medium
WO2018153237A1 (en) Caching method and system for replaying live broadcast, and playing method and system
WO2017080428A1 (en) Streaming media channel recording, reviewing method, device, server and storage medium
US11496805B2 (en) Video delivery method and apparatus, and electronic device
CN101867777A (en) Video ordering transmission method based on peer-to-peer computing set-top box
US9871606B1 (en) Identification of concurrently broadcast time-based media
US10284894B2 (en) Methods and apparatus for naming video content chunks
CN109842804A (en) Processing method and server, the computer storage medium of audio, video data
WO2021073539A1 (en) Hls playback method, client, server and storage medium
CN112118461B (en) Audio and video file storage and distribution method and device
CN107801051A (en) Virtual sliced sheet information transferring method and device, video server
KR100809641B1 (en) Method for exchanging contents between heterogeneous system and contents management system for performing the method
CN105812831B (en) Network program recording method, device and system and playing method and device
CN104702978A (en) Video data locating method and network playing equipment
CN114222086B (en) Method, system, medium and electronic device for scheduling audio and video code stream
CN108924606A (en) Streaming Media processing method, device, storage medium and electronic device
CN111225248B (en) On-demand content management method and content distribution network on-demand server
van der Hooft et al. Low-latency delivery of news-based video content

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