[go: up one dir, main page]

CN105450551B - A kind of method and download server for downloading live stream - Google Patents

A kind of method and download server for downloading live stream Download PDF

Info

Publication number
CN105450551B
CN105450551B CN201510883313.0A CN201510883313A CN105450551B CN 105450551 B CN105450551 B CN 105450551B CN 201510883313 A CN201510883313 A CN 201510883313A CN 105450551 B CN105450551 B CN 105450551B
Authority
CN
China
Prior art keywords
thread
downloading task
live stream
downloading
download
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201510883313.0A
Other languages
Chinese (zh)
Other versions
CN105450551A (en
Inventor
王恒
陈正超
周平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guiyang Longmaster Information and Technology Co ltd
Original Assignee
Guiyang Longmaster Information and Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guiyang Longmaster Information and Technology Co ltd filed Critical Guiyang Longmaster Information and Technology Co ltd
Priority to CN201510883313.0A priority Critical patent/CN105450551B/en
Publication of CN105450551A publication Critical patent/CN105450551A/en
Application granted granted Critical
Publication of CN105450551B publication Critical patent/CN105450551B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/70Admission control; Resource allocation
    • H04L47/80Actions related to the user profile or the type of traffic
    • H04L47/801Real time traffic
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/65Network streaming protocols, e.g. real-time transport protocol [RTP] or real-time control protocol [RTCP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware
    • H04N21/231Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
    • H04N21/23103Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion using load balancing strategies, e.g. by placing or distributing content on different disks, different memories or different servers

Landscapes

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

Abstract

The invention discloses a kind of method and download server for downloading live stream, shown method includes: that main thread receives live stream downloading request, adds live stream downloading task in the task list safeguarded to downloading task distribution thread;Downloading task distributes thread, and there are when live stream downloading task in discovery task list, live stream downloading task is taken out from task list, it checks in safeguarded idle thread list with the presence or absence of idle download thread, if there is idle download thread, the live stream downloading task that idle download thread processing is taken out then is distributed, the downloading that live stream downloading task is broadcast live stream is executed by the idle download thread distributed.The present invention can satisfy user to the downloading demand of live stream, and can download multiple live streaming audio-videos simultaneously.

Description

A kind of method and download server for downloading live stream
Technical field
The present invention relates to the audio and video technology of internet, espespecially a kind of method and download server for downloading live stream.
Background technique
Real-time messages transport protocol (Real Time Messaging Protocol, RTMP) is the live stream of present mainstream Agreement.As RTMP is widely used, the downloading demand of live stream is consequently increased.
Current application and video website can only download the audio-video document recorded, not support live streaming audio-video Download function, user be only capable of using record screen or recording software record.
Summary of the invention
In order to solve the above-mentioned technical problems, the present invention provides a kind of method and download server for downloading live stream, energy It enough supports the downloading of audio-video live stream and supports multiple channels while downloading.
In order to reach the object of the invention, the present invention provides a kind of methods for downloading live stream, comprising:
Main thread receives live stream downloading request, adds live stream in the task list safeguarded to downloading task distribution thread Downloading task;
Downloading task distribution thread in finding the task list there are when live stream downloading task, from described It is engaged in taking out live stream downloading task in list, checks and whether there is idle download thread in safeguarded idle thread list, If there is idle download thread, then the live stream downloading task that idle download thread processing is taken out is distributed, by what is distributed Idle download thread executes the downloading that live stream downloading task is broadcast live stream.
Further, the method also includes:
The downloading task distribution thread there is no when idle download thread in the idle thread list, work as by judgement Whether the total quantity of preceding download thread reaches number of threads threshold value, if not up to, creating the straight of download thread processing taking-up Broadcast stream downloading task.
Further, the method also includes:
Downloading task distribution thread if it is determined that the total quantity of current download thread reaches the number of threads threshold value, Waiting list then is added in the downloading task of taking-up, after the completion of waiting has live stream downloading task, distributes idle download thread It is handled.
Further, the downloading task distributes thread in the case where the initial stage live stream downloading task being not present, Download thread is not created, there are live stream downloading task and without download thread, just creates download thread.
Further, the live stream downloading task that the idle download thread processing of the distribution is taken out, comprising:
The downloading task distribution thread distributes a download thread and handles a live stream downloading task.
Further, a kind of download server, comprising: downloading task creating unit and downloading task allocation unit, in which:
The downloading task creating unit receives live stream downloading request for main control line journey, distributes to downloading task Live stream downloading task is added in the task list of thread maintenance;
The downloading task allocation unit, for controlling the downloading task distribution thread in finding the task list There are when live stream downloading task, live stream downloading task is taken out from the task list, checks safeguarded idle thread Idle download thread processing is then distributed if there is idle download thread with the presence or absence of idle download thread in list The live stream downloading task of taking-up executes live stream downloading task by the idle download thread distributed and is broadcast live under stream It carries.
Further, the downloading task allocation unit is also used to control the downloading task distribution thread in the sky There is no when idle download thread in idle thread list, judge whether the total quantity of current download thread reaches number of threads threshold Value, if not up to, creating the live stream downloading task that download thread processing is taken out.
Further, the downloading task allocation unit is also used to control the downloading task distribution thread and works as in judgement When the total quantity of preceding download thread reaches the number of threads threshold value, waiting list is added in the downloading task of taking-up, waiting has After the completion of live stream downloading task, distributes idle download thread and handled.
Further, the downloading task allocation unit is also used to control the downloading task distribution thread in initial rank Section does not create download thread, there are live stream downloading task and without downloading wire there is no in the case where live stream downloading task In the case where journey, download thread is just created.
Further, the downloading task allocation unit controls the idle downloading wire of the downloading task distribution thread distribution The live stream downloading task that journey processing is taken out, comprising:
It controls the downloading task distribution thread and distributes download thread one live stream downloading task of processing.
Compared with prior art, the present invention includes that main thread receives live stream downloading request, distributes thread to downloading task Live stream downloading task is added in the task list of maintenance;Downloading task distributes thread, and there are live streams in discovery task list When downloading task, live stream downloading task is taken out from task list, checking in safeguarded idle thread list whether there is Idle download thread is then distributed under the live stream that idle download thread processing is taken out if there is idle download thread Load task executes the downloading that live stream downloading task is broadcast live stream by the idle download thread distributed.The present invention can expire Sufficient user can download multiple live streaming audio-videos to the downloading demand of live stream simultaneously.
Other features and advantages of the present invention will be illustrated in the following description, also, partly becomes from specification It obtains it is clear that understand through the implementation of the invention.The objectives and other advantages of the invention can be by specification, right Specifically noted structure is achieved and obtained in claim and attached drawing.
Detailed description of the invention
Attached drawing is used to provide to further understand technical solution of the present invention, and constitutes part of specification, with this The embodiment of application technical solution for explaining the present invention together, does not constitute the limitation to technical solution of the present invention.
Fig. 1 is the flow chart of the method for downloading live stream of the invention;
Fig. 2 is the architecture diagram of the server of downloading live stream of the invention.
Specific embodiment
To make the objectives, technical solutions, and advantages of the present invention clearer, below in conjunction with attached drawing to the present invention Embodiment be described in detail.It should be noted that in the absence of conflict, in the embodiment and embodiment in the application Feature can mutual any combination.
Step shown in the flowchart of the accompanying drawings can be in a computer system such as a set of computer executable instructions It executes.Also, although logical order is shown in flow charts, and it in some cases, can be to be different from herein suitable Sequence executes shown or described step.
As shown in Figure 1, the method for downloading live stream of the invention, comprising:
Step 101: main thread receives live stream downloading request, adds in the task list safeguarded to downloading task distribution thread Add live stream downloading task;
Main thread is mainly the operation received after the completion of downloading request and processing downloading.
Step 102: downloading task distributes thread in discovery task list there are when live stream downloading task, arranges from task Live stream downloading task is taken out in table, is checked with the presence or absence of idle download thread in safeguarded idle thread list, if In the presence of idle download thread, then the live stream downloading task that idle download thread processing is taken out is distributed, by the free time distributed Download thread execute live stream downloading task and be broadcast live the downloading of stream.
Downloading task distributes thread and safeguards a task list and an idle thread list.
Main thread can add live stream downloading task into task list, when downloading task distribution thread discovery has live stream When downloading task, downloading task is taken out from task list, and check in idle thread list whether available free download thread, If available free download thread, an idle download thread is taken out for handling live stream downloading task.Under distribution It carries thread and executes the downloading that live stream downloading task completes live stream.
Download thread refers to the thread for handling live stream downloading task, such thread can have multiple.
Further, when downloading task distribution thread does not have idle download thread in viewing idle thread list, sentence Whether the total quantity for current download thread of breaking reaches number of threads threshold value, if not up to, creating download thread processing and taking out Live stream downloading task.
Further, downloading task distribution thread is if it is determined that the total quantity of current download thread reaches number of threads threshold value, Waiting list then is added in the downloading task of taking-up, after the completion of waiting has live stream downloading task, distributes idle download thread It is handled.
Downloading task distributes thread, and there is no idle download threads in viewing idle thread list, and judge to work as It when the total quantity of preceding download thread reaches the number of threads threshold value of restriction, then needs that other downloading tasks is waited to complete, wait empty Not busy download thread handles the task.
Further, downloading task distribution thread is not created in the case where the initial stage live stream downloading task being not present Download thread is built, there are live stream downloading task and without download thread, just creates download thread.
Download thread be not server one start initial stage be created that it is multiple, but after having downloading task Thread creation is distributed by downloading task.
The quantity limitation of download thread is related to server hardware, can be configured according to server hardware.
The creation rule of download thread is as follows:
1) after server starting, no downloading task, the quantity of download thread is zero;
2) when there is a downloading task, and do not have to create download thread when download thread;
3) when there is downloading task, the total quantity of idle download thread and download thread is not less than the number of threads limited When threshold value, download thread is created;
4) if there is downloading task, not no idle download thread, and the total quantity of download thread reaches the thread of restriction When amount threshold, waiting list is added in downloading task, is handled after waiting available free download thread.
Further, the live stream downloading task that the idle download thread processing of distribution of the invention is taken out, comprising: downloading is appointed Business distribution thread distributes a download thread and handles a live stream downloading task.
A download thread same period only handles a downloading task in the present invention.
The method of downloading live stream of the invention can apply need download live streaming audio-video various scenes in, such as into Website or audio-video chatroom of row live streaming etc..
For example, being applied to chatroom report recording.Since the same time might have multiple chatrooms in violation of rules and regulations, reported It needs to record the voice of the period afterwards, determines to handle chatroom after being audited by administrator.
Chatroom management server is responsible for creating chatroom, chat room members management and destroying chatroom etc..Chatroom wound When building, chatroom management server is that a direct broadcast band (address RTMP) is distributed in the chatroom of creation, and house-owner passes through straight Channels share audio-frequency information is broadcast, other members are listened to by the channel.
When there is user to think that chatroom live content is related to violation, the chatroom, the i.e. management of notice chatroom can be reported The server chatroom is related in violation of rules and regulations.After when chatroom, management server receives notice, notify under live stream download server Live content of the chatroom in some period is carried, the direct broadcast band (address RTMP) of the chatroom is carried in notice packet.
When live stream download server receives downloading task request, chatroom direct broadcast band is connected, chatroom is downloaded The live audio data for some period that management server requires.
Live stream download server is broadcast live the recording of audio data using the method for downloading live stream of the invention.Directly Broadcasting stream download server is multithreaded server, includes: main thread, downloading task distribution thread and multiple download threads.
As shown in Fig. 2, the present invention also provides a kind of download servers, comprising: downloading task creating unit and downloading are appointed Business allocation unit, in which:
The downloading task creating unit receives live stream downloading request for main control line journey, distributes to downloading task Live stream downloading task is added in the task list of thread maintenance;
The downloading task allocation unit, for controlling the downloading task distribution thread in finding the task list There are when live stream downloading task, live stream downloading task is taken out from the task list, checks safeguarded idle thread Idle download thread processing is then distributed if there is idle download thread with the presence or absence of idle download thread in list The live stream downloading task of taking-up executes live stream downloading task by the idle download thread distributed and is broadcast live under stream It carries.
Further, the downloading task allocation unit is also used to control the downloading task distribution thread in the free time There is no when idle download thread in thread list, judge whether the total quantity of current download thread reaches number of threads threshold Value, if not up to, creating the live stream downloading task that download thread processing is taken out.
Further, it is current in judgement to be also used to control the downloading task distribution thread for the downloading task allocation unit When the total quantity of download thread reaches the number of threads threshold value, waiting list is added in the downloading task of taking-up, waiting has straight After the completion of broadcasting stream downloading task, distributes idle download thread and handled.
Further, the downloading task allocation unit is also used to control the downloading task distribution thread in the initial stage There is no in the case where live stream downloading task, download thread is not created, there are live stream downloading task and without download thread In the case where, just create download thread.
Further, the downloading task allocation unit controls the idle download thread of the downloading task distribution thread distribution Handle the live stream downloading task taken out, comprising:
It controls the downloading task distribution thread and distributes download thread one live stream downloading task of processing.
Although disclosed herein embodiment it is as above, the content only for ease of understanding the present invention and use Embodiment is not intended to limit the invention.Technical staff in any fields of the present invention is taken off not departing from the present invention Under the premise of the spirit and scope of dew, any modification and variation, but the present invention can be carried out in the form and details of implementation Scope of patent protection, still should be subject to the scope of the claims as defined in the appended claims.

