CN106656593B - Method and system for streaming media live broadcast recording redundancy hot standby - Google Patents
Method and system for streaming media live broadcast recording redundancy hot standby Download PDFInfo
- Publication number
- CN106656593B CN106656593B CN201611179975.0A CN201611179975A CN106656593B CN 106656593 B CN106656593 B CN 106656593B CN 201611179975 A CN201611179975 A CN 201611179975A CN 106656593 B CN106656593 B CN 106656593B
- Authority
- CN
- China
- Prior art keywords
- streaming media
- live
- recording
- live broadcast
- receiving
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 26
- 238000012544 monitoring process Methods 0.000 claims description 6
- 230000027455 binding Effects 0.000 claims description 4
- 238000009739 binding Methods 0.000 claims description 4
- 238000012552 review Methods 0.000 description 4
- 230000005540 biological transmission Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000010276 construction Methods 0.000 description 2
- 230000007547 defect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000000977 initiatory effect Effects 0.000 description 2
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 230000006870 function Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 230000001105 regulatory effect Effects 0.000 description 1
- 230000000717 retained effect Effects 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/61—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
- H04L65/612—Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for unicast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/06—Management of faults, events, alarms or notifications
- H04L41/0654—Management of faults, events, alarms or notifications using network fault recovery
- H04L41/0668—Management of faults, events, alarms or notifications using network fault recovery by dynamic selection of recovery network elements, e.g. replacement by the most appropriate element after failure
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/70—Media network packetisation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L65/00—Network arrangements, protocols or services for supporting real-time applications in data packet communication
- H04L65/60—Network streaming of media packets
- H04L65/75—Media network packet handling
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
Landscapes
- Engineering & Computer Science (AREA)
- Multimedia (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
- Hardware Redundancy (AREA)
Abstract
The invention discloses a method for redundant hot standby of live recording of streaming media, which comprises the following steps: synchronously inputting the code stream coded by the live broadcast coder into a main and standby network; releasing a live channel and configuring input source information through a background management system; the streaming media controller adopts a main and standby hot standby mechanism and controls the receiving and recording task controller to start or stop the live broadcast receiving and recording task through an API (application program interface); when the receiving and recording task controller starts the live broadcast receiving and recording task, receiving and recording and distributively storing an accessed live broadcast encoder code stream, and sending heartbeat message information to the streaming media controller at regular time; and the streaming media controller monitors the states of all live broadcast receiving and recording tasks and performs distributed storage on the state data of the live broadcast receiving and recording tasks. The invention also provides a system for the streaming media live broadcast recording redundancy hot standby. By implementing the technical scheme provided by the invention, the quick redundant hot standby can be realized, the efficiency is improved, and the cost is reduced.
Description
Technical Field
The invention relates to the technical field of streaming media processing, in particular to a method and a system for live-broadcast recording redundancy hot standby of streaming media.
Background
With the vigorous development of internet live broadcast, more and more live broadcast platforms begin to emerge, such as internet televisions, internet radios and the like, and users can conveniently play remote live broadcast contents, such as events, conferences, teaching, operations and the like, in real time without visiting the scene through a play terminal provided by the live broadcast platform. The need for live recording has become more widespread, whether due to regulatory, content review requirements, or in order to enable time shifting and review directly at a later time.
However, an effective live broadcast recording redundancy hot standby technical scheme is not provided in the current live broadcast platform. The main reason is that the central server has limited bandwidth and storage capacity, and is likely to become a bottleneck of the whole network service when thousands of users are served, especially when a large number of users request to instantly get in. The most common existing streaming media transmission technical means is to use a single server to record a plurality of channels fixedly, and because a redundant hot standby mode is not supported, when one recording and broadcasting server fails or goes down, the whole service is interrupted, and manual switching to another recording and broadcasting server with cold backup is required, so that the service interruption time is long, and the data transmission efficiency and the terminal user experience are affected greatly.
The existing live broadcast recording and backup method usually adopts a dual-computer hot standby mode, that is, the standby device will record the streaming media data copy which is completely the same as the main device, resulting in a large amount of redundant storage, wasting limited storage resources and storage I/O (input/output) access bandwidth, and also obviously reducing the read-write performance and service concurrency of the whole system; in addition, the additional disk read-write operations also damage the disk life, and further reduce the MTBF (mean time between failure) of the server, and indirectly increase the hardware cost of the whole system.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a technical scheme for supporting the live streaming, recording and redundancy hot standby, so that the rapid redundancy hot standby is realized, the system failure and the service interruption time after downtime are reduced, the live streaming, recording and redundancy hot standby efficiency is improved, and the hardware occupied resources and cost are reduced.
In order to solve the above technical problems, an embodiment of the present invention provides a method for supporting live streaming recording redundancy hot standby, including:
synchronously inputting the code stream coded by the live broadcast coder into a main network and a standby network in a port level backup mode;
releasing a live channel and configuring input source information through a background management system;
the streaming media controller adopts a main and standby redundancy mechanism, creates a live broadcast receiving and recording task according to the live broadcast channel and the input source information, and provides a virtual IP access mode for external equipment;
the streaming media controller controls the receiving and recording task controller to start or stop the live broadcast receiving and recording task through the API;
when the receiving and recording task controller starts the live broadcasting receiving and recording task, receiving and recording and distributively storing live broadcasting code streams of live broadcasting encoders accessed by a main network and a standby network, and sending heartbeat message information to the streaming media controller at regular time;
and the streaming media controller monitors the states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and performs distributed storage on the state data of the live broadcast receiving and recording tasks.
Further, when the receiving and recording task controller starts the live receiving and recording task, the method further includes:
detecting whether the current live channel list is empty;
if so, recording and storing the streaming media accessed by the main network and the standby network in a distributed manner;
if not, loading the existing playlist file of the current live channel catalog, reserving the completed section, starting to receive the streaming media data accessed by the main network and the standby network for continuous section, and setting a label of the newly added section on the playlist file.
Further, the method for live recording and redundant hot standby of streaming media further comprises:
when a node where a main device in the streaming media controller is located fails, switching the streaming media controller to a standby device inside the streaming media controller to work;
loading task information data recorded by a main device in the streaming media controller from a distributed storage;
monitoring and detecting the states of all current live broadcast receiving and recording tasks; and when the heartbeat message information does not exist in the live broadcast receiving and recording task and the feedback information is not received after the heartbeat message information is inquired for multiple times, the live broadcast receiving and recording task is retransmitted to the receiving and recording task controller.
Preferably, the method for live recording and redundant hot standby of streaming media further includes:
when receiving a live broadcast request sent by a broadcast terminal, the source server searches data recorded in a live broadcast channel corresponding to the live broadcast request according to a local storage path, dynamically generates a playlist file, and returns the playlist file to the broadcast terminal.
Further, the method for live recording and redundant hot standby of streaming media further comprises:
configuring the channel and program parameters of live broadcast recording, and generating a live broadcast address for a broadcast terminal through an API (application programming interface);
and the playing terminal requests the live broadcast address, starts downloading the slice file according to the index of the playlist file, and plays the streaming media of the live-recorded channel based on the HLS protocol.
On the other hand, an embodiment of the present invention further provides a system for live streaming recording redundant hot standby, including:
the live broadcast encoder is used for outputting live broadcast streaming media to be recorded;
the main network and the standby network are used for synchronously inputting the code stream coded by the live broadcast coder into the main network and the standby network in a port level backup mode;
the background management system is used for releasing the live channel and configuring input source information;
the streaming media controller adopting a main and standby redundancy mechanism is used for creating a live broadcast receiving and recording task according to the live broadcast channel and the input source information and providing a virtual IP access mode for external equipment;
the receiving and recording task controller is used for receiving a control signal of the streaming media controller through an API (application program interface) and starting or stopping a live broadcast receiving and recording task;
the receiving and recording task controller is also used for receiving and recording and storing the live broadcast code streams of the live broadcast encoders accessed by the main network and the standby network in a distributed manner when the live broadcast receiving and recording task is started, and sending heartbeat message information to the streaming media controller at regular time;
the streaming media controller is further configured to monitor states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and perform distributed storage on state data of the live broadcast receiving and recording tasks;
and the distributed memory is used for storing the data recorded by the receiving and recording task controller and the streaming media controller.
Further, the listing task controller is further configured to:
detecting whether the current live channel list is empty; if so, recording and storing the streaming media accessed by the main network and the standby network in a distributed manner; if not, loading the existing playlist file of the current live channel catalog, reserving the completed section, starting to receive the streaming media data accessed by the main network and the standby network for continuous section, and setting a label of the newly added section on the playlist file.
Further, the system for live streaming recording and redundant hot standby also comprises:
the streaming media controller adopting the main and standby redundancy mechanism comprises main equipment and standby equipment;
the standby equipment is used for taking over the main equipment of the streaming media controller to work when the node where the main equipment in the streaming media controller is located fails;
the standby equipment is also used for loading task information data recorded by the main equipment in the streaming media controller from a distributed storage; monitoring and detecting the states of all current live broadcast receiving and recording tasks; and when the heartbeat message information does not exist in the live broadcast receiving and recording task and the feedback information is not received after the heartbeat message information is inquired for multiple times, the live broadcast receiving and recording task is retransmitted to the receiving and recording task controller.
Further, the system for live recording and redundant hot standby of streaming media further comprises: a source server and a play terminal;
and the source server is used for searching data recorded in a live broadcast channel corresponding to the live broadcast request according to a local storage path when receiving the live broadcast request sent by the broadcast terminal, dynamically generating a playlist file, and returning the playlist file to the broadcast terminal.
Preferably, the system for live recording and redundant hot standby of streaming media further includes:
the background management system is also used for configuring the channel and program parameters of live broadcast recording and generating a live broadcast address for the broadcast terminal through the API;
and the playing terminal is used for requesting the live broadcast address, starting to download the slice file according to the index of the playlist file, and playing the streaming media of the live-recorded channel based on the HLS protocol.
The technical scheme for live-broadcasting, recording and redundancy hot standby of the streaming media provided by the embodiment of the invention overcomes the defects of the prior art, fully utilizes the resources of the prior streaming media server, realizes quick redundancy hot standby under the conditions of not additionally increasing the servers and reducing unnecessary redundancy storage space, and reduces the time (controlled within 2 seconds) for service interruption after system failure and downtime. In the technical scheme provided by the invention, the receiving and recording task controller and the streaming media controller can be deployed on the streaming media server, a special recording server or a special control server is not needed, and the hardware resources and the construction cost of the system are reduced; in addition, in order to ensure that the receiving and recording tasks are issued to continue to operate under the condition that the streaming media controller fails or a server where the streaming media controller is down and the like, the newly issued receiving and recording tasks can also continue to be received, and the streaming media controller adopts a main and standby redundancy mechanism to perform distributed storage on the state data of the live broadcast receiving and recording tasks; in addition, the streaming media recorded when the live recording task is started also adopt distributed storage, so that load balancing scheduling among a plurality of media servers can be easily realized, and meanwhile, the recording task can be dynamically issued to a relatively idle streaming media server, thereby facilitating the infinite expansion of the storage capacity increased along with the service volume.
Drawings
Fig. 1 is a flowchart illustrating steps of a method for redundant hot standby of live streaming recording according to an embodiment of the present invention.
Fig. 2 is a schematic structural diagram of an embodiment of a system for live streaming recording redundant hot standby provided by the present invention.
FIG. 3 is a flow diagram of the steps of one implementation of initiating a listing task provided by the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
Referring to fig. 1, a flowchart of steps of a method for live streaming recording redundant hot standby according to an embodiment of the present invention is shown. Fig. 2 is a schematic structural diagram of an embodiment of a system for live streaming recording redundant hot standby according to the present invention.
In this embodiment, the method for live recording and redundant hot standby of streaming media mainly includes the following six steps:
step S1: the code stream coded by the live broadcast encoder 100 is accessed to the main network 201 and the standby network 202 in a port-level backup mode;
step S2: publishing live channels and configuring input source information through a background management system 300;
step S3: the streaming media controller 400 creates a live broadcast receiving and recording task according to the live broadcast channel and the input source information by using a main and standby redundancy mechanism, and provides a virtual IP access mode for external equipment;
step S4: the streaming media controller 400 controls the receiving and recording task controller 500 to start or stop the live receiving and recording task through the API interface;
step S5: when the receiving and recording task controller 500 starts the live receiving and recording task, receiving and distributively storing the live code stream of the live encoder accessed by the main network 201 and the standby network 202, and regularly sending heartbeat message information to the streaming media controller 400;
step S6: the streaming media controller 400 monitors the states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and performs distributed storage on the state data of the live broadcast receiving and recording tasks. And when the streaming media controller detects that the live receiving and recording tasks of one or more live channels are interrupted or failed, searching out a relatively idle node and re-issuing the live receiving and recording tasks corresponding to the live channels.
Corresponding to the method for live streaming recording redundancy hot standby provided by the embodiment, the embodiment of the invention also provides a system for live streaming recording redundancy hot standby, which comprises the following steps:
a live encoder 100, configured to output a live streaming media to be recorded; in order to ensure that a single point of failure does not occur in an input source, the live encoder 100 needs to support a port-level backup and N + M redundant backup mechanism, so that when a currently used live encoder fails or goes down, a standby live encoder can be automatically switched to output a backup stream. As shown in fig. 2, the live encoder 100 is at least provided with a main live encoder 101 and a standby live encoder 102, so as to implement dual-machine backup of streaming media data. In this embodiment, the port-level backup refers to that the live encoder 100 uses a plurality of (e.g., 2) network interfaces for binding to implement port-level backup, and the purpose of the port-level backup is to implement more complete data backup; and the N + M redundant backup refers to a backup mechanism between multiple live encoders and multiple networks.
The main network 201 and the standby network 202 are used for accessing the live broadcast code stream of the live broadcast encoder through the network interfaces respectively bound, and performing real-time backup on the live broadcast stream media to be recorded through the standby network 202.
And the background management system 300 is used for publishing the live channel and configuring the input source information.
The streaming media controller 400 adopting the main/standby redundancy mechanism is configured to create a live broadcast receiving and recording task according to the live broadcast channel and the input source information, and provide a virtual IP access manner for the external device, so that the external device can normally access when the main/standby is switched.
A receiving and recording task controller 500, configured to receive a control signal of the streaming media controller 400 through an API interface, and start or stop a live receiving and recording task;
the receiving and recording task controller 500 is further configured to receive, record and store in a distributed manner streaming media accessed by the main network 201 and the standby network 202 when the live receiving and recording task is started, and send heartbeat message information to the streaming media controller 400 at regular time.
The streaming media controller 400 is further configured to monitor states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and perform distributed storage on state data of the live broadcast receiving and recording tasks.
A distributed memory 600 for storing data recorded by the receiving and recording task controller 500 and the streaming media controller 400.
When a node where a main device 401 in the streaming media controller 400 is located fails, switching the streaming media controller to a standby device 402 inside the streaming media controller to work; loading task information data recorded by the master device 401 in the streaming media controller 400 from a distributed storage 600; monitoring and detecting the states of all current live broadcast receiving and recording tasks; when it is found that there is no heartbeat message information in the live broadcast receiving and recording task and no feedback information is received after multiple queries, the live broadcast receiving and recording task is re-issued to the receiving and recording task controller 500.
In this embodiment, the Live broadcast encoder 100 sends a program source with the same multicast output content to the main network 201 and the standby network 202 through multiple protocols such as UDP (User data program, User Datagram Protocol), which are configured as primary and standby redundant bindings, to avoid a single point failure of the networks, and outputs the streaming media data subjected to the redundant hot standby to the playing terminal 800 through hls (http Live streaming) Protocol for playing. The HLS is a streaming media transmission protocol based on HTTP, is widely applied between a streaming media server and a client (mainly applied to an iOS terminal and an android terminal), and can realize live broadcast, time shifting, review and on-demand playing of streaming media.
A user can create and release a live broadcast channel through a management page of the background management system 300, configure a multicast address and a port of an input source, and set options such as whether to open a review recording or not, and the background management system 300 will issue a created live broadcast receiving and recording task to the streaming media controller 400 through an HTTP REST (Representational State Transfer) API (Application programming interface) interface; meanwhile, a live broadcast URL (Uniform resource locator) broadcast address may be acquired from the streaming media controller 400 through the API interface, so as to be provided to the broadcast terminal 800 for access.
In specific implementation, the streaming media controller 400 may provide a function of starting, stopping, or restarting a channel live broadcast receiving and recording task by using an HTTP protocol and a REST API interface. After the receiving and recording tasks are started, the receiving and recording task controller 500 needs to send heartbeat message information to the streaming media controller 400 at regular time, and meanwhile, the streaming media controller 400 can also actively inquire the state information of all the receiving and recording tasks, and under the condition that the receiving and recording tasks are interrupted or failed, find out a relatively idle node according to an optimized algorithm, and resend the receiving and recording tasks of the channel.
In this embodiment, the streaming media controller 400 mainly provides management of the receiving and recording tasks, including issuing, status monitoring, load balancing of tasks at each node, and the like, and may be deployed on an existing streaming media server, and in order to ensure that the receiving and recording tasks that have been issued continue to run when the streaming media controller fails or the server where the receiving and recording tasks are down occurs, and the like, the newly issued receiving and recording tasks may also continue to be received, and the streaming media controller 400 needs to be deployed to two servers for main and standby redundancy.
As shown in fig. 2, the streaming media controller 400 adopting the main/standby redundancy mechanism includes a main device 401 and a standby device 402. The streaming media controller may adopt various technologies (such as keepalived technology) to realize support of its own master and slave devices, and only provides a virtual IP mode to access the external device. Keepalived is a WEB service high availability scheme implemented based on VRRP (Virtual router redundancy Protocol), and can be used to avoid single point of failure. The streaming media controller 400 (including the main device 401 and the standby device 402) needs to record data such as the receiving and recording task states of all channels, and store the data in the distributed storage disk, so that when a node where the main device 401 is located fails or crashes, and then switches to a node of the standby device 402, the situation of all receiving and recording tasks can be continuously monitored and managed, assuming that a part of the receiving and recording tasks are also running when the node where the main device 401 is located fails, after the main and standby switches, the standby device 402 needs to load task information data recorded by the main device 401 from the distributed storage 600 again, detect the states of all the receiving and recording tasks, and need to coordinate and send the receiving and recording tasks again when a failure or an interruption occurs.
The standby device 402 is configured to take over the main device 401 of the streaming media controller 400 to work when a node where the main device 401 in the streaming media controller 400 is located fails;
the standby device 402 is further configured to load data recorded by the main device 401 in the streaming media controller 400 from the distributed storage 600; detecting the states of all live broadcast receiving and recording tasks at present; and when the live recording task is interrupted, re-issuing the live recording task to the recording task controller 500.
Further, the listing task controller 500 is further configured to:
detecting whether the current live channel list is empty; if yes, recording and distributively storing the streaming media accessed by the main network 201 and the standby network 202, and regularly sending heartbeat message information to the streaming media controller 400; if not, loading the playlist file existing in the current live channel directory, reserving the completed slices, starting to receive streaming media data accessed by the main network 201 and the standby network 202 for continuous slicing, and setting a tag of a newly added slice on the playlist file.
Referring to fig. 3, a flowchart of steps of one implementation of initiating a listing task is provided.
Specifically, after the recording task is started, if the current live channel directory is found to be empty, stream media recording is performed according to a first starting mode; if it is detected that there are remaining playlist file box slices in the current directory, which indicates that the current directory is a re-issued recording task, at this time, an existing playlist file, such as an index file in an M3U8 format, needs to be loaded first, all completed slices are retained, and then input data is received from the live encoder 100, and the slices are continued; the serial number of the slice is continuously increased on the basis of the existing serial number, and the index file in the M3U8 format needs to add a corresponding tag (e.g., an EXT-X-disconnect tag) according to the protocol of the HLS to distinguish each slice. Practical tests prove that the data lost in the hot handover can be controlled within 2 seconds, and the influence on the service is basically avoided.
Further, the system for live recording and redundant hot standby of streaming media further comprises: an origin server 700 and a cast terminal 800. In specific implementation, the source server 700 of the streaming media is a device in one or more source server clusters 1 to N, and mainly provides on-demand push of live broadcast, time shift, and on-demand playback of recorded code streams, and may be deployed on the same or different streaming media servers together with the recording task controller 500. In addition, the source server 700 is configured to, when receiving a live broadcast request sent by the broadcast terminal 800, find data recorded in a live broadcast channel corresponding to the live broadcast request according to a local storage path, dynamically generate a playlist file (for example, an index file with M3U8 as a format suffix), and return the playlist file to the broadcast terminal 800.
In addition, the background management system 300 is further configured to configure parameters of a channel and a program recorded in a live broadcast, and generate a live broadcast address for the broadcast terminal 800 through an API interface;
the playing terminal 800 is configured to request the live broadcast address, start downloading a slice file according to an index of a playlist file, and play a streaming media of a live-recorded channel based on an HLS protocol.
In this embodiment, the receiving and recording task controller 500 needs to establish a heartbeat mechanism with the streaming media controller 400 to monitor the execution state of the receiving and recording task in real time; furthermore, after the streaming media controller 400 switches to the standby node 402 due to a failure, a software mechanism is required to re-establish the heartbeat link.
The distributed storage needs to be mounted to the local directories of all the streaming media servers, and recording paths are not allocated to the on-demand data and the live data respectively. For example, if the "/media" is used as a virtual root directory, the "/media/vod" directory may store on-demand data, and the "/media/live" directory may be used to store live data. And the path structure of live recording can be defined as: "root directory: media/live, live channel path channel [ n ] "; the directory structure of the live listings is defined as: a subdirectory under "/media/live/channel [ n ]/". The slice filename rule definition may be performed according to a specific streaming media transport protocol, and the slice segmentation duration is preferably 10 seconds.
When the broadcast terminal 800 requests a live broadcast address, the background management system 300 configures parameters of a channel and a program recorded in live broadcast, and generates a live broadcast address for the broadcast terminal 800 through an API interface, for example, the format of the broadcast address may be: http:// streaming _ domain/live/chan [ n ]/planylist.m3u8.
In the present embodiment, it is assumed that the play request has been sent to all the source servers 700 in the cluster, and the case of the edge server is not considered. In a specific actual live broadcast platform system, the source server 700 of the cluster redirects the request of the broadcast terminal 800 to one of the source servers through a load balancing technique, and the source server finds the data recorded in the live broadcast channel according to the path definition rule, dynamically generates an index file with M3U8 as a suffix, and returns the index file to the broadcast terminal 800. The playing terminal 800 starts downloading the slice file according to the index of the M3U8 file, and starts the playing flow of the streaming media based on the HLS protocol in a sliding window manner.
The technical scheme for live-broadcasting, recording and redundancy hot standby of the streaming media provided by the embodiment of the invention overcomes the defects of the prior art, fully utilizes the resources of the prior streaming media server, realizes quick redundancy hot standby under the conditions of not additionally increasing the servers and reducing unnecessary redundancy storage space, and reduces the time (controlled within 2 seconds) for service interruption after system failure and downtime. In the technical scheme provided by the invention, the receiving and recording task controller and the streaming media controller can be deployed on the streaming media server, a special recording server or a special control server is not needed, and the hardware resources and the construction cost of the system are reduced; in addition, in order to ensure that the receiving and recording tasks are issued to continue to operate under the condition that the streaming media controller fails or a server where the streaming media controller is down and the like, the newly issued receiving and recording tasks can also continue to be received, and the streaming media controller adopts a main and standby redundancy mechanism to perform distributed storage on the state data of the live broadcast receiving and recording tasks; in addition, the streaming media recorded when the live recording task is started also adopt distributed storage, so that load balancing scheduling among a plurality of media servers can be easily realized, and meanwhile, the recording task can be dynamically issued to a relatively idle streaming media server, thereby facilitating the infinite expansion of the storage capacity increased along with the service volume.
By implementing the technical scheme provided by the invention, a redundant hot standby mechanism can be provided to ensure that the service is not interrupted for a long time when any one of the links and equipment of the main network, the standby network, the live broadcast streaming media input source, the receiving and recording task controller, the source server, the streaming media controller and the like fails. The invention does not need to adopt a special live broadcast receiving and recording server, saves the cost of the server, and saves the investment of storage because the live broadcast redundant copies are not recorded, thereby saving the investment cost of the whole system. In addition, with the great increase of the traffic, the system can be easily extended seamlessly by using the method and the system, and the service of the existing service is not influenced.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (10)
1. A method for redundant hot standby of live recording of streaming media is characterized by comprising the following steps:
the method comprises the steps that through a port level backup mode, streaming media coded by a live broadcast coder are synchronously input into a main network and a standby network, and the port level backup adopts two network interfaces for binding so as to realize port level backup;
releasing a live channel and configuring input source information through a background management system;
the streaming media controller adopts a main and standby redundancy mechanism, creates a live broadcast receiving and recording task according to the live broadcast channel and the input source information, and provides a virtual IP access mode for external equipment;
the streaming media controller controls the receiving and recording task controller to start or stop the live broadcast receiving and recording task through the API;
when the receiving and recording task controller starts the live receiving and recording task, receiving and recording and distributively storing the streaming media accessed by the main network and the standby network, and sending heartbeat message information to the streaming media controller at regular time;
and the streaming media controller monitors the states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and performs distributed storage on the state data of the live broadcast receiving and recording tasks.
2. The method for redundant hot standby for live streaming recording of streaming media according to claim 1, wherein when the receiving task controller starts the live receiving task, the method further comprises:
detecting whether the current live channel list is empty;
if so, recording and storing the streaming media accessed by the main network and the standby network in a distributed manner;
if not, loading the existing playlist file of the current live channel catalog, reserving the completed section, starting to receive the streaming media accessed by the main network and the standby network for continuous section, and setting a label of the newly added section on the playlist file.
3. The method for redundant hot standby for live streaming of streaming media as claimed in claim 1, wherein the method further comprises:
when a node where a main device in the streaming media controller is located fails, switching the streaming media controller to a standby device inside the streaming media controller to work;
loading task information data recorded by a main device in the streaming media controller from a distributed storage;
monitoring and detecting the states of all current live broadcast receiving and recording tasks; and when the heartbeat message information does not exist in the live broadcast receiving and recording task and the feedback information is not received after the heartbeat message information is inquired for multiple times, the live broadcast receiving and recording task is retransmitted to the receiving and recording task controller.
4. The method for redundant hot standby for live streaming of streaming media as claimed in claim 1, wherein the method further comprises:
when a source server receives a live broadcast request sent by a broadcast terminal, searching data recorded by a live broadcast channel corresponding to the live broadcast request according to a local storage path, dynamically generating a playlist file, and returning the playlist file to the broadcast terminal;
and the playing terminal requests the live broadcast address, starts downloading the slice file according to the index of the playlist file, and plays the streaming media of the live-recorded channel based on the HLS protocol.
5. The method for redundant hot standby for live streaming of streaming media as claimed in claim 4, wherein the method further comprises:
and configuring the channel and program parameters of live broadcast recording, and generating a live broadcast address for the broadcast terminal through an API (application programming interface).
6. A system for redundant hot standby of live streaming recording is characterized by comprising:
the live broadcast encoder is used for outputting live broadcast streaming media to be recorded;
the main network and the standby network are used for synchronously inputting the streaming media coded by the live broadcast coder into the main network and the standby network in a port level backup mode, and the port level backup adopts two network interfaces for binding so as to realize port level backup;
the background management system is used for releasing the live channel and configuring input source information;
the streaming media controller adopting a main and standby redundancy mechanism is used for creating a live broadcast receiving and recording task according to the live broadcast channel and the input source information and providing a virtual IP access mode for external equipment;
the receiving and recording task controller is used for receiving a control signal of the streaming media controller through an API (application program interface) and starting or stopping a live broadcast receiving and recording task;
the receiving and recording task controller is further configured to receive, record and store in a distributed manner streaming media accessed by a main network and a standby network when the live receiving and recording task is started, and send heartbeat message information to the streaming media controller at regular time;
the streaming media controller is further configured to monitor states of all live broadcast receiving and recording tasks through active query or according to the heartbeat message information, and perform distributed storage on state data of the live broadcast receiving and recording tasks;
and the distributed memory is used for storing the data recorded by the receiving and recording task controller and the streaming media controller.
7. The system of redundant hot standby for live streaming of media as claimed in claim 6, wherein said listing task controller is further configured to:
detecting whether the current live channel list is empty; if so, recording and storing the streaming media accessed by the main network and the standby network in a distributed manner; if not, loading the existing playlist file of the current live channel catalog, reserving the completed section, starting to receive the streaming media accessed by the main network and the standby network for continuous section, and setting a label of the newly added section on the playlist file.
8. The system for redundant hot standby for live streaming of media as claimed in claim 6,
the streaming media controller adopting the main and standby redundancy mechanism comprises main equipment and standby equipment;
the standby equipment is used for taking over the main equipment of the streaming media controller to work when the node where the main equipment in the streaming media controller is located fails;
the standby equipment is also used for loading task information data recorded by the main equipment in the streaming media controller from a distributed storage; monitoring and detecting the states of all current live broadcast receiving and recording tasks; and when the heartbeat message information does not exist in the live broadcast receiving and recording task and the feedback information is not received after the heartbeat message information is inquired for multiple times, the live broadcast receiving and recording task is retransmitted to the receiving and recording task controller.
9. The system for redundant hot standby for live streaming recording of claim 6, further comprising: a source server and a play terminal;
the source server is used for searching data recorded in a live broadcast channel corresponding to a live broadcast request according to a local storage path when receiving the live broadcast request sent by the broadcast terminal, dynamically generating a playlist file, and returning the playlist file to the broadcast terminal;
and the playing terminal is used for requesting the live broadcast address, starting to download the slice file according to the index of the playlist file, and playing the streaming media of the live-recorded channel based on the HLS protocol.
10. The system for redundant hot standby for live streaming of media as claimed in claim 9,
the background management system is also used for configuring the channel and program parameters of live broadcast recording and generating a live broadcast address for the broadcast terminal through the API.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611179975.0A CN106656593B (en) | 2016-12-19 | 2016-12-19 | Method and system for streaming media live broadcast recording redundancy hot standby |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611179975.0A CN106656593B (en) | 2016-12-19 | 2016-12-19 | Method and system for streaming media live broadcast recording redundancy hot standby |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106656593A CN106656593A (en) | 2017-05-10 |
CN106656593B true CN106656593B (en) | 2020-04-14 |
Family
ID=58833880
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611179975.0A Active CN106656593B (en) | 2016-12-19 | 2016-12-19 | Method and system for streaming media live broadcast recording redundancy hot standby |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106656593B (en) |
Families Citing this family (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107426021A (en) * | 2017-07-19 | 2017-12-01 | 北京锐安科技有限公司 | Construction method, device and the redundant system of redundant system |
CN109428864B (en) * | 2017-08-30 | 2021-11-09 | 武汉斗鱼网络科技有限公司 | Method and device for improving quality of nginx-rtmp pull flow service |
CN107734350B (en) * | 2017-09-25 | 2020-11-03 | 上海幻电信息科技有限公司 | Live broadcasting system and live broadcasting method |
CN108012161B (en) * | 2017-11-10 | 2021-10-01 | 广州华多网络科技有限公司 | Video live broadcast method, system and terminal equipment |
CN110602545A (en) * | 2019-09-26 | 2019-12-20 | 杭州米络星科技(集团)有限公司 | Distributed recording execution method for network live broadcast |
CN111031341A (en) * | 2019-11-20 | 2020-04-17 | 杭州当虹科技股份有限公司 | Heartbeat-based dual-computer hot standby method |
CN111026585B (en) * | 2019-12-05 | 2023-03-17 | 四川湖山电器股份有限公司 | Storage server hot standby switching method in recording and broadcasting system |
CN111083521B (en) * | 2019-12-27 | 2022-02-01 | 杭州当虹科技股份有限公司 | RTMP release main/standby fast switching method |
CN114143569B (en) * | 2021-11-18 | 2024-02-27 | 聚好看科技股份有限公司 | Webpage recording and live broadcasting method and system |
CN114422717B (en) * | 2021-12-06 | 2024-01-05 | 新奥特(北京)视频技术有限公司 | Method and device for managing and controlling rebroadcast recording on cloud, electronic equipment and storage medium |
CN115314733A (en) * | 2022-08-05 | 2022-11-08 | 京东方智慧物联科技有限公司 | Data display system, method, electronic device and storage medium |
CN116016467A (en) * | 2022-12-14 | 2023-04-25 | 苏州华启智能科技有限公司 | Train network optimization method, system and storage medium based on streaming media application |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101068155A (en) * | 2006-09-20 | 2007-11-07 | 腾讯科技(深圳)有限公司 | Coordinate connection stream media direct broadcasting system and collection server thereof |
CN101729794A (en) * | 2008-10-11 | 2010-06-09 | 华为技术有限公司 | Method, device and system for realizing live broadcast and live broadcast pretreatment |
CN102523480A (en) * | 2011-12-08 | 2012-06-27 | 成都东方盛行电子有限责任公司 | Recording system and method based on active-standby and cache technology |
CN105744290A (en) * | 2016-01-27 | 2016-07-06 | 观止云(北京)信息技术有限公司 | HLS hot standby method |
CN105872614A (en) * | 2016-04-12 | 2016-08-17 | 乐视控股(北京)有限公司 | Live stream switching method and device |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2006047732A2 (en) * | 2004-10-27 | 2006-05-04 | Eg Technology, Inc. | Network architecture for real time delivery of video over lossy networks from remote locations |
-
2016
- 2016-12-19 CN CN201611179975.0A patent/CN106656593B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101068155A (en) * | 2006-09-20 | 2007-11-07 | 腾讯科技(深圳)有限公司 | Coordinate connection stream media direct broadcasting system and collection server thereof |
CN101729794A (en) * | 2008-10-11 | 2010-06-09 | 华为技术有限公司 | Method, device and system for realizing live broadcast and live broadcast pretreatment |
CN102523480A (en) * | 2011-12-08 | 2012-06-27 | 成都东方盛行电子有限责任公司 | Recording system and method based on active-standby and cache technology |
CN105744290A (en) * | 2016-01-27 | 2016-07-06 | 观止云(北京)信息技术有限公司 | HLS hot standby method |
CN105872614A (en) * | 2016-04-12 | 2016-08-17 | 乐视控股(北京)有限公司 | Live stream switching method and device |
Also Published As
Publication number | Publication date |
---|---|
CN106656593A (en) | 2017-05-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106656593B (en) | Method and system for streaming media live broadcast recording redundancy hot standby | |
US6970939B2 (en) | Method and apparatus for large payload distribution in a network | |
US9143452B2 (en) | Data processing | |
CN100518305C (en) | A content distribution network system and content and service scheduling method thereof | |
EP2901308B1 (en) | Load distribution in data networks | |
CN100525288C (en) | Method and apparatus for large payload distribution in network | |
EP2227016B1 (en) | A content buffering, querying method and point-to-point media transmitting system | |
EP3729784B1 (en) | Methods and apparatus for delivering content | |
US8984382B2 (en) | Distributed data distribution | |
EP4342163B1 (en) | Broker cell for distributed message system | |
CN116455920A (en) | Data storage method, system, computer equipment and storage medium | |
WO2012046585A1 (en) | Distributed storage system, method of controlling same, and program | |
Lin et al. | A fault-tolerant ONVIF protocol extension for seamless surveillance video stream recording | |
US20140195691A1 (en) | Method, system and media server for creating multicast channel | |
KR100751075B1 (en) | Remote mirroring system using parallel transmission technology on NAS | |
CN119652739B (en) | Master-slave hot standby scheduling method, system and storage medium of universal management gateway | |
CN114338626B (en) | Streaming media playback system, method, device, equipment and readable storage medium | |
JP2011191907A (en) | Data distribution system, load balancing method and storage server | |
CN119211587A (en) | Network live broadcast method, device, electronic device and non-volatile storage medium | |
CN119828975A (en) | Data access method and device, storage medium and electronic equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |