CN117201894A - Media stream slicing method, device, system, equipment and storage medium - Google Patents

Media stream slicing method, device, system, equipment and storage medium Download PDF

Info

Publication number
CN117201894A
CN117201894A CN202311220511.XA CN202311220511A CN117201894A CN 117201894 A CN117201894 A CN 117201894A CN 202311220511 A CN202311220511 A CN 202311220511A CN 117201894 A CN117201894 A CN 117201894A
Authority
CN
China
Prior art keywords
slice
current
slicing
media stream
target
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.)
Pending
Application number
CN202311220511.XA
Other languages
Chinese (zh)
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.)
Douyin Vision Co Ltd
Original Assignee
Douyin Vision 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 Douyin Vision Co Ltd filed Critical Douyin Vision Co Ltd
Priority to CN202311220511.XA priority Critical patent/CN117201894A/en
Publication of CN117201894A publication Critical patent/CN117201894A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the disclosure provides a media stream slicing method, a device, a system, equipment and a storage medium. The method is applied to slicing equipment and comprises the following steps: responding to a streaming request of a target media stream and generating a slicing information acquisition request when a slicing task of the target media stream does not exist currently; transmitting a slice information acquisition request to a central server so that the central server determines current slice information corresponding to a target media stream; creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on current slicing information through the created slicing task; and determining target slice information based on the current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information based on the target slice information. Through the technical scheme of the embodiment of the disclosure, the consistency of different slicing devices on the same media stream slice can be ensured, and the flexibility and usability of the slice are improved.

Description

Media stream slicing method, device, system, equipment and storage medium
Technical Field
Embodiments of the present disclosure relate to computer technology, and in particular, to a media stream slicing method, apparatus, system, device, and storage medium.
Background
With the rapid development of live broadcasting technology, slicing processing is often required to be performed on media stream data generated by live broadcasting, so that conversion between a push stream protocol and a pull stream protocol is realized. Currently, in order to avoid inconsistency of slicing, a single slicing device is generally used to slice the same media stream, that is, the same media stream is always sliced on one slicing device. It can be seen that this slicing approach does not switch slicing equipment, resulting in poor flexibility and usability of slicing the media stream.
Disclosure of Invention
The present disclosure provides a media stream slicing method, apparatus, system, device and storage medium, so as to ensure consistency of slicing different slicing devices on the same media stream slice, thereby switching the slicing devices and improving flexibility and usability of media stream slicing.
In a first aspect, an embodiment of the present disclosure provides a media stream slicing method, applied to a slicing device, including:
responding to a streaming request of a target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently;
Transmitting the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on the current slicing information through the created slicing task;
and determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
In a second aspect, an embodiment of the present disclosure provides a media stream slicing method, applied to a central server, including:
receiving a slice information acquisition request corresponding to a target media stream sent by a slicing device;
determining current slice information corresponding to the target media stream based on the slice information acquisition request, and sending the current slice information to the slicing device so that the slicing device creates a slice task of the target media stream, performs slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determines target slice information corresponding to the target media stream based on the obtained current stream data slice;
And receiving the target slice information sent by the slicing equipment, and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
In a third aspect, embodiments of the present disclosure further provide a media stream slicing apparatus integrated into a slicing device, the apparatus comprising:
the slice information acquisition request generation module is used for responding to a pull stream request of the target media stream and generating a slice information acquisition request corresponding to the target media stream when the slice task of the target media stream does not exist currently;
a slice information acquisition request sending module, configured to send the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
the stream data slicing processing module is used for creating slicing tasks of the target media stream and slicing the current stream data of the target media stream based on the current slicing information through the created slicing tasks;
and the target slice information determining module is used for determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
In a fourth aspect, an embodiment of the present disclosure further provides a media stream slicing apparatus integrated in a central server, the apparatus including:
the slice information acquisition request receiving module is used for receiving a slice information acquisition request corresponding to a target media stream sent by the slicing equipment;
the current slice information determining module is used for determining current slice information corresponding to the target media stream based on the slice information acquisition request, sending the current slice information to the slicing equipment so that the slicing equipment can create a slice task of the target media stream, performing slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determining the target slice information corresponding to the target media stream based on the obtained current stream data slice;
and the slice information synchronous updating module is used for receiving the target slice information sent by the slicing equipment and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
In a fifth aspect, embodiments of the present disclosure also provide a media stream slicing system, the system comprising: a central server and at least two slicing devices;
Wherein each slicing device is configured to implement a media stream slicing method as provided in the first aspect;
the central server is configured to implement the media stream slicing method as provided in the second aspect.
In a sixth aspect, embodiments of the present disclosure further provide an electronic device, including:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the media stream slicing method as described in any of the embodiments of the present disclosure.
In a seventh aspect, the disclosed embodiments also provide a storage medium containing computer-executable instructions for performing a media stream slicing method as described in any of the disclosed embodiments when executed by a computer processor.
According to the embodiment of the disclosure, a slicing device responds to a streaming request of a target media stream and does not currently have a slicing task of the target media stream, a slicing information acquisition request corresponding to the target media stream is generated, and the slicing information acquisition request is sent to a central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
Fig. 1 is a flow chart of a media stream slicing method according to an embodiment of the disclosure;
FIG. 2 is an example of a media stream slice scenario in accordance with embodiments of the present disclosure;
fig. 3 is a flow chart of a media stream slicing method according to an embodiment of the disclosure;
fig. 4 is a flow chart of a media stream slicing method according to an embodiment of the disclosure;
fig. 5 is a schematic structural diagram of a media stream slicing apparatus according to an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a media stream slicing apparatus according to an embodiment of the present disclosure;
FIG. 7 is a schematic diagram of a media stream slicing system according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Fig. 1 is a schematic flow chart of a media stream slicing method provided by an embodiment of the present disclosure, where the embodiment of the present disclosure is suitable for slicing streaming continuous media stream data to obtain segmented streaming data slices, the method may be performed by a media stream slicing device, and the device may be implemented in a software and/or hardware form and integrated on a slicing device. As shown in fig. 1, the media stream slicing method specifically includes the following steps:
s110, responding to a stream pulling request of the target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently.
The target media stream may refer to a certain video stream that needs to be pulled currently. Different media streams may be distinguished using different media stream identification information (i.e., stream ids). In a live scene, the target media stream may be a live video stream, and stream data of the target media stream is continuously generated over time. The slicing task of the target media stream may refer to a task of slicing stream data of the target media stream.
Specifically, when the user side needs to play the target media stream, a pull stream request of the target media stream may be sent to one slicing device in the slicing device cluster. After receiving the streaming request, the slicing device may detect whether a slicing task of the target media stream currently exists. If the fact that the slicing task of the target media stream does not exist currently is detected, the fact that the slicing equipment does not slice the target media stream currently is indicated, and a corresponding slicing task needs to be created. In order to ensure slice consistency between the slicing apparatus and other slicing apparatuses, it is necessary to generate a slice information acquisition request corresponding to the target media stream so as to acquire the latest slice information of the target media stream.
Illustratively, before S110, it may further include: and receiving a stream pulling request of the target media stream sent by the user terminal through the edge server.
The edge server may refer to a CDN (Content Delivery Network ) node, configured to cache a media stream pulled by a user side, so as to reduce network bandwidth cost. The client may refer to a client that plays a media stream. Specifically, as shown in fig. 2, in the live scenario, the anchor may push the media stream generated by live broadcast to the media server through RTMP (Real Time Messaging Protocol, real-time message protocol) or HTTP (HyperText Transfer Protocol ) -FLV (Flash video) protocol. The protocol adopted in the streaming of the user side is HLS (HTTP Live Streaming, HTTP real-time streaming media), so that the conversion from RTMP protocol or HTTP-FLV protocol to HLS protocol needs to be realized. Wherein, the description of the media stream data by RTMP protocol and HTTP-FLV protocol is streaming, based on frame and package. The description of media stream data by HLS protocol is segmented, based on TS (Transport Stream) files, each TS file comprising several seconds of media stream data. That is, in order to implement conversion from RTMP protocol or HTTP-FLV protocol to HLS protocol, continuous media stream data needs to be sliced by a slicing device, divided into a plurality of TS files for transmission, and a continuously updated lightweight index file is used to control downloading and playing of the TS files after slicing, so as to implement live broadcast and on-demand of streaming media.
As shown in fig. 2, when the client needs to play the target media stream, a pull request of the target media stream may be sent to the edge server. If the edge server does not have the cached media stream data, the edge server continues to send a streaming request of the target media stream to a slicing device, such as the slicing device 1 or the slicing device 2, so that the slicing device performs slicing processing based on the received streaming request of the target media stream.
And S120, transmitting the slice information acquisition request to the central server so that the central server determines the current slice information corresponding to the target media stream based on the slice information acquisition request.
Wherein the central server may be used to manage slice information for all media streams. The central server may be in connected communication with at least two slicing devices. The current slice information may refer to the globally most current slice information of the target media stream. The current slicing information may include the last slicing procedure information of the target media stream to enable other slicing devices to continue to complete the consistent slices.
Specifically, the slicing apparatus transmits a slicing information acquisition request to the center server. The central server responds to the received slice information acquisition request, determines current slice information corresponding to the target media stream from the database, and sends the current slice information to the slicing device.
S130, creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on current slicing information through the created slicing task.
Wherein the current stream data of the target media stream may refer to the latest stream data of the target media stream generated during the current period of time. For example, the current stream data may be the latest data of the live video.
In particular, the slicing device may create slicing tasks for the target media stream and obtain current stream data for the target media stream from the media server. The method comprises the steps of executing a created slicing task, determining the starting position of a current slice based on received current slice information, slicing the obtained current stream data according to the starting position of the current slice and a fixed time interval, and obtaining a current stream data slice consistent with slices of other slicing devices and a current index file corresponding to the current stream data slice, thereby ensuring that the same media stream can be synchronously sliced on any one slicing device, ensuring the consistency of slices, and avoiding the situation of play errors caused by inconsistent slices. After the current stream data slice and the current index file corresponding to the current stream data slice are obtained, the current index file corresponding to the current stream data slice may be sent to the user side. And the user side downloads and plays the corresponding current stream data slice based on the received current index file, thereby completing the playing process of the media stream.
It should be noted that, after the slicing task of the target media stream is created on the slicing device, the slicing task is continuously executed, and continuous slicing processing is performed on the current stream data of the target media stream obtained each time, so as to obtain the current stream data slice after each slicing and the current index file corresponding to the current stream data slice. For example, the first slicing process is performed on the current stream data of the first obtained target media stream based on the received current slicing information, and the next slicing process is performed on the current stream data of the next obtained target media stream based on the slicing position information after the first slicing, and the same is followed by slicing. The first slice is synchronized with other slicing equipment, so that the subsequent slices are synchronized slices, and the consistency of each slice is ensured.
Illustratively, after S130, it may further include: and sending the current index file corresponding to the current stream data slice to the user side through the edge server, so that the user side downloads and plays the current stream data slice based on the current index file.
Wherein the number of current stream data slices may be a plurality. For example, the current stream data slice may be a TS file or an FMP4 file. The current index file may be an m3u8 file. The current index file may include a network address for each slice of stream data for slice download via that network address.
Specifically, as shown in fig. 2, the slicing device performs slicing processing on current stream data of a target media stream transmitted through an RTMP protocol or an HTTP-FLV protocol based on current slice information, so as to obtain a current stream data slice capable of being transmitted by using an HLS protocol and a corresponding current index file, thereby realizing protocol conversion. The slicing device may send the current index file corresponding to the current stream data slice to the edge server, and then the edge server sends the current index file to the user side. The user side determines the network address of the current stream data slice to be played based on the received current index file, and downloads the current stream data slice to be played based on the network address for playing, so that the media stream playing of the HLS protocol is realized.
And S140, determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
The target slice information may refer to newly determined slice information, among other things. The target slice information dynamically changes from slice to slice obtained at a time.
Specifically, the slicing device can continuously slice the current stream data of the target media stream through the created slicing task of the target media stream, and obtain all current stream data slices after each slicing. And determining target slice information corresponding to the target media stream based on the current stream data slice obtained by each slice, and sending the target slice information to a central server. The central server can synchronously update the current slice information corresponding to the target media stream as target slice information, so that the central server always stores the latest slice information, and the consistency of other slicing devices on the target media stream slices is ensured.
It should be noted that, the slicing information of the target media stream needs to be updated once after each slicing of the slicing device, so that the slicing device can be switched at any time, for example, the failed slicing device is removed, a new slicing device is added, and the consistency of slicing of different slicing devices on the same path of media stream is ensured.
According to the technical scheme, the slicing equipment responds to the streaming request of the target media stream and does not currently exist the slicing task of the target media stream, a slicing information acquisition request corresponding to the target media stream is generated, and the slicing information acquisition request is sent to the central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
Based on the technical scheme, the method can further comprise the following steps: responding to a stream pulling request of a target media stream and the current slicing task of the target media stream exists, and directly acquiring the current stream data slice after the current slicing and the corresponding current index file.
Specifically, when the slicing task of the target media stream currently exists in the slicing device is detected, the fact that the slicing device is continuously slicing the target media stream currently is indicated, the current stream data slices obtained by slicing each time are synchronous slices, interaction with a central server is not needed, and therefore the slicing device can directly obtain the current stream data slices after slicing the time and corresponding current index files and send the current index files to a user side, and the user side downloads the current stream data slices based on the current index files to play.
Based on the above technical solution, S120 may further include: if the central server does not have the current slice information corresponding to the target media stream, a slice task of the target media stream is created, and slice processing is carried out on the current stream data of the target media stream through the created slice task.
Specifically, if all slicing devices do not slice the target media stream, that is, there is no current slicing information of the target media stream in the database of the central server, no identification information, such as 404, may be sent to the slicing devices at this time. After receiving the absence of the identification information sent by the central server, the slicing device indicates that the slicing device is the first device for slicing the target media stream, and can directly slice the current stream data of the target media stream based on a preset slicing mode. The slicing device needs to determine target slicing information corresponding to the target media stream based on the current stream data slice obtained each time after each slicing, and sends the target slicing information to the central server, so that the central server synchronously updates the current slicing information corresponding to the target media stream based on the target slicing information, the latest slicing information is guaranteed to be stored, and further consistency of different slicing devices on the same media stream slice is guaranteed.
Fig. 3 is a flow chart of a media stream slicing method according to an embodiment of the present disclosure, where the step of slicing current stream data of a target media stream based on current slice information is optimized on the basis of the above-described embodiment of the present disclosure. Wherein the same or corresponding terms as those of the above-described embodiments are not explained in detail herein.
As shown in fig. 3, the media stream slicing method specifically includes the following steps:
s210, responding to a streaming request of the target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently.
And S220, transmitting the slice information acquisition request to the central server so that the central server determines the current slice information corresponding to the target media stream based on the slice information acquisition request.
S230, creating a slicing task of the target media stream, and determining a current slice starting position and a current starting time stamp of the first stream data slice based on current slice information through the created slicing task.
The current slice starting position may refer to a stream data starting position when a slice is started, that is, a stream data starting position corresponding to a first stream data slice, which is used for ensuring the consistency of stream data corresponding to the slice. The current slice start position may be characterized using a frame number or a time stamp. The current start timestamp of the first stream data slice may refer to the start timestamp of the first stream data slice after the slice for slice timestamp alignment.
Specifically, the slicing device may first determine a current slice start position and a current start time stamp of a first stream data slice based on current slice information of the target media stream by performing a slicing task of the created target media stream.
Illustratively, the current slice information may include: a stream data start time stamp and a slice start time stamp corresponding to the current start slice. Wherein the current start slice may refer to the first stream data slice after the current slice. The stream data start time stamp may refer to a time stamp of a start slice of RTMP or HTTP-FLV stream data. The slice start timestamp may refer to the timestamp of the first slice after the slice.
Illustratively, "determining a current slice start position and a current start time stamp of a first stream data slice based on the current slice information" in S230 may include: determining the starting position of the current slice based on the stream data starting time stamp corresponding to the current starting slice; the current start timestamp of the first stream data slice is determined based on the slice start timestamp corresponding to the current start slice.
Specifically, the stream data start time stamp corresponding to the current start slice may be determined as the current slice start position. And determining a slice start time stamp corresponding to the current start slice as the current start time stamp of the first stream data slice.
S240, slicing and time alignment are carried out on the current stream data of the target media stream based on a preset slicing mode, a current slicing starting position and a current starting time stamp, and the current stream data slice after time alignment and a current index file corresponding to the current stream data slice are obtained.
The preset slicing mode may be a media stream slicing algorithm set in advance based on service requirements. Each slicing device uses the same preset slicing mode so as to have the same slicing time interval and the like, thereby further ensuring the consistency of slicing.
Specifically, the slicing device may begin slicing from a current slice start position in the current stream data of the target media stream based on a preset slicing manner, so as to obtain all current stream data slices after the current slicing. Based on the current starting time stamp corresponding to the current starting slice, the starting time stamp of each current stream data slice is adjusted, and all the current stream data slices aligned with other segmentation equipment are obtained, so that the consistency of the slices is further ensured, and the situation of play errors is avoided.
S250, determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server, so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
For example, the target slice information may include the same field as the current slice information. For example, the target slice information may also include: a stream data start time stamp and a slice start time stamp corresponding to the target start slice.
Illustratively, S250 may include: determining a reference stream data slice in the obtained current stream data slices; determining a stream data starting time stamp corresponding to a target starting slice based on the stream data starting time stamp corresponding to the reference stream data slice; and determining the slice start time stamp corresponding to the target start slice based on the slice start time stamp corresponding to the reference stream data slice.
Wherein the reference stream data slice may be preset for identifying the slice of the next slice start position. For example, the reference stream data slice may be the first stream data slice, so that when other slicing devices slice, slicing may be started at the first slice position of the last slice, so that other slicing devices may recover all slices of the last slice and continue to complete the slicing task, thereby improving the cache hit rate of the slices. Alternatively, the reference stream data slice may be the last stream data slice, so that when other slicing devices slice, slicing may be started at the last slice position of the last slice, thereby saving slice resources.
Specifically, the first stream data slice or the last stream data slice among all the current stream data slices currently obtained may be determined as the reference stream data slice. The stream data start time stamp corresponding to the reference stream data slice may be determined as the stream data start time stamp corresponding to the target start slice. The slice start time stamp corresponding to the reference stream data slice may be determined as the slice start time stamp corresponding to the target start slice, thereby obtaining target slice information after the current slice.
Illustratively, the current slice information may also include a current slice sequence number. Accordingly, the target slice information may further include: target slice sequence number. The slice sequence number may be used to characterize the order of the slices. For example, a larger slice number indicates a later slice, closer to the current time. The slice sequence number may be characterized by the index sequence number of the index file generated for each slice. The current slice number may refer to the slice number after the latest slice. The target slice number may refer to a slice number after the current slice.
Illustratively, S250 may further include: and acquiring the current slice sequence number in the current slice information, and accumulating the current slice sequence number to acquire the target slice sequence number.
Specifically, the slice number may start with 1, and each slice is processed by adding 1 to the slice number. For example, the current slice sequence number in the current slice information may be processed by adding 1 to obtain the target slice sequence number in the target slice information. The accuracy of the synchronous updating of the slice information of the target media stream can be ensured by utilizing the target slice serial number, so that the central server always stores the latest slice information of the target media stream.
According to the technical scheme, the slicing equipment performs slicing and time alignment on the current stream data of the target media stream based on the preset slicing mode, the current slicing starting position and the current starting time stamp, and the current stream data slice after time alignment with other slicing equipment is obtained, so that the slicing consistency is further ensured, and the situation of play errors is avoided.
Fig. 4 is a flow chart of a media stream slicing method provided by an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to slicing streaming continuous media stream data to obtain segmented streaming data slices, the method may be performed by a media stream slicing device, and the device may be implemented in a software and/or hardware form and integrated on a central server. As shown in fig. 4, the media stream slicing method specifically includes the following steps:
S310, receiving a slice information acquisition request corresponding to a target media stream sent by a slice device.
Specifically, when the user side needs to play the target media stream, a pull stream request of the target media stream may be sent to one slicing device in the slicing device cluster. After receiving the streaming request, the slicing device may detect whether a slicing task of the target media stream currently exists. If it is detected that the slicing task of the target media stream does not exist currently, in order to ensure slicing consistency between the slicing device and other slicing devices, a slicing information acquisition request corresponding to the target media stream needs to be generated, and the slicing information acquisition request is sent to a central server so as to acquire the latest slicing information of the target media stream.
S320, determining current slice information corresponding to the target media stream based on the slice information acquisition request, and sending the current slice information to the slicing device, so that the slicing device creates a slice task of the target media stream, performs slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determines the target slice information corresponding to the target media stream based on the obtained current stream data slice.
Wherein the central server may be used to manage slice information for all media streams. The central server may be in connected communication with at least two slicing devices. The current slice information may refer to the globally most current slice information of the target media stream. The current slicing information may include the last slicing procedure information of the target media stream to enable other slicing devices to continue to complete the consistent slices. The target slice information may refer to newly determined slice information. The target slice information dynamically changes from slice to slice obtained at a time.
Specifically, the central server responds to the received slice information acquisition request, determines current slice information corresponding to the target media stream from the database, and sends the current slice information to the slicing device. The slicing device may create slicing tasks for the target media stream and obtain current stream data for the target media stream from the media server. The method comprises the steps of executing a created slicing task, determining the starting position of a current slice based on received current slice information, slicing the obtained current stream data according to the starting position of the current slice and a fixed time interval, and obtaining a current stream data slice consistent with slices of other slicing devices and a current index file corresponding to the current stream data slice, thereby ensuring that the same media stream can be synchronously sliced on any one slicing device, ensuring the consistency of slices, and avoiding the situation of play errors caused by inconsistent slices. The slicing device can continuously slice the current stream data of the target media stream through the created slicing task of the target media stream, and all current stream data slices after each slicing are obtained. And determining target slice information corresponding to the target media stream based on the current stream data slice obtained by each slice, and sending the target slice information to a central server.
Illustratively, "determining current slice information corresponding to the target media stream based on the slice information acquisition request" in S320 may include: based on the slice information acquisition request, acquiring current slice information corresponding to the target media stream and expiration time corresponding to the current slice information from a database; and if the current time does not reach the expiration time, transmitting the current slicing information to slicing equipment.
Specifically, a database in the central server stores current slice information and corresponding expiration time corresponding to each media stream. The central server can query the current slice information and the corresponding expiration time corresponding to the target media stream from the database based on the target media stream identification information in the slice information acquisition request. By detecting whether the current time reaches the expiration time, whether the queried current slice information is valid information can be determined. If the current time does not reach the expiration time, the current slice information is indicated to be not expired, and the current slice information can be sent to the slicing device. By setting the expiration time, the validity of slice information can be ensured, and the condition of invalid slicing of the premature streaming data in the live broadcast scene is avoided, so that slice resources are saved.
For example, if the database of the central server does not store the current slice information corresponding to the target media stream, or the current time reaches the expiration time corresponding to the current slice information, the slicing device may send the absence identification information, such as 404, so that when the slicing device receives the absence identification information, slicing processing is directly performed on the current stream data of the target media stream based on the preset slicing mode.
S330, receiving target slice information sent by the slice device, and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
Specifically, when receiving the target slice information sent by the slicing device, the central server can directly and synchronously update the current slice information corresponding to the target media stream as the target slice information, so that the central server always stores the latest slice information, and the consistency of other slicing devices on the slicing of the target media stream is ensured.
Illustratively, S330 may include: acquiring a target slice sequence number in target slice information and a current slice sequence number in current slice information corresponding to a target media stream stored in a database; and comparing the target slice sequence number with the current slice sequence number, and synchronously updating the current slice information corresponding to the target media stream based on the comparison result.
Wherein the slice sequence number may be used to characterize the sequencing of the slices. For example, a larger slice number indicates a later slice, closer to the current time. The target slice number may refer to a slice number after the current slice. The current slice number may be the last slice number after the last slice of the data store.
Specifically, when receiving the target slice information sent by each slice device, the central server may obtain the current slice sequence number in the current slice information corresponding to the target media stream from the database, and compare the target slice sequence number in the target slice information with the current slice sequence number to determine whether to update the current slice information synchronously. If the target slice sequence number is greater than the current slice sequence number, the target slice information is updated compared with the current slice information, and the current slice information corresponding to the target media stream can be updated into the target slice information. If the target slice sequence number is smaller than or equal to the current slice sequence number, the current slice information is the latest slice information, and updating is not needed. The accuracy of the synchronous updating of the slice information of the target media stream can be ensured by comparing the slice serial numbers, so that the central server always stores the latest slice information of the target media stream.
According to the technical scheme, the slicing equipment responds to the streaming request of the target media stream and does not currently exist the slicing task of the target media stream, a slicing information acquisition request corresponding to the target media stream is generated, and the slicing information acquisition request is sent to the central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
The following is an embodiment of a media stream slicing apparatus provided by an embodiment of the present disclosure, where the media stream slicing apparatus and the media stream slicing method of the foregoing embodiment belong to the same inventive concept, and details of the embodiments of the media stream slicing apparatus are not described in detail, and reference may be made to the foregoing embodiments.
Fig. 5 is a schematic structural diagram of a media stream slicing device according to an embodiment of the present disclosure, as shown in fig. 5, where the device is integrated in a slicing apparatus, and specifically includes: a slice information acquisition request generation module 410, a slice information acquisition request transmission module 420, a stream data slice processing module 430, and a target slice information determination module 440.
The slice information acquisition request generation module 410 is configured to generate a slice information acquisition request corresponding to a target media stream in response to a pull stream request of the target media stream and that there is no slice task of the target media stream currently; a slice information acquisition request sending module 420, configured to send the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request; a stream data slicing processing module 430, configured to create a slicing task of the target media stream, and perform slicing processing on current stream data of the target media stream based on the current slice information through the created slicing task; the target slice information determining module 440 is configured to determine target slice information corresponding to the target media stream based on the obtained current stream data slice, and send the target slice information to the central server, so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
According to the technical scheme provided by the embodiment of the disclosure, the slicing equipment responds to the streaming request of the target media stream and does not currently have the slicing task of the target media stream, generates the slicing information acquisition request corresponding to the target media stream, and sends the slicing information acquisition request to the central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
Based on the above technical solution, the stream data slice processing module 430 includes:
a start information determining unit configured to determine a current slice start position and a current start time stamp of a first stream data slice based on the current slice information;
and the stream data slice processing unit is used for slicing and time aligning the current stream data of the target media stream based on a preset slice mode, the current slice starting position and the current starting time stamp, and obtaining a current stream data slice after time alignment and a current index file corresponding to the current stream data slice.
On the basis of the above technical solutions, the current slice information includes: a stream data start time stamp and a slice start time stamp corresponding to the current start slice;
the initial information determining unit is specifically configured to: determining a current slice starting position based on a stream data starting time stamp corresponding to the current starting slice; and determining the current start time stamp of the first stream data slice based on the slice start time stamp corresponding to the current start slice.
On the basis of the above technical solutions, the target slice information includes: a stream data start time stamp and a slice start time stamp corresponding to the target start slice;
The target slice information determining module 440 is specifically configured to: determining a reference stream data slice in the obtained current stream data slices; determining a stream data starting time stamp corresponding to a target starting slice based on the stream data starting time stamp corresponding to the reference stream data slice; and determining the slice starting time stamp corresponding to the target starting slice based on the slice starting time stamp corresponding to the reference stream data slice.
On the basis of the above technical solutions, the target slice information further includes: a target slice sequence number;
the target slice information determining module 440 is further specifically configured to: and acquiring a current slice sequence number in the current slice information, and accumulating the current slice sequence number to obtain a target slice sequence number.
On the basis of the technical schemes, the device further comprises:
the streaming request receiving module is used for receiving the streaming request of the target media stream sent by the user side through the edge server before the streaming request of the target media stream is responded and the slicing task of the target media stream does not exist currently and the slicing information acquisition request corresponding to the target media stream is generated;
and the index file sending module is used for sending a current index file corresponding to the current stream data slice to the user side through the edge server after slicing the current stream data of the target media stream based on the current slice information, so that the user side downloads and plays the current stream data slice based on the current index file.
The media stream slicing device provided by the embodiment of the disclosure can execute the media stream slicing method applied to slicing equipment provided by the embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 6 is a schematic structural diagram of a media stream slicing apparatus according to an embodiment of the present disclosure, as shown in fig. 6, where the apparatus is integrated in a central server, and specifically includes: the slice information acquisition request receiving module 510, the current slice information determining module 520, and the slice information synchronization updating module 530.
The slice information acquisition request receiving module 510 is configured to receive a slice information acquisition request corresponding to a target media stream sent by a slicing device; the current slice information determining module 520 is configured to determine current slice information corresponding to the target media stream based on the slice information acquisition request, send the current slice information to the slicing device, so that the slicing device creates a slice task of the target media stream, perform slice processing on current stream data of the target media stream based on the current slice information through the created slice task, and determine target slice information corresponding to the target media stream based on the obtained current stream data slice; and the slice information synchronization updating module 530 is configured to receive the target slice information sent by the slicing device, and synchronously update current slice information corresponding to the target media stream based on the target slice information.
According to the technical scheme provided by the embodiment of the disclosure, the slicing equipment responds to the streaming request of the target media stream and does not currently have the slicing task of the target media stream, generates the slicing information acquisition request corresponding to the target media stream, and sends the slicing information acquisition request to the central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
Based on the above technical solution, the current slice information determining module 520 is specifically configured to:
acquiring current slice information corresponding to the target media stream and expiration time corresponding to the current slice information from a database based on the slice information acquisition request; and if the current time does not reach the expiration time, transmitting the current slicing information to the slicing equipment.
Based on the above technical solutions, the slice information synchronization update module 530 is specifically configured to:
acquiring a target slice sequence number in the target slice information and a current slice sequence number in current slice information corresponding to the target media stream stored in a database; and comparing the target slice sequence number with the current slice sequence number, and synchronously updating the current slice information corresponding to the target media stream based on a comparison result.
The media stream slicing device provided by the embodiment of the disclosure can execute the media stream slicing method applied to the central server provided by the embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method.
It should be noted that each unit and module included in the above apparatus are only divided according to the functional logic, but not limited to the above division, so long as the corresponding functions can be implemented; in addition, the specific names of the functional units are also only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present disclosure.
Fig. 7 is a schematic structural diagram of a media stream slicing system according to an embodiment of the present disclosure, where the embodiment may be applicable to a case of slicing streaming continuous media stream data to obtain segmented streaming data slices. As shown in fig. 7, the system specifically includes: a central server 610 and at least two slicing devices 620;
wherein each slicing device 620 is configured to implement the media stream slicing method applied to the slicing device in the above-described embodiment. The central server 610 is used to implement the media stream slicing method applied to the central server in the above-described embodiment.
The slicing equipment clusters formed by all the slicing equipment are distributed clusters, and the consistency of slicing of different slicing equipment on the same media stream is ensured, so that the slicing equipment can be switched at any time, and the slicing flexibility and the slicing equipment availability are improved.
In the media stream slicing system in the embodiment of the disclosure, slicing equipment responds to a streaming request of a target media stream and a slicing task of the target media stream does not exist currently, generates a slicing information acquisition request corresponding to the target media stream, and sends the slicing information acquisition request to a central server. The center server determines current slice information corresponding to the target media stream based on the slice information acquisition request. The slicing device creates slicing tasks of the target media stream, and performs slicing processing on current stream data of the target media stream based on current slicing information through the created slicing tasks, so that slicing is performed by using the current slicing information obtained from the central server, and the consistency of slicing of the same media stream by different slicing devices can be ensured. The slicing device determines target slice information corresponding to the target media stream based on the obtained current stream data slice, and sends the target slice information to the central server. The central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information, so that synchronous slicing of the same media stream on any one slicing device can be ensured by utilizing the synchronously updated current slice information, the consistency of slicing is further ensured, the slicing devices can be switched at any time, and the flexibility and the usability of slicing the media stream are improved.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure. Referring now to fig. 8, a schematic diagram of an electronic device (e.g., a terminal device or server in fig. 8) 500 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 8 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 8, the electronic device 500 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 501, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 502 or a program loaded from a storage means 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic apparatus 500 are also stored. The processing device 501, the ROM 502, and the RAM 503 are connected to each other via a bus 504. An edit/output (I/O) interface 505 is also connected to bus 504.
In general, the following devices may be connected to the I/O interface 505: input devices 506 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 507 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 508 including, for example, magnetic tape, hard disk, etc.; and communication means 509. The communication means 509 may allow the electronic device 500 to communicate with other devices wirelessly or by wire to exchange data. While fig. 8 shows an electronic device 500 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via the communication means 509, or from the storage means 508, or from the ROM 502. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 501.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
The electronic device provided by the embodiment of the present disclosure and the media stream slicing method provided by the foregoing embodiment belong to the same inventive concept, and technical details not described in detail in the present embodiment may be referred to the foregoing embodiment, and the present embodiment has the same beneficial effects as the foregoing embodiment.
The disclosed embodiments provide a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the media stream slicing method provided by the above embodiments.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: responding to a streaming request of a target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently; transmitting the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request; creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on the current slicing information through the created slicing task; and determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
Alternatively, the computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: receiving a slice information acquisition request corresponding to a target media stream sent by a slicing device; determining current slice information corresponding to the target media stream based on the slice information acquisition request, and sending the current slice information to the slicing device so that the slicing device creates a slice task of the target media stream, performs slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determines target slice information corresponding to the target media stream based on the obtained current stream data slice; and receiving the target slice information sent by the slicing equipment, and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit does not in any way constitute a limitation of the unit itself, for example the first acquisition unit may also be described as "unit acquiring at least two internet protocol addresses".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, the method comprising:
responding to a streaming request of a target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently;
transmitting the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on the current slicing information through the created slicing task;
and determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, further comprising:
Optionally, the slicing processing of the current stream data of the target media stream based on the current slice information includes:
determining a current slice start position and a current start time stamp of a first stream data slice based on the current slice information;
and slicing and time alignment are carried out on the current stream data of the target media stream based on a preset slicing mode, the current slice starting position and the current starting time stamp, and a current stream data slice after time alignment and a current index file corresponding to the current stream data slice are obtained.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, further comprising:
optionally, the current slice information includes: a stream data start time stamp and a slice start time stamp corresponding to the current start slice;
the determining a current slice start position and a current start time stamp of a first stream data slice based on the current slice information includes:
determining a current slice starting position based on a stream data starting time stamp corresponding to the current starting slice;
and determining the current start time stamp of the first stream data slice based on the slice start time stamp corresponding to the current start slice.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, further comprising:
optionally, the target slice information includes: a stream data start time stamp and a slice start time stamp corresponding to the target start slice;
the determining, based on the obtained current stream data slice, target slice information corresponding to the target media stream includes:
determining a reference stream data slice in the obtained current stream data slices;
determining a stream data starting time stamp corresponding to a target starting slice based on the stream data starting time stamp corresponding to the reference stream data slice;
and determining the slice starting time stamp corresponding to the target starting slice based on the slice starting time stamp corresponding to the reference stream data slice.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, further comprising:
optionally, the target slice information further includes: a target slice sequence number;
the determining, based on the obtained current stream data slice, target slice information corresponding to the target media stream, further includes:
and acquiring a current slice sequence number in the current slice information, and accumulating the current slice sequence number to obtain a target slice sequence number.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a slicing apparatus, further comprising:
optionally, before generating the slice information acquisition request corresponding to the target media stream in response to the pull stream request of the target media stream and that the slice task of the target media stream does not exist currently, the method further includes:
receiving a stream pulling request of a target media stream sent by a user side through an edge server;
after slicing the current stream data of the target media stream based on the current slice information, further comprising:
and sending a current index file corresponding to the current stream data slice to the user side through the edge server, so that the user side downloads and plays the current stream data slice based on the current index file.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a central server, the method comprising:
receiving a slice information acquisition request corresponding to a target media stream sent by a slicing device;
determining current slice information corresponding to the target media stream based on the slice information acquisition request, and sending the current slice information to the slicing device so that the slicing device creates a slice task of the target media stream, performs slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determines target slice information corresponding to the target media stream based on the obtained current stream data slice;
And receiving the target slice information sent by the slicing equipment, and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a central server, further comprising:
optionally, the determining current slice information corresponding to the target media stream based on the slice information acquisition request and sending the current slice information to the slicing device includes:
acquiring current slice information corresponding to the target media stream and expiration time corresponding to the current slice information from a database based on the slice information acquisition request;
and if the current time does not reach the expiration time, transmitting the current slicing information to the slicing equipment.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing method, applied to a central server, further comprising:
optionally, the step of synchronously updating the current slice information corresponding to the target media stream based on the target slice information includes:
Acquiring a target slice sequence number in the target slice information and a current slice sequence number in current slice information corresponding to the target media stream stored in a database;
and comparing the target slice sequence number with the current slice sequence number, and synchronously updating the current slice information corresponding to the target media stream based on a comparison result.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing apparatus, integrated in a slicing device, the apparatus comprising:
the slice information acquisition request generation module is used for responding to a pull stream request of the target media stream and generating a slice information acquisition request corresponding to the target media stream when the slice task of the target media stream does not exist currently;
a slice information acquisition request sending module, configured to send the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
the stream data slicing processing module is used for creating slicing tasks of the target media stream and slicing the current stream data of the target media stream based on the current slicing information through the created slicing tasks;
And the target slice information determining module is used for determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
According to one or more embodiments of the present disclosure, there is provided a media stream slicing apparatus, integrated with a central server, the apparatus comprising:
the slice information acquisition request receiving module is used for receiving a slice information acquisition request corresponding to a target media stream sent by the slicing equipment;
the current slice information determining module is used for determining current slice information corresponding to the target media stream based on the slice information acquisition request, sending the current slice information to the slicing equipment so that the slicing equipment can create a slice task of the target media stream, performing slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determining the target slice information corresponding to the target media stream based on the obtained current stream data slice;
And the slice information synchronous updating module is used for receiving the target slice information sent by the slicing equipment and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (14)

1. A media stream slicing method, for use in a slicing apparatus, the method comprising:
responding to a streaming request of a target media stream, and generating a slice information acquisition request corresponding to the target media stream when a slice task of the target media stream does not exist currently;
transmitting the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
creating a slicing task of the target media stream, and slicing current stream data of the target media stream based on the current slicing information through the created slicing task;
and determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
2. The media stream slicing method of claim 1, wherein slicing current stream data of the target media stream based on the current slice information comprises:
determining a current slice start position and a current start time stamp of a first stream data slice based on the current slice information;
and slicing and time alignment are carried out on the current stream data of the target media stream based on a preset slicing mode, the current slice starting position and the current starting time stamp, and a current stream data slice after time alignment and a current index file corresponding to the current stream data slice are obtained.
3. The media stream slicing method of claim 2, wherein the current slice information comprises: a stream data start time stamp and a slice start time stamp corresponding to the current start slice;
the determining a current slice start position and a current start time stamp of a first stream data slice based on the current slice information includes:
determining a current slice starting position based on a stream data starting time stamp corresponding to the current starting slice;
and determining the current start time stamp of the first stream data slice based on the slice start time stamp corresponding to the current start slice.
4. The media stream slicing method of claim 1, wherein the target slice information comprises: a stream data start time stamp and a slice start time stamp corresponding to the target start slice;
the determining, based on the obtained current stream data slice, target slice information corresponding to the target media stream includes:
determining a reference stream data slice in the obtained current stream data slices;
determining a stream data starting time stamp corresponding to a target starting slice based on the stream data starting time stamp corresponding to the reference stream data slice;
and determining the slice starting time stamp corresponding to the target starting slice based on the slice starting time stamp corresponding to the reference stream data slice.
5. The media stream slicing method of claim 4, wherein the target slice information further comprises: a target slice sequence number;
the determining, based on the obtained current stream data slice, target slice information corresponding to the target media stream, further includes:
and acquiring a current slice sequence number in the current slice information, and accumulating the current slice sequence number to obtain a target slice sequence number.
6. The media stream slicing method of any one of claims 1-5, further comprising, prior to generating the slice information acquisition request corresponding to the target media stream in response to the pull request for the target media stream and the slicing task for the target media stream not currently being present:
Receiving a stream pulling request of a target media stream sent by a user side through an edge server;
after slicing the current stream data of the target media stream based on the current slice information, further comprising:
and sending a current index file corresponding to the current stream data slice to the user side through the edge server, so that the user side downloads and plays the current stream data slice based on the current index file.
7. A media stream slicing method, applied to a central server, the method comprising:
receiving a slice information acquisition request corresponding to a target media stream sent by a slicing device;
determining current slice information corresponding to the target media stream based on the slice information acquisition request, and sending the current slice information to the slicing device so that the slicing device creates a slice task of the target media stream, performs slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determines target slice information corresponding to the target media stream based on the obtained current stream data slice;
and receiving the target slice information sent by the slicing equipment, and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
8. The media stream slicing method of claim 7, wherein determining current slice information corresponding to the target media stream based on the slice information acquisition request and transmitting the current slice information to the slicing device comprises:
acquiring current slice information corresponding to the target media stream and expiration time corresponding to the current slice information from a database based on the slice information acquisition request;
and if the current time does not reach the expiration time, transmitting the current slicing information to the slicing equipment.
9. The media stream slicing method of claim 7, wherein synchronously updating current slice information corresponding to the target media stream based on the target slice information, comprises:
acquiring a target slice sequence number in the target slice information and a current slice sequence number in current slice information corresponding to the target media stream stored in a database;
and comparing the target slice sequence number with the current slice sequence number, and synchronously updating the current slice information corresponding to the target media stream based on a comparison result.
10. A media stream slicing apparatus integrated into a slicing device, the apparatus comprising:
The slice information acquisition request generation module is used for responding to a pull stream request of the target media stream and generating a slice information acquisition request corresponding to the target media stream when the slice task of the target media stream does not exist currently;
a slice information acquisition request sending module, configured to send the slice information acquisition request to a central server, so that the central server determines current slice information corresponding to the target media stream based on the slice information acquisition request;
the stream data slicing processing module is used for creating slicing tasks of the target media stream and slicing the current stream data of the target media stream based on the current slicing information through the created slicing tasks;
and the target slice information determining module is used for determining target slice information corresponding to the target media stream based on the obtained current stream data slice, and sending the target slice information to the central server so that the central server synchronously updates the current slice information corresponding to the target media stream based on the target slice information.
11. A media stream slicing apparatus integrated with a central server, the apparatus comprising:
The slice information acquisition request receiving module is used for receiving a slice information acquisition request corresponding to a target media stream sent by the slicing equipment;
the current slice information determining module is used for determining current slice information corresponding to the target media stream based on the slice information acquisition request, sending the current slice information to the slicing equipment so that the slicing equipment can create a slice task of the target media stream, performing slice processing on the current stream data of the target media stream based on the current slice information through the created slice task, and determining the target slice information corresponding to the target media stream based on the obtained current stream data slice;
and the slice information synchronous updating module is used for receiving the target slice information sent by the slicing equipment and synchronously updating the current slice information corresponding to the target media stream based on the target slice information.
12. A media stream slicing system, the system comprising: a central server and at least two slicing devices;
wherein each slicing device is configured to implement a media stream slicing method as claimed in any one of claims 1-6;
The central server is configured to implement the media stream slicing method according to any of claims 7-9.
13. An electronic device, the electronic device comprising:
one or more processors;
storage means for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the media stream slicing method of any of claims 1-9.
14. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the media stream slicing method of any of claims 1-9.
CN202311220511.XA 2023-09-20 2023-09-20 Media stream slicing method, device, system, equipment and storage medium Pending CN117201894A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311220511.XA CN117201894A (en) 2023-09-20 2023-09-20 Media stream slicing method, device, system, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311220511.XA CN117201894A (en) 2023-09-20 2023-09-20 Media stream slicing method, device, system, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN117201894A true CN117201894A (en) 2023-12-08

Family

ID=88999604

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311220511.XA Pending CN117201894A (en) 2023-09-20 2023-09-20 Media stream slicing method, device, system, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN117201894A (en)

Similar Documents

Publication Publication Date Title
US11356748B2 (en) Method, apparatus and system for slicing live streaming
CN113411642B (en) Screen projection method and device, electronic equipment and storage medium
US20120282951A1 (en) Anchoring and sharing locations and enjoyment experience information on a presentation timeline for multimedia content streamed over a network
CN108900855B (en) Live content recording method and device, computer readable storage medium and server
WO2022095840A1 (en) Livestreaming room setup method and apparatus, electronic device, and storage medium
CN111309747A (en) Data synchronization method, system and device
WO2023165371A1 (en) Audio playing method and apparatus, electronic device and storage medium
CN111163336B (en) Video resource pushing method and device, electronic equipment and computer readable medium
CN113794942B (en) Method, apparatus, system, device and medium for switching view angle of free view angle video
CN110083768B (en) Information sharing method, device, equipment and medium
CN113542856B (en) Method, device, equipment and computer readable medium for reverse playing of online video
CN113259729B (en) Data switching method, server, system and storage medium
CN114584822B (en) Synchronous playing method and device, terminal equipment and storage medium
CN115695928B (en) Screen projection method and device, electronic equipment and storage medium
CN114827698B (en) Method, device, terminal equipment and storage medium for synchronizing play information
CN117201894A (en) Media stream slicing method, device, system, equipment and storage medium
CN113420400B (en) Routing relation establishment method, request processing method, device and equipment
CN114125485A (en) Image processing method, apparatus, device and medium
CN111367592B (en) Information processing method and device
CN112015746A (en) Data real-time processing method, device, medium and electronic equipment
CN115225917A (en) Recording plug-flow method, device, equipment and medium
CN111314021A (en) Data transmission method and device, electronic equipment and computer readable storage medium
CN111212296A (en) Live broadcast room gift list configuration method, device, medium and electronic equipment
CN117528157A (en) Video playing method, device, system, equipment and storage medium
CN113794836B (en) Bullet time video generation method, device, system, equipment and 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