Claims (10)

1. a kind of method for downloading live stream characterized by comprising
Main thread receives live stream downloading request, addition live stream downloading in the task list safeguarded to downloading task distribution thread Task;
The downloading task distribution thread, there are when live stream downloading task, arranges in finding the task list from the task Live stream downloading task is taken out in table, is checked with the presence or absence of idle download thread in safeguarded idle thread list, if In the presence of idle download thread, then the live stream downloading task that idle download thread processing is taken out is distributed, by the free time distributed Download thread execute live stream downloading task and be broadcast live the downloading of stream.
2. the method according to claim 1, wherein the method also includes:
The downloading task distribution thread is there is no when idle download thread in the idle thread list, and judgement is when front lower Whether the total quantity for carrying thread reaches number of threads threshold value, if not up to, creating the live stream that download thread processing is taken out Downloading task.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
Downloading task distribution thread then will if it is determined that the total quantity of current download thread reaches the number of threads threshold value Waiting list is added in the downloading task of taking-up, after the completion of waiting has live stream downloading task, distributes idle download thread and carries out Processing.
4. according to the method in claim 2 or 3, it is characterised in that:
The downloading task distribution thread does not create downloading wire in the case where the initial stage live stream downloading task being not present Journey just creates download thread there are live stream downloading task and without download thread.
5. according to the method described in claim 4, it is characterized in that, the live streaming that the download thread processing of the distribution free time is taken out Flow downloading task, comprising:
The downloading task distribution thread distributes a download thread and handles a live stream downloading task.
6. a kind of download server characterized by comprising downloading task creating unit and downloading task allocation unit, in which:
The downloading task creating unit receives live stream downloading request for main control line journey, distributes thread to downloading task Live stream downloading task is added in the task list of maintenance;
The downloading task allocation unit exists in finding the task list for controlling the downloading task distribution thread When live stream downloading task, live stream downloading task is taken out from the task list, checks safeguarded idle thread list In then distribute idle download thread processing if there is idle download thread with the presence or absence of idle download thread and take out Live stream downloading task, the downloading that live stream downloading task is broadcast live stream is executed by the idle download thread distributed.
7. download server according to claim 6, it is characterised in that:
The downloading task allocation unit is also used to control downloading task distribution thread in the idle thread list not When in the presence of idle download thread, judge whether the total quantity of current download thread reaches number of threads threshold value, if not up to, Then create the live stream downloading task that download thread processing is taken out.
8. download server according to claim 7, it is characterised in that:
The downloading task allocation unit is also used to control the downloading task distribution thread and is judging the total of current download thread When quantity reaches the number of threads threshold value, waiting list is added in the downloading task of taking-up, waiting has live stream downloading task After the completion, idle download thread is distributed to be handled.
9. download server according to claim 7 or 8, it is characterised in that:
The downloading task allocation unit, being also used to control the downloading task distribution thread, there is no live streams in the initial stage In the case where downloading task, download thread is not created, there are live stream downloading task and without download thread, is just created Build download thread.
10. download server according to claim 9, which is characterized in that described in the downloading task allocation unit control Downloading task distributes the thread distribution live stream downloading task that idle download thread processing is taken out, comprising:
It controls the downloading task distribution thread and distributes download thread one live stream downloading task of processing.
CN201510883313.0A 2015-12-07 2015-12-07 A kind of method and download server for downloading live stream Active CN105450551B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510883313.0A CN105450551B (en) 2015-12-07 2015-12-07 A kind of method and download server for downloading live stream

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510883313.0A CN105450551B (en) 2015-12-07 2015-12-07 A kind of method and download server for downloading live stream

Publications (2)

Publication Number Publication Date
CN105450551A CN105450551A (en) 2016-03-30
CN105450551B true CN105450551B (en) 2019-04-09

Family

ID=55560346

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510883313.0A Active CN105450551B (en) 2015-12-07 2015-12-07 A kind of method and download server for downloading live stream

Country Status (1)

Country Link
CN (1) CN105450551B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106412624A (en) * 2016-09-29 2017-02-15 天脉聚源(北京)科技有限公司 Method and device for downloading streaming media data
CN106375337B (en) * 2016-09-30 2019-12-06 杭州迪普科技股份有限公司 Message interaction method and device based on multithreading
CN106790525A (en) * 2016-12-20 2017-05-31 广东小天才科技有限公司 File downloading method and device
CN110333947B (en) * 2019-05-23 2023-06-16 深圳市腾讯网域计算机网络有限公司 Method, device, equipment and medium for loading subcontracting resources of game application
CN113573080B (en) * 2021-06-28 2023-09-29 北京百度网讯科技有限公司 Live broadcast recording method and device, electronic equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760082A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Method for managing task and mobile terminal
CN103905515A (en) * 2012-12-28 2014-07-02 北大方正集团有限公司 Distributed Internet information downloading system and method
CN104881307A (en) * 2015-05-15 2015-09-02 广东小天才科技有限公司 Method and device for realizing downloading

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6535878B1 (en) * 1997-05-02 2003-03-18 Roxio, Inc. Method and system for providing on-line interactivity over a server-client network
US8639772B2 (en) * 2010-02-16 2014-01-28 Iboard Incorporated Centralized application resource manager

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102760082A (en) * 2011-04-29 2012-10-31 腾讯科技(深圳)有限公司 Method for managing task and mobile terminal
CN103905515A (en) * 2012-12-28 2014-07-02 北大方正集团有限公司 Distributed Internet information downloading system and method
CN104881307A (en) * 2015-05-15 2015-09-02 广东小天才科技有限公司 Method and device for realizing downloading

Also Published As

Publication number Publication date
CN105450551A (en) 2016-03-30

Similar Documents

Publication Publication Date Title
CN105450551B (en) A kind of method and download server for downloading live stream
CN104168303B (en) A kind of method and apparatus shown between network direct broadcasting
US9800691B2 (en) Stream processing using a client-server architecture
CN104539977B (en) Method for previewing and device is broadcast live
WO2017101488A1 (en) Real-time transcoding monitoring method and real-time transcoding system
US10942792B2 (en) Event driven subscription matching
JP2009503680A (en) Dynamic balancing of user experience in multi-user computing systems
EP3021556A1 (en) Transmission method and device for media stream in video conference
US20140215545A1 (en) Online video playing method and video playing server
US9769239B2 (en) Systems and methods for user agent signaling request acceleration by transport accelerator
CN108540868A (en) Processing method, device, server, terminal and the storage medium of HLS live streamings
JP2009524346A5 (en)
WO2016074326A1 (en) Channel switching method, apparatus and system
CN113794909A (en) Video streaming system, method, server, device, and storage medium
US20160294903A1 (en) Method and device for pushing resources to mobile communication terminal by smart television
CN111611523B (en) Resource management system, resource management method, device and storage medium
CN102591658A (en) Method and device for processing message
US10075538B2 (en) Methods and systems for delivering content
CN115209231A (en) Data transmission method, device, equipment and computer readable storage medium
CN113225607B (en) Method and system for displaying gift in live broadcast room
CN101577736A (en) Method and device for uploading files
CN108924630A (en) A kind of method and playback equipment of display caching progress
CN112839239B (en) Audio and video processing method and device and server
CN110392277A (en) A kind of content recording method, device, equipment and the storage medium of live video
CN110149524A (en) Live stream slice systems, live stream dicing method, device and readable medium

Legal Events

